• Home
  • Raw
  • Download

Lines Matching refs:packet

83         for packet in self.cleanup_releases:
84 self._send(packet)
150 def _handle_arp(self, packet): argument
152 if packet[ARP].op == ARP.who_has:
153 reply = ARP(op=ARP.is_at, hwsrc=self.real_hwaddr, psrc=packet.pdst,
889 def _get_response(self, packet): argument
890 resp = srp1(packet, iface=self.iface, timeout=10, verbose=False)
899 def _send(self, packet): argument
900 sendp(packet, iface=self.iface, verbose=False)
902 def _assert_type(self, packet, tp): argument
903 asserts.assert_false(None == packet, "No packet")
904 asserts.assert_equal(tp, get_mess_type(packet))
906 def _assert_ack(self, packet): argument
907 self._assert_type(packet, ACK)
909 def _assert_nak(self, packet): argument
910 self._assert_type(packet, NAK)
912 def _assert_offer(self, packet): argument
913 self._assert_type(packet, OFFER)
915 def _assert_broadcast(self, packet): argument
916 asserts.assert_false(None == packet, "No packet")
917 asserts.assert_equal(packet.getlayer(Ether).dst, BROADCAST_MAC)
918 asserts.assert_equal(packet.getlayer(IP).dst, NETADDR_BROADCAST)
919 self._assert_broadcastbit(packet)
921 def _assert_broadcastbit(self, packet, isset=True): argument
923 flag = packet.getlayer(BOOTP).flags
926 def _assert_unicast(self, packet, ipAddr=None): argument
927 asserts.assert_false(None == packet, "No packet")
928 asserts.assert_false(packet.getlayer(Ether).dst == BROADCAST_MAC,
931 asserts.assert_equal(packet.getlayer(IP).dst, ipAddr)
933 def _assert_relayed(self, packet, giaddr): argument
934 self._assert_unicast(packet, giaddr)
935 asserts.assert_equal(giaddr, packet.getlayer(BOOTP).giaddr,
1021 def setopt(packet, optname, val): argument
1022 dhcp = packet.getlayer(DHCP)
1031 def getopt(packet, key): argument
1032 opts = [opt[1] for opt in packet.getlayer(DHCP).options if opt[0] == key]
1036 def removeopt(packet, key): argument
1037 dhcp = packet.getlayer(DHCP)
1041 def get_opt_labels(packet): argument
1042 dhcp_resp = packet.getlayer(DHCP)
1048 def get_yiaddr(packet): argument
1049 return packet.getlayer(BOOTP).yiaddr
1052 def get_chaddr(packet): argument
1054 return packet.getlayer(BOOTP).chaddr[:6]
1057 def get_mess_type(packet): argument
1058 return getopt(packet, 'message-type')