| Home | Trees | Index | Help |
|
|---|
| Package dpkt :: Module dpkt :: Class Packet |
|
object --+
|
Packet
Accept,
ActivateCallPlane,
Address,
Aggregator,
AH,
ARP,
ASPath,
ASPathSegment,
AtomicAggregate,
Attribute,
Auth,
Auth,
Authentication,
AVP,
BGP,
BGP4MPMessage,
Call,
CallInfo,
CallState,
Capability,
CDP,
Chunk,
ClearPromptStatus,
CloseReceiveChannel,
ClusterList,
Communities,
Community,
Datagram,
DHCP,
Diameter,
DisplayPromptStatus,
DisplayText,
DNS,
DTP,
Echo,
Echo,
Error,
ESP,
Ethernet,
FileHdr,
FLAP,
GRE,
Gzip,
GzipExtra,
H225,
HSRP,
ICMP,
ICMP6,
IE,
IGMP,
IP,
IP6,
IPX,
Keepalive,
KeypadButton,
LocalPref,
Loopback,
Message,
MPReachNLRI,
MPUnreachNLRI,
MRTHeader,
MultiExitDisc,
NetflowBase,
NetflowRecordBase,
NextHop,
Notification,
NTP,
Open,
OpenReceiveChannel,
OpenReceiveChannelAck,
Origin,
OriginatorID,
OSPF,
Parameter,
PIM,
PktHdr,
Pmap,
PPP,
PPPoE,
Q,
QQ3Packet,
QQ5Packet,
QQBasicPacket,
Quote,
RADIUS,
Reject,
Reply,
ReservedCommunity,
RIP,
RouteGeneric,
RouteIPV4,
RouteIPV6,
RouteRefresh,
RPC,
RTE,
RTP,
SCCP,
SCTP,
SelectStartKeys,
Session,
SetLamp,
SetSpeakerMode,
SLL,
SMB,
SNAC,
SRE,
SSL2,
SSL3,
StartMediaTransmission,
StartTone,
StopMediaTransmission,
STP,
STUN,
TCP,
TFTP,
TLV,
TNS,
TPKT,
UDP,
Update,
VRRP,
YHOO,
YMSG
Base packet class, with metaclass magic to generate members from
self.__hdr__.
__hdr__ should be defined as a list of (name, structfmt, default) tuples
__byte_order__ can be set to override the default ('>')
Example::
>>> class Foo(Packet):
... __hdr__ = (('foo', 'I', 1), ('bar', 'H', 2), ('baz', '4s', 'quux'))
...
>>> foo = Foo(bar=3)
>>> foo
Foo(bar=3)
>>> str(foo)
' quux'
>>> foo.bar
3
>>> foo.baz
'quux'
>>> foo.foo = 7
>>> foo.baz = 'whee'
>>> foo
Foo(baz='whee', foo=7, bar=3)
>>> Foo('hello, world!')
Foo(baz=' wor', foo=1751477356L, bar=28460, data='ld!')
| Method Summary | |
|---|---|
Packet constructor with ([buf], [field=val,...]) prototype. | |
__getitem__(self,
k)
| |
__len__(self)
| |
__repr__(self)
| |
__str__(self)
| |
Return packed header + self.data string. | |
Return packed header string. | |
Unpack packet header fields from buf, and set self.data. | |
| Inherited from object | |
x.__delattr__('name') <==> del x.name... | |
x.__getattribute__('name') <==> x.name... | |
x.__hash__() <==> hash(x)... | |
T.__new__(S, ...) -> a new object with type S, a subtype of T... | |
helper for pickle... | |
helper for pickle... | |
x.__setattr__('name', value) <==> x.name = value... | |
| Class Variable Summary | |
|---|---|
type |
__metaclass__ = dpkt.dpkt._MetaPacket |
| Method Details |
|---|
__init__(self,
*args,
**kwargs)
|
pack(self)Return packed header + self.data string. |
pack_hdr(self)Return packed header string. |
unpack(self, buf)Unpack packet header fields from buf, and set self.data. |
| Home | Trees | Index | Help |
|
|---|
| Generated by Epydoc 2.1 on Sun Oct 1 11:24:15 2006 | http://epydoc.sf.net |