layer567 Package

bgp Module

Border Gateway Protocol.

class pypacker.layer567.bgp.BGP(*args, **kwargs)

Bases: pypacker.pypacker.Packet

class Keepalive(*args, **kwargs)

Bases: pypacker.pypacker.Packet

class BGP.Notification(*args, **kwargs)

Bases: pypacker.pypacker.Packet

__hdr__ = (('code', 'B', 0), ('subcode', 'B', 0))
code = 0
subcode = 0
class BGP.Open(*args, **kwargs)

Bases: pypacker.pypacker.Packet

class Parameter(*args, **kwargs)

Bases: pypacker.pypacker.Packet

__hdr__ = (('type', 'B', 0), ('len', 'B', 0))
len = 0
type = 0
BGP.Open.__hdr__ = (('v', 'B', 4), ('asn', 'H', 0), ('holdtime', 'H', 0), ('identifier', 'I', 0), ('param_len', 'B', 0), ('params', None, <class 'pypacker.triggerlist.TriggerList'>))
BGP.Open.asn = 0
BGP.Open.holdtime = 0
BGP.Open.identifier = 0
BGP.Open.param_len = 0
BGP.Open.v = 4
class BGP.RouteRefresh(*args, **kwargs)

Bases: pypacker.pypacker.Packet

__hdr__ = (('afi', 'H', 1), ('rsvd', 'B', 0), ('safi', 'B', 1))
afi = 1
rsvd = 0
safi = 1
class BGP.Update(*args, **kwargs)

Bases: pypacker.pypacker.Packet

class Attribute(*args, **kwargs)

Bases: pypacker.pypacker.Packet

class ASPath(*args, **kwargs)

Bases: pypacker.pypacker.Packet

class ASPathSegment(*args, **kwargs)

Bases: pypacker.pypacker.Packet

__hdr__ = (('type', 'B', 0), ('len', 'B', 0))
len = 0
type = 0
BGP.Update.Attribute.ASPath.__hdr__ = (('segments', None, <class 'pypacker.triggerlist.TriggerList'>),)
class BGP.Update.Attribute.Aggregator(*args, **kwargs)

Bases: pypacker.pypacker.Packet

__hdr__ = (('asn', 'H', 0), ('ip', 'I', 0))
asn = 0
ip = 0
class BGP.Update.Attribute.AtomicAggregate(*args, **kwargs)

Bases: pypacker.pypacker.Packet

class BGP.Update.Attribute.ClusterList(*args, **kwargs)

Bases: pypacker.pypacker.Packet

class BGP.Update.Attribute.Communitie(*args, **kwargs)

Bases: pypacker.pypacker.Packet

class BGP.Update.Attribute.LocalPref(*args, **kwargs)

Bases: pypacker.pypacker.Packet

__hdr__ = (('value', 'I', 0),)
value = 0
class BGP.Update.Attribute.MPReachNLRI(*args, **kwargs)

Bases: pypacker.pypacker.Packet

__hdr__ = (('afi', 'H', 1), ('safi', 'B', 1))
afi = 1
safi = 1
class BGP.Update.Attribute.MPUnreachNLRI(*args, **kwargs)

Bases: pypacker.pypacker.Packet

__hdr__ = (('afi', 'H', 1), ('safi', 'B', 1))
afi = 1
safi = 1
class BGP.Update.Attribute.MultiExitDisc(*args, **kwargs)

Bases: pypacker.pypacker.Packet

__hdr__ = (('value', 'I', 0),)
value = 0
class BGP.Update.Attribute.NextHop(*args, **kwargs)

Bases: pypacker.pypacker.Packet

__hdr__ = (('ip', 'I', 0),)
ip = 0
class BGP.Update.Attribute.Origin(*args, **kwargs)

Bases: pypacker.pypacker.Packet

__hdr__ = (('type', 'B', 0),)
type = 0
class BGP.Update.Attribute.OriginatorID(*args, **kwargs)

Bases: pypacker.pypacker.Packet

__hdr__ = (('value', 'I', 0),)
value = 0
BGP.Update.Attribute.__hdr__ = (('flags', 'B', 0), ('type', 'B', 0), ('len', 'B', 0))
BGP.Update.Attribute.extended_length
BGP.Update.Attribute.flags = 0
BGP.Update.Attribute.len = 0
BGP.Update.Attribute.optional
BGP.Update.Attribute.partial
BGP.Update.Attribute.transitive
BGP.Update.Attribute.type = 0
BGP.Update.__hdr__ = (('unflen', 'H', 0), ('pathlen', 'H', 0), ('wroutes', None, <class 'pypacker.triggerlist.TriggerList'>), ('pathattrs', None, <class 'pypacker.triggerlist.TriggerList'>), ('anncroutes', None, <class 'pypacker.triggerlist.TriggerList'>))
BGP.Update.pathlen = 0
BGP.Update.unflen = 0
BGP.__hdr__ = (('marker', '16s', b'\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff'), ('len', 'H', 0), ('type', 'B', 1))
BGP.len = 0
BGP.marker = b'\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff'
BGP.type = 1
class pypacker.layer567.bgp.Route(*args, **kwargs)

Bases: pypacker.pypacker.Packet

__hdr__ = (('len', 'B', 0),)
len = 0

dhcp Module

Dynamic Host Configuration Protocol.

class pypacker.layer567.dhcp.DHCP(*args, **kwargs)

Bases: pypacker.pypacker.Packet

__hdr__ = (('op', 'B', 1), ('hrd', 'B', 1), ('hln', 'B', 6), ('hops', 'B', 0), ('xid', 'I', 3735928559), ('secs', 'H', 0), ('flags', 'H', 0), ('ciaddr', 'I', 0), ('yiaddr', 'I', 0), ('siaddr', 'I', 0), ('giaddr', 'I', 0), ('chaddr', '16s', b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'), ('sname', '64s', b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'), ('file', '128s', b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'), ('magic', 'I', 1669485411), ('opts', None, <class 'pypacker.triggerlist.TriggerList'>))
chaddr = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
ciaddr = 0
file = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
flags = 0
giaddr = 0
hln = 6
hops = 0
hrd = 1
magic = 1669485411
op = 1
secs = 0
siaddr = 0
sname = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
xid = 3735928559
yiaddr = 0
class pypacker.layer567.dhcp.DHCPOptMulti(*args, **kwargs)

Bases: pypacker.pypacker.Packet

__hdr__ = (('type', 'B', 0), ('len', 'B', 0))
len = 0
type = 0
class pypacker.layer567.dhcp.DHCPOptSingle(*args, **kwargs)

Bases: pypacker.pypacker.Packet

__hdr__ = (('type', 'B', 0),)
type = 0

diameter Module

Diameter.

class pypacker.layer567.diameter.AVP(*args, **kwargs)

Bases: pypacker.pypacker.Packet

__hdr__ = (('code', 'I', 0), ('flags', 'B', 0), ('len', '3s', b''))
code = 0
flags = 0
len = b''
mandatory_flag
protected_flag
vendor_flag
class pypacker.layer567.diameter.Diameter(*args, **kwargs)

Bases: pypacker.pypacker.Packet

__hdr__ = (('v', 'B', 1), ('len', '3s', 0), ('flags', 'B', 0), ('cmd', '3s', 0), ('app_id', 'I', 0), ('hop_id', 'I', 0), ('end_id', 'I', 0), ('avps', None, <class 'pypacker.triggerlist.TriggerList'>))
app_id = 0
cmd = 0
end_id = 0
error_flag
flags = 0
hop_id = 0
len = 0
proxiable_flag
request_flag
retransmit_flag
v = 1

dns Module

Domain Name System.

class pypacker.layer567.dns.DNS(*args, **kwargs)

Bases: pypacker.pypacker.Packet

class AddRecord(*args, **kwargs)

Bases: pypacker.pypacker.Packet

DNS additional records.

__hdr__ = (('name', None, <class 'pypacker.layer567.dns.DNSString'>), ('postfix', 'B', 0), ('type', 'H', 41), ('plen', 'H', 4096), ('rcode', 'B', 0), ('edns', 'B', 0), ('z', 'H', 0), ('dlen', 'H', 0))
dlen = 0
edns = 0
plen = 4096
postfix = 0
rcode = 0
type = 41
z = 0
class DNS.Answer(*args, **kwargs)

Bases: pypacker.pypacker.Packet

DNS resource record.

__hdr__ = (('name', 'H', 49164), ('type', 'H', 1), ('cls', 'H', 1), ('ttl', 'I', 180), ('dlen', 'H', 4), ('address', None, <class 'pypacker.triggerlist.TriggerList'>))
cls = 1
dlen = 4
name = 49164
ttl = 180
type = 1
class DNS.Auth(*args, **kwargs)

Bases: pypacker.pypacker.Packet

Auth, generic type.

__hdr__ = (('name', 'H', 0), ('type', 'H', 0), ('cls', 'H', 0), ('ttl', 'I', 0), ('dlen', 'H', 0), ('server', None, <class 'pypacker.layer567.dns.DNSString'>), ('postfix', 'B', 0))
cls = 0
dlen = 0
name = 0
postfix = 0
ttl = 0
type = 0
class DNS.AuthSOA(*args, **kwargs)

Bases: pypacker.pypacker.Packet

Auth type SOA.

__hdr__ = (('name', 'H', 0), ('type', 'H', 0), ('cls', 'H', 0), ('ttl', 'I', 0), ('dlen', 'H', 0), ('name', None, <class 'pypacker.layer567.dns.DNSString'>), ('postfix1', 'B', 0), ('mailbox', None, <class 'pypacker.layer567.dns.DNSString'>), ('postfix2', 'B', 0), ('pserver', 'H', 0), ('mbox', 'H', 0), ('serial', 'H', 0), ('refresh', 'H', 0), ('retry', 'H', 0), ('expire', 'H', 0), ('minttl', 'H', 0))
cls = 0
dlen = 0
expire = 0
mbox = 0
minttl = 0
name = 0
postfix1 = 0
postfix2 = 0
pserver = 0
refresh = 0
retry = 0
serial = 0
ttl = 0
type = 0
class DNS.Query(*args, **kwargs)

Bases: pypacker.pypacker.Packet

DNS question.

__hdr__ = (('name', None, <class 'pypacker.layer567.dns.DNSString'>), ('postfix', 'B', 0), ('type', 'H', 1), ('cls', 'H', 1))
cls = 1
postfix = 0
type = 1
DNS.__hdr__ = (('id', 'H', 4660), ('flags', 'H', 288), ('questions_amount', 'H', 0), ('answers_amount', 'H', 0), ('authrr_amount', 'H', 0), ('addrr_amount', 'H', 0), ('queries', None, <class 'pypacker.layer567.dns.DNSTriggerList'>), ('answers', None, <class 'pypacker.layer567.dns.DNSTriggerList'>), ('auths', None, <class 'pypacker.layer567.dns.DNSTriggerList'>), ('addrecords', None, <class 'pypacker.layer567.dns.DNSTriggerList'>))
DNS.addrr_amount = 0
DNS.answers_amount = 0
DNS.authrr_amount = 0
DNS.flags = 288
DNS.id = 4660
DNS.questions_amount = 0
class pypacker.layer567.dns.DNSString(lst=[], clz=None, packet=None)

Bases: pypacker.triggerlist.TriggerList

find_by_id(id)
class pypacker.layer567.dns.DNSTriggerList(lst=[], clz=None, packet=None)

Bases: pypacker.triggerlist.TriggerList

hsrp Module

Cisco Hot Standby Router Protocol.

class pypacker.layer567.hsrp.HSRP(*args, **kwargs)

Bases: pypacker.pypacker.Packet

__hdr__ = (('version', 'B', 0), ('opcode', 'B', 0), ('state', 'B', 0), ('hello', 'B', 0), ('hold', 'B', 0), ('priority', 'B', 0), ('group', 'B', 0), ('rsvd', 'B', 0), ('auth', '8s', b'cisco'), ('vip', '4s', b''))
auth = b'cisco'
group = 0
hello = 0
hold = 0
opcode = 0
priority = 0
rsvd = 0
state = 0
version = 0
vip = b''

http Module

Hypertext Transfer Protocol.

class pypacker.layer567.http.HTTP(*args, **kwargs)

Bases: pypacker.pypacker.Packet

__hdr__ = (('startline', None, <class 'pypacker.layer567.http.HTTPStartLine'>), ('header', None, <class 'pypacker.layer567.http.HTTPHeader'>))
class pypacker.layer567.http.HTTPHeader(lst=[], clz=None, packet=None)

Bases: pypacker.triggerlist.TriggerList

class pypacker.layer567.http.HTTPStartLine(lst=[], clz=None, packet=None)

Bases: pypacker.triggerlist.TriggerList

netflow Module

Cisco Netflow. TODO: currently not integrated!

class pypacker.layer567.netflow.Netflow1(*args, **kwargs)

Bases: pypacker.layer567.netflow.NetflowBase

Netflow Version 1.

class NetflowRecord(*args, **kwargs)

Bases: pypacker.layer567.netflow.NetflowRecordBase

Netflow v1 flow record.

__hdr__ = (('src_addr', 'I', 0), ('dst_addr', 'I', 0), ('next_hop', 'I', 0), ('input_iface', 'H', 0), ('output_iface', 'H', 0), ('pkts_sent', 'I', 0), ('bytes_sent', 'I', 0), ('start_time', 'I', 0), ('end_time', 'I', 0), ('src_port', 'H', 0), ('dst_port', 'H', 0), ('pad1', 'H', 0), ('ip_proto', 'B', 0), ('tos', 'B', 0), ('tcp_flags', 'B', 0), ('pad2', 'B', 0), ('pad3', 'H', 0), ('reserved', 'I', 0))
bytes_sent = 0
dst_addr = 0
dst_port = 0
end_time = 0
input_iface = 0
ip_proto = 0
next_hop = 0
output_iface = 0
pad1 = 0
pad2 = 0
pad3 = 0
pkts_sent = 0
reserved = 0
src_addr = 0
src_port = 0
start_time = 0
tcp_flags = 0
tos = 0
Netflow1.count = 0
Netflow1.sys_uptime = 0
Netflow1.unix_nsec = 0
Netflow1.unix_sec = 0
Netflow1.version = 1
class pypacker.layer567.netflow.Netflow5(*args, **kwargs)

Bases: pypacker.layer567.netflow.NetflowBase

Netflow Version 5.

class NetflowRecord(*args, **kwargs)

Bases: pypacker.layer567.netflow.NetflowRecordBase

Netflow v5 flow record.

__hdr__ = (('src_addr', 'I', 0), ('dst_addr', 'I', 0), ('next_hop', 'I', 0), ('input_iface', 'H', 0), ('output_iface', 'H', 0), ('pkts_sent', 'I', 0), ('bytes_sent', 'I', 0), ('start_time', 'I', 0), ('end_time', 'I', 0), ('src_port', 'H', 0), ('dst_port', 'H', 0), ('pad1', 'B', 0), ('tcp_flags', 'B', 0), ('ip_proto', 'B', 0), ('tos', 'B', 0), ('src_as', 'H', 0), ('dst_as', 'H', 0), ('src_mask', 'B', 0), ('dst_mask', 'B', 0), ('pad2', 'H', 0))
bytes_sent = 0
dst_addr = 0
dst_as = 0
dst_mask = 0
dst_port = 0
end_time = 0
input_iface = 0
ip_proto = 0
next_hop = 0
output_iface = 0
pad1 = 0
pad2 = 0
pkts_sent = 0
src_addr = 0
src_as = 0
src_mask = 0
src_port = 0
start_time = 0
tcp_flags = 0
tos = 0
Netflow5.__hdr__ = (('version', 'H', 1), ('count', 'H', 0), ('sys_uptime', 'I', 0), ('unix_sec', 'I', 0), ('unix_nsec', 'I', 0), ('flow_sequence', 'I', 0), ('engine_type', 'B', 0), ('engine_id', 'B', 0), ('reserved', 'H', 0))
Netflow5.count = 0
Netflow5.engine_id = 0
Netflow5.engine_type = 0
Netflow5.flow_sequence = 0
Netflow5.reserved = 0
Netflow5.sys_uptime = 0
Netflow5.unix_nsec = 0
Netflow5.unix_sec = 0
Netflow5.version = 1
class pypacker.layer567.netflow.Netflow6(*args, **kwargs)

Bases: pypacker.layer567.netflow.NetflowBase

Netflow Version 6. XXX - unsupported by Cisco, but may be found in the field.

class NetflowRecord(*args, **kwargs)

Bases: pypacker.layer567.netflow.NetflowRecordBase

Netflow v6 flow record.

__hdr__ = (('src_addr', 'I', 0), ('dst_addr', 'I', 0), ('next_hop', 'I', 0), ('input_iface', 'H', 0), ('output_iface', 'H', 0), ('pkts_sent', 'I', 0), ('bytes_sent', 'I', 0), ('start_time', 'I', 0), ('end_time', 'I', 0), ('src_port', 'H', 0), ('dst_port', 'H', 0), ('pad1', 'B', 0), ('tcp_flags', 'B', 0), ('ip_proto', 'B', 0), ('tos', 'B', 0), ('src_as', 'H', 0), ('dst_as', 'H', 0), ('src_mask', 'B', 0), ('dst_mask', 'B', 0), ('in_encaps', 'B', 0), ('out_encaps', 'B', 0), ('peer_nexthop', 'I', 0))
bytes_sent = 0
dst_addr = 0
dst_as = 0
dst_mask = 0
dst_port = 0
end_time = 0
in_encaps = 0
input_iface = 0
ip_proto = 0
next_hop = 0
out_encaps = 0
output_iface = 0
pad1 = 0
peer_nexthop = 0
pkts_sent = 0
src_addr = 0
src_as = 0
src_mask = 0
src_port = 0
start_time = 0
tcp_flags = 0
tos = 0
Netflow6.__hdr__ = (('version', 'H', 1), ('count', 'H', 0), ('sys_uptime', 'I', 0), ('unix_sec', 'I', 0), ('unix_nsec', 'I', 0), ('flow_sequence', 'I', 0), ('engine_type', 'B', 0), ('engine_id', 'B', 0), ('reserved', 'H', 0))
Netflow6.count = 0
Netflow6.engine_id = 0
Netflow6.engine_type = 0
Netflow6.flow_sequence = 0
Netflow6.reserved = 0
Netflow6.sys_uptime = 0
Netflow6.unix_nsec = 0
Netflow6.unix_sec = 0
Netflow6.version = 1
class pypacker.layer567.netflow.Netflow7(*args, **kwargs)

Bases: pypacker.layer567.netflow.NetflowBase

Netflow Version 7.

class NetflowRecord(*args, **kwargs)

Bases: pypacker.layer567.netflow.NetflowRecordBase

Netflow v7 flow record.

__hdr__ = (('src_addr', 'I', 0), ('dst_addr', 'I', 0), ('next_hop', 'I', 0), ('input_iface', 'H', 0), ('output_iface', 'H', 0), ('pkts_sent', 'I', 0), ('bytes_sent', 'I', 0), ('start_time', 'I', 0), ('end_time', 'I', 0), ('src_port', 'H', 0), ('dst_port', 'H', 0), ('flags', 'B', 0), ('tcp_flags', 'B', 0), ('ip_proto', 'B', 0), ('tos', 'B', 0), ('src_as', 'H', 0), ('dst_as', 'H', 0), ('src_mask', 'B', 0), ('dst_mask', 'B', 0), ('pad2', 'H', 0), ('router_sc', 'I', 0))
bytes_sent = 0
dst_addr = 0
dst_as = 0
dst_mask = 0
dst_port = 0
end_time = 0
flags = 0
input_iface = 0
ip_proto = 0
next_hop = 0
output_iface = 0
pad2 = 0
pkts_sent = 0
router_sc = 0
src_addr = 0
src_as = 0
src_mask = 0
src_port = 0
start_time = 0
tcp_flags = 0
tos = 0
Netflow7.__hdr__ = (('version', 'H', 1), ('count', 'H', 0), ('sys_uptime', 'I', 0), ('unix_sec', 'I', 0), ('unix_nsec', 'I', 0), ('flow_sequence', 'I', 0), ('reserved', 'I', 0))
Netflow7.count = 0
Netflow7.flow_sequence = 0
Netflow7.reserved = 0
Netflow7.sys_uptime = 0
Netflow7.unix_nsec = 0
Netflow7.unix_sec = 0
Netflow7.version = 1
class pypacker.layer567.netflow.NetflowBase(*args, **kwargs)

Bases: pypacker.pypacker.Packet

Base class for Cisco Netflow packets.

class NetflowRecordBase(*args, **kwargs)

Bases: pypacker.pypacker.Packet

Base class for netflow v1-v7 netflow records.

unpack(buf)
NetflowBase.__hdr__ = (('version', 'H', 1), ('count', 'H', 0), ('sys_uptime', 'I', 0), ('unix_sec', 'I', 0), ('unix_nsec', 'I', 0))
NetflowBase.count = 0
NetflowBase.sys_uptime = 0
NetflowBase.unix_nsec = 0
NetflowBase.unix_sec = 0
NetflowBase.unpack(buf)
NetflowBase.version = 1

ntp Module

Network Time Protocol.

class pypacker.layer567.ntp.NTP(*args, **kwargs)

Bases: pypacker.pypacker.Packet

__hdr__ = (('flags', 'B', 28), ('stratum', 'B', 2), ('interval', 'B', 4), ('precision', 'B', 233), ('delay', 'I', 0), ('dispersion', 'I', 0), ('id', '4s', b'\x00\x01\x02\x03'), ('update_time', '8s', b'\x00\x00\x00\x00\x00\x00\x00\x00'), ('originate_time', '8s', b''), ('receive_time', '8s', b''), ('transmit_time', '8s', b''))
delay = 0
dispersion = 0
flags = 28
id = b'\x00\x01\x02\x03'
interval = 4
li
mode
originate_time = b''
precision = 233
receive_time = b''
stratum = 2
transmit_time = b''
update_time = b'\x00\x00\x00\x00\x00\x00\x00\x00'
v

pmap Module

Portmap / rpcbind.

class pypacker.layer567.pmap.Pmap(*args, **kwargs)

Bases: pypacker.pypacker.Packet

__hdr__ = (('prog', 'I', 0), ('vers', 'I', 0), ('prot', 'I', 0), ('port', 'I', 0))
port = 0
prog = 0
prot = 0
vers = 0

radius Module

Remote Authentication Dial-In User Service.

class pypacker.layer567.radius.Radius(*args, **kwargs)

Bases: pypacker.pypacker.Packet

__hdr__ = (('code', 'B', 0), ('id', 'B', 0), ('len', 'H', 4), ('auth', '16s', b''))
auth = b''
code = 0
id = 0
len = 4
parse_attrs(buf)

Parse attributes buffer into a list of (type, data) tuples.

rfb Module

Remote Framebuffer Protocol.

class pypacker.layer567.rfb.CutText(*args, **kwargs)

Bases: pypacker.pypacker.Packet

__hdr__ = (('pad', '3s', ''), ('length', 'I', 0))
length = 0
pad = ''
class pypacker.layer567.rfb.FramebufferUpdate(*args, **kwargs)

Bases: pypacker.pypacker.Packet

__hdr__ = (('pad', '1s', ''), ('num_rects', 'H', 0))
num_rects = 0
pad = ''
class pypacker.layer567.rfb.FramebufferUpdateRequest(*args, **kwargs)

Bases: pypacker.pypacker.Packet

__hdr__ = (('incremental', 'B', 0), ('x_position', 'H', 0), ('y_position', 'H', 0), ('width', 'H', 0), ('height', 'H', 0))
height = 0
incremental = 0
width = 0
x_position = 0
y_position = 0
class pypacker.layer567.rfb.KeyEvent(*args, **kwargs)

Bases: pypacker.pypacker.Packet

__hdr__ = (('down_flag', 'B', 0), ('pad', '2s', ''), ('key', 'I', 0))
down_flag = 0
key = 0
pad = ''
class pypacker.layer567.rfb.PointerEvent(*args, **kwargs)

Bases: pypacker.pypacker.Packet

__hdr__ = (('button_mask', 'B', 0), ('x_position', 'H', 0), ('y_position', 'H', 0))
button_mask = 0
x_position = 0
y_position = 0
class pypacker.layer567.rfb.RFB(*args, **kwargs)

Bases: pypacker.pypacker.Packet

__hdr__ = (('type', 'B', 0),)
type = 0
class pypacker.layer567.rfb.SetColourMapEntries(*args, **kwargs)

Bases: pypacker.pypacker.Packet

__hdr__ = (('pad', '1s', ''), ('first_colour', 'H', 0), ('num_colours', 'H', 0))
first_colour = 0
num_colours = 0
pad = ''
class pypacker.layer567.rfb.SetEncodings(*args, **kwargs)

Bases: pypacker.pypacker.Packet

__hdr__ = (('pad', '1s', ''), ('num_encodings', 'H', 0))
num_encodings = 0
pad = ''
class pypacker.layer567.rfb.SetPixelFormat(*args, **kwargs)

Bases: pypacker.pypacker.Packet

__hdr__ = (('pad', '3s', ''), ('pixel_fmt', '16s', ''))
pad = ''
pixel_fmt = ''

rip Module

Routing Information Protocol.

class pypacker.layer567.rip.Auth(*args, **kwargs)

Bases: pypacker.pypacker.Packet

__hdr__ = (('rsvd', 'H', 65535), ('type', 'H', 2), ('auth', '16s', 0))
auth = 0
rsvd = 65535
type = 2
class pypacker.layer567.rip.RIP(*args, **kwargs)

Bases: pypacker.pypacker.Packet

__hdr__ = (('cmd', 'B', 1), ('v', 'B', 2), ('rsvd', 'H', 0), ('rte_auth', None, <class 'pypacker.triggerlist.TriggerList'>))
cmd = 1
rsvd = 0
v = 2
class pypacker.layer567.rip.RTE(*args, **kwargs)

Bases: pypacker.pypacker.Packet

__hdr__ = (('family', 'H', 2), ('route_tag', 'H', 0), ('addr', 'I', 0), ('subnet', 'I', 0), ('next_hop', 'I', 0), ('metric', 'I', 1))
addr = 0
family = 2
metric = 1
next_hop = 0
route_tag = 0
subnet = 0

rpc Module

Remote Procedure Call.

class pypacker.layer567.rpc.RPC(*args, **kwargs)

Bases: pypacker.pypacker.Packet

class Auth(*args, **kwargs)

Bases: pypacker.pypacker.Packet

__hdr__ = (('flavor', 'I', 0),)
flavor = 0
unpack(buf)
class RPC.Call(*args, **kwargs)

Bases: pypacker.pypacker.Packet

__hdr__ = (('rpcvers', 'I', 2), ('prog', 'I', 0), ('vers', 'I', 0), ('proc', 'I', 0))
proc = 0
prog = 0
rpcvers = 2
unpack(buf)
vers = 0
class RPC.Reply(*args, **kwargs)

Bases: pypacker.pypacker.Packet

class Accept(*args, **kwargs)

Bases: pypacker.pypacker.Packet

__hdr__ = (('stat', 'I', 0),)
stat = 0
unpack(buf)
class RPC.Reply.Reject(*args, **kwargs)

Bases: pypacker.pypacker.Packet

__hdr__ = (('stat', 'I', 1),)
stat = 1
unpack(buf)
RPC.Reply.__hdr__ = (('stat', 'I', 0),)
RPC.Reply.stat = 0
RPC.Reply.unpack(buf)
RPC.__hdr__ = (('xid', 'I', 0), ('dir', 'I', 0))
RPC.dir = 0
RPC.unpack(buf)
RPC.xid = 0
pypacker.layer567.rpc.pack_xdrlist(*args)
pypacker.layer567.rpc.unpack_xdrlist(cls, buf)

rtp Module

Real-Time Transport Protocol

class pypacker.layer567.rtp.RTP(*args, **kwargs)

Bases: pypacker.pypacker.Packet

__hdr__ = (('type', 'H', 32768), ('seq', 'H', 0), ('ts', 'I', 0), ('ssrc', 'I', 0))
cc
getcc()
getm()
getp()
getpt()
getversion()
getx()
m
p
pt
seq = 0
setcc(value)
setm(value)
setp(value)
setpt(value)
setversion(value)
setx(value)
ssrc = 0
ts = 0
type = 32768
version
x

sip Module

Session Initiation Protocol.

class pypacker.layer567.sip.SIP(*args, **kwargs)

Bases: pypacker.layer567.http.HTTP

smb Module

Server Message Block.

class pypacker.layer567.smb.SMB(*args, **kwargs)

Bases: pypacker.pypacker.Packet

__hdr__ = [('proto', '4s', b''), ('cmd', 'B', 0), ('err', 'I', 0), ('flags1', 'B', 0), ('flags2', 'B', 0), ('pad', '6s', ''), ('tid', 'H', 0), ('pid', 'H', 0), ('uid', 'H', 0), ('mid', 'H', 0)]
cmd = 0
err = 0
flags1 = 0
flags2 = 0
mid = 0
pad = ''
pid = 0
proto = b''
tid = 0
uid = 0

ssl_ciphersuites Module

Nicely formatted cipher suite definitions for TLS

A list of cipher suites in the form of CipherSuite objects. These are supposed to be immutable; don’t mess with them.

class pypacker.layer567.ssl_ciphersuites.CipherSuite(code, name, kx, auth, encoding, mac)

Bases: builtins.object

Encapsulates a cipher suite.

Members/args: * code: two-byte ID code, as int * name: as in ‘TLS_RSA_WITH_RC4_40_MD5’ * kx: key exchange algorithm, string * auth: authentication algorithm, string * encoding: encoding algorithm * mac: message authentication code algorithm

BLOCK_SIZES = {'AES_256_CBC': 16}
MAC_SIZES = {'MD5': 16, 'SHA': 20, 'SHA256': 32}
block_size

In bytes. Default to 1.

mac_size

In bytes. Default to 0.

telnet Module

Telnet.

class pypacker.layer567.telnet.Telnet(*args, **kwargs)

Bases: pypacker.pypacker.Packet

__hdr__ = (('telnet_data', None, <class 'pypacker.triggerlist.TriggerList'>),)
pypacker.layer567.telnet.strip_options(buf)

Return a list of lines and dict of options from telnet data.

tpkt Module

ISO Transport Service on top of the TCP (TPKT).

class pypacker.layer567.tpkt.TPKT(*args, **kwargs)

Bases: pypacker.pypacker.Packet

__hdr__ = (('v', 'B', 3), ('rsvd', 'B', 0), ('len', 'H', 0))
len = 0
rsvd = 0
v = 3