scapy.contrib.nsh
- class scapy.contrib.nsh.NSH(_pkt, /, *, ver=0, oam=0, unused1=0, ttl=63, length=None, unused2=0, mdtype=1, nextproto=3, spi=0, si=255, context_header=b'', vlch=[])[源代码]
基类:
PacketNetwork Service Header. NSH MD-type 1 if there is no ContextHeaders
- aliastypes
- fields_desc
Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |VER|O|U| TTL | LENGTH |UNUSED2| MDTYPE| NEXTPROTO | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | SPI | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | SI | CONTEXT HEADER | +-+-+-+-+-+-+-+-+ + | | + + | | + + | | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | VLCH | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. NSHNSH fields ver
BitField(2 bits)0oam
BitField(1 bit)0unused1
BitField(1 bit)0ttl
BitField(6 bits)63length
BitFieldLenField(6 bits)Noneunused2
BitField(4 bits)0mdtype
1nextproto
3spi
0si
255context_header
XStrFixedLenField(Cond)b''vlch
PacketListField(Cond)[]
- class scapy.contrib.nsh.NSHTLV(_pkt, /, *, class_=0, type=0, reserved=0, length=0, metadata=[])[源代码]
基类:
PacketNSH MD-type 2 - Variable Length Context Headers
- aliastypes
- fields_desc
Display RFC-like schema
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | CLASS | TYPE |R| LENGTH | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | METADATA | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. NSHTLVNSHTLV fields class_
0type
BitField(8 bits)0reserved
BitField(1 bit)0length
BitField(7 bits)0metadata
[]