PYNETLIBSpnl Logo

Introduction

what is pynetlibs and why?: 

py(thon)net(work)lib(rary)s is a module written to dissect and check network packets as return by tcpdump.
once you have a packet choose what function in the module is corrected to dissect it.
original packet is a string and values are returned in the form of a structurated tuple.

every functions accept at least two arguments: a pointer to the packet and the offset.

        the pointer is a packet data reference; offset is the byte position to start dissection

basicaly functions return two values: dissected data and update-offset

        dissect data is a tuple of values representing protocol-dependent field values; update-offset is the updated position of next protocol data

Here is the list of available functions:


captured_time, truncated = info(lib_pcap_header)

data, offset = ppp_dissect(packet,offset)
data, offset = ppp_lcp_dissect(packet,offset)
option_data = ppp_lcp_opn_dissect(packet,offset)
data, offset = ppp_chap_dissect(packet,offset)
data, offset = ppp_pap_dissect(packet,offset)
data, offset = ppp_lqr_dissect(packet,offset)
data, offset = ppp_ipcp_dissect(packet,offset)
option_data = ppp_ipcp_opn_dissect(packet,offset)
data, offset = ppp_ip6cp_dissect(packet,offset)
option_data = ppp_ip6cp_opn_dissect(packet,offset)
data, offset = ppp_oe_dissect(packet,offset)
option_data = ppp_oe_tag_dissect(packet,offset)

data, offset = eth_dissect(packet,offset)
data, offset = arp_dissect(packet,offset)
data, offset = eth_ip_dissect(packet,offset)
data, offset = ip4_dissect(packet,offset)
option_data = ip4_opn_dissect(packet,offset)
data, offset = icmp_dissect(packet,offset)
data, offset = tcp_dissect(packet,offset)
option_data = tcp_opn_dissect(packet,offset)
data, offset = udp_dissect(packet,offset)
data, offset = igmp_dissect(packet,offset)
data, offset = pim_dissect(packet,offset)
option_data = pim_opn_dissect(packet,offset)
data, offset = ip6_dissect(packet,offset)
data, offset = hbh_dissect(packet,offset)
data, offset = dst_dissect(packet,offset)
data, offset = rtg_dissect(packet,offset)
data, offset = frg_dissect(packet,offset)
data, offset = auth_dissect(packet,offset)
data, offset = esp_dissect(packet,offset)
option_data = ip6_opn_dissect(packet,offset)
data, offset = icmp6_dissect(packet,offset)
option_data = icmp6_opn_dissect(packet,offset)
data, offset = dns_dissect(packet,offset)


chk <boolean> = ip4_cksum(packet,offset,ip_header_length)

chk <boolean> = icmp_cksum(packet,offset)
chk <boolean> = icmp6_cksum(packet,offset)
chk <boolean> = igmp_cksum(packet,offset)
chk <boolean> = tcp_cksum(packet,offset)
chk <boolean> = udp_cksum(packet,offset)
chk <boolean> = pim_cksum(packet,offset)
chk <boolean> = fcs16(packet)
chk <boolean> = fcs32(packet)

dot:quo:ted:add:res:s <string>     = haddr2dot(hardware_address_string)
dot.quoted.addr.ess <string>       = addr42dot(ip4_address_string)
do:t:qu:ot:ed:ad:dr:es::s <string> = addr62dot(ip6_address_string)


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