dhcpkit_vpp.protocols package

Classes and constants for protocol implementations

class dhcpkit_vpp.protocols.Layer2Frame[source]

Bases: dhcpkit.protocol_element.ProtocolElement

Base class for layer 2 frames

class dhcpkit_vpp.protocols.Layer3Packet[source]

Bases: dhcpkit.protocol_element.ProtocolElement

Base class for layer 3 packets

get_pseudo_header(for_payload: dhcpkit_vpp.protocols.Layer4Protocol) → bytes[source]

Return the pseudo header for this protocol

Parameters:for_payload – Get the pseudo header for the given layer 4 protocol
Returns:The pseudo header bytes
class dhcpkit_vpp.protocols.Layer4Protocol[source]

Bases: dhcpkit.protocol_element.ProtocolElement

Base class for layer 4 protocols

length

Return the length of this protocol+payload

Returns:The length
protocol_number = 0
save(zero_checksum: bool = False, recalculate_checksum_for: Optional[dhcpkit_vpp.protocols.Layer3Packet] = None) → bytearray[source]

Save the internal state of this object as a buffer.

Parameters:
  • zero_checksum – Save with zeroes where the checksum should be
  • recalculate_checksum_for – Recalculate the checksum for the given layer 3 packet headers
Returns:

The buffer with the data from this element