Package dpkt :: Module ip :: Class IP
[hide private]
[frames] | no frames]

Class IP

source code

 object --+    
          |    
dpkt.Packet --+
              |
             IP

Nested Classes [hide private]

Inherited from dpkt.Packet: __metaclass__

Instance Methods [hide private]
 
_get_v(self) source code
 
_set_v(self, v) source code
 
_get_hl(self) source code
 
_set_hl(self, hl) source code
 
__len__(self) source code
 
__str__(self)
str(x)
source code
 
unpack(self, buf)
Unpack packet header fields from buf, and set self.data.
source code

Inherited from dpkt.Packet: __getitem__, __init__, __repr__, pack, pack_hdr

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__

Class Methods [hide private]
 
set_proto(cls, p, pktclass) source code
 
get_proto(cls, p) source code
Class Variables [hide private]
  __hdr__ = (('v_hl', 'B', 69), ('tos', 'B', 0), ('len', 'H', 20...
  _protosw = {0: <class 'dpkt.ip.IP'>, 1: <class 'dpkt.icmp.ICMP...
  opts = ''
  __hdr_defaults__ = {'dst': '\x00\x00\x00\x00', 'id': 0, 'len':...
  __hdr_fields__ = ['v_hl', 'tos', 'len', 'id', 'off', 'ttl', 'p...
  __hdr_fmt__ = '>BBHHHBBH4s4s'
  __hdr_len__ = 20
Properties [hide private]
  v
  hl

Inherited from object: __class__

Method Details [hide private]

__len__(self)
(Length operator)

source code 
Overrides: dpkt.Packet.__len__

__str__(self)
(Informal representation operator)

source code 
str(x)

Overrides: object.__str__
(inherited documentation)

unpack(self, buf)

source code 
Unpack packet header fields from buf, and set self.data.

Overrides: dpkt.Packet.unpack
(inherited documentation)

Class Variable Details [hide private]

__hdr__

Value:
(('v_hl', 'B', 69),
 ('tos', 'B', 0),
 ('len', 'H', 20),
 ('id', 'H', 0),
 ('off', 'H', 0),
 ('ttl', 'B', 64),
 ('p', 'B', 0),
 ('sum', 'H', 0),
...

_protosw

Value:
{0: <class 'dpkt.ip.IP'>,
 1: <class 'dpkt.icmp.ICMP'>,
 2: <class 'dpkt.igmp.IGMP'>,
 6: <class 'dpkt.tcp.TCP'>,
 17: <class 'dpkt.udp.UDP'>,
 41: <class 'dpkt.ip6.IP6'>,
 47: <class 'dpkt.gre.GRE'>,
 50: <class 'dpkt.esp.ESP'>,
...

__hdr_defaults__

Value:
{'dst': '\x00\x00\x00\x00',
 'id': 0,
 'len': 20,
 'off': 0,
 'p': 0,
 'src': '\x00\x00\x00\x00',
 'sum': 0,
 'tos': 0,
...

__hdr_fields__

Value:
['v_hl', 'tos', 'len', 'id', 'off', 'ttl', 'p', 'sum', 'src', 'dst']

Property Details [hide private]

v

Get Method:
_get_v(self)
Set Method:
_set_v(self, v)

hl

Get Method:
_get_hl(self)
Set Method:
_set_hl(self, hl)