scapy.layers.hsrp

HSRP (Hot Standby Router Protocol) A proprietary redundancy protocol for Cisco routers.

class scapy.layers.hsrp.HSRP(_pkt, /, *, version=0, opcode=0, state=16, hellotime=3, holdtime=10, priority=120, group=1, reserved=0, auth=b'cisco\x00\x00\x00', virtualIP='192.168.1.1')[源代码]

基类:Packet

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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|    VERSION    |     OPCODE    |     STATE     |   HELLOTIME   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|    HOLDTIME   |    PRIORITY   |     GROUP     |    RESERVED   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                              AUTH                             |
+                                                               +
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                           VIRTUALIP                           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                            Fig. HSRP                             
HSRP fields

version

ByteField

0

opcode

ByteEnumField

0

state

ByteEnumField

16

hellotime

ByteField

3

holdtime

ByteField

10

priority

ByteField

120

group

ByteField

1

reserved

ByteField

0

auth

StrFixedLenField

b'cisco\x00\x00\x00'

virtualIP

IPField

'192.168.1.1'

guess_payload_class(payload)[源代码]
class scapy.layers.hsrp.HSRPmd5(_pkt, /, *, type=4, len=None, algo=0, padding=0, flags=0, sourceip=None, keyid=0, authdigest=b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')[源代码]

基类:Packet

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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|      TYPE     |      LEN      |      ALGO     |    PADDING    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             FLAGS             |            SOURCEIP           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                               |             KEYID             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                               |           AUTHDIGEST          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               +
|                                                               |
+                                                               +
|                                                               |
+                                                               +
|                                                               |
+                               +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                           Fig. HSRPmd5                           
HSRPmd5 fields

type

ByteEnumField

4

len

ByteField

None

algo

ByteEnumField

0

padding

ByteField

0

flags

XShortField

0

sourceip

SourceIPField

None

keyid

XIntField

0

authdigest

StrFixedLenField

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

post_build(p, pay)[源代码]