scapy.contrib.vtp

VTP Scapy Extension

version

2009-02-15

copyright

2009 by Jochen Bartl

e-mail

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

license

GPL v2

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

TODO
  • Join messages

  • RE MD5 hash calculation

  • Have a closer look at 8 byte padding in summary adv:

    “debug sw-vlan vtp packets” says the TLV length is invalid, when I change the values:

    b'\x00\x00\x00\x01\x06\x01\x00\x02'

    • x00x00 ?

    • x00x01 tlvtype?

    • x06 length?

    • x00x02 value?

  • h2i function for VTPTimeStampField

References
class scapy.contrib.vtp.VTP

Bases: scapy.packet.Packet

aliastypes
fields_desc
VTP fields

ver

ByteField

2

code

ByteEnumField

1

followers

ByteField (Cond)

1

seq

ByteField (Cond)

1

reserved

ByteField (Cond)

0

domnamelen

ByteField

None

domname

StrFixedLenField

b'manbearpig'

rev

SignedIntField (Cond)

0

uid

IPField (Cond)

'192.168.0.1'

timestamp

VTPTimeStampField (Cond)

b'930301000000'

md5

StrFixedLenField (Cond)

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

vlaninfo

PacketListField (Cond)

[]

startvalue

ShortField (Cond)

0

post_build(p, pay)
class scapy.contrib.vtp.VTPTimeStampField(name, default)

Bases: scapy.fields.StrFixedLenField

i2repr(pkt, x)
class scapy.contrib.vtp.VTPVlanInfo

Bases: scapy.packet.Packet

aliastypes
fields_desc
VTPVlanInfo fields

len

ByteField

None

status

ByteEnumField

0

type

ByteEnumField

1

vlannamelen

FieldLenField

None

vlanid

ShortField

1

mtu

ShortField

1500

dot10index

XIntField

None

vlanname

StrLenField

b'default'

tlvlist

PacketListField (Cond)

[]

guess_payload_class(p)
post_build(p, pay)
class scapy.contrib.vtp.VTPVlanInfoTlv

Bases: scapy.packet.Packet

aliastypes
fields_desc
VTPVlanInfoTlv fields

type

ByteEnumField

0

length

ByteField

0

value

StrLenField

None

guess_payload_class(p)