1IPV4(3)                            ipv4 1.1                            IPV4(3)
2
3
4

NAME

6       packet.internet.ipv4 - IPv4 module
7

DESCRIPTION

9       Decode IP version 4 layer.
10

CLASSES

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           data = string,    # Raw data of payload if protocol
52                             # is not supported
53       )
54
55
56       Methods defined here:
57       ---------------------
58
59       __init__(self, pktt)
60       Constructor
61
62       Initialize object's private data.
63
64
65              pktt:  Packet trace object (packet.pktt.Pktt) so this layer has
66                     access to the parent layers.
67
68       __str__(self)
69       String representation of object
70
71       The representation depends on the verbose level set by debug_repr().
72       If set to 0 the generic object representation is returned.
73       If set to 1 the representation of the object is condensed:
74           '192.168.0.20 -> 192.168.0.61 '
75
76       If set to 2 the representation of the object also includes the
77       protocol and length of payload:
78           '192.168.0.20 -> 192.168.0.61, protocol: 17(UDP), len: 84'
79

SEE ALSO

81       baseobj(3),      packet.transport.tcp(3),      packet.transport.udp(3),
82       packet.utils(3)
83
84

BUGS

86       No known bugs.
87

AUTHOR

89       Jorge Mora (mora@netapp.com)
90
91
92
93NFStest 2.1.5                  14 February 2017                        IPV4(3)
Impressum