PACKET.INTERNET.IPV4(1) packet.internet.ipv4 1.0.1 PACKET.INTERNET.IPV4(1)NAME
packet.internet.ipv4 - IPv4 module
DESCRIPTION
Decode IP version 4 layer.
CLASSES
class IPv4(baseobj.BaseObj, packet.unpack.Unpack)
IPv4 object
Usage:
from packet.internet.ipv4 import IPv4
x = IPv4(pktt, buffer)
Object definition:
IPv4(
version = int,
IHL = int,
header_size = int,
total_size = int,
id = int,
fragment_offset = int,
TTL = int,
protocol = int,
checksum = int,
src = "%d.%d.%d.%d", # source IP address
dst = "%d.%d.%d.%d", # destination IP address
TOS = TOS(
precedence = int,
delay = int,
throughput = int,
reliability = int,
monetary_cost = int,
),
DSCP = int,
ECN = int,
flags = Flags(
DF = int,
MF = int,
)
options = string, # IP options if available
data = string, # Raw data of payload if protocol
# is not supported )
Methods defined here:
---------------------
__init__(self, pktt, data)
Constructor
Initialize object's private data.
pktt: Packet trace object (packet.pktt.Pktt) so this layer has
access to the parent layers.
data: Raw packet data for this layer.
__str__(self)
String representation of object
The representation depends on the verbose level set by
debug_repr(). If set to 0 the generic object representation is
returned. If set to 1 the representation of the object is con‐
densed:
'192.168.0.20 -> 192.168.0.61 '
If set to 2 the representation of the object also includes the
protocol and length of payload:
'192.168.0.20 -> 192.168.0.61, protocol: 17(UDP), len: 84'
SEE ALSObaseobj(1), packet.transport.tcp(1), packet.unpack(1)BUGS
No known bugs.
AUTHOR
Jorge Mora (mora@netapp.com)
NFStest 1.0.2 10 April 2013 PACKET.INTERNET.IPV4(1)