scapy.contrib.carp

class scapy.contrib.carp.CARP(_pkt, /, *, version=4, type=4, vhid=1, advskew=0, authlen=0, demotion=0, advbase=0, chksum=None, counter1=0, counter2=0, hmac1=0, hmac2=0, hmac3=0, hmac4=0, hmac5=0)[source]

Bases: Packet

aliastypes
build_hmac_sha1(pw=b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', ip4l=[], ip6l=[])[source]
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|  TYPE |      VHID     |    ADVSKEW    |    AUTHLEN    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|    DEMOTION   |    ADVBASE    |             CHKSUM            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                            COUNTER1                           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                            COUNTER2                           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                             HMAC1                             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                             HMAC2                             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                             HMAC3                             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                             HMAC4                             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                             HMAC5                             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                            Fig. CARP                             
CARP fields

version

BitField (4 bits)

4

type

BitField (4 bits)

4

vhid

ByteField

1

advskew

ByteField

0

authlen

ByteField

0

demotion

ByteField

0

advbase

ByteField

0

chksum

XShortField

None

counter1

XIntField

0

counter2

XIntField

0

hmac1

XIntField

0

hmac2

XIntField

0

hmac3

XIntField

0

hmac4

XIntField

0

hmac5

XIntField

0

post_build(pkt, pay)[source]