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

Class IP

source code

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

Internet Protocol.

TODO: Longer class information....

Attributes:
    __hdr__: Header fields of IP.
    TODO.

Instance Methods [hide private]
 
__init__(self, *args, **kwargs)
Packet constructor with ([buf], [field=val,...]) prototype.
source code
 
__len__(self) source code
 
__bytes__(self) source code
 
unpack(self, buf)
Unpack packet header fields from buf, and set self.data.
source code

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

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

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', 2...
  _protosw = {0: <class 'dpkt.ip.IP'>, 1: <class 'dpkt.icmp.ICMP...
  opts = ''
  __hdr_defaults__ = {'_v_hl': 69, 'dst': '\x00\x00\x00\x00', 'i...
  __hdr_fields__ = ['_v_hl', 'tos', 'len', 'id', 'off', 'ttl', '...
  __hdr_fmt__ = '>BBHHHBBH4s4s'
  __hdr_len__ = 20
Properties [hide private]
  v
  hl
  rf
  df
  mf
  offset
  _v_hl
  data
  dst
  id
  len
  off
  p
  src
  sum
  tos
  ttl

Inherited from object: __class__

Method Details [hide private]

__init__(self, *args, **kwargs)
(Constructor)

source code 
Packet constructor with ([buf], [field=val,...]) prototype.

Arguments:

buf -- optional packet buffer to unpack

Optional keyword arguments correspond to members to set
(matching fields in self.__hdr__, or 'data').

Overrides: object.__init__
(inherited documentation)

__len__(self)
(Length operator)

source code 
Overrides: dpkt.Packet.__len__

__bytes__(self)

source code 
Overrides: dpkt.Packet.__bytes__

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'>,
 4: <class 'dpkt.ip.IP'>,
 6: <class 'dpkt.tcp.TCP'>,
 17: <class 'dpkt.udp.UDP'>,
 41: <class 'dpkt.ip6.IP6'>,
 47: <class 'dpkt.gre.GRE'>,
...

__hdr_defaults__

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

__hdr_fields__

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

Property Details [hide private]

v

Get Method:
unreachable.v(self)
Set Method:
unreachable.v(self, v)

hl

Get Method:
unreachable.hl(self)
Set Method:
unreachable.hl(self, hl)

rf

Get Method:
unreachable.rf(self)
Set Method:
unreachable.rf(self, rf)

df

Get Method:
unreachable.df(self)
Set Method:
unreachable.df(self, df)

mf

Get Method:
unreachable.mf(self)
Set Method:
unreachable.mf(self, mf)

offset

Get Method:
unreachable.offset(self)
Set Method:
unreachable.offset(self, offset)