def pns_join (self, left): if ip_peer.ip2long ( left ) & self.pns_netmask == self.pns_netmask: Circle.pns_join (self, left) return self.log ('pns-join-drop ip="%s"' % left, 'error')
def pns_joined (self, right): if ip_peer.ip2long ( right[0] ) & self.pns_netmask == self.pns_netmask: Circle.pns_joined (self, right) return # TODO: ban ? self.log ('joined-drop ip="%s"' % right[0], 'error')
from allegra import loginfo, ip_peer s = ip_peer.host_ip loginfo.log ('%r' % s) loginfo.log ('%r' % ip_peer.is_ip (s)) l = ip_peer.ip2long (s) loginfo.log ('%r' % l) loginfo.log ('%r' % (ip_peer.long2ip (l))) loginfo.log ('%r' % ip_peer.in_addr_arpa (s))
def __init__ (self, pns_peer, name, subscribers): self.pns_netmask = ip_peer.ip2long (name) Circle.__init__ (self, pns_peer, name, subscribers)
from allegra import loginfo, ip_peer s = ip_peer.host_ip loginfo.log('%r' % s) loginfo.log('%r' % ip_peer.is_ip(s)) l = ip_peer.ip2long(s) loginfo.log('%r' % l) loginfo.log('%r' % (ip_peer.long2ip(l))) loginfo.log('%r' % ip_peer.in_addr_arpa(s))