Package tp :: Package netlib :: Package objects :: Module Header :: Class Header
[show private | hide private]
[frames | no frames]

Type Header

object --+
         |
        Header

Known Subclasses:
Processed

Base class for all packets.

Includes all the common parts for the packets.

The class can be instansated however it will morph into
into the correct packet type once the process function
is called with data.

Example:

        p = Header(data)
        str(p)
        '<Object instance at 0x401ee50c>'

Method Summary
  __init__(self, protocol, sequence, type, length)
Create a new header object.
  __eq__(self, other)
  __repr__(self)
Return a reconisable string.
  __str__(self)
Produce a string suitable to be send over the wire.
  data_set(self, data)
Processes the data of the packet.
  fromstr(cls, data)
Look at the packet type and morph this object into the correct type. (Class method)
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name...
  __getattribute__(...)
x.__getattribute__('name') <==> x.name...
  __hash__(x)
x.__hash__() <==> hash(x)...
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T...
  __reduce__(...)
helper for pickle...
  __reduce_ex__(...)
helper for pickle...
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value...

Class Variable Summary
int size = 16                                                                    
str struct = '4sIII'
classobj VersionError = tp.netlib.objects.Header.VersionError

Instance Method Details

__init__(self, protocol, sequence, type, length)
(Constructor)

Create a new header object.

It takes a string which contains the "header" data.
Overrides:
__builtin__.object.__init__

__repr__(self)
(Representation operator)

Return a reconisable string.
Overrides:
__builtin__.object.__repr__

__str__(self)
(Informal representation operator)

Produce a string suitable to be send over the wire.
Overrides:
__builtin__.object.__str__

data_set(self, data=None)

Processes the data of the packet.

Class Method Details

fromstr(cls, data)

Look at the packet type and morph this object into the
correct type.

Class Variable Details

size

Type:
int
Value:
16                                                                    

struct

Type:
str
Value:
'4sIII'                                                                

Generated by Epydoc 2.1 on Fri Jan 1 08:00:27 2010 http://epydoc.sf.net