1IPV4(3) ipv4 1.3 IPV4(3)
2
3
4
6 packet.internet.ipv4 - IPv4 module
7
9 Decode IP version 4 layer.
10
12 class Flags(baseobj.BaseObj)
13 Flags object
14
15
16 Methods defined here:
17 ---------------------
18
19 __init__(self, data)
20 Constructor which takes a single byte as input
21
22 class IPv4(baseobj.BaseObj)
23 IPv4 object
24
25 Usage:
26 from packet.internet.ipv4 import IPv4
27
28 x = IPv4(pktt)
29
30 Object definition:
31
32 IPv4(
33 version = int,
34 IHL = int, # Internet Header Length (in 32bit words)
35 header_size = int, # IHL in actual bytes
36 DSCP = int, # Differentiated Services Code Point
37 ECN = int, # Explicit Congestion Notification
38 total_size = int, # Total length
39 id = int, # Identification
40 flags = Flags( # Flags:
41 DF = int, # Don't Fragment
42 MF = int, # More Fragments
43 )
44 fragment_offset = int, # Fragment offset (in 8-byte blocks)
45 TTL = int, # Time to Live
46 protocol = int, # Protocol of next layer (RFC790)
47 checksum = int, # Header checksum
48 src = "%d.%d.%d.%d", # source IP address
49 dst = "%d.%d.%d.%d", # destination IP address
50 options = string, # IP options if available
51 psize = int # Payload data size
52 data = string, # Raw data of payload if protocol
53 # is not supported
54 )
55
56
57 Methods defined here:
58 ---------------------
59
60 __init__(self, pktt)
61 Constructor
62
63 Initialize object's private data.
64
65
66 pktt: Packet trace object (packet.pktt.Pktt) so this layer has
67 access to the parent layers.
68
69 __str__(self)
70 String representation of object
71
72 The representation depends on the verbose level set by debug_repr().
73 If set to 0 the generic object representation is returned.
74 If set to 1 the representation of the object is condensed:
75 '192.168.0.20 -> 192.168.0.61 '
76
77 If set to 2 the representation of the object also includes the
78 protocol and length of payload:
79 '192.168.0.20 -> 192.168.0.61, protocol: 17(UDP), len: 84'
80
82 baseobj(3), packet.transport.tcp(3), packet.transport.udp(3),
83 packet.utils(3)
84
85
87 No known bugs.
88
90 Jorge Mora (mora@netapp.com)
91
92
93
94NFStest 3.2 21 March 2023 IPV4(3)