scapy.contrib.isis

IS-IS Scapy Extension

copyright

2014-2016 BENOCS GmbH, Berlin (Germany)

author

Marcel Patzlaff, mpatzlaff@benocs.com Michal Kaliszan, mkaliszan@benocs.com

license

GPLv2

This module 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 module 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.

description

This module provides Scapy layers for the Intermediate System to Intermediate System routing protocol as defined in RFC 1195.

Currently it (partially) supports the packaging/encoding requirements of the following RFCs: * RFC 1195 (only the TCP/IP related part) * RFC 3358 (optional checksums) * RFC 5301 (dynamic hostname extension) * RFC 5302 (domain-wide prefix distribution) * RFC 5303 (three-way handshake) * RFC 5304 (cryptographic authentication) * RFC 5308 (routing IPv6 with IS-IS)

TODO
  • packet relations (requests, responses)

  • support for recent RFCs: * RFC 5305 (traffic engineering) * RFC 5307 (support for G-MPLS) * RFC 5310 (generic cryptographic authentication) * RFC 5316 (inter-AS MPLS and G-MPLS TE)

class scapy.contrib.isis.ISIS_32bitAdministrativeTagSubTlv

Bases: scapy.contrib.isis.ISIS_GenericSubTlv

aliastypes
fields_desc
ISIS_32bitAdministrativeTagSubTlv fields

type

ByteEnumField

1

len

FieldLenField

None

tags

FieldListField

[]

class scapy.contrib.isis.ISIS_64bitAdministrativeTagSubTlv

Bases: scapy.contrib.isis.ISIS_GenericSubTlv

aliastypes
fields_desc
ISIS_64bitAdministrativeTagSubTlv fields

type

ByteEnumField

2

len

FieldLenField

None

tags

FieldListField

[]

class scapy.contrib.isis.ISIS_AdministrativeGroupSubTlv

Bases: scapy.contrib.isis.ISIS_GenericSubTlv

aliastypes
fields_desc
ISIS_AdministrativeGroupSubTlv fields

code

ByteEnumField

3

len

FieldLenField

None

admingroup

IPField

'0.0.0.1'

class scapy.contrib.isis.ISIS_AreaEntry

Bases: scapy.packet.Packet

aliastypes
extract_padding(s)
fields_desc
ISIS_AreaEntry fields

arealen

FieldLenField

None

areaid

ISIS_AreaIdField

'49'

class scapy.contrib.isis.ISIS_AreaIdField(name, default, length_from)

Bases: scapy.fields.Field

addfield(pkt, s, val)
getfield(pkt, s)
i2len(pkt, x)
i2m(pkt, x)
length_from
m2i(pkt, x)
randval()
class scapy.contrib.isis.ISIS_AreaTlv

Bases: scapy.contrib.isis.ISIS_GenericTlv

aliastypes
fields_desc
ISIS_AreaTlv fields

type

ByteEnumField

1

len

FieldLenField

None

areas

PacketListField

[]

class scapy.contrib.isis.ISIS_AuthenticationTlv

Bases: scapy.contrib.isis.ISIS_GenericTlv

aliastypes
fields_desc
ISIS_AuthenticationTlv fields

type

ByteEnumField

10

len

FieldLenField

None

authtype

ByteEnumField

1

password

BoundStrLenField

b''

class scapy.contrib.isis.ISIS_BufferSizeTlv

Bases: scapy.contrib.isis.ISIS_GenericTlv

aliastypes
fields_desc
ISIS_BufferSizeTlv fields

type

ByteEnumField

14

len

ByteField

2

lspbuffersize

ShortField

1497

class scapy.contrib.isis.ISIS_ChecksumTlv

Bases: scapy.contrib.isis.ISIS_GenericTlv

aliastypes
fields_desc
ISIS_ChecksumTlv fields

type

ByteEnumField

12

len

ByteField

2

checksum

XShortField

None

class scapy.contrib.isis.ISIS_CircuitTypeField(name='circuittype', default=2, size=8, names=None)

Bases: scapy.fields.FlagsField

class scapy.contrib.isis.ISIS_CommonHdr

Bases: scapy.packet.Packet

aliastypes
fields_desc
ISIS_CommonHdr fields

nlpid

ByteEnumField

131

hdrlen

ByteField

None

version

ByteField

1

idlen

ByteField

0

pdutype

ByteEnumField

None

pduversion

ByteField

1

hdrreserved

ByteField

0

maxareaaddr

ByteField

0

payload_guess

Possible sublayers: ISIS_L1_CSNP, ISIS_L1_LAN_Hello, ISIS_L1_LSP, ISIS_L1_PSNP, ISIS_L2_CSNP, ISIS_L2_LAN_Hello, ISIS_L2_LSP, ISIS_L2_PSNP, ISIS_P2P_Hello

post_build(pkt, pay)
class scapy.contrib.isis.ISIS_DynamicHostnameTlv

Bases: scapy.contrib.isis.ISIS_GenericTlv

aliastypes
fields_desc
ISIS_DynamicHostnameTlv fields

type

ByteEnumField

137

len

FieldLenField

None

hostname

BoundStrLenField

b''

class scapy.contrib.isis.ISIS_ExtendedIpPrefix

Bases: scapy.packet.Packet

aliastypes
extract_padding(s)
fields_desc
ISIS_ExtendedIpPrefix fields

metric

IntField

1

updown

BitField (1 bit)

0

subtlvindicator

BitField (1 bit)

0

pfxlen

BitFieldLenField (6 bits)

None

pfx

IPPrefixField

('0.0.0.0', 1)

subtlvslen

FieldLenField (Cond)

None

subtlvs

PacketListField (Cond)

[]

class scapy.contrib.isis.ISIS_ExtendedIpReachabilityTlv

Bases: scapy.contrib.isis.ISIS_GenericTlv

aliastypes
fields_desc
ISIS_ExtendedIpReachabilityTlv fields

type

ByteEnumField

135

len

FieldLenField

None

pfxs

PacketListField

[]

class scapy.contrib.isis.ISIS_ExtendedIsNeighbourEntry

Bases: scapy.packet.Packet

aliastypes
extract_padding(s)
fields_desc
ISIS_ExtendedIsNeighbourEntry fields

neighbourid

ISIS_NodeIdField

'0102.0304.0506.07'

metric

ThreeBytesField

1

subtlvslen

FieldLenField

None

subtlvs

PacketListField

[]

class scapy.contrib.isis.ISIS_ExtendedIsReachabilityTlv

Bases: scapy.contrib.isis.ISIS_GenericTlv

aliastypes
fields_desc
ISIS_ExtendedIsReachabilityTlv fields

type

ByteEnumField

22

len

FieldLenField

None

neighbours

PacketListField

[]

class scapy.contrib.isis.ISIS_ExternalIpReachabilityTlv

Bases: scapy.contrib.isis.ISIS_GenericTlv

aliastypes
fields_desc
ISIS_ExternalIpReachabilityTlv fields

type

ByteEnumField

130

len

FieldLenField

None

entries

PacketListField

[]

class scapy.contrib.isis.ISIS_GenericSubTlv

Bases: scapy.contrib.isis._ISIS_GenericTlv_Base

aliastypes
fields_desc
ISIS_GenericSubTlv fields

type

ByteField

0

len

FieldLenField

None

val

BoundStrLenField

b''

class scapy.contrib.isis.ISIS_GenericTlv

Bases: scapy.contrib.isis._ISIS_GenericTlv_Base

aliastypes
fields_desc
ISIS_GenericTlv fields

type

ByteField

0

len

FieldLenField

None

val

BoundStrLenField

b''

class scapy.contrib.isis.ISIS_IPv4InterfaceAddressSubTlv

Bases: scapy.contrib.isis.ISIS_GenericSubTlv

aliastypes
fields_desc
ISIS_IPv4InterfaceAddressSubTlv fields

type

ByteEnumField

6

len

FieldLenField

None

address

IPField

'0.0.0.0'

class scapy.contrib.isis.ISIS_IPv4NeighborAddressSubTlv

Bases: scapy.contrib.isis.ISIS_GenericSubTlv

aliastypes
fields_desc
ISIS_IPv4NeighborAddressSubTlv fields

type

ByteEnumField

8

len

FieldLenField

None

address

IPField

'0.0.0.0'

class scapy.contrib.isis.ISIS_IPv6InterfaceAddressSubTlv

Bases: scapy.contrib.isis.ISIS_GenericSubTlv

aliastypes
fields_desc
ISIS_IPv6InterfaceAddressSubTlv fields

type

ByteEnumField

12

len

FieldLenField

None

address

IP6Field

'::'

class scapy.contrib.isis.ISIS_IPv6NeighborAddressSubTlv

Bases: scapy.contrib.isis.ISIS_GenericSubTlv

aliastypes
fields_desc
ISIS_IPv6NeighborAddressSubTlv fields

type

ByteEnumField

13

len

FieldLenField

None

address

IP6Field

'::'

class scapy.contrib.isis.ISIS_InternalIpReachabilityTlv

Bases: scapy.contrib.isis.ISIS_GenericTlv

aliastypes
fields_desc
ISIS_InternalIpReachabilityTlv fields

type

ByteEnumField

128

len

FieldLenField

None

entries

PacketListField

[]

class scapy.contrib.isis.ISIS_IpInterfaceAddressTlv

Bases: scapy.contrib.isis.ISIS_GenericTlv

aliastypes
fields_desc
ISIS_IpInterfaceAddressTlv fields

type

ByteEnumField

132

len

FieldLenField

None

addresses

FieldListField

[]

class scapy.contrib.isis.ISIS_IpReachabilityEntry

Bases: scapy.packet.Packet

aliastypes
extract_padding(s)
fields_desc
ISIS_IpReachabilityEntry fields

defmetric

ByteField

1

delmetric

ByteField

128

expmetric

ByteField

128

errmetric

ByteField

128

ipaddress

IPField

'0.0.0.0'

subnetmask

IPField

'255.255.255.255'

class scapy.contrib.isis.ISIS_Ipv6InterfaceAddressTlv

Bases: scapy.contrib.isis.ISIS_GenericTlv

aliastypes
fields_desc
ISIS_Ipv6InterfaceAddressTlv fields

type

ByteEnumField

232

len

FieldLenField

None

addresses

IP6ListField

[]

class scapy.contrib.isis.ISIS_Ipv6Prefix

Bases: scapy.packet.Packet

aliastypes
extract_padding(s)
fields_desc
ISIS_Ipv6Prefix fields

metric

IntField

1

updown

BitField (1 bit)

0

external

BitField (1 bit)

0

subtlvindicator

BitField (1 bit)

0

reserved

BitField (5 bits)

0

pfxlen

FieldLenField

None

pfx

IP6PrefixField

('::', 1)

subtlvslen

FieldLenField (Cond)

None

subtlvs

PacketListField (Cond)

[]

class scapy.contrib.isis.ISIS_Ipv6ReachabilityTlv

Bases: scapy.contrib.isis.ISIS_GenericTlv

aliastypes
fields_desc
ISIS_Ipv6ReachabilityTlv fields

type

ByteEnumField

236

len

FieldLenField

None

pfxs

PacketListField

[]

class scapy.contrib.isis.ISIS_IsNeighbourTlv

Bases: scapy.contrib.isis.ISIS_GenericTlv

aliastypes
fields_desc
ISIS_IsNeighbourTlv fields

type

ByteEnumField

6

len

FieldLenField

None

neighbours

FieldListField

[]

class scapy.contrib.isis.ISIS_IsReachabilityEntry

Bases: scapy.packet.Packet

aliastypes
extract_padding(s)
fields_desc
ISIS_IsReachabilityEntry fields

defmetric

ByteField

1

delmetric

ByteField

128

expmetric

ByteField

128

errmetric

ByteField

128

neighbourid

ISIS_NodeIdField

'0102.0304.0506.07'

class scapy.contrib.isis.ISIS_IsReachabilityTlv

Bases: scapy.contrib.isis.ISIS_GenericTlv

aliastypes
fields_desc
ISIS_IsReachabilityTlv fields

type

ByteEnumField

2

len

FieldLenField

None

virtual

ByteField

0

neighbours

PacketListField

[]

class scapy.contrib.isis.ISIS_L1_CSNP

Bases: scapy.contrib.isis._ISIS_CSNP_Base

aliastypes
answers(other)
fields_desc
ISIS_L1_CSNP fields

pdulength

_ISIS_PduLengthField

None

sourceid

ISIS_NodeIdField

'0102.0304.0506.00'

startlspid

ISIS_LspIdField

'0000.0000.0000.00-00'

endlspid

ISIS_LspIdField

'FFFF.FFFF.FFFF.FF-FF'

tlvs

_ISIS_TlvListField

[]

class scapy.contrib.isis.ISIS_L1_LAN_Hello

Bases: scapy.contrib.isis._ISIS_LAN_HelloBase

aliastypes
fields_desc
ISIS_L1_LAN_Hello fields

circuittype

ISIS_CircuitTypeField (8 bits)

<Flag 2 (L2)>

sourceid

ISIS_SystemIdField

'0102.0304.0506'

holdingtime

ShortField

30

pdulength

_ISIS_PduLengthField

None

priority

ByteField

1

lanid

ISIS_NodeIdField

'0000.0000.0000.00'

tlvs

_ISIS_TlvListField

[]

class scapy.contrib.isis.ISIS_L1_LSP

Bases: scapy.contrib.isis._ISIS_LSP_Base

aliastypes
answers(other)
fields_desc
ISIS_L1_LSP fields

pdulength

_ISIS_PduLengthField

None

lifetime

ShortField

1199

lspid

ISIS_LspIdField

'0102.0304.0506.00-00'

seqnum

XIntField

1

checksum

XShortField

None

typeblock

FlagsField (8 bits)

<Flag 3 (L1+L2)>

tlvs

_ISIS_TlvListField

[]

class scapy.contrib.isis.ISIS_L1_PSNP

Bases: scapy.contrib.isis._ISIS_PSNP_Base

aliastypes
answers(other)
fields_desc
ISIS_L1_PSNP fields

pdulength

_ISIS_PduLengthField

None

sourceid

ISIS_NodeIdField

'0102.0304.0506.00'

tlvs

_ISIS_TlvListField

[]

class scapy.contrib.isis.ISIS_L2_CSNP

Bases: scapy.contrib.isis._ISIS_CSNP_Base

aliastypes
answers(other)
fields_desc
ISIS_L2_CSNP fields

pdulength

_ISIS_PduLengthField

None

sourceid

ISIS_NodeIdField

'0102.0304.0506.00'

startlspid

ISIS_LspIdField

'0000.0000.0000.00-00'

endlspid

ISIS_LspIdField

'FFFF.FFFF.FFFF.FF-FF'

tlvs

_ISIS_TlvListField

[]

class scapy.contrib.isis.ISIS_L2_LAN_Hello

Bases: scapy.contrib.isis._ISIS_LAN_HelloBase

aliastypes
fields_desc
ISIS_L2_LAN_Hello fields

circuittype

ISIS_CircuitTypeField (8 bits)

<Flag 2 (L2)>

sourceid

ISIS_SystemIdField

'0102.0304.0506'

holdingtime

ShortField

30

pdulength

_ISIS_PduLengthField

None

priority

ByteField

1

lanid

ISIS_NodeIdField

'0000.0000.0000.00'

tlvs

_ISIS_TlvListField

[]

class scapy.contrib.isis.ISIS_L2_LSP

Bases: scapy.contrib.isis._ISIS_LSP_Base

aliastypes
answers(other)
fields_desc
ISIS_L2_LSP fields

pdulength

_ISIS_PduLengthField

None

lifetime

ShortField

1199

lspid

ISIS_LspIdField

'0102.0304.0506.00-00'

seqnum

XIntField

1

checksum

XShortField

None

typeblock

FlagsField (8 bits)

<Flag 3 (L1+L2)>

tlvs

_ISIS_TlvListField

[]

class scapy.contrib.isis.ISIS_L2_PSNP

Bases: scapy.contrib.isis._ISIS_PSNP_Base

aliastypes
answers(other)
fields_desc
ISIS_L2_PSNP fields

pdulength

_ISIS_PduLengthField

None

sourceid

ISIS_NodeIdField

'0102.0304.0506.00'

tlvs

_ISIS_TlvListField

[]

class scapy.contrib.isis.ISIS_LinkLocalRemoteIdentifiersSubTlv

Bases: scapy.contrib.isis.ISIS_GenericSubTlv

aliastypes
fields_desc
ISIS_LinkLocalRemoteIdentifiersSubTlv fields

type

ByteEnumField

4

len

FieldLenField

8

localid

IntField

'0'

remoteid

IntField

'0'

class scapy.contrib.isis.ISIS_LspEntry

Bases: scapy.packet.Packet

aliastypes
extract_padding(s)
fields_desc
ISIS_LspEntry fields

lifetime

ShortField

1200

lspid

ISIS_LspIdField

'0102.0304.0506.07-08'

seqnum

XIntField

1

checksum

XShortField

None

class scapy.contrib.isis.ISIS_LspEntryTlv

Bases: scapy.contrib.isis.ISIS_GenericTlv

aliastypes
fields_desc
ISIS_LspEntryTlv fields

type

ByteEnumField

9

len

FieldLenField

None

entries

PacketListField

[]

class scapy.contrib.isis.ISIS_LspIdField(name, default)

Bases: scapy.contrib.isis._ISIS_IdFieldBase

randval()
class scapy.contrib.isis.ISIS_MaximumLinkBandwidthSubTlv

Bases: scapy.contrib.isis.ISIS_GenericSubTlv

aliastypes
fields_desc
ISIS_MaximumLinkBandwidthSubTlv fields

type

ByteEnumField

9

len

FieldLenField

None

maxbw

IEEEFloatField

1000

class scapy.contrib.isis.ISIS_MaximumReservableLinkBandwidthSubTlv

Bases: scapy.contrib.isis.ISIS_GenericSubTlv

aliastypes
fields_desc
ISIS_MaximumReservableLinkBandwidthSubTlv fields

type

ByteEnumField

10

len

FieldLenField

None

maxrsvbw

IEEEFloatField

1000

class scapy.contrib.isis.ISIS_NodeIdField(name, default)

Bases: scapy.contrib.isis._ISIS_IdFieldBase

randval()
class scapy.contrib.isis.ISIS_P2PAdjacencyStateTlv

Bases: scapy.contrib.isis.ISIS_GenericTlv

aliastypes
fields_desc
ISIS_P2PAdjacencyStateTlv fields

type

ByteEnumField

240

len

_AdjacencyStateTlvLenField

None

state

ByteEnumField

2

extlocalcircuitid

IntField (Cond)

None

neighboursystemid

ISIS_SystemIdField (Cond)

None

neighbourextlocalcircuitid

IntField (Cond)

None

class scapy.contrib.isis.ISIS_P2P_Hello

Bases: scapy.contrib.isis._ISIS_PduBase

aliastypes
fields_desc
ISIS_P2P_Hello fields

circuittype

ISIS_CircuitTypeField (8 bits)

<Flag 2 (L2)>

sourceid

ISIS_SystemIdField

'0102.0304.0506'

holdingtime

ShortField

30

pdulength

_ISIS_PduLengthField

None

localcircuitid

ByteField

0

tlvs

_ISIS_TlvListField

[]

class scapy.contrib.isis.ISIS_PaddingTlv

Bases: scapy.contrib.isis.ISIS_GenericTlv

aliastypes
fields_desc
ISIS_PaddingTlv fields

type

ByteEnumField

8

len

FieldLenField

None

padding

BoundStrLenField

b''

class scapy.contrib.isis.ISIS_ProtocolsSupportedTlv

Bases: scapy.contrib.isis.ISIS_GenericTlv

aliastypes
fields_desc
ISIS_ProtocolsSupportedTlv fields

type

ByteEnumField

129

len

FieldLenField

None

nlpids

FieldListField

[]

class scapy.contrib.isis.ISIS_SystemIdField(name, default)

Bases: scapy.contrib.isis._ISIS_IdFieldBase

randval()
class scapy.contrib.isis.ISIS_TEDefaultMetricSubTlv

Bases: scapy.contrib.isis.ISIS_GenericSubTlv

aliastypes
fields_desc
ISIS_TEDefaultMetricSubTlv fields

type

ByteEnumField

18

len

FieldLenField

None

temetric

ThreeBytesField

1000

class scapy.contrib.isis.ISIS_TERouterIDTlv

Bases: scapy.contrib.isis.ISIS_GenericTlv

aliastypes
fields_desc
ISIS_TERouterIDTlv fields

type

ByteEnumField

134

len

FieldLenField

None

routerid

IPField

'0.0.0.0'

class scapy.contrib.isis.ISIS_UnreservedBandwidthSubTlv

Bases: scapy.contrib.isis.ISIS_GenericSubTlv

aliastypes
fields_desc
ISIS_UnreservedBandwidthSubTlv fields

type

ByteEnumField

11

len

FieldLenField

None

unrsvbw

FieldListField

[1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000]

scapy.contrib.isis.isis_area2str(area)
scapy.contrib.isis.isis_lspid2str(lspid)
scapy.contrib.isis.isis_nodeid2str(nodeid)
scapy.contrib.isis.isis_str2area(s)
scapy.contrib.isis.isis_str2lspid(s)
scapy.contrib.isis.isis_str2nodeid(s)
scapy.contrib.isis.isis_str2sysid(s)
scapy.contrib.isis.isis_sysid2str(sysid)