scapy.layers.quic
QUIC
The draft of a very basic implementation of the structures from [RFC 9000]. This isn’t binded to UDP by default as currently too incomplete.
TODO: - payloads. - encryption. - automaton. - etc.
- class scapy.layers.quic.QUIC(_pkt, /)[source]
Bases:
Packet
- aliastypes
- classmethod dispatch_hook(_pkt=None, *args, **kargs)[source]
Returns the right class for the given data.
- match_subclass = True
- class scapy.layers.quic.QUIC_0RTT(_pkt, /, *, HeaderForm=1, FixedBit=1, LongPacketType=1, Reserved=0, PacketNumberLen=None, Version=1, DstConnIDLen=None, DstConnID=b'', SrcConnIDLen=None, SrcConnID=b'', Length=0, PacketNumber=None)[source]
Bases:
QUIC
- 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |H|F|LON|RES|PAC| VERSION | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | DSTCONNIDLEN | DSTCONNID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | SRCCONNIDLEN | SRCCONNID | LENGTH | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | PACKETNUMBER | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. QUIC_0RTT
QUIC_0RTT fields HeaderForm
1
FixedBit
BitField
(1 bit)1
LongPacketType
1
Reserved
BitField
(2 bits)0
PacketNumberLen
QuicPacketNumberBitFieldLenField
(2 bits)None
Version
1
DstConnIDLen
None
DstConnID
b''
SrcConnIDLen
None
SrcConnID
b''
Length
0
PacketNumber
MultipleTypeField
(ByteField, ShortField, ThreeBytesField, IntField, ByteField)0
- class scapy.layers.quic.QUIC_1RTT(_pkt, /, *, HeaderForm=0, FixedBit=1, SpinBit=0, Reserved=0, KeyPhase=0, PacketNumberLen=None, PacketNumber=None)[source]
Bases:
QUIC
- 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |H|F|S|RES|K|PAC| PACKETNUMBER | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. QUIC_1RTT
QUIC_1RTT fields HeaderForm
0
FixedBit
BitField
(1 bit)1
SpinBit
BitField
(1 bit)0
Reserved
BitField
(2 bits)0
KeyPhase
BitField
(1 bit)0
PacketNumberLen
QuicPacketNumberBitFieldLenField
(2 bits)None
PacketNumber
MultipleTypeField
(ByteField, ShortField, ThreeBytesField, IntField, ByteField)0
- class scapy.layers.quic.QUIC_ACK(_pkt, /, *, Type=2)[source]
Bases:
Packet
- aliastypes
- class scapy.layers.quic.QUIC_Handshake(_pkt, /, *, HeaderForm=1, FixedBit=1, LongPacketType=2, Reserved=0, PacketNumberLen=None, Version=1, DstConnIDLen=None, DstConnID=b'', SrcConnIDLen=None, SrcConnID=b'', Length=0, PacketNumber=None)[source]
Bases:
QUIC
- 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |H|F|LON|RES|PAC| VERSION | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | DSTCONNIDLEN | DSTCONNID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | SRCCONNIDLEN | SRCCONNID | LENGTH | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | PACKETNUMBER | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. QUIC_Handshake
QUIC_Handshake fields HeaderForm
1
FixedBit
BitField
(1 bit)1
LongPacketType
2
Reserved
BitField
(2 bits)0
PacketNumberLen
QuicPacketNumberBitFieldLenField
(2 bits)None
Version
1
DstConnIDLen
None
DstConnID
b''
SrcConnIDLen
None
SrcConnID
b''
Length
0
PacketNumber
MultipleTypeField
(ByteField, ShortField, ThreeBytesField, IntField, ByteField)0
- class scapy.layers.quic.QUIC_Initial(_pkt, /, *, HeaderForm=1, FixedBit=1, LongPacketType=0, Reserved=0, PacketNumberLen=None, Version=1, DstConnIDLen=None, DstConnID=b'', SrcConnIDLen=None, SrcConnID=b'', TokenLen=None, Token=b'', Length=0, PacketNumber=None)[source]
Bases:
QUIC
- 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |H|F|LON|RES|PAC| VERSION | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | DSTCONNIDLEN | DSTCONNID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | SRCCONNIDLEN | SRCCONNID | TOKENLEN | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | TOKEN | LENGTH | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | PACKETNUMBER | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. QUIC_Initial
QUIC_Initial fields HeaderForm
1
FixedBit
BitField
(1 bit)1
LongPacketType
0
Reserved
BitField
(2 bits)0
PacketNumberLen
QuicPacketNumberBitFieldLenField
(2 bits)None
Version
1
DstConnIDLen
None
DstConnID
b''
SrcConnIDLen
None
SrcConnID
b''
TokenLen
None
Token
b''
Length
0
PacketNumber
MultipleTypeField
(ByteField, ShortField, ThreeBytesField, IntField, ByteField)0
- class scapy.layers.quic.QUIC_PADDING(_pkt, /, *, Type=0)[source]
Bases:
Packet
- aliastypes
- class scapy.layers.quic.QUIC_PING(_pkt, /, *, Type=1)[source]
Bases:
Packet
- aliastypes
- class scapy.layers.quic.QUIC_Retry(_pkt, /, *, HeaderForm=1, FixedBit=1, LongPacketType=3, Unused=0, Version=1, DstConnIDLen=None, DstConnID=b'', SrcConnIDLen=None, SrcConnID=b'')[source]
Bases:
QUIC
- 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |H|F|LON| UNUSED| VERSION | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | DSTCONNIDLEN | DSTCONNID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | SRCCONNIDLEN | SRCCONNID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Fig. QUIC_Retry
QUIC_Retry fields HeaderForm
1
FixedBit
BitField
(1 bit)1
LongPacketType
3
Unused
BitField
(4 bits)0
Version
1
DstConnIDLen
None
DstConnID
b''
SrcConnIDLen
None
SrcConnID
b''
- class scapy.layers.quic.QUIC_Version(_pkt, /, *, HeaderForm=1, Unused=0, Version=0, DstConnIDLen=None, DstConnID=b'', SrcConnIDLen=None, SrcConnID=b'', SupportedVersions=[])[source]
Bases:
QUIC
- 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 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |H| UNUSED | VERSION | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | DSTCONNIDLEN | DSTCONNID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | SRCCONNIDLEN | SRCCONNID |SUPPORTEDVERSIO| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | +-+-+-+-+-+-+-+-+ Fig. QUIC_Version
QUIC_Version fields HeaderForm
1
Unused
BitField
(7 bits)0
Version
0
DstConnIDLen
None
DstConnID
b''
SrcConnIDLen
None
SrcConnID
b''
SupportedVersions
[]
- class scapy.layers.quic.QuicPacketNumberBitFieldLenField(name: str, default: I | None, size: int, tot_size: int = 0, end_tot_size: int = 0)[source]
Bases:
BitField
- class scapy.layers.quic.QuicVarEnumField(name: str, default: int | None, enum: Any)[source]
Bases:
QuicVarIntField
,_EnumField
[int
]- i2s: Dict[I, str] | None
- i2s_cb: Callable[[I], str] | None
- s2i: Dict[str, I] | None
- s2i_cb: Callable[[str], I] | None
- class scapy.layers.quic.QuicVarIntField(name: str, default: Any, fmt: str = 'H')[source]
Bases:
Field
[int
,int
]
- class scapy.layers.quic.QuicVarLenField(name: str, default: Optional[Any], length_of: Optional[str] = None, fmt: str = 'H', count_of: Optional[str] = None, adjust: Callable[[Packet, int], int] = <function FieldLenField.<lambda>>)[source]
Bases:
FieldLenField
,QuicVarIntField