HOME


NAME

arp_dissect - an address resolution protocol dissect function

SYNOPSIS

data,offset=arp_dissect(pkt,offset)

DESCRIPTION

dissect address resolution protocol

              ARP Header
    0                   1
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |            HW Type            |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |           Protocol            |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   | HW  ADDR Len  | Proto Length  |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |           OP Code             |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   /      Sender HW Address        /
   /                               /
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   /      Sender IP Address        /
   /                               /
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   /      Target HW Address        /
   /                               /
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   /      Target IP Address        /
   /                               /
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      reference RFC 826, 1293

funtion accepts two arguments:
    pkt is a packet reference containing the whole packet to be dissect
    offset is the position inside packet to start dissection

funtion return two values:
    data is a 9 long tuple:

harware type
protocol
hardware address length
protocol length
operation code
sender hardware address
sender ip address
target hardware address
target ip address

    offset is the original offset plus arp_header_lenght

ADDITIONAL
sender IP address and target IP address are returned in the form of string
to convert to dot quotation use addr42dot(address)
same way to convert sender hardware address and target hardware address
use haddr2dot(address )

HOME


This document was generated by paolo bastiancich on January, 16 2003 using texi2html