UDP - User Datagram Protocol¶
pcapkit.protocols.transport.udp
contains
UDP
only,
which implements extractor for User Datagram Protocol
(UDP) *, whose structure is described as below:
Octets |
Bits |
Name |
Description |
---|---|---|---|
0 |
0 |
|
Source Port |
2 |
16 |
|
Destination Port |
4 |
32 |
|
Length (header includes) |
6 |
48 |
|
Checksum |
- class pcapkit.protocols.transport.udp.UDP(file=None, length=None, **kwargs)[source]¶
-
This class implements User Datagram Protocol.
This class currently supports parsing of the following protocols, which are registered in the
self.__proto__
attribute:Port Number
Protocol
80
- Parameters
*args (Any) – Arbitrary positional arguments.
**kwargs (Any) – Arbitrary keyword arguments.
- Return type
Protocol[PT]
- property name: Literal['User Datagram Protocol']¶
Name of current protocol.
- Return type
Literal
[‘User Datagram Protocol’]
- read(length=None, **kwargs)[source]¶
Read User Datagram Protocol (UDP).
Structure of UDP header [RFC 768]:
0 7 8 15 16 23 24 31 +--------+--------+--------+--------+ | Source | Destination | | Port | Port | +--------+--------+--------+--------+ | | | | Length | Checksum | +--------+--------+--------+--------+ | | data octets ... +---------------- ...
Data Structures¶
- class pcapkit.protocols.data.transport.udp.UDP(srcport, dstport, len, checksum)[source]¶
Bases:
Info
Data model for UDP protocol.
- Parameters
*args (VT) – Arbitrary positional arguments.
**kwargs (VT) – Arbitrary keyword arguments.
- Return type