def _handle_packet(mac, address, packet): """Do something with a SYN for the other machine!""" if not (IP in packet and TCP in packet): return if packet[IP].dst != address: logging.debug("Sniffed a TCP SYN for the wrong address?: %s" % packet.show() ) return #logging.debug(packet.display()) sleepproxy.manager.mdns.forget(mac) # pre-emptively drop adv to keep the mac from de-colliding its name sleep(0.4) wake(mac) #retry=15?
def _handle_packet(mac, address, packet): """Do something with a SYN for the other machine!""" if not (IP in packet and TCP in packet): return if packet[IP].dst != address: logging.debug("Sniffed a TCP SYN for the wrong address?: {}".format( packet.show()) ) return #logging.debug(packet.display()) sleepproxy.manager.mdns.forget(mac) # pre-emptively drop adv to keep the mac from de-colliding its name sleep(0.4) wake(mac) #retry=15?
def _handle_packet(mac, address, packet): """Do something with a SYN for the other machine!""" if not (IP in packet and TCP in packet): return if packet[IP].dst != address: print "Sniffed a TCP SYN for the wrong address!?" print packet.show() return wake(mac) # TODO: Check if it awoke? sleepproxy.manager.forget_host(mac)
def _handle_packet(mac, address, packet): """Do something with a SYN for the other machine!""" if not (IP in packet and TCP in packet): return if packet[IP].dst != address: logging.debug("Sniffed a TCP SYN for the wrong address?: %s" % packet.show()) return logging.info( "Got SYN packet from %s:%s > %s:%s" % (packet[IP].src, packet[TCP].sport, packet[IP].dst, packet[TCP].dport)) logging.debug(packet.display(True)) sleepproxy.manager.mdns.forget( mac ) # pre-emptively drop adv to keep the mac from de-colliding its name sleep(0.4) wake(mac) #retry=15?