Package dpkt :: Module arp
[hide private]
[frames] | no frames]

Source Code for Module dpkt.arp

 1  # $Id: arp.py 23 2006-11-08 15:45:33Z dugsong $ 
 2   
 3  """Address Resolution Protocol.""" 
 4   
 5  import dpkt 
 6   
 7  # Hardware address format 
 8  ARP_HRD_ETH     = 0x0001        # ethernet hardware 
 9  ARP_HRD_IEEE802 = 0x0006        # IEEE 802 hardware 
10   
11  # Protocol address format 
12  ARP_PRO_IP      = 0x0800        # IP protocol 
13   
14  # ARP operation 
15  ARP_OP_REQUEST          = 1     # request to resolve ha given pa 
16  ARP_OP_REPLY            = 2     # response giving hardware address 
17  ARP_OP_REVREQUEST       = 3     # request to resolve pa given ha 
18  ARP_OP_REVREPLY         = 4     # response giving protocol address 
19   
20 -class ARP(dpkt.Packet):
21 __hdr__ = ( 22 ('hrd', 'H', ARP_HRD_ETH), 23 ('pro', 'H', ARP_PRO_IP), 24 ('hln', 'B', 6), # hardware address length 25 ('pln', 'B', 4), # protocol address length 26 ('op', 'H', ARP_OP_REQUEST), 27 ('sha', '6s', ''), 28 ('spa', '4s', ''), 29 ('tha', '6s', ''), 30 ('tpa', '4s', '') 31 )
32