scapy.contrib.eigrp

EIGRP Scapy Extension

version

2009-08-13

copyright

2009年:乔钦·巴特尔(Jochen Bartl)

e-mail

lobo@c3a.de / jochen.bartl@gmail.com

license

液化石油气v2

:TODO

Known bugs
Thanks

  • TLV code derived from the CDP implementation of scapy. (Thanks to Nicolas Bareil and Arnaud Ebalard)

    http://trac.secdev.org/scapy/ticket/18

  • IOS / EIGRP版本表示法修正(由Dirk Loss提出)

class scapy.contrib.eigrp.EIGRP

Bases: scapy.packet.Packet

aliastypes
fields_desc
EIGRP字段

ver

ByteField

2

opcode

ByteEnumField

5

chksum

XShortField

None

flags

FlagsField (32位)

<Flag 0 ()>

seq

IntField

0

ack

IntField

0

asn

IntField

100

tlvlist

RepeatedTlvListField

[]

mysummary()
post_build(p, pay)
class scapy.contrib.eigrp.EIGRPAuthData

Bases: scapy.contrib.eigrp.EIGRPGeneric

aliastypes
fields_desc
EIGRPAuthData字段

type

XShortField

2

len

FieldLenField

None

authtype

ShortEnumField

2

keysize

ShortField

None

keyid

IntField

1

nullpad

StrFixedLenField

b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'

authdata

StrLenField

<RandString>

post_build(p, pay)
class scapy.contrib.eigrp.EIGRPExtRoute

Bases: scapy.contrib.eigrp.EIGRPGeneric

aliastypes
fields_desc
EIGRPExtRoute字段

type

XShortField

259

len

FieldLenField

None

nexthop

IPField

'192.168.0.0'

originrouter

IPField

'192.168.0.1'

originasn

IntField

0

tag

IntField

0

externalmetric

IntField

0

reserved

ShortField

0

extprotocolid

ByteEnumField

3

flags

FlagsField (8位)

<Flag 0 ()>

delay

IntField

0

bandwidth

IntField

256

mtu

ThreeBytesField

1500

hopcount

ByteField

0

reliability

ByteField

255

load

ByteField

0

reserved2

XShortField

0

prefixlen

ByteField

24

dst

EigrpIPField

'192.168.1.0'

class scapy.contrib.eigrp.EIGRPGeneric

Bases: scapy.packet.Packet

aliastypes
fields_desc
EIGRP通用字段

type

XShortField

0

len

FieldLenField

None

value

StrLenField

b'\x00'

guess_payload_class(p)
class scapy.contrib.eigrp.EIGRPIntRoute

Bases: scapy.contrib.eigrp.EIGRPGeneric

aliastypes
fields_desc
EIGRPIntRoute字段

type

XShortField

258

len

FieldLenField

None

nexthop

IPField

'192.168.0.0'

delay

IntField

128000

bandwidth

IntField

256

mtu

ThreeBytesField

1500

hopcount

ByteField

0

reliability

ByteField

255

load

ByteField

0

reserved

XShortField

0

prefixlen

ByteField

24

dst

EigrpIPField

'192.168.1.0'

class scapy.contrib.eigrp.EIGRPNms

Bases: scapy.contrib.eigrp.EIGRPGeneric

aliastypes
fields_desc
EIGRPNms字段

type

XShortField

5

len

ShortField

8

nms

IntField

2

class scapy.contrib.eigrp.EIGRPParam

Bases: scapy.contrib.eigrp.EIGRPGeneric

aliastypes
fields_desc
EIGRPParam字段

type

XShortField

1

len

ShortField

12

k1

ByteField

1

k2

ByteField

0

k3

ByteField

1

k4

ByteField

0

k5

ByteField

0

reserved

ByteField

0

holdtime

ShortField

15

class scapy.contrib.eigrp.EIGRPSeq

Bases: scapy.contrib.eigrp.EIGRPGeneric

aliastypes
fields_desc
EIGRPSeq字段

type

XShortField

3

len

ShortField

None

addrlen

ByteField

4

ipaddr

IPField (Cond)

'192.168.0.1'

ip6addr

IP6Field (Cond)

'2001::'

post_build(p, pay)
class scapy.contrib.eigrp.EIGRPStub

Bases: scapy.contrib.eigrp.EIGRPGeneric

aliastypes
fields_desc
EIGRPStub字段

type

XShortField

6

len

ShortField

6

flags

FlagsField (16位)

<Flag 13 (connected+summary+receive-only)>

class scapy.contrib.eigrp.EIGRPSwVer

Bases: scapy.contrib.eigrp.EIGRPGeneric

aliastypes
fields_desc
EIGRPSwVer字段

type

XShortField

4

len

ShortField

8

ios

ShortVersionField

3072

eigrp

ShortVersionField

258

class scapy.contrib.eigrp.EIGRPv6ExtRoute

Bases: scapy.contrib.eigrp.EIGRPGeneric

aliastypes
fields_desc
EIGRPv6ExtRoute字段

type

XShortField

1027

len

FieldLenField

None

nexthop

IP6Field

'::'

originrouter

IPField

'192.168.0.1'

originasn

IntField

0

tag

IntField

0

externalmetric

IntField

0

reserved

ShortField

0

extprotocolid

ByteEnumField

3

flags

FlagsField (8位)

<Flag 0 ()>

delay

IntField

0

bandwidth

IntField

256000

mtu

ThreeBytesField

1500

hopcount

ByteField

1

reliability

ByteField

0

load

ByteField

1

reserved2

XShortField

0

prefixlen

ByteField

8

dst

EigrpIP6Field

'::'

class scapy.contrib.eigrp.EIGRPv6IntRoute

Bases: scapy.contrib.eigrp.EIGRPGeneric

aliastypes
fields_desc
EIGRPv6IntRoute字段

type

XShortField

1026

len

FieldLenField

None

nexthop

IP6Field

'::'

delay

IntField

128000

bandwidth

IntField

256000

mtu

ThreeBytesField

1500

hopcount

ByteField

1

reliability

ByteField

255

load

ByteField

0

reserved

XShortField

0

prefixlen

ByteField

16

dst

EigrpIP6Field

'2001::'

class scapy.contrib.eigrp.EigrpIP6Field(name, default, length=None, length_from=None)

Bases: scapy.fields.StrField, scapy.fields.IP6Field

这是一种特殊的字段类型,用于在内部和外部路由更新中处理目标网络的ip地址.

any2i(pkt, x)
getfield(pkt, s)
h2i(pkt, x)
i2len(pkt, x)
i2m(pkt, x)
i2repr(pkt, x)
length_from
m2i(pkt, x)
prefixlen_to_bytelen(plen)
randval()
class scapy.contrib.eigrp.EigrpIPField(name, default, length=None, length_from=None)

Bases: scapy.fields.StrField, scapy.fields.IPField

这是一种特殊的字段类型,用于在内部和外部路由更新中处理目标网络的ip地址.

如果网络掩码是8位,16位或24位,则EIGRP将从IP地址的主机部分中删除零.

getfield(pkt, s)
h2i(pkt, x)
i2len(pkt, x)
i2m(pkt, x)
length_from
m2i(pkt, x)
prefixlen_to_bytelen(tmp_len)
randval()
class scapy.contrib.eigrp.RepeatedTlvListField(name, default, cls)

Bases: scapy.fields.PacketListField

addfield(pkt, s, val)
getfield(pkt, s)
class scapy.contrib.eigrp.ShortVersionField(name, default)

Bases: scapy.fields.ShortField

h2i(pkt, x)

该字段接受字符串值,例如v12.1,v1.1或整数值. 字符串值必须以" v"开头,后跟浮点数. 有效数字在0到255之间.

i2repr(pkt, x)
randval()