Pcpp Module
Bindings for ::pcpp namespace
- class mtf.libs.mtf_pybinder.pcpp.AndFilter
A class for connecting several filters into one filter with logical “and” between them. For example: if the 2 filters are: “IPv4 address = x.x.x.x” + “TCP port dst = 80”, then the new filter will be: “IPv4 address = x.x.x.x _AND_ TCP port dst = 80”<BR> This class follows the composite design pattern<BR> For deeper understanding of the filter concept please refer to PcapFilter.h
add some methods: “addFilter”, “removeFilter”, “clearAllFilter”
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.AndFilter) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.AndFilter, filters: std::vector<pcpp::GeneralFilter * __ptr64,std::allocator<pcpp::GeneralFilter * __ptr64> >) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.AndFilter, arg0: mtf.libs.mtf_pybinder.pcpp.AndFilter) -> None
- __new__(**kwargs)
- add_filter(self: mtf.libs.mtf_pybinder.pcpp.AndFilter, filter: mtf.libs.mtf_pybinder.pcpp.GeneralFilter) None
Add filter to the and condition
The filter to add
- Args:
filter (str)
- Returns:
void
- assign(self: mtf.libs.mtf_pybinder.pcpp.AndFilter, : mtf.libs.mtf_pybinder.pcpp.AndFilter) mtf.libs.mtf_pybinder.pcpp.AndFilter
- Returns:
pcpp.AndFilter
- match_packet_with_filter(self: mtf.libs.mtf_pybinder.pcpp.GeneralFilter, raw_packet: mtf.libs.mtf_pybinder.pcpp.RawPacket) bool
Match a raw packet with a given BPF filter.
A pointer to the raw packet to match the BPF filter with True if a raw packet matches the BPF filter or false otherwise
- Args:
raw_packet (str)
- Returns:
bool
- parse_to_string(self: mtf.libs.mtf_pybinder.pcpp.GeneralFilter, result: str) None
A method that parses the class instance into BPF string format
An empty string that the parsing will be written into. If the string isn’t empty, its content will be overridden
- Args:
result (str)
- Returns:
void
- set_filters(self: mtf.libs.mtf_pybinder.pcpp.AndFilter, filters: std::vector<pcpp::GeneralFilter * __ptr64, std::allocator<pcpp::GeneralFilter * __ptr64> >) None
Remove the current filters and set new ones
The new filters to set. The previous ones will be removed
- Args:
filters (str)
- Returns:
void
- class mtf.libs.mtf_pybinder.pcpp.ArpFilter
A class for filtering ARP packets according the ARP opcode. When using this filter only ARP packets with the relevant opcode will be received <BR> For deeper understanding of the filter concept please refer to PcapFilter.h
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.ArpFilter, op_code: mtf.libs.mtf_pybinder.pcpp.ArpOpcode) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.ArpFilter, arg0: mtf.libs.mtf_pybinder.pcpp.ArpFilter) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.ArpFilter, : mtf.libs.mtf_pybinder.pcpp.ArpFilter) mtf.libs.mtf_pybinder.pcpp.ArpFilter
- Returns:
pcpp.ArpFilter
- match_packet_with_filter(self: mtf.libs.mtf_pybinder.pcpp.GeneralFilter, raw_packet: mtf.libs.mtf_pybinder.pcpp.RawPacket) bool
Match a raw packet with a given BPF filter.
A pointer to the raw packet to match the BPF filter with True if a raw packet matches the BPF filter or false otherwise
- Args:
raw_packet (str)
- Returns:
bool
- parse_to_string(self: mtf.libs.mtf_pybinder.pcpp.GeneralFilter, result: str) None
A method that parses the class instance into BPF string format
An empty string that the parsing will be written into. If the string isn’t empty, its content will be overridden
- Args:
result (str)
- Returns:
void
- set_op_code(self: mtf.libs.mtf_pybinder.pcpp.ArpFilter, op_code: mtf.libs.mtf_pybinder.pcpp.ArpOpcode) None
Set the ARP opcode
The ARP opcode: ::ARP_REQUEST or ::ARP_REPLY
- Args:
op_code (str)
- Returns:
void
- class mtf.libs.mtf_pybinder.pcpp.ArpLayer
Represents an ARP protocol layer. Currently only IPv4 ARP messages are supported
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.ArpLayer, op_code: mtf.libs.mtf_pybinder.pcpp.ArpOpcode = <ArpOpcode.ARP_REQUEST: 1>, sender_mac_addr: mtf.libs.mtf_pybinder.pcpp.MacAddress = <mtf.libs.mtf_pybinder.pcpp.MacAddress object at 0x00000243618ABB70>, target_mac_addr: mtf.libs.mtf_pybinder.pcpp.MacAddress = <mtf.libs.mtf_pybinder.pcpp.MacAddress object at 0x00000243618ABB30>, sender_ip_addr: mtf.libs.mtf_pybinder.pcpp.IPv4Address = <mtf.libs.mtf_pybinder.pcpp.IPv4Address object at 0x00000243618ABAF0>, target_ip_addr: mtf.libs.mtf_pybinder.pcpp.IPv4Address = <mtf.libs.mtf_pybinder.pcpp.IPv4Address object at 0x0000024361874670>) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.ArpLayer, arg0: mtf.libs.mtf_pybinder.pcpp.ArpLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.ArpLayer, arg0: mtf.libs.mtf_pybinder.pcpp.ArpLayer) -> None
- __new__(**kwargs)
- property arp_protocol_type
Property protocolType from the header uint16_t
- assign(self: mtf.libs.mtf_pybinder.pcpp.ArpLayer, : mtf.libs.mtf_pybinder.pcpp.ArpLayer) mtf.libs.mtf_pybinder.pcpp.ArpLayer
- Returns:
pcpp.ArpLayer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- property drarp_error_status
Property drarp_error_status from the DRARP_ERROR message header. If the layer is not DRARP_ERROR, this property cannot be set, and will return DRARPERR_UNKNOWN (0).
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property hardware_size
Property hardwareSize from the header uint8_t
- property hardware_type
Property hardwareType from the header uint16_t
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- is_reply(self: mtf.libs.mtf_pybinder.pcpp.ArpLayer) bool
Is this packet an ARP reply?
- Returns:
bool
- is_request(self: mtf.libs.mtf_pybinder.pcpp.ArpLayer) bool
Is this packet an ARP request?
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property op_code
Property opcode from the header uint16_t
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_size
Property protocolSize from the header uint8_t
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property sender_ip_addr
The sender protocol address (SPA) in the form of IPv4Address
- property sender_mac_address
The sender hardware address (SHA) in the form of MacAddress
- property target_ip_addr
The target protocol address (TPA) in the form of IPv4Address
- property target_mac_address
The target hardware address (THA) in the form of MacAddress
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.ArpOpcode
An enum for ARP message type
Members:
ARP_REQUEST
ARP_REPLY
RARP_REQUEST
RARP_REPLY
DRARP_REQUEST
DRARP_REPLY
DRARP_ERROR
INARP_REQUEST
INARP_REPLY
- ARP_REPLY
- ARP_REQUEST
- DRARP_ERROR
- DRARP_REPLY
- DRARP_REQUEST
- INARP_REPLY
- INARP_REQUEST
- RARP_REPLY
- RARP_REQUEST
- __init__(self: mtf.libs.mtf_pybinder.pcpp.ArpOpcode, value: int) None
- __new__(**kwargs)
- property name
- property value
- class mtf.libs.mtf_pybinder.pcpp.AuthenticationHeaderLayer
Represents an IPSec AuthenticationHeader (AH) layer
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.AuthenticationHeaderLayer, arg0: mtf.libs.mtf_pybinder.pcpp.AuthenticationHeaderLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.AuthenticationHeaderLayer, arg0: mtf.libs.mtf_pybinder.pcpp.AuthenticationHeaderLayer) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.AuthenticationHeaderLayer, : mtf.libs.mtf_pybinder.pcpp.AuthenticationHeaderLayer) mtf.libs.mtf_pybinder.pcpp.AuthenticationHeaderLayer
- Returns:
pcpp.AuthenticationHeaderLayer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- property icv_bytes
Integrity Check Value (ICV) data
- property icv_hex_stream
The value of the Integrity Check Value (ICV) as a hex string
- property icv_length
The size of the Integrity Check Value (ICV)
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- static is_data_valid(data: int, data_len: int) bool
A static method that validates the input data
- Args:
data (bytes): The pointer to the beginning of a byte stream of a AuthenticationHeader layer data_len (unsigned int): The length of byte stream
- Returns:
bool: True if the data is valid and can represent an AuthenticationHeader layer
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property sequence_number
The sequence number value
- property spi
The Security Parameters Index (SPI) field value
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.BPFStringFilter
This class can be loaded with a BPF filter string and then can be used to verify the string is valid.<BR>
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.BPFStringFilter, filter_str: str) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.BPFStringFilter, arg0: mtf.libs.mtf_pybinder.pcpp.BPFStringFilter) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.GeneralFilter, : mtf.libs.mtf_pybinder.pcpp.GeneralFilter) mtf.libs.mtf_pybinder.pcpp.GeneralFilter
- Returns:
pcpp.GeneralFilter
- match_packet_with_filter(self: mtf.libs.mtf_pybinder.pcpp.GeneralFilter, raw_packet: mtf.libs.mtf_pybinder.pcpp.RawPacket) bool
Match a raw packet with a given BPF filter.
A pointer to the raw packet to match the BPF filter with True if a raw packet matches the BPF filter or false otherwise
- Args:
raw_packet (str)
- Returns:
bool
- parse_to_string(self: mtf.libs.mtf_pybinder.pcpp.GeneralFilter, result: str) None
A method that parses the class instance into BPF string format
An empty string that the parsing will be written into. If the string isn’t empty, its content will be overridden
- Args:
result (str)
- Returns:
void
- verify_filter(self: mtf.libs.mtf_pybinder.pcpp.BPFStringFilter) bool
Verify the filter is valid
True if the filter is valid or false otherwise
- Returns:
bool
- class mtf.libs.mtf_pybinder.pcpp.BapLayer
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.BapLayer, data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.BapLayer, data: int, data_len: int, copy_data: bool) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.BapLayer, data: bytes) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.BapLayer, message_type: mtf.libs.mtf_pybinder.pcpp.BapMessageType, suffix_len: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.BapLayer, arg0: mtf.libs.mtf_pybinder.pcpp.BapLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.BapLayer, arg0: mtf.libs.mtf_pybinder.pcpp.BapLayer) -> None
- __new__(**kwargs)
- static add_port(port: int) None
- Args:
port (str)
- assign(self: mtf.libs.mtf_pybinder.pcpp.BapLayer, : mtf.libs.mtf_pybinder.pcpp.BapLayer) mtf.libs.mtf_pybinder.pcpp.BapLayer
- Returns:
pcpp.BapLayer
- static clear_ports() None
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- get_segmented_fct_id_extended_msg(self: mtf.libs.mtf_pybinder.pcpp.BapLayer) mtf.libs.mtf_pybinder.pcpp.SegmentedFctIdExtendedMsg
- Returns:
pcpp.SegmentedFctIdExtendedMsg
- get_segmented_length_extended_msg(self: mtf.libs.mtf_pybinder.pcpp.BapLayer) mtf.libs.mtf_pybinder.pcpp.SegmentedLengthExtendedMsg
- Returns:
pcpp.SegmentedLengthExtendedMsg
- get_segmented_length_fct_id_extended_msg(self: mtf.libs.mtf_pybinder.pcpp.BapLayer) mtf.libs.mtf_pybinder.pcpp.SegmentedLengthFctIdExtendedMsg
- Returns:
pcpp.SegmentedLengthFctIdExtendedMsg
- get_segmented_msg(self: mtf.libs.mtf_pybinder.pcpp.BapLayer) mtf.libs.mtf_pybinder.pcpp.SegmentedMsg
- Returns:
pcpp.SegmentedMsg
- get_segmented_sequence_msg(self: mtf.libs.mtf_pybinder.pcpp.BapLayer) mtf.libs.mtf_pybinder.pcpp.SegmentedSequenceMsg
- Returns:
pcpp.SegmentedSequenceMsg
- get_unsegmented_fct_id_extended_msg(self: mtf.libs.mtf_pybinder.pcpp.BapLayer) mtf.libs.mtf_pybinder.pcpp.UnsegmentedFctIdExtendedMsg
- Returns:
pcpp.UnsegmentedFctIdExtendedMsg
- get_unsegmented_msg(self: mtf.libs.mtf_pybinder.pcpp.BapLayer) mtf.libs.mtf_pybinder.pcpp.UnsegmentedMsg
- Returns:
pcpp.UnsegmentedMsg
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- static is_extended_id(id: int) bool
- Args:
id (unsigned int)
- Returns:
bool
- is_fct_id_extended(self: mtf.libs.mtf_pybinder.pcpp.BapLayer) bool
- Returns:
bool
- is_segmented(self: mtf.libs.mtf_pybinder.pcpp.BapLayer) bool
- Returns:
bool
- is_segmented_length_extended(self: mtf.libs.mtf_pybinder.pcpp.BapLayer) bool
- Returns:
bool
- is_segmented_start(self: mtf.libs.mtf_pybinder.pcpp.BapLayer) bool
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property msg_type
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property seg_sequence_payload
A method that get the segmented sequence payload to reassemble the segmented packet:
- property seg_start_payload_with_header
A method that get the segmented start payload with the header to reassemble the segmented packet:
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.BapMessageType
Members:
UNSEGMENTED_MSG
UNSEGMENTED_FCTID_EXTENDED_MSG
SEGMENTED_MSG
SEGMENTED_LENGTH_EXTENDED_MSG
SEGMENTED_FCTID_EXTENDED_MSG
SEGMENTED_LENGTH_FCTID_EXTENDED_MSG
SEGMENTED_SEQUENCE_MSG
INVALID_BAP_MSG
- INVALID_BAP_MSG
- SEGMENTED_FCTID_EXTENDED_MSG
- SEGMENTED_LENGTH_EXTENDED_MSG
- SEGMENTED_LENGTH_FCTID_EXTENDED_MSG
- SEGMENTED_MSG
- SEGMENTED_SEQUENCE_MSG
- UNSEGMENTED_FCTID_EXTENDED_MSG
- UNSEGMENTED_MSG
- __init__(self: mtf.libs.mtf_pybinder.pcpp.BapMessageType, value: int) None
- __new__(**kwargs)
- property name
- property value
- class mtf.libs.mtf_pybinder.pcpp.BgpKeepaliveMessageLayer
Represents a BGP v4 KEEPALIVE message
- class BgpMessageType
An enum representing BGP message types
Members:
Open
Update
Notification
Keepalive
RouteRefresh
- Keepalive
- Notification
- Open
- RouteRefresh
- Update
- __init__(self: mtf.libs.mtf_pybinder.pcpp.BgpLayer.BgpMessageType, value: int) None
- __new__(**kwargs)
- property name
- property value
- Keepalive
- Notification
- Open
- RouteRefresh
- Update
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.BgpKeepaliveMessageLayer, data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.BgpKeepaliveMessageLayer) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.BgpKeepaliveMessageLayer, : mtf.libs.mtf_pybinder.pcpp.BgpKeepaliveMessageLayer) mtf.libs.mtf_pybinder.pcpp.BgpKeepaliveMessageLayer
- Returns:
pcpp.BgpKeepaliveMessageLayer
- class bgp_common_header
- __init__(self: mtf.libs.mtf_pybinder.pcpp.BgpLayer.bgp_common_header) None
- __new__(**kwargs)
- property length
- property message_type
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.BgpLayer) None
Calculates the basic BGP fields: - Set marker to all ones - Set message type value - Set messagelength
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_bgp_message_type(self: mtf.libs.mtf_pybinder.pcpp.BgpKeepaliveMessageLayer) mtf.libs.mtf_pybinder.pcpp.BgpLayer.BgpMessageType
- Returns:
enum pcpp.BgpLayer.BgpMessageType
- get_header_len(self: mtf.libs.mtf_pybinder.pcpp.BgpLayer) int
The size of the BGP message
- Returns:
unsigned int
- get_keepalive_header(self: mtf.libs.mtf_pybinder.pcpp.BgpKeepaliveMessageLayer) mtf.libs.mtf_pybinder.pcpp.BgpLayer.bgp_common_header
Get a pointer to the KeepAlive message data. Notice this points directly to the data, so any change will modify the actual packet data
- Returns:
pcpp.BgpLayer.bgp_common_header: A pointer to a bgp_keepalive_message structure containing the data
- get_message_type_as_string(self: mtf.libs.mtf_pybinder.pcpp.BgpLayer) str
BGP message type as string. Return value can be one of the following: “OPEN”, “UPDATE”, “NOTIFICATION”,”KEEPALIVE”, “ROUTE-REFRESH”, “Unknown”
- Returns:
str
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_osi_model_layer(self: mtf.libs.mtf_pybinder.pcpp.BgpLayer) mtf.libs.mtf_pybinder.pcpp.OsiModelLayer
- Returns:
enum pcpp.OsiModelLayer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- static is_bgp_port(port_src: int, port_dst: int) bool
A static method that checks whether a source or dest port match those associated with the BGP protocol
- Args:
port_src (unsigned int): Source port number to check port_dst (unsigned int): Dest port number to check
- Returns:
bool: True if the source or dest port matchthose associated with the BGP protocol
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- static parse_bgp_layer(data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) mtf.libs.mtf_pybinder.pcpp.BgpLayer
A method that creates a BGP layer from packet raw data
- Args:
data (bytes): A pointer to the raw data data_len (unsigned int): Size of the data inbytes prev_layer (pcpp.Layer): A pointer to the previous layer packet (pcpp.Packet): A pointer to the Packet instance where layer will be stored
- Returns:
pcpp.BgpLayer: A newly allocated BGP layer of one of the following types (according to the message type):
BgpOpenMessageLayer,BgpUpdateMessageLayer, BgpNotificationMessageLayer, BgpKeepaliveMessageLayer, BgpRouteRefreshMessageLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.BgpLayer) None
Multiple BGP messages can reside in a single packet, and the only layer that can come after a BGP message isanother BGP message. This method checks for remaining data and parses it as another BGP layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- to_string(self: mtf.libs.mtf_pybinder.pcpp.BgpLayer) str
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.BgpLayer
Represents Border Gateway Protocol (BGP) v4 protocol layer. This is an abstract class that cannot be instantiated, and contains functionality which is common to all BGP message types.
- class BgpMessageType
An enum representing BGP message types
Members:
Open
Update
Notification
Keepalive
RouteRefresh
- Keepalive
- Notification
- Open
- RouteRefresh
- Update
- __init__(self: mtf.libs.mtf_pybinder.pcpp.BgpLayer.BgpMessageType, value: int) None
- __new__(**kwargs)
- property name
- property value
- Keepalive
- Notification
- Open
- RouteRefresh
- Update
- __init__(self: mtf.libs.mtf_pybinder.pcpp.BgpLayer, arg0: mtf.libs.mtf_pybinder.pcpp.BgpLayer) None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.BgpLayer, : mtf.libs.mtf_pybinder.pcpp.BgpLayer) mtf.libs.mtf_pybinder.pcpp.BgpLayer
- Returns:
pcpp.BgpLayer
- class bgp_common_header
- __init__(self: mtf.libs.mtf_pybinder.pcpp.BgpLayer.bgp_common_header) None
- __new__(**kwargs)
- property length
- property message_type
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.BgpLayer) None
Calculates the basic BGP fields: - Set marker to all ones - Set message type value - Set messagelength
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_bgp_message_type(self: mtf.libs.mtf_pybinder.pcpp.BgpLayer) mtf.libs.mtf_pybinder.pcpp.BgpLayer.BgpMessageType
BGP message type
- Returns:
enum pcpp.BgpLayer.BgpMessageType
- get_header_len(self: mtf.libs.mtf_pybinder.pcpp.BgpLayer) int
The size of the BGP message
- Returns:
unsigned int
- get_message_type_as_string(self: mtf.libs.mtf_pybinder.pcpp.BgpLayer) str
BGP message type as string. Return value can be one of the following: “OPEN”, “UPDATE”, “NOTIFICATION”,”KEEPALIVE”, “ROUTE-REFRESH”, “Unknown”
- Returns:
str
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_osi_model_layer(self: mtf.libs.mtf_pybinder.pcpp.BgpLayer) mtf.libs.mtf_pybinder.pcpp.OsiModelLayer
- Returns:
enum pcpp.OsiModelLayer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- static is_bgp_port(port_src: int, port_dst: int) bool
A static method that checks whether a source or dest port match those associated with the BGP protocol
- Args:
port_src (unsigned int): Source port number to check port_dst (unsigned int): Dest port number to check
- Returns:
bool: True if the source or dest port matchthose associated with the BGP protocol
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- static parse_bgp_layer(data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) mtf.libs.mtf_pybinder.pcpp.BgpLayer
A method that creates a BGP layer from packet raw data
- Args:
data (bytes): A pointer to the raw data data_len (unsigned int): Size of the data inbytes prev_layer (pcpp.Layer): A pointer to the previous layer packet (pcpp.Packet): A pointer to the Packet instance where layer will be stored
- Returns:
pcpp.BgpLayer: A newly allocated BGP layer of one of the following types (according to the message type):
BgpOpenMessageLayer,BgpUpdateMessageLayer, BgpNotificationMessageLayer, BgpKeepaliveMessageLayer, BgpRouteRefreshMessageLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.BgpLayer) None
Multiple BGP messages can reside in a single packet, and the only layer that can come after a BGP message isanother BGP message. This method checks for remaining data and parses it as another BGP layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- to_string(self: mtf.libs.mtf_pybinder.pcpp.BgpLayer) str
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.BgpNotificationMessageLayer
Represents a BGP v4 NOTIFICATION message
- class BgpMessageType
An enum representing BGP message types
Members:
Open
Update
Notification
Keepalive
RouteRefresh
- Keepalive
- Notification
- Open
- RouteRefresh
- Update
- __init__(self: mtf.libs.mtf_pybinder.pcpp.BgpLayer.BgpMessageType, value: int) None
- __new__(**kwargs)
- property name
- property value
- Keepalive
- Notification
- Open
- RouteRefresh
- Update
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.BgpNotificationMessageLayer, data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.BgpNotificationMessageLayer, error_code: int, error_sub_code: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.BgpNotificationMessageLayer, error_code: int, error_sub_code: int, notification_data: int, notification_data_len: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.BgpNotificationMessageLayer, error_code: int, error_sub_code: int, notification_data: str) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.BgpNotificationMessageLayer, : mtf.libs.mtf_pybinder.pcpp.BgpNotificationMessageLayer) mtf.libs.mtf_pybinder.pcpp.BgpNotificationMessageLayer
- Returns:
pcpp.BgpNotificationMessageLayer
- class bgp_common_header
- __init__(self: mtf.libs.mtf_pybinder.pcpp.BgpLayer.bgp_common_header) None
- __new__(**kwargs)
- property length
- property message_type
- class bgp_notification_message
- __init__(self: mtf.libs.mtf_pybinder.pcpp.BgpNotificationMessageLayer.bgp_notification_message) None
- __new__(**kwargs)
- property error_code
- property error_sub_code
- property length
- property message_type
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.BgpLayer) None
Calculates the basic BGP fields: - Set marker to all ones - Set message type value - Set messagelength
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_bgp_message_type(self: mtf.libs.mtf_pybinder.pcpp.BgpNotificationMessageLayer) mtf.libs.mtf_pybinder.pcpp.BgpLayer.BgpMessageType
- Returns:
enum pcpp.BgpLayer.BgpMessageType
- get_header_len(self: mtf.libs.mtf_pybinder.pcpp.BgpLayer) int
The size of the BGP message
- Returns:
unsigned int
- get_message_type_as_string(self: mtf.libs.mtf_pybinder.pcpp.BgpLayer) str
BGP message type as string. Return value can be one of the following: “OPEN”, “UPDATE”, “NOTIFICATION”,”KEEPALIVE”, “ROUTE-REFRESH”, “Unknown”
- Returns:
str
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_notification_data(self: mtf.libs.mtf_pybinder.pcpp.BgpNotificationMessageLayer) int
A pointer to the notification data. Notification data is a variable-length field used to diagnose the reason for the BGP NOTIFICATION
- Returns:
bytes
- get_notification_data_as_hex_string(self: mtf.libs.mtf_pybinder.pcpp.BgpNotificationMessageLayer) str
A hex string which represents the notification data. Notification data is a variable-length field used to diagnose the reason for the BGP NOTIFICATION
- Returns:
str
- get_notification_data_len(self: mtf.libs.mtf_pybinder.pcpp.BgpNotificationMessageLayer) int
The size in [bytes] of the notification data. Notification data is a variable-length field used to diagnose the reason for the BGP NOTIFICATION
- Returns:
unsigned int
- get_notification_msg_header(self: mtf.libs.mtf_pybinder.pcpp.BgpNotificationMessageLayer) pcpp::BgpNotificationMessageLayer::bgp_notification_message
Get a pointer to the notification message data. Notice this points directly to the data, so any change will modify the actual packet data
- Returns:
pcpp.BgpNotificationMessageLayer.bgp_notification_message: A pointer to a bgp_notification_message structure containing the data
- get_osi_model_layer(self: mtf.libs.mtf_pybinder.pcpp.BgpLayer) mtf.libs.mtf_pybinder.pcpp.OsiModelLayer
- Returns:
enum pcpp.OsiModelLayer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- static is_bgp_port(port_src: int, port_dst: int) bool
A static method that checks whether a source or dest port match those associated with the BGP protocol
- Args:
port_src (unsigned int): Source port number to check port_dst (unsigned int): Dest port number to check
- Returns:
bool: True if the source or dest port matchthose associated with the BGP protocol
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- static parse_bgp_layer(data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) mtf.libs.mtf_pybinder.pcpp.BgpLayer
A method that creates a BGP layer from packet raw data
- Args:
data (bytes): A pointer to the raw data data_len (unsigned int): Size of the data inbytes prev_layer (pcpp.Layer): A pointer to the previous layer packet (pcpp.Packet): A pointer to the Packet instance where layer will be stored
- Returns:
pcpp.BgpLayer: A newly allocated BGP layer of one of the following types (according to the message type):
BgpOpenMessageLayer,BgpUpdateMessageLayer, BgpNotificationMessageLayer, BgpKeepaliveMessageLayer, BgpRouteRefreshMessageLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.BgpLayer) None
Multiple BGP messages can reside in a single packet, and the only layer that can come after a BGP message isanother BGP message. This method checks for remaining data and parses it as another BGP layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- set_notification_data(*args, **kwargs)
Overloaded function.
set_notification_data(self: mtf.libs.mtf_pybinder.pcpp.BgpNotificationMessageLayer, new_notification_data: int, new_notification_data_len: int) -> bool
Set the notification data. This method will extend or shorten the existing layer to include the new notification data. If newNotificationData is NULL or newNotificationDataLen is zero then notification data will be set to none.
- Args:
new_notification_data (bytes): A byte array containing the new notification data new_notification_data_len (unsigned int): The size of the byte array
- Returns:
bool: True if notification data was set successfully or false if any error occurred. In case of an error an appropriate
error message will be printed to log
set_notification_data(self: mtf.libs.mtf_pybinder.pcpp.BgpNotificationMessageLayer, new_notification_data_as_hex_string: str) -> bool
Set the notification data. This method will extend or shorten the existing layer to include the new notification data. If newNotificationDataAsHexString is an empty string then notification data will be set to none.
- Args:
new_notification_data_as_hex_string (str): A hex string representing the new notification data. If the string is not a valid hex string
no data will be changed and an error will be returned
- Returns:
bool: True if notification data was set successfully or false if any error occurred or if the string is not a valid hex string.
In case of an error an appropriate error message will be printed to log
- to_string(self: mtf.libs.mtf_pybinder.pcpp.BgpLayer) str
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.BgpOpenMessageLayer
Represents a BGP v4 OPEN message
- class BgpMessageType
An enum representing BGP message types
Members:
Open
Update
Notification
Keepalive
RouteRefresh
- Keepalive
- Notification
- Open
- RouteRefresh
- Update
- __init__(self: mtf.libs.mtf_pybinder.pcpp.BgpLayer.BgpMessageType, value: int) None
- __new__(**kwargs)
- property name
- property value
- Keepalive
- Notification
- Open
- RouteRefresh
- Update
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.BgpOpenMessageLayer, data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.BgpOpenMessageLayer, arg0: int, arg1: int, arg2: mtf.libs.mtf_pybinder.pcpp.IPv4Address) -> None
doc
__init__(self: mtf.libs.mtf_pybinder.pcpp.BgpOpenMessageLayer, my_autonomous_system: int, hold_time: int, bgp_id: mtf.libs.mtf_pybinder.pcpp.IPv4Address, optional_params: list[pcpp::BgpOpenMessageLayer::optional_parameter]) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.BgpOpenMessageLayer, : mtf.libs.mtf_pybinder.pcpp.BgpOpenMessageLayer) mtf.libs.mtf_pybinder.pcpp.BgpOpenMessageLayer
- Returns:
pcpp.BgpOpenMessageLayer
- class bgp_common_header
- __init__(self: mtf.libs.mtf_pybinder.pcpp.BgpLayer.bgp_common_header) None
- __new__(**kwargs)
- property length
- property message_type
- class bgp_open_message
- __init__(self: mtf.libs.mtf_pybinder.pcpp.BgpOpenMessageLayer.bgp_open_message) None
- __new__(**kwargs)
- property bgp_id
- property hold_time
- property length
- property message_type
- property my_autonomous_system
- property optional_parameter_length
- property version
- clear_optional_parameters(self: mtf.libs.mtf_pybinder.pcpp.BgpOpenMessageLayer) bool
Clear all optional parameters currently in the message. This is equivalent to calling setOptionalParameters() with an empty vector as a parameter
- Returns:
bool: True if all optional parameters were successfully cleared or false otherwise. In case of an error an appropriate message
will be printed to log
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.BgpLayer) None
Calculates the basic BGP fields: - Set marker to all ones - Set message type value - Set messagelength
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_bgp_id(self: mtf.libs.mtf_pybinder.pcpp.BgpOpenMessageLayer) mtf.libs.mtf_pybinder.pcpp.IPv4Address
The BGP identifier as IPv4Address object
- Returns:
pcpp.IPv4Address
- get_bgp_message_type(self: mtf.libs.mtf_pybinder.pcpp.BgpOpenMessageLayer) mtf.libs.mtf_pybinder.pcpp.BgpLayer.BgpMessageType
- Returns:
enum pcpp.BgpLayer.BgpMessageType
- get_header_len(self: mtf.libs.mtf_pybinder.pcpp.BgpLayer) int
The size of the BGP message
- Returns:
unsigned int
- get_message_type_as_string(self: mtf.libs.mtf_pybinder.pcpp.BgpLayer) str
BGP message type as string. Return value can be one of the following: “OPEN”, “UPDATE”, “NOTIFICATION”,”KEEPALIVE”, “ROUTE-REFRESH”, “Unknown”
- Returns:
str
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_open_msg_header(self: mtf.libs.mtf_pybinder.pcpp.BgpOpenMessageLayer) pcpp::BgpOpenMessageLayer::bgp_open_message
Get a pointer to the open message data. Notice this points directly to the data, so any change will modify the actual packet data
- Returns:
pcpp.BgpOpenMessageLayer.bgp_open_message: A pointer to a bgp_open_message structure containing the data
- get_optional_parameters(self: mtf.libs.mtf_pybinder.pcpp.BgpOpenMessageLayer, optional_parameters: list[pcpp::BgpOpenMessageLayer::optional_parameter]) None
Get a vector of the optional parameters in the message
- Args:
optional_parameters (list[pcpp.BgpOpenMessageLayer.optional_parameter]): The vector where the optional parameters will be written to. This method doesn’t remove any
existing data on this vector before pushing data to it
- get_optional_parameters_length(self: mtf.libs.mtf_pybinder.pcpp.BgpOpenMessageLayer) int
The length in [bytes] of the optional parameters data in the message
- Returns:
unsigned int
- get_osi_model_layer(self: mtf.libs.mtf_pybinder.pcpp.BgpLayer) mtf.libs.mtf_pybinder.pcpp.OsiModelLayer
- Returns:
enum pcpp.OsiModelLayer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- static is_bgp_port(port_src: int, port_dst: int) bool
A static method that checks whether a source or dest port match those associated with the BGP protocol
- Args:
port_src (unsigned int): Source port number to check port_dst (unsigned int): Dest port number to check
- Returns:
bool: True if the source or dest port matchthose associated with the BGP protocol
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- class optional_parameter
A structure that represents BGP OPEN message optional parameters
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.BgpOpenMessageLayer.optional_parameter) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.BgpOpenMessageLayer.optional_parameter, type_val: int, value_as_hex_string: str) -> None
- __new__(**kwargs)
- property length
- property type
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- static parse_bgp_layer(data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) mtf.libs.mtf_pybinder.pcpp.BgpLayer
A method that creates a BGP layer from packet raw data
- Args:
data (bytes): A pointer to the raw data data_len (unsigned int): Size of the data inbytes prev_layer (pcpp.Layer): A pointer to the previous layer packet (pcpp.Packet): A pointer to the Packet instance where layer will be stored
- Returns:
pcpp.BgpLayer: A newly allocated BGP layer of one of the following types (according to the message type):
BgpOpenMessageLayer,BgpUpdateMessageLayer, BgpNotificationMessageLayer, BgpKeepaliveMessageLayer, BgpRouteRefreshMessageLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.BgpLayer) None
Multiple BGP messages can reside in a single packet, and the only layer that can come after a BGP message isanother BGP message. This method checks for remaining data and parses it as another BGP layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- set_bgp_id(self: mtf.libs.mtf_pybinder.pcpp.BgpOpenMessageLayer, new_bgp_id: mtf.libs.mtf_pybinder.pcpp.IPv4Address) None
Set the BGP identifier BGP identifier to set. If value is not a valid IPv4 address it won’t be set
- Args:
new_bgp_id (pcpp.IPv4Address)
- set_optional_parameters(self: mtf.libs.mtf_pybinder.pcpp.BgpOpenMessageLayer, optional_parameters: list[pcpp::BgpOpenMessageLayer::optional_parameter]) bool
Set optional parameters in the message. This method will override all existing optional parameters currently in the message. If the input is an empty vector all optional parameters will be cleared. This method automatically sets the bgp_common_header#length and the bgp_open_message#optionalParameterLength fields on the message
- Args:
optional_parameters (list[pcpp.BgpOpenMessageLayer.optional_parameter]): A vector of new optional parameters to set in the message
- Returns:
bool: True if all optional parameters were set successfully or false otherwise. In case of an error an appropriate message
will be printed to log
- to_string(self: mtf.libs.mtf_pybinder.pcpp.BgpLayer) str
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.BgpRouteRefreshMessageLayer
Represents a BGP v4 ROUTE-REFRESH message
- class BgpMessageType
An enum representing BGP message types
Members:
Open
Update
Notification
Keepalive
RouteRefresh
- Keepalive
- Notification
- Open
- RouteRefresh
- Update
- __init__(self: mtf.libs.mtf_pybinder.pcpp.BgpLayer.BgpMessageType, value: int) None
- __new__(**kwargs)
- property name
- property value
- Keepalive
- Notification
- Open
- RouteRefresh
- Update
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.BgpRouteRefreshMessageLayer, data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.BgpRouteRefreshMessageLayer, afi: int, safi: int) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.BgpRouteRefreshMessageLayer, : mtf.libs.mtf_pybinder.pcpp.BgpRouteRefreshMessageLayer) mtf.libs.mtf_pybinder.pcpp.BgpRouteRefreshMessageLayer
- Returns:
pcpp.BgpRouteRefreshMessageLayer
- class bgp_common_header
- __init__(self: mtf.libs.mtf_pybinder.pcpp.BgpLayer.bgp_common_header) None
- __new__(**kwargs)
- property length
- property message_type
- class bgp_route_refresh_message
- __init__(self: mtf.libs.mtf_pybinder.pcpp.BgpRouteRefreshMessageLayer.bgp_route_refresh_message) None
- __new__(**kwargs)
- property afi
- property length
- property message_type
- property reserved
- property safi
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.BgpLayer) None
Calculates the basic BGP fields: - Set marker to all ones - Set message type value - Set messagelength
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_bgp_message_type(self: mtf.libs.mtf_pybinder.pcpp.BgpRouteRefreshMessageLayer) mtf.libs.mtf_pybinder.pcpp.BgpLayer.BgpMessageType
- Returns:
enum pcpp.BgpLayer.BgpMessageType
- get_header_len(self: mtf.libs.mtf_pybinder.pcpp.BgpLayer) int
The size of the BGP message
- Returns:
unsigned int
- get_message_type_as_string(self: mtf.libs.mtf_pybinder.pcpp.BgpLayer) str
BGP message type as string. Return value can be one of the following: “OPEN”, “UPDATE”, “NOTIFICATION”,”KEEPALIVE”, “ROUTE-REFRESH”, “Unknown”
- Returns:
str
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_osi_model_layer(self: mtf.libs.mtf_pybinder.pcpp.BgpLayer) mtf.libs.mtf_pybinder.pcpp.OsiModelLayer
- Returns:
enum pcpp.OsiModelLayer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- get_route_refresh_header(self: mtf.libs.mtf_pybinder.pcpp.BgpRouteRefreshMessageLayer) pcpp::BgpRouteRefreshMessageLayer::bgp_route_refresh_message
Get a pointer to the ROUTE-REFRESH message data. Notice this points directly to the data, so any change will modify the actual packet data
- Returns:
pcpp.BgpRouteRefreshMessageLayer.bgp_route_refresh_message: A pointer to a bgp_route_refresh_message structure containing the data
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- static is_bgp_port(port_src: int, port_dst: int) bool
A static method that checks whether a source or dest port match those associated with the BGP protocol
- Args:
port_src (unsigned int): Source port number to check port_dst (unsigned int): Dest port number to check
- Returns:
bool: True if the source or dest port matchthose associated with the BGP protocol
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- static parse_bgp_layer(data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) mtf.libs.mtf_pybinder.pcpp.BgpLayer
A method that creates a BGP layer from packet raw data
- Args:
data (bytes): A pointer to the raw data data_len (unsigned int): Size of the data inbytes prev_layer (pcpp.Layer): A pointer to the previous layer packet (pcpp.Packet): A pointer to the Packet instance where layer will be stored
- Returns:
pcpp.BgpLayer: A newly allocated BGP layer of one of the following types (according to the message type):
BgpOpenMessageLayer,BgpUpdateMessageLayer, BgpNotificationMessageLayer, BgpKeepaliveMessageLayer, BgpRouteRefreshMessageLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.BgpLayer) None
Multiple BGP messages can reside in a single packet, and the only layer that can come after a BGP message isanother BGP message. This method checks for remaining data and parses it as another BGP layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- to_string(self: mtf.libs.mtf_pybinder.pcpp.BgpLayer) str
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.BgpUpdateMessageLayer
Represents a BGP v4 UPDATE message
- class BgpMessageType
An enum representing BGP message types
Members:
Open
Update
Notification
Keepalive
RouteRefresh
- Keepalive
- Notification
- Open
- RouteRefresh
- Update
- __init__(self: mtf.libs.mtf_pybinder.pcpp.BgpLayer.BgpMessageType, value: int) None
- __new__(**kwargs)
- property name
- property value
- Keepalive
- Notification
- Open
- RouteRefresh
- Update
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.BgpUpdateMessageLayer, data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.BgpUpdateMessageLayer) -> None
doc
__init__(self: mtf.libs.mtf_pybinder.pcpp.BgpUpdateMessageLayer, arg0: list[pcpp::BgpUpdateMessageLayer::prefix_and_ip]) -> None
doc
__init__(self: mtf.libs.mtf_pybinder.pcpp.BgpUpdateMessageLayer, arg0: list[pcpp::BgpUpdateMessageLayer::prefix_and_ip], arg1: list[pcpp::BgpUpdateMessageLayer::path_attribute]) -> None
doc
__init__(self: mtf.libs.mtf_pybinder.pcpp.BgpUpdateMessageLayer, withdrawn_routes: list[pcpp::BgpUpdateMessageLayer::prefix_and_ip], path_attributes: list[pcpp::BgpUpdateMessageLayer::path_attribute], nlri: list[pcpp::BgpUpdateMessageLayer::prefix_and_ip]) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.BgpUpdateMessageLayer, : mtf.libs.mtf_pybinder.pcpp.BgpUpdateMessageLayer) mtf.libs.mtf_pybinder.pcpp.BgpUpdateMessageLayer
- Returns:
pcpp.BgpUpdateMessageLayer
- class bgp_common_header
- __init__(self: mtf.libs.mtf_pybinder.pcpp.BgpLayer.bgp_common_header) None
- __new__(**kwargs)
- property length
- property message_type
- clear_network_layer_reachability_info(self: mtf.libs.mtf_pybinder.pcpp.BgpUpdateMessageLayer) bool
Clear all NLRI data currently in the message. This is equivalent to calling setNetworkLayerReachabilityInfo() with an empty vector as a parameter
- Returns:
bool: True if all NLRI were successfully cleared or false otherwise. In case of an error an appropriate message
will be printed to log
- clear_path_attributes(self: mtf.libs.mtf_pybinder.pcpp.BgpUpdateMessageLayer) bool
Clear all Path Attributes data currently in the message. This is equivalent to calling setPathAttributes() with an empty vector as a parameter True if all Path Attributes were successfully cleared or false otherwise. In case of an error an appropriate message will be printed to log
- Returns:
bool
- clear_withdrawn_routes(self: mtf.libs.mtf_pybinder.pcpp.BgpUpdateMessageLayer) bool
Clear all Withdrawn Routes data currently in the message. This is equivalent to calling setWithdrawnRoutes() with an empty vector as a parameter
- Returns:
bool: True if all Withdrawn Routes were successfully cleared or false otherwise. In case of an error an appropriate message
will be printed to log
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.BgpLayer) None
Calculates the basic BGP fields: - Set marker to all ones - Set message type value - Set messagelength
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_basic_msg_header(self: mtf.libs.mtf_pybinder.pcpp.BgpUpdateMessageLayer) mtf.libs.mtf_pybinder.pcpp.BgpLayer.bgp_common_header
Get a pointer to the basic BGP message data. Notice this points directly to the data, so any change will modify the actual packet data
- Returns:
pcpp.BgpLayer.bgp_common_header: A pointer to a bgp_common_header structure containing the data
- get_bgp_message_type(self: mtf.libs.mtf_pybinder.pcpp.BgpUpdateMessageLayer) mtf.libs.mtf_pybinder.pcpp.BgpLayer.BgpMessageType
- Returns:
enum pcpp.BgpLayer.BgpMessageType
- get_header_len(self: mtf.libs.mtf_pybinder.pcpp.BgpLayer) int
The size of the BGP message
- Returns:
unsigned int
- get_message_type_as_string(self: mtf.libs.mtf_pybinder.pcpp.BgpLayer) str
BGP message type as string. Return value can be one of the following: “OPEN”, “UPDATE”, “NOTIFICATION”,”KEEPALIVE”, “ROUTE-REFRESH”, “Unknown”
- Returns:
str
- get_network_layer_reachability_info(self: mtf.libs.mtf_pybinder.pcpp.BgpUpdateMessageLayer, nlri: list[pcpp::BgpUpdateMessageLayer::prefix_and_ip]) None
Get a vector of the Network Layer Reachability Info currently in the message
- Args:
nlri (list[pcpp.BgpUpdateMessageLayer.prefix_and_ip]): A reference to a vector the NLRI data will be written to
- get_network_layer_reachability_info_length(self: mtf.libs.mtf_pybinder.pcpp.BgpUpdateMessageLayer) int
The size in [bytes] of the Network Layer Reachability Info
- Returns:
unsigned int
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_osi_model_layer(self: mtf.libs.mtf_pybinder.pcpp.BgpLayer) mtf.libs.mtf_pybinder.pcpp.OsiModelLayer
- Returns:
enum pcpp.OsiModelLayer
- get_path_attributes(self: mtf.libs.mtf_pybinder.pcpp.BgpUpdateMessageLayer, path_attributes: list[pcpp::BgpUpdateMessageLayer::path_attribute]) None
Get a vector of the Path Attributes currently in the message
- Args:
path_attributes (list[pcpp.BgpUpdateMessageLayer.path_attribute]): A reference to a vector the Path Attributes data will be written to
- get_path_attributes_length(self: mtf.libs.mtf_pybinder.pcpp.BgpUpdateMessageLayer) int
The size in [bytes] of the Path Attributes data
- Returns:
unsigned int
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- get_withdrawn_routes(self: mtf.libs.mtf_pybinder.pcpp.BgpUpdateMessageLayer, withdrawn_routes: list[pcpp::BgpUpdateMessageLayer::prefix_and_ip]) None
Get a vector of the Withdrawn Routes currently in the message
- Args:
withdrawn_routes (list[pcpp.BgpUpdateMessageLayer.prefix_and_ip]): A reference to a vector the Withdrawn Routes data will be written to
- get_withdrawn_routes_length(self: mtf.libs.mtf_pybinder.pcpp.BgpUpdateMessageLayer) int
The size in [bytes] of the Withdrawn Routes data
- Returns:
unsigned int
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- static is_bgp_port(port_src: int, port_dst: int) bool
A static method that checks whether a source or dest port match those associated with the BGP protocol
- Args:
port_src (unsigned int): Source port number to check port_dst (unsigned int): Dest port number to check
- Returns:
bool: True if the source or dest port matchthose associated with the BGP protocol
- static is_data_valid(data: int, data_size: int) bool
A static method that takes a byte array and detects whether it is a BgpUpdateMessage
- Args:
data (bytes): A byte array data_size (unsigned int): The byte array size (in bytes)
- Returns:
bool: True if the data looks like a valid BgpUpdateMessage layer
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- static parse_bgp_layer(data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) mtf.libs.mtf_pybinder.pcpp.BgpLayer
A method that creates a BGP layer from packet raw data
- Args:
data (bytes): A pointer to the raw data data_len (unsigned int): Size of the data inbytes prev_layer (pcpp.Layer): A pointer to the previous layer packet (pcpp.Packet): A pointer to the Packet instance where layer will be stored
- Returns:
pcpp.BgpLayer: A newly allocated BGP layer of one of the following types (according to the message type):
BgpOpenMessageLayer,BgpUpdateMessageLayer, BgpNotificationMessageLayer, BgpKeepaliveMessageLayer, BgpRouteRefreshMessageLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.BgpLayer) None
Multiple BGP messages can reside in a single packet, and the only layer that can come after a BGP message isanother BGP message. This method checks for remaining data and parses it as another BGP layer
- class path_attribute
A structure that represents BGP OPEN message Path Attributes information
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.BgpUpdateMessageLayer.path_attribute) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.BgpUpdateMessageLayer.path_attribute, flags_val: int, type_val: int, data_as_hex_string: str) -> None
- __new__(**kwargs)
- property flags
- property length
- property type
- class prefix_and_ip
A structure that contains IPv4 address and IP address mask (prefix) information. It’s used to represent BGP Withdrawn Routes and Network Layer Reachability Information (NLRI)
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.BgpUpdateMessageLayer.prefix_and_ip) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.BgpUpdateMessageLayer.prefix_and_ip, prefix_val: int, ip_addr_val: str) -> None
- __new__(**kwargs)
- property ip_addr
- property prefix
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- set_network_layer_reachability_info(self: mtf.libs.mtf_pybinder.pcpp.BgpUpdateMessageLayer, nlri: list[pcpp::BgpUpdateMessageLayer::prefix_and_ip]) bool
Set NLRI data in this message. This method will override any existing NLRI data in the message. If the input is an empty vector all NLRI data will be removed. This method automatically sets the bgp_common_header#length field in the message
- Args:
nlri (list[pcpp.BgpUpdateMessageLayer.prefix_and_ip]): New NLRI data to set in the message
- Returns:
bool: True if all NLRI data was set successfully or false otherwise. In case of an error an appropriate message
will be printed to log
- set_path_attributes(self: mtf.libs.mtf_pybinder.pcpp.BgpUpdateMessageLayer, path_attributes: list[pcpp::BgpUpdateMessageLayer::path_attribute]) bool
Set Path Attributes in this message. This method will override any existing Path Attributes in the message. If the input is an empty vector all Path Attributes will be removed. This method automatically sets the bgp_common_header#length and the Path Attributes length fields in the message
- Args:
path_attributes (list[pcpp.BgpUpdateMessageLayer.path_attribute]): New Path Attributes to set in the message
- Returns:
bool: True if all Path Attributes were set successfully or false otherwise. In case of an error an appropriate message
will be printed to log
- set_withdrawn_routes(self: mtf.libs.mtf_pybinder.pcpp.BgpUpdateMessageLayer, withdrawn_routes: list[pcpp::BgpUpdateMessageLayer::prefix_and_ip]) bool
Set Withdrawn Routes in this message. This method will override any existing Withdrawn Routes in the message. If the input is an empty vector all Withdrawn Routes will be removed. This method automatically sets the bgp_common_header#length and the Withdrawn Routes length fields in the message
- Args:
withdrawn_routes (list[pcpp.BgpUpdateMessageLayer.prefix_and_ip]): New Withdrawn Routes to set in the message
- Returns:
bool: True if all Withdrawn Routes were set successfully or false otherwise. In case of an error an appropriate message
will be printed to log
- to_string(self: mtf.libs.mtf_pybinder.pcpp.BgpLayer) str
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.BootpOpCodes
BootP opcodes
Members:
DHCP_BOOTREQUEST
DHCP_BOOTREPLY
- DHCP_BOOTREPLY
- DHCP_BOOTREQUEST
- __init__(self: mtf.libs.mtf_pybinder.pcpp.BootpOpCodes, value: int) None
- __new__(**kwargs)
- property name
- property value
- class mtf.libs.mtf_pybinder.pcpp.BpfFilterWrapper
A wrapper class for BPF filtering. Enables setting a BPF filter and matching it against a packet
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.BpfFilterWrapper) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.BpfFilterWrapper, arg0: mtf.libs.mtf_pybinder.pcpp.BpfFilterWrapper) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.BpfFilterWrapper, : mtf.libs.mtf_pybinder.pcpp.BpfFilterWrapper) mtf.libs.mtf_pybinder.pcpp.BpfFilterWrapper
- Returns:
pcpp.BpfFilterWrapper
- match_packet_with_filter(*args, **kwargs)
Overloaded function.
match_packet_with_filter(self: mtf.libs.mtf_pybinder.pcpp.BpfFilterWrapper, raw_packet: mtf.libs.mtf_pybinder.pcpp.RawPacket) -> bool
Match a packet with the filter stored in this object. If the filter is empty the method returns “true”.
If the link type of the raw packet is different than the one set in setFilter(), the filter will be re-compiled and stored in the object. A pointer to a raw packet which the filter will be matched against True if the filter matches (or if it’s empty). False if the packet doesn’t match or if the filter could not be compiled
- Args:
raw_packet (str)
- Returns:
bool
match_packet_with_filter(self: mtf.libs.mtf_pybinder.pcpp.BpfFilterWrapper, packet_data: int, packet_data_length: int, packet_timestamp: mtf.libs.mtf_pybinder.pcpp.timespec, link_type: int) -> bool
Match a packet data with the filter stored in this object. If the filter is empty the method returns “true”.
If the link type provided is different than the one set in setFilter(), the filter will be re-compiled and stored in the object. A byte stream containing the packet data The length in [bytes] of the byte stream The packet timestamp The packet link type True if the filter matches (or if it’s empty). False if the packet doesn’t match or if the filter could not be compiled
- Args:
packet_data (str)
- Returns:
bool
- set_filter(*args, **kwargs)
Overloaded function.
set_filter(self: mtf.libs.mtf_pybinder.pcpp.BpfFilterWrapper, filter: str) -> bool
- Args:
filter (str)
set_filter(self: mtf.libs.mtf_pybinder.pcpp.BpfFilterWrapper, filter: str, link_type: mtf.libs.mtf_pybinder.pcpp.LinkLayerType) -> bool
Set a filter. This method receives a filter in BPF syntax (https://biot.com/capstats/bpf.html) and an optional link type,
compiles them, and if compilation is successful it stores the filter. A filter in BPF syntax An optional parameter to set the filter’s link type. The default is LINKTYPE_ETHERNET True if compilation is successful and filter is stored in side this object, false otherwise
- Args:
filter (str)
- Returns:
bool
- class mtf.libs.mtf_pybinder.pcpp.ConnectionData
Represents basic TCP/UDP + IP connection data
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.ConnectionData) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.ConnectionData, arg0: mtf.libs.mtf_pybinder.pcpp.ConnectionData) -> None
- __new__(**kwargs)
- property dst_ip
- property dst_port
- property end_time
- property flow_key
- set_end_time(self: mtf.libs.mtf_pybinder.pcpp.ConnectionData, end_time_value: mtf.libs.mtf_pybinder.pcpp.timeval) None
Set endTime of Connection integer value
- Args:
end_time_value (timeval)
- set_start_time(self: mtf.libs.mtf_pybinder.pcpp.ConnectionData, start_time_value: mtf.libs.mtf_pybinder.pcpp.timeval) None
Set startTime of Connection integer value
- Args:
start_time_value (timeval)
- property src_ip
- property src_port
- property start_time
- class mtf.libs.mtf_pybinder.pcpp.CotpLayer
Represents a COTP (Connection Oriented Transport Protocol)
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.CotpLayer, data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.CotpLayer, tpdu_number: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.CotpLayer, arg0: mtf.libs.mtf_pybinder.pcpp.CotpLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.CotpLayer, arg0: mtf.libs.mtf_pybinder.pcpp.CotpLayer) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.CotpLayer, : mtf.libs.mtf_pybinder.pcpp.CotpLayer) mtf.libs.mtf_pybinder.pcpp.CotpLayer
- Returns:
pcpp.CotpLayer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.CotpLayer) None
Does nothing for this layer
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_header_len(self: mtf.libs.mtf_pybinder.pcpp.CotpLayer) int
Size of
- Returns:
unsigned int
- get_length(self: mtf.libs.mtf_pybinder.pcpp.CotpLayer) int
COTP length
- Returns:
unsigned int
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_osi_model_layer(self: mtf.libs.mtf_pybinder.pcpp.CotpLayer) mtf.libs.mtf_pybinder.pcpp.OsiModelLayer
- Returns:
enum pcpp.OsiModelLayer
- get_pdu_type(self: mtf.libs.mtf_pybinder.pcpp.CotpLayer) int
COTP PDU type
- Returns:
unsigned int
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- get_tpdu_number(self: mtf.libs.mtf_pybinder.pcpp.CotpLayer) int
COTP TPDU number
- Returns:
unsigned int
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- static is_data_valid(data: int, data_size: int) bool
A static method that takes a byte array and detects whether it is a COTP
- Args:
data (bytes): A byte array data_size (unsigned int): The byte array size (in bytes)
- Returns:
bool: True if the data looks like a valid COTP layer
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.CotpLayer) None
Currently parses the rest of the packet as a S7COMM or generic payload (PayloadLayer)
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- set_length(self: mtf.libs.mtf_pybinder.pcpp.CotpLayer, length: int) None
Set the value of the length
- Args:
length (unsigned int): The value of the length
- set_pdu_type(self: mtf.libs.mtf_pybinder.pcpp.CotpLayer, pdu_type: int) None
Set the value of the version
- Args:
pdu_type (unsigned int): The number of the PDU type
- set_tpdu_number(self: mtf.libs.mtf_pybinder.pcpp.CotpLayer, tpdu_number: int) None
Set the value of the version
- Args:
tpdu_number (unsigned int): The value of the TPDU number
- to_string(self: mtf.libs.mtf_pybinder.pcpp.CotpLayer) str
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.DTLSAlertLayer
- __init__(self: mtf.libs.mtf_pybinder.pcpp.DTLSAlertLayer, data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) None
- __new__(**kwargs)
- static add_dtls_port(port: int) None
Adds port to the list of valid DTLS ports. Port to add
- Args:
port (unsigned int)
- property alert_description
SSL/TLS alert description. Will return ::SSL_ALERT_ENCRYPTED if alert is encrypted
- Returns:
enum pcpp.SSLAlertDescription
- property alert_level
SSL/TLS alert level. Will return ::SSL_ALERT_LEVEL_ENCRYPTED if alert is encrypted
- Returns:
enum pcpp.SSLAlertLevel
- assign(self: mtf.libs.mtf_pybinder.pcpp.DTLSAlertLayer, : mtf.libs.mtf_pybinder.pcpp.DTLSAlertLayer) mtf.libs.mtf_pybinder.pcpp.DTLSAlertLayer
- Returns:
pcpp.DTLSAlertLayer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- static create_dtls_message(data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) mtf.libs.mtf_pybinder.pcpp.DTLSLayer
A static method that creates DTLS layers by raw data. This method parses the raw data, finds if and which DTLS record it is and creates the corresponding record layer. It’s the responsibility of the user to free the created object when done using it A pointer to the raw data Size of the data in bytes A pointer to the previous layer A pointer to the Packet instance where layer will be stored in A pointer to the newly created record layer. If no SSL/TLS record could be identified from the raw data NULL is returned
- Args:
data (bytes) data_len (unsigned int) prev_layer (pcpp.Layer) packet (pcpp.Packet)
- Returns:
pcpp.DTLSLayer
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- property epoch
The DTLS epoch as parsed from the record
- Returns:
unsigned int
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- static is_dtls_message(*args, **kwargs)
Overloaded function.
is_dtls_message(src_port: int, dst_port: int, data: int, data_len: int) -> bool
- Args:
src_port (unsigned int) dst_port (unsigned int) data (bytes) data_len (unsigned int)
- Returns:
bool
is_dtls_message(src_port: int, dst_port: int, data: int, data_len: int, ignore_ports: bool) -> bool
A static methods that gets raw data of a layer and checks whether this data is a DTLS record or not. This check is done using the source/dest port and matching of a legal record type in the raw data. The source port of the packet that contains the raw data. Source port (or dest port) are a criteria to identify DTLS packets The dest port of the packet that contains the raw data. Dest port (or source port) are a criteria to identify DTLS packets The data to check Length (in bytes) of the data DTLS ports are only relevant for parsing the first DTLS message, but are not relevant for parsing subsequent messages. This parameter can be set to “true” to skip DTLS ports check. This is an optional parameter and its default is “false”
- Args:
src_port (unsigned int) dst_port (unsigned int) data (bytes) data_len (unsigned int) ignore_ports (bool)
- Returns:
bool
- static is_dtls_port(port: int) bool
A static method that checks whether the port is considered as DTLS. The port number to be checked
- Args:
port (unsigned int)
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property record_length
The DTLS record length as parsed from the record
- Returns:
unsigned int
- property record_type
The DTLS record type as parsed from the record
- Returns:
enum pcpp.SSLRecordType
- property record_version
The DTLS version used in this record (parsed from the record)
- Returns:
pcpp.SSLVersion
- static remove_all_dtls_ports() None
Removes all ports from the list of valid DTLS ports.
- static remove_dtls_port(port: int) None
Removes port from the list of valid DTLS ports. Port to remove
- Args:
port (unsigned int)
- property sequence_number
The DTLS sequence number as parsed from the record
- Returns:
unsigned int
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.DTLSApplicationDataLayer
- __init__(self: mtf.libs.mtf_pybinder.pcpp.DTLSApplicationDataLayer, data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) None
- __new__(**kwargs)
- static add_dtls_port(port: int) None
Adds port to the list of valid DTLS ports. Port to add
- Args:
port (unsigned int)
- assign(self: mtf.libs.mtf_pybinder.pcpp.DTLSApplicationDataLayer, : mtf.libs.mtf_pybinder.pcpp.DTLSApplicationDataLayer) mtf.libs.mtf_pybinder.pcpp.DTLSApplicationDataLayer
- Returns:
pcpp.DTLSApplicationDataLayer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- static create_dtls_message(data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) mtf.libs.mtf_pybinder.pcpp.DTLSLayer
A static method that creates DTLS layers by raw data. This method parses the raw data, finds if and which DTLS record it is and creates the corresponding record layer. It’s the responsibility of the user to free the created object when done using it A pointer to the raw data Size of the data in bytes A pointer to the previous layer A pointer to the Packet instance where layer will be stored in A pointer to the newly created record layer. If no SSL/TLS record could be identified from the raw data NULL is returned
- Args:
data (bytes) data_len (unsigned int) prev_layer (pcpp.Layer) packet (pcpp.Packet)
- Returns:
pcpp.DTLSLayer
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- property encrypted_data
Encrypted data. This data can be decrypted only if you have the symmetric key that was agreed between the client and the server during DTLS handshake process
- property encrypted_data_len
The length in bytes of the encrypted data returned in getEncryptedData()
- Returns:
unsigned int
- property epoch
The DTLS epoch as parsed from the record
- Returns:
unsigned int
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- static is_dtls_message(*args, **kwargs)
Overloaded function.
is_dtls_message(src_port: int, dst_port: int, data: int, data_len: int) -> bool
- Args:
src_port (unsigned int) dst_port (unsigned int) data (bytes) data_len (unsigned int)
- Returns:
bool
is_dtls_message(src_port: int, dst_port: int, data: int, data_len: int, ignore_ports: bool) -> bool
A static methods that gets raw data of a layer and checks whether this data is a DTLS record or not. This check is done using the source/dest port and matching of a legal record type in the raw data. The source port of the packet that contains the raw data. Source port (or dest port) are a criteria to identify DTLS packets The dest port of the packet that contains the raw data. Dest port (or source port) are a criteria to identify DTLS packets The data to check Length (in bytes) of the data DTLS ports are only relevant for parsing the first DTLS message, but are not relevant for parsing subsequent messages. This parameter can be set to “true” to skip DTLS ports check. This is an optional parameter and its default is “false”
- Args:
src_port (unsigned int) dst_port (unsigned int) data (bytes) data_len (unsigned int) ignore_ports (bool)
- Returns:
bool
- static is_dtls_port(port: int) bool
A static method that checks whether the port is considered as DTLS. The port number to be checked
- Args:
port (unsigned int)
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property record_length
The DTLS record length as parsed from the record
- Returns:
unsigned int
- property record_type
The DTLS record type as parsed from the record
- Returns:
enum pcpp.SSLRecordType
- property record_version
The DTLS version used in this record (parsed from the record)
- Returns:
pcpp.SSLVersion
- static remove_all_dtls_ports() None
Removes all ports from the list of valid DTLS ports.
- static remove_dtls_port(port: int) None
Removes port from the list of valid DTLS ports. Port to remove
- Args:
port (unsigned int)
- property sequence_number
The DTLS sequence number as parsed from the record
- Returns:
unsigned int
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.DTLSCertificateMessage
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.DTLSCertificateMessage, data: int, data_len: int, container: pcpp::DTLSHandshakeLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.DTLSCertificateMessage, arg0: mtf.libs.mtf_pybinder.pcpp.DTLSCertificateMessage) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.DTLSCertificateMessage, arg0: mtf.libs.mtf_pybinder.pcpp.DTLSCertificateMessage) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.DTLSCertificateMessage, : mtf.libs.mtf_pybinder.pcpp.DTLSCertificateMessage) mtf.libs.mtf_pybinder.pcpp.DTLSCertificateMessage
- Returns:
pcpp.DTLSCertificateMessage
- property body_length
The handshake message body length in bytes.
- Returns:
unsigned int
- static create_handshake_message(data: int, data_len: int, container: pcpp::DTLSHandshakeLayer) mtf.libs.mtf_pybinder.pcpp.DTLSHandshakeMessage
A factory method for creating instances of handshake messages from raw data The raw data containing 1 handshake message Raw data length in bytes A pointer to the DTLSHandshakeLayer instance which will contain the created message. This parameter is required because the handshake message includes a pointer to its container
- Args:
data (bytes) data_len (unsigned int) container (pcpp.DTLSHandshakeLayer)
- Returns:
pcpp.DTLSHandshakeMessage
- property fragment_length
The length of this message fragment in bytes.
- Returns:
unsigned int
- property fragment_offset
The number of bytes contained in previous message fragments.
- Returns:
unsigned int
- get_certificate(self: mtf.libs.mtf_pybinder.pcpp.DTLSCertificateMessage, index: int) mtf.libs.mtf_pybinder.pcpp.SSLx509Certificate
Get a certificate by index The index of the certificate to retrieve A pointer to the certificate object. Notice that if index < 0 or index > num of certificates encapsulated in current packet a NULL value will be returned
- Args:
index (int)
- Returns:
pcpp.SSLx509Certificate
- property handshake_type
The handshake message type
- Returns:
enum pcpp.SSLHandshakeType
- is_message_complete(self: mtf.libs.mtf_pybinder.pcpp.DTLSHandshakeMessage) bool
True if current packet contains the entire message or false otherwise. This method is important because sometimes handshake messages are divided in consequent packets (happens a lot in certificate messages which usually contain several KB of data which is larger than standard packet size, so the message is divided between several packets)
- Returns:
bool
- property message_length
The handshake message length in bytes. Notice that sometimes the handshake message is divided between several packets, in this case this method will return the length of part of the message in the current packet
- Returns:
unsigned int
- property message_seq
The handshake message sequence number.
- Returns:
unsigned int
- property num_of_certificates
The number of certificates encapsulated in this message (as written in the ‘length’ field of the message). Notice that because the message may spread over several packets, not all certificates will necessarily be in this packet. So, for example, there may be a case where this method return 3 (message contains 3 certificates) but this message actually contains only 1 certificate as the other 2 are spread over the other packets
- Returns:
int
- class mtf.libs.mtf_pybinder.pcpp.DTLSCertificateRequestMessage
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.DTLSCertificateRequestMessage, data: int, data_len: int, container: pcpp::DTLSHandshakeLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.DTLSCertificateRequestMessage, arg0: mtf.libs.mtf_pybinder.pcpp.DTLSCertificateRequestMessage) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.DTLSCertificateRequestMessage, arg0: mtf.libs.mtf_pybinder.pcpp.DTLSCertificateRequestMessage) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.DTLSCertificateRequestMessage, : mtf.libs.mtf_pybinder.pcpp.DTLSCertificateRequestMessage) mtf.libs.mtf_pybinder.pcpp.DTLSCertificateRequestMessage
- Returns:
pcpp.DTLSCertificateRequestMessage
- property body_length
The handshake message body length in bytes.
- Returns:
unsigned int
- property certificate_authority_data
Certificate authority data as raw data (byte array). Parsing of this data may be added in the future. Notice that if this message is spread over several packets in a way none of the certificate authority data exists in this packet, nullptr will be returned
- property certificate_authority_length
The length of certificate authority data returned by getCertificateAuthorityData(). Notice that if this message is spread over several packets in a way none of certificate authority data exists in the current packet, 0 will be returned. Also, if some of the data exists in the consequent packets, the length that will be returned is the length of data exists in the current packet only (and not the total length)
- Returns:
unsigned int
- property certificate_types
A reference to a vector containing all client certificate types exist in this message
- Returns:
list[enum pcpp.SSLClientCertificateType]
- static create_handshake_message(data: int, data_len: int, container: pcpp::DTLSHandshakeLayer) mtf.libs.mtf_pybinder.pcpp.DTLSHandshakeMessage
A factory method for creating instances of handshake messages from raw data The raw data containing 1 handshake message Raw data length in bytes A pointer to the DTLSHandshakeLayer instance which will contain the created message. This parameter is required because the handshake message includes a pointer to its container
- Args:
data (bytes) data_len (unsigned int) container (pcpp.DTLSHandshakeLayer)
- Returns:
pcpp.DTLSHandshakeMessage
- property fragment_length
The length of this message fragment in bytes.
- Returns:
unsigned int
- property fragment_offset
The number of bytes contained in previous message fragments.
- Returns:
unsigned int
- property handshake_type
The handshake message type
- Returns:
enum pcpp.SSLHandshakeType
- is_message_complete(self: mtf.libs.mtf_pybinder.pcpp.DTLSHandshakeMessage) bool
True if current packet contains the entire message or false otherwise. This method is important because sometimes handshake messages are divided in consequent packets (happens a lot in certificate messages which usually contain several KB of data which is larger than standard packet size, so the message is divided between several packets)
- Returns:
bool
- property message_length
The handshake message length in bytes. Notice that sometimes the handshake message is divided between several packets, in this case this method will return the length of part of the message in the current packet
- Returns:
unsigned int
- property message_seq
The handshake message sequence number.
- Returns:
unsigned int
- class mtf.libs.mtf_pybinder.pcpp.DTLSCertificateVerifyMessage
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.DTLSCertificateVerifyMessage, data: int, data_len: int, container: pcpp::DTLSHandshakeLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.DTLSCertificateVerifyMessage, arg0: mtf.libs.mtf_pybinder.pcpp.DTLSCertificateVerifyMessage) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.DTLSCertificateVerifyMessage, arg0: mtf.libs.mtf_pybinder.pcpp.DTLSCertificateVerifyMessage) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.DTLSCertificateVerifyMessage, : mtf.libs.mtf_pybinder.pcpp.DTLSCertificateVerifyMessage) mtf.libs.mtf_pybinder.pcpp.DTLSCertificateVerifyMessage
- Returns:
pcpp.DTLSCertificateVerifyMessage
- property body_length
The handshake message body length in bytes.
- Returns:
unsigned int
- static create_handshake_message(data: int, data_len: int, container: pcpp::DTLSHandshakeLayer) mtf.libs.mtf_pybinder.pcpp.DTLSHandshakeMessage
A factory method for creating instances of handshake messages from raw data The raw data containing 1 handshake message Raw data length in bytes A pointer to the DTLSHandshakeLayer instance which will contain the created message. This parameter is required because the handshake message includes a pointer to its container
- Args:
data (bytes) data_len (unsigned int) container (pcpp.DTLSHandshakeLayer)
- Returns:
pcpp.DTLSHandshakeMessage
- property fragment_length
The length of this message fragment in bytes.
- Returns:
unsigned int
- property fragment_offset
The number of bytes contained in previous message fragments.
- Returns:
unsigned int
- property handshake_type
The handshake message type
- Returns:
enum pcpp.SSLHandshakeType
- is_message_complete(self: mtf.libs.mtf_pybinder.pcpp.DTLSHandshakeMessage) bool
True if current packet contains the entire message or false otherwise. This method is important because sometimes handshake messages are divided in consequent packets (happens a lot in certificate messages which usually contain several KB of data which is larger than standard packet size, so the message is divided between several packets)
- Returns:
bool
- property message_length
The handshake message length in bytes. Notice that sometimes the handshake message is divided between several packets, in this case this method will return the length of part of the message in the current packet
- Returns:
unsigned int
- property message_seq
The handshake message sequence number.
- Returns:
unsigned int
- property signed_hash
Signed hash data as raw data (byte array). Parsing of this data may be added in the future. Notice that if this message is spread over several packets in a way none of the signed hash data exists in this packet, nullptr will be returned
- property signed_hash_length
The length of signed hash data returned by getSignedHash(). Notice that if this message is spread over several packets in a way none of this data exists in the current packet, 0 will be returned. Also, if some of the data exists in the consequent packets, the length that will be returned will be the length of data exists in the current packet only (and not the total length)
- Returns:
unsigned int
- class mtf.libs.mtf_pybinder.pcpp.DTLSChangeCipherSpecLayer
- __init__(self: mtf.libs.mtf_pybinder.pcpp.DTLSChangeCipherSpecLayer, data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) None
- __new__(**kwargs)
- static add_dtls_port(port: int) None
Adds port to the list of valid DTLS ports. Port to add
- Args:
port (unsigned int)
- assign(self: mtf.libs.mtf_pybinder.pcpp.DTLSChangeCipherSpecLayer, : mtf.libs.mtf_pybinder.pcpp.DTLSChangeCipherSpecLayer) mtf.libs.mtf_pybinder.pcpp.DTLSChangeCipherSpecLayer
- Returns:
pcpp.DTLSChangeCipherSpecLayer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- static create_dtls_message(data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) mtf.libs.mtf_pybinder.pcpp.DTLSLayer
A static method that creates DTLS layers by raw data. This method parses the raw data, finds if and which DTLS record it is and creates the corresponding record layer. It’s the responsibility of the user to free the created object when done using it A pointer to the raw data Size of the data in bytes A pointer to the previous layer A pointer to the Packet instance where layer will be stored in A pointer to the newly created record layer. If no SSL/TLS record could be identified from the raw data NULL is returned
- Args:
data (bytes) data_len (unsigned int) prev_layer (pcpp.Layer) packet (pcpp.Packet)
- Returns:
pcpp.DTLSLayer
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- property epoch
The DTLS epoch as parsed from the record
- Returns:
unsigned int
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- static is_dtls_message(*args, **kwargs)
Overloaded function.
is_dtls_message(src_port: int, dst_port: int, data: int, data_len: int) -> bool
- Args:
src_port (unsigned int) dst_port (unsigned int) data (bytes) data_len (unsigned int)
- Returns:
bool
is_dtls_message(src_port: int, dst_port: int, data: int, data_len: int, ignore_ports: bool) -> bool
A static methods that gets raw data of a layer and checks whether this data is a DTLS record or not. This check is done using the source/dest port and matching of a legal record type in the raw data. The source port of the packet that contains the raw data. Source port (or dest port) are a criteria to identify DTLS packets The dest port of the packet that contains the raw data. Dest port (or source port) are a criteria to identify DTLS packets The data to check Length (in bytes) of the data DTLS ports are only relevant for parsing the first DTLS message, but are not relevant for parsing subsequent messages. This parameter can be set to “true” to skip DTLS ports check. This is an optional parameter and its default is “false”
- Args:
src_port (unsigned int) dst_port (unsigned int) data (bytes) data_len (unsigned int) ignore_ports (bool)
- Returns:
bool
- static is_dtls_port(port: int) bool
A static method that checks whether the port is considered as DTLS. The port number to be checked
- Args:
port (unsigned int)
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property record_length
The DTLS record length as parsed from the record
- Returns:
unsigned int
- property record_type
The DTLS record type as parsed from the record
- Returns:
enum pcpp.SSLRecordType
- property record_version
The DTLS version used in this record (parsed from the record)
- Returns:
pcpp.SSLVersion
- static remove_all_dtls_ports() None
Removes all ports from the list of valid DTLS ports.
- static remove_dtls_port(port: int) None
Removes port from the list of valid DTLS ports. Port to remove
- Args:
port (unsigned int)
- property sequence_number
The DTLS sequence number as parsed from the record
- Returns:
unsigned int
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.DTLSClientHelloMessage
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.DTLSClientHelloMessage, data: int, data_len: int, container: pcpp::DTLSHandshakeLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.DTLSClientHelloMessage, arg0: mtf.libs.mtf_pybinder.pcpp.DTLSClientHelloMessage) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.DTLSClientHelloMessage, arg0: mtf.libs.mtf_pybinder.pcpp.DTLSClientHelloMessage) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.DTLSClientHelloMessage, : mtf.libs.mtf_pybinder.pcpp.DTLSClientHelloMessage) mtf.libs.mtf_pybinder.pcpp.DTLSClientHelloMessage
- Returns:
pcpp.DTLSClientHelloMessage
- property body_length
The handshake message body length in bytes.
- Returns:
unsigned int
- property cipher_suite_count
The number of cipher-suites included in this message
- Returns:
unsigned int
- property compression_methods_value
The value of the compression method byte
- Returns:
unsigned int
- property cookie
Cookie as byte array. If client-hello message doesn’t include cookie nullptr will be returned
- property cookie_length
Cookie length in bytes. If client-hello message doesn’t include cookie 0 will be returned
- Returns:
unsigned int
- static create_handshake_message(data: int, data_len: int, container: pcpp::DTLSHandshakeLayer) mtf.libs.mtf_pybinder.pcpp.DTLSHandshakeMessage
A factory method for creating instances of handshake messages from raw data The raw data containing 1 handshake message Raw data length in bytes A pointer to the DTLSHandshakeLayer instance which will contain the created message. This parameter is required because the handshake message includes a pointer to its container
- Args:
data (bytes) data_len (unsigned int) container (pcpp.DTLSHandshakeLayer)
- Returns:
pcpp.DTLSHandshakeMessage
- property extension_count
The number of extensions in this message
- Returns:
int
- property extensions_length
The size (in bytes) of all extensions data in this message. Extracted from the “extensions length” field
- Returns:
unsigned int
- property fragment_length
The length of this message fragment in bytes.
- Returns:
unsigned int
- property fragment_offset
The number of bytes contained in previous message fragments.
- Returns:
unsigned int
- generate_tls_fingerprint(self: mtf.libs.mtf_pybinder.pcpp.DTLSClientHelloMessage) mtf.libs.mtf_pybinder.pcpp.SSLClientHelloMessage.ClientHelloTLSFingerprint
TLS fingerprinting is a way to identify client applications using the details in the TLS Client Hello packet. It was initially introduced by Lee Brotherston in his 2015 research: <https://blog.squarelemon.com/tls-fingerprinting/> This implementation of TLS fingerprint is a C++ version of Salesforce’s JA3 open source project (originally written in Python and Zeek): <https://engineering.salesforce.com/tls-fingerprinting-with-ja3-and-ja3s-247362855967> A SSLClientHelloMessage#ClientHelloTLSFingerprint struct that contains all the elements needed for creating a TLS fingerprint out of this Client Hello message. This struct has also methods to extract the TLS fingerprint itself in a string or MD5 formats
- Returns:
pcpp.SSLClientHelloMessage.ClientHelloTLSFingerprint
- get_cipher_suite(self: mtf.libs.mtf_pybinder.pcpp.DTLSClientHelloMessage, index: int) mtf.libs.mtf_pybinder.pcpp.SSLCipherSuite
Get a pointer to a cipher-suite by index. The cipher-suites are numbered according to their order of appearance in the message. If index is out of bounds (less than 0 or larger than total amount of cipher suites) nullptr will be returned. nullptr will also be returned if the cipher-suite ID is unknown. If you still want to get the cipher-suite ID you can use getCipherSuiteID() The index of the cipher-suite to return The pointer to the cipher-suite object or nullptr if index is out of bounds
- Args:
index (int)
- Returns:
pcpp.SSLCipherSuite
- get_cipher_suite_id(self: mtf.libs.mtf_pybinder.pcpp.DTLSClientHelloMessage, index: int) int
Get the cipher-suite ID by index. This method just parses the ID from the client-hello message and returns it. To get more information on the cipher-suite you can use the getCipherSuite() method The index of the cipher-suite to return Set to “true” if parsing succeeded and the return value is valid or “false” if: (1) the index is out-of-bounds (less than 0 or larger than total amount of cipher suites) or (2) the parsing failed. If the value is “false” the return value can be ignored The cipher-suite ID if “isValid” is set to “true”. If “isValid” is set to “false” the return value can be ignored
- Args:
index (int)
- get_extension(self: mtf.libs.mtf_pybinder.pcpp.DTLSClientHelloMessage, index: int) mtf.libs.mtf_pybinder.pcpp.SSLExtension
Get a pointer to an extension by index. The extensions are numbered according to their order of appearance in the message. If index is out of bounds (less than 0 or larger than total amount of extensions) nullptr will be returned The index of the extension to return The pointer to the extension or nullptr if index is out of bounds
- Args:
index (int)
- Returns:
pcpp.SSLExtension
- get_extension_of_type(*args, **kwargs)
Overloaded function.
get_extension_of_type(self: mtf.libs.mtf_pybinder.pcpp.DTLSClientHelloMessage, type: int) -> mtf.libs.mtf_pybinder.pcpp.SSLExtension
Get a pointer to an extension by numeric type field. Every extension has a 2-byte numeric value representing its type (for example: renegotiation info extension type is 0x1ff). This method gets the type and returns a pointer to the extension object The 2-byte numeric type of the extension A pointer to the extension object of nullptr if this type doesn’t exist in this message
- Args:
type (unsigned int)
- Returns:
pcpp.SSLExtension
get_extension_of_type(self: mtf.libs.mtf_pybinder.pcpp.DTLSClientHelloMessage, type: mtf.libs.mtf_pybinder.pcpp.SSLExtensionType) -> mtf.libs.mtf_pybinder.pcpp.SSLExtension
Get a pointer to an extension by its enum type The type of extension to return A pointer to the extension object or nullptr if this type doesn’t exist in this message
- Args:
type (enum pcpp.SSLExtensionType)
- Returns:
pcpp.SSLExtension
- property handshake_type
The handshake message type
- Returns:
enum pcpp.SSLHandshakeType
- property handshake_version
Handshake DTLS version (notice it may be different than DTLSLayer#getRecordVersion(). Each client-hello or server-hello message has both record version and handshake version and they may differ from one another)
- Returns:
pcpp.SSLVersion
- is_message_complete(self: mtf.libs.mtf_pybinder.pcpp.DTLSHandshakeMessage) bool
True if current packet contains the entire message or false otherwise. This method is important because sometimes handshake messages are divided in consequent packets (happens a lot in certificate messages which usually contain several KB of data which is larger than standard packet size, so the message is divided between several packets)
- Returns:
bool
- property message_length
The handshake message length in bytes. Notice that sometimes the handshake message is divided between several packets, in this case this method will return the length of part of the message in the current packet
- Returns:
unsigned int
- property message_seq
The handshake message sequence number.
- Returns:
unsigned int
- property random
Handshake random number
- property session_id
Session ID as byte array. If server-hello message doesn’t include session ID NULL will be returned
- property session_id_length
Session ID length in bytes. If client-hello message doesn’t include session ID 0 will be returned
- Returns:
unsigned int
- class mtf.libs.mtf_pybinder.pcpp.DTLSClientKeyExchangeMessage
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.DTLSClientKeyExchangeMessage, data: int, data_len: int, container: pcpp::DTLSHandshakeLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.DTLSClientKeyExchangeMessage, arg0: mtf.libs.mtf_pybinder.pcpp.DTLSClientKeyExchangeMessage) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.DTLSClientKeyExchangeMessage, arg0: mtf.libs.mtf_pybinder.pcpp.DTLSClientKeyExchangeMessage) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.DTLSClientKeyExchangeMessage, : mtf.libs.mtf_pybinder.pcpp.DTLSClientKeyExchangeMessage) mtf.libs.mtf_pybinder.pcpp.DTLSClientKeyExchangeMessage
- Returns:
pcpp.DTLSClientKeyExchangeMessage
- property body_length
The handshake message body length in bytes.
- Returns:
unsigned int
- property client_key_exchange_params
Raw data of the server key exchange params. Currently this data can only be returned as raw, parsing may be added in the future. Notice that if the message is spread over more than 1 packet in a way params doesn’t exist in the first packet, nullptr will be returned
- property client_key_exchange_params_length
The size of the params field. Notice that if the message is spread over more than 1 packet in a way the ssl_tls_handshake_layer cannot be parsed from the packet, 0 will be returned. Also, if only part of the params exist in current packet (and the rest are on consequent packets), the size that will be returned is the size of the part that exists in the current packet (and not the total size of params)
- Returns:
unsigned int
- static create_handshake_message(data: int, data_len: int, container: pcpp::DTLSHandshakeLayer) mtf.libs.mtf_pybinder.pcpp.DTLSHandshakeMessage
A factory method for creating instances of handshake messages from raw data The raw data containing 1 handshake message Raw data length in bytes A pointer to the DTLSHandshakeLayer instance which will contain the created message. This parameter is required because the handshake message includes a pointer to its container
- Args:
data (bytes) data_len (unsigned int) container (pcpp.DTLSHandshakeLayer)
- Returns:
pcpp.DTLSHandshakeMessage
- property fragment_length
The length of this message fragment in bytes.
- Returns:
unsigned int
- property fragment_offset
The number of bytes contained in previous message fragments.
- Returns:
unsigned int
- property handshake_type
The handshake message type
- Returns:
enum pcpp.SSLHandshakeType
- is_message_complete(self: mtf.libs.mtf_pybinder.pcpp.DTLSHandshakeMessage) bool
True if current packet contains the entire message or false otherwise. This method is important because sometimes handshake messages are divided in consequent packets (happens a lot in certificate messages which usually contain several KB of data which is larger than standard packet size, so the message is divided between several packets)
- Returns:
bool
- property message_length
The handshake message length in bytes. Notice that sometimes the handshake message is divided between several packets, in this case this method will return the length of part of the message in the current packet
- Returns:
unsigned int
- property message_seq
The handshake message sequence number.
- Returns:
unsigned int
- class mtf.libs.mtf_pybinder.pcpp.DTLSFinishedMessage
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.DTLSFinishedMessage, data: int, data_len: int, container: pcpp::DTLSHandshakeLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.DTLSFinishedMessage, arg0: mtf.libs.mtf_pybinder.pcpp.DTLSFinishedMessage) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.DTLSFinishedMessage, arg0: mtf.libs.mtf_pybinder.pcpp.DTLSFinishedMessage) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.DTLSFinishedMessage, : mtf.libs.mtf_pybinder.pcpp.DTLSFinishedMessage) mtf.libs.mtf_pybinder.pcpp.DTLSFinishedMessage
- Returns:
pcpp.DTLSFinishedMessage
- property body_length
The handshake message body length in bytes.
- Returns:
unsigned int
- static create_handshake_message(data: int, data_len: int, container: pcpp::DTLSHandshakeLayer) mtf.libs.mtf_pybinder.pcpp.DTLSHandshakeMessage
A factory method for creating instances of handshake messages from raw data The raw data containing 1 handshake message Raw data length in bytes A pointer to the DTLSHandshakeLayer instance which will contain the created message. This parameter is required because the handshake message includes a pointer to its container
- Args:
data (bytes) data_len (unsigned int) container (pcpp.DTLSHandshakeLayer)
- Returns:
pcpp.DTLSHandshakeMessage
- property fragment_length
The length of this message fragment in bytes.
- Returns:
unsigned int
- property fragment_offset
The number of bytes contained in previous message fragments.
- Returns:
unsigned int
- property handshake_type
The handshake message type
- Returns:
enum pcpp.SSLHandshakeType
- is_message_complete(self: mtf.libs.mtf_pybinder.pcpp.DTLSHandshakeMessage) bool
True if current packet contains the entire message or false otherwise. This method is important because sometimes handshake messages are divided in consequent packets (happens a lot in certificate messages which usually contain several KB of data which is larger than standard packet size, so the message is divided between several packets)
- Returns:
bool
- property message_length
The handshake message length in bytes. Notice that sometimes the handshake message is divided between several packets, in this case this method will return the length of part of the message in the current packet
- Returns:
unsigned int
- property message_seq
The handshake message sequence number.
- Returns:
unsigned int
- property signed_hash
Signed hash data as raw data (byte array). Parsing of this data may be added in the future. Notice that if this message is spread over several packets in a way none of the signed hash data exists in this packet, nullptr will be returned
- property signed_hash_length
The length of signed hash data returned by getSignedHash(). Notice that if the message is spread over several packets in a way none of this data exists in the current packet, 0 will be returned. Also, if some of the data exists in the consequent packets, the length that will be returned will be the length of data exists in the current packet only (and not the total length)
- Returns:
unsigned int
- class mtf.libs.mtf_pybinder.pcpp.DTLSHandshakeLayer
- __init__(self: mtf.libs.mtf_pybinder.pcpp.DTLSHandshakeLayer, data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) None
- __new__(**kwargs)
- static add_dtls_port(port: int) None
Adds port to the list of valid DTLS ports. Port to add
- Args:
port (unsigned int)
- assign(self: mtf.libs.mtf_pybinder.pcpp.DTLSLayer, : mtf.libs.mtf_pybinder.pcpp.DTLSLayer) mtf.libs.mtf_pybinder.pcpp.DTLSLayer
- Returns:
pcpp.DTLSLayer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- static create_dtls_message(data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) mtf.libs.mtf_pybinder.pcpp.DTLSLayer
A static method that creates DTLS layers by raw data. This method parses the raw data, finds if and which DTLS record it is and creates the corresponding record layer. It’s the responsibility of the user to free the created object when done using it A pointer to the raw data Size of the data in bytes A pointer to the previous layer A pointer to the Packet instance where layer will be stored in A pointer to the newly created record layer. If no SSL/TLS record could be identified from the raw data NULL is returned
- Args:
data (bytes) data_len (unsigned int) prev_layer (pcpp.Layer) packet (pcpp.Packet)
- Returns:
pcpp.DTLSLayer
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- property epoch
The DTLS epoch as parsed from the record
- Returns:
unsigned int
- get_handshake_message_at(self: mtf.libs.mtf_pybinder.pcpp.DTLSHandshakeLayer, index: int) mtf.libs.mtf_pybinder.pcpp.DTLSHandshakeMessage
Get a pointer to an handshake message by index. The message are numbered according to their order of appearance in the layer. If index is out of bounds (less than 0 or larger than total amount of message) nullptr will be returned The index of the message to return The pointer to the message object or nullptr if index is out of bounds
- Args:
index (int)
- Returns:
pcpp.DTLSHandshakeMessage
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property handshake_messages_count
The number of messages in this layer instance
- Returns:
unsigned int
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- static is_dtls_message(*args, **kwargs)
Overloaded function.
is_dtls_message(src_port: int, dst_port: int, data: int, data_len: int) -> bool
- Args:
src_port (unsigned int) dst_port (unsigned int) data (bytes) data_len (unsigned int)
- Returns:
bool
is_dtls_message(src_port: int, dst_port: int, data: int, data_len: int, ignore_ports: bool) -> bool
A static methods that gets raw data of a layer and checks whether this data is a DTLS record or not. This check is done using the source/dest port and matching of a legal record type in the raw data. The source port of the packet that contains the raw data. Source port (or dest port) are a criteria to identify DTLS packets The dest port of the packet that contains the raw data. Dest port (or source port) are a criteria to identify DTLS packets The data to check Length (in bytes) of the data DTLS ports are only relevant for parsing the first DTLS message, but are not relevant for parsing subsequent messages. This parameter can be set to “true” to skip DTLS ports check. This is an optional parameter and its default is “false”
- Args:
src_port (unsigned int) dst_port (unsigned int) data (bytes) data_len (unsigned int) ignore_ports (bool)
- Returns:
bool
- static is_dtls_port(port: int) bool
A static method that checks whether the port is considered as DTLS. The port number to be checked
- Args:
port (unsigned int)
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property record_length
The DTLS record length as parsed from the record
- Returns:
unsigned int
- property record_type
The DTLS record type as parsed from the record
- Returns:
enum pcpp.SSLRecordType
- property record_version
The DTLS version used in this record (parsed from the record)
- Returns:
pcpp.SSLVersion
- static remove_all_dtls_ports() None
Removes all ports from the list of valid DTLS ports.
- static remove_dtls_port(port: int) None
Removes port from the list of valid DTLS ports. Port to remove
- Args:
port (unsigned int)
- property sequence_number
The DTLS sequence number as parsed from the record
- Returns:
unsigned int
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.DTLSHandshakeMessage
- __init__(self: mtf.libs.mtf_pybinder.pcpp.DTLSHandshakeMessage, arg0: mtf.libs.mtf_pybinder.pcpp.DTLSHandshakeMessage) None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.DTLSHandshakeMessage, : mtf.libs.mtf_pybinder.pcpp.DTLSHandshakeMessage) mtf.libs.mtf_pybinder.pcpp.DTLSHandshakeMessage
- Returns:
pcpp.DTLSHandshakeMessage
- property body_length
The handshake message body length in bytes.
- Returns:
unsigned int
- static create_handshake_message(data: int, data_len: int, container: pcpp::DTLSHandshakeLayer) mtf.libs.mtf_pybinder.pcpp.DTLSHandshakeMessage
A factory method for creating instances of handshake messages from raw data The raw data containing 1 handshake message Raw data length in bytes A pointer to the DTLSHandshakeLayer instance which will contain the created message. This parameter is required because the handshake message includes a pointer to its container
- Args:
data (bytes) data_len (unsigned int) container (pcpp.DTLSHandshakeLayer)
- Returns:
pcpp.DTLSHandshakeMessage
- property fragment_length
The length of this message fragment in bytes.
- Returns:
unsigned int
- property fragment_offset
The number of bytes contained in previous message fragments.
- Returns:
unsigned int
- property handshake_type
The handshake message type
- Returns:
enum pcpp.SSLHandshakeType
- is_message_complete(self: mtf.libs.mtf_pybinder.pcpp.DTLSHandshakeMessage) bool
True if current packet contains the entire message or false otherwise. This method is important because sometimes handshake messages are divided in consequent packets (happens a lot in certificate messages which usually contain several KB of data which is larger than standard packet size, so the message is divided between several packets)
- Returns:
bool
- property message_length
The handshake message length in bytes. Notice that sometimes the handshake message is divided between several packets, in this case this method will return the length of part of the message in the current packet
- Returns:
unsigned int
- property message_seq
The handshake message sequence number.
- Returns:
unsigned int
- class mtf.libs.mtf_pybinder.pcpp.DTLSHelloRequestMessage
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.DTLSHelloRequestMessage, data: int, data_len: int, container: pcpp::DTLSHandshakeLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.DTLSHelloRequestMessage, arg0: mtf.libs.mtf_pybinder.pcpp.DTLSHelloRequestMessage) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.DTLSHelloRequestMessage, arg0: mtf.libs.mtf_pybinder.pcpp.DTLSHelloRequestMessage) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.DTLSHelloRequestMessage, : mtf.libs.mtf_pybinder.pcpp.DTLSHelloRequestMessage) mtf.libs.mtf_pybinder.pcpp.DTLSHelloRequestMessage
- Returns:
pcpp.DTLSHelloRequestMessage
- property body_length
The handshake message body length in bytes.
- Returns:
unsigned int
- static create_handshake_message(data: int, data_len: int, container: pcpp::DTLSHandshakeLayer) mtf.libs.mtf_pybinder.pcpp.DTLSHandshakeMessage
A factory method for creating instances of handshake messages from raw data The raw data containing 1 handshake message Raw data length in bytes A pointer to the DTLSHandshakeLayer instance which will contain the created message. This parameter is required because the handshake message includes a pointer to its container
- Args:
data (bytes) data_len (unsigned int) container (pcpp.DTLSHandshakeLayer)
- Returns:
pcpp.DTLSHandshakeMessage
- property fragment_length
The length of this message fragment in bytes.
- Returns:
unsigned int
- property fragment_offset
The number of bytes contained in previous message fragments.
- Returns:
unsigned int
- property handshake_type
The handshake message type
- Returns:
enum pcpp.SSLHandshakeType
- is_message_complete(self: mtf.libs.mtf_pybinder.pcpp.DTLSHandshakeMessage) bool
True if current packet contains the entire message or false otherwise. This method is important because sometimes handshake messages are divided in consequent packets (happens a lot in certificate messages which usually contain several KB of data which is larger than standard packet size, so the message is divided between several packets)
- Returns:
bool
- property message_length
The handshake message length in bytes. Notice that sometimes the handshake message is divided between several packets, in this case this method will return the length of part of the message in the current packet
- Returns:
unsigned int
- property message_seq
The handshake message sequence number.
- Returns:
unsigned int
- class mtf.libs.mtf_pybinder.pcpp.DTLSHelloVerifyRequestMessage
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.DTLSHelloVerifyRequestMessage, data: int, data_len: int, container: pcpp::DTLSHandshakeLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.DTLSHelloVerifyRequestMessage, arg0: mtf.libs.mtf_pybinder.pcpp.DTLSHelloVerifyRequestMessage) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.DTLSHelloVerifyRequestMessage, arg0: mtf.libs.mtf_pybinder.pcpp.DTLSHelloVerifyRequestMessage) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.DTLSHelloVerifyRequestMessage, : mtf.libs.mtf_pybinder.pcpp.DTLSHelloVerifyRequestMessage) mtf.libs.mtf_pybinder.pcpp.DTLSHelloVerifyRequestMessage
- Returns:
pcpp.DTLSHelloVerifyRequestMessage
- property body_length
The handshake message body length in bytes.
- Returns:
unsigned int
- property cookie
Cookie as byte array. If client-hello message doesn’t include cookie nullptr will be returned
- property cookie_length
Cookie length in bytes. If client-hello message doesn’t include cookie 0 will be returned
- Returns:
unsigned int
- static create_handshake_message(data: int, data_len: int, container: pcpp::DTLSHandshakeLayer) mtf.libs.mtf_pybinder.pcpp.DTLSHandshakeMessage
A factory method for creating instances of handshake messages from raw data The raw data containing 1 handshake message Raw data length in bytes A pointer to the DTLSHandshakeLayer instance which will contain the created message. This parameter is required because the handshake message includes a pointer to its container
- Args:
data (bytes) data_len (unsigned int) container (pcpp.DTLSHandshakeLayer)
- Returns:
pcpp.DTLSHandshakeMessage
- property fragment_length
The length of this message fragment in bytes.
- Returns:
unsigned int
- property fragment_offset
The number of bytes contained in previous message fragments.
- Returns:
unsigned int
- property handshake_type
The handshake message type
- Returns:
enum pcpp.SSLHandshakeType
- property handshake_version
Handshake SSL/TLS version (notice it may be different than DTLSLayer#getRecordVersion(). Each client-hello or server-hello message has both record version and handshake version and they may differ from one another)
- Returns:
pcpp.SSLVersion
- is_message_complete(self: mtf.libs.mtf_pybinder.pcpp.DTLSHandshakeMessage) bool
True if current packet contains the entire message or false otherwise. This method is important because sometimes handshake messages are divided in consequent packets (happens a lot in certificate messages which usually contain several KB of data which is larger than standard packet size, so the message is divided between several packets)
- Returns:
bool
- property message_length
The handshake message length in bytes. Notice that sometimes the handshake message is divided between several packets, in this case this method will return the length of part of the message in the current packet
- Returns:
unsigned int
- property message_seq
The handshake message sequence number.
- Returns:
unsigned int
- class mtf.libs.mtf_pybinder.pcpp.DTLSLayer
- __init__(self: mtf.libs.mtf_pybinder.pcpp.DTLSLayer, arg0: mtf.libs.mtf_pybinder.pcpp.DTLSLayer) None
- __new__(**kwargs)
- static add_dtls_port(port: int) None
Adds port to the list of valid DTLS ports. Port to add
- Args:
port (unsigned int)
- assign(self: mtf.libs.mtf_pybinder.pcpp.DTLSLayer, : mtf.libs.mtf_pybinder.pcpp.DTLSLayer) mtf.libs.mtf_pybinder.pcpp.DTLSLayer
- Returns:
pcpp.DTLSLayer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- static create_dtls_message(data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) mtf.libs.mtf_pybinder.pcpp.DTLSLayer
A static method that creates DTLS layers by raw data. This method parses the raw data, finds if and which DTLS record it is and creates the corresponding record layer. It’s the responsibility of the user to free the created object when done using it A pointer to the raw data Size of the data in bytes A pointer to the previous layer A pointer to the Packet instance where layer will be stored in A pointer to the newly created record layer. If no SSL/TLS record could be identified from the raw data NULL is returned
- Args:
data (bytes) data_len (unsigned int) prev_layer (pcpp.Layer) packet (pcpp.Packet)
- Returns:
pcpp.DTLSLayer
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- property epoch
The DTLS epoch as parsed from the record
- Returns:
unsigned int
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- static is_dtls_message(*args, **kwargs)
Overloaded function.
is_dtls_message(src_port: int, dst_port: int, data: int, data_len: int) -> bool
- Args:
src_port (unsigned int) dst_port (unsigned int) data (bytes) data_len (unsigned int)
- Returns:
bool
is_dtls_message(src_port: int, dst_port: int, data: int, data_len: int, ignore_ports: bool) -> bool
A static methods that gets raw data of a layer and checks whether this data is a DTLS record or not. This check is done using the source/dest port and matching of a legal record type in the raw data. The source port of the packet that contains the raw data. Source port (or dest port) are a criteria to identify DTLS packets The dest port of the packet that contains the raw data. Dest port (or source port) are a criteria to identify DTLS packets The data to check Length (in bytes) of the data DTLS ports are only relevant for parsing the first DTLS message, but are not relevant for parsing subsequent messages. This parameter can be set to “true” to skip DTLS ports check. This is an optional parameter and its default is “false”
- Args:
src_port (unsigned int) dst_port (unsigned int) data (bytes) data_len (unsigned int) ignore_ports (bool)
- Returns:
bool
- static is_dtls_port(port: int) bool
A static method that checks whether the port is considered as DTLS. The port number to be checked
- Args:
port (unsigned int)
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property record_length
The DTLS record length as parsed from the record
- Returns:
unsigned int
- property record_type
The DTLS record type as parsed from the record
- Returns:
enum pcpp.SSLRecordType
- property record_version
The DTLS version used in this record (parsed from the record)
- Returns:
pcpp.SSLVersion
- static remove_all_dtls_ports() None
Removes all ports from the list of valid DTLS ports.
- static remove_dtls_port(port: int) None
Removes port from the list of valid DTLS ports. Port to remove
- Args:
port (unsigned int)
- property sequence_number
The DTLS sequence number as parsed from the record
- Returns:
unsigned int
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.DTLSNewConnectionIdMessage
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.DTLSNewConnectionIdMessage, data: int, data_len: int, container: pcpp::DTLSHandshakeLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.DTLSNewConnectionIdMessage, arg0: mtf.libs.mtf_pybinder.pcpp.DTLSNewConnectionIdMessage) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.DTLSNewConnectionIdMessage, arg0: mtf.libs.mtf_pybinder.pcpp.DTLSNewConnectionIdMessage) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.DTLSNewConnectionIdMessage, : mtf.libs.mtf_pybinder.pcpp.DTLSNewConnectionIdMessage) mtf.libs.mtf_pybinder.pcpp.DTLSNewConnectionIdMessage
- Returns:
pcpp.DTLSNewConnectionIdMessage
- property body_length
The handshake message body length in bytes.
- Returns:
unsigned int
- static create_handshake_message(data: int, data_len: int, container: pcpp::DTLSHandshakeLayer) mtf.libs.mtf_pybinder.pcpp.DTLSHandshakeMessage
A factory method for creating instances of handshake messages from raw data The raw data containing 1 handshake message Raw data length in bytes A pointer to the DTLSHandshakeLayer instance which will contain the created message. This parameter is required because the handshake message includes a pointer to its container
- Args:
data (bytes) data_len (unsigned int) container (pcpp.DTLSHandshakeLayer)
- Returns:
pcpp.DTLSHandshakeMessage
- property fragment_length
The length of this message fragment in bytes.
- Returns:
unsigned int
- property fragment_offset
The number of bytes contained in previous message fragments.
- Returns:
unsigned int
- property handshake_type
The handshake message type
- Returns:
enum pcpp.SSLHandshakeType
- is_message_complete(self: mtf.libs.mtf_pybinder.pcpp.DTLSHandshakeMessage) bool
True if current packet contains the entire message or false otherwise. This method is important because sometimes handshake messages are divided in consequent packets (happens a lot in certificate messages which usually contain several KB of data which is larger than standard packet size, so the message is divided between several packets)
- Returns:
bool
- property message_length
The handshake message length in bytes. Notice that sometimes the handshake message is divided between several packets, in this case this method will return the length of part of the message in the current packet
- Returns:
unsigned int
- property message_seq
The handshake message sequence number.
- Returns:
unsigned int
- class mtf.libs.mtf_pybinder.pcpp.DTLSNewSessionTicketMessage
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.DTLSNewSessionTicketMessage, data: int, data_len: int, container: pcpp::DTLSHandshakeLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.DTLSNewSessionTicketMessage, arg0: mtf.libs.mtf_pybinder.pcpp.DTLSNewSessionTicketMessage) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.DTLSNewSessionTicketMessage, arg0: mtf.libs.mtf_pybinder.pcpp.DTLSNewSessionTicketMessage) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.DTLSNewSessionTicketMessage, : mtf.libs.mtf_pybinder.pcpp.DTLSNewSessionTicketMessage) mtf.libs.mtf_pybinder.pcpp.DTLSNewSessionTicketMessage
- Returns:
pcpp.DTLSNewSessionTicketMessage
- property body_length
The handshake message body length in bytes.
- Returns:
unsigned int
- static create_handshake_message(data: int, data_len: int, container: pcpp::DTLSHandshakeLayer) mtf.libs.mtf_pybinder.pcpp.DTLSHandshakeMessage
A factory method for creating instances of handshake messages from raw data The raw data containing 1 handshake message Raw data length in bytes A pointer to the DTLSHandshakeLayer instance which will contain the created message. This parameter is required because the handshake message includes a pointer to its container
- Args:
data (bytes) data_len (unsigned int) container (pcpp.DTLSHandshakeLayer)
- Returns:
pcpp.DTLSHandshakeMessage
- property fragment_length
The length of this message fragment in bytes.
- Returns:
unsigned int
- property fragment_offset
The number of bytes contained in previous message fragments.
- Returns:
unsigned int
- property handshake_type
The handshake message type
- Returns:
enum pcpp.SSLHandshakeType
- is_message_complete(self: mtf.libs.mtf_pybinder.pcpp.DTLSHandshakeMessage) bool
True if current packet contains the entire message or false otherwise. This method is important because sometimes handshake messages are divided in consequent packets (happens a lot in certificate messages which usually contain several KB of data which is larger than standard packet size, so the message is divided between several packets)
- Returns:
bool
- property message_length
The handshake message length in bytes. Notice that sometimes the handshake message is divided between several packets, in this case this method will return the length of part of the message in the current packet
- Returns:
unsigned int
- property message_seq
The handshake message sequence number.
- Returns:
unsigned int
- property session_ticket_data
Session ticket data as raw data (byte array). Parsing of this data may be added in the future. Notice that if this message is spread over several packets in a way none of the signed hash data exists in current packet, nullptr will be returned
- property session_ticket_data_length
The length of session ticket data returned by getSessionTicketData(). Notice that if this message is spread over several packets in a way none of this data exists in the current packet, 0 will be returned. Also, if some of the data exist in the consequent packets, the length that will be returned will be the length of the data existing in the current packet only (and not the total length)
- Returns:
unsigned int
- class mtf.libs.mtf_pybinder.pcpp.DTLSRequestConnectionIdMessage
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.DTLSRequestConnectionIdMessage, data: int, data_len: int, container: pcpp::DTLSHandshakeLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.DTLSRequestConnectionIdMessage, arg0: mtf.libs.mtf_pybinder.pcpp.DTLSRequestConnectionIdMessage) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.DTLSRequestConnectionIdMessage, arg0: mtf.libs.mtf_pybinder.pcpp.DTLSRequestConnectionIdMessage) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.DTLSRequestConnectionIdMessage, : mtf.libs.mtf_pybinder.pcpp.DTLSRequestConnectionIdMessage) mtf.libs.mtf_pybinder.pcpp.DTLSRequestConnectionIdMessage
- Returns:
pcpp.DTLSRequestConnectionIdMessage
- property body_length
The handshake message body length in bytes.
- Returns:
unsigned int
- static create_handshake_message(data: int, data_len: int, container: pcpp::DTLSHandshakeLayer) mtf.libs.mtf_pybinder.pcpp.DTLSHandshakeMessage
A factory method for creating instances of handshake messages from raw data The raw data containing 1 handshake message Raw data length in bytes A pointer to the DTLSHandshakeLayer instance which will contain the created message. This parameter is required because the handshake message includes a pointer to its container
- Args:
data (bytes) data_len (unsigned int) container (pcpp.DTLSHandshakeLayer)
- Returns:
pcpp.DTLSHandshakeMessage
- property fragment_length
The length of this message fragment in bytes.
- Returns:
unsigned int
- property fragment_offset
The number of bytes contained in previous message fragments.
- Returns:
unsigned int
- property handshake_type
The handshake message type
- Returns:
enum pcpp.SSLHandshakeType
- is_message_complete(self: mtf.libs.mtf_pybinder.pcpp.DTLSHandshakeMessage) bool
True if current packet contains the entire message or false otherwise. This method is important because sometimes handshake messages are divided in consequent packets (happens a lot in certificate messages which usually contain several KB of data which is larger than standard packet size, so the message is divided between several packets)
- Returns:
bool
- property message_length
The handshake message length in bytes. Notice that sometimes the handshake message is divided between several packets, in this case this method will return the length of part of the message in the current packet
- Returns:
unsigned int
- property message_seq
The handshake message sequence number.
- Returns:
unsigned int
- property num_ci_ds
Number of Connection IDs
- Returns:
unsigned int
- class mtf.libs.mtf_pybinder.pcpp.DTLSServerHelloDoneMessage
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.DTLSServerHelloDoneMessage, data: int, data_len: int, container: pcpp::DTLSHandshakeLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.DTLSServerHelloDoneMessage, arg0: mtf.libs.mtf_pybinder.pcpp.DTLSServerHelloDoneMessage) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.DTLSServerHelloDoneMessage, arg0: mtf.libs.mtf_pybinder.pcpp.DTLSServerHelloDoneMessage) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.DTLSServerHelloDoneMessage, : mtf.libs.mtf_pybinder.pcpp.DTLSServerHelloDoneMessage) mtf.libs.mtf_pybinder.pcpp.DTLSServerHelloDoneMessage
- Returns:
pcpp.DTLSServerHelloDoneMessage
- property body_length
The handshake message body length in bytes.
- Returns:
unsigned int
- static create_handshake_message(data: int, data_len: int, container: pcpp::DTLSHandshakeLayer) mtf.libs.mtf_pybinder.pcpp.DTLSHandshakeMessage
A factory method for creating instances of handshake messages from raw data The raw data containing 1 handshake message Raw data length in bytes A pointer to the DTLSHandshakeLayer instance which will contain the created message. This parameter is required because the handshake message includes a pointer to its container
- Args:
data (bytes) data_len (unsigned int) container (pcpp.DTLSHandshakeLayer)
- Returns:
pcpp.DTLSHandshakeMessage
- property fragment_length
The length of this message fragment in bytes.
- Returns:
unsigned int
- property fragment_offset
The number of bytes contained in previous message fragments.
- Returns:
unsigned int
- property handshake_type
The handshake message type
- Returns:
enum pcpp.SSLHandshakeType
- is_message_complete(self: mtf.libs.mtf_pybinder.pcpp.DTLSHandshakeMessage) bool
True if current packet contains the entire message or false otherwise. This method is important because sometimes handshake messages are divided in consequent packets (happens a lot in certificate messages which usually contain several KB of data which is larger than standard packet size, so the message is divided between several packets)
- Returns:
bool
- property message_length
The handshake message length in bytes. Notice that sometimes the handshake message is divided between several packets, in this case this method will return the length of part of the message in the current packet
- Returns:
unsigned int
- property message_seq
The handshake message sequence number.
- Returns:
unsigned int
- class mtf.libs.mtf_pybinder.pcpp.DTLSServerHelloMessage
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.DTLSServerHelloMessage, data: int, data_len: int, container: pcpp::DTLSHandshakeLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.DTLSServerHelloMessage, arg0: mtf.libs.mtf_pybinder.pcpp.DTLSServerHelloMessage) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.DTLSServerHelloMessage, arg0: mtf.libs.mtf_pybinder.pcpp.DTLSServerHelloMessage) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.DTLSServerHelloMessage, : mtf.libs.mtf_pybinder.pcpp.DTLSServerHelloMessage) mtf.libs.mtf_pybinder.pcpp.DTLSServerHelloMessage
- Returns:
pcpp.DTLSServerHelloMessage
- property body_length
The handshake message body length in bytes.
- Returns:
unsigned int
- property compression_methods_value
The value of the compression method byte
- Returns:
unsigned int
- static create_handshake_message(data: int, data_len: int, container: pcpp::DTLSHandshakeLayer) mtf.libs.mtf_pybinder.pcpp.DTLSHandshakeMessage
A factory method for creating instances of handshake messages from raw data The raw data containing 1 handshake message Raw data length in bytes A pointer to the DTLSHandshakeLayer instance which will contain the created message. This parameter is required because the handshake message includes a pointer to its container
- Args:
data (bytes) data_len (unsigned int) container (pcpp.DTLSHandshakeLayer)
- Returns:
pcpp.DTLSHandshakeMessage
- property extension_count
The number of extensions in this message
- Returns:
int
- property extensions_length
The size (in bytes) of all extensions data in this message. Extracted from the “extensions length” field
- Returns:
unsigned int
- property fragment_length
The length of this message fragment in bytes.
- Returns:
unsigned int
- property fragment_offset
The number of bytes contained in previous message fragments.
- Returns:
unsigned int
- generate_tls_fingerprint(self: mtf.libs.mtf_pybinder.pcpp.DTLSServerHelloMessage) mtf.libs.mtf_pybinder.pcpp.SSLServerHelloMessage.ServerHelloTLSFingerprint
ServerHello TLS fingerprinting is a way to fingerprint TLS Server Hello messages. In conjunction with ClientHello TLS fingerprinting it can assist in identifying specific client-server communication (for example: a malware connecting to its backend server). ServerHello TLS fingerprinting was introduced in Salesforce’s JA3S open source project: <https://engineering.salesforce.com/tls-fingerprinting-with-ja3-and-ja3s-247362855967> This implementation is a C++ version of Salesforce’s JAS3 (originally written in Python and Zeek) A SSLServerHelloMessage#ServerHelloTLSFingerprint struct that contains all the elements needed for creating a TLS fingerprint out of this Server Hello message. This struct has also methods to extract the TLS fingerprint itself in a string or MD5 formats
- Returns:
pcpp.SSLServerHelloMessage.ServerHelloTLSFingerprint
- get_cipher_suite(self: mtf.libs.mtf_pybinder.pcpp.DTLSServerHelloMessage) mtf.libs.mtf_pybinder.pcpp.SSLCipherSuite
A pointer to the cipher suite encapsulated in this message (server-hello message contains one cipher-suite, the one that will be used to for encryption between client and server). May return NULL if the parsing of the message failed or the cipher-suite ID is unknown. If you still want to get the cipher-suite ID you can use the getCipherSuiteID() method
- Returns:
pcpp.SSLCipherSuite
- get_cipher_suite_id(self: mtf.libs.mtf_pybinder.pcpp.DTLSServerHelloMessage) int
Get the cipher-suite ID. This method just parses the ID from the server-hello message and returns it. To get more information on the cipher-suite you can use the getCipherSuite() method Set to “true” if parsing succeeded and the return value is valid or “false” otherwise. If the value is “false” the return value can be ignored The cipher-suite ID if “isValid” is set to “true”. If “isValid” is set to “false” the return value can be ignored
- get_extension(self: mtf.libs.mtf_pybinder.pcpp.DTLSServerHelloMessage, index: int) mtf.libs.mtf_pybinder.pcpp.SSLExtension
Get a pointer to an extension by index. The extensions are numbered according to their order of appearance in the message. If index is out of bounds (less than 0 or larger than total amount of extensions) nullptr will be returned The index of the extension to return The pointer to the extension or nullptr if index is out of bounds
- Args:
index (int)
- Returns:
pcpp.SSLExtension
- get_extension_of_type(*args, **kwargs)
Overloaded function.
get_extension_of_type(self: mtf.libs.mtf_pybinder.pcpp.DTLSServerHelloMessage, type: int) -> mtf.libs.mtf_pybinder.pcpp.SSLExtension
Get a pointer to an extension by numeric type field. Every extension has a 2-byte numeric value representing its type (for example: renegotiation info extension type is 0x1ff). This method gets the type and returns a pointer to the extension object The 2-byte numeric type of the extension A pointer to the extension object of nullptr if this type doesn’t exist in this message
- Args:
type (unsigned int)
- Returns:
pcpp.SSLExtension
get_extension_of_type(self: mtf.libs.mtf_pybinder.pcpp.DTLSServerHelloMessage, type: mtf.libs.mtf_pybinder.pcpp.SSLExtensionType) -> mtf.libs.mtf_pybinder.pcpp.SSLExtension
Get a pointer to an extension by its enum type The type of extension to return A pointer to the extension object or nullptr if this type doesn’t exist in this message
- Args:
type (enum pcpp.SSLExtensionType)
- Returns:
pcpp.SSLExtension
- property handshake_type
The handshake message type
- Returns:
enum pcpp.SSLHandshakeType
- property handshake_version
Handshake SSL/TLS version (notice it may be different than DTLSLayer#getRecordVersion(). Each client-hello or server-hello message has both record version and handshake version and they may differ from one another). NOTE: for TLS 1.3 the handshake version written in ssl_tls_client_server_hello::handshakeVersion is still TLS 1.2, so a special check is made here see if a SupportedVersions extension exists and if so extract the version from it. This is the most straight-forward way to detect TLS 1.3.
- Returns:
pcpp.SSLVersion
- is_message_complete(self: mtf.libs.mtf_pybinder.pcpp.DTLSHandshakeMessage) bool
True if current packet contains the entire message or false otherwise. This method is important because sometimes handshake messages are divided in consequent packets (happens a lot in certificate messages which usually contain several KB of data which is larger than standard packet size, so the message is divided between several packets)
- Returns:
bool
- property message_length
The handshake message length in bytes. Notice that sometimes the handshake message is divided between several packets, in this case this method will return the length of part of the message in the current packet
- Returns:
unsigned int
- property message_seq
The handshake message sequence number.
- Returns:
unsigned int
- property random
Handshake random number
- property session_id
Session ID as byte array. If server-hello message doesn’t include session ID NULL will be returned
- property session_id_length
Session ID length in bytes. If server-hello message doesn’t include session ID 0 will be returned
- Returns:
unsigned int
- class mtf.libs.mtf_pybinder.pcpp.DTLSServerKeyExchangeMessage
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.DTLSServerKeyExchangeMessage, data: int, data_len: int, container: pcpp::DTLSHandshakeLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.DTLSServerKeyExchangeMessage, arg0: mtf.libs.mtf_pybinder.pcpp.DTLSServerKeyExchangeMessage) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.DTLSServerKeyExchangeMessage, arg0: mtf.libs.mtf_pybinder.pcpp.DTLSServerKeyExchangeMessage) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.DTLSServerKeyExchangeMessage, : mtf.libs.mtf_pybinder.pcpp.DTLSServerKeyExchangeMessage) mtf.libs.mtf_pybinder.pcpp.DTLSServerKeyExchangeMessage
- Returns:
pcpp.DTLSServerKeyExchangeMessage
- property body_length
The handshake message body length in bytes.
- Returns:
unsigned int
- static create_handshake_message(data: int, data_len: int, container: pcpp::DTLSHandshakeLayer) mtf.libs.mtf_pybinder.pcpp.DTLSHandshakeMessage
A factory method for creating instances of handshake messages from raw data The raw data containing 1 handshake message Raw data length in bytes A pointer to the DTLSHandshakeLayer instance which will contain the created message. This parameter is required because the handshake message includes a pointer to its container
- Args:
data (bytes) data_len (unsigned int) container (pcpp.DTLSHandshakeLayer)
- Returns:
pcpp.DTLSHandshakeMessage
- property fragment_length
The length of this message fragment in bytes.
- Returns:
unsigned int
- property fragment_offset
The number of bytes contained in previous message fragments.
- Returns:
unsigned int
- property handshake_type
The handshake message type
- Returns:
enum pcpp.SSLHandshakeType
- is_message_complete(self: mtf.libs.mtf_pybinder.pcpp.DTLSHandshakeMessage) bool
True if current packet contains the entire message or false otherwise. This method is important because sometimes handshake messages are divided in consequent packets (happens a lot in certificate messages which usually contain several KB of data which is larger than standard packet size, so the message is divided between several packets)
- Returns:
bool
- property message_length
The handshake message length in bytes. Notice that sometimes the handshake message is divided between several packets, in this case this method will return the length of part of the message in the current packet
- Returns:
unsigned int
- property message_seq
The handshake message sequence number.
- Returns:
unsigned int
- property server_key_exchange_params
Raw data of the server key exchange params. Currently this data can only returned as raw, parsing may be added in the future. Notice that if the message is spread over more than 1 packet in a way params doesn’t exist in the first packet, nullptr will be returned
- property server_key_exchange_params_length
The size of the params field. Notice that if the message is spread over more than 1 packet in a way the ssl_tls_handshake_layer cannot be parsed from the packet, 0 will be returned. Also, if only part of the params exist in current packet (and the rest are on consequent packets), the size that will be returned is the size of the part that exists in the current packet (and not total size of params)
- Returns:
unsigned int
- class mtf.libs.mtf_pybinder.pcpp.DTLSUnknownMessage
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.DTLSUnknownMessage, data: int, data_len: int, container: pcpp::DTLSHandshakeLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.DTLSUnknownMessage, arg0: mtf.libs.mtf_pybinder.pcpp.DTLSUnknownMessage) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.DTLSUnknownMessage, arg0: mtf.libs.mtf_pybinder.pcpp.DTLSUnknownMessage) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.DTLSUnknownMessage, : mtf.libs.mtf_pybinder.pcpp.DTLSUnknownMessage) mtf.libs.mtf_pybinder.pcpp.DTLSUnknownMessage
- Returns:
pcpp.DTLSUnknownMessage
- property body_length
The handshake message body length in bytes.
- Returns:
unsigned int
- static create_handshake_message(data: int, data_len: int, container: pcpp::DTLSHandshakeLayer) mtf.libs.mtf_pybinder.pcpp.DTLSHandshakeMessage
A factory method for creating instances of handshake messages from raw data The raw data containing 1 handshake message Raw data length in bytes A pointer to the DTLSHandshakeLayer instance which will contain the created message. This parameter is required because the handshake message includes a pointer to its container
- Args:
data (bytes) data_len (unsigned int) container (pcpp.DTLSHandshakeLayer)
- Returns:
pcpp.DTLSHandshakeMessage
- property fragment_length
The length of this message fragment in bytes.
- Returns:
unsigned int
- property fragment_offset
The number of bytes contained in previous message fragments.
- Returns:
unsigned int
- property handshake_type
The handshake message type
- Returns:
enum pcpp.SSLHandshakeType
- is_message_complete(self: mtf.libs.mtf_pybinder.pcpp.DTLSHandshakeMessage) bool
True if current packet contains the entire message or false otherwise. This method is important because sometimes handshake messages are divided in consequent packets (happens a lot in certificate messages which usually contain several KB of data which is larger than standard packet size, so the message is divided between several packets)
- Returns:
bool
- property message_length
The handshake message length in bytes. Notice that sometimes the handshake message is divided between several packets, in this case this method will return the length of part of the message in the current packet
- Returns:
unsigned int
- property message_seq
The handshake message sequence number.
- Returns:
unsigned int
- class mtf.libs.mtf_pybinder.pcpp.DhcpLayer
Represents a DHCP (Dynamic Host Configuration Protocol) protocol layer
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.DhcpLayer, msg_type: mtf.libs.mtf_pybinder.pcpp.DhcpMessageType, client_mac_addr: mtf.libs.mtf_pybinder.pcpp.MacAddress) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.DhcpLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.DhcpLayer, arg0: mtf.libs.mtf_pybinder.pcpp.DhcpLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.DhcpLayer, arg0: mtf.libs.mtf_pybinder.pcpp.DhcpLayer) -> None
- __new__(**kwargs)
- add_option(self: mtf.libs.mtf_pybinder.pcpp.DhcpLayer, option_builder: mtf.libs.mtf_pybinder.pcpp.DhcpOptionBuilder) mtf.libs.mtf_pybinder.pcpp.DhcpOption
Add a new DHCP option at the end of the layer
- Args:
option_builder (pcpp.DhcpOptionBuilder): A DhcpOptionBuilder object that contains the requested DHCP option data to add
- Returns:
pcpp.DhcpOption: A DhcpOption object containing the newly added DHCP option data or logical NULL
(DhcpOption#isNull() == true) if addition failed
- add_option_after(self: mtf.libs.mtf_pybinder.pcpp.DhcpLayer, option_builder: mtf.libs.mtf_pybinder.pcpp.DhcpOptionBuilder, prev_option: mtf.libs.mtf_pybinder.pcpp.DhcpOptionTypes) mtf.libs.mtf_pybinder.pcpp.DhcpOption
Add a new DHCP option after an existing one
- Args:
option_builder (pcpp.DhcpOptionBuilder): A DhcpOptionBuilder object that contains the requested DHCP option data to add prev_option (enum pcpp.DhcpOptionTypes): The DHCP option type which the newly added option will come after
- Returns:
pcpp.DhcpOption: A DhcpOption object containing the newly added DHCP option data or logical NULL
(DhcpOption#isNull() == true) if addition failed
- assign(self: mtf.libs.mtf_pybinder.pcpp.DhcpLayer, : mtf.libs.mtf_pybinder.pcpp.DhcpLayer) mtf.libs.mtf_pybinder.pcpp.DhcpLayer
- Returns:
pcpp.DhcpLayer
- property boot_filename
Boot file name, std::string
- property broadcast_flag
Broadcast flag, bool
- property client_ip_address
The client IPv4 address (as extracted from dhcp_header#clientIpAddress converted to IPv4Address object)
- property client_mac_address
The client MAC address as extracted from dhcp_header#clientMacAddress, assuming dhcp_header#hardwareType is 1 (Ethernet) and dhcp_header#hardwareAddressLength is 6 (MAC address length). Otherwise returns MacAddress#Zero
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- property flags
Flags field, uint16_t
- property gateway_ip_address
Gateway IPv4 address (as extracted from dhcp_header#gatewayIpAddress converted to IPv4Address object)
- get_first_option_data(self: mtf.libs.mtf_pybinder.pcpp.DhcpLayer) mtf.libs.mtf_pybinder.pcpp.DhcpOption
The first DHCP option in the packet. If there are no DHCP options the returned value will contain a logical NULL (DhcpOption#isNull() == true)
- Returns:
pcpp.DhcpOption
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_next_option_data(self: mtf.libs.mtf_pybinder.pcpp.DhcpLayer, dhcp_option: mtf.libs.mtf_pybinder.pcpp.DhcpOption) mtf.libs.mtf_pybinder.pcpp.DhcpOption
Get the DHCP option that comes after a given option. If the given option was the last one, the returned value will contain a logical NULL (DhcpOption#isNull() == true)
- Args:
dhcp_option (pcpp.DhcpOption): A given DHCP option
- Returns:
pcpp.DhcpOption: A DhcpOption object containing the option data that comes next, or logical NULL if the given DHCP
option: (1) was the last one; (2) contains a logical NULL or (3) doesn’t belong to this packet
- get_option_data(self: mtf.libs.mtf_pybinder.pcpp.DhcpLayer, option_type: mtf.libs.mtf_pybinder.pcpp.DhcpOptionTypes) mtf.libs.mtf_pybinder.pcpp.DhcpOption
Get a DHCP option by type
- Args:
option_type (enum pcpp.DhcpOptionTypes): DHCP option type
- Returns:
pcpp.DhcpOption: A DhcpOption object containing the first DHCP option data that matches this type, or logical NULL
(DhcpOption#isNull() == true) if no such option found
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property hardware_address_length
Hardware address length, uint8_t
- property hardware_type
Hardware address type of this message, uint8_t
- property header_len
The header length in bytes
- Returns:
unsigned int
- property hops
Hop count, uint8_t
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property magic_number
DHCP magic cookie
- Returns:
unsigned int
- property message_type
DHCP message type as extracted from ::DHCPOPT_DHCP_MESSAGE_TYPE option. If this option doesn’t exist the value of ::DHCP_UNKNOWN_MSG_TYPE is returned
- property op_code
The BootP opcode of this message, enum pcpp.BootpOpCodes
- property option_count
The number of DHCP options in this layer
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- remove_all_options(self: mtf.libs.mtf_pybinder.pcpp.DhcpLayer) bool
Remove all DHCP options in this layer True if all DHCP options were successfully removed or false if removal failed for some reason
- Returns:
bool
- remove_option(self: mtf.libs.mtf_pybinder.pcpp.DhcpLayer, option_type: mtf.libs.mtf_pybinder.pcpp.DhcpOptionTypes) bool
Remove an existing DHCP option from the layer
- Args:
option_type (enum pcpp.DhcpOptionTypes): The DHCP option type to remove
- Returns:
bool: True if DHCP option was successfully removed or false if type wasn’t found or if removal failed
- property seconds_elapsed
Seconds elapsed since client began address acquisition or renewal process, uint16_t
- property server_ip_address
The server IPv4 address (as extracted from dhcp_header#serverIpAddress converted to IPv4Address object)
- property server_name
Optional server host name, std::string
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- property transaction_id
Transaction ID value, uint32_t
- property your_ip_address
Your IPv4 address (as extracted from dhcp_header#yourIpAddress converted to IPv4Address object)
- class mtf.libs.mtf_pybinder.pcpp.DhcpMessageType
DHCP message types
Members:
DHCP_UNKNOWN_MSG_TYPE
DHCP_DISCOVER
DHCP_OFFER
DHCP_REQUEST
DHCP_DECLINE
DHCP_ACK
DHCP_NAK
DHCP_RELEASE
DHCP_INFORM
- DHCP_ACK
- DHCP_DECLINE
- DHCP_DISCOVER
- DHCP_INFORM
- DHCP_NAK
- DHCP_OFFER
- DHCP_RELEASE
- DHCP_REQUEST
- DHCP_UNKNOWN_MSG_TYPE
- __init__(self: mtf.libs.mtf_pybinder.pcpp.DhcpMessageType, value: int) None
- __new__(**kwargs)
- property name
- property value
- class mtf.libs.mtf_pybinder.pcpp.DhcpOption
A wrapper class for DHCP options. This class does not create or modify DHCP option records, but rather serves as a wrapper and provides useful methods for setting and retrieving data to/from them
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.DhcpOption, option_raw_data: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.DhcpOption, arg0: mtf.libs.mtf_pybinder.pcpp.DhcpOption) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.DhcpOption, arg0: mtf.libs.mtf_pybinder.pcpp.DhcpOption) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.DhcpOption, : mtf.libs.mtf_pybinder.pcpp.DhcpOption) mtf.libs.mtf_pybinder.pcpp.DhcpOption
- Returns:
pcpp.DhcpOption
- static can_assign(record_raw_data: int, tlv_data_len: int) bool
- Args:
record_raw_data (bytes) tlv_data_len (unsigned int)
- Returns:
bool
- property data_size
- Returns:
unsigned int
- get_value_as(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t, offset: int) int
- Args:
offset (unsigned int)
- Returns:
unsigned int
- is_not_null(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t) bool
- Returns:
bool
- is_null(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t) bool
- Returns:
bool
- property length
Return the length field of the DHCP Option
- property option_data
Return the option data of the DHCP Option
- purge_record_data(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t) None
- property record_raw_data
- set_value(*args, **kwargs)
Overloaded function.
set_value(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t, new_value: int) -> bool
- Args:
new_value (unsigned int)
- Returns:
bool
set_value(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t, new_value: int, value_offset: int) -> bool
- Args:
new_value (unsigned int) value_offset (int)
- Returns:
bool
- property total_size
- Returns:
unsigned int
- property type
Return the type field of the DHCP Option
- property value
- class mtf.libs.mtf_pybinder.pcpp.DhcpOptionBuilder
A class for building DHCP options. This builder receives the option parameters in its c’tor, builds the DHCP option raw buffer and provides a build() method to get a DhcpOption object out of it
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.DhcpOptionBuilder, option_type: mtf.libs.mtf_pybinder.pcpp.DhcpOptionTypes, option_value: bytes) -> None
- A class for building DHCP options. This builder receives the option parameters in its c’tor,
builds the DHCP option raw buffer and provides a build() method to get a DhcpOption object out of it
__init__(self: mtf.libs.mtf_pybinder.pcpp.DhcpOptionBuilder, option_type: mtf.libs.mtf_pybinder.pcpp.DhcpOptionTypes, option_value: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.DhcpOptionBuilder, option_type: mtf.libs.mtf_pybinder.pcpp.DhcpOptionTypes, option_value: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.DhcpOptionBuilder, option_type: mtf.libs.mtf_pybinder.pcpp.DhcpOptionTypes, option_value: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.DhcpOptionBuilder, option_type: mtf.libs.mtf_pybinder.pcpp.DhcpOptionTypes, option_value: mtf.libs.mtf_pybinder.pcpp.IPv4Address) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.DhcpOptionBuilder, option_type: mtf.libs.mtf_pybinder.pcpp.DhcpOptionTypes, option_value: str) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.DhcpOptionBuilder, arg0: mtf.libs.mtf_pybinder.pcpp.DhcpOptionBuilder) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.DhcpOptionBuilder, other: mtf.libs.mtf_pybinder.pcpp.DhcpOptionBuilder) mtf.libs.mtf_pybinder.pcpp.DhcpOptionBuilder
Assignment operator that copies all data from another instance of DhcpOptionBuilder
- Args:
other (pcpp.DhcpOptionBuilder): The instance to assign from
- Returns:
pcpp.DhcpOptionBuilder: A reference to the assignee
- build(self: mtf.libs.mtf_pybinder.pcpp.DhcpOptionBuilder) mtf.libs.mtf_pybinder.pcpp.DhcpOption
Build the DhcpOption object out of the parameters defined in the c’tor
- Returns:
pcpp.DhcpOption: The DhcpOption object
- class mtf.libs.mtf_pybinder.pcpp.DhcpOptionTypes
DHCP option types.
Members:
DHCPOPT_UNKNOWN
DHCPOPT_PAD
DHCPOPT_SUBNET_MASK
DHCPOPT_TIME_OFFSET
DHCPOPT_ROUTERS
DHCPOPT_TIME_SERVERS
DHCPOPT_NAME_SERVERS
DHCPOPT_DOMAIN_NAME_SERVERS
DHCPOPT_LOG_SERVERS
DHCPOPT_QUOTES_SERVERS
DHCPOPT_LPR_SERVERS
DHCPOPT_IMPRESS_SERVERS
DHCPOPT_RESOURCE_LOCATION_SERVERS
DHCPOPT_HOST_NAME
DHCPOPT_BOOT_SIZE
DHCPOPT_MERIT_DUMP
DHCPOPT_DOMAIN_NAME
DHCPOPT_SWAP_SERVER
DHCPOPT_ROOT_PATH
DHCPOPT_EXTENSIONS_PATH
DHCPOPT_IP_FORWARDING
DHCPOPT_NON_LOCAL_SOURCE_ROUTING
DHCPOPT_POLICY_FILTER
DHCPOPT_MAX_DGRAM_REASSEMBLY
DEFAULT_IP_TTL
DHCPOPT_PATH_MTU_AGING_TIMEOUT
PATH_MTU_PLATEAU_TABLE
DHCPOPT_INTERFACE_MTU
DHCPOPT_ALL_SUBNETS_LOCAL
DHCPOPT_BROADCAST_ADDRESS
DHCPOPT_PERFORM_MASK_DISCOVERY
DHCPOPT_MASK_SUPPLIER
DHCPOPT_ROUTER_DISCOVERY
DHCPOPT_ROUTER_SOLICITATION_ADDRESS
DHCPOPT_STATIC_ROUTES
DHCPOPT_TRAILER_ENCAPSULATION
DHCPOPT_ARP_CACHE_TIMEOUT
DHCPOPT_IEEE802_3_ENCAPSULATION
DHCPOPT_DEFAULT_TCP_TTL
DHCPOPT_TCP_KEEPALIVE_INTERVAL
DHCPOPT_TCP_KEEPALIVE_GARBAGE
DHCPOPT_NIS_DOMAIN
DHCPOPT_NIS_SERVERS
DHCPOPT_NTP_SERVERS
DHCPOPT_VENDOR_ENCAPSULATED_OPTIONS
DHCPOPT_NETBIOS_NAME_SERVERS
DHCPOPT_NETBIOS_DD_SERVER
DHCPOPT_NETBIOS_NODE_TYPE
DHCPOPT_NETBIOS_SCOPE
DHCPOPT_FONT_SERVERS
DHCPOPT_X_DISPLAY_MANAGER
DHCPOPT_DHCP_REQUESTED_ADDRESS
DHCPOPT_DHCP_LEASE_TIME
DHCPOPT_DHCP_OPTION_OVERLOAD
DHCPOPT_DHCP_MESSAGE_TYPE
DHCPOPT_DHCP_SERVER_IDENTIFIER
DHCPOPT_DHCP_PARAMETER_REQUEST_LIST
DHCPOPT_DHCP_MESSAGE
DHCPOPT_DHCP_MAX_MESSAGE_SIZE
DHCPOPT_DHCP_RENEWAL_TIME
DHCPOPT_DHCP_REBINDING_TIME
DHCPOPT_VENDOR_CLASS_IDENTIFIER
DHCPOPT_DHCP_CLIENT_IDENTIFIER
DHCPOPT_NWIP_DOMAIN_NAME
DHCPOPT_NWIP_SUBOPTIONS
DHCPOPT_NIS_DOMAIN_NAME
DHCPOPT_NIS_SERVER_ADDRESS
DHCPOPT_TFTP_SERVER_NAME
DHCPOPT_BOOTFILE_NAME
DHCPOPT_HOME_AGENT_ADDRESS
DHCPOPT_SMTP_SERVER
DHCPOPT_POP3_SERVER
DHCPOPT_NNTP_SERVER
DHCPOPT_WWW_SERVER
DHCPOPT_FINGER_SERVER
DHCPOPT_IRC_SERVER
DHCPOPT_STREETTALK_SERVER
DHCPOPT_STDA_SERVER
DHCPOPT_USER_CLASS
DHCPOPT_DIRECTORY_AGENT
DHCPOPT_SERVICE_SCOPE
DHCPOPT_RAPID_COMMIT
DHCPOPT_FQDN
DHCPOPT_DHCP_AGENT_OPTIONS
DHCPOPT_ISNS
DHCPOPT_NDS_SERVERS
DHCPOPT_NDS_TREE_NAME
DHCPOPT_NDS_CONTEXT
DHCPOPT_BCMCS_CONTROLLER_DOMAIN_NAME_LIST
DHCPOPT_BCMCS_CONTROLLER_IPV4_ADDRESS
DHCPOPT_AUTHENTICATION
DHCPOPT_CLIENT_LAST_TXN_TIME
DHCPOPT_ASSOCIATED_IP
DHCPOPT_CLIENT_SYSTEM
DHCPOPT_CLIENT_NDI
DHCPOPT_LDAP
DHCPOPT_UUID_GUID
DHCPOPT_USER_AUTH
DHCPOPT_GEOCONF_CIVIC
DHCPOPT_PCODE
DHCPOPT_TCODE
DHCPOPT_NETINFO_ADDRESS
DHCPOPT_NETINFO_TAG
DHCPOPT_URL
DHCPOPT_AUTO_CONFIG
DHCPOPT_NAME_SERVICE_SEARCH
DHCPOPT_SUBNET_SELECTION
DHCPOPT_DOMAIN_SEARCH
DHCPOPT_SIP_SERVERS
DHCPOPT_CLASSLESS_STATIC_ROUTE
DHCPOPT_CCC
DHCPOPT_GEOCONF
DHCPOPT_V_I_VENDOR_CLASS
DHCPOPT_V_I_VENDOR_OPTS
DHCPOPT_OPTION_PANA_AGENT
DHCPOPT_OPTION_V4_LOST
DHCPOPT_OPTION_CAPWAP_AC_V4
DHCPOPT_OPTION_IPV4_ADDRESS_MOS
DHCPOPT_OPTION_IPV4_FQDN_MOS
DHCPOPT_SIP_UA_CONFIG
DHCPOPT_OPTION_IPV4_ADDRESS_ANDSF
DHCPOPT_GEOLOC
DHCPOPT_FORCERENEW_NONCE_CAPABLE
DHCPOPT_RDNSS_SELECTION
DHCPOPT_STATUS_CODE
DHCPOPT_BASE_TIME
DHCPOPT_START_TIME_OF_STATE
DHCPOPT_QUERY_START_TIME
DHCPOPT_QUERY_END_TIME
DHCPOPT_DHCP_STATE
DHCPOPT_DATA_SOURCE
DHCPOPT_OPTION_V4_PCP_SERVER
DHCPOPT_OPTION_V4_PORTPARAMS
DHCPOPT_CAPTIVE_PORTAL
DHCPOPT_OPTION_MUD_URL_V4
DHCPOPT_ETHERBOOT
DHCPOPT_IP_TELEPHONE
DHCPOPT_PXELINUX_MAGIC
DHCPOPT_CONFIGURATION_FILE
DHCPOPT_PATH_PREFIX
DHCPOPT_REBOOT_TIME
DHCPOPT_OPTION_6RD
DHCPOPT_OPTION_V4_ACCESS_DOMAIN
DHCPOPT_SUBNET_ALLOCATION
DHCPOPT_VIRTUAL_SUBNET_SELECTION
DHCPOPT_END
- DEFAULT_IP_TTL
- DHCPOPT_ALL_SUBNETS_LOCAL
- DHCPOPT_ARP_CACHE_TIMEOUT
- DHCPOPT_ASSOCIATED_IP
- DHCPOPT_AUTHENTICATION
- DHCPOPT_AUTO_CONFIG
- DHCPOPT_BASE_TIME
- DHCPOPT_BCMCS_CONTROLLER_DOMAIN_NAME_LIST
- DHCPOPT_BCMCS_CONTROLLER_IPV4_ADDRESS
- DHCPOPT_BOOTFILE_NAME
- DHCPOPT_BOOT_SIZE
- DHCPOPT_BROADCAST_ADDRESS
- DHCPOPT_CAPTIVE_PORTAL
- DHCPOPT_CCC
- DHCPOPT_CLASSLESS_STATIC_ROUTE
- DHCPOPT_CLIENT_LAST_TXN_TIME
- DHCPOPT_CLIENT_NDI
- DHCPOPT_CLIENT_SYSTEM
- DHCPOPT_CONFIGURATION_FILE
- DHCPOPT_DATA_SOURCE
- DHCPOPT_DEFAULT_TCP_TTL
- DHCPOPT_DHCP_AGENT_OPTIONS
- DHCPOPT_DHCP_CLIENT_IDENTIFIER
- DHCPOPT_DHCP_LEASE_TIME
- DHCPOPT_DHCP_MAX_MESSAGE_SIZE
- DHCPOPT_DHCP_MESSAGE
- DHCPOPT_DHCP_MESSAGE_TYPE
- DHCPOPT_DHCP_OPTION_OVERLOAD
- DHCPOPT_DHCP_PARAMETER_REQUEST_LIST
- DHCPOPT_DHCP_REBINDING_TIME
- DHCPOPT_DHCP_RENEWAL_TIME
- DHCPOPT_DHCP_REQUESTED_ADDRESS
- DHCPOPT_DHCP_SERVER_IDENTIFIER
- DHCPOPT_DHCP_STATE
- DHCPOPT_DIRECTORY_AGENT
- DHCPOPT_DOMAIN_NAME
- DHCPOPT_DOMAIN_NAME_SERVERS
- DHCPOPT_DOMAIN_SEARCH
- DHCPOPT_END
- DHCPOPT_ETHERBOOT
- DHCPOPT_EXTENSIONS_PATH
- DHCPOPT_FINGER_SERVER
- DHCPOPT_FONT_SERVERS
- DHCPOPT_FORCERENEW_NONCE_CAPABLE
- DHCPOPT_FQDN
- DHCPOPT_GEOCONF
- DHCPOPT_GEOCONF_CIVIC
- DHCPOPT_GEOLOC
- DHCPOPT_HOME_AGENT_ADDRESS
- DHCPOPT_HOST_NAME
- DHCPOPT_IEEE802_3_ENCAPSULATION
- DHCPOPT_IMPRESS_SERVERS
- DHCPOPT_INTERFACE_MTU
- DHCPOPT_IP_FORWARDING
- DHCPOPT_IP_TELEPHONE
- DHCPOPT_IRC_SERVER
- DHCPOPT_ISNS
- DHCPOPT_LDAP
- DHCPOPT_LOG_SERVERS
- DHCPOPT_LPR_SERVERS
- DHCPOPT_MASK_SUPPLIER
- DHCPOPT_MAX_DGRAM_REASSEMBLY
- DHCPOPT_MERIT_DUMP
- DHCPOPT_NAME_SERVERS
- DHCPOPT_NAME_SERVICE_SEARCH
- DHCPOPT_NDS_CONTEXT
- DHCPOPT_NDS_SERVERS
- DHCPOPT_NDS_TREE_NAME
- DHCPOPT_NETBIOS_DD_SERVER
- DHCPOPT_NETBIOS_NAME_SERVERS
- DHCPOPT_NETBIOS_NODE_TYPE
- DHCPOPT_NETBIOS_SCOPE
- DHCPOPT_NETINFO_ADDRESS
- DHCPOPT_NETINFO_TAG
- DHCPOPT_NIS_DOMAIN
- DHCPOPT_NIS_DOMAIN_NAME
- DHCPOPT_NIS_SERVERS
- DHCPOPT_NIS_SERVER_ADDRESS
- DHCPOPT_NNTP_SERVER
- DHCPOPT_NON_LOCAL_SOURCE_ROUTING
- DHCPOPT_NTP_SERVERS
- DHCPOPT_NWIP_DOMAIN_NAME
- DHCPOPT_NWIP_SUBOPTIONS
- DHCPOPT_OPTION_6RD
- DHCPOPT_OPTION_CAPWAP_AC_V4
- DHCPOPT_OPTION_IPV4_ADDRESS_ANDSF
- DHCPOPT_OPTION_IPV4_ADDRESS_MOS
- DHCPOPT_OPTION_IPV4_FQDN_MOS
- DHCPOPT_OPTION_MUD_URL_V4
- DHCPOPT_OPTION_PANA_AGENT
- DHCPOPT_OPTION_V4_ACCESS_DOMAIN
- DHCPOPT_OPTION_V4_LOST
- DHCPOPT_OPTION_V4_PCP_SERVER
- DHCPOPT_OPTION_V4_PORTPARAMS
- DHCPOPT_PAD
- DHCPOPT_PATH_MTU_AGING_TIMEOUT
- DHCPOPT_PATH_PREFIX
- DHCPOPT_PCODE
- DHCPOPT_PERFORM_MASK_DISCOVERY
- DHCPOPT_POLICY_FILTER
- DHCPOPT_POP3_SERVER
- DHCPOPT_PXELINUX_MAGIC
- DHCPOPT_QUERY_END_TIME
- DHCPOPT_QUERY_START_TIME
- DHCPOPT_QUOTES_SERVERS
- DHCPOPT_RAPID_COMMIT
- DHCPOPT_RDNSS_SELECTION
- DHCPOPT_REBOOT_TIME
- DHCPOPT_RESOURCE_LOCATION_SERVERS
- DHCPOPT_ROOT_PATH
- DHCPOPT_ROUTERS
- DHCPOPT_ROUTER_DISCOVERY
- DHCPOPT_ROUTER_SOLICITATION_ADDRESS
- DHCPOPT_SERVICE_SCOPE
- DHCPOPT_SIP_SERVERS
- DHCPOPT_SIP_UA_CONFIG
- DHCPOPT_SMTP_SERVER
- DHCPOPT_START_TIME_OF_STATE
- DHCPOPT_STATIC_ROUTES
- DHCPOPT_STATUS_CODE
- DHCPOPT_STDA_SERVER
- DHCPOPT_STREETTALK_SERVER
- DHCPOPT_SUBNET_ALLOCATION
- DHCPOPT_SUBNET_MASK
- DHCPOPT_SUBNET_SELECTION
- DHCPOPT_SWAP_SERVER
- DHCPOPT_TCODE
- DHCPOPT_TCP_KEEPALIVE_GARBAGE
- DHCPOPT_TCP_KEEPALIVE_INTERVAL
- DHCPOPT_TFTP_SERVER_NAME
- DHCPOPT_TIME_OFFSET
- DHCPOPT_TIME_SERVERS
- DHCPOPT_TRAILER_ENCAPSULATION
- DHCPOPT_UNKNOWN
- DHCPOPT_URL
- DHCPOPT_USER_AUTH
- DHCPOPT_USER_CLASS
- DHCPOPT_UUID_GUID
- DHCPOPT_VENDOR_CLASS_IDENTIFIER
- DHCPOPT_VENDOR_ENCAPSULATED_OPTIONS
- DHCPOPT_VIRTUAL_SUBNET_SELECTION
- DHCPOPT_V_I_VENDOR_CLASS
- DHCPOPT_V_I_VENDOR_OPTS
- DHCPOPT_WWW_SERVER
- DHCPOPT_X_DISPLAY_MANAGER
- PATH_MTU_PLATEAU_TABLE
- __init__(self: mtf.libs.mtf_pybinder.pcpp.DhcpOptionTypes, value: int) None
- __new__(**kwargs)
- property name
- property value
- class mtf.libs.mtf_pybinder.pcpp.DhcpV6Layer
Represents a DHCPv6 (Dynamic Host Configuration Protocol version 6) protocol layer
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.DhcpV6Layer, data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: pcpp::Packet) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.DhcpV6Layer, message_type: mtf.libs.mtf_pybinder.pcpp.DhcpV6MessageType, transaction_id: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.DhcpV6Layer, arg0: mtf.libs.mtf_pybinder.pcpp.DhcpV6Layer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.DhcpV6Layer, arg0: mtf.libs.mtf_pybinder.pcpp.DhcpV6Layer) -> None
- __new__(**kwargs)
- add_option(self: mtf.libs.mtf_pybinder.pcpp.DhcpV6Layer, option_builder: mtf.libs.mtf_pybinder.pcpp.DhcpV6OptionBuilder) mtf.libs.mtf_pybinder.pcpp.DhcpV6Option
Add a new DHCPv6 option at the end of the layer
- Args:
option_builder (pcpp.DhcpV6OptionBuilder): A DhcpV6OptionBuilder object that contains the requested DHCPv6 option data to add
- Returns:
pcpp.DhcpV6Option: A DhcpV6Option object containing the newly added DHCP option data or logical NULL
(DhcpV6Option#isNull() == true) if addition failed
- add_option_after(self: mtf.libs.mtf_pybinder.pcpp.DhcpV6Layer, option_builder: mtf.libs.mtf_pybinder.pcpp.DhcpV6OptionBuilder, option_type: mtf.libs.mtf_pybinder.pcpp.DhcpV6OptionType) mtf.libs.mtf_pybinder.pcpp.DhcpV6Option
Add a new DHCPv6 option after an existing one
- Args:
option_builder (pcpp.DhcpV6OptionBuilder): A DhcpV6OptionBuilder object that contains the requested DHCPv6 option data to add option_type (enum pcpp.DhcpV6OptionType): The DHCPv6 option type which the newly added option will come after
- Returns:
pcpp.DhcpV6Option: A DhcpV6Option object containing the newly added DHCPv6 option data or logical NULL
(DhcpV6Option#isNull() == true) if addition failed
- add_option_before(self: mtf.libs.mtf_pybinder.pcpp.DhcpV6Layer, option_builder: mtf.libs.mtf_pybinder.pcpp.DhcpV6OptionBuilder, option_type: mtf.libs.mtf_pybinder.pcpp.DhcpV6OptionType) mtf.libs.mtf_pybinder.pcpp.DhcpV6Option
Add a new DHCPv6 option before an existing one
- Args:
option_builder (pcpp.DhcpV6OptionBuilder): A DhcpV6OptionBuilder object that contains the requested DHCPv6 option data to add option_type (enum pcpp.DhcpV6OptionType): The DHCPv6 option type which the newly added option will come before
- Returns:
pcpp.DhcpV6Option: A DhcpV6Option object containing the newly added DHCPv6 option data or logical NULL
(DhcpV6Option#isNull() == true) if addition failed
- assign(self: mtf.libs.mtf_pybinder.pcpp.DhcpV6Layer, : mtf.libs.mtf_pybinder.pcpp.DhcpV6Layer) mtf.libs.mtf_pybinder.pcpp.DhcpV6Layer
- Returns:
pcpp.DhcpV6Layer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_first_option_data(self: mtf.libs.mtf_pybinder.pcpp.DhcpV6Layer) mtf.libs.mtf_pybinder.pcpp.DhcpV6Option
The first DHCPv6 option in the packet. If there are no DHCPv6 options the returned value will contain a logical NULL (DhcpV6Option#isNull() == true)
- Returns:
pcpp.DhcpV6Option
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_next_option_data(self: mtf.libs.mtf_pybinder.pcpp.DhcpV6Layer, dhcpv6_option: mtf.libs.mtf_pybinder.pcpp.DhcpV6Option) mtf.libs.mtf_pybinder.pcpp.DhcpV6Option
Get the DHCPv6 option that comes after a given option. If the given option was the last one, the returned value will contain a logical NULL (DhcpV6Option#isNull() == true)
- Args:
dhcpv6_option (pcpp.DhcpV6Option): A given DHCPv6 option
- Returns:
pcpp.DhcpV6Option: A DhcpV6Option object containing the option data that comes next, or logical NULL if the given DHCPv6
option: (1) was the last one; (2) contains a logical NULL or (3) doesn’t belong to this packet
- get_option_data(self: mtf.libs.mtf_pybinder.pcpp.DhcpV6Layer, option: mtf.libs.mtf_pybinder.pcpp.DhcpV6OptionType) mtf.libs.mtf_pybinder.pcpp.DhcpV6Option
Get a DHCPv6 option by type
- Args:
option (enum pcpp.DhcpV6OptionType): DHCPv6 option type
- Returns:
pcpp.DhcpV6Option: A DhcpV6OptionType object containing the first DHCP option data that matches this type, or logical NULL
(DhcpV6Option#isNull() == true) if no such option found
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- static is_data_valid(data: int, data_len: int) bool
A static method that validates the input data
- Args:
data (bytes): The pointer to the beginning of a byte stream of an DHCPv6 layer data_len (unsigned int): The length of the byte stream
- Returns:
bool: True if the data is valid and can represent an DHCPv6 layer
- static is_dhcp_v6_port(port: int) bool
A static method that checks whether a port is considered as a DHCPv6 port
- Args:
port (unsigned int): The port number to check
- Returns:
bool: True if this is a DHCPv6 port number, false otherwise
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property message_type
The message type of this DHCPv6 message
- property message_type_as_string
The string value of the message type of this DHCPv6 message
- Returns:
str
- property option_count
The number of DHCPv6 options in this layer
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- remove_all_options(self: mtf.libs.mtf_pybinder.pcpp.DhcpV6Layer) bool
Remove all DHCPv6 options in this layer
- Returns:
bool: True if all DHCPv6 options were successfully removed or false if removal failed for some reason
- remove_option(self: mtf.libs.mtf_pybinder.pcpp.DhcpV6Layer, option_type: mtf.libs.mtf_pybinder.pcpp.DhcpV6OptionType) bool
Remove an existing DHCPv6 option from the layer
- Args:
option_type (enum pcpp.DhcpV6OptionType): The DHCPv6 option type to remove
- Returns:
bool: True if DHCPv6 option was successfully removed or false if type wasn’t found or if removal failed
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- property transaction_id
The transaction ID of this DHCPv6 message
- class mtf.libs.mtf_pybinder.pcpp.DhcpV6MessageType
DHCPv6 message types
Members:
DHCPV6_UNKNOWN_MSG_TYPE
DHCPV6_SOLICIT
DHCPV6_ADVERTISE
DHCPV6_REQUEST
DHCPV6_CONFIRM
DHCPV6_RENEW
DHCPV6_REBIND
DHCPV6_REPLY
DHCPV6_RELEASE
DHCPV6_DECLINE
DHCPV6_RECONFIGURE
DHCPV6_INFORMATION_REQUEST
DHCPV6_RELAY_FORWARD
DHCPV6_RELAY_REPLY
- DHCPV6_ADVERTISE
- DHCPV6_CONFIRM
- DHCPV6_DECLINE
- DHCPV6_INFORMATION_REQUEST
- DHCPV6_REBIND
- DHCPV6_RECONFIGURE
- DHCPV6_RELAY_FORWARD
- DHCPV6_RELAY_REPLY
- DHCPV6_RELEASE
- DHCPV6_RENEW
- DHCPV6_REPLY
- DHCPV6_REQUEST
- DHCPV6_SOLICIT
- DHCPV6_UNKNOWN_MSG_TYPE
- __init__(self: mtf.libs.mtf_pybinder.pcpp.DhcpV6MessageType, value: int) None
- __new__(**kwargs)
- property name
- property value
- class mtf.libs.mtf_pybinder.pcpp.DhcpV6Option
A wrapper class for DHCPv6 options. This class does not create or modify DHCP option records, but rather serves as a wrapper and provides useful methods for setting and retrieving data to/from them
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.DhcpV6Option, option_raw_data: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.DhcpV6Option, arg0: mtf.libs.mtf_pybinder.pcpp.DhcpV6Option) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.DhcpV6Option, arg0: mtf.libs.mtf_pybinder.pcpp.DhcpV6Option) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.DhcpV6Option, : mtf.libs.mtf_pybinder.pcpp.DhcpV6Option) mtf.libs.mtf_pybinder.pcpp.DhcpV6Option
- Returns:
pcpp.DhcpV6Option
- static can_assign(record_raw_data: int, tlv_data_len: int) bool
- Args:
record_raw_data (bytes) tlv_data_len (unsigned int)
- Returns:
bool
- property data_size
- Returns:
unsigned int
- get_value_as_hex_string(self: mtf.libs.mtf_pybinder.pcpp.DhcpV6Option) str
The raw option value (byte array) as a hex string
- Returns:
str
- is_not_null(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_short_unsigned_short_t) bool
- Returns:
bool
- is_null(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_short_unsigned_short_t) bool
- Returns:
bool
- property option_data
- purge_record_data(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_short_unsigned_short_t) None
- property record_raw_data
- property total_size
- Returns:
unsigned int
- property type
The option type converted to ::DhcpV6OptionType enum
- Returns:
enum pcpp.DhcpV6OptionType
- property value
- class mtf.libs.mtf_pybinder.pcpp.DhcpV6OptionBuilder
A class for building DHCPv6 options. This builder receives the option parameters in its c’tor, builds the DHCPv6 option raw buffer and provides a build() method to get a DhcpV6Option object out of it
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.DhcpV6OptionBuilder, option_type: mtf.libs.mtf_pybinder.pcpp.DhcpV6OptionType, option_value_as_hex_stream: str) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.DhcpV6OptionBuilder, option_type: mtf.libs.mtf_pybinder.pcpp.DhcpV6OptionType, option_value: int, option_value_len: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.DhcpV6OptionBuilder, arg0: mtf.libs.mtf_pybinder.pcpp.DhcpV6OptionBuilder) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.DhcpV6OptionBuilder, : mtf.libs.mtf_pybinder.pcpp.DhcpV6OptionBuilder) mtf.libs.mtf_pybinder.pcpp.DhcpV6OptionBuilder
- Returns:
pcpp.DhcpV6OptionBuilder
- build(self: mtf.libs.mtf_pybinder.pcpp.DhcpV6OptionBuilder) mtf.libs.mtf_pybinder.pcpp.DhcpV6Option
Build the DhcpV6Option object out of the parameters defined in the c’tor
- Returns:
pcpp.DhcpV6Option: The DhcpV6Option object
- class mtf.libs.mtf_pybinder.pcpp.DhcpV6OptionType
- DHCPv6 option types.
Resources for more information: - https://onlinelibrary.wiley.com/doi/pdf/10.1002/9781118073810.app2 - https://datatracker.ietf.org/doc/html/rfc5970 - https://datatracker.ietf.org/doc/html/rfc6607 - https://datatracker.ietf.org/doc/html/rfc8520
Members:
DHCPV6_OPT_UNKNOWN
DHCPV6_OPT_CLIENTID
DHCPV6_OPT_SERVERID
DHCPV6_OPT_IA_NA
DHCPV6_OPT_IA_TA
DHCPV6_OPT_IAADDR
DHCPV6_OPT_ORO
DHCPV6_OPT_PREFERENCE
DHCPV6_OPT_ELAPSED_TIME
DHCPV6_OPT_RELAY_MSG
DHCPV6_OPT_AUTH
DHCPV6_OPT_UNICAST
DHCPV6_OPT_STATUS_CODE
DHCPV6_OPT_RAPID_COMMIT
DHCPV6_OPT_USER_CLASS
DHCPV6_OPT_VENDOR_CLASS
DHCPV6_OPT_VENDOR_OPTS
DHCPV6_OPT_INTERFACE_ID
DHCPV6_OPT_RECONF_MSG
DHCPV6_OPT_RECONF_ACCEPT
DHCPV6_OPT_SIP_SERVERS_D
DHCPV6_OPT_SIP_SERVERS_A
DHCPV6_OPT_DNS_SERVERS
DHCPV6_OPT_DOMAIN_LIST
DHCPV6_OPT_IA_PD
DHCPV6_OPT_IAPREFIX
DHCPV6_OPT_NIS_SERVERS
DHCPV6_OPT_NISP_SERVERS
DHCPV6_OPT_NIS_DOMAIN_NAME
DHCPV6_OPT_NISP_DOMAIN_NAME
DHCPV6_OPT_SNTP_SERVERS
DHCPV6_OPT_INFORMATION_REFRESH_TIME
DHCPV6_OPT_BCMCS_SERVER_D
DHCPV6_OPT_BCMCS_SERVER_A
DHCPV6_OPT_GEOCONF_CIVIC
DHCPV6_OPT_REMOTE_ID
DHCPV6_OPT_SUBSCRIBER_ID
DHCPV6_OPT_CLIENT_FQDN
DHCPV6_OPT_PANA_AGENT
DHCPV6_OPT_NEW_POSIX_TIMEZONE
DHCPV6_OPT_NEW_TZDB_TIMEZONE
DHCPV6_OPT_ERO
DHCPV6_OPT_LQ_QUERY
DHCPV6_OPT_CLIENT_DATA
DHCPV6_OPT_CLT_TIME
DHCPV6_OPT_LQ_RELAY_DATA
DHCPV6_OPT_LQ_CLIENT_LINK
DHCPV6_OPT_MIP6_HNINF
DHCPV6_OPT_MIP6_RELAY
DHCPV6_OPT_V6_LOST
DHCPV6_OPT_CAPWAP_AC_V6
DHCPV6_OPT_RELAY_ID
DHCPV6_OPT_IPH6_ADDRESS_MOS
DHCPV6_OPT_IPV6_FQDN_MOS
DHCPV6_OPT_NTP_SERVER
DHCPV6_OPT_BOOTFILE_URL
DHCPV6_OPT_BOOTFILE_PARAM
DHCPV6_OPT_CLIENT_ARCH_TYPE
DHCPV6_OPT_NII
DHCPV6_OPT_ERP_LOCAL_DOMAIN_NAME
DHCPV6_OPT_RELAY_SUPPLIED_OPTIONS
DHCPV6_OPT_VSS
DHCPV6_OPT_CLIENT_LINKLAYER_ADDR
DHCPV6_OPT_MUD_URL
- DHCPV6_OPT_AUTH
- DHCPV6_OPT_BCMCS_SERVER_A
- DHCPV6_OPT_BCMCS_SERVER_D
- DHCPV6_OPT_BOOTFILE_PARAM
- DHCPV6_OPT_BOOTFILE_URL
- DHCPV6_OPT_CAPWAP_AC_V6
- DHCPV6_OPT_CLIENTID
- DHCPV6_OPT_CLIENT_ARCH_TYPE
- DHCPV6_OPT_CLIENT_DATA
- DHCPV6_OPT_CLIENT_FQDN
- DHCPV6_OPT_CLIENT_LINKLAYER_ADDR
- DHCPV6_OPT_CLT_TIME
- DHCPV6_OPT_DNS_SERVERS
- DHCPV6_OPT_DOMAIN_LIST
- DHCPV6_OPT_ELAPSED_TIME
- DHCPV6_OPT_ERO
- DHCPV6_OPT_ERP_LOCAL_DOMAIN_NAME
- DHCPV6_OPT_GEOCONF_CIVIC
- DHCPV6_OPT_IAADDR
- DHCPV6_OPT_IAPREFIX
- DHCPV6_OPT_IA_NA
- DHCPV6_OPT_IA_PD
- DHCPV6_OPT_IA_TA
- DHCPV6_OPT_INFORMATION_REFRESH_TIME
- DHCPV6_OPT_INTERFACE_ID
- DHCPV6_OPT_IPH6_ADDRESS_MOS
- DHCPV6_OPT_IPV6_FQDN_MOS
- DHCPV6_OPT_LQ_CLIENT_LINK
- DHCPV6_OPT_LQ_QUERY
- DHCPV6_OPT_LQ_RELAY_DATA
- DHCPV6_OPT_MIP6_HNINF
- DHCPV6_OPT_MIP6_RELAY
- DHCPV6_OPT_MUD_URL
- DHCPV6_OPT_NEW_POSIX_TIMEZONE
- DHCPV6_OPT_NEW_TZDB_TIMEZONE
- DHCPV6_OPT_NII
- DHCPV6_OPT_NISP_DOMAIN_NAME
- DHCPV6_OPT_NISP_SERVERS
- DHCPV6_OPT_NIS_DOMAIN_NAME
- DHCPV6_OPT_NIS_SERVERS
- DHCPV6_OPT_NTP_SERVER
- DHCPV6_OPT_ORO
- DHCPV6_OPT_PANA_AGENT
- DHCPV6_OPT_PREFERENCE
- DHCPV6_OPT_RAPID_COMMIT
- DHCPV6_OPT_RECONF_ACCEPT
- DHCPV6_OPT_RECONF_MSG
- DHCPV6_OPT_RELAY_ID
- DHCPV6_OPT_RELAY_MSG
- DHCPV6_OPT_RELAY_SUPPLIED_OPTIONS
- DHCPV6_OPT_REMOTE_ID
- DHCPV6_OPT_SERVERID
- DHCPV6_OPT_SIP_SERVERS_A
- DHCPV6_OPT_SIP_SERVERS_D
- DHCPV6_OPT_SNTP_SERVERS
- DHCPV6_OPT_STATUS_CODE
- DHCPV6_OPT_SUBSCRIBER_ID
- DHCPV6_OPT_UNICAST
- DHCPV6_OPT_UNKNOWN
- DHCPV6_OPT_USER_CLASS
- DHCPV6_OPT_V6_LOST
- DHCPV6_OPT_VENDOR_CLASS
- DHCPV6_OPT_VENDOR_OPTS
- DHCPV6_OPT_VSS
- __init__(self: mtf.libs.mtf_pybinder.pcpp.DhcpV6OptionType, value: int) None
- __new__(**kwargs)
- property name
- property value
- class mtf.libs.mtf_pybinder.pcpp.Direction
An enum that contains direction (source or destination)
Members:
SRC
DST
SRC_OR_DST
- DST
- SRC
- SRC_OR_DST
- __init__(self: mtf.libs.mtf_pybinder.pcpp.Direction, value: int) None
- __new__(**kwargs)
- property name
- property value
- class mtf.libs.mtf_pybinder.pcpp.DltLayer
Represents an DLT protocol layer.
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.DltLayer, header_type: int, message_counter: int, payload: list[int] = []) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.DltLayer, arg0: mtf.libs.mtf_pybinder.pcpp.DltLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.DltLayer, arg0: mtf.libs.mtf_pybinder.pcpp.DltLayer) -> None
- __new__(**kwargs)
- property application_id
The Application Id in DLT extended header
- property args
The Number of Arguments in DLT extended header
- assign(self: mtf.libs.mtf_pybinder.pcpp.IDataContainer, : mtf.libs.mtf_pybinder.pcpp.IDataContainer) mtf.libs.mtf_pybinder.pcpp.IDataContainer
- Returns:
pcpp.IDataContainer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- property context_id
The Contex Id in DLT extended header
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- property dlt_payload
Payload of DLT layer
- property ecu_id
The Ecu Id in DLT header
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property has_ecu_id
A method to check if this packet has ECU ID
- property has_extended_header
A method to check if this packet has Extended Header
- property has_session_id
A method to check if this packet has Session ID
- property has_timestamp
A method to check if this packet has Timestamp
- property header_len
The header length in bytes
- Returns:
unsigned int
- property header_type
return the header type in host representation
- property header_type_version
Getter for Version field in Herder Type
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- property is_msb_first
A method to check if this packet is MSB First
- property is_verbose
A method to check if this packet is verbose
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property length
return the Length
- property message_counter
The MessageCounter field in host representation
- property message_id
return Message ID, 0 if in verbose mode
- property message_info
The Message Info in DLT extended header
- property message_type
Getter for Message Type in Message Infor
- property message_type_info
Getter for Version field in Herder Type
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property session_id
The Session Id in DLT header
- property time_stamp
The Receive Timestamp in milliseconds in DLT header
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.DoIPAliveCheckRequestLayer
- __init__(self: mtf.libs.mtf_pybinder.pcpp.DoIPAliveCheckRequestLayer, version: int = 0, inverse_version: int = 0) None
- __new__(**kwargs)
- static add_port(port: int) None
add user defined port number for DoIP protocol
- Args:
port (unsigned int)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IDataContainer, : mtf.libs.mtf_pybinder.pcpp.IDataContainer) mtf.libs.mtf_pybinder.pcpp.IDataContainer
- Returns:
pcpp.IDataContainer
- static clear_ports() None
clear the port numbers for DoIP protocol
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- property inverse_version
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property length
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- property type
- property version
- class mtf.libs.mtf_pybinder.pcpp.DoIPAliveCheckResponseLayer
- __init__(self: mtf.libs.mtf_pybinder.pcpp.DoIPAliveCheckResponseLayer, version: int = 0, inverse_version: int = 0, source_address: int = 0) None
- __new__(**kwargs)
- static add_port(port: int) None
add user defined port number for DoIP protocol
- Args:
port (unsigned int)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IDataContainer, : mtf.libs.mtf_pybinder.pcpp.IDataContainer) mtf.libs.mtf_pybinder.pcpp.IDataContainer
- Returns:
pcpp.IDataContainer
- static clear_ports() None
clear the port numbers for DoIP protocol
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- property inverse_version
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property length
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property source_address
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- property type
- property version
- class mtf.libs.mtf_pybinder.pcpp.DoIPDiagnosticMessageAckLayer
- __init__(self: mtf.libs.mtf_pybinder.pcpp.DoIPDiagnosticMessageAckLayer, version: int = 0, inverse_version: int = 0, source_address: int = 0, target_address: int = 0, ack_code: int = 0, previous_message: list[int] = []) None
- __new__(**kwargs)
- property ack_code
- static add_port(port: int) None
add user defined port number for DoIP protocol
- Args:
port (unsigned int)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IDataContainer, : mtf.libs.mtf_pybinder.pcpp.IDataContainer) mtf.libs.mtf_pybinder.pcpp.IDataContainer
- Returns:
pcpp.IDataContainer
- static clear_ports() None
clear the port numbers for DoIP protocol
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- property doip_diagnostic_message_ack_previous_msg_len
- Returns:
unsigned int
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- property inverse_version
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property length
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property previous_message
The previous_message field of the DoIP header
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property source_address
- property target_address
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- property type
- property version
- class mtf.libs.mtf_pybinder.pcpp.DoIPDiagnosticMessageLayer
- __init__(self: mtf.libs.mtf_pybinder.pcpp.DoIPDiagnosticMessageLayer, version: int = 0, inverse_version: int = 0, source_address: int = 0, target_address: int = 0) None
- __new__(**kwargs)
- static add_port(port: int) None
add user defined port number for DoIP protocol
- Args:
port (unsigned int)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IDataContainer, : mtf.libs.mtf_pybinder.pcpp.IDataContainer) mtf.libs.mtf_pybinder.pcpp.IDataContainer
- Returns:
pcpp.IDataContainer
- static clear_ports() None
clear the port numbers for DoIP protocol
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- property inverse_version
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property length
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property source_address
- property target_address
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- property type
- property version
- class mtf.libs.mtf_pybinder.pcpp.DoIPDiagnosticMessageNackLayer
- __init__(self: mtf.libs.mtf_pybinder.pcpp.DoIPDiagnosticMessageNackLayer, version: int = 0, inverse_version: int = 0, source_address: int = 0, target_address: int = 0, nack_code: int = 0, previous_message: list[int] = []) None
- __new__(**kwargs)
- static add_port(port: int) None
add user defined port number for DoIP protocol
- Args:
port (unsigned int)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IDataContainer, : mtf.libs.mtf_pybinder.pcpp.IDataContainer) mtf.libs.mtf_pybinder.pcpp.IDataContainer
- Returns:
pcpp.IDataContainer
- static clear_ports() None
clear the port numbers for DoIP protocol
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- property doip_diagnostic_message_nack_previous_msg_len
- Returns:
unsigned int
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- property inverse_version
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property length
- property nack_code
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property previous_message
The previous_message field of the DoIP header
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property source_address
- property target_address
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- property type
- property version
- class mtf.libs.mtf_pybinder.pcpp.DoIPEntityStatusRequestLayer
- __init__(self: mtf.libs.mtf_pybinder.pcpp.DoIPEntityStatusRequestLayer, version: int = 0, inverse_version: int = 0) None
- __new__(**kwargs)
- static add_port(port: int) None
add user defined port number for DoIP protocol
- Args:
port (unsigned int)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IDataContainer, : mtf.libs.mtf_pybinder.pcpp.IDataContainer) mtf.libs.mtf_pybinder.pcpp.IDataContainer
- Returns:
pcpp.IDataContainer
- static clear_ports() None
clear the port numbers for DoIP protocol
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- property inverse_version
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property length
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- property type
- property version
- class mtf.libs.mtf_pybinder.pcpp.DoIPEntityStatusResponseLayer
- __init__(self: mtf.libs.mtf_pybinder.pcpp.DoIPEntityStatusResponseLayer, version: int = 0, inverse_version: int = 0, node_type: int = 0, max_sockets: int = 0, current_sockets: int = 0, max_data_size: int = 0) None
- __new__(**kwargs)
- static add_port(port: int) None
add user defined port number for DoIP protocol
- Args:
port (unsigned int)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IDataContainer, : mtf.libs.mtf_pybinder.pcpp.IDataContainer) mtf.libs.mtf_pybinder.pcpp.IDataContainer
- Returns:
pcpp.IDataContainer
- static clear_ports() None
clear the port numbers for DoIP protocol
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property current_sockets
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- property inverse_version
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property length
- property max_data_size
- property max_sockets
- property node_type
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- property type
- property version
- class mtf.libs.mtf_pybinder.pcpp.DoIPGenericNackLayer
- __init__(self: mtf.libs.mtf_pybinder.pcpp.DoIPGenericNackLayer, version: int = 0, inverse_version: int = 0, nack_code: int = 0) None
- __new__(**kwargs)
- static add_port(port: int) None
add user defined port number for DoIP protocol
- Args:
port (unsigned int)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IDataContainer, : mtf.libs.mtf_pybinder.pcpp.IDataContainer) mtf.libs.mtf_pybinder.pcpp.IDataContainer
- Returns:
pcpp.IDataContainer
- static clear_ports() None
clear the port numbers for DoIP protocol
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- property inverse_version
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property length
- property nack_code
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- property type
- property version
- class mtf.libs.mtf_pybinder.pcpp.DoIPLayer
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.DoIPLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.DoIPLayer, arg0: mtf.libs.mtf_pybinder.pcpp.DoIPLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.DoIPLayer, arg0: mtf.libs.mtf_pybinder.pcpp.DoIPLayer) -> None
- __new__(**kwargs)
- static add_port(port: int) None
add user defined port number for DoIP protocol
- Args:
port (unsigned int)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IDataContainer, : mtf.libs.mtf_pybinder.pcpp.IDataContainer) mtf.libs.mtf_pybinder.pcpp.IDataContainer
- Returns:
pcpp.IDataContainer
- static clear_ports() None
clear the port numbers for DoIP protocol
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- property inverse_version
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property length
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- property type
- property version
- class mtf.libs.mtf_pybinder.pcpp.DoIPMsgTypes
Members:
kGenricNack
kVehicleIdentificationReq
kVehicleIdentificationReqEid
kVehicleIdentificationReqVin
kVehicleAnnouncementMessage
kRoutingActivationRequest
kRoutingActivationResponse
kAliveCheckRequest
kAliveCheckResponse
kEntityStatusRequest
kEntityStatusResponse
kPowerInformationRequest
kPowerInformationResponse
kDiagnosticMessage
kDiagnosticMessageAck
kDiagnosticMessageNack
- __init__(self: mtf.libs.mtf_pybinder.pcpp.DoIPMsgTypes, value: int) None
- __new__(**kwargs)
- kAliveCheckRequest
- kAliveCheckResponse
- kDiagnosticMessage
- kDiagnosticMessageAck
- kDiagnosticMessageNack
- kEntityStatusRequest
- kEntityStatusResponse
- kGenricNack
- kPowerInformationRequest
- kPowerInformationResponse
- kRoutingActivationRequest
- kRoutingActivationResponse
- kVehicleAnnouncementMessage
- kVehicleIdentificationReq
- kVehicleIdentificationReqEid
- kVehicleIdentificationReqVin
- property name
- property value
- class mtf.libs.mtf_pybinder.pcpp.DoIPPowerInformationRequestLayer
- __init__(self: mtf.libs.mtf_pybinder.pcpp.DoIPPowerInformationRequestLayer, version: int = 0, inverse_version: int = 0) None
- __new__(**kwargs)
- static add_port(port: int) None
add user defined port number for DoIP protocol
- Args:
port (unsigned int)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IDataContainer, : mtf.libs.mtf_pybinder.pcpp.IDataContainer) mtf.libs.mtf_pybinder.pcpp.IDataContainer
- Returns:
pcpp.IDataContainer
- static clear_ports() None
clear the port numbers for DoIP protocol
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- property inverse_version
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property length
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- property type
- property version
- class mtf.libs.mtf_pybinder.pcpp.DoIPPowerInformationResponseLayer
- __init__(self: mtf.libs.mtf_pybinder.pcpp.DoIPPowerInformationResponseLayer, version: int = 0, inverse_version: int = 0, power_mode: int = 0) None
- __new__(**kwargs)
- static add_port(port: int) None
add user defined port number for DoIP protocol
- Args:
port (unsigned int)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IDataContainer, : mtf.libs.mtf_pybinder.pcpp.IDataContainer) mtf.libs.mtf_pybinder.pcpp.IDataContainer
- Returns:
pcpp.IDataContainer
- static clear_ports() None
clear the port numbers for DoIP protocol
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- property inverse_version
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property length
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property power_mode
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- property type
- property version
- class mtf.libs.mtf_pybinder.pcpp.DoIPRoutingActivationRequestLayer
- __init__(self: mtf.libs.mtf_pybinder.pcpp.DoIPRoutingActivationRequestLayer, version: int = 0, inverse_version: int = 0, source_address: int = 0, activation_type: int = 0, reserved_by_iso: int = 0, reserved_by_oem: int = 0) None
- __new__(**kwargs)
- property activation_type
- static add_port(port: int) None
add user defined port number for DoIP protocol
- Args:
port (unsigned int)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IDataContainer, : mtf.libs.mtf_pybinder.pcpp.IDataContainer) mtf.libs.mtf_pybinder.pcpp.IDataContainer
- Returns:
pcpp.IDataContainer
- static clear_ports() None
clear the port numbers for DoIP protocol
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- property inverse_version
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property length
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property reserved_by_iso
- property reserved_by_oem
- property source_address
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- property type
- property version
- class mtf.libs.mtf_pybinder.pcpp.DoIPRoutingActivationResponseLayer
- __init__(self: mtf.libs.mtf_pybinder.pcpp.DoIPRoutingActivationResponseLayer, version: int = 0, inverse_version: int = 0, logical_address_tester: int = 0, logical_address_doip_entity: int = 0, routing_activation_response_code: int = 0, reserved_by_iso: int = 0, reserved_by_oem: int = 0) None
- __new__(**kwargs)
- static add_port(port: int) None
add user defined port number for DoIP protocol
- Args:
port (unsigned int)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IDataContainer, : mtf.libs.mtf_pybinder.pcpp.IDataContainer) mtf.libs.mtf_pybinder.pcpp.IDataContainer
- Returns:
pcpp.IDataContainer
- static clear_ports() None
clear the port numbers for DoIP protocol
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- property inverse_version
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property length
- property logical_address_doip_entity
- property logical_address_tester
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property reserved_by_iso
- property reserved_by_oem
- property routing_activation_response_code
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- property type
- property version
- class mtf.libs.mtf_pybinder.pcpp.DoIPVehicleAnnouncementMessageLayer
- __init__(self: mtf.libs.mtf_pybinder.pcpp.DoIPVehicleAnnouncementMessageLayer, version: int = 0, inverse_version: int = 0, vin: list[int] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], logical_address: int = 0, eid: int = 0, gid: int = 0, further_action: int = 0, use_vin_sync_status: bool = False, vin_gid_status: int = 0) None
- __new__(**kwargs)
- static add_port(port: int) None
add user defined port number for DoIP protocol
- Args:
port (unsigned int)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IDataContainer, : mtf.libs.mtf_pybinder.pcpp.IDataContainer) mtf.libs.mtf_pybinder.pcpp.IDataContainer
- Returns:
pcpp.IDataContainer
- static clear_ports() None
clear the port numbers for DoIP protocol
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- property eid
- property further_action
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property gid
- property has_do_ip_use_vehicle_identification_sync_status
- Returns:
bool
- property header_len
The header length in bytes
- Returns:
unsigned int
- property inverse_version
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property length
- property logical_address
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- property type
- property version
- property vin
- property vin_gid_status
- class mtf.libs.mtf_pybinder.pcpp.DoIPVehicleIdentificationRequestEidLayer
- __init__(self: mtf.libs.mtf_pybinder.pcpp.DoIPVehicleIdentificationRequestEidLayer, version: int = 0, inverse_version: int = 0, eid: int = 0) None
- __new__(**kwargs)
- static add_port(port: int) None
add user defined port number for DoIP protocol
- Args:
port (unsigned int)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IDataContainer, : mtf.libs.mtf_pybinder.pcpp.IDataContainer) mtf.libs.mtf_pybinder.pcpp.IDataContainer
- Returns:
pcpp.IDataContainer
- static clear_ports() None
clear the port numbers for DoIP protocol
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- property eid
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- property inverse_version
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property length
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- property type
- property version
- class mtf.libs.mtf_pybinder.pcpp.DoIPVehicleIdentificationRequestLayer
- __init__(self: mtf.libs.mtf_pybinder.pcpp.DoIPVehicleIdentificationRequestLayer, version: int = 0, inverse_version: int = 0) None
- __new__(**kwargs)
- static add_port(port: int) None
add user defined port number for DoIP protocol
- Args:
port (unsigned int)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IDataContainer, : mtf.libs.mtf_pybinder.pcpp.IDataContainer) mtf.libs.mtf_pybinder.pcpp.IDataContainer
- Returns:
pcpp.IDataContainer
- static clear_ports() None
clear the port numbers for DoIP protocol
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- property inverse_version
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property length
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- property type
- property version
- class mtf.libs.mtf_pybinder.pcpp.DoIPVehicleIdentificationRequestVinLayer
- __init__(self: mtf.libs.mtf_pybinder.pcpp.DoIPVehicleIdentificationRequestVinLayer, version: int = 0, inverse_version: int = 0, vin: list[int] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]) None
- __new__(**kwargs)
- static add_port(port: int) None
add user defined port number for DoIP protocol
- Args:
port (unsigned int)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IDataContainer, : mtf.libs.mtf_pybinder.pcpp.IDataContainer) mtf.libs.mtf_pybinder.pcpp.IDataContainer
- Returns:
pcpp.IDataContainer
- static clear_ports() None
clear the port numbers for DoIP protocol
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- property inverse_version
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property length
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- property type
- property version
- property vin
- class mtf.libs.mtf_pybinder.pcpp.DrarpErrorStatusType
An enum for DRARP Error Status type
Members:
DRARPERR_UNKNOWN
DRARPERR_RESTRICTED
DRARPERR_NOADDRESSES
DRARPERR_SERVERDOWN
DRARPERR_MOVED
DRARPERR_FAILURE
- DRARPERR_FAILURE
- DRARPERR_MOVED
- DRARPERR_NOADDRESSES
- DRARPERR_RESTRICTED
- DRARPERR_SERVERDOWN
- DRARPERR_UNKNOWN
- __init__(self: mtf.libs.mtf_pybinder.pcpp.DrarpErrorStatusType, value: int) None
- __new__(**kwargs)
- property name
- property value
- class mtf.libs.mtf_pybinder.pcpp.DsaLayer
Represents an DSA Tag layer.
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.DsaLayer, dsa_tag: int = 0, inner_ether_type: int = 0) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.DsaLayer, arg0: mtf.libs.mtf_pybinder.pcpp.DsaLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.DsaLayer, arg0: mtf.libs.mtf_pybinder.pcpp.DsaLayer) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IDataContainer, : mtf.libs.mtf_pybinder.pcpp.IDataContainer) mtf.libs.mtf_pybinder.pcpp.IDataContainer
- Returns:
pcpp.IDataContainer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- property dsa_tag
The dsa_tag field of the DSA Tag.
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- property inner_ether_type
The inner_ether_type field of the DSA Tag.
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.ESPDecryption
Helper class that handles IPsec ESP layer decryption
- class KeyInfo
Represents ESP key information using Wireshark esp_sa format
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.ESPDecryption.KeyInfo, arg0: mtf.libs.mtf_pybinder.pcpp.ESPDecryption.KeyInfo) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.ESPDecryption.KeyInfo) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.ESPDecryption.KeyInfo, : mtf.libs.mtf_pybinder.pcpp.ESPDecryption.KeyInfo) mtf.libs.mtf_pybinder.pcpp.ESPDecryption.KeyInfo
- Returns:
pcpp.ESPDecryption.KeyInfo
- property dst_ip
- property encryption_alg
- property encryption_key
- property integrity_alg
- property integrity_key
- property protocol
- property spi
- property src_ip
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.ESPDecryption) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.ESPDecryption, arg0: mtf.libs.mtf_pybinder.pcpp.ESPDecryption) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.ESPDecryption, : mtf.libs.mtf_pybinder.pcpp.ESPDecryption) mtf.libs.mtf_pybinder.pcpp.ESPDecryption
- Returns:
pcpp.ESPDecryption
- set_keys(self: mtf.libs.mtf_pybinder.pcpp.ESPDecryption, keys: list[pcpp::ESPDecryption::KeyInfo]) None
Set key information to use in the decryption process
- Args:
keys (list[pcpp.ESPDecryption.KeyInfo]): Structure containing keys information
- try_decrypt(self: mtf.libs.mtf_pybinder.pcpp.ESPDecryption, packet: mtf.libs.mtf_pybinder.pcpp.Packet, extended_sn: bool = False) mtf.libs.mtf_pybinder.pcpp.Packet
Decrypt an ESP Layer if it contains an encrypted payload
- Args:
packet (bytes): Pointer to the packet containing an ESP Layer extended_sn (bool): Flag to indicate if the sequence number is extended. Default value is false.
- Returns:
std::shared_ptr<pcpp::Packet>: Decrypted ESP packet if successful, null pointer otherwise
- class mtf.libs.mtf_pybinder.pcpp.ESPLayer
Represents an IPSec Encapsulating Security Payload (ESP) layer
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.ESPLayer, arg0: mtf.libs.mtf_pybinder.pcpp.ESPLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.ESPLayer, arg0: mtf.libs.mtf_pybinder.pcpp.ESPLayer) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.ESPLayer, : mtf.libs.mtf_pybinder.pcpp.ESPLayer) mtf.libs.mtf_pybinder.pcpp.ESPLayer
- Returns:
pcpp.ESPLayer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- static is_data_valid(data: int, data_len: int) bool
A static method that validates the input data
- Args:
data (bytes): The pointer to the beginning of a byte stream of a ESP layer data_len (unsigned int): The length of byte stream
- Returns:
bool: True if the data is valid and can represent an ESP layer
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property sequence_number
The sequence number value
- property spi
The Security Parameters Index (SPI) field value
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.EthDot3Layer
Represents an IEEE 802.3 Ethernet protocol layer
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.EthDot3Layer, data: int, data_len: int, packet: mtf.libs.mtf_pybinder.pcpp.Packet) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.EthDot3Layer, data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.EthDot3Layer, source_mac: mtf.libs.mtf_pybinder.pcpp.MacAddress, dest_mac: mtf.libs.mtf_pybinder.pcpp.MacAddress, length: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.EthDot3Layer, arg0: mtf.libs.mtf_pybinder.pcpp.EthDot3Layer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.EthDot3Layer, arg0: mtf.libs.mtf_pybinder.pcpp.EthDot3Layer) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.EthDot3Layer, : mtf.libs.mtf_pybinder.pcpp.EthDot3Layer) mtf.libs.mtf_pybinder.pcpp.EthDot3Layer
- Returns:
pcpp.EthDot3Layer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.EthDot3Layer) None
Does nothing for this layer
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_dest_mac(self: mtf.libs.mtf_pybinder.pcpp.EthDot3Layer) mtf.libs.mtf_pybinder.pcpp.MacAddress
Get the destination MAC address
- Returns:
pcpp.MacAddress: The destination MAC address
- get_eth_header(self: mtf.libs.mtf_pybinder.pcpp.EthDot3Layer) mtf.libs.mtf_pybinder.pcpp.ether_dot3_header
Get a pointer to the Ethernet header. Notice this points directly to the data, so every change will change the actual packet data
- Returns:
pcpp.ether_dot3_header: A pointer to the ether_header
- get_header_len(self: mtf.libs.mtf_pybinder.pcpp.EthDot3Layer) int
Size of ether_dot3_header
- Returns:
unsigned int
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_osi_model_layer(self: mtf.libs.mtf_pybinder.pcpp.EthDot3Layer) mtf.libs.mtf_pybinder.pcpp.OsiModelLayer
- Returns:
enum pcpp.OsiModelLayer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- get_source_mac(self: mtf.libs.mtf_pybinder.pcpp.EthDot3Layer) mtf.libs.mtf_pybinder.pcpp.MacAddress
Get the source MAC address
- Returns:
pcpp.MacAddress: The source MAC address
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- static is_data_valid(data: int, data_len: int) bool
A static method that validates the input data
- Args:
data (bytes): The pointer to the beginning of a byte stream of an IEEE 802.3 Eth packet data_len (unsigned int): The length of the byte stream
- Returns:
bool: True if the data is valid and can represent an IEEE 802.3 Eth packet
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.EthDot3Layer) None
Parses next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- set_dest_mac(self: mtf.libs.mtf_pybinder.pcpp.EthDot3Layer, dest_mac: mtf.libs.mtf_pybinder.pcpp.MacAddress) None
Set destination MAC address
- Args:
dest_mac (pcpp.MacAddress): Destination MAC to set
- set_source_mac(self: mtf.libs.mtf_pybinder.pcpp.EthDot3Layer, source_mac: mtf.libs.mtf_pybinder.pcpp.MacAddress) None
Set source MAC address
- Args:
source_mac (pcpp.MacAddress): Source MAC to set
- to_string(self: mtf.libs.mtf_pybinder.pcpp.EthDot3Layer) str
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.EthLayer
Represents an Ethernet II protocol layer
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.EthLayer, data: int, data_len: int, packet: pcpp::Packet) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.EthLayer, data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: pcpp::Packet) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.EthLayer, arg0: mtf.libs.mtf_pybinder.pcpp.MacAddress, arg1: mtf.libs.mtf_pybinder.pcpp.MacAddress) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.EthLayer, source_mac: mtf.libs.mtf_pybinder.pcpp.MacAddress = <mtf.libs.mtf_pybinder.pcpp.MacAddress object at 0x0000024361864FF0>, dest_mac: mtf.libs.mtf_pybinder.pcpp.MacAddress = <mtf.libs.mtf_pybinder.pcpp.MacAddress object at 0x0000024361889270>, ether_type: int = 0) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.EthLayer, arg0: mtf.libs.mtf_pybinder.pcpp.EthLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.EthLayer, arg0: mtf.libs.mtf_pybinder.pcpp.EthLayer) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.EthLayer, : mtf.libs.mtf_pybinder.pcpp.EthLayer) mtf.libs.mtf_pybinder.pcpp.EthLayer
- Returns:
pcpp.EthLayer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.EthLayer) None
Calculate ether_header#etherType for known protocols: IPv4, IPv6, ARP, VLAN
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_dest_mac(self: mtf.libs.mtf_pybinder.pcpp.EthLayer) mtf.libs.mtf_pybinder.pcpp.MacAddress
Get the destination MAC address
- Returns:
pcpp.MacAddress: The destination MAC address
- get_eth_type(self: mtf.libs.mtf_pybinder.pcpp.EthLayer) int
Get the Ethernet type.
- get_header_len(self: mtf.libs.mtf_pybinder.pcpp.EthLayer) int
Get the size of ether_header
- Returns:
unsigned int: Size of ether_header
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_osi_model_layer(self: mtf.libs.mtf_pybinder.pcpp.EthLayer) mtf.libs.mtf_pybinder.pcpp.OsiModelLayer
- Returns:
enum pcpp.OsiModelLayer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- get_source_mac(self: mtf.libs.mtf_pybinder.pcpp.EthLayer) mtf.libs.mtf_pybinder.pcpp.MacAddress
Get the source MAC address
- Returns:
pcpp.MacAddress: The source MAC address
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- static is_data_valid(data: int, data_len: int) bool
A static method that validates the input data The pointer to the beginning of a byte stream of anEthernet II packet The length of the byte stream True if the data is valid and can represent anEthernet II packet
- Args:
data (bytes): The pointer to the beginning of a byte stream of an Ethernet II packet data_len (unsigned int): The length of the byte stream
- Returns:
bool: True if the data is valid and can represent an Ethernet II packet
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.EthLayer) None
Currently identifies the following next layers: IPv4Layer, IPv6Layer, ArpLayer, VlanLayer, PPPoESessionLayer,PPPoEDiscoveryLayer, MplsLayer. Otherwise sets PayloadLayer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- set_dest_mac(self: mtf.libs.mtf_pybinder.pcpp.EthLayer, dest_mac: mtf.libs.mtf_pybinder.pcpp.MacAddress) None
Set destination MAC address
- Args:
dest_mac (pcpp.MacAddress): Destination MAC to set
- set_source_mac(self: mtf.libs.mtf_pybinder.pcpp.EthLayer, source_mac: mtf.libs.mtf_pybinder.pcpp.MacAddress) None
Set source MAC address
- Args:
source_mac (pcpp.MacAddress): Source MAC to set
- to_string(self: mtf.libs.mtf_pybinder.pcpp.EthLayer) str
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.EtherTypeFilter
A class for filtering by EtherType field of the Ethernet protocol. This enables to filter packets from certain protocols, such as ARP, IPv4, IPv6, VLAN tags, etc.<BR> For deeper understanding of the filter concept please refer to PcapFilter.h
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.EtherTypeFilter, ether_type: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.EtherTypeFilter, arg0: mtf.libs.mtf_pybinder.pcpp.EtherTypeFilter) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.EtherTypeFilter, : mtf.libs.mtf_pybinder.pcpp.EtherTypeFilter) mtf.libs.mtf_pybinder.pcpp.EtherTypeFilter
- Returns:
pcpp.EtherTypeFilter
- match_packet_with_filter(self: mtf.libs.mtf_pybinder.pcpp.GeneralFilter, raw_packet: mtf.libs.mtf_pybinder.pcpp.RawPacket) bool
Match a raw packet with a given BPF filter.
A pointer to the raw packet to match the BPF filter with True if a raw packet matches the BPF filter or false otherwise
- Args:
raw_packet (str)
- Returns:
bool
- parse_to_string(self: mtf.libs.mtf_pybinder.pcpp.GeneralFilter, result: str) None
A method that parses the class instance into BPF string format
An empty string that the parsing will be written into. If the string isn’t empty, its content will be overridden
- Args:
result (str)
- Returns:
void
- set_ether_type(self: mtf.libs.mtf_pybinder.pcpp.EtherTypeFilter, ether_type: int) None
Set the EtherType value
The EtherType value to create the filter with
- Args:
ether_type (str)
- Returns:
void
- class mtf.libs.mtf_pybinder.pcpp.FilterOperator
Supported operators enum
Members:
EQUALS
NOT_EQUALS
GREATER_THAN
GREATER_OR_EQUAL
LESS_THAN
LESS_OR_EQUAL
- EQUALS
- GREATER_OR_EQUAL
- GREATER_THAN
- LESS_OR_EQUAL
- LESS_THAN
- NOT_EQUALS
- __init__(self: mtf.libs.mtf_pybinder.pcpp.FilterOperator, value: int) None
- __new__(**kwargs)
- property name
- property value
- class mtf.libs.mtf_pybinder.pcpp.FtpDataLayer
Class for representing the data of FTP Layer
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.FtpDataLayer, data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.FtpDataLayer, arg0: mtf.libs.mtf_pybinder.pcpp.FtpDataLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.FtpDataLayer, arg0: mtf.libs.mtf_pybinder.pcpp.FtpDataLayer) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.FtpDataLayer, : mtf.libs.mtf_pybinder.pcpp.FtpDataLayer) mtf.libs.mtf_pybinder.pcpp.FtpDataLayer
- Returns:
pcpp.FtpDataLayer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property payload
- property payload_len
Get the payload data length The payload data length in bytes
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- to_string(self: mtf.libs.mtf_pybinder.pcpp.FtpDataLayer) str
Returns the protocol info as readable string
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.FtpLayer
Class for general FTP message
- __init__(self: mtf.libs.mtf_pybinder.pcpp.FtpLayer, arg0: mtf.libs.mtf_pybinder.pcpp.FtpLayer) None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.FtpLayer, : mtf.libs.mtf_pybinder.pcpp.FtpLayer) mtf.libs.mtf_pybinder.pcpp.FtpLayer
- Returns:
pcpp.FtpLayer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.FtpLayer) None
Does nothing for this layer
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_header_len(self: mtf.libs.mtf_pybinder.pcpp.FtpLayer) int
Get the size of the layer
- Returns:
unsigned int
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_osi_model_layer(self: mtf.libs.mtf_pybinder.pcpp.FtpLayer) mtf.libs.mtf_pybinder.pcpp.OsiModelLayer
The OSI layer level of FTP (Application Layer).
- Returns:
enum pcpp.OsiModelLayer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- static is_data_valid(data: int, data_size: int) bool
A static method that takes a byte array and detects whether it is a single command text based message. All single command text based message terminated with single.
- Args:
data (bytes): A byte array data_size (unsigned int): The byte array size (in bytes)
- Returns:
bool: True if the data is identified as single command text based message
- static is_ftp_data_port(port: int) bool
A static method that checks whether the port is considered as FTP data
- Args:
port (unsigned int): The port number to be checked
- Returns:
bool
- static is_ftp_port(port: int) bool
A static method that checks whether the port is considered as FTP control
- Args:
port (unsigned int): The port number to be checked
- Returns:
bool
- is_multi_line(self: mtf.libs.mtf_pybinder.pcpp.SingleCommandTextProtocol) bool
Checks if the current message is a multi-line reply. Multi-line messages are indicated with a Hyphen (-) immediately after reply code.
- Returns:
bool: true If this is a multi-line reply, false Otherwise
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.FtpLayer) None
FTP is the always last so does nothing for this layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.FtpRequestLayer
Class for representing the request messages of FTP Layer
- class FtpCommand
Enum for FTP command codes
Members:
UNK
ABOR
ACCT
ADAT
ALLO
APPE
AUTH
AVBL
CCC
CDUP
CONF
CSID
CWD
DELE
DSIZ
ENC
EPRT
EPSV
FEAT
HELP
HOST
LANG
LIST
LPRT
LPSV
MDTM
MFCT
MFF
MFMT
MIC
MKD
MLSD
MLST
MODE
NLST
NOOP
OPTS
PASS
PASV
PBSZ
PORT
PROT
PWD
QUIT
REIN
REST
RETR
RMD
RMDA
RNFR
RNTO
SITE
SIZE
SMNT
SPSV
STAT
STOR
STOU
STRU
SYST
THMB
TYPE
USER
XCUP
XMKD
XPWD
XRCP
XRMD
XRSQ
XSEM
XSEN
- ABOR
- ACCT
- ADAT
- ALLO
- APPE
- AUTH
- AVBL
- CCC
- CDUP
- CONF
- CSID
- CWD
- DELE
- DSIZ
- ENC
- EPRT
- EPSV
- FEAT
- HELP
- HOST
- LANG
- LIST
- LPRT
- LPSV
- MDTM
- MFCT
- MFF
- MFMT
- MIC
- MKD
- MLSD
- MLST
- MODE
- NLST
- NOOP
- OPTS
- PASS
- PASV
- PBSZ
- PORT
- PROT
- PWD
- QUIT
- REIN
- REST
- RETR
- RMD
- RMDA
- RNFR
- RNTO
- SITE
- SIZE
- SMNT
- SPSV
- STAT
- STOR
- STOU
- STRU
- SYST
- THMB
- TYPE
- UNK
- USER
- XCUP
- XMKD
- XPWD
- XRCP
- XRMD
- XRSQ
- XSEM
- XSEN
- __init__(self: mtf.libs.mtf_pybinder.pcpp.FtpRequestLayer.FtpCommand, value: int) None
- __new__(**kwargs)
- property name
- property value
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.FtpRequestLayer, data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.FtpRequestLayer, arg0: pcpp::FtpRequestLayer::FtpCommand) -> None
doc
__init__(self: mtf.libs.mtf_pybinder.pcpp.FtpRequestLayer, command: pcpp::FtpRequestLayer::FtpCommand, option: str) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.FtpRequestLayer, : mtf.libs.mtf_pybinder.pcpp.FtpRequestLayer) mtf.libs.mtf_pybinder.pcpp.FtpRequestLayer
- Returns:
pcpp.FtpRequestLayer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.FtpLayer) None
Does nothing for this layer
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_command(self: mtf.libs.mtf_pybinder.pcpp.FtpRequestLayer) mtf.libs.mtf_pybinder.pcpp.FtpRequestLayer.FtpCommand
Get the command of request message
- Returns:
enum pcpp.FtpRequestLayer.FtpCommand: FtpCommand Value of the command
- static get_command_as_string(code: mtf.libs.mtf_pybinder.pcpp.FtpRequestLayer.FtpCommand) str
Convert the command to readable string
- Args:
code (enum pcpp.FtpRequestLayer.FtpCommand): Command code to convert
- Returns:
str: std::string Returns the command as readable string
- static get_command_info(code: mtf.libs.mtf_pybinder.pcpp.FtpRequestLayer.FtpCommand) str
Convert the command info to readable string
- Args:
code (enum pcpp.FtpRequestLayer.FtpCommand): Command code to convert
- Returns:
str: std::string Returns the command info as readable string
- get_command_option(*args, **kwargs)
Overloaded function.
get_command_option(self: mtf.libs.mtf_pybinder.pcpp.FtpRequestLayer) -> str
- Returns:
str
get_command_option(self: mtf.libs.mtf_pybinder.pcpp.FtpRequestLayer, remove_escape_characters: bool) -> str
Get the command argument of request message
- Args:
remove_escape_characters (bool): Whether non-alphanumerical characters should be removed or not
- Returns:
str: std::string Value of command argument
- get_command_string(self: mtf.libs.mtf_pybinder.pcpp.FtpRequestLayer) str
Get the command of request message as string
- Returns:
str: std::string Value of the command as string
- get_header_len(self: mtf.libs.mtf_pybinder.pcpp.FtpLayer) int
Get the size of the layer
- Returns:
unsigned int
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_osi_model_layer(self: mtf.libs.mtf_pybinder.pcpp.FtpLayer) mtf.libs.mtf_pybinder.pcpp.OsiModelLayer
The OSI layer level of FTP (Application Layer).
- Returns:
enum pcpp.OsiModelLayer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- static is_data_valid(data: int, data_size: int) bool
A static method that takes a byte array and detects whether it is a single command text based message. All single command text based message terminated with single.
- Args:
data (bytes): A byte array data_size (unsigned int): The byte array size (in bytes)
- Returns:
bool: True if the data is identified as single command text based message
- static is_ftp_data_port(port: int) bool
A static method that checks whether the port is considered as FTP data
- Args:
port (unsigned int): The port number to be checked
- Returns:
bool
- static is_ftp_port(port: int) bool
A static method that checks whether the port is considered as FTP control
- Args:
port (unsigned int): The port number to be checked
- Returns:
bool
- is_multi_line(self: mtf.libs.mtf_pybinder.pcpp.SingleCommandTextProtocol) bool
Checks if the current message is a multi-line reply. Multi-line messages are indicated with a Hyphen (-) immediately after reply code.
- Returns:
bool: true If this is a multi-line reply, false Otherwise
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.FtpLayer) None
FTP is the always last so does nothing for this layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- set_command(self: mtf.libs.mtf_pybinder.pcpp.FtpRequestLayer, code: mtf.libs.mtf_pybinder.pcpp.FtpRequestLayer.FtpCommand) bool
Set the command of request message
- Args:
code (enum pcpp.FtpRequestLayer.FtpCommand): Value to set command
- Returns:
bool: True if the operation is successful, false otherwise
- set_command_option(self: mtf.libs.mtf_pybinder.pcpp.FtpRequestLayer, value: str) bool
Set the command argument of request message
- Args:
value (str): Value to set command argument
- Returns:
bool: True if the operation is successful, false otherwise
- to_string(self: mtf.libs.mtf_pybinder.pcpp.FtpRequestLayer) str
Returns the protocol info as readable string
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.FtpResponseLayer
Class for representing the response messages of FTP Layer
- class FtpStatusCode
Enum for FTP response codes
Members:
UNKNOWN
RESTART_MARKER
SERVICE_READY_IN_MIN
DATA_ALREADY_OPEN_START_TRANSFER
FILE_OK
COMMAND_OK
COMMAND_NOT_IMPLEMENTED_SUPERFLUOUS
SYSTEM_STATUS
DIR_STATUS
FILE_STATUS
HELP_MESSAGE
NAME_SYSTEM_TYPE
SERVICE_READY_FOR_USER
SERVICE_CLOSING_CONTROL
DATA_OPEN_NO_TRANSFER
CLOSING_DATA
ENTERING_PASSIVE
ENTERING_EXTENDED_PASSIVE
USER_LOG_IN_PROCEED
USER_LOG_IN_AUTHORIZED
SEC_DATA_EXCHANGE_COMPLETE
SEC_DATA_EXCHANGE_COMPLETE_SUCCESS
REQ_FILE_OK_COMPLETE
PATHNAME_CREATED
USER_OK_NEED_PASSWORD
NEED_ACCOUNT
REQ_SEC_MECHANISM_OK
SEC_IS_ACCEPTABLE
USER_OK_NEED_PASS_CHALLENGE
FILE_PENDING_ACTION
SERVICE_NOT_AVAILABLE
CANT_OPEN_DATA_CONNECTION
CONNECTION_CLOSED
NEED_UNAVAILABLE_RESOURCE_TO_SEC
REQ_FILE_ACTION_NOT_TAKEN
REQ_ACTION_ABORTED
REQ_ACTION_NOT_TAKEN
SYNTAX_ERROR_COMMAND_UNRECOGNIZED
SYNTAX_ERROR_PARAMETER_OR_ARGUMENT
COMMAND_NOT_IMPLEMENTED
BAD_SEQUENCE_COMMANDS
COMMAND_NOT_IMPLEMENTED_FOR_PARAMETER
NETWORK_PROTOCOL_NOT_SUPPORTED
NOT_LOGGED_IN
NEED_ACCOUNT_FOR_STORE_FILE
COMMAND_PROTECTION_DENIED
REQUEST_DENIED
FAILED_SEC_CHECK
REQ_PROT_LEVEL_NOT_SUPPORTED
COMMAND_PROTECTION_LEVEL_NOT_SUPPORTED
FILE_UNAVAILABLE
PAGE_TYPE_UNKNOWN
EXCEED_STORAGE_ALLOCATION
FILENAME_NOT_ALLOWED
INTEGRITY_PROTECTED
CONFIDENTIALITY_AND_INTEGRITY_PROTECTED
CONFIDENTIALITY_PROTECTED
- BAD_SEQUENCE_COMMANDS
- CANT_OPEN_DATA_CONNECTION
- CLOSING_DATA
- COMMAND_NOT_IMPLEMENTED
- COMMAND_NOT_IMPLEMENTED_FOR_PARAMETER
- COMMAND_NOT_IMPLEMENTED_SUPERFLUOUS
- COMMAND_OK
- COMMAND_PROTECTION_DENIED
- COMMAND_PROTECTION_LEVEL_NOT_SUPPORTED
- CONFIDENTIALITY_AND_INTEGRITY_PROTECTED
- CONFIDENTIALITY_PROTECTED
- CONNECTION_CLOSED
- DATA_ALREADY_OPEN_START_TRANSFER
- DATA_OPEN_NO_TRANSFER
- DIR_STATUS
- ENTERING_EXTENDED_PASSIVE
- ENTERING_PASSIVE
- EXCEED_STORAGE_ALLOCATION
- FAILED_SEC_CHECK
- FILENAME_NOT_ALLOWED
- FILE_OK
- FILE_PENDING_ACTION
- FILE_STATUS
- FILE_UNAVAILABLE
- HELP_MESSAGE
- INTEGRITY_PROTECTED
- NAME_SYSTEM_TYPE
- NEED_ACCOUNT
- NEED_ACCOUNT_FOR_STORE_FILE
- NEED_UNAVAILABLE_RESOURCE_TO_SEC
- NETWORK_PROTOCOL_NOT_SUPPORTED
- NOT_LOGGED_IN
- PAGE_TYPE_UNKNOWN
- PATHNAME_CREATED
- REQUEST_DENIED
- REQ_ACTION_ABORTED
- REQ_ACTION_NOT_TAKEN
- REQ_FILE_ACTION_NOT_TAKEN
- REQ_FILE_OK_COMPLETE
- REQ_PROT_LEVEL_NOT_SUPPORTED
- REQ_SEC_MECHANISM_OK
- RESTART_MARKER
- SEC_DATA_EXCHANGE_COMPLETE
- SEC_DATA_EXCHANGE_COMPLETE_SUCCESS
- SEC_IS_ACCEPTABLE
- SERVICE_CLOSING_CONTROL
- SERVICE_NOT_AVAILABLE
- SERVICE_READY_FOR_USER
- SERVICE_READY_IN_MIN
- SYNTAX_ERROR_COMMAND_UNRECOGNIZED
- SYNTAX_ERROR_PARAMETER_OR_ARGUMENT
- SYSTEM_STATUS
- UNKNOWN
- USER_LOG_IN_AUTHORIZED
- USER_LOG_IN_PROCEED
- USER_OK_NEED_PASSWORD
- USER_OK_NEED_PASS_CHALLENGE
- __init__(self: mtf.libs.mtf_pybinder.pcpp.FtpResponseLayer.FtpStatusCode, value: int) None
- __new__(**kwargs)
- property name
- property value
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.FtpResponseLayer, data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.FtpResponseLayer, arg0: pcpp::FtpResponseLayer::FtpStatusCode) -> None
doc
__init__(self: mtf.libs.mtf_pybinder.pcpp.FtpResponseLayer, code: pcpp::FtpResponseLayer::FtpStatusCode, option: str) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.FtpResponseLayer, : mtf.libs.mtf_pybinder.pcpp.FtpResponseLayer) mtf.libs.mtf_pybinder.pcpp.FtpResponseLayer
- Returns:
pcpp.FtpResponseLayer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.FtpLayer) None
Does nothing for this layer
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_header_len(self: mtf.libs.mtf_pybinder.pcpp.FtpLayer) int
Get the size of the layer
- Returns:
unsigned int
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_osi_model_layer(self: mtf.libs.mtf_pybinder.pcpp.FtpLayer) mtf.libs.mtf_pybinder.pcpp.OsiModelLayer
The OSI layer level of FTP (Application Layer).
- Returns:
enum pcpp.OsiModelLayer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- get_status_code(self: mtf.libs.mtf_pybinder.pcpp.FtpResponseLayer) mtf.libs.mtf_pybinder.pcpp.FtpResponseLayer.FtpStatusCode
Get the status code of response message
- Returns:
enum pcpp.FtpResponseLayer.FtpStatusCode: FtpStatusCode Value of the status code
- static get_status_code_as_string(code: mtf.libs.mtf_pybinder.pcpp.FtpResponseLayer.FtpStatusCode) str
Convert the status code to readable string
- Args:
code (enum pcpp.FtpResponseLayer.FtpStatusCode): Status code to convert
- Returns:
str: std::string Returns the status info as readable string
- get_status_code_string(self: mtf.libs.mtf_pybinder.pcpp.FtpResponseLayer) str
Get the status code of response message as string
- Returns:
str: std::string Value of the status code as string
- get_status_option(*args, **kwargs)
Overloaded function.
get_status_option(self: mtf.libs.mtf_pybinder.pcpp.FtpResponseLayer) -> str
- Returns:
str
get_status_option(self: mtf.libs.mtf_pybinder.pcpp.FtpResponseLayer, remove_escape_characters: bool) -> str
Get the argument of response message
- Args:
remove_escape_characters (bool): Whether non-alphanumerical characters should be removed or not
- Returns:
str: std::string Value of argument
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- static is_data_valid(data: int, data_size: int) bool
A static method that takes a byte array and detects whether it is a single command text based message. All single command text based message terminated with single.
- Args:
data (bytes): A byte array data_size (unsigned int): The byte array size (in bytes)
- Returns:
bool: True if the data is identified as single command text based message
- static is_ftp_data_port(port: int) bool
A static method that checks whether the port is considered as FTP data
- Args:
port (unsigned int): The port number to be checked
- Returns:
bool
- static is_ftp_port(port: int) bool
A static method that checks whether the port is considered as FTP control
- Args:
port (unsigned int): The port number to be checked
- Returns:
bool
- is_multi_line(self: mtf.libs.mtf_pybinder.pcpp.SingleCommandTextProtocol) bool
Checks if the current message is a multi-line reply. Multi-line messages are indicated with a Hyphen (-) immediately after reply code.
- Returns:
bool: true If this is a multi-line reply, false Otherwise
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.FtpLayer) None
FTP is the always last so does nothing for this layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- set_status_code(self: mtf.libs.mtf_pybinder.pcpp.FtpResponseLayer, code: mtf.libs.mtf_pybinder.pcpp.FtpResponseLayer.FtpStatusCode) bool
Set the status code of response message
- Args:
code (enum pcpp.FtpResponseLayer.FtpStatusCode): Value to set status code
- Returns:
bool: True if the operation is successful, false otherwise
- set_status_option(self: mtf.libs.mtf_pybinder.pcpp.FtpResponseLayer, value: str) bool
Set the argument of response message
- Args:
value (str): Value to set argument
- Returns:
bool: True if the operation is successful, false otherwise
- to_string(self: mtf.libs.mtf_pybinder.pcpp.FtpResponseLayer) str
Returns the protocol info as readable string
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.GREv0Layer
Represents a GRE version 0 protocol. Limitation: currently this layer doesn’t support GRE routing information parsing and editing. So if a GREv0 packet includes routing information it won’t be parse correctly. I didn’t add it because of lack of time, but if you need it please tell me and I’ll add it
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.GREv0Layer, data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.GREv0Layer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.GREv0Layer, arg0: mtf.libs.mtf_pybinder.pcpp.GREv0Layer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.GREv0Layer, arg0: mtf.libs.mtf_pybinder.pcpp.GREv0Layer) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.GREv0Layer, : mtf.libs.mtf_pybinder.pcpp.GREv0Layer) mtf.libs.mtf_pybinder.pcpp.GREv0Layer
- Returns:
pcpp.GREv0Layer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.GREv0Layer) None
Calculate the following fields: - gre_basic_header#protocol - GRE checksum field (if exists in packet)
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_checksum(self: mtf.libs.mtf_pybinder.pcpp.GREv0Layer, checksum: int) bool
Get checksum value if field exists in layer
- Args:
checksum (unsigned int): The returned checksum value if exists in layer. Else remain unchanged
- Returns:
bool: True if checksum field exists in layer. In this case checksum parameter will be filled with the value.
Or false if checksum field doesn’t exist in layer
- get_gre_header(self: mtf.libs.mtf_pybinder.pcpp.GREv0Layer) mtf.libs.mtf_pybinder.pcpp.gre_basic_header
Get a pointer to the basic GRE header containing only non-optional fields. Notice this points directly to the data, so every change will change the actual packet data. Also please notice that changing the set bits (gre_basic_header#strictSourceRouteBit, gre_basic_header#sequenceNumBit, gre_basic_header#keyBit, gre_basic_header#routingBit, gre_basic_header#checksumBit, gre_basic_header#ackSequenceNumBit) without using the proper set or unset methods (such as setChecksum(), unsetChecksum(), etc.) may result to wrong calculation of header length and really weird bugs. Please avoid doing so
- Returns:
pcpp.gre_basic_header: A pointer to the gre_basic_header
- static get_gre_version(gre_data: int, gre_data_len: int) int
A static method that determines the GRE version of GRE layer raw data by looking at the gre_basic_header#version field
- Args:
gre_data (bytes): GRE layer raw data gre_data_len (unsigned int): Size of raw data
- Returns:
unsigned int: ::GREv0 or ::GREv1 values if raw data is GREv0 or GREv1 (accordingly) or ::UnknownProtocol otherwise
- get_header_len(self: mtf.libs.mtf_pybinder.pcpp.GreLayer) int
Size of GRE header (may change if optional fields are added or removed)
- Returns:
unsigned int
- get_key(self: mtf.libs.mtf_pybinder.pcpp.GREv0Layer, key: int) bool
Get key value if field exists in layer The returned key value if exists in layer. Else remain unchanged
- Args:
key (unsigned int): The returned key value if exists in layer. Else remain unchanged
- Returns:
bool: True if key field exists in layer. In this case key parameter will be filled with the value.
Or false if key field doesn’t exist in layer
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_offset(self: mtf.libs.mtf_pybinder.pcpp.GREv0Layer, offset: int) bool
Get offset value if field exists in layer. Notice there is no setOffset() method as GRE routing information isn’t supported yet (see comment on class description)
- Args:
offset (unsigned int): The returned offset value if exists in layer. Else remain unchanged
- Returns:
bool: True if offset field exists in layer. In this case offset parameter will be filled with the value.
Or false if offset field doesn’t exist in layer
- get_osi_model_layer(self: mtf.libs.mtf_pybinder.pcpp.GreLayer) mtf.libs.mtf_pybinder.pcpp.OsiModelLayer
- Returns:
enum pcpp.OsiModelLayer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- get_sequence_number(self: mtf.libs.mtf_pybinder.pcpp.GreLayer, seq_number: int) bool
Get sequence number value if field exists in layer
- Args:
seq_number (unsigned int): The returned sequence number value if exists in layer. Else remain unchanged
- Returns:
bool: True if sequence number field exists in layer. In this case seqNumber will be filled with the value.
Or false if sequence number field doesn’t exist in layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- static is_data_valid(data: int, data_len: int) bool
A static method that validates the input data
- Args:
data (bytes): The pointer to the beginning of a byte stream of an GREv0 layer data_len (unsigned int): The length of the byte stream
- Returns:
bool: True if the data is valid and can represent an GREv0 layer
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.GreLayer) None
Currently identifies the following next layers: IPv4Layer, IPv6Layer, VlanLayer, MplsLayer, PPP_PPTPLayer, EthLayer, EthDot3Layer Otherwise sets PayloadLayer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- set_checksum(self: mtf.libs.mtf_pybinder.pcpp.GREv0Layer, checksum: int) bool
Set checksum value. If checksum or offset fields already exist (gre_basic_header#checksumBit or gre_basic_header#routingBit are set) then only the new value is set. If both fields don’t exist a new 4-byte value will be added to the layer, gre_basic_header#checksumBit will be set (gre_basic_header#routingBit will remain unset), the new checksum value will be set and offset value will be set to 0. The reason both fields are added is that GREv0 protocol states both of them or none of them should exist on packet (even if only one of the bits are set)
- Args:
checksum (unsigned int): The checksum value to set
- Returns:
bool: True if managed to set the value/s successfully, or false otherwise (if couldn’t extend the layer)
- set_key(self: mtf.libs.mtf_pybinder.pcpp.GREv0Layer, key: int) bool
Set key value. If field already exists (gre_basic_header#keyBit is set) then only the new value is set. If field doesn’t exist it will be added to the layer, gre_basic_header#keyBit will be set and the new value will be set
- Args:
key (unsigned int): The key value to set
- Returns:
bool: True if managed to set the value successfully, or false otherwise (if couldn’t extend the layer)
- set_sequence_number(self: mtf.libs.mtf_pybinder.pcpp.GreLayer, seq_number: int) bool
Set sequence number value. If field already exists (gre_basic_header#sequenceNumBit is set) then only the new value is set. If field doesn’t exist it will be added to the layer, gre_basic_header#sequenceNumBit will be set and the new value will be set
- Args:
seq_number (unsigned int): The sequence number value to set
- Returns:
bool: True if managed to set the value successfully, or false otherwise (if couldn’t extend the layer)
- to_string(self: mtf.libs.mtf_pybinder.pcpp.GREv0Layer) str
- Returns:
str
- unset_checksum(self: mtf.libs.mtf_pybinder.pcpp.GREv0Layer) bool
Unset checksum and possibly remove it from the layer. It will be removed from the layer only if gre_basic_header#routingBit is not set as well. Otherwise checksum field will remain on packet with value of 0
- Returns:
bool: True if managed to unset successfully or false (and error log) if checksum wasn’t set in the first
place or if didn’t manage to remove it from the layer
- unset_key(self: mtf.libs.mtf_pybinder.pcpp.GREv0Layer) bool
Unset key and remove it from the layer
- Returns:
bool: True if managed to unset successfully or false (and error log) if key wasn’t set in the first
place or if didn’t manage to remove it from the layer
- unset_sequence_number(self: mtf.libs.mtf_pybinder.pcpp.GreLayer) bool
Unset sequence number and remove it from the layer
- Returns:
bool: True if managed to unset successfully or false (and error log) if sequence number wasn’t set in the first
place or if didn’t manage to remove it from the layer
- class mtf.libs.mtf_pybinder.pcpp.GREv1Layer
Represents a GRE version 1 protocol
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.GREv1Layer, data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.GREv1Layer, call_id: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.GREv1Layer, arg0: mtf.libs.mtf_pybinder.pcpp.GREv1Layer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.GREv1Layer, arg0: mtf.libs.mtf_pybinder.pcpp.GREv1Layer) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.GREv1Layer, : mtf.libs.mtf_pybinder.pcpp.GREv1Layer) mtf.libs.mtf_pybinder.pcpp.GREv1Layer
- Returns:
pcpp.GREv1Layer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.GREv1Layer) None
Calculate the following fields: - gre1_header#payloadLength - gre_basic_header#protocol
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_acknowledgment_num(self: mtf.libs.mtf_pybinder.pcpp.GREv1Layer, ack_num: int) bool
Get acknowledgment (ack) number value if field exists in layer
- Args:
ack_num (unsigned int): The returned ack number value if exists in layer. Else remain unchanged
- Returns:
bool: True if ack number field exists in layer. In this case ackNum will be filled with the value.
Or false if ack number field doesn’t exist in layer
- get_gre_header(self: mtf.libs.mtf_pybinder.pcpp.GREv1Layer) mtf.libs.mtf_pybinder.pcpp.gre1_header
Get a pointer to the basic GREv1 header containing all non-optional fields. Notice this points directly to the data, so every change will change the actual packet data. Also please notice that changing the set bits (gre_basic_header#strictSourceRouteBit, gre_basic_header#sequenceNumBit, gre_basic_header#keyBit, gre_basic_header#routingBit, gre_basic_header#checksumBit, gre_basic_header#ackSequenceNumBit) without using the proper set or unset methods (such as setAcknowledgmentNum(), unsetSequenceNumber(), etc.) may result to wrong calculation of header length or illegal GREv1 packet and to some really weird bugs. Please avoid doing so
- Returns:
pcpp.gre1_header: A pointer to the gre1_header
- static get_gre_version(gre_data: int, gre_data_len: int) int
A static method that determines the GRE version of GRE layer raw data by looking at the gre_basic_header#version field
- Args:
gre_data (bytes): GRE layer raw data gre_data_len (unsigned int): Size of raw data
- Returns:
unsigned int: ::GREv0 or ::GREv1 values if raw data is GREv0 or GREv1 (accordingly) or ::UnknownProtocol otherwise
- get_header_len(self: mtf.libs.mtf_pybinder.pcpp.GreLayer) int
Size of GRE header (may change if optional fields are added or removed)
- Returns:
unsigned int
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_osi_model_layer(self: mtf.libs.mtf_pybinder.pcpp.GreLayer) mtf.libs.mtf_pybinder.pcpp.OsiModelLayer
- Returns:
enum pcpp.OsiModelLayer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- get_sequence_number(self: mtf.libs.mtf_pybinder.pcpp.GreLayer, seq_number: int) bool
Get sequence number value if field exists in layer
- Args:
seq_number (unsigned int): The returned sequence number value if exists in layer. Else remain unchanged
- Returns:
bool: True if sequence number field exists in layer. In this case seqNumber will be filled with the value.
Or false if sequence number field doesn’t exist in layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- static is_data_valid(data: int, data_len: int) bool
A static method that validates the input data
- Args:
data (bytes): The pointer to the beginning of a byte stream of an GREv1 layer data_len (unsigned int): The length of the byte stream
- Returns:
bool: True if the data is valid and can represent an GREv1 layer
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.GreLayer) None
Currently identifies the following next layers: IPv4Layer, IPv6Layer, VlanLayer, MplsLayer, PPP_PPTPLayer, EthLayer, EthDot3Layer Otherwise sets PayloadLayer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- set_acknowledgment_num(self: mtf.libs.mtf_pybinder.pcpp.GREv1Layer, ack_num: int) bool
Set acknowledgment (ack) number value. If field already exists (gre_basic_header#ackSequenceNumBit is set) then only the new value is set. If field doesn’t exist it will be added to the layer, gre_basic_header#ackSequenceNumBit will be set and the new value will be set
- Args:
ack_num (unsigned int): The ack number value to set
- Returns:
bool: True if managed to set the value successfully, or false otherwise (if couldn’t extend the layer)
- set_sequence_number(self: mtf.libs.mtf_pybinder.pcpp.GreLayer, seq_number: int) bool
Set sequence number value. If field already exists (gre_basic_header#sequenceNumBit is set) then only the new value is set. If field doesn’t exist it will be added to the layer, gre_basic_header#sequenceNumBit will be set and the new value will be set
- Args:
seq_number (unsigned int): The sequence number value to set
- Returns:
bool: True if managed to set the value successfully, or false otherwise (if couldn’t extend the layer)
- to_string(self: mtf.libs.mtf_pybinder.pcpp.GREv1Layer) str
- Returns:
str
- unset_acknowledgment_num(self: mtf.libs.mtf_pybinder.pcpp.GREv1Layer) bool
Unset acknowledgment (ack) number and remove it from the layer True if managed to unset successfully or false (and error log) if ack number wasn’t set in the first place or if didn’t manage to remove it from the layer
- Returns:
bool
- unset_sequence_number(self: mtf.libs.mtf_pybinder.pcpp.GreLayer) bool
Unset sequence number and remove it from the layer
- Returns:
bool: True if managed to unset successfully or false (and error log) if sequence number wasn’t set in the first
place or if didn’t manage to remove it from the layer
- class mtf.libs.mtf_pybinder.pcpp.GeneralFilter
The base class for all filter classes. This class is virtual and abstract, hence cannot be instantiated.<BR> For deeper understanding of the filter concept please refer to PcapFilter.h
- __init__(*args, **kwargs)
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.GeneralFilter, : mtf.libs.mtf_pybinder.pcpp.GeneralFilter) mtf.libs.mtf_pybinder.pcpp.GeneralFilter
- Returns:
pcpp.GeneralFilter
- match_packet_with_filter(self: mtf.libs.mtf_pybinder.pcpp.GeneralFilter, raw_packet: mtf.libs.mtf_pybinder.pcpp.RawPacket) bool
Match a raw packet with a given BPF filter.
A pointer to the raw packet to match the BPF filter with True if a raw packet matches the BPF filter or false otherwise
- Args:
raw_packet (str)
- Returns:
bool
- parse_to_string(self: mtf.libs.mtf_pybinder.pcpp.GeneralFilter, result: str) None
A method that parses the class instance into BPF string format
An empty string that the parsing will be written into. If the string isn’t empty, its content will be overridden
- Args:
result (str)
- Returns:
void
- class mtf.libs.mtf_pybinder.pcpp.GreLayer
Abstract base class for GRE layers (GREv0Layer and GREv1Layer). Cannot be instantiated and contains common logic for derived classes
- __init__(self: mtf.libs.mtf_pybinder.pcpp.GreLayer, arg0: mtf.libs.mtf_pybinder.pcpp.GreLayer) None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.GreLayer, : mtf.libs.mtf_pybinder.pcpp.GreLayer) mtf.libs.mtf_pybinder.pcpp.GreLayer
- Returns:
pcpp.GreLayer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- static get_gre_version(gre_data: int, gre_data_len: int) int
A static method that determines the GRE version of GRE layer raw data by looking at the gre_basic_header#version field
- Args:
gre_data (bytes): GRE layer raw data gre_data_len (unsigned int): Size of raw data
- Returns:
unsigned int: ::GREv0 or ::GREv1 values if raw data is GREv0 or GREv1 (accordingly) or ::UnknownProtocol otherwise
- get_header_len(self: mtf.libs.mtf_pybinder.pcpp.GreLayer) int
Size of GRE header (may change if optional fields are added or removed)
- Returns:
unsigned int
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_osi_model_layer(self: mtf.libs.mtf_pybinder.pcpp.GreLayer) mtf.libs.mtf_pybinder.pcpp.OsiModelLayer
- Returns:
enum pcpp.OsiModelLayer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- get_sequence_number(self: mtf.libs.mtf_pybinder.pcpp.GreLayer, seq_number: int) bool
Get sequence number value if field exists in layer
- Args:
seq_number (unsigned int): The returned sequence number value if exists in layer. Else remain unchanged
- Returns:
bool: True if sequence number field exists in layer. In this case seqNumber will be filled with the value.
Or false if sequence number field doesn’t exist in layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.GreLayer) None
Currently identifies the following next layers: IPv4Layer, IPv6Layer, VlanLayer, MplsLayer, PPP_PPTPLayer, EthLayer, EthDot3Layer Otherwise sets PayloadLayer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- set_sequence_number(self: mtf.libs.mtf_pybinder.pcpp.GreLayer, seq_number: int) bool
Set sequence number value. If field already exists (gre_basic_header#sequenceNumBit is set) then only the new value is set. If field doesn’t exist it will be added to the layer, gre_basic_header#sequenceNumBit will be set and the new value will be set
- Args:
seq_number (unsigned int): The sequence number value to set
- Returns:
bool: True if managed to set the value successfully, or false otherwise (if couldn’t extend the layer)
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- unset_sequence_number(self: mtf.libs.mtf_pybinder.pcpp.GreLayer) bool
Unset sequence number and remove it from the layer
- Returns:
bool: True if managed to unset successfully or false (and error log) if sequence number wasn’t set in the first
place or if didn’t manage to remove it from the layer
- class mtf.libs.mtf_pybinder.pcpp.GtpV1Layer
A class representing the [GTP v1](https://en.wikipedia.org/wiki/GPRS_Tunnelling_Protocol) protocol.
- class GtpExtension
A class that represents [GTP header extensions](https://en.wikipedia.org/wiki/GPRS_Tunnelling_Protocol)
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.GtpV1Layer.GtpExtension) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.GtpV1Layer.GtpExtension, arg0: mtf.libs.mtf_pybinder.pcpp.GtpV1Layer.GtpExtension) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.GtpV1Layer.GtpExtension, other: mtf.libs.mtf_pybinder.pcpp.GtpV1Layer.GtpExtension) mtf.libs.mtf_pybinder.pcpp.GtpV1Layer.GtpExtension
An assignment operator for this class
- Args:
other (pcpp.GtpV1Layer.GtpExtension): The extension to assign from
- Returns:
pcpp.GtpV1Layer.GtpExtension: A reference to the assignee
- get_content(self: mtf.libs.mtf_pybinder.pcpp.GtpV1Layer.GtpExtension) int
A byte array that includes the extension’s content. The length of this array can be determined by getContentLength(). If the object is empty a null value is returned
- Returns:
bytes
- get_content_length(self: mtf.libs.mtf_pybinder.pcpp.GtpV1Layer.GtpExtension) int
The length of the extension’s content, excluding the extension length and next extension type fields. If the object is empty a value of zero is returned
- Returns:
unsigned int
- get_extension_type(self: mtf.libs.mtf_pybinder.pcpp.GtpV1Layer.GtpExtension) int
The extension type. If the object is empty a value of zero is returned
- Returns:
unsigned int
- get_next_extension(self: mtf.libs.mtf_pybinder.pcpp.GtpV1Layer.GtpExtension) mtf.libs.mtf_pybinder.pcpp.GtpV1Layer.GtpExtension
An instance of this class representing the next extension header, if exists in the message. If there are no more header extensions or if this object is empty an empty instance of GtpExtension is returned, meaning one that GtpExtension#isNull() returns “true”
- Returns:
pcpp.GtpV1Layer.GtpExtension
- get_next_extension_header_type(self: mtf.libs.mtf_pybinder.pcpp.GtpV1Layer.GtpExtension) int
The extension type of the next header. If there are no more header extensions or if this object is empty a value of zero is returned
- Returns:
unsigned int
- get_total_length(self: mtf.libs.mtf_pybinder.pcpp.GtpV1Layer.GtpExtension) int
The total length of the extension including the length and next extension type fields. If the object is empty a value of zero is returned
- Returns:
unsigned int
- is_null(self: mtf.libs.mtf_pybinder.pcpp.GtpV1Layer.GtpExtension) bool
Instances of this class may be initialized as empty, meaning they don’t contain any data. In these cases this method returns true
- Returns:
bool
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.GtpV1Layer, data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.GtpV1Layer, message_type: mtf.libs.mtf_pybinder.pcpp.GtpV1MessageType, teid: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.GtpV1Layer, message_type: mtf.libs.mtf_pybinder.pcpp.GtpV1MessageType, teid: int, set_seq_num: bool, seq_num: int, set_npdu_num: bool, npdu_num: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.GtpV1Layer, arg0: mtf.libs.mtf_pybinder.pcpp.GtpV1Layer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.GtpV1Layer, arg0: mtf.libs.mtf_pybinder.pcpp.GtpV1Layer) -> None
- __new__(**kwargs)
- add_extension(self: mtf.libs.mtf_pybinder.pcpp.GtpV1Layer, extension_type: int, extension_content: int) pcpp::GtpV1Layer::GtpExtension
Add a GTPv1 header extension. It is assumed that the extension is 4 bytes in length and its content is 2 bytes in length. If you need a different content size please reach out to me. This method takes care of extending the layer to make room for the new extension and also sets the relevant flags and fields
- Args:
extension_type (unsigned int): The type of the new extension extension_content (unsigned int): A 2-byte long content
- Returns:
pcpp.GtpV1Layer.GtpExtension: An object representing the newly added extension. If there was an error adding the extension a null object will be
returned (meaning GtpExtension#isNull() will return “true”) and a corresponding error message will be written to log
- assign(self: mtf.libs.mtf_pybinder.pcpp.GtpV1Layer, : mtf.libs.mtf_pybinder.pcpp.GtpV1Layer) mtf.libs.mtf_pybinder.pcpp.GtpV1Layer
- Returns:
pcpp.GtpV1Layer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.GtpV1Layer) None
Calculate the following fields: - gtpv1_header#messageLength
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_header(self: mtf.libs.mtf_pybinder.pcpp.GtpV1Layer) mtf.libs.mtf_pybinder.pcpp.gtpv1_header
The GTP v1 common header structure. Notice this points directly to the data, so every change will change the actual packet data
- Returns:
pcpp.gtpv1_header
- get_header_len(self: mtf.libs.mtf_pybinder.pcpp.GtpV1Layer) int
The size of the GTP header. For GTP-C packets the size is determined by the value of gtpv1_header#messageLength and for GTP-U the size only includes the GTP header itself (meaning the size of gtpv1_header plus the size of the optional fields such as sequence number, N-PDU or extensions if exist)
- Returns:
unsigned int
- get_message_type(self: mtf.libs.mtf_pybinder.pcpp.GtpV1Layer) mtf.libs.mtf_pybinder.pcpp.GtpV1MessageType
The message type of this GTP packet
- Returns:
enum pcpp.GtpV1MessageType
- get_message_type_as_string(self: mtf.libs.mtf_pybinder.pcpp.GtpV1Layer) str
A string representation of the packet’s message type
- Returns:
str
- get_next_extension(self: mtf.libs.mtf_pybinder.pcpp.GtpV1Layer) pcpp::GtpV1Layer::GtpExtension
An object that represents the next extension header, if exists in the message. If there are no extensions an empty object is returned, meaning an object which GtpExtension#isNull() returns “true”
- Returns:
pcpp.GtpV1Layer.GtpExtension
- get_next_extension_header_type(self: mtf.libs.mtf_pybinder.pcpp.GtpV1Layer, next_ext_type: int) bool
Get the type of the next header extension if exists on the message (extensions are optional in GTP messages)
- Args:
next_ext_type (unsigned int): Set with the next header extension type if exists in layer. Otherwise remains unchanged
- Returns:
bool: True if the message contains header extensions, in which case nextExtType is set to the next
header extension type. If there are no header extensions false is returned and nextExtType remains unchanged
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_npdu_number(self: mtf.libs.mtf_pybinder.pcpp.GtpV1Layer, npdu_num: int) bool
Get the N-PDU number if exists on the message (N-PDU number is an optional field in GTP messages)
- Args:
npdu_num (unsigned int): Set with the N-PDU number value if exists in the layer. Otherwise remains unchanged
- Returns:
bool: True if the N-PDU number field exists in layer, in which case npduNum is set with the value.
Or false otherwise
- get_osi_model_layer(self: mtf.libs.mtf_pybinder.pcpp.GtpV1Layer) mtf.libs.mtf_pybinder.pcpp.OsiModelLayer
- Returns:
enum pcpp.OsiModelLayer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- get_sequence_number(self: mtf.libs.mtf_pybinder.pcpp.GtpV1Layer, seq_number: int) bool
Get the sequence number if exists on the message (sequence number is an optional field in GTP messages)
- Args:
seq_number (unsigned int): Set with the sequence number value if exists in the layer. Otherwise remains unchanged
- Returns:
bool: True if the sequence number field exists in layer, in which case seqNumber is set with the value.
Or false otherwise
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- static is_gt_pv1(data: int, data_size: int) bool
A static method that takes a byte array and detects whether it is a GTP v1 message
- Args:
data (bytes): A byte array data_size (unsigned int): The byte array size (in bytes)
- Returns:
bool: True if the data is identified as GTP v1 message (GTP-C or GTP-U)
- static is_gt_pv1_port(port: int) bool
A static method that checks whether the port is considered as GTPv1
- Args:
port (unsigned int): The port number to be checked
- Returns:
bool: True if the port matches those associated with the BGP protocol
- is_gtpc_message(self: mtf.libs.mtf_pybinder.pcpp.GtpV1Layer) bool
True if this is a GTP-C message, false otherwise
- Returns:
bool
- is_gtpu_message(self: mtf.libs.mtf_pybinder.pcpp.GtpV1Layer) bool
True if this is a GTP-U message, false otherwise
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.GtpV1Layer) None
Identifies the following next layers for GTP-U packets: IPv4Layer, IPv6Layer. Otherwise sets PayloadLayer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- set_npdu_number(self: mtf.libs.mtf_pybinder.pcpp.GtpV1Layer, npdu_num: int) bool
Set an N-PDU number
- Args:
npdu_num (unsigned int): The N-PDU number to set
- Returns:
bool: True if the value was set successfully, false otherwise. In case of failure a corresponding error message will be written to log
- set_sequence_number(self: mtf.libs.mtf_pybinder.pcpp.GtpV1Layer, seq_number: int) bool
Set a sequence number
- Args:
seq_number (unsigned int): The sequence number to set
- Returns:
bool: True if the value was set successfully, false otherwise. In case of failure a corresponding error message will be written to log
- to_string(self: mtf.libs.mtf_pybinder.pcpp.GtpV1Layer) str
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.GtpV1MessageType
- An enum representing the possible GTP v1 message types.
All of the message types except for #GtpV1_GPDU are considered GTP-C messages. #GtpV1_GPDU is considered a GTP-U message
Members:
GtpV1_MessageTypeUnknown
GtpV1_EchoRequest
GtpV1_EchoResponse
GtpV1_VersionNotSupported
GtpV1_NodeAliveRequest
GtpV1_NodeAliveResponse
GtpV1_RedirectionRequest
GtpV1_CreatePDPContextRequest
GtpV1_CreatePDPContextResponse
GtpV1_UpdatePDPContextRequest
GtpV1_UpdatePDPContextResponse
GtpV1_DeletePDPContextRequest
GtpV1_DeletePDPContextResponse
GtpV1_InitiatePDPContextActivationRequest
GtpV1_InitiatePDPContextActivationResponse
GtpV1_ErrorIndication
GtpV1_PDUNotificationRequest
GtpV1_PDUNotificationResponse
GtpV1_PDUNotificationRejectRequest
GtpV1_PDUNotificationRejectResponse
GtpV1_SupportedExtensionsHeaderNotification
GtpV1_SendRoutingforGPRSRequest
GtpV1_SendRoutingforGPRSResponse
GtpV1_FailureReportRequest
GtpV1_FailureReportResponse
GtpV1_NoteMSPresentRequest
GtpV1_NoteMSPresentResponse
GtpV1_IdentificationRequest
GtpV1_IdentificationResponse
GtpV1_SGSNContextRequest
GtpV1_SGSNContextResponse
GtpV1_SGSNContextAcknowledge
GtpV1_ForwardRelocationRequest
GtpV1_ForwardRelocationResponse
GtpV1_ForwardRelocationComplete
GtpV1_RelocationCancelRequest
GtpV1_RelocationCancelResponse
GtpV1_ForwardSRNSContext
GtpV1_ForwardRelocationCompleteAcknowledge
GtpV1_ForwardSRNSContextAcknowledge
GtpV1_UERegistrationRequest
GtpV1_UERegistrationResponse
GtpV1_RANInformationRelay
GtpV1_MBMSNotificationRequest
GtpV1_MBMSNotificationResponse
GtpV1_MBMSNotificationRejectRequest
GtpV1_MBMSNotificationRejectResponse
GtpV1_CreateMBMSNotificationRequest
GtpV1_CreateMBMSNotificationResponse
GtpV1_UpdateMBMSNotificationRequest
GtpV1_UpdateMBMSNotificationResponse
GtpV1_DeleteMBMSNotificationRequest
GtpV1_DeleteMBMSNotificationResponse
GtpV1_MBMSRegistrationRequest
GtpV1_MBMSRegistrationResponse
GtpV1_MBMSDeRegistrationRequest
GtpV1_MBMSDeRegistrationResponse
GtpV1_MBMSSessionStartRequest
GtpV1_MBMSSessionStartResponse
GtpV1_MBMSSessionStopRequest
GtpV1_MBMSSessionStopResponse
GtpV1_MBMSSessionUpdateRequest
GtpV1_MBMSSessionUpdateResponse
GtpV1_MSInfoChangeRequest
GtpV1_MSInfoChangeResponse
GtpV1_DataRecordTransferRequest
GtpV1_DataRecordTransferResponse
GtpV1_EndMarker
GtpV1_GPDU
- GtpV1_CreateMBMSNotificationRequest
- GtpV1_CreateMBMSNotificationResponse
- GtpV1_CreatePDPContextRequest
- GtpV1_CreatePDPContextResponse
- GtpV1_DataRecordTransferRequest
- GtpV1_DataRecordTransferResponse
- GtpV1_DeleteMBMSNotificationRequest
- GtpV1_DeleteMBMSNotificationResponse
- GtpV1_DeletePDPContextRequest
- GtpV1_DeletePDPContextResponse
- GtpV1_EchoRequest
- GtpV1_EchoResponse
- GtpV1_EndMarker
- GtpV1_ErrorIndication
- GtpV1_FailureReportRequest
- GtpV1_FailureReportResponse
- GtpV1_ForwardRelocationComplete
- GtpV1_ForwardRelocationCompleteAcknowledge
- GtpV1_ForwardRelocationRequest
- GtpV1_ForwardRelocationResponse
- GtpV1_ForwardSRNSContext
- GtpV1_ForwardSRNSContextAcknowledge
- GtpV1_GPDU
- GtpV1_IdentificationRequest
- GtpV1_IdentificationResponse
- GtpV1_InitiatePDPContextActivationRequest
- GtpV1_InitiatePDPContextActivationResponse
- GtpV1_MBMSDeRegistrationRequest
- GtpV1_MBMSDeRegistrationResponse
- GtpV1_MBMSNotificationRejectRequest
- GtpV1_MBMSNotificationRejectResponse
- GtpV1_MBMSNotificationRequest
- GtpV1_MBMSNotificationResponse
- GtpV1_MBMSRegistrationRequest
- GtpV1_MBMSRegistrationResponse
- GtpV1_MBMSSessionStartRequest
- GtpV1_MBMSSessionStartResponse
- GtpV1_MBMSSessionStopRequest
- GtpV1_MBMSSessionStopResponse
- GtpV1_MBMSSessionUpdateRequest
- GtpV1_MBMSSessionUpdateResponse
- GtpV1_MSInfoChangeRequest
- GtpV1_MSInfoChangeResponse
- GtpV1_MessageTypeUnknown
- GtpV1_NodeAliveRequest
- GtpV1_NodeAliveResponse
- GtpV1_NoteMSPresentRequest
- GtpV1_NoteMSPresentResponse
- GtpV1_PDUNotificationRejectRequest
- GtpV1_PDUNotificationRejectResponse
- GtpV1_PDUNotificationRequest
- GtpV1_PDUNotificationResponse
- GtpV1_RANInformationRelay
- GtpV1_RedirectionRequest
- GtpV1_RelocationCancelRequest
- GtpV1_RelocationCancelResponse
- GtpV1_SGSNContextAcknowledge
- GtpV1_SGSNContextRequest
- GtpV1_SGSNContextResponse
- GtpV1_SendRoutingforGPRSRequest
- GtpV1_SendRoutingforGPRSResponse
- GtpV1_SupportedExtensionsHeaderNotification
- GtpV1_UERegistrationRequest
- GtpV1_UERegistrationResponse
- GtpV1_UpdateMBMSNotificationRequest
- GtpV1_UpdateMBMSNotificationResponse
- GtpV1_UpdatePDPContextRequest
- GtpV1_UpdatePDPContextResponse
- GtpV1_VersionNotSupported
- __init__(self: mtf.libs.mtf_pybinder.pcpp.GtpV1MessageType, value: int) None
- __new__(**kwargs)
- property name
- property value
- class mtf.libs.mtf_pybinder.pcpp.HeaderField
A wrapper class for each text-based-protocol header field, e.g “Host”, “Cookie”, “Content-Length”, “Via”, “Call-ID”, etc. Each field contains a name (e.g “Host”) and a value (e.g “www.wikipedia.org”). The user can get and set both of them through dedicated methods. The separator between header fields is either CRLF (“”) or LF (“”) in more rare cases, which means every HeaderField instance is responsible for wrapping and parsing a header field from the previous CRLF (not inclusive) until the next CRLF/LF (inclusive) A special case is with the end of a header, meaning 2 consecutive CRLFs (“”) or consecutive LFs (“”). PcapPlusPlus treats the first CRLF/LF as part of the last field in the header, and the second CRLF is an HeaderField instance of its own which name and values are an empty string (“”) or pcpp::PCPP_END_OF_TEXT_BASED_PROTOCOL_HEADER
- __init__(self: mtf.libs.mtf_pybinder.pcpp.HeaderField, arg0: mtf.libs.mtf_pybinder.pcpp.HeaderField) None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.HeaderField, other: mtf.libs.mtf_pybinder.pcpp.HeaderField) mtf.libs.mtf_pybinder.pcpp.HeaderField
Assignment operator for this class. This method copies the data from the other instance and will not share any resources with it. Also, if the instance already contains data it will be deleted or zeroed
- Args:
other (pcpp.HeaderField): The instance to assign from
- Returns:
pcpp.HeaderField: A reference to the assignee
- property field_name
The field name as string. Notice the return data is copied data, so changing it won’t change the packet data
- Returns:
str
- property field_size
The field length in bytes, meaning count of all characters from the previous CRLF (not inclusive) until the next CRLF (inclusive) For example: the field “Host: www.wikipedia.org” will have the length of 25
- Returns:
unsigned int
- property field_value
The field value as string. Notice the return data is copied data, so changing it won’t change the packet data
- Returns:
str
- is_end_of_header(self: mtf.libs.mtf_pybinder.pcpp.HeaderField) bool
Get an indication whether the field is a field that ends the header (meaning contain only CRLF - see class explanation)
- Returns:
bool: True if this is a end-of-header field, false otherwise
- set_field_value(self: mtf.libs.mtf_pybinder.pcpp.HeaderField, new_value: str) bool
A setter for field value
- Args:
new_value (str): The new value to set to the field. Old value will be deleted
- Returns:
bool: True if setting the value was completed successfully, false otherwise
- class mtf.libs.mtf_pybinder.pcpp.HttpMessage
Represents a general HTTP message. It’s an abstract class and cannot be instantiated. It’s inherited by HttpRequestLayer and HttpResponseLayer
- __init__(*args, **kwargs)
- __new__(**kwargs)
- add_end_of_header(self: mtf.libs.mtf_pybinder.pcpp.TextBasedProtocolMessage) mtf.libs.mtf_pybinder.pcpp.HeaderField
Add the special end-of-header field (see the explanation in HeaderField) A pointer to the newly created header field, or NULL if the field could not be created
- Returns:
pcpp.HeaderField
- add_field(*args, **kwargs)
Overloaded function.
add_field(self: mtf.libs.mtf_pybinder.pcpp.HttpMessage, field_name: str, field_value: str) -> mtf.libs.mtf_pybinder.pcpp.HeaderField
- Args:
field_name (str) field_value (str)
- Returns:
pcpp.HeaderField
add_field(self: mtf.libs.mtf_pybinder.pcpp.HttpMessage, new_field: mtf.libs.mtf_pybinder.pcpp.HeaderField) -> mtf.libs.mtf_pybinder.pcpp.HeaderField
- Args:
new_field (pcpp.HeaderField)
- Returns:
pcpp.HeaderField
- assign(self: mtf.libs.mtf_pybinder.pcpp.IDataContainer, : mtf.libs.mtf_pybinder.pcpp.IDataContainer) mtf.libs.mtf_pybinder.pcpp.IDataContainer
- Returns:
pcpp.IDataContainer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.TextBasedProtocolMessage) None
Does nothing for this class
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- property field_count
The number of header fields currently in the layer (not including CRLF at the end of the header)
- Returns:
int
- get_field_by_name(*args, **kwargs)
Overloaded function.
get_field_by_name(self: mtf.libs.mtf_pybinder.pcpp.TextBasedProtocolMessage, field_name: str) -> mtf.libs.mtf_pybinder.pcpp.HeaderField
- Args:
field_name (str)
- Returns:
pcpp.HeaderField
get_field_by_name(self: mtf.libs.mtf_pybinder.pcpp.TextBasedProtocolMessage, field_name: str, index: int = 0) -> mtf.libs.mtf_pybinder.pcpp.HeaderField
Get a pointer to a header field by name. The search is case insensitive, meaning if a field with name Host exists and the fieldName parameter is host (all letter are lower case), this method will return a pointer to Host field
- Args:
field_name (str): The field name index (int): Optional parameter. If the field name appears more than once, this parameter will indicate which field to get.
The default value is 0 (get the first appearance of the field name as appears on the packet)
- Returns:
pcpp.HeaderField: A pointer to an HeaderField instance, or NULL if field doesn’t exist
- get_first_field(self: mtf.libs.mtf_pybinder.pcpp.TextBasedProtocolMessage) mtf.libs.mtf_pybinder.pcpp.HeaderField
A pointer to the first header field exists in this message, or NULL if no such field exists
- Returns:
pcpp.HeaderField
- get_header_len(self: mtf.libs.mtf_pybinder.pcpp.TextBasedProtocolMessage) int
The message length
- Returns:
unsigned int
- get_next_field(self: mtf.libs.mtf_pybinder.pcpp.TextBasedProtocolMessage, prev_field: mtf.libs.mtf_pybinder.pcpp.HeaderField) mtf.libs.mtf_pybinder.pcpp.HeaderField
Get the field which appears after a certain field
- Args:
prev_field (pcpp.HeaderField): A pointer to the field
- Returns:
pcpp.HeaderField: The field after prevField or NULL if prevField is the last field. If prevField is NULL, this method will return NULL
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_osi_model_layer(self: mtf.libs.mtf_pybinder.pcpp.HttpMessage) mtf.libs.mtf_pybinder.pcpp.OsiModelLayer
- Returns:
enum pcpp.OsiModelLayer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- insert_field(*args, **kwargs)
Overloaded function.
insert_field(self: mtf.libs.mtf_pybinder.pcpp.HttpMessage, prev_field: mtf.libs.mtf_pybinder.pcpp.HeaderField, field_name: str, field_value: str) -> mtf.libs.mtf_pybinder.pcpp.HeaderField
- Args:
prev_field (pcpp.HeaderField) field_name (str) field_value (str)
- Returns:
pcpp.HeaderField
insert_field(self: mtf.libs.mtf_pybinder.pcpp.HttpMessage, prev_field: mtf.libs.mtf_pybinder.pcpp.HeaderField, new_field: mtf.libs.mtf_pybinder.pcpp.HeaderField) -> mtf.libs.mtf_pybinder.pcpp.HeaderField
- Args:
prev_field (pcpp.HeaderField) new_field (pcpp.HeaderField)
- Returns:
pcpp.HeaderField
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- is_header_complete(self: mtf.libs.mtf_pybinder.pcpp.TextBasedProtocolMessage) bool
Indicate whether the header is complete (ending with end-of-header “” or “”) or spread over more packets
- Returns:
bool: True if the header is complete or false if not
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.TextBasedProtocolMessage) None
Currently set only PayloadLayer for the rest of the data
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- remove_field(*args, **kwargs)
Overloaded function.
remove_field(self: mtf.libs.mtf_pybinder.pcpp.TextBasedProtocolMessage, field_to_remove: mtf.libs.mtf_pybinder.pcpp.HeaderField) -> bool
Remove a field from the message
- Args:
field_to_remove (pcpp.HeaderField): A pointer to the field that should be removed
- Returns:
bool: True if the field was removed successfully, or false otherwise (for example: if fieldToRemove is NULL, if it doesn’t exist in the message, or if the removal failed)
remove_field(self: mtf.libs.mtf_pybinder.pcpp.TextBasedProtocolMessage, field_name: str) -> bool
- Args:
field_name (str)
- Returns:
bool
remove_field(self: mtf.libs.mtf_pybinder.pcpp.TextBasedProtocolMessage, field_name: str, index: int) -> bool
Remove a field from the message
- Args:
field_name (str): The name of the field that should be removed index (int): Optional parameter. If the field name appears more than once, this parameter will indicate which field to remove.
The default value is 0 (remove the first appearance of the field name as appears on the packet)
- Returns:
bool: True if the field was removed successfully, or false otherwise (for example: if fieldName doesn’t exist in the message, or if the removal failed)
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.HttpRequestFirstLine
Represents an HTTP request header first line. The first line includes 3 parameters: HTTP method (e.g GET, POST, etc.), URI (e.g /main/index.html) and HTTP version (e.g HTTP/1.1). All these parameters are included in this class, and the user can retrieve or set them. This class cannot be instantiated by users, it’s created inside HttpRequestLayer and user can get a pointer to an instance of it. All “get” methods of this class will retrieve the actual data of the HTTP request and the “set” methods will change the packet data. Since HTTP is a textual protocol, most fields aren’t of fixed size and this also applies to the first line parameters. So most “set” methods of this class need in most cases to shorten or extend the data in HttpRequestLayer. These methods will return a false value if this action failed
- __init__(self: mtf.libs.mtf_pybinder.pcpp.HttpRequestFirstLine, arg0: mtf.libs.mtf_pybinder.pcpp.HttpRequestFirstLine) None
- __new__(**kwargs)
- property is_complete
As explained in HttpRequestLayer, an HTTP header can spread over more than 1 packet, so when looking at a single packet the header can be partial. Same goes for the first line - it can spread over more than 1 packet. This method returns an indication whether the first line is partial
- Returns:
bool: False if the first line is partial, true if it’s complete
- property method
The HTTP method pcpp.HttpRequestFirstLine.setMethod(enum pcpp.HttpRequestLayer.HttpMethod) –> bool
- Returns:
enum pcpp.HttpRequestLayer.HttpMethod
- static parse_method(data: str, data_len: int) mtf.libs.mtf_pybinder.pcpp.HttpRequestLayer.HttpMethod
A static method for parsing the HTTP method out of raw data
- Args:
data (str): The raw data data_len (unsigned int): The raw data length
- Returns:
enum pcpp.HttpRequestLayer.HttpMethod: The parsed HTTP method
- property size
The size in bytes of the HTTP first line
- Returns:
int
- property uri
A copied version of the URI (notice changing the return value won’t change the actual data of the packet)
- Returns:
str
- property version
The HTTP version pcpp.HttpRequestFirstLine.setVersion(enum pcpp.HttpVersion) –> void
- Returns:
enum pcpp.HttpVersion
- class mtf.libs.mtf_pybinder.pcpp.HttpRequestLayer
Represents an HTTP request header and inherits all basic functionality of HttpMessage and TextBasedProtocolMessage. The functionality that is added for this class is the HTTP first line concept. An HTTP request has the following first line: GET /bla/blabla.asp HTTP/1.1 Since it’s not an “ordinary” HTTP field, it requires a special treatment and gets a class of it’s own: HttpRequestFirstLine. Unlike most L2-4 protocols, an HTTP request header can spread over more than 1 packet. PcapPlusPlus currently doesn’t support a header that is spread over more than 1 packet so in such cases: 1) only the first packet will be parsed as HttpRequestLayer (the other packets won’t be recognized as HttpRequestLayer) and 2) the HTTP header for the first packet won’t be complete (as it continues in the following packets), this why PcapPlusPlus can indicate that HTTP request header is complete or not(doesn’t end with “” or “”) using HttpMessage#isHeaderComplete()
- HttpCONNECT
- HttpDELETE
- HttpGET
- HttpHEAD
- class HttpMethod
HTTP request methods
Members:
HttpGET
HttpHEAD
HttpPOST
HttpPUT
HttpDELETE
HttpTRACE
HttpOPTIONS
HttpCONNECT
HttpPATCH
HttpMethodUnknown
- HttpCONNECT
- HttpDELETE
- HttpGET
- HttpHEAD
- HttpMethodUnknown
- HttpOPTIONS
- HttpPATCH
- HttpPOST
- HttpPUT
- HttpTRACE
- __init__(self: mtf.libs.mtf_pybinder.pcpp.HttpRequestLayer.HttpMethod, value: int) None
- __new__(**kwargs)
- property name
- property value
- HttpMethodUnknown
- HttpOPTIONS
- HttpPATCH
- HttpPOST
- HttpPUT
- HttpTRACE
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.HttpRequestLayer, method: pcpp::HttpRequestLayer::HttpMethod, uri: str, version: mtf.libs.mtf_pybinder.pcpp.HttpVersion) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.HttpRequestLayer, arg0: mtf.libs.mtf_pybinder.pcpp.HttpRequestLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.HttpRequestLayer, arg0: mtf.libs.mtf_pybinder.pcpp.HttpRequestLayer) -> None
- __new__(**kwargs)
- add_end_of_header(self: mtf.libs.mtf_pybinder.pcpp.TextBasedProtocolMessage) mtf.libs.mtf_pybinder.pcpp.HeaderField
Add the special end-of-header field (see the explanation in HeaderField) A pointer to the newly created header field, or NULL if the field could not be created
- Returns:
pcpp.HeaderField
- add_field(*args, **kwargs)
Overloaded function.
add_field(self: mtf.libs.mtf_pybinder.pcpp.HttpMessage, field_name: str, field_value: str) -> mtf.libs.mtf_pybinder.pcpp.HeaderField
- Args:
field_name (str) field_value (str)
- Returns:
pcpp.HeaderField
add_field(self: mtf.libs.mtf_pybinder.pcpp.HttpMessage, new_field: mtf.libs.mtf_pybinder.pcpp.HeaderField) -> mtf.libs.mtf_pybinder.pcpp.HeaderField
- Args:
new_field (pcpp.HeaderField)
- Returns:
pcpp.HeaderField
- assign(self: mtf.libs.mtf_pybinder.pcpp.HttpRequestLayer, other: mtf.libs.mtf_pybinder.pcpp.HttpRequestLayer) mtf.libs.mtf_pybinder.pcpp.HttpRequestLayer
An assignment operator overload for this layer. This method inherits base assignment operator HttpMessage#operator=() and add the functionality of copying the first line as well
- Args:
other (pcpp.HttpRequestLayer): The instance to copy from
- Returns:
pcpp.HttpRequestLayer: A reference to the assignee
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.TextBasedProtocolMessage) None
Does nothing for this class
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- property field_count
The number of header fields currently in the layer (not including CRLF at the end of the header)
- Returns:
int
- property first_line
A pointer to the first line instance for this message
- Returns:
pcpp.HttpRequestFirstLine
- get_field_by_name(*args, **kwargs)
Overloaded function.
get_field_by_name(self: mtf.libs.mtf_pybinder.pcpp.TextBasedProtocolMessage, field_name: str) -> mtf.libs.mtf_pybinder.pcpp.HeaderField
- Args:
field_name (str)
- Returns:
pcpp.HeaderField
get_field_by_name(self: mtf.libs.mtf_pybinder.pcpp.TextBasedProtocolMessage, field_name: str, index: int = 0) -> mtf.libs.mtf_pybinder.pcpp.HeaderField
Get a pointer to a header field by name. The search is case insensitive, meaning if a field with name Host exists and the fieldName parameter is host (all letter are lower case), this method will return a pointer to Host field
- Args:
field_name (str): The field name index (int): Optional parameter. If the field name appears more than once, this parameter will indicate which field to get.
The default value is 0 (get the first appearance of the field name as appears on the packet)
- Returns:
pcpp.HeaderField: A pointer to an HeaderField instance, or NULL if field doesn’t exist
- get_first_field(self: mtf.libs.mtf_pybinder.pcpp.TextBasedProtocolMessage) mtf.libs.mtf_pybinder.pcpp.HeaderField
A pointer to the first header field exists in this message, or NULL if no such field exists
- Returns:
pcpp.HeaderField
- get_header_len(self: mtf.libs.mtf_pybinder.pcpp.TextBasedProtocolMessage) int
The message length
- Returns:
unsigned int
- get_next_field(self: mtf.libs.mtf_pybinder.pcpp.TextBasedProtocolMessage, prev_field: mtf.libs.mtf_pybinder.pcpp.HeaderField) mtf.libs.mtf_pybinder.pcpp.HeaderField
Get the field which appears after a certain field
- Args:
prev_field (pcpp.HeaderField): A pointer to the field
- Returns:
pcpp.HeaderField: The field after prevField or NULL if prevField is the last field. If prevField is NULL, this method will return NULL
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_osi_model_layer(self: mtf.libs.mtf_pybinder.pcpp.HttpMessage) mtf.libs.mtf_pybinder.pcpp.OsiModelLayer
- Returns:
enum pcpp.OsiModelLayer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- insert_field(*args, **kwargs)
Overloaded function.
insert_field(self: mtf.libs.mtf_pybinder.pcpp.HttpMessage, prev_field: mtf.libs.mtf_pybinder.pcpp.HeaderField, field_name: str, field_value: str) -> mtf.libs.mtf_pybinder.pcpp.HeaderField
- Args:
prev_field (pcpp.HeaderField) field_name (str) field_value (str)
- Returns:
pcpp.HeaderField
insert_field(self: mtf.libs.mtf_pybinder.pcpp.HttpMessage, prev_field: mtf.libs.mtf_pybinder.pcpp.HeaderField, new_field: mtf.libs.mtf_pybinder.pcpp.HeaderField) -> mtf.libs.mtf_pybinder.pcpp.HeaderField
- Args:
prev_field (pcpp.HeaderField) new_field (pcpp.HeaderField)
- Returns:
pcpp.HeaderField
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- is_header_complete(self: mtf.libs.mtf_pybinder.pcpp.TextBasedProtocolMessage) bool
Indicate whether the header is complete (ending with end-of-header “” or “”) or spread over more packets
- Returns:
bool: True if the header is complete or false if not
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.TextBasedProtocolMessage) None
Currently set only PayloadLayer for the rest of the data
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- remove_field(*args, **kwargs)
Overloaded function.
remove_field(self: mtf.libs.mtf_pybinder.pcpp.TextBasedProtocolMessage, field_to_remove: mtf.libs.mtf_pybinder.pcpp.HeaderField) -> bool
Remove a field from the message
- Args:
field_to_remove (pcpp.HeaderField): A pointer to the field that should be removed
- Returns:
bool: True if the field was removed successfully, or false otherwise (for example: if fieldToRemove is NULL, if it doesn’t exist in the message, or if the removal failed)
remove_field(self: mtf.libs.mtf_pybinder.pcpp.TextBasedProtocolMessage, field_name: str) -> bool
- Args:
field_name (str)
- Returns:
bool
remove_field(self: mtf.libs.mtf_pybinder.pcpp.TextBasedProtocolMessage, field_name: str, index: int) -> bool
Remove a field from the message
- Args:
field_name (str): The name of the field that should be removed index (int): Optional parameter. If the field name appears more than once, this parameter will indicate which field to remove.
The default value is 0 (remove the first appearance of the field name as appears on the packet)
- Returns:
bool: True if the field was removed successfully, or false otherwise (for example: if fieldName doesn’t exist in the message, or if the removal failed)
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- property url
The URL is hostname+uri. So given the following URL, for example: “www.cnn.com/main.html”, the hostname is “www.cnn.com” and the URI is “/.main.html”. URI and hostname are split to 2 different places inside the HTTP request packet: URI is in the first line and hostname is in “HOST” field. This methods concatenates the hostname and URI to the full URL
- Returns:
str: The URL of the HTTP request message
- class mtf.libs.mtf_pybinder.pcpp.HttpResponseFirstLine
Represents an HTTP response header first line. The first line includes 2 parameters: status code (e.g 200 OK, 404 Not Found, etc.), and HTTP version (e.g HTTP/1.1). These 2 parameters are included in this class, and the user can retrieve or set them. This class cannot be instantiated by users, it’s created inside HttpResponseLayer and user can get a pointer to an instance of it. The “get” methods of this class will retrieve the actual data of the HTTP response and the “set” methods will change the packet data. Since HTTP is a textual protocol, most fields aren’t of fixed size and this also applies to the first line parameters. So most “set” methods of this class need in most cases to shorten or extend the data in HttpResponseLayer. These methods will return a false value if this action failed
- __init__(self: mtf.libs.mtf_pybinder.pcpp.HttpResponseFirstLine, arg0: mtf.libs.mtf_pybinder.pcpp.HttpResponseFirstLine) None
- __new__(**kwargs)
- get_status_code_as_int(self: mtf.libs.mtf_pybinder.pcpp.HttpResponseFirstLine) int
The status code number as integer (e.g 200, 404, etc.)
- Returns:
int
- get_status_code_string(self: mtf.libs.mtf_pybinder.pcpp.HttpResponseFirstLine) str
The status code message (e.g “OK”, “Not Found”, etc.)
- Returns:
str
- property is_complete
As explained in HttpResponseLayer, an HTTP header can spread over more than 1 packet, so when looking at a single packet the header can be partial. Same goes for the first line - it can spread over more than 1 packet. This method returns an indication whether the first line is partial
- Returns:
bool: False if the first line is partial, true if it’s complete
- static parse_status_code(data: str, data_len: int) mtf.libs.mtf_pybinder.pcpp.HttpResponseStatusCode
A static method for parsing the HTTP status code out of raw data
- Args:
data (str): The raw data data_len (unsigned int): The raw data length
- Returns:
pcpp.HttpResponseStatusCode: The parsed HTTP status code as enum
- static parse_version(data: str, data_len: int) mtf.libs.mtf_pybinder.pcpp.HttpVersion
A static method for parsing the HTTP version out of raw first line data (e.g “HTTP/x.y”) The raw data The raw data length The parsed HTTP status code as enum
- Args:
data (str): The raw data data_len (unsigned int): The raw data length
- Returns:
enum pcpp.HttpVersion: The parsed HTTP status code as enum
- property size
The size in bytes of the HTTP first line
- Returns:
int
- property status_code
The status code as HttpResponseStatusCode enum
- Returns:
pcpp.HttpResponseStatusCode
- property version
The HTTP version
- Returns:
enum pcpp.HttpVersion
- class mtf.libs.mtf_pybinder.pcpp.HttpResponseLayer
Represents an HTTP response header and inherits all basic functionality of HttpMessage and TextBasedProtocolMessage. The functionality that is added for this class is the HTTP first line concept. An HTTP response has the following first line: 200 OK HTTP/1.1 Since it’s not an “ordinary” HTTP field, it requires a special treatment and gets a class of it’s own: HttpResponseFirstLine. Unlike most L2-4 protocols, an HTTP response header can spread over more than 1 packet. PcapPlusPlus currently doesn’t support a header that is spread over more than 1 packet so in such cases: 1) only the first packet will be parsed as HttpResponseLayer (the other packets won’t be recognized as HttpResponseLayer) and 2) the HTTP header for the first packet won’t be complete (as it continues in the following packets), this why PcapPlusPlus can indicate that HTTP response header is complete or not (doesn’t end with “” or “”) using HttpMessage#isHeaderComplete()
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.HttpResponseLayer, version: mtf.libs.mtf_pybinder.pcpp.HttpVersion, status_code: mtf.libs.mtf_pybinder.pcpp.HttpResponseStatusCode, status_code_string: str) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.HttpResponseLayer, version: mtf.libs.mtf_pybinder.pcpp.HttpVersion, status_code: mtf.libs.mtf_pybinder.pcpp.HttpResponseStatusCode) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.HttpResponseLayer, arg0: mtf.libs.mtf_pybinder.pcpp.HttpResponseLayer) -> None
- __new__(**kwargs)
- add_end_of_header(self: mtf.libs.mtf_pybinder.pcpp.TextBasedProtocolMessage) mtf.libs.mtf_pybinder.pcpp.HeaderField
Add the special end-of-header field (see the explanation in HeaderField) A pointer to the newly created header field, or NULL if the field could not be created
- Returns:
pcpp.HeaderField
- add_field(*args, **kwargs)
Overloaded function.
add_field(self: mtf.libs.mtf_pybinder.pcpp.HttpMessage, field_name: str, field_value: str) -> mtf.libs.mtf_pybinder.pcpp.HeaderField
- Args:
field_name (str) field_value (str)
- Returns:
pcpp.HeaderField
add_field(self: mtf.libs.mtf_pybinder.pcpp.HttpMessage, new_field: mtf.libs.mtf_pybinder.pcpp.HeaderField) -> mtf.libs.mtf_pybinder.pcpp.HeaderField
- Args:
new_field (pcpp.HeaderField)
- Returns:
pcpp.HeaderField
- assign(self: mtf.libs.mtf_pybinder.pcpp.HttpResponseLayer, other: mtf.libs.mtf_pybinder.pcpp.HttpResponseLayer) mtf.libs.mtf_pybinder.pcpp.HttpResponseLayer
An assignment operator overload for this layer. This method inherits base assignment operator HttpMessage#operator=() and adds the functionality of copying the first line as well
- Args:
other (pcpp.HttpResponseLayer): The instance to copy from
- Returns:
pcpp.HttpResponseLayer: A reference to the assignee
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.TextBasedProtocolMessage) None
Does nothing for this class
- property content_length
HTTP response body length determined by “Content-Length” field
- Returns:
int
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- property field_count
The number of header fields currently in the layer (not including CRLF at the end of the header)
- Returns:
int
- property first_line
A pointer to the first line instance for this message
- Returns:
pcpp.HttpResponseFirstLine
- get_field_by_name(*args, **kwargs)
Overloaded function.
get_field_by_name(self: mtf.libs.mtf_pybinder.pcpp.TextBasedProtocolMessage, field_name: str) -> mtf.libs.mtf_pybinder.pcpp.HeaderField
- Args:
field_name (str)
- Returns:
pcpp.HeaderField
get_field_by_name(self: mtf.libs.mtf_pybinder.pcpp.TextBasedProtocolMessage, field_name: str, index: int = 0) -> mtf.libs.mtf_pybinder.pcpp.HeaderField
Get a pointer to a header field by name. The search is case insensitive, meaning if a field with name Host exists and the fieldName parameter is host (all letter are lower case), this method will return a pointer to Host field
- Args:
field_name (str): The field name index (int): Optional parameter. If the field name appears more than once, this parameter will indicate which field to get.
The default value is 0 (get the first appearance of the field name as appears on the packet)
- Returns:
pcpp.HeaderField: A pointer to an HeaderField instance, or NULL if field doesn’t exist
- get_first_field(self: mtf.libs.mtf_pybinder.pcpp.TextBasedProtocolMessage) mtf.libs.mtf_pybinder.pcpp.HeaderField
A pointer to the first header field exists in this message, or NULL if no such field exists
- Returns:
pcpp.HeaderField
- get_header_len(self: mtf.libs.mtf_pybinder.pcpp.TextBasedProtocolMessage) int
The message length
- Returns:
unsigned int
- get_next_field(self: mtf.libs.mtf_pybinder.pcpp.TextBasedProtocolMessage, prev_field: mtf.libs.mtf_pybinder.pcpp.HeaderField) mtf.libs.mtf_pybinder.pcpp.HeaderField
Get the field which appears after a certain field
- Args:
prev_field (pcpp.HeaderField): A pointer to the field
- Returns:
pcpp.HeaderField: The field after prevField or NULL if prevField is the last field. If prevField is NULL, this method will return NULL
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_osi_model_layer(self: mtf.libs.mtf_pybinder.pcpp.HttpMessage) mtf.libs.mtf_pybinder.pcpp.OsiModelLayer
- Returns:
enum pcpp.OsiModelLayer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- insert_field(*args, **kwargs)
Overloaded function.
insert_field(self: mtf.libs.mtf_pybinder.pcpp.HttpMessage, prev_field: mtf.libs.mtf_pybinder.pcpp.HeaderField, field_name: str, field_value: str) -> mtf.libs.mtf_pybinder.pcpp.HeaderField
- Args:
prev_field (pcpp.HeaderField) field_name (str) field_value (str)
- Returns:
pcpp.HeaderField
insert_field(self: mtf.libs.mtf_pybinder.pcpp.HttpMessage, prev_field: mtf.libs.mtf_pybinder.pcpp.HeaderField, new_field: mtf.libs.mtf_pybinder.pcpp.HeaderField) -> mtf.libs.mtf_pybinder.pcpp.HeaderField
- Args:
prev_field (pcpp.HeaderField) new_field (pcpp.HeaderField)
- Returns:
pcpp.HeaderField
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- is_header_complete(self: mtf.libs.mtf_pybinder.pcpp.TextBasedProtocolMessage) bool
Indicate whether the header is complete (ending with end-of-header “” or “”) or spread over more packets
- Returns:
bool: True if the header is complete or false if not
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.TextBasedProtocolMessage) None
Currently set only PayloadLayer for the rest of the data
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- remove_field(*args, **kwargs)
Overloaded function.
remove_field(self: mtf.libs.mtf_pybinder.pcpp.TextBasedProtocolMessage, field_to_remove: mtf.libs.mtf_pybinder.pcpp.HeaderField) -> bool
Remove a field from the message
- Args:
field_to_remove (pcpp.HeaderField): A pointer to the field that should be removed
- Returns:
bool: True if the field was removed successfully, or false otherwise (for example: if fieldToRemove is NULL, if it doesn’t exist in the message, or if the removal failed)
remove_field(self: mtf.libs.mtf_pybinder.pcpp.TextBasedProtocolMessage, field_name: str) -> bool
- Args:
field_name (str)
- Returns:
bool
remove_field(self: mtf.libs.mtf_pybinder.pcpp.TextBasedProtocolMessage, field_name: str, index: int) -> bool
Remove a field from the message
- Args:
field_name (str): The name of the field that should be removed index (int): Optional parameter. If the field name appears more than once, this parameter will indicate which field to remove.
The default value is 0 (remove the first appearance of the field name as appears on the packet)
- Returns:
bool: True if the field was removed successfully, or false otherwise (for example: if fieldName doesn’t exist in the message, or if the removal failed)
- set_content_length(self: mtf.libs.mtf_pybinder.pcpp.HttpResponseLayer, content_length: int, prev_field_name: str = '') mtf.libs.mtf_pybinder.pcpp.HeaderField
The length of the body of many HTTP response messages is determined by a HTTP header field called Content-Length. This method sets The content-length field value. The method supports several cases: - If the Content-Length field exists - the method will only replace the existing value with the new value - If the Content-Length field doesn’t exist - the method will create this field and put the value in it. Here are also 2 cases: - If prevFieldName is specified - the new Content-Length field will be created after it - If prevFieldName isn’t specified or doesn’t exist - the new Content-Length field will be created as the last field before end-of-header field
- Args:
content_length (int): The content length value to set prev_field_name (str): Optional field, if specified and “Content-Length” field doesn’t exist, it will be created after it
- Returns:
pcpp.HeaderField: A pointer to the “Content-Length” field, or NULL if creation failed for some reason
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.HttpResponseStatusCode
The enum wrapper class of HTTP response status codes
- Http100Continue
- Http101SwitchingProtocols
- Http102Processing
- Http103EarlyHints
- Http200OK
- Http201Created
- Http202Accepted
- Http203NonAuthoritativeInformation
- Http204NoContent
- Http205ResetContent
- Http206PartialContent
- Http207MultiStatus
- Http208AlreadyReported
- Http226IMUsed
- Http300MultipleChoices
- Http301MovedPermanently
- Http302
- Http303SeeOther
- Http304NotModified
- Http305UseProxy
- Http306SwitchProxy
- Http307TemporaryRedirect
- Http308PermanentRedirect
- Http400BadRequest
- Http401Unauthorized
- Http402PaymentRequired
- Http403Forbidden
- Http404NotFound
- Http405MethodNotAllowed
- Http406NotAcceptable
- Http407ProxyAuthenticationRequired
- Http408RequestTimeout
- Http409Conflict
- Http410Gone
- Http411LengthRequired
- Http412PreconditionFailed
- Http413RequestEntityTooLarge
- Http414RequestURITooLong
- Http415UnsupportedMediaType
- Http416RequestedRangeNotSatisfiable
- Http417ExpectationFailed
- Http418ImATeapot
- Http419AuthenticationTimeout
- Http420
- Http421MisdirectedRequest
- Http422UnprocessableEntity
- Http423Locked
- Http424FailedDependency
- Http425TooEarly
- Http426UpgradeRequired
- Http428PreconditionRequired
- Http429TooManyRequests
- Http431RequestHeaderFieldsTooLarge
- Http440LoginTimeout
- Http444NoResponse
- Http449RetryWith
- Http450BlockedByWindowsParentalControls
- Http451
- Http494RequestHeaderTooLarge
- Http495CertError
- Http496NoCert
- Http497HTTPtoHTTPS
- Http498TokenExpiredInvalid
- Http499
- Http500InternalServerError
- Http501NotImplemented
- Http502BadGateway
- Http504GatewayTimeout
- Http505HTTPVersionNotSupported
- Http506VariantAlsoNegotiates
- Http507InsufficientStorage
- Http508LoopDetected
- Http509BandwidthLimitExceeded
- Http510NotExtended
- Http511NetworkAuthenticationRequired
- Http520OriginError
- Http521WebServerIsDown
- Http522ConnectionTimedOut
- Http523ProxyDeclinedRequest
- Http524aTimeoutOccurred
- Http598NetworkReadTimeoutError
- Http599NetworkConnectTimeoutError
- HttpStatus1xxCodeUnknown
- HttpStatus2xxCodeUnknown
- HttpStatus3xxCodeUnknown
- HttpStatus4xxCodeUnknown
- HttpStatus5xxCodeUnknown
- HttpStatusCodeUnknown
- class Value
Define enum types and the corresponding int values
Members:
Http100Continue
Http101SwitchingProtocols
Http102Processing
Http103EarlyHints
Http200OK
Http201Created
Http202Accepted
Http203NonAuthoritativeInformation
Http204NoContent
Http205ResetContent
Http206PartialContent
Http207MultiStatus
Http208AlreadyReported
Http226IMUsed
Http300MultipleChoices
Http301MovedPermanently
Http302
Http303SeeOther
Http304NotModified
Http305UseProxy
Http306SwitchProxy
Http307TemporaryRedirect
Http308PermanentRedirect
Http400BadRequest
Http401Unauthorized
Http402PaymentRequired
Http403Forbidden
Http404NotFound
Http405MethodNotAllowed
Http406NotAcceptable
Http407ProxyAuthenticationRequired
Http408RequestTimeout
Http409Conflict
Http410Gone
Http411LengthRequired
Http412PreconditionFailed
Http413RequestEntityTooLarge
Http414RequestURITooLong
Http415UnsupportedMediaType
Http416RequestedRangeNotSatisfiable
Http417ExpectationFailed
Http418ImATeapot
Http419AuthenticationTimeout
Http420
Http421MisdirectedRequest
Http422UnprocessableEntity
Http423Locked
Http424FailedDependency
Http425TooEarly
Http426UpgradeRequired
Http428PreconditionRequired
Http429TooManyRequests
Http431RequestHeaderFieldsTooLarge
Http440LoginTimeout
Http444NoResponse
Http449RetryWith
Http450BlockedByWindowsParentalControls
Http451
Http494RequestHeaderTooLarge
Http495CertError
Http496NoCert
Http497HTTPtoHTTPS
Http498TokenExpiredInvalid
Http499
Http500InternalServerError
Http501NotImplemented
Http502BadGateway
Http503ServiceUnavailable
Http504GatewayTimeout
Http505HTTPVersionNotSupported
Http506VariantAlsoNegotiates
Http507InsufficientStorage
Http508LoopDetected
Http509BandwidthLimitExceeded
Http510NotExtended
Http511NetworkAuthenticationRequired
Http520OriginError
Http521WebServerIsDown
Http522ConnectionTimedOut
Http523ProxyDeclinedRequest
Http524aTimeoutOccurred
Http598NetworkReadTimeoutError
Http599NetworkConnectTimeoutError
HttpStatus1xxCodeUnknown
HttpStatus2xxCodeUnknown
HttpStatus3xxCodeUnknown
HttpStatus4xxCodeUnknown
HttpStatus5xxCodeUnknown
HttpStatusCodeUnknown
- Http100Continue
- Http101SwitchingProtocols
- Http102Processing
- Http103EarlyHints
- Http200OK
- Http201Created
- Http202Accepted
- Http203NonAuthoritativeInformation
- Http204NoContent
- Http205ResetContent
- Http206PartialContent
- Http207MultiStatus
- Http208AlreadyReported
- Http226IMUsed
- Http300MultipleChoices
- Http301MovedPermanently
- Http302
- Http303SeeOther
- Http304NotModified
- Http305UseProxy
- Http306SwitchProxy
- Http307TemporaryRedirect
- Http308PermanentRedirect
- Http400BadRequest
- Http401Unauthorized
- Http402PaymentRequired
- Http403Forbidden
- Http404NotFound
- Http405MethodNotAllowed
- Http406NotAcceptable
- Http407ProxyAuthenticationRequired
- Http408RequestTimeout
- Http409Conflict
- Http410Gone
- Http411LengthRequired
- Http412PreconditionFailed
- Http413RequestEntityTooLarge
- Http414RequestURITooLong
- Http415UnsupportedMediaType
- Http416RequestedRangeNotSatisfiable
- Http417ExpectationFailed
- Http418ImATeapot
- Http419AuthenticationTimeout
- Http420
- Http421MisdirectedRequest
- Http422UnprocessableEntity
- Http423Locked
- Http424FailedDependency
- Http425TooEarly
- Http426UpgradeRequired
- Http428PreconditionRequired
- Http429TooManyRequests
- Http431RequestHeaderFieldsTooLarge
- Http440LoginTimeout
- Http444NoResponse
- Http449RetryWith
- Http450BlockedByWindowsParentalControls
- Http451
- Http494RequestHeaderTooLarge
- Http495CertError
- Http496NoCert
- Http497HTTPtoHTTPS
- Http498TokenExpiredInvalid
- Http499
- Http500InternalServerError
- Http501NotImplemented
- Http502BadGateway
- Http504GatewayTimeout
- Http505HTTPVersionNotSupported
- Http506VariantAlsoNegotiates
- Http507InsufficientStorage
- Http508LoopDetected
- Http509BandwidthLimitExceeded
- Http510NotExtended
- Http511NetworkAuthenticationRequired
- Http520OriginError
- Http521WebServerIsDown
- Http522ConnectionTimedOut
- Http523ProxyDeclinedRequest
- Http524aTimeoutOccurred
- Http598NetworkReadTimeoutError
- Http599NetworkConnectTimeoutError
- HttpStatus1xxCodeUnknown
- HttpStatus2xxCodeUnknown
- HttpStatus3xxCodeUnknown
- HttpStatus4xxCodeUnknown
- HttpStatus5xxCodeUnknown
- HttpStatusCodeUnknown
- __init__(self: mtf.libs.mtf_pybinder.pcpp.HttpResponseStatusCode.Value, value: int) None
- __new__(**kwargs)
- property name
- property value
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.HttpResponseStatusCode) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.HttpResponseStatusCode, status_code: pcpp::HttpResponseStatusCode::Value) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.HttpResponseStatusCode, status_code_number: int) -> None
doc
__init__(self: mtf.libs.mtf_pybinder.pcpp.HttpResponseStatusCode, status_code_number: int, status_message: str) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.HttpResponseStatusCode, status_code: pcpp::HttpResponseStatusCode::Value, status_message: str) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.HttpResponseStatusCode, arg0: mtf.libs.mtf_pybinder.pcpp.HttpResponseStatusCode) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.HttpResponseStatusCode, : mtf.libs.mtf_pybinder.pcpp.HttpResponseStatusCode) mtf.libs.mtf_pybinder.pcpp.HttpResponseStatusCode
- Returns:
pcpp.HttpResponseStatusCode
- is_unsupported_code(self: mtf.libs.mtf_pybinder.pcpp.HttpResponseStatusCode) bool
If this HttpResponseStatusCode a valid code Any unknown or error code has an extreme large enum value
- Returns:
bool
- property message
get status code message, e.g. “OK”, “Not Found”
- Returns:
str
- property value_int
get status code number as int
- Returns:
int
- property value_string
get status code number as string
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.HttpVersion
An enum for HTTP version
Members:
ZeroDotNine
OneDotZero
OneDotOne
HttpVersionUnknown
- HttpVersionUnknown
- OneDotOne
- OneDotZero
- ZeroDotNine
- __init__(self: mtf.libs.mtf_pybinder.pcpp.HttpVersion, value: int) None
- __new__(**kwargs)
- property name
- property value
- class mtf.libs.mtf_pybinder.pcpp.ICMPv6DestinationUnreachableLayer
Represents an ICMPv6_DESTINATION_UNREACHABLE layer
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6DestinationUnreachableLayer, code: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6DestinationUnreachableLayer, arg0: mtf.libs.mtf_pybinder.pcpp.ICMPv6DestinationUnreachableLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6DestinationUnreachableLayer, arg0: mtf.libs.mtf_pybinder.pcpp.ICMPv6DestinationUnreachableLayer) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6DestinationUnreachableLayer, : mtf.libs.mtf_pybinder.pcpp.ICMPv6DestinationUnreachableLayer) mtf.libs.mtf_pybinder.pcpp.ICMPv6DestinationUnreachableLayer
- Returns:
pcpp.ICMPv6DestinationUnreachableLayer
- property checksum
Get the checksum header field in host representation
- property code
Get the code header field
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- is_message_of_type(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6Layer, type: mtf.libs.mtf_pybinder.pcpp.ICMPv6MessageType) bool
Type to check True if the layer if of the given type, false otherwise
- Args:
type (enum pcpp.ICMPv6MessageType): Type to check
- Returns:
bool: True if the layer if of the given type, false otherwise
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property message_type
Get the ICMPv6 Message Type
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property reserved
Reserved
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.ICMPv6EchoLayer
Represents an ICMPv6 echo request/reply protocol layer
- class ICMPv6EchoType
An enum representing ICMPv6 echo message types
Members:
REQUEST
REPLY
- REPLY
- REQUEST
- __init__(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6EchoLayer.ICMPv6EchoType, value: int) None
- __new__(**kwargs)
- property name
- property value
- REPLY
- REQUEST
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6EchoLayer, msg_type: pcpp::ICMPv6EchoLayer::ICMPv6EchoType, id: int, sequence: int, data: bytes) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6EchoLayer, msg_type: pcpp::ICMPv6EchoLayer::ICMPv6EchoType, id: int, sequence: int, data: list[int]) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6EchoLayer, arg0: mtf.libs.mtf_pybinder.pcpp.ICMPv6EchoLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6EchoLayer, arg0: mtf.libs.mtf_pybinder.pcpp.ICMPv6EchoLayer) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6EchoLayer, : mtf.libs.mtf_pybinder.pcpp.ICMPv6EchoLayer) mtf.libs.mtf_pybinder.pcpp.ICMPv6EchoLayer
- Returns:
pcpp.ICMPv6EchoLayer
- property checksum
Get the checksum header field in host representation
- property code
Get the code header field
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- property echo_data
Echo data bytes
- property echo_data_len
Size of the data in bytes
- Returns:
unsigned int
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- property identifier
Identifier in host representation
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- is_message_of_type(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6Layer, type: mtf.libs.mtf_pybinder.pcpp.ICMPv6MessageType) bool
Type to check True if the layer if of the given type, false otherwise
- Args:
type (enum pcpp.ICMPv6MessageType): Type to check
- Returns:
bool: True if the layer if of the given type, false otherwise
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property message_type
Get the ICMPv6 Message Type
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property sequence
Sequence number in host representation
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.ICMPv6Layer
Base class for ICMPv6 protocol layers which provides common logic for ICMPv6 messages.
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6Layer, msg_type: mtf.libs.mtf_pybinder.pcpp.ICMPv6MessageType, code: int, data: bytes) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6Layer, arg0: mtf.libs.mtf_pybinder.pcpp.ICMPv6Layer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6Layer, arg0: mtf.libs.mtf_pybinder.pcpp.ICMPv6Layer) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6Layer, : mtf.libs.mtf_pybinder.pcpp.ICMPv6Layer) mtf.libs.mtf_pybinder.pcpp.ICMPv6Layer
- Returns:
pcpp.IcmpV6Layer
- property checksum
Get the checksum header field in host representation
- property code
Get the code header field
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- is_message_of_type(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6Layer, type: mtf.libs.mtf_pybinder.pcpp.ICMPv6MessageType) bool
Type to check True if the layer if of the given type, false otherwise
- Args:
type (enum pcpp.ICMPv6MessageType): Type to check
- Returns:
bool: True if the layer if of the given type, false otherwise
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property message_type
Get the ICMPv6 Message Type
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.ICMPv6MessageType
An enum representing the available ICMPv6 message types
Members:
ICMPv6_UNKNOWN_MESSAGE
ICMPv6_DESTINATION_UNREACHABLE
ICMPv6_PACKET_TOO_BIG
ICMPv6_TIME_EXCEEDED
ICMPv6_PARAMETER_PROBLEM
ICMPv6_PRIVATE_EXPERIMENTATION1
ICMPv6_PRIVATE_EXPERIMENTATION2
ICMPv6_RESERVED_EXPANSION_ERROR
ICMPv6_ECHO_REQUEST
ICMPv6_ECHO_REPLY
ICMPv6_MULTICAST_LISTENER_QUERY
ICMPv6_MULTICAST_LISTENER_REPORT
ICMPv6_MULTICAST_LISTENER_DONE
ICMPv6_ROUTER_SOLICITATION
ICMPv6_ROUTER_ADVERTISEMENT
ICMPv6_NEIGHBOR_SOLICITATION
ICMPv6_NEIGHBOR_ADVERTISEMENT
ICMPv6_REDIRECT_MESSAGE
ICMPv6_ROUTER_RENUMBERING
ICMPv6_ICMP_NODE_INFORMATION_QUERY
ICMPv6_ICMP_NODE_INFORMATION_RESPONSE
ICMPv6_INVERSE_NEIGHBOR_DISCOVERY_SOLICITATION_MESSAGE
ICMPv6_INVERSE_NEIGHBOR_DISCOVERY_ADVERTISEMENT_MESSAGE
ICMPv6_MULTICAST_LISTENER_DISCOVERY_REPORTS
ICMPv6_HOME_AGENT_ADDRESS_DISCOVERY_REQUEST_MESSAGE
ICMPv6_HOME_AGENT_ADDRESS_DISCOVERY_REPLY_MESSAGE
ICMPv6_MOBILE_PREFIX_SOLICITATION
ICMPv6_MOBILE_PREFIX_ADVERTISEMENT
ICMPv6_CERTIFICATION_PATH_SOLICITATION
ICMPv6_CERTIFICATION_PATH_ADVERTISEMENT
ICMPv6_EXPERIMENTAL_MOBILITY
ICMPv6_MULTICAST_ROUTER_ADVERTISEMENT
ICMPv6_MULTICAST_ROUTER_SOLICITATION
ICMPv6_MULTICAST_ROUTER_TERMINATION
ICMPv6_RPL_CONTROL_MESSAGE
ICMPv6_PRIVATE_EXPERIMENTATION3
ICMPv6_PRIVATE_EXPERIMENTATION4
ICMPv6_RESERVED_EXPANSION_INFORMATIONAL
- ICMPv6_CERTIFICATION_PATH_ADVERTISEMENT
- ICMPv6_CERTIFICATION_PATH_SOLICITATION
- ICMPv6_DESTINATION_UNREACHABLE
- ICMPv6_ECHO_REPLY
- ICMPv6_ECHO_REQUEST
- ICMPv6_EXPERIMENTAL_MOBILITY
- ICMPv6_HOME_AGENT_ADDRESS_DISCOVERY_REPLY_MESSAGE
- ICMPv6_HOME_AGENT_ADDRESS_DISCOVERY_REQUEST_MESSAGE
- ICMPv6_ICMP_NODE_INFORMATION_QUERY
- ICMPv6_ICMP_NODE_INFORMATION_RESPONSE
- ICMPv6_INVERSE_NEIGHBOR_DISCOVERY_ADVERTISEMENT_MESSAGE
- ICMPv6_INVERSE_NEIGHBOR_DISCOVERY_SOLICITATION_MESSAGE
- ICMPv6_MOBILE_PREFIX_ADVERTISEMENT
- ICMPv6_MOBILE_PREFIX_SOLICITATION
- ICMPv6_MULTICAST_LISTENER_DISCOVERY_REPORTS
- ICMPv6_MULTICAST_LISTENER_DONE
- ICMPv6_MULTICAST_LISTENER_QUERY
- ICMPv6_MULTICAST_LISTENER_REPORT
- ICMPv6_MULTICAST_ROUTER_ADVERTISEMENT
- ICMPv6_MULTICAST_ROUTER_SOLICITATION
- ICMPv6_MULTICAST_ROUTER_TERMINATION
- ICMPv6_NEIGHBOR_ADVERTISEMENT
- ICMPv6_NEIGHBOR_SOLICITATION
- ICMPv6_PACKET_TOO_BIG
- ICMPv6_PARAMETER_PROBLEM
- ICMPv6_PRIVATE_EXPERIMENTATION1
- ICMPv6_PRIVATE_EXPERIMENTATION2
- ICMPv6_PRIVATE_EXPERIMENTATION3
- ICMPv6_PRIVATE_EXPERIMENTATION4
- ICMPv6_REDIRECT_MESSAGE
- ICMPv6_RESERVED_EXPANSION_ERROR
- ICMPv6_RESERVED_EXPANSION_INFORMATIONAL
- ICMPv6_ROUTER_ADVERTISEMENT
- ICMPv6_ROUTER_RENUMBERING
- ICMPv6_ROUTER_SOLICITATION
- ICMPv6_RPL_CONTROL_MESSAGE
- ICMPv6_TIME_EXCEEDED
- ICMPv6_UNKNOWN_MESSAGE
- __init__(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6MessageType, value: int) None
- __new__(**kwargs)
- property name
- property value
- class mtf.libs.mtf_pybinder.pcpp.ICMPv6MulticastAddressRecord
Base class for ICMPv6 protocol layers which provides common logic for ICMPv6 messages.
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6MulticastAddressRecord, type: mtf.libs.mtf_pybinder.pcpp.ICMPv6MulticastAddressRecordType, multicast_address: mtf.libs.mtf_pybinder.pcpp.IPv6Address, source_addresses: list[mtf.libs.mtf_pybinder.pcpp.IPv6Address], aux_data: list[int]) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6MulticastAddressRecord, arg0: mtf.libs.mtf_pybinder.pcpp.ICMPv6MulticastAddressRecord) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6MulticastAddressRecord, : mtf.libs.mtf_pybinder.pcpp.ICMPv6MulticastAddressRecord) mtf.libs.mtf_pybinder.pcpp.ICMPv6MulticastAddressRecord
- Returns:
pcpp.IcmpV6MulticastAddressRecord
- property aux_data_len
aux_data_len of icmpv6_multicast_address_record_hdr
- property auxiliary_data
Auxiliary data bytes
- property multicast_address
multicast_address of icmpv6_multicast_address_record_hdr
- property number_of_sources
number_of_sources of icmpv6_multicast_address_record_hdr
- property record_type
record_type of icmpv6_multicast_address_record_hdr
- property source_addresses
List of source addresses
- class mtf.libs.mtf_pybinder.pcpp.ICMPv6MulticastAddressRecordType
An enum representing the available ICMPv6 message types
Members:
MODE_IS_INCLUDE
MODE_IS_EXCLUDE
CHANGE_TO_INCLUDE_MODE
CHANGE_TO_EXCLUDE_MODE
ALLOW_NEW_SOURCES
BLOCK_OLD_SOURCES
- ALLOW_NEW_SOURCES
- BLOCK_OLD_SOURCES
- CHANGE_TO_EXCLUDE_MODE
- CHANGE_TO_INCLUDE_MODE
- MODE_IS_EXCLUDE
- MODE_IS_INCLUDE
- __init__(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6MulticastAddressRecordType, value: int) None
- __new__(**kwargs)
- property name
- property value
- class mtf.libs.mtf_pybinder.pcpp.ICMPv6MulticastListenerDiscoveryLayer
Common base class for Multicast Listener Discovery (MLD) layers
- __init__(*args, **kwargs)
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6Layer, : mtf.libs.mtf_pybinder.pcpp.ICMPv6Layer) mtf.libs.mtf_pybinder.pcpp.ICMPv6Layer
- Returns:
pcpp.IcmpV6Layer
- property checksum
Get the checksum header field in host representation
- property code
Get the code header field
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- is_message_of_type(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6Layer, type: mtf.libs.mtf_pybinder.pcpp.ICMPv6MessageType) bool
Type to check True if the layer if of the given type, false otherwise
- Args:
type (enum pcpp.ICMPv6MessageType): Type to check
- Returns:
bool: True if the layer if of the given type, false otherwise
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property maximum_response_delay
The Maximum Response Delay
- property message_type
Get the ICMPv6 Message Type
- property multicast_address
The multicast address
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property reserved
Reserved
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.ICMPv6MulticastListenerDiscoveryReportsLayer
Represents an ICMPv6_MULTICAST_LISTENER_DISCOVERY_REPORTS layer
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6MulticastListenerDiscoveryReportsLayer, code: int, multicast_address_records: list[mtf.libs.mtf_pybinder.pcpp.ICMPv6MulticastAddressRecord]) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6MulticastListenerDiscoveryReportsLayer, arg0: mtf.libs.mtf_pybinder.pcpp.ICMPv6MulticastListenerDiscoveryReportsLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6MulticastListenerDiscoveryReportsLayer, arg0: mtf.libs.mtf_pybinder.pcpp.ICMPv6MulticastListenerDiscoveryReportsLayer) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6MulticastListenerDiscoveryReportsLayer, : mtf.libs.mtf_pybinder.pcpp.ICMPv6MulticastListenerDiscoveryReportsLayer) mtf.libs.mtf_pybinder.pcpp.ICMPv6MulticastListenerDiscoveryReportsLayer
- Returns:
pcpp.ICMPv6MulticastListenerDiscoveryReportsLayer
- property checksum
Get the checksum header field in host representation
- property code
Get the code header field
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- is_message_of_type(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6Layer, type: mtf.libs.mtf_pybinder.pcpp.ICMPv6MessageType) bool
Type to check True if the layer if of the given type, false otherwise
- Args:
type (enum pcpp.ICMPv6MessageType): Type to check
- Returns:
bool: True if the layer if of the given type, false otherwise
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property message_type
Get the ICMPv6 Message Type
- property number_of_multicast_address_records
Number of Mcast Address Records
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property records
List of Multicast Address Records
- property reserved
Reserved
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.ICMPv6MulticastListenerDoneLayer
Represents an ICMPv6_MULTICAST_LISTENER_DONE layer
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6MulticastListenerDoneLayer, code: int, maximum_response_delay: int, multicast_address: mtf.libs.mtf_pybinder.pcpp.IPv6Address) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6MulticastListenerDoneLayer, arg0: mtf.libs.mtf_pybinder.pcpp.ICMPv6MulticastListenerDoneLayer) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6MulticastListenerDoneLayer, : mtf.libs.mtf_pybinder.pcpp.ICMPv6MulticastListenerDoneLayer) mtf.libs.mtf_pybinder.pcpp.ICMPv6MulticastListenerDoneLayer
- Returns:
pcpp.ICMPv6MulticastListenerDoneLayer
- property checksum
Get the checksum header field in host representation
- property code
Get the code header field
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- is_message_of_type(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6Layer, type: mtf.libs.mtf_pybinder.pcpp.ICMPv6MessageType) bool
Type to check True if the layer if of the given type, false otherwise
- Args:
type (enum pcpp.ICMPv6MessageType): Type to check
- Returns:
bool: True if the layer if of the given type, false otherwise
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property maximum_response_delay
The Maximum Response Delay
- property message_type
Get the ICMPv6 Message Type
- property multicast_address
The multicast address
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property reserved
Reserved
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.ICMPv6MulticastListenerQueryLayer
Represents an ICMPv6_MULTICAST_LISTENER_QUERY layer
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6MulticastListenerQueryLayer, code: int, maximum_response_delay: int, multicast_address: mtf.libs.mtf_pybinder.pcpp.IPv6Address) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6MulticastListenerQueryLayer, arg0: mtf.libs.mtf_pybinder.pcpp.ICMPv6MulticastListenerQueryLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6MulticastListenerQueryLayer, arg0: mtf.libs.mtf_pybinder.pcpp.ICMPv6MulticastListenerQueryLayer) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6MulticastListenerQueryLayer, : mtf.libs.mtf_pybinder.pcpp.ICMPv6MulticastListenerQueryLayer) mtf.libs.mtf_pybinder.pcpp.ICMPv6MulticastListenerQueryLayer
- Returns:
pcpp.ICMPv6MulticastListenerQueryLayer
- property checksum
Get the checksum header field in host representation
- property code
Get the code header field
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- is_message_of_type(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6Layer, type: mtf.libs.mtf_pybinder.pcpp.ICMPv6MessageType) bool
Type to check True if the layer if of the given type, false otherwise
- Args:
type (enum pcpp.ICMPv6MessageType): Type to check
- Returns:
bool: True if the layer if of the given type, false otherwise
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property maximum_response_delay
The Maximum Response Delay
- property message_type
Get the ICMPv6 Message Type
- property multicast_address
The multicast address
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property reserved
Reserved
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.ICMPv6MulticastListenerReportLayer
Represents an ICMPv6_MULTICAST_LISTENER_REPORT layer
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6MulticastListenerReportLayer, code: int, maximum_response_delay: int, multicast_address: mtf.libs.mtf_pybinder.pcpp.IPv6Address) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6MulticastListenerReportLayer, arg0: mtf.libs.mtf_pybinder.pcpp.ICMPv6MulticastListenerReportLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6MulticastListenerReportLayer, arg0: mtf.libs.mtf_pybinder.pcpp.ICMPv6MulticastListenerReportLayer) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6MulticastListenerReportLayer, : mtf.libs.mtf_pybinder.pcpp.ICMPv6MulticastListenerReportLayer) mtf.libs.mtf_pybinder.pcpp.ICMPv6MulticastListenerReportLayer
- Returns:
pcpp.ICMPv6MulticastListenerReportLayer
- property checksum
Get the checksum header field in host representation
- property code
Get the code header field
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- is_message_of_type(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6Layer, type: mtf.libs.mtf_pybinder.pcpp.ICMPv6MessageType) bool
Type to check True if the layer if of the given type, false otherwise
- Args:
type (enum pcpp.ICMPv6MessageType): Type to check
- Returns:
bool: True if the layer if of the given type, false otherwise
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property maximum_response_delay
The Maximum Response Delay
- property message_type
Get the ICMPv6 Message Type
- property multicast_address
The multicast address
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property reserved
Reserved
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.ICMPv6Option
A wrapper class for ICMPv6 options. This class does not create or modify ICMPv6 option records, but rather serves as a wrapper and provides useful methods for setting and retrieving data to/from them
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6Option, arg0: mtf.libs.mtf_pybinder.pcpp.ICMPv6Option) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6Option, arg0: mtf.libs.mtf_pybinder.pcpp.ICMPv6Option) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6Option, : mtf.libs.mtf_pybinder.pcpp.ICMPv6Option) mtf.libs.mtf_pybinder.pcpp.ICMPv6Option
- Returns:
pcpp.ICMPv6Option
- static can_assign(record_raw_data: int, tlv_data_len: int) bool
- Args:
record_raw_data (bytes) tlv_data_len (unsigned int)
- Returns:
bool
- property data_size
- Returns:
unsigned int
- get_value_as(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t, offset: int) int
- Args:
offset (unsigned int)
- Returns:
unsigned int
- is_not_null(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t) bool
- Returns:
bool
- is_null(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t) bool
- Returns:
bool
- property length
- Returns:
unsigned int
- purge_record_data(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t) None
- property record_raw_data
- set_value(*args, **kwargs)
Overloaded function.
set_value(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t, new_value: int) -> bool
- Args:
new_value (unsigned int)
- Returns:
bool
set_value(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t, new_value: int, value_offset: int) -> bool
- Args:
new_value (unsigned int) value_offset (int)
- Returns:
bool
- property total_size
- Returns:
unsigned int
- property type
The option type converted to ::ICMPv6OptionType enum
- Returns:
enum pcpp.ICMPv6OptionType
- property value
- property value_as_hex_string
The raw option value (byte array) as a hex string
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.ICMPv6OptionBuilder
A class for building ICMPv6 Type-Length-Value (TLV) options. This builder receives the option parameters in its c’tor, builds the option raw buffer and provides a method to build a ICMPv6Option object out of it
- __init__(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6OptionBuilder, type: mtf.libs.mtf_pybinder.pcpp.ICMPv6OptionType, value: list[int]) None
- __new__(**kwargs)
- build(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6OptionBuilder) mtf.libs.mtf_pybinder.pcpp.ICMPv6Option
Build the ICMPv6Option object out of the parameters defined in the c’tor
- class mtf.libs.mtf_pybinder.pcpp.ICMPv6OptionType
ICMPv6 option types.
Members:
ICMPV6_OPT_UNKNOWN
ICMPV6_OPT_SOURCE_LINK_LAYER_ADDRESS
ICMPV6_OPT_TARGET_LINK_LAYER_ADDRESS
ICMPV6_OPT_PREFIX_INFORMATION
ICMPV6_OPT_REDIRECT_HEADER
ICMPV6_OPT_MTU
ICMPV6_OPT_TRUST_ANCHOR
ICMPV6_OPT_CERTIFICATE
ICMPV6_OPT_IP_ADDRESS_PREFIX
ICMPV6_OPT_NEW_ROUTER_PREFIX_INFORMATION
ICMPV6_OPT_LINK_LAYER_ADDRESS
ICMPV6_OPT_NEIGHBOR_ADVERTISEMENT_ACK
ICMPV6_OPT_PVD_ID_ROUTER_ADVERTISEMENT
ICMPV6_OPT_MAP
ICMPV6_OPT_ROUTE_INFORMATION
ICMPV6_OPT_RECURSIVE_DNS_SERVER
ICMPV6_OPT_RA_FLAGS_EXTENSION
ICMPV6_OPT_HANDOVER_KEY_REQUEST
ICMPV6_OPT_HANDOVER_KEY_REPLY
ICMPV6_OPT_HANDOVER_ASSIST_INFORMATION
ICMPV6_OPT_MOBILE_NODE_IDENTIFIER
ICMPV6_OPT_DNS_SEARCH_LIST
ICMPV6_OPT_PROXY_SIGNATURE
ICMPV6_OPT_ADDRESS_REGISTRATION
ICMPV6_OPT_6LOWPAN_CONTEXT
ICMPV6_OPT_AUTHORITATIVE_BORDER_ROUTER
ICMPV6_OPT_6LOWPAN_CAPABILITY_INDICATION
ICMPV6_OPT_DHCP_CAPTIVE_PORTAL
ICMPV6_OPT_PREF64
ICMPV6_OPT_CRYPTO_ID_PARAMETERS
ICMPV6_OPT_NDP_SIGNATURE
ICMPV6_OPT_RESOURCE_DIRECTORY_ADDRESS
- ICMPV6_OPT_6LOWPAN_CAPABILITY_INDICATION
- ICMPV6_OPT_6LOWPAN_CONTEXT
- ICMPV6_OPT_ADDRESS_REGISTRATION
- ICMPV6_OPT_AUTHORITATIVE_BORDER_ROUTER
- ICMPV6_OPT_CERTIFICATE
- ICMPV6_OPT_CRYPTO_ID_PARAMETERS
- ICMPV6_OPT_DHCP_CAPTIVE_PORTAL
- ICMPV6_OPT_DNS_SEARCH_LIST
- ICMPV6_OPT_HANDOVER_ASSIST_INFORMATION
- ICMPV6_OPT_HANDOVER_KEY_REPLY
- ICMPV6_OPT_HANDOVER_KEY_REQUEST
- ICMPV6_OPT_IP_ADDRESS_PREFIX
- ICMPV6_OPT_LINK_LAYER_ADDRESS
- ICMPV6_OPT_MAP
- ICMPV6_OPT_MOBILE_NODE_IDENTIFIER
- ICMPV6_OPT_MTU
- ICMPV6_OPT_NDP_SIGNATURE
- ICMPV6_OPT_NEIGHBOR_ADVERTISEMENT_ACK
- ICMPV6_OPT_NEW_ROUTER_PREFIX_INFORMATION
- ICMPV6_OPT_PREF64
- ICMPV6_OPT_PREFIX_INFORMATION
- ICMPV6_OPT_PROXY_SIGNATURE
- ICMPV6_OPT_PVD_ID_ROUTER_ADVERTISEMENT
- ICMPV6_OPT_RA_FLAGS_EXTENSION
- ICMPV6_OPT_RECURSIVE_DNS_SERVER
- ICMPV6_OPT_REDIRECT_HEADER
- ICMPV6_OPT_RESOURCE_DIRECTORY_ADDRESS
- ICMPV6_OPT_ROUTE_INFORMATION
- ICMPV6_OPT_SOURCE_LINK_LAYER_ADDRESS
- ICMPV6_OPT_TARGET_LINK_LAYER_ADDRESS
- ICMPV6_OPT_TRUST_ANCHOR
- ICMPV6_OPT_UNKNOWN
- __init__(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6OptionType, value: int) None
- __new__(**kwargs)
- property name
- property value
- class mtf.libs.mtf_pybinder.pcpp.ICMPv6PacketTooBigLayer
Represents an ICMPv6_PACKET_TOO_BIG layer
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6PacketTooBigLayer, code: int, mtu: int, suffix_data: list[int]) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6PacketTooBigLayer, arg0: mtf.libs.mtf_pybinder.pcpp.ICMPv6PacketTooBigLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6PacketTooBigLayer, arg0: mtf.libs.mtf_pybinder.pcpp.ICMPv6PacketTooBigLayer) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6PacketTooBigLayer, : mtf.libs.mtf_pybinder.pcpp.ICMPv6PacketTooBigLayer) mtf.libs.mtf_pybinder.pcpp.ICMPv6PacketTooBigLayer
- Returns:
pcpp.ICMPv6PacketTooBigLayer
- property checksum
Get the checksum header field in host representation
- property code
Get the code header field
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- is_message_of_type(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6Layer, type: mtf.libs.mtf_pybinder.pcpp.ICMPv6MessageType) bool
Type to check True if the layer if of the given type, false otherwise
- Args:
type (enum pcpp.ICMPv6MessageType): Type to check
- Returns:
bool: True if the layer if of the given type, false otherwise
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property message_type
Get the ICMPv6 Message Type
- property mtu
uint32_t MTU
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property suffix_data
std::vector<uint8_t> The suffix data of the layer
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.ICMPv6ParameterProblemLayer
Represents an ICMPv6_PARAMETER_PROBLEM layer
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6ParameterProblemLayer, code: int, pointer: int, suffix_data: list[int]) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6ParameterProblemLayer, arg0: mtf.libs.mtf_pybinder.pcpp.ICMPv6ParameterProblemLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6ParameterProblemLayer, arg0: mtf.libs.mtf_pybinder.pcpp.ICMPv6ParameterProblemLayer) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6ParameterProblemLayer, : mtf.libs.mtf_pybinder.pcpp.ICMPv6ParameterProblemLayer) mtf.libs.mtf_pybinder.pcpp.ICMPv6ParameterProblemLayer
- Returns:
pcpp.ICMPv6ParameterProblemLayer
- property checksum
Get the checksum header field in host representation
- property code
Get the code header field
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- is_message_of_type(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6Layer, type: mtf.libs.mtf_pybinder.pcpp.ICMPv6MessageType) bool
Type to check True if the layer if of the given type, false otherwise
- Args:
type (enum pcpp.ICMPv6MessageType): Type to check
- Returns:
bool: True if the layer if of the given type, false otherwise
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property message_type
Get the ICMPv6 Message Type
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property pointer
uint32_t Pointer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property suffix_data
std::vector<uint8_t> The suffix data of the layer
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.ICMPv6RedirectLayer
Represents an ICMPv6_REDIRECT layer
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6RedirectLayer, code: int, target_address: mtf.libs.mtf_pybinder.pcpp.IPv6Address, destination_address: mtf.libs.mtf_pybinder.pcpp.IPv6Address, options: list[mtf.libs.mtf_pybinder.pcpp.ICMPv6OptionBuilder]) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6RedirectLayer, arg0: mtf.libs.mtf_pybinder.pcpp.ICMPv6RedirectLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6RedirectLayer, arg0: mtf.libs.mtf_pybinder.pcpp.ICMPv6RedirectLayer) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6RedirectLayer, : mtf.libs.mtf_pybinder.pcpp.ICMPv6RedirectLayer) mtf.libs.mtf_pybinder.pcpp.ICMPv6RedirectLayer
- Returns:
pcpp.ICMPv6RedirectLayer
- property checksum
Get the checksum header field in host representation
- property code
Get the code header field
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- property destination_address
The destination address
- property first_option_data
The first ICMPv6 option in the packet. If there are no DHCPv6 options the returned value will contain a logical NULL (ICMPv6Option#isNull() == true)
- Returns:
pcpp.ICMPv6Option
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_next_option_data(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6RedirectLayer, option: mtf.libs.mtf_pybinder.pcpp.ICMPv6Option) mtf.libs.mtf_pybinder.pcpp.ICMPv6Option
Get the ICMPv6 option that comes after a given option. If the given option was the last one, the returned value will contain a logical NULL (ICMPv6Option#isNull() == true)
- Args:
option (pcpp.ICMPv6Option): A given ICMPv6 option
- Returns:
pcpp.ICMPv6Option: A ICMPv6Option object containing the option data that comes next, or logical NULL if the given ICMPv6
option: (1) was the last one; (2) contains a logical NULL or (3) doesn’t belong to this packet
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- is_message_of_type(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6Layer, type: mtf.libs.mtf_pybinder.pcpp.ICMPv6MessageType) bool
Type to check True if the layer if of the given type, false otherwise
- Args:
type (enum pcpp.ICMPv6MessageType): Type to check
- Returns:
bool: True if the layer if of the given type, false otherwise
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property message_type
Get the ICMPv6 Message Type
- property option_count
The number of ICMPv6 options in this layer
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property reserved
Reserved
- property target_address
The target address
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.ICMPv6RouterAdvertisementLayer
Represents an ICMPv6_ROUTER_ADVERTISEMENT layer
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6RouterAdvertisementLayer, code: int, cur_hop_limit: int, flags: int, router_lifetime: int, reachable_time: int, retrans_timer: int, options: list[mtf.libs.mtf_pybinder.pcpp.ICMPv6OptionBuilder]) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6RouterAdvertisementLayer, arg0: mtf.libs.mtf_pybinder.pcpp.ICMPv6RouterAdvertisementLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6RouterAdvertisementLayer, arg0: mtf.libs.mtf_pybinder.pcpp.ICMPv6RouterAdvertisementLayer) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6RouterAdvertisementLayer, : mtf.libs.mtf_pybinder.pcpp.ICMPv6RouterAdvertisementLayer) mtf.libs.mtf_pybinder.pcpp.ICMPv6RouterAdvertisementLayer
- Returns:
pcpp.ICMPv6RouterAdvertisementLayer
- property checksum
Get the checksum header field in host representation
- property code
Get the code header field
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property cur_hop_limit
uint8_t The Current Hop Limit field value
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- property first_option_data
The first ICMPv6 option in the packet. If there are no DHCPv6 options the returned value will contain a logical NULL (ICMPv6Option#isNull() == true)
- Returns:
pcpp.ICMPv6Option
- property flags
uint8_t The Flags field value
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_next_option_data(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6RouterAdvertisementLayer, option: mtf.libs.mtf_pybinder.pcpp.ICMPv6Option) mtf.libs.mtf_pybinder.pcpp.ICMPv6Option
Get the ICMPv6 option that comes after a given option. If the given option was the last one, the returned value will contain a logical NULL (ICMPv6Option#isNull() == true)
- Args:
option (pcpp.ICMPv6Option): A given ICMPv6 option
- Returns:
pcpp.ICMPv6Option: A ICMPv6Option object containing the option data that comes next, or logical NULL if the given ICMPv6
option: (1) was the last one; (2) contains a logical NULL or (3) doesn’t belong to this packet
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- is_message_of_type(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6Layer, type: mtf.libs.mtf_pybinder.pcpp.ICMPv6MessageType) bool
Type to check True if the layer if of the given type, false otherwise
- Args:
type (enum pcpp.ICMPv6MessageType): Type to check
- Returns:
bool: True if the layer if of the given type, false otherwise
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property message_type
Get the ICMPv6 Message Type
- property option_count
The number of ICMPv6 options in this layer
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property reachable_time
uint32_t The Reachable Time field value
- property retrans_timer
uint32_t The Retrans Timer field value
- property router_lifetime
uint16_t The Router Lifetime field value
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.ICMPv6RouterSolicitationLayer
Represents an ICMPv6_ROUTER_SOLICITATION layer
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6RouterSolicitationLayer, code: int, options: list[mtf.libs.mtf_pybinder.pcpp.ICMPv6OptionBuilder]) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6RouterSolicitationLayer, arg0: mtf.libs.mtf_pybinder.pcpp.ICMPv6RouterSolicitationLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6RouterSolicitationLayer, arg0: mtf.libs.mtf_pybinder.pcpp.ICMPv6RouterSolicitationLayer) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6RouterSolicitationLayer, : mtf.libs.mtf_pybinder.pcpp.ICMPv6RouterSolicitationLayer) mtf.libs.mtf_pybinder.pcpp.ICMPv6RouterSolicitationLayer
- Returns:
pcpp.ICMPv6RouterSolicitationLayer
- property checksum
Get the checksum header field in host representation
- property code
Get the code header field
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- property first_option_data
The first ICMPv6 option in the packet. If there are no DHCPv6 options the returned value will contain a logical NULL (ICMPv6Option#isNull() == true)
- Returns:
pcpp.ICMPv6Option
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_next_option_data(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6RouterSolicitationLayer, option: mtf.libs.mtf_pybinder.pcpp.ICMPv6Option) mtf.libs.mtf_pybinder.pcpp.ICMPv6Option
Get the ICMPv6 option that comes after a given option. If the given option was the last one, the returned value will contain a logical NULL (ICMPv6Option#isNull() == true)
- Args:
option (pcpp.ICMPv6Option): A given ICMPv6 option
- Returns:
pcpp.ICMPv6Option: A ICMPv6Option object containing the option data that comes next, or logical NULL if the given ICMPv6
option: (1) was the last one; (2) contains a logical NULL or (3) doesn’t belong to this packet
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- is_message_of_type(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6Layer, type: mtf.libs.mtf_pybinder.pcpp.ICMPv6MessageType) bool
Type to check True if the layer if of the given type, false otherwise
- Args:
type (enum pcpp.ICMPv6MessageType): Type to check
- Returns:
bool: True if the layer if of the given type, false otherwise
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property message_type
Get the ICMPv6 Message Type
- property option_count
The number of ICMPv6 options in this layer
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property reserved
Reserved
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.ICMPv6TimeExceededLayer
Represents an ICMPv6_TIME_EXCEEDED layer
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6TimeExceededLayer, code: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6TimeExceededLayer, arg0: mtf.libs.mtf_pybinder.pcpp.ICMPv6TimeExceededLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6TimeExceededLayer, arg0: mtf.libs.mtf_pybinder.pcpp.ICMPv6TimeExceededLayer) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6TimeExceededLayer, : mtf.libs.mtf_pybinder.pcpp.ICMPv6TimeExceededLayer) mtf.libs.mtf_pybinder.pcpp.ICMPv6TimeExceededLayer
- Returns:
pcpp.ICMPv6TimeExceededLayer
- property checksum
Get the checksum header field in host representation
- property code
Get the code header field
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- is_message_of_type(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6Layer, type: mtf.libs.mtf_pybinder.pcpp.ICMPv6MessageType) bool
Type to check True if the layer if of the given type, false otherwise
- Args:
type (enum pcpp.ICMPv6MessageType): Type to check
- Returns:
bool: True if the layer if of the given type, false otherwise
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property message_type
Get the ICMPv6 Message Type
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property reserved
Reserved
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.IDataContainer
An interface (virtual abstract class) that indicates an object that holds a pointer to a buffer data. The Layer class is an example of such object, hence it inherits this interface
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IDataContainer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IDataContainer, arg0: mtf.libs.mtf_pybinder.pcpp.IDataContainer) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IDataContainer, : mtf.libs.mtf_pybinder.pcpp.IDataContainer) mtf.libs.mtf_pybinder.pcpp.IDataContainer
- Returns:
pcpp.IDataContainer
- class mtf.libs.mtf_pybinder.pcpp.IDevice
An abstract interface representing all packet processing devices. It stands as the root class for all devices. This is an abstract class that cannot be instantiated
- __init__(*args, **kwargs)
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IDevice, : mtf.libs.mtf_pybinder.pcpp.IDevice) mtf.libs.mtf_pybinder.pcpp.IDevice
- Returns:
pcpp.IDevice
- close(self: mtf.libs.mtf_pybinder.pcpp.IDevice) None
Close the device
- is_opened(self: mtf.libs.mtf_pybinder.pcpp.IDevice) bool
- Returns:
bool: True if the file is opened, false otherwise
- open(self: mtf.libs.mtf_pybinder.pcpp.IDevice) bool
Open the device
- Returns:
bool: True if device was opened successfully, false otherwise
- class mtf.libs.mtf_pybinder.pcpp.IFileDevice
An abstract class (cannot be instantiated, has a private c’tor) which is the parent class for all file devices
- class PcapStats
A container for pcap device statistics
- __init__(self: mtf.libs.mtf_pybinder.pcpp.IPcapDevice.PcapStats) None
- __new__(**kwargs)
- property packets_drop
- property packets_drop_by_interface
- property packets_recv
- __init__(*args, **kwargs)
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IFileDevice, : mtf.libs.mtf_pybinder.pcpp.IFileDevice) mtf.libs.mtf_pybinder.pcpp.IFileDevice
- Returns:
pcpp.IFileDevice
- clear_filter(self: mtf.libs.mtf_pybinder.pcpp.IFilterableDevice) bool
Clear the filter currently set on the device
- Returns:
bool: True if filter was removed successfully or if no filter was set, false otherwise
- close(self: mtf.libs.mtf_pybinder.pcpp.IDevice) None
Close the device
- get_file_name(self: mtf.libs.mtf_pybinder.pcpp.IFileDevice) str
Get the name of the file
- Returns:
str: The name of the file
- static get_pcap_lib_version_info() str
A static method for retrieving pcap lib (libpcap/WinPcap/etc.) version information. This method is actually a wrapper for [pcap_lib_version()](https://www.tcpdump.org/manpages/pcap_lib_version.3pcap.html)
- Returns:
str: A string containing the pcap lib version information
- get_statistics(self: mtf.libs.mtf_pybinder.pcpp.IPcapDevice, stats: pcpp::IPcapDevice::PcapStats) None
Get statistics from the device
- Args:
stats (pcpp.IPcapDevice.PcapStats): An object containing the stats
- is_opened(self: mtf.libs.mtf_pybinder.pcpp.IDevice) bool
- Returns:
bool: True if the file is opened, false otherwise
- static match_packet_with_filter(filter: mtf.libs.mtf_pybinder.pcpp.GeneralFilter, raw_packet: mtf.libs.mtf_pybinder.pcpp.RawPacket) bool
Match a raw packet with a given BPF filter. Notice this method is static which means you don’t need any device instance in order to perform this match
- Args:
filter (pcpp.GeneralFilter): A filter class to test against raw_packet (pcpp.RawPacket): A pointer to the raw packet to match the filter with
- Returns:
bool: True if raw packet matches the filter or false otherwise
- open(self: mtf.libs.mtf_pybinder.pcpp.IDevice) bool
Open the device
- Returns:
bool: True if device was opened successfully, false otherwise
- set_filter(*args, **kwargs)
Overloaded function.
set_filter(self: mtf.libs.mtf_pybinder.pcpp.IFilterableDevice, filter: mtf.libs.mtf_pybinder.pcpp.GeneralFilter) -> bool
Set a filter for the device. When implemented by the device, only packets that match the filter will be received
- Args:
filter (pcpp.GeneralFilter): The filter to be set in PcapPlusPlus’ GeneralFilter format
- Returns:
bool: True if filter set successfully, false otherwise
set_filter(self: mtf.libs.mtf_pybinder.pcpp.IFilterableDevice, filter_as_string: str) -> bool
Set a filter for the device. When implemented by the device, only packets that match the filter will be received
- Args:
filter_as_string (str): The filter to be set in Berkeley Packet Filter (BPF) syntax (http://biot.com/capstats/bpf.html)
- Returns:
bool: True if filter set successfully, false otherwise
- class mtf.libs.mtf_pybinder.pcpp.IFileReaderDevice
An abstract class (cannot be instantiated, has a private c’tor) which is the parent class for file reader devices
- class PcapStats
A container for pcap device statistics
- __init__(self: mtf.libs.mtf_pybinder.pcpp.IPcapDevice.PcapStats) None
- __new__(**kwargs)
- property packets_drop
- property packets_drop_by_interface
- property packets_recv
- __init__(*args, **kwargs)
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IFileReaderDevice, : mtf.libs.mtf_pybinder.pcpp.IFileReaderDevice) mtf.libs.mtf_pybinder.pcpp.IFileReaderDevice
- Returns:
pcpp.IFileReaderDevice
- clear_filter(self: mtf.libs.mtf_pybinder.pcpp.IFilterableDevice) bool
Clear the filter currently set on the device
- Returns:
bool: True if filter was removed successfully or if no filter was set, false otherwise
- close(self: mtf.libs.mtf_pybinder.pcpp.IDevice) None
Close the device
- get_file_name(self: mtf.libs.mtf_pybinder.pcpp.IFileDevice) str
Get the name of the file
- Returns:
str: The name of the file
- get_file_size(self: mtf.libs.mtf_pybinder.pcpp.IFileReaderDevice) int
Get the file size in bytes
- Returns:
unsigned int: The file size in bytes
- get_next_packet(self: mtf.libs.mtf_pybinder.pcpp.IFileReaderDevice, raw_packet: mtf.libs.mtf_pybinder.pcpp.RawPacket) bool
- Args:
raw_packet (pcpp.RawPacket)
- Returns:
bool
- static get_pcap_lib_version_info() str
A static method for retrieving pcap lib (libpcap/WinPcap/etc.) version information. This method is actually a wrapper for [pcap_lib_version()](https://www.tcpdump.org/manpages/pcap_lib_version.3pcap.html)
- Returns:
str: A string containing the pcap lib version information
- static get_reader(file_name: str) mtf.libs.mtf_pybinder.pcpp.IFileReaderDevice
A static method that creates an instance of the reader best fit to read the file. It decides by the file extension: for .pcapng files it returns an instance of PcapNgFileReaderDevice and for all other extensions it returns an instance of PcapFileReaderDevice
- Args:
file_name (str): The file name to open
- Returns:
pcpp.IFileReaderDevice: An instance of the reader to read the file. Notice you should free this instance when done using it
- get_statistics(self: mtf.libs.mtf_pybinder.pcpp.IPcapDevice, stats: pcpp::IPcapDevice::PcapStats) None
Get statistics from the device
- Args:
stats (pcpp.IPcapDevice.PcapStats): An object containing the stats
- is_opened(self: mtf.libs.mtf_pybinder.pcpp.IDevice) bool
- Returns:
bool: True if the file is opened, false otherwise
- static match_packet_with_filter(filter: mtf.libs.mtf_pybinder.pcpp.GeneralFilter, raw_packet: mtf.libs.mtf_pybinder.pcpp.RawPacket) bool
Match a raw packet with a given BPF filter. Notice this method is static which means you don’t need any device instance in order to perform this match
- Args:
filter (pcpp.GeneralFilter): A filter class to test against raw_packet (pcpp.RawPacket): A pointer to the raw packet to match the filter with
- Returns:
bool: True if raw packet matches the filter or false otherwise
- open(self: mtf.libs.mtf_pybinder.pcpp.IDevice) bool
Open the device
- Returns:
bool: True if device was opened successfully, false otherwise
- set_filter(*args, **kwargs)
Overloaded function.
set_filter(self: mtf.libs.mtf_pybinder.pcpp.IFilterableDevice, filter: mtf.libs.mtf_pybinder.pcpp.GeneralFilter) -> bool
Set a filter for the device. When implemented by the device, only packets that match the filter will be received
- Args:
filter (pcpp.GeneralFilter): The filter to be set in PcapPlusPlus’ GeneralFilter format
- Returns:
bool: True if filter set successfully, false otherwise
set_filter(self: mtf.libs.mtf_pybinder.pcpp.IFilterableDevice, filter_as_string: str) -> bool
Set a filter for the device. When implemented by the device, only packets that match the filter will be received
- Args:
filter_as_string (str): The filter to be set in Berkeley Packet Filter (BPF) syntax (http://biot.com/capstats/bpf.html)
- Returns:
bool: True if filter set successfully, false otherwise
- class mtf.libs.mtf_pybinder.pcpp.IFileWriterDevice
An abstract class (cannot be instantiated, has a private c’tor) which is the parent class for file writer devices
- class PcapStats
A container for pcap device statistics
- __init__(self: mtf.libs.mtf_pybinder.pcpp.IPcapDevice.PcapStats) None
- __new__(**kwargs)
- property packets_drop
- property packets_drop_by_interface
- property packets_recv
- __init__(*args, **kwargs)
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IFileWriterDevice, : mtf.libs.mtf_pybinder.pcpp.IFileWriterDevice) mtf.libs.mtf_pybinder.pcpp.IFileWriterDevice
- Returns:
pcpp.IFileWriterDevice
- clear_filter(self: mtf.libs.mtf_pybinder.pcpp.IFilterableDevice) bool
Clear the filter currently set on the device
- Returns:
bool: True if filter was removed successfully or if no filter was set, false otherwise
- close(self: mtf.libs.mtf_pybinder.pcpp.IDevice) None
Close the device
- get_file_name(self: mtf.libs.mtf_pybinder.pcpp.IFileDevice) str
Get the name of the file
- Returns:
str: The name of the file
- static get_pcap_lib_version_info() str
A static method for retrieving pcap lib (libpcap/WinPcap/etc.) version information. This method is actually a wrapper for [pcap_lib_version()](https://www.tcpdump.org/manpages/pcap_lib_version.3pcap.html)
- Returns:
str: A string containing the pcap lib version information
- get_statistics(self: mtf.libs.mtf_pybinder.pcpp.IPcapDevice, stats: pcpp::IPcapDevice::PcapStats) None
Get statistics from the device
- Args:
stats (pcpp.IPcapDevice.PcapStats): An object containing the stats
- is_opened(self: mtf.libs.mtf_pybinder.pcpp.IDevice) bool
- Returns:
bool: True if the file is opened, false otherwise
- static match_packet_with_filter(filter: mtf.libs.mtf_pybinder.pcpp.GeneralFilter, raw_packet: mtf.libs.mtf_pybinder.pcpp.RawPacket) bool
Match a raw packet with a given BPF filter. Notice this method is static which means you don’t need any device instance in order to perform this match
- Args:
filter (pcpp.GeneralFilter): A filter class to test against raw_packet (pcpp.RawPacket): A pointer to the raw packet to match the filter with
- Returns:
bool: True if raw packet matches the filter or false otherwise
- open(*args, **kwargs)
Overloaded function.
open(self: mtf.libs.mtf_pybinder.pcpp.IFileWriterDevice) -> bool
- Returns:
bool
open(self: mtf.libs.mtf_pybinder.pcpp.IFileWriterDevice, append_mode: bool) -> bool
- Args:
append_mode (bool)
- Returns:
bool
- set_filter(*args, **kwargs)
Overloaded function.
set_filter(self: mtf.libs.mtf_pybinder.pcpp.IFilterableDevice, filter: mtf.libs.mtf_pybinder.pcpp.GeneralFilter) -> bool
Set a filter for the device. When implemented by the device, only packets that match the filter will be received
- Args:
filter (pcpp.GeneralFilter): The filter to be set in PcapPlusPlus’ GeneralFilter format
- Returns:
bool: True if filter set successfully, false otherwise
set_filter(self: mtf.libs.mtf_pybinder.pcpp.IFilterableDevice, filter_as_string: str) -> bool
Set a filter for the device. When implemented by the device, only packets that match the filter will be received
- Args:
filter_as_string (str): The filter to be set in Berkeley Packet Filter (BPF) syntax (http://biot.com/capstats/bpf.html)
- Returns:
bool: True if filter set successfully, false otherwise
- write_packet(self: mtf.libs.mtf_pybinder.pcpp.IFileWriterDevice, packet: mtf.libs.mtf_pybinder.pcpp.RawPacket) bool
- Args:
packet (pcpp.RawPacket)
- Returns:
bool
- class mtf.libs.mtf_pybinder.pcpp.IFilterWithDirection
An abstract class that is the base class for all filters which contain a direction (source or destination). This class cannot be instantiated<BR> For deeper understanding of the filter concept please refer to PcapFilter.h
- __init__(*args, **kwargs)
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IFilterWithDirection, : mtf.libs.mtf_pybinder.pcpp.IFilterWithDirection) mtf.libs.mtf_pybinder.pcpp.IFilterWithDirection
- Returns:
pcpp.IFilterWithDirection
- match_packet_with_filter(self: mtf.libs.mtf_pybinder.pcpp.GeneralFilter, raw_packet: mtf.libs.mtf_pybinder.pcpp.RawPacket) bool
Match a raw packet with a given BPF filter.
A pointer to the raw packet to match the BPF filter with True if a raw packet matches the BPF filter or false otherwise
- Args:
raw_packet (str)
- Returns:
bool
- parse_to_string(self: mtf.libs.mtf_pybinder.pcpp.GeneralFilter, result: str) None
A method that parses the class instance into BPF string format
An empty string that the parsing will be written into. If the string isn’t empty, its content will be overridden
- Args:
result (str)
- Returns:
void
- set_direction(self: mtf.libs.mtf_pybinder.pcpp.IFilterWithDirection, dir: mtf.libs.mtf_pybinder.pcpp.Direction) None
Set the direction for the filter (source or destination)
The direction
- Args:
dir (str)
- Returns:
void
- class mtf.libs.mtf_pybinder.pcpp.IFilterWithOperator
An abstract class that is the base class for all filters which contain an operator (e.g X equals Y; A is greater than B; Z1 not equals Z2, etc.). This class cannot be instantiated<BR> For deeper understanding of the filter concept please refer to PcapFilter.h
- __init__(*args, **kwargs)
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IFilterWithOperator, : mtf.libs.mtf_pybinder.pcpp.IFilterWithOperator) mtf.libs.mtf_pybinder.pcpp.IFilterWithOperator
- Returns:
pcpp.IFilterWithOperator
- match_packet_with_filter(self: mtf.libs.mtf_pybinder.pcpp.GeneralFilter, raw_packet: mtf.libs.mtf_pybinder.pcpp.RawPacket) bool
Match a raw packet with a given BPF filter.
A pointer to the raw packet to match the BPF filter with True if a raw packet matches the BPF filter or false otherwise
- Args:
raw_packet (str)
- Returns:
bool
- parse_to_string(self: mtf.libs.mtf_pybinder.pcpp.GeneralFilter, result: str) None
A method that parses the class instance into BPF string format
An empty string that the parsing will be written into. If the string isn’t empty, its content will be overridden
- Args:
result (str)
- Returns:
void
- set_operator(self: mtf.libs.mtf_pybinder.pcpp.IFilterWithOperator, op: mtf.libs.mtf_pybinder.pcpp.FilterOperator) None
Set the operator for the filter
The operator to set
- Args:
op (str)
- Returns:
void
- class mtf.libs.mtf_pybinder.pcpp.IFilterableDevice
An abstract interface representing all devices that have BPF (Berkeley Packet Filter) filtering capabilities, meaning devices that can filter packets based on the BPF filtering syntax. This is an abstract class that cannot be instantiated
- __init__(*args, **kwargs)
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IFilterableDevice, : mtf.libs.mtf_pybinder.pcpp.IFilterableDevice) mtf.libs.mtf_pybinder.pcpp.IFilterableDevice
- Returns:
pcpp.IFilterableDevice
- clear_filter(self: mtf.libs.mtf_pybinder.pcpp.IFilterableDevice) bool
Clear the filter currently set on the device
- Returns:
bool: True if filter was removed successfully or if no filter was set, false otherwise
- set_filter(*args, **kwargs)
Overloaded function.
set_filter(self: mtf.libs.mtf_pybinder.pcpp.IFilterableDevice, filter: mtf.libs.mtf_pybinder.pcpp.GeneralFilter) -> bool
Set a filter for the device. When implemented by the device, only packets that match the filter will be received
- Args:
filter (pcpp.GeneralFilter): The filter to be set in PcapPlusPlus’ GeneralFilter format
- Returns:
bool: True if filter set successfully, false otherwise
set_filter(self: mtf.libs.mtf_pybinder.pcpp.IFilterableDevice, filter_as_string: str) -> bool
Set a filter for the device. When implemented by the device, only packets that match the filter will be received
- Args:
filter_as_string (str): The filter to be set in Berkeley Packet Filter (BPF) syntax (http://biot.com/capstats/bpf.html)
- Returns:
bool: True if filter set successfully, false otherwise
- class mtf.libs.mtf_pybinder.pcpp.IKEv2AuthenticationPayload
- class AuthMethod
IKEv2 Authentication Methods
Members:
RSA_DIGITAL_SIGNATURE
SHARED_KEY_MSG_INTEGRITY_CODE
DSS_DIGITAL_SIGNATURE
ECDSA_SHA_256
ECDSA_SHA_384
ECDSA_SHA_521
GENERIC_SECURE_PASSWORD
NULL_AUTH
DIGITAL_SIGNATURE
- DIGITAL_SIGNATURE
- DSS_DIGITAL_SIGNATURE
- ECDSA_SHA_256
- ECDSA_SHA_384
- ECDSA_SHA_521
- GENERIC_SECURE_PASSWORD
- NULL_AUTH
- RSA_DIGITAL_SIGNATURE
- SHARED_KEY_MSG_INTEGRITY_CODE
- __init__(self: mtf.libs.mtf_pybinder.pcpp.IKEv2AuthenticationPayload.AuthMethod, value: int) None
- __new__(**kwargs)
- property name
- property value
- DIGITAL_SIGNATURE
- DSS_DIGITAL_SIGNATURE
- ECDSA_SHA_256
- ECDSA_SHA_384
- ECDSA_SHA_521
- GENERIC_SECURE_PASSWORD
- NULL_AUTH
- RSA_DIGITAL_SIGNATURE
- SHARED_KEY_MSG_INTEGRITY_CODE
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IKEv2AuthenticationPayload, arg0: mtf.libs.mtf_pybinder.pcpp.IKEv2AuthenticationPayload) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IKEv2AuthenticationPayload, arg0: mtf.libs.mtf_pybinder.pcpp.IKEv2AuthenticationPayload) -> None
- __new__(**kwargs)
- property auth_data
The authentication data
- property auth_method
The method of authentication
- property is_critical
The status of the Critical bit
- property next_payload
The type of the next payload
- property payload_length
The length of the current payload
- property payload_type
The type of this payload
- property raw_data
Payload raw data
- class mtf.libs.mtf_pybinder.pcpp.IKEv2CertificatePayload
- ARL
- CRL
- class CertEncoding
IKEv2 Certificate Encodings
Members:
PKCS7_WRAPPED_X509
PGP
DNS_SIGNED_KEY
X509_CERT_SIGNATURE
KERBEROS_TOKEN
CRL
ARL
SPKI_CERT
X509_CERT_ATTRIBUTE
RAW_RSA_KEY
HASH_URL_X509_CERT
HASH_URL_X509_BUNDLE
OCSP_CONTENT
RAW_PUBLIC_KEY
- ARL
- CRL
- DNS_SIGNED_KEY
- HASH_URL_X509_BUNDLE
- HASH_URL_X509_CERT
- KERBEROS_TOKEN
- OCSP_CONTENT
- PGP
- PKCS7_WRAPPED_X509
- RAW_PUBLIC_KEY
- RAW_RSA_KEY
- SPKI_CERT
- X509_CERT_ATTRIBUTE
- X509_CERT_SIGNATURE
- __init__(self: mtf.libs.mtf_pybinder.pcpp.IKEv2CertificatePayload.CertEncoding, value: int) None
- __new__(**kwargs)
- property name
- property value
- DNS_SIGNED_KEY
- HASH_URL_X509_BUNDLE
- HASH_URL_X509_CERT
- KERBEROS_TOKEN
- OCSP_CONTENT
- PGP
- PKCS7_WRAPPED_X509
- RAW_PUBLIC_KEY
- RAW_RSA_KEY
- SPKI_CERT
- X509_CERT_ATTRIBUTE
- X509_CERT_SIGNATURE
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IKEv2CertificatePayload, arg0: mtf.libs.mtf_pybinder.pcpp.IKEv2CertificatePayload) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IKEv2CertificatePayload, arg0: mtf.libs.mtf_pybinder.pcpp.IKEv2CertificatePayload) -> None
- __new__(**kwargs)
- property cert_encoding
The type of certificate
- property certificate_data
The certificate data
- property is_critical
The status of the Critical bit
- property next_payload
The type of the next payload
- property payload_length
The length of the current payload
- property payload_type
The type of this payload
- property raw_data
Payload raw data
- class mtf.libs.mtf_pybinder.pcpp.IKEv2CertificateRequestPayload
- ARL
- CRL
- class CertEncoding
IKEv2 Certificate Encodings
Members:
PKCS7_WRAPPED_X509
PGP
DNS_SIGNED_KEY
X509_CERT_SIGNATURE
KERBEROS_TOKEN
CRL
ARL
SPKI_CERT
X509_CERT_ATTRIBUTE
RAW_RSA_KEY
HASH_URL_X509_CERT
HASH_URL_X509_BUNDLE
OCSP_CONTENT
RAW_PUBLIC_KEY
- ARL
- CRL
- DNS_SIGNED_KEY
- HASH_URL_X509_BUNDLE
- HASH_URL_X509_CERT
- KERBEROS_TOKEN
- OCSP_CONTENT
- PGP
- PKCS7_WRAPPED_X509
- RAW_PUBLIC_KEY
- RAW_RSA_KEY
- SPKI_CERT
- X509_CERT_ATTRIBUTE
- X509_CERT_SIGNATURE
- __init__(self: mtf.libs.mtf_pybinder.pcpp.IKEv2CertificateRequestPayload.CertEncoding, value: int) None
- __new__(**kwargs)
- property name
- property value
- DNS_SIGNED_KEY
- HASH_URL_X509_BUNDLE
- HASH_URL_X509_CERT
- KERBEROS_TOKEN
- OCSP_CONTENT
- PGP
- PKCS7_WRAPPED_X509
- RAW_PUBLIC_KEY
- RAW_RSA_KEY
- SPKI_CERT
- X509_CERT_ATTRIBUTE
- X509_CERT_SIGNATURE
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IKEv2CertificateRequestPayload, arg0: mtf.libs.mtf_pybinder.pcpp.IKEv2CertificateRequestPayload) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IKEv2CertificateRequestPayload, arg0: mtf.libs.mtf_pybinder.pcpp.IKEv2CertificateRequestPayload) -> None
- __new__(**kwargs)
- property cert_encoding
The type of certificate
- property certificate_data
The certificate data
- property is_critical
The status of the Critical bit
- property next_payload
The type of the next payload
- property payload_length
The length of the current payload
- property payload_type
The type of this payload
- property raw_data
Payload raw data
- class mtf.libs.mtf_pybinder.pcpp.IKEv2ConfigurationPayload
- CFG_ACK
- CFG_REPLY
- CFG_REQUEST
- CFG_SET
- class CfgType
IKEv2 Configuration Types
Members:
CFG_REQUEST
CFG_REPLY
CFG_SET
CFG_ACK
- CFG_ACK
- CFG_REPLY
- CFG_REQUEST
- CFG_SET
- __init__(self: mtf.libs.mtf_pybinder.pcpp.IKEv2ConfigurationPayload.CfgType, value: int) None
- __new__(**kwargs)
- property name
- property value
- class ConfigurationAttribute
- __init__(self: mtf.libs.mtf_pybinder.pcpp.IKEv2ConfigurationPayload.ConfigurationAttribute, data: int) None
- __new__(**kwargs)
- property attribute_type
The Configuration Attribute unique identifier
- property length
The length in octets of the value
- property value
The Configuration Attribute value
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IKEv2ConfigurationPayload, data: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IKEv2ConfigurationPayload, arg0: mtf.libs.mtf_pybinder.pcpp.IKEv2ConfigurationPayload) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IKEv2ConfigurationPayload, arg0: mtf.libs.mtf_pybinder.pcpp.IKEv2ConfigurationPayload) -> None
- __new__(**kwargs)
- property cfg_type
The type of exchange represented by the Configuration Attributes
- get_attributes(self: mtf.libs.mtf_pybinder.pcpp.IKEv2ConfigurationPayload) list[pcpp::IKEv2ConfigurationPayload::ConfigurationAttribute]
The list of Configuration Attributes
- Returns:
list[pcpp.IKEv2ConfigurationPayload.ConfigurationAttribute]
- property is_critical
The status of the Critical bit
- property next_payload
The type of the next payload
- property payload_length
The length of the current payload
- property payload_type
The type of this payload
- property raw_data
Payload raw data
- class mtf.libs.mtf_pybinder.pcpp.IKEv2Decryption
Helper class that handles IPsec IKEv2 layer decryption and defragmentation
- class KeyInfo
Represents IKEv2 key information using Wireshark ikev2_decryption_table format
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IKEv2Decryption.KeyInfo, arg0: mtf.libs.mtf_pybinder.pcpp.IKEv2Decryption.KeyInfo) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IKEv2Decryption.KeyInfo) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IKEv2Decryption.KeyInfo, : mtf.libs.mtf_pybinder.pcpp.IKEv2Decryption.KeyInfo) mtf.libs.mtf_pybinder.pcpp.IKEv2Decryption.KeyInfo
- Returns:
pcpp.IKEv2Decryption.KeyInfo
- property encryption_alg
- property integrity_alg
- property sk_ai
- property sk_ar
- property sk_ei
- property sk_er
- property spi_i
- property spi_r
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IKEv2Decryption) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IKEv2Decryption, arg0: mtf.libs.mtf_pybinder.pcpp.IKEv2Decryption) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IKEv2Decryption, : mtf.libs.mtf_pybinder.pcpp.IKEv2Decryption) mtf.libs.mtf_pybinder.pcpp.IKEv2Decryption
- Returns:
pcpp.IKEv2Decryption
- set_keys(self: mtf.libs.mtf_pybinder.pcpp.IKEv2Decryption, keys: list[pcpp::IKEv2Decryption::KeyInfo]) None
Set key information to use in the decryption process
- Args:
keys (list[pcpp.IKEv2Decryption.KeyInfo]): Structure containing key information
- try_decrypt(self: mtf.libs.mtf_pybinder.pcpp.IKEv2Decryption, packet: mtf.libs.mtf_pybinder.pcpp.Packet) mtf.libs.mtf_pybinder.pcpp.Packet
Decrypt and defragment an IKEv2 Layer if it contains an encrypted payload (SK or SKF)
- Args:
packet (bytes): Pointer to the packet containing an IKEv2 Layer
- Returns:
pcpp.IKEv2GenericPayload: Decrypted (and defragmented, if needed) packet if successful, null pointer otherwise
- class mtf.libs.mtf_pybinder.pcpp.IKEv2DeletePayload
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IKEv2DeletePayload, arg0: mtf.libs.mtf_pybinder.pcpp.IKEv2DeletePayload) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IKEv2DeletePayload, arg0: mtf.libs.mtf_pybinder.pcpp.IKEv2DeletePayload) -> None
- __new__(**kwargs)
- property is_critical
The status of the Critical bit
- property next_payload
The type of the next payload
- property num_of_spis
The number of SPIs
- property payload_length
The length of the current payload
- property payload_type
The type of this payload
- property protocol_id
The protocol identifier
- property raw_data
Payload raw data
- property spi_size
The length of the SPI
- property spis
The Security Parameter Index(es) data
- class mtf.libs.mtf_pybinder.pcpp.IKEv2EAPPayload
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IKEv2EAPPayload, data: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IKEv2EAPPayload, arg0: mtf.libs.mtf_pybinder.pcpp.IKEv2EAPPayload) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IKEv2EAPPayload, arg0: mtf.libs.mtf_pybinder.pcpp.IKEv2EAPPayload) -> None
- __new__(**kwargs)
- property code
The type of EAP message
- property identifier
The EAP message identifier
- property is_critical
The status of the Critical bit
- property length
The length of the EAP message
- property next_payload
The type of the next payload
- property payload_length
The length of the current payload
- property payload_type
The type of this payload
- property raw_data
Payload raw data
- property type
The type of the data being requested
- property type_data
The EAP variable length data
- class mtf.libs.mtf_pybinder.pcpp.IKEv2EncryptedFragmentPayload
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IKEv2EncryptedFragmentPayload, data: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IKEv2EncryptedFragmentPayload, arg0: mtf.libs.mtf_pybinder.pcpp.IKEv2EncryptedFragmentPayload) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IKEv2EncryptedFragmentPayload, arg0: mtf.libs.mtf_pybinder.pcpp.IKEv2EncryptedFragmentPayload) -> None
- __new__(**kwargs)
- property fragment_number
The current Fragment message number
- property is_critical
The status of the Critical bit
- property next_payload
The type of the next payload
- property payload_length
The length of the current payload
- property payload_type
The type of this payload
- property raw_data
Payload raw data
- property total_fragments
The number of Fragment messages
- class mtf.libs.mtf_pybinder.pcpp.IKEv2EncryptedPayload
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IKEv2EncryptedPayload, arg0: mtf.libs.mtf_pybinder.pcpp.IKEv2EncryptedPayload) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IKEv2EncryptedPayload, arg0: mtf.libs.mtf_pybinder.pcpp.IKEv2EncryptedPayload) -> None
- __new__(**kwargs)
- property is_critical
The status of the Critical bit
- property next_payload
The type of the next payload
- property payload_length
The length of the current payload
- property payload_type
The type of this payload
- property raw_data
Payload raw data
- class mtf.libs.mtf_pybinder.pcpp.IKEv2ExchangeType
IKEv2 exchange types
Members:
IKE_SA_INIT
IKE_AUTH
CREATE_CHILD_SA
INFORMATIONAL
- CREATE_CHILD_SA
- IKE_AUTH
- IKE_SA_INIT
- INFORMATIONAL
- __init__(self: mtf.libs.mtf_pybinder.pcpp.IKEv2ExchangeType, value: int) None
- __new__(**kwargs)
- property name
- property value
- class mtf.libs.mtf_pybinder.pcpp.IKEv2GenericPayload
Represents an IPsec IKEv2 generic payload header
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IKEv2GenericPayload, arg0: mtf.libs.mtf_pybinder.pcpp.IKEv2GenericPayload) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IKEv2GenericPayload, arg0: mtf.libs.mtf_pybinder.pcpp.IKEv2GenericPayload) -> None
- __new__(**kwargs)
- property is_critical
The status of the Critical bit
- property next_payload
The type of the next payload
- property payload_length
The length of the current payload
- property payload_type
The type of this payload
- property raw_data
Payload raw data
- class mtf.libs.mtf_pybinder.pcpp.IKEv2IdentificationPayload
- ID_DER_ASN1_DN
- ID_DER_ASN1_GN
- ID_FC_NAME
- ID_FQDN
- ID_IPV4_ADDR
- ID_IPV6_ADDR
- ID_KEY_ID
- ID_NULL
- ID_RFC822_ADDR
- class IdType
IKEv2 Identification Payload ID types
Members:
ID_IPV4_ADDR
ID_FQDN
ID_RFC822_ADDR
ID_IPV6_ADDR
ID_DER_ASN1_DN
ID_DER_ASN1_GN
ID_KEY_ID
ID_FC_NAME
ID_NULL
- ID_DER_ASN1_DN
- ID_DER_ASN1_GN
- ID_FC_NAME
- ID_FQDN
- ID_IPV4_ADDR
- ID_IPV6_ADDR
- ID_KEY_ID
- ID_NULL
- ID_RFC822_ADDR
- __init__(self: mtf.libs.mtf_pybinder.pcpp.IKEv2IdentificationPayload.IdType, value: int) None
- __new__(**kwargs)
- property name
- property value
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IKEv2IdentificationPayload, arg0: mtf.libs.mtf_pybinder.pcpp.IKEv2IdentificationPayload) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IKEv2IdentificationPayload, arg0: mtf.libs.mtf_pybinder.pcpp.IKEv2IdentificationPayload) -> None
- __new__(**kwargs)
- property id_type
The type of identification
- property identification_data
The identification value
- property is_critical
The status of the Critical bit
- property next_payload
The type of the next payload
- property payload_length
The length of the current payload
- property payload_type
The type of this payload
- property raw_data
Payload raw data
- class mtf.libs.mtf_pybinder.pcpp.IKEv2KeyExchangePayload
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IKEv2KeyExchangePayload, arg0: mtf.libs.mtf_pybinder.pcpp.IKEv2KeyExchangePayload) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IKEv2KeyExchangePayload, arg0: mtf.libs.mtf_pybinder.pcpp.IKEv2KeyExchangePayload) -> None
- __new__(**kwargs)
- property dh_group_number
The Diffie-Hellman Group Number
- property is_critical
The status of the Critical bit
- property key_exchange_data
The Diffie-Hellman public value
- property next_payload
The type of the next payload
- property payload_length
The length of the current payload
- property payload_type
The type of this payload
- property raw_data
Payload raw data
- class mtf.libs.mtf_pybinder.pcpp.IKEv2Layer
Represents an IPsec IKEv2 layer
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IKEv2Layer, arg0: mtf.libs.mtf_pybinder.pcpp.IKEv2Layer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IKEv2Layer, arg0: mtf.libs.mtf_pybinder.pcpp.IKEv2Layer) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IKEv2Layer, : mtf.libs.mtf_pybinder.pcpp.IKEv2Layer) mtf.libs.mtf_pybinder.pcpp.IKEv2Layer
- Returns:
pcpp.IKEv2Layer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- property exchange_type
The type of the exchange being used
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_payload_of_type(self: mtf.libs.mtf_pybinder.pcpp.IKEv2Layer, type: mtf.libs.mtf_pybinder.pcpp.IKEv2PayloadType, from_value: mtf.libs.mtf_pybinder.pcpp.IKEv2GenericPayload = None) mtf.libs.mtf_pybinder.pcpp.IKEv2GenericPayload
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- property initiator_flag
The Initiator bit value inside the header flags
- property initiator_spi
The Initiator Security Parameters Index (SPI) field value
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- static is_data_valid(data: int, data_len: int) bool
A static method that validates the input data
- Args:
data (bytes): The pointer to the beginning of a byte stream of a IKEv2 layer data_len (unsigned int): The length of byte stream
- Returns:
bool: True if the data is valid and can represent an IKEv2 layer
- static is_ikev2_port(port: int) bool
A static method that checks whether a port is considered as a IKEv2 port
- Args:
port (unsigned int): The port number to check
- Returns:
bool: True if this is a IKEv2 port number, false otherwise
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property length
The message length
- property major_version
The major version of the IKE protocol
- property message_id
The message identifier
- property minor_version
The minor version of the IKE protocol
- property next_payload
The type of the next payload
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- parse_payloads(self: mtf.libs.mtf_pybinder.pcpp.IKEv2Layer, data: int, data_len: int) None
Parse and store the payloads from raw data
- Args:
data (bytes): A pointer to the raw data data_len (unsigned int): Size of the data in bytes
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property responder_spi
The Responder Security Parameters Index (SPI) field value
- property response_flag
The Response bit value inside the header flags
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- property version_flag
The Version bit value inside the header flags
- class mtf.libs.mtf_pybinder.pcpp.IKEv2NoncePayload
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IKEv2NoncePayload, arg0: mtf.libs.mtf_pybinder.pcpp.IKEv2NoncePayload) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IKEv2NoncePayload, arg0: mtf.libs.mtf_pybinder.pcpp.IKEv2NoncePayload) -> None
- __new__(**kwargs)
- property is_critical
The status of the Critical bit
- property next_payload
The type of the next payload
- property nonce_data
The nonce data
- property payload_length
The length of the current payload
- property payload_type
The type of this payload
- property raw_data
Payload raw data
- class mtf.libs.mtf_pybinder.pcpp.IKEv2NotifyPayload
- ADDITIONAL_IP4_ADDRESS
- ADDITIONAL_IP6_ADDRESS
- ADDITIONAL_KEY_EXCHANGE
- ADDITIONAL_TS_POSSIBLE
- ANOTHER_AUTH_FOLLOWS
- AUTHENTICATION_FAILED
- AUTHORIZATION_FAILED
- AUTH_LIFETIME
- CHILDLESS_IKEV2_SUPPORTED
- CHILD_SA_NOT_FOUND
- CLONE_IKE_SA
- CLONE_IKE_SA_SUPPORTED
- COOKIE
- COOKIE2
- EAP_ONLY_AUTHENTICATION
- ERX_SUPPORTED
- ESP_TFC_PADDING_NOT_SUPPORTED
- FAILED_CP_REQUIRED
- HTTP_CERT_LOOKUP_SUPPORTED
- IFOM_CAPABILITY
- IKEV2_FRAGMENTATION_SUPPORTED
- IKEV2_MESSAGE_ID_SYNC
- IKEV2_MESSAGE_ID_SYNC_SUPPORTED
- INITIAL_CONTACT
- INTERMEDIATE_EXCHANGE_SUPPORTED
- INTERNAL_ADDRESS_FAILURE
- INVALID_GROUP_ID
- INVALID_IKE_SPI
- INVALID_KE_PAYLOAD
- INVALID_MAJOR_VERSION
- INVALID_MESSAGE_ID
- INVALID_SELECTORS
- INVALID_SPI
- INVALID_SYNTAX
- IP4_ALLOWED
- IP6_ALLOWED
- IPCOMP_SUPPORTED
- IPSEC_REPLAY_COUNTER_SYNC
- IPSEC_REPLAY_COUNTER_SYNC_SUPPORTED
- LINK_ID
- MOBIKE_SUPPORTED
- MULTIPLE_AUTH_SUPPORTED
- NAT_DETECTION_DESTINATION_IP
- NAT_DETECTION_SOURCE_IP
- NON_FIRST_FRAGMENTS_ALSO
- NO_ADDITIONAL_ADDRESSES
- NO_ADDITIONAL_SAS
- NO_NATS_ALLOWED
- NO_PPK_AUTH
- NO_PROPOSAL_CHOSEN
- class NotifyMessageType
IKEv2 Notify Message Types
Members:
UNSUPPORTED_CRITICAL_PAYLOAD
INVALID_IKE_SPI
INVALID_MAJOR_VERSION
INVALID_SYNTAX
INVALID_MESSAGE_ID
INVALID_SPI
NO_PROPOSAL_CHOSEN
INVALID_KE_PAYLOAD
AUTHENTICATION_FAILED
SINGLE_PAIR_REQUIRED
NO_ADDITIONAL_SAS
INTERNAL_ADDRESS_FAILURE
FAILED_CP_REQUIRED
TS_UNACCEPTABLE
INVALID_SELECTORS
UNACCEPTABLE_ADDRESSES
UNEXPECTED_NAT_DETECTED
USE_ASSIGNED_HoA
TEMPORARY_FAILURE
CHILD_SA_NOT_FOUND
INVALID_GROUP_ID
AUTHORIZATION_FAILED
STATE_NOT_FOUND
INITIAL_CONTACT
SET_WINDOW_SIZE
ADDITIONAL_TS_POSSIBLE
IPCOMP_SUPPORTED
NAT_DETECTION_SOURCE_IP
NAT_DETECTION_DESTINATION_IP
COOKIE
USE_TRANSPORT_MODE
HTTP_CERT_LOOKUP_SUPPORTED
REKEY_SA
ESP_TFC_PADDING_NOT_SUPPORTED
NON_FIRST_FRAGMENTS_ALSO
MOBIKE_SUPPORTED
ADDITIONAL_IP4_ADDRESS
ADDITIONAL_IP6_ADDRESS
NO_ADDITIONAL_ADDRESSES
UPDATE_SA_ADDRESSES
COOKIE2
NO_NATS_ALLOWED
AUTH_LIFETIME
MULTIPLE_AUTH_SUPPORTED
ANOTHER_AUTH_FOLLOWS
REDIRECT_SUPPORTED
REDIRECT
REDIRECTED_FROM
TICKET_LT_OPAQUE
TICKET_REQUEST
TICKET_ACK
TICKET_NACK
TICKET_OPAQUE
LINK_ID
USE_WESP_MODE
ROHC_SUPPORTED
EAP_ONLY_AUTHENTICATION
CHILDLESS_IKEV2_SUPPORTED
QUICK_CRASH_DETECTION
IKEV2_MESSAGE_ID_SYNC_SUPPORTED
IPSEC_REPLAY_COUNTER_SYNC_SUPPORTED
IKEV2_MESSAGE_ID_SYNC
IPSEC_REPLAY_COUNTER_SYNC
SECURE_PASSWORD_METHODS
PSK_PERSIST
PSK_CONFIRM
ERX_SUPPORTED
IFOM_CAPABILITY
SENDER_REQUEST_ID
IKEV2_FRAGMENTATION_SUPPORTED
SIGNATURE_HASH_ALGORITHMS
CLONE_IKE_SA_SUPPORTED
CLONE_IKE_SA
PUZZLE
USE_PPK
PPK_IDENTITY
NO_PPK_AUTH
INTERMEDIATE_EXCHANGE_SUPPORTED
IP4_ALLOWED
IP6_ALLOWED
ADDITIONAL_KEY_EXCHANGE
USE_AGGFRAG
- ADDITIONAL_IP4_ADDRESS
- ADDITIONAL_IP6_ADDRESS
- ADDITIONAL_KEY_EXCHANGE
- ADDITIONAL_TS_POSSIBLE
- ANOTHER_AUTH_FOLLOWS
- AUTHENTICATION_FAILED
- AUTHORIZATION_FAILED
- AUTH_LIFETIME
- CHILDLESS_IKEV2_SUPPORTED
- CHILD_SA_NOT_FOUND
- CLONE_IKE_SA
- CLONE_IKE_SA_SUPPORTED
- COOKIE
- COOKIE2
- EAP_ONLY_AUTHENTICATION
- ERX_SUPPORTED
- ESP_TFC_PADDING_NOT_SUPPORTED
- FAILED_CP_REQUIRED
- HTTP_CERT_LOOKUP_SUPPORTED
- IFOM_CAPABILITY
- IKEV2_FRAGMENTATION_SUPPORTED
- IKEV2_MESSAGE_ID_SYNC
- IKEV2_MESSAGE_ID_SYNC_SUPPORTED
- INITIAL_CONTACT
- INTERMEDIATE_EXCHANGE_SUPPORTED
- INTERNAL_ADDRESS_FAILURE
- INVALID_GROUP_ID
- INVALID_IKE_SPI
- INVALID_KE_PAYLOAD
- INVALID_MAJOR_VERSION
- INVALID_MESSAGE_ID
- INVALID_SELECTORS
- INVALID_SPI
- INVALID_SYNTAX
- IP4_ALLOWED
- IP6_ALLOWED
- IPCOMP_SUPPORTED
- IPSEC_REPLAY_COUNTER_SYNC
- IPSEC_REPLAY_COUNTER_SYNC_SUPPORTED
- LINK_ID
- MOBIKE_SUPPORTED
- MULTIPLE_AUTH_SUPPORTED
- NAT_DETECTION_DESTINATION_IP
- NAT_DETECTION_SOURCE_IP
- NON_FIRST_FRAGMENTS_ALSO
- NO_ADDITIONAL_ADDRESSES
- NO_ADDITIONAL_SAS
- NO_NATS_ALLOWED
- NO_PPK_AUTH
- NO_PROPOSAL_CHOSEN
- PPK_IDENTITY
- PSK_CONFIRM
- PSK_PERSIST
- PUZZLE
- QUICK_CRASH_DETECTION
- REDIRECT
- REDIRECTED_FROM
- REDIRECT_SUPPORTED
- REKEY_SA
- ROHC_SUPPORTED
- SECURE_PASSWORD_METHODS
- SENDER_REQUEST_ID
- SET_WINDOW_SIZE
- SIGNATURE_HASH_ALGORITHMS
- SINGLE_PAIR_REQUIRED
- STATE_NOT_FOUND
- TEMPORARY_FAILURE
- TICKET_ACK
- TICKET_LT_OPAQUE
- TICKET_NACK
- TICKET_OPAQUE
- TICKET_REQUEST
- TS_UNACCEPTABLE
- UNACCEPTABLE_ADDRESSES
- UNEXPECTED_NAT_DETECTED
- UNSUPPORTED_CRITICAL_PAYLOAD
- UPDATE_SA_ADDRESSES
- USE_AGGFRAG
- USE_ASSIGNED_HoA
- USE_PPK
- USE_TRANSPORT_MODE
- USE_WESP_MODE
- __init__(self: mtf.libs.mtf_pybinder.pcpp.IKEv2NotifyPayload.NotifyMessageType, value: int) None
- __new__(**kwargs)
- property name
- property value
- PPK_IDENTITY
- PSK_CONFIRM
- PSK_PERSIST
- PUZZLE
- QUICK_CRASH_DETECTION
- REDIRECT
- REDIRECTED_FROM
- REDIRECT_SUPPORTED
- REKEY_SA
- ROHC_SUPPORTED
- SECURE_PASSWORD_METHODS
- SENDER_REQUEST_ID
- SET_WINDOW_SIZE
- SIGNATURE_HASH_ALGORITHMS
- SINGLE_PAIR_REQUIRED
- STATE_NOT_FOUND
- TEMPORARY_FAILURE
- TICKET_ACK
- TICKET_LT_OPAQUE
- TICKET_NACK
- TICKET_OPAQUE
- TICKET_REQUEST
- TS_UNACCEPTABLE
- UNACCEPTABLE_ADDRESSES
- UNEXPECTED_NAT_DETECTED
- UNSUPPORTED_CRITICAL_PAYLOAD
- UPDATE_SA_ADDRESSES
- USE_AGGFRAG
- USE_ASSIGNED_HoA
- USE_PPK
- USE_TRANSPORT_MODE
- USE_WESP_MODE
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IKEv2NotifyPayload, arg0: mtf.libs.mtf_pybinder.pcpp.IKEv2NotifyPayload) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IKEv2NotifyPayload, arg0: mtf.libs.mtf_pybinder.pcpp.IKEv2NotifyPayload) -> None
- __new__(**kwargs)
- property is_critical
The status of the Critical bit
- property next_payload
The type of the next payload
- property notification_data
The notification data
- property notify_message_type
The type of notification message
- property payload_length
The length of the current payload
- property payload_type
The type of this payload
- property protocol_id
The protocol identifier
- property raw_data
Payload raw data
- property spi
The Security Parameter Index data
- property spi_size
The length of the SPI
- class mtf.libs.mtf_pybinder.pcpp.IKEv2PayloadType
IKEv2 payload types
Members:
NO_NEXT_PAYLOAD
SA
KE
IDi
IDr
CERT
CERTREQ
AUTH
Ni
Nr
N
D
V
TSi
TSr
SK
CP
EAP
SKF
- AUTH
- CERT
- CERTREQ
- CP
- D
- EAP
- IDi
- IDr
- KE
- N
- NO_NEXT_PAYLOAD
- Ni
- Nr
- SA
- SK
- SKF
- TSi
- TSr
- V
- __init__(self: mtf.libs.mtf_pybinder.pcpp.IKEv2PayloadType, value: int) None
- __new__(**kwargs)
- property name
- property value
- class mtf.libs.mtf_pybinder.pcpp.IKEv2SecurityAssociationPayload
- class Proposal
- __init__(self: mtf.libs.mtf_pybinder.pcpp.IKEv2SecurityAssociationPayload.Proposal, arg0: mtf.libs.mtf_pybinder.pcpp.IKEv2SecurityAssociationPayload.Proposal) None
- __new__(**kwargs)
- property last_substruc
Whether or not this is the last Proposal Substructure
- property num_transforms
The number of transforms in this proposal
- property proposal_length
The length of this proposal
- property proposal_num
The index of this proposal inside the SA payload
- property protocol_id
The IPsec protocol identifier for the current negotiation
- property spi
The SPI data
- property spi_size
The size in octets of the SPI of the corresponding protocol
- property transforms
The list of transforms in this proposal
- Returns:
list[pcpp.IKEv2SecurityAssociationPayload.Transform]
- class Transform
- __init__(self: mtf.libs.mtf_pybinder.pcpp.IKEv2SecurityAssociationPayload.Transform, arg0: mtf.libs.mtf_pybinder.pcpp.IKEv2SecurityAssociationPayload.Transform) None
- __new__(**kwargs)
- property attributes
The list of transform attributes in this transform
- Returns:
list[pcpp.IKEv2SecurityAssociationPayload.TransformAttribute]
- property last_substruc
Whether or not this is the last Transform Substructure
- property transform_id
The specific instance of the Transform Type being proposed
- property transform_length
The length in octets of the Transform, including Header and Attributes
- property transform_type
The type of this transform
- class TransformAttribute
- __init__(*args, **kwargs)
- __new__(**kwargs)
- property attribute_format
True if format is Type/Length/Value, false if Type/Value
- property attribute_length
The length of the attribute
- property attribute_type
The unique identifier for each type of attribute
- property attribute_value
The value of the attribute
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IKEv2SecurityAssociationPayload, arg0: mtf.libs.mtf_pybinder.pcpp.IKEv2SecurityAssociationPayload) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IKEv2SecurityAssociationPayload, arg0: mtf.libs.mtf_pybinder.pcpp.IKEv2SecurityAssociationPayload) -> None
- __new__(**kwargs)
- property is_critical
The status of the Critical bit
- property next_payload
The type of the next payload
- property payload_length
The length of the current payload
- property payload_type
The type of this payload
- property proposals
The list of proposals in this Security Association
- Returns:
list[pcpp.IKEv2SecurityAssociationPayload.Proposal]
- property raw_data
Payload raw data
- class mtf.libs.mtf_pybinder.pcpp.IKEv2TrafficSelectorPayload
- class IPTrafficSelector
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IKEv2TrafficSelectorPayload.IPTrafficSelector, arg0: mtf.libs.mtf_pybinder.pcpp.IKEv2TrafficSelectorPayload.IPTrafficSelector) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IKEv2TrafficSelectorPayload.IPTrafficSelector, arg0: mtf.libs.mtf_pybinder.pcpp.IKEv2TrafficSelectorPayload.IPTrafficSelector) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IKEv2TrafficSelectorPayload.IPTrafficSelector, : mtf.libs.mtf_pybinder.pcpp.IKEv2TrafficSelectorPayload.IPTrafficSelector) mtf.libs.mtf_pybinder.pcpp.IKEv2TrafficSelectorPayload.IPTrafficSelector
- Returns:
pcpp.IKEv2TrafficSelectorPayload.IPTrafficSelector
- property end_port
The largest port number allowed
- property ip_protocol_id
The associated IP protocol ID
- property selector_length
The length of the Traffic Selector
- property start_port
The smallest port number allowed
- property ts_type
The type of the Traffic Selector
- class IPv4TrafficSelector
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IKEv2TrafficSelectorPayload.IPv4TrafficSelector, arg0: mtf.libs.mtf_pybinder.pcpp.IKEv2TrafficSelectorPayload.IPv4TrafficSelector) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IKEv2TrafficSelectorPayload.IPv4TrafficSelector, arg0: mtf.libs.mtf_pybinder.pcpp.IKEv2TrafficSelectorPayload.IPv4TrafficSelector) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IKEv2TrafficSelectorPayload.IPv4TrafficSelector, : mtf.libs.mtf_pybinder.pcpp.IKEv2TrafficSelectorPayload.IPv4TrafficSelector) mtf.libs.mtf_pybinder.pcpp.IKEv2TrafficSelectorPayload.IPv4TrafficSelector
- Returns:
pcpp.IKEv2TrafficSelectorPayload.IPv4TrafficSelector
- property end_port
The largest port number allowed
- property ending_address
The largest address included
- property ip_protocol_id
The associated IP protocol ID
- property selector_length
The length of the Traffic Selector
- property start_port
The smallest port number allowed
- property starting_address
The smallest address included
- property ts_type
The type of the Traffic Selector
- class IPv6TrafficSelector
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IKEv2TrafficSelectorPayload.IPv6TrafficSelector, arg0: mtf.libs.mtf_pybinder.pcpp.IKEv2TrafficSelectorPayload.IPv6TrafficSelector) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IKEv2TrafficSelectorPayload.IPv6TrafficSelector, arg0: mtf.libs.mtf_pybinder.pcpp.IKEv2TrafficSelectorPayload.IPv6TrafficSelector) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IKEv2TrafficSelectorPayload.IPv6TrafficSelector, : mtf.libs.mtf_pybinder.pcpp.IKEv2TrafficSelectorPayload.IPv6TrafficSelector) mtf.libs.mtf_pybinder.pcpp.IKEv2TrafficSelectorPayload.IPv6TrafficSelector
- Returns:
pcpp.IKEv2TrafficSelectorPayload.IPv6TrafficSelector
- property end_port
The largest port number allowed
- property ending_address
The largest address included
- property ip_protocol_id
The associated IP protocol ID
- property selector_length
The length of the Traffic Selector
- property start_port
The smallest port number allowed
- property starting_address
The smallest address included
- property ts_type
The type of the Traffic Selector
- TS_FC_ADDR_RANGE
- TS_IPV4_ADDR_RANGE
- TS_IPV6_ADDR_RANGE
- TS_SECLABEL
- class TrafficSelector
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IKEv2TrafficSelectorPayload.TrafficSelector, arg0: mtf.libs.mtf_pybinder.pcpp.IKEv2TrafficSelectorPayload.TrafficSelector) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IKEv2TrafficSelectorPayload.TrafficSelector, arg0: mtf.libs.mtf_pybinder.pcpp.IKEv2TrafficSelectorPayload.TrafficSelector) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IKEv2TrafficSelectorPayload.TrafficSelector, : mtf.libs.mtf_pybinder.pcpp.IKEv2TrafficSelectorPayload.TrafficSelector) mtf.libs.mtf_pybinder.pcpp.IKEv2TrafficSelectorPayload.TrafficSelector
- Returns:
pcpp.IKEv2TrafficSelectorPayload.TrafficSelector
- property selector_length
The length of the Traffic Selector
- property ts_type
The type of the Traffic Selector
- class TrafficSelectorType
IKEv2 Traffic Selector Types
Members:
TS_IPV4_ADDR_RANGE
TS_IPV6_ADDR_RANGE
TS_FC_ADDR_RANGE
TS_SECLABEL
- TS_FC_ADDR_RANGE
- TS_IPV4_ADDR_RANGE
- TS_IPV6_ADDR_RANGE
- TS_SECLABEL
- __init__(self: mtf.libs.mtf_pybinder.pcpp.IKEv2TrafficSelectorPayload.TrafficSelectorType, value: int) None
- __new__(**kwargs)
- property name
- property value
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IKEv2TrafficSelectorPayload, arg0: mtf.libs.mtf_pybinder.pcpp.IKEv2TrafficSelectorPayload) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IKEv2TrafficSelectorPayload, arg0: mtf.libs.mtf_pybinder.pcpp.IKEv2TrafficSelectorPayload) -> None
- __new__(**kwargs)
- get_selectors(self: mtf.libs.mtf_pybinder.pcpp.IKEv2TrafficSelectorPayload) list[pcpp::IKEv2TrafficSelectorPayload::TrafficSelector]
The list of Traffic Selectors in this payload
- Returns:
list[pcpp.IKEv2TrafficSelectorPayload.TrafficSelector]
- property is_critical
The status of the Critical bit
- property next_payload
The type of the next payload
- property number_of_tss
The number of Traffic Selectors
- property payload_length
The length of the current payload
- property payload_type
The type of this payload
- property raw_data
Payload raw data
- class mtf.libs.mtf_pybinder.pcpp.IKEv2VendorIdPayload
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IKEv2VendorIdPayload, arg0: mtf.libs.mtf_pybinder.pcpp.IKEv2VendorIdPayload) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IKEv2VendorIdPayload, arg0: mtf.libs.mtf_pybinder.pcpp.IKEv2VendorIdPayload) -> None
- __new__(**kwargs)
- property is_critical
The status of the Critical bit
- property next_payload
The type of the next payload
- property payload_length
The length of the current payload
- property payload_type
The type of this payload
- property raw_data
Payload raw data
- property vendor_id
The Vendor ID data
- class mtf.libs.mtf_pybinder.pcpp.IPAddress
The class is a version-independent representation for an IP address
- class AddressType
An enum representing the address type: IPv4 or IPv6
Members:
IPv4AddressType
IPv6AddressType
- IPv4AddressType
- IPv6AddressType
- __init__(self: mtf.libs.mtf_pybinder.pcpp.IPAddress.AddressType, value: int) None
- __new__(**kwargs)
- property name
- property value
- IPv4AddressType
- IPv6AddressType
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPAddress) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPAddress, addr: mtf.libs.mtf_pybinder.pcpp.IPv4Address) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPAddress, addr: mtf.libs.mtf_pybinder.pcpp.IPv6Address) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPAddress, addr_as_string: str) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPAddress, arg0: mtf.libs.mtf_pybinder.pcpp.IPAddress) -> None
- __new__(**kwargs)
- assign(*args, **kwargs)
Overloaded function.
assign(self: mtf.libs.mtf_pybinder.pcpp.IPAddress, addr: mtf.libs.mtf_pybinder.pcpp.IPv4Address) -> mtf.libs.mtf_pybinder.pcpp.IPAddress
Overload of an assignment operator.
- Args:
addr (pcpp.IPv4Address): A const reference to instance of IPv4Address
- Returns:
pcpp.IPAddress: A reference to the assignee
assign(self: mtf.libs.mtf_pybinder.pcpp.IPAddress, addr: mtf.libs.mtf_pybinder.pcpp.IPv6Address) -> mtf.libs.mtf_pybinder.pcpp.IPAddress
Overload of an assignment operator.
- Args:
addr (pcpp.IPv6Address): A const reference to instance of IPv6Address
- Returns:
pcpp.IPAddress: A reference to the assignee
assign(self: mtf.libs.mtf_pybinder.pcpp.IPAddress, : mtf.libs.mtf_pybinder.pcpp.IPAddress) -> mtf.libs.mtf_pybinder.pcpp.IPAddress
- Returns:
pcpp.IPAddress
- get_ipv4(self: mtf.libs.mtf_pybinder.pcpp.IPAddress) mtf.libs.mtf_pybinder.pcpp.IPv4Address
Get a reference to IPv4 address instance
- Returns:
pcpp.IPv4Address: The const reference to IPv4Address instance
- get_ipv6(self: mtf.libs.mtf_pybinder.pcpp.IPAddress) mtf.libs.mtf_pybinder.pcpp.IPv6Address
Get a reference to IPv6 address instance
- Returns:
pcpp.IPv6Address: The const reference to IPv6Address instance
- get_type(self: mtf.libs.mtf_pybinder.pcpp.IPAddress) mtf.libs.mtf_pybinder.pcpp.IPAddress.AddressType
Gets the address type: IPv4 or IPv6
- Returns:
enum pcpp.IPAddress.AddressType: The address type
- is_ipv4(self: mtf.libs.mtf_pybinder.pcpp.IPAddress) bool
Determine whether the object contains an IP version 4 address
- Returns:
bool: True if this is an IPv4 IPAddress, otherwise Flase
- is_ipv6(self: mtf.libs.mtf_pybinder.pcpp.IPAddress) bool
Determine whether the object contains an IP version 6 address
- Returns:
bool
- is_multicast(self: mtf.libs.mtf_pybinder.pcpp.IPAddress) bool
Determine whether the address is a multicast address
- Returns:
bool: True if an address is multicast
- to_string(self: mtf.libs.mtf_pybinder.pcpp.IPAddress) str
- Returns:
str: A string representation of the address
- class mtf.libs.mtf_pybinder.pcpp.IPFilter
A class for representing IPv4 address filter, equivalent to “net src x.x.x.x” or “net dst x.x.x.x”<BR> For deeper understanding of the filter concept please refer to PcapFilter.h
Add IPv6 filtering support
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPFilter, ip_address: str, dir: mtf.libs.mtf_pybinder.pcpp.Direction) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPFilter, ip_address: str, dir: mtf.libs.mtf_pybinder.pcpp.Direction, ipv4_mask: str) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPFilter, ip_address: str, dir: mtf.libs.mtf_pybinder.pcpp.Direction, len: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPFilter, arg0: mtf.libs.mtf_pybinder.pcpp.IPFilter) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IPFilter, : mtf.libs.mtf_pybinder.pcpp.IPFilter) mtf.libs.mtf_pybinder.pcpp.IPFilter
- Returns:
pcpp.IPFilter
- match_packet_with_filter(self: mtf.libs.mtf_pybinder.pcpp.GeneralFilter, raw_packet: mtf.libs.mtf_pybinder.pcpp.RawPacket) bool
Match a raw packet with a given BPF filter.
A pointer to the raw packet to match the BPF filter with True if a raw packet matches the BPF filter or false otherwise
- Args:
raw_packet (str)
- Returns:
bool
- parse_to_string(self: mtf.libs.mtf_pybinder.pcpp.GeneralFilter, result: str) None
A method that parses the class instance into BPF string format
An empty string that the parsing will be written into. If the string isn’t empty, its content will be overridden
- Args:
result (str)
- Returns:
void
- set_addr(self: mtf.libs.mtf_pybinder.pcpp.IPFilter, ip_address: str) None
Set the IPv4 address
The IPv4 address to build the filter with. If this address is not a valid IPv4 address an error will be written to log and parsing this filter will fail
- Args:
ip_address (str)
- Returns:
void
- set_direction(self: mtf.libs.mtf_pybinder.pcpp.IFilterWithDirection, dir: mtf.libs.mtf_pybinder.pcpp.Direction) None
Set the direction for the filter (source or destination)
The direction
- Args:
dir (str)
- Returns:
void
- set_len(self: mtf.libs.mtf_pybinder.pcpp.IPFilter, len: int) None
Set the subnet
The subnet to use (e.g “/24”)
- Args:
len (str)
- Returns:
void
- set_mask(self: mtf.libs.mtf_pybinder.pcpp.IPFilter, ipv4_mask: str) None
Set the IPv4 mask
The mask to use. Mask should also be in a valid IPv4 format (i.e x.x.x.x), otherwise parsing this filter will fail
- Args:
ipv4_mask (str)
- Returns:
void
- class mtf.libs.mtf_pybinder.pcpp.IPLayer
This is an interface (abstract class) implemented in the IP layers (IPv4Layer and IPv6Layer). It provides methods to fetch the source and destination IP addresses in an abdtract way that hides the IP type (IPv4 or IPv6). This is useful for use-cases in which the IP type doesn’t matter. For example: if you’re only interested in printing the IP address the IP type shouldn’t matter.
- __init__(*args, **kwargs)
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IPLayer, : mtf.libs.mtf_pybinder.pcpp.IPLayer) mtf.libs.mtf_pybinder.pcpp.IPLayer
- Returns:
pcpp.IPLayer
- get_dst_ip_address(self: mtf.libs.mtf_pybinder.pcpp.IPLayer) mtf.libs.mtf_pybinder.pcpp.IPAddress
An abstract method to get the destination IP address
- Returns:
pcpp.IPAddress: An IPAddress object containing the destination address
- get_src_ip_address(self: mtf.libs.mtf_pybinder.pcpp.IPLayer) mtf.libs.mtf_pybinder.pcpp.IPAddress
An abstract method to get the source IP address
- Returns:
pcpp.IPAddress: An IPAddress object containing the source address
- class mtf.libs.mtf_pybinder.pcpp.IPNetwork
A class representing version independent IP network definition, both IPv4 and IPv6 are included
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPNetwork, address: mtf.libs.mtf_pybinder.pcpp.IPAddress, prefix_len: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPNetwork, address: mtf.libs.mtf_pybinder.pcpp.IPAddress, netmask: str) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPNetwork, address_and_netmask: str) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPNetwork, arg0: mtf.libs.mtf_pybinder.pcpp.IPNetwork) -> None
- __new__(**kwargs)
- assign(*args, **kwargs)
Overloaded function.
assign(self: mtf.libs.mtf_pybinder.pcpp.IPNetwork, other: mtf.libs.mtf_pybinder.pcpp.IPNetwork) -> mtf.libs.mtf_pybinder.pcpp.IPNetwork
Overload of an assignment operator.
- Args:
other (pcpp.IPNetwork): An instance of IPNetwork to assign
- Returns:
pcpp.IPNetwork: A reference to theassignee
assign(self: mtf.libs.mtf_pybinder.pcpp.IPNetwork, other: mtf.libs.mtf_pybinder.pcpp.IPv4Network) -> mtf.libs.mtf_pybinder.pcpp.IPNetwork
Overload of an assignment operator.
- Args:
other (pcpp.IPv4Network): An instance of IPv4Network to assign
- Returns:
pcpp.IPNetwork: A reference to theassignee
assign(self: mtf.libs.mtf_pybinder.pcpp.IPNetwork, other: mtf.libs.mtf_pybinder.pcpp.IPv6Network) -> mtf.libs.mtf_pybinder.pcpp.IPNetwork
Overload of an assignment operator.
- Args:
other (pcpp.IPv6Network): An instance of IPv6Network to assign
- Returns:
pcpp.IPNetwork: A reference to theassignee
- get_highest_address(self: mtf.libs.mtf_pybinder.pcpp.IPNetwork) mtf.libs.mtf_pybinder.pcpp.IPAddress
The highest non-reserved IP address in this network, for example: the highest address in 3546::/16 is 3546:ffff:ffff:ffff:ffff:ffff:ffff:ffff, the highest address in 10.10.10.10/16 is 10.10.255.254
- Returns:
pcpp.IPAddress
- get_lowest_address(self: mtf.libs.mtf_pybinder.pcpp.IPNetwork) mtf.libs.mtf_pybinder.pcpp.IPAddress
The lowest non-reserved IP address in this network, for example: the lowest address in 3546::/16 is 3546::1, the lowest address in 10.10.10.10/16 is 10.10.0.1
- Returns:
pcpp.IPAddress
- get_netmask(self: mtf.libs.mtf_pybinder.pcpp.IPNetwork) str
The netmask, for example: the netmask of 3546::/16 is ffff::, the netmask of 10.10.10.10/8 is 255.0.0.0
- Returns:
str
- get_network_prefix(self: mtf.libs.mtf_pybinder.pcpp.IPNetwork) mtf.libs.mtf_pybinder.pcpp.IPAddress
The network prefix, for example: the network prefix of 3546:f321::/16 is 3546::, the network prefix of 10.10.10.10/16 is 10.10.0.0
- Returns:
pcpp.IPAddress
- get_prefix_len(self: mtf.libs.mtf_pybinder.pcpp.IPNetwork) int
The prefix length, for example: the prefix length of 3546::/ffff:: is 16, the prefix length of 10.10.10.10/255.0.0.0 is 8
- Returns:
unsigned int
- get_total_address_count(self: mtf.libs.mtf_pybinder.pcpp.IPNetwork) int
The number of addresses in this network, for example: the number of addresses in 16ff::/120 is 256, the number ofaddresses in 10.10.0.0/24 is 256. If the number of addresses exceeds the size of uint64_t a std::out_of_rangeexception is thrown
- Returns:
unsigned int
- includes(*args, **kwargs)
Overloaded function.
includes(self: mtf.libs.mtf_pybinder.pcpp.IPNetwork, address: mtf.libs.mtf_pybinder.pcpp.IPAddress) -> bool
- Args:
address (pcpp.IPAddress): An IP address
- Returns:
bool: True is the address belongs to the network, false otherwise or if the address isn’t valid
includes(self: mtf.libs.mtf_pybinder.pcpp.IPNetwork, network: mtf.libs.mtf_pybinder.pcpp.IPNetwork) -> bool
- Args:
network (pcpp.IPNetwork): An IP network
- Returns:
bool: True is the input network is completely included within this network, false otherwise
- is_ipv4_network(self: mtf.libs.mtf_pybinder.pcpp.IPNetwork) bool
- Returns:
bool: True if this is an IPv4 network, false otherwise
- is_ipv6_network(self: mtf.libs.mtf_pybinder.pcpp.IPNetwork) bool
- Returns:
bool: True if this is an IPv6 network, false otherwise
- to_string(self: mtf.libs.mtf_pybinder.pcpp.IPNetwork) str
- Returns:
str: A string representation of the network in a format of NETWORK_PREFIX/PREFIX_LEN, for example:
fda7:9f81:6c23:275::/64 or 192.168.0.0/16
- class mtf.libs.mtf_pybinder.pcpp.IPProtocolTypes
An enum for all possible IPv4 and IPv6 protocol types
Members:
PACKETPP_IPPROTO_HOPOPTS
PACKETPP_IPPROTO_ICMP
PACKETPP_IPPROTO_IGMP
PACKETPP_IPPROTO_IPIP
PACKETPP_IPPROTO_TCP
PACKETPP_IPPROTO_EGP
PACKETPP_IPPROTO_PUP
PACKETPP_IPPROTO_UDP
PACKETPP_IPPROTO_IDP
PACKETPP_IPPROTO_IPV6
PACKETPP_IPPROTO_ROUTING
PACKETPP_IPPROTO_FRAGMENT
PACKETPP_IPPROTO_GRE
PACKETPP_IPPROTO_ESP
PACKETPP_IPPROTO_AH
PACKETPP_IPPROTO_ICMPV6
PACKETPP_IPPROTO_NONE
PACKETPP_IPPROTO_DSTOPTS
PACKETPP_IPPROTO_VRRP
PACKETPP_IPPROTO_RAW
PACKETPP_IPPROTO_MAX
- PACKETPP_IPPROTO_AH
- PACKETPP_IPPROTO_DSTOPTS
- PACKETPP_IPPROTO_EGP
- PACKETPP_IPPROTO_ESP
- PACKETPP_IPPROTO_FRAGMENT
- PACKETPP_IPPROTO_GRE
- PACKETPP_IPPROTO_HOPOPTS
- PACKETPP_IPPROTO_ICMP
- PACKETPP_IPPROTO_ICMPV6
- PACKETPP_IPPROTO_IDP
- PACKETPP_IPPROTO_IGMP
- PACKETPP_IPPROTO_IPIP
- PACKETPP_IPPROTO_IPV6
- PACKETPP_IPPROTO_MAX
- PACKETPP_IPPROTO_NONE
- PACKETPP_IPPROTO_PUP
- PACKETPP_IPPROTO_RAW
- PACKETPP_IPPROTO_ROUTING
- PACKETPP_IPPROTO_TCP
- PACKETPP_IPPROTO_UDP
- PACKETPP_IPPROTO_VRRP
- __init__(self: mtf.libs.mtf_pybinder.pcpp.IPProtocolTypes, value: int) None
- __new__(**kwargs)
- property name
- property value
- class mtf.libs.mtf_pybinder.pcpp.IPcapDevice
An abstract class representing all libpcap-based packet capturing devices: files, libPcap, WinPcap/Npcap and RemoteCapture. This class is abstract and cannot be instantiated
- class PcapStats
A container for pcap device statistics
- __init__(self: mtf.libs.mtf_pybinder.pcpp.IPcapDevice.PcapStats) None
- __new__(**kwargs)
- property packets_drop
- property packets_drop_by_interface
- property packets_recv
- __init__(*args, **kwargs)
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IPcapDevice, : mtf.libs.mtf_pybinder.pcpp.IPcapDevice) mtf.libs.mtf_pybinder.pcpp.IPcapDevice
- Returns:
pcpp.IPcapDevice
- clear_filter(self: mtf.libs.mtf_pybinder.pcpp.IFilterableDevice) bool
Clear the filter currently set on the device
- Returns:
bool: True if filter was removed successfully or if no filter was set, false otherwise
- close(self: mtf.libs.mtf_pybinder.pcpp.IDevice) None
Close the device
- static get_pcap_lib_version_info() str
A static method for retrieving pcap lib (libpcap/WinPcap/etc.) version information. This method is actually a wrapper for [pcap_lib_version()](https://www.tcpdump.org/manpages/pcap_lib_version.3pcap.html)
- Returns:
str: A string containing the pcap lib version information
- get_statistics(self: mtf.libs.mtf_pybinder.pcpp.IPcapDevice, stats: pcpp::IPcapDevice::PcapStats) None
Get statistics from the device
- Args:
stats (pcpp.IPcapDevice.PcapStats): An object containing the stats
- is_opened(self: mtf.libs.mtf_pybinder.pcpp.IDevice) bool
- Returns:
bool: True if the file is opened, false otherwise
- static match_packet_with_filter(filter: mtf.libs.mtf_pybinder.pcpp.GeneralFilter, raw_packet: mtf.libs.mtf_pybinder.pcpp.RawPacket) bool
Match a raw packet with a given BPF filter. Notice this method is static which means you don’t need any device instance in order to perform this match
- Args:
filter (pcpp.GeneralFilter): A filter class to test against raw_packet (pcpp.RawPacket): A pointer to the raw packet to match the filter with
- Returns:
bool: True if raw packet matches the filter or false otherwise
- open(self: mtf.libs.mtf_pybinder.pcpp.IDevice) bool
Open the device
- Returns:
bool: True if device was opened successfully, false otherwise
- set_filter(*args, **kwargs)
Overloaded function.
set_filter(self: mtf.libs.mtf_pybinder.pcpp.IFilterableDevice, filter: mtf.libs.mtf_pybinder.pcpp.GeneralFilter) -> bool
Set a filter for the device. When implemented by the device, only packets that match the filter will be received
- Args:
filter (pcpp.GeneralFilter): The filter to be set in PcapPlusPlus’ GeneralFilter format
- Returns:
bool: True if filter set successfully, false otherwise
set_filter(self: mtf.libs.mtf_pybinder.pcpp.IFilterableDevice, filter_as_string: str) -> bool
Set a filter for the device. When implemented by the device, only packets that match the filter will be received
- Args:
filter_as_string (str): The filter to be set in Berkeley Packet Filter (BPF) syntax (http://biot.com/capstats/bpf.html)
- Returns:
bool: True if filter set successfully, false otherwise
- class mtf.libs.mtf_pybinder.pcpp.IPv4Address
Represents an IPv4 address (of type XXX.XXX.XXX.XXX)
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv4Address) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv4Address, addr_as_int: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv4Address, addr_as_string: str) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv4Address, arg0: mtf.libs.mtf_pybinder.pcpp.IPv4Address) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IPv4Address, : mtf.libs.mtf_pybinder.pcpp.IPv4Address) mtf.libs.mtf_pybinder.pcpp.IPv4Address
- Returns:
pcpp.IPv4Address
- is_multicast(self: mtf.libs.mtf_pybinder.pcpp.IPv4Address) bool
- Returns:
bool: True if an address is multicast, false otherwise.
- match_network(*args, **kwargs)
Overloaded function.
match_network(self: mtf.libs.mtf_pybinder.pcpp.IPv4Address, network: pcpp::IPv4Network) -> bool
Checks whether the address matches a network.
- Args:
network (pcpp.IPv4Network): An IPv4Network network
- Returns:
bool: True if the address matches the network or false otherwise
match_network(self: mtf.libs.mtf_pybinder.pcpp.IPv4Address, network: str) -> bool
Checks whether the address matches a network. For example: this method will return true for address 10.1.1.9 and network which is one of: 10.1.1.1/24, 10.1.1.1/255.255.255.0 Another example: this method will return false for address 11.1.1.9 and network which is one of: 10.1.1.1/16, 10.1.1.1/255.255.0.0
- Args:
network (str): A string in one of these formats:
X.X.X.X/Y where X.X.X.X is a valid IP address and Y is a number between 0 and 32
X.X.X.X/Y.Y.Y.Y where X.X.X.X is a valid IP address and Y.Y.Y.Y is a valid netmask
- Returns:
bool: True if the address matches the network or false if it doesn’t or if the network is invalid
- to_bytes(self: mtf.libs.mtf_pybinder.pcpp.IPv4Address) int
- Returns:
bytes: A non-owning pointer to 4-byte C-style array representing the IPv4 address
- to_int(self: mtf.libs.mtf_pybinder.pcpp.IPv4Address) int
- Returns:
unsigned int: A 4-byte integer in network byte order representing the IPv4 address
- to_string(self: mtf.libs.mtf_pybinder.pcpp.IPv4Address) str
- Returns:
str: A string representation of the address
- class mtf.libs.mtf_pybinder.pcpp.IPv4IDFilter
A class for filtering IPv4 traffic by IP ID field of the IPv4 protocol, For example: “filter only IPv4 traffic which IP ID is greater than 1234”<BR> For deeper understanding of the filter concept please refer to PcapFilter.h
- __init__(self: mtf.libs.mtf_pybinder.pcpp.IPv4IDFilter, ip_id: int, op: mtf.libs.mtf_pybinder.pcpp.FilterOperator) None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IPv4IDFilter, : mtf.libs.mtf_pybinder.pcpp.IPv4IDFilter) mtf.libs.mtf_pybinder.pcpp.IPv4IDFilter
- Returns:
pcpp.IPv4IDFilter
- match_packet_with_filter(self: mtf.libs.mtf_pybinder.pcpp.GeneralFilter, raw_packet: mtf.libs.mtf_pybinder.pcpp.RawPacket) bool
Match a raw packet with a given BPF filter.
A pointer to the raw packet to match the BPF filter with True if a raw packet matches the BPF filter or false otherwise
- Args:
raw_packet (str)
- Returns:
bool
- parse_to_string(self: mtf.libs.mtf_pybinder.pcpp.GeneralFilter, result: str) None
A method that parses the class instance into BPF string format
An empty string that the parsing will be written into. If the string isn’t empty, its content will be overridden
- Args:
result (str)
- Returns:
void
- set_ip_id(self: mtf.libs.mtf_pybinder.pcpp.IPv4IDFilter, ip_id: int) None
Set the IP ID to filter
- Args:
ip_id (str): The IP ID to filter
- Returns:
void
- set_operator(self: mtf.libs.mtf_pybinder.pcpp.IFilterWithOperator, op: mtf.libs.mtf_pybinder.pcpp.FilterOperator) None
Set the operator for the filter
The operator to set
- Args:
op (str)
- Returns:
void
- class mtf.libs.mtf_pybinder.pcpp.IPv4Layer
Represents an IPv4 protocol layer
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv4Layer, data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: pcpp::Packet) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv4Layer, data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: pcpp::Packet, set_total_len_as_data_len: bool) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv4Layer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv4Layer, src_ip: mtf.libs.mtf_pybinder.pcpp.IPv4Address, dst_ip: mtf.libs.mtf_pybinder.pcpp.IPv4Address) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv4Layer, arg0: mtf.libs.mtf_pybinder.pcpp.IPv4Layer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv4Layer, arg0: mtf.libs.mtf_pybinder.pcpp.IPv4Layer) -> None
- __new__(**kwargs)
- add_option(self: mtf.libs.mtf_pybinder.pcpp.IPv4Layer, option_builder: mtf.libs.mtf_pybinder.pcpp.IPv4OptionBuilder) mtf.libs.mtf_pybinder.pcpp.IPv4Option
Add a new IPv4 option at the end of the layer (after the last IPv4 option)
- Args:
option_builder (pcpp.IPv4OptionBuilder): An IPv4OptionBuilder object thatcontains the IPv4 option data to be added
- Returns:
pcpp.IPv4Option: A IPv4Option object that contains the newly added IPv4 option dataor logical NULL
(IPv4Option#isNull() == true) if addition failed. In case of a failure a corresponding errormessage will be printed to log
- add_option_after(*args, **kwargs)
Overloaded function.
add_option_after(self: mtf.libs.mtf_pybinder.pcpp.IPv4Layer, option_builder: mtf.libs.mtf_pybinder.pcpp.IPv4OptionBuilder) -> mtf.libs.mtf_pybinder.pcpp.IPv4Option
- Args:
option_builder (pcpp.IPv4OptionBuilder a0)
- Returns:
pcpp.IPv4Option
add_option_after(self: mtf.libs.mtf_pybinder.pcpp.IPv4Layer, option_builder: mtf.libs.mtf_pybinder.pcpp.IPv4OptionBuilder, prev_option_type: mtf.libs.mtf_pybinder.pcpp.IPv4OptionTypes) -> mtf.libs.mtf_pybinder.pcpp.IPv4Option
Add a new IPv4 option after an existing one
- Args:
option_builder (pcpp.IPv4OptionBuilder): An IPv4OptionBuilder object that contains the requested IPv4option data to be added prev_option_type (enum pcpp.IPv4OptionTypes): The IPv4 option which the newly added option should come after. This is an optionalparameter which
gets a default value of ::IPV4OPT_Unknown if omitted, which means the new option will be added asthe first option in the layer
- Returns:
pcpp.IPv4Option: A IPv4Option object containing the newly added IPv4 option data or logicalNULL
(IPv4Option#isNull() == true) if addition failed. In case of a failure a corresponding error message willbe printed to log
- assign(self: mtf.libs.mtf_pybinder.pcpp.IPv4Layer, other: mtf.libs.mtf_pybinder.pcpp.IPv4Layer) mtf.libs.mtf_pybinder.pcpp.IPv4Layer
An assignment operator that first delete all data from current layer and then copy the entire header from the otherIPv4Layer (including IPv4 options)
- Args:
other (pcpp.IPv4Layer)
- Returns:
pcpp.IPv4Layer
- property checksum
IP checksum value
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- property dst_ip_address
Destination IP address
- property fragment_flags
A bitmask containing the fragmentation flags (e.g IP_DONT_FRAGMENT or IP_MORE_FRAGMENTS)
- Returns:
unsigned int
- property fragment_offset
The fragment offset in case this packet is a fragment, 0 otherwise
- Returns:
unsigned int
- get_dst_ip_address(self: mtf.libs.mtf_pybinder.pcpp.IPLayer) mtf.libs.mtf_pybinder.pcpp.IPAddress
An abstract method to get the destination IP address
- Returns:
pcpp.IPAddress: An IPAddress object containing the destination address
- get_first_option(self: mtf.libs.mtf_pybinder.pcpp.IPv4Layer) mtf.libs.mtf_pybinder.pcpp.IPv4Option
The first IPv4 option in the packet. If the current layer contains no options the returned value will contain alogical NULL (IPv4Option#isNull() == true)
- Returns:
pcpp.IPv4Option
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_next_option(self: mtf.libs.mtf_pybinder.pcpp.IPv4Layer, option: mtf.libs.mtf_pybinder.pcpp.IPv4Option) mtf.libs.mtf_pybinder.pcpp.IPv4Option
Get the IPv4 option that comes after a given option. If the given option was the last one, the returned value will contain a logical NULL (IPv4Option#isNull() == true)
- Args:
option (pcpp.IPv4Option): An IPv4 option object that exists in the current layer
- Returns:
pcpp.IPv4Option: A IPv4Option object that contains the IPv4 option data that comes next, or logical NULL if the given
IPv4option: (1) was the last one; or (2) contains a logical NULL; or (3) doesn’t belong to this packet
- get_option(self: mtf.libs.mtf_pybinder.pcpp.IPv4Layer, option: mtf.libs.mtf_pybinder.pcpp.IPv4OptionTypes) mtf.libs.mtf_pybinder.pcpp.IPv4Option
Get an IPv4 option by type.
- Args:
option (enum pcpp.IPv4OptionTypes): IPv4 option type
- Returns:
pcpp.IPv4Option: An IPv4Option object that contains the first option thatmatches this type, or logical NULL
(IPv4Option#isNull() == true) if no such option found
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- get_src_ip_address(self: mtf.libs.mtf_pybinder.pcpp.IPLayer) mtf.libs.mtf_pybinder.pcpp.IPAddress
An abstract method to get the source IP address
- Returns:
pcpp.IPAddress: An IPAddress object containing the source address
- property header_len
The header length in bytes
- Returns:
unsigned int
- property identification
IP identification field
- property ip_version
IP version number
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- static is_data_valid(data: int, data_len: int) bool
A static method that validates the input data
- Args:
data (bytes): The pointer to the beginning of a byte stream of IPpacket data_len (unsigned int): The length of the byte stream
- Returns:
bool: True if the data is valid and can represent an IPv4packet
- is_first_fragment(self: mtf.libs.mtf_pybinder.pcpp.IPv4Layer) bool
True if this packet is a fragment (in sense of IP fragmentation) and is the first fragment (which usually containsthe L4 header). Return false otherwise (not a fragment or not the first fragment)
- Returns:
bool
- is_fragment(self: mtf.libs.mtf_pybinder.pcpp.IPv4Layer) bool
True if this packet is a fragment (in sense of IP fragmentation), false otherwise
- Returns:
bool
- is_last_fragment(self: mtf.libs.mtf_pybinder.pcpp.IPv4Layer) bool
True if this packet is a fragment (in sense of IP fragmentation) and is the last fragment. Return false otherwise(not a fragment or not the last fragment)
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property option_count
The number of IPv4 options in this layer
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol
Payload protocol type
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- remove_all_options(self: mtf.libs.mtf_pybinder.pcpp.IPv4Layer) bool
Remove all IPv4 options from the layer
- Returns:
bool: True if options removed successfully or false if some error occurred(an appropriate error message will be printed to log)
- remove_option(self: mtf.libs.mtf_pybinder.pcpp.IPv4Layer, option: mtf.libs.mtf_pybinder.pcpp.IPv4OptionTypes) bool
Remove an IPv4 option
- Args:
option (enum pcpp.IPv4OptionTypes): The option type to remove
- Returns:
bool: True if option was removed successfully or false ifoption type wasn’t found or failed to shorten the layer. If an option appears twice in the layer, its firstinstance
will be removed
- property src_ip_address
Source IP address
- property time_to_live
Time to Live value
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- property total_length
Length of header and payload in bytes
- property type_of_service
Type of service, same as DSCP
- class mtf.libs.mtf_pybinder.pcpp.IPv4Network
A class representing IPv4 network definition
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv4Network, address: mtf.libs.mtf_pybinder.pcpp.IPv4Address, prefix_len: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv4Network, address: mtf.libs.mtf_pybinder.pcpp.IPv4Address, netmask: str) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv4Network, address_and_netmask: str) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv4Network, arg0: mtf.libs.mtf_pybinder.pcpp.IPv4Network) -> None
- __new__(**kwargs)
- get_highest_address(self: mtf.libs.mtf_pybinder.pcpp.IPv4Network) mtf.libs.mtf_pybinder.pcpp.IPv4Address
The highest non-reserved IPv4 address in this network, for example: the highest address in 10.10.10.10/16 is 10.10.255.254
- Returns:
pcpp.IPv4Address
- get_lowest_address(self: mtf.libs.mtf_pybinder.pcpp.IPv4Network) mtf.libs.mtf_pybinder.pcpp.IPv4Address
The lowest non-reserved IPv4 address in this network, for example: the lowest address in 10.10.10.10/16 is 10.10.0.1
- Returns:
pcpp.IPv4Address
- get_netmask(self: mtf.libs.mtf_pybinder.pcpp.IPv4Network) str
The netmask, for example: the netmask of 10.10.10.10/8 is 255.0.0.0
- Returns:
str
- get_network_prefix(self: mtf.libs.mtf_pybinder.pcpp.IPv4Network) mtf.libs.mtf_pybinder.pcpp.IPv4Address
The network prefix, for example: the network prefix of 10.10.10.10/16 is 10.10.0.0
- Returns:
pcpp.IPv4Address
- get_prefix_len(self: mtf.libs.mtf_pybinder.pcpp.IPv4Network) int
The prefix length, for example: the prefix length of 10.10.10.10/255.0.0.0 is 8
- Returns:
unsigned int
- get_total_address_count(self: mtf.libs.mtf_pybinder.pcpp.IPv4Network) int
The number of addresses in this network including reserved addresses, for example: the number of addresses in 10.10.0.0/24 is 256
- Returns:
unsigned int
- includes(*args, **kwargs)
Overloaded function.
includes(self: mtf.libs.mtf_pybinder.pcpp.IPv4Network, address: mtf.libs.mtf_pybinder.pcpp.IPv4Address) -> bool
- Args:
address (pcpp.IPv4Address): An IPv4 address
- Returns:
bool: True is the address belongs to the network, false otherwise or if the address isn’t valid
includes(self: mtf.libs.mtf_pybinder.pcpp.IPv4Network, network: mtf.libs.mtf_pybinder.pcpp.IPv4Network) -> bool
- Args:
network (pcpp.IPv4Network): An IPv4 network
- Returns:
bool: True is the input network is completely included within this network, false otherwise, for example:
10.10.10.10/16 includes 10.10.10.10/24 but doesn’t include 10.10.10.10/8
- to_string(self: mtf.libs.mtf_pybinder.pcpp.IPv4Network) str
- Returns:
str: A string representation of the network in a format of NETWORK_PREFIX/PREFIX_LEN, for example:
192.168.0.0/16
- class mtf.libs.mtf_pybinder.pcpp.IPv4Option
A wrapper class for IPv4 options. This class does not create or modify IPv4 option records, but rather serves as a wrapper and provides useful methods for retrieving data from them
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv4Option, option_raw_data: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv4Option, arg0: mtf.libs.mtf_pybinder.pcpp.IPv4Option) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv4Option, arg0: mtf.libs.mtf_pybinder.pcpp.IPv4Option) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IPv4Option, : mtf.libs.mtf_pybinder.pcpp.IPv4Option) mtf.libs.mtf_pybinder.pcpp.IPv4Option
- Returns:
pcpp.IPv4Option
- static can_assign(record_raw_data: int, tlv_data_len: int) bool
Check if a pointer can be assigned to the TLV record data
- Args:
record_raw_data (bytes): A pointer to the TLV record raw data tlv_data_len (unsigned int): The size of the TLV record raw data
- Returns:
bool: True if data is valid and can be assigned
- property data_size
- Returns:
unsigned int
- get_value_as(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t, offset: int) int
- Args:
offset (unsigned int)
- Returns:
unsigned int
- property ipv4_option_type
IPv4 option type casted as pcpp.IPv4OptionTypes enum
- Returns:
enum pcpp.IPv4OptionTypes
- is_not_null(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t) bool
- Returns:
bool
- is_null(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t) bool
- Returns:
bool
- purge_record_data(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t) None
- property record_raw_data
- set_value(*args, **kwargs)
Overloaded function.
set_value(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t, new_value: int) -> bool
- Args:
new_value (unsigned int)
- Returns:
bool
set_value(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t, new_value: int, value_offset: int) -> bool
- Args:
new_value (unsigned int) value_offset (int)
- Returns:
bool
- property total_size
- Returns:
unsigned int
- property type
- Returns:
unsigned int
- property value
- property value_as_ip_list
A method for parsing the IPv4 option value as a list of IPv4 addresses. This method is relevant only for certain typesof IPv4 options which their value is a list of IPv4 addresses such as ::IPV4OPT_RecordRoute,::IPV4OPT_StrictSourceRoute, ::IPV4OPT_LooseSourceRoute, etc. This method returns a vector of the IPv4 addresses. A vector of IPv4 addresses parsed from the IPv4option value
- class mtf.libs.mtf_pybinder.pcpp.IPv4OptionBuilder
A class for building IPv4 option records. This builder receives the IPv4 option parameters in its c’tor, builds the IPv4 option raw buffer and provides a build() method to get a IPv4Option object out of it
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv4OptionBuilder, option_type: mtf.libs.mtf_pybinder.pcpp.IPv4OptionTypes, option_value: int, option_value_len: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv4OptionBuilder, option_type: mtf.libs.mtf_pybinder.pcpp.IPv4OptionTypes, option_value: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv4OptionBuilder, option_type: mtf.libs.mtf_pybinder.pcpp.IPv4OptionTypes, ip_list: list[mtf.libs.mtf_pybinder.pcpp.IPv4Address]) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv4OptionBuilder, timestamp_value: mtf.libs.mtf_pybinder.pcpp.IPv4TimestampOptionValue) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv4OptionBuilder, arg0: mtf.libs.mtf_pybinder.pcpp.IPv4OptionBuilder) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IPv4OptionBuilder, : mtf.libs.mtf_pybinder.pcpp.IPv4OptionBuilder) mtf.libs.mtf_pybinder.pcpp.IPv4OptionBuilder
- Returns:
pcpp.IPv4OptionBuilder
- build(self: mtf.libs.mtf_pybinder.pcpp.IPv4OptionBuilder) mtf.libs.mtf_pybinder.pcpp.IPv4Option
Build the IPv4Option object out of the parameters defined in the c’tor
- Returns:
pcpp.IPv4Option: The IPv4Option object
- class mtf.libs.mtf_pybinder.pcpp.IPv4OptionTypes
An enum for supported IPv4 option types
Members:
IPV4OPT_EndOfOptionsList
IPV4OPT_NOP
IPV4OPT_RecordRoute
IPV4OPT_MTUProbe
IPV4OPT_MTUReply
IPV4OPT_QuickStart
IPV4OPT_Timestamp
IPV4OPT_Traceroute
IPV4OPT_Security
IPV4OPT_LooseSourceRoute
IPV4OPT_ExtendedSecurity
IPV4OPT_CommercialSecurity
IPV4OPT_StreamID
IPV4OPT_StrictSourceRoute
IPV4OPT_ExtendedInternetProtocol
IPV4OPT_AddressExtension
IPV4OPT_RouterAlert
IPV4OPT_SelectiveDirectedBroadcast
IPV4OPT_DynamicPacketState
IPV4OPT_UpstreamMulticastPkt
IPV4OPT_Unknown
- IPV4OPT_AddressExtension
- IPV4OPT_CommercialSecurity
- IPV4OPT_DynamicPacketState
- IPV4OPT_EndOfOptionsList
- IPV4OPT_ExtendedInternetProtocol
- IPV4OPT_ExtendedSecurity
- IPV4OPT_LooseSourceRoute
- IPV4OPT_MTUProbe
- IPV4OPT_MTUReply
- IPV4OPT_NOP
- IPV4OPT_QuickStart
- IPV4OPT_RecordRoute
- IPV4OPT_RouterAlert
- IPV4OPT_Security
- IPV4OPT_SelectiveDirectedBroadcast
- IPV4OPT_StreamID
- IPV4OPT_StrictSourceRoute
- IPV4OPT_Timestamp
- IPV4OPT_Traceroute
- IPV4OPT_Unknown
- IPV4OPT_UpstreamMulticastPkt
- __init__(self: mtf.libs.mtf_pybinder.pcpp.IPv4OptionTypes, value: int) None
- __new__(**kwargs)
- property name
- property value
- class mtf.libs.mtf_pybinder.pcpp.IPv4TimestampOptionValue
A struct representing a parsed value of the IPv4 timestamp option. This struct is used returned in IPv4OptionData#getTimestampOptionValue() method
- TimestampAndIP
- TimestampOnly
- class TimestampType
An enum for IPv4 timestamp option types
Members:
TimestampOnly
TimestampAndIP
TimestampsForPrespecifiedIPs
Unknown
- TimestampAndIP
- TimestampOnly
- TimestampsForPrespecifiedIPs
- Unknown
- __init__(self: mtf.libs.mtf_pybinder.pcpp.IPv4TimestampOptionValue.TimestampType, value: int) None
- __new__(**kwargs)
- property name
- property value
- TimestampsForPrespecifiedIPs
- Unknown
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv4TimestampOptionValue) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv4TimestampOptionValue, arg0: mtf.libs.mtf_pybinder.pcpp.IPv4TimestampOptionValue) -> None
- __new__(**kwargs)
- clear(self: mtf.libs.mtf_pybinder.pcpp.IPv4TimestampOptionValue) None
Clear the structure. Clean the timestamps and IP addresses vectors and set the type asIPv4TimestampOptionValue#Unknown
- property ip_addresses
- property timestamps
- property type
- class mtf.libs.mtf_pybinder.pcpp.IPv4TotalLengthFilter
A class for filtering IPv4 traffic by “total length” field of the IPv4 protocol, For example: “filter only IPv4 traffic which “total length” value is less than 60B”<BR> For deeper understanding of the filter concept please refer to PcapFilter.h
- __init__(self: mtf.libs.mtf_pybinder.pcpp.IPv4TotalLengthFilter, total_length: int, op: mtf.libs.mtf_pybinder.pcpp.FilterOperator) None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IPv4TotalLengthFilter, : mtf.libs.mtf_pybinder.pcpp.IPv4TotalLengthFilter) mtf.libs.mtf_pybinder.pcpp.IPv4TotalLengthFilter
- Returns:
pcpp.IPv4TotalLengthFilter
- match_packet_with_filter(self: mtf.libs.mtf_pybinder.pcpp.GeneralFilter, raw_packet: mtf.libs.mtf_pybinder.pcpp.RawPacket) bool
Match a raw packet with a given BPF filter.
A pointer to the raw packet to match the BPF filter with True if a raw packet matches the BPF filter or false otherwise
- Args:
raw_packet (str)
- Returns:
bool
- parse_to_string(self: mtf.libs.mtf_pybinder.pcpp.GeneralFilter, result: str) None
A method that parses the class instance into BPF string format
An empty string that the parsing will be written into. If the string isn’t empty, its content will be overridden
- Args:
result (str)
- Returns:
void
- set_operator(self: mtf.libs.mtf_pybinder.pcpp.IFilterWithOperator, op: mtf.libs.mtf_pybinder.pcpp.FilterOperator) None
Set the operator for the filter
The operator to set
- Args:
op (str)
- Returns:
void
- set_total_length(self: mtf.libs.mtf_pybinder.pcpp.IPv4TotalLengthFilter, total_length: int) None
Set the total length value
- Args:
total_length (unsigned int): The total length value to filter
- Returns:
void
- class mtf.libs.mtf_pybinder.pcpp.IPv6Address
Represents an IPv6 address (of type xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx).
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv6Address) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv6Address, addr_as_string: str) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv6Address, arg0: mtf.libs.mtf_pybinder.pcpp.IPv6Address) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IPv6Address, : mtf.libs.mtf_pybinder.pcpp.IPv6Address) mtf.libs.mtf_pybinder.pcpp.IPv6Address
- Returns:
pcpp.IPv6Address
- copy_to(self: mtf.libs.mtf_pybinder.pcpp.IPv6Address, arr: int) None
Gets a pointer to an already allocated byte array and copies the address value to it. This method assumes array allocated size is at least 16 (the size of an IPv6 address)
- Args:
arr (bytes): A pointer to the array which address will be copied to
- is_multicast(self: mtf.libs.mtf_pybinder.pcpp.IPv6Address) bool
Determine whether the address is a multicast address
- Returns:
bool: True if an address is multicast
- match_network(*args, **kwargs)
Overloaded function.
match_network(self: mtf.libs.mtf_pybinder.pcpp.IPv6Address, network: pcpp::IPv6Network) -> bool
Checks whether the address matches a network.
- Args:
network (pcpp.IPv6Network): An IPv6Network network
- Returns:
bool: True if the address matches the network or false otherwise
match_network(self: mtf.libs.mtf_pybinder.pcpp.IPv6Address, network: str) -> bool
Checks whether the address matches a network. For example: this method will return true for address d6e5:83dc:0c58:bc5d:1449:5898:: and network which is one of: d6e5:83dc:0c58:bc5d::/64,d6e5:83dc:0c58:bc5d::/ffff:ffff:ffff:ffff:: Another example: this method will return false for address d6e5:83dc::and network which is one of: d6e5:83dc:0c58:bc5d::/64, d6e5:83dc:0c58:bc5d::/ffff:ffff:ffff:ffff:
- Args:
network (str): A stringin one of these formats:
IPV6_ADDRESS/Y where IPV6_ADDRESS is a valid IPv6 address and Y is a number between 0and 128
IPV6_ADDRESS/IPV6_NETMASK where IPV6_ADDRESS is a valid IPv6 address and IPV6_NETMASK is a valid IPv6 netmask
- Returns:
bool: True if the address matches the network or false if it doesn’t or if the network is invalid
- to_bytes(self: mtf.libs.mtf_pybinder.pcpp.IPv6Address) int
- Returns:
bytes: A non-owning pointer to 16-byte array representing the IPv6 address
- to_string(self: mtf.libs.mtf_pybinder.pcpp.IPv6Address) str
- Returns:
str: A string representation of the address
- class mtf.libs.mtf_pybinder.pcpp.IPv6AuthenticationHeader
Represents IPv6 authentication header extension (used in IPSec protocol) and allows easy access to all of its data
- IPv6AuthenticationHdr
- IPv6Destination
- class IPv6ExtensionType
An enum representing all supported IPv6 extension types
Members:
IPv6HopByHop
IPv6Routing
IPv6Fragmentation
IPv6AuthenticationHdr
IPv6Destination
IPv6ExtensionUnknown
- IPv6AuthenticationHdr
- IPv6Destination
- IPv6ExtensionUnknown
- IPv6Fragmentation
- IPv6HopByHop
- IPv6Routing
- __init__(self: mtf.libs.mtf_pybinder.pcpp.IPv6Extension.IPv6ExtensionType, value: int) None
- __new__(**kwargs)
- property name
- property value
- IPv6ExtensionUnknown
- IPv6Fragmentation
- IPv6HopByHop
- IPv6Routing
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv6AuthenticationHeader, security_parameters_index: int, sequence_number: int, integrity_check_value: list[int]) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv6AuthenticationHeader, arg0: mtf.libs.mtf_pybinder.pcpp.IPv6AuthenticationHeader) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv6AuthenticationHeader, arg0: mtf.libs.mtf_pybinder.pcpp.IPv6AuthenticationHeader) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IPv6AuthenticationHeader, : mtf.libs.mtf_pybinder.pcpp.IPv6AuthenticationHeader) mtf.libs.mtf_pybinder.pcpp.IPv6AuthenticationHeader
- Returns:
pcpp.IPv6AuthenticationHeader
- property extension_len
The size of extension in bytes, meaning (for most extensions): 8 * ([headerLen field] + 1)
- Returns:
unsigned int
- property extension_type
The type of the extension
- Returns:
enum pcpp.IPv6Extension.IPv6ExtensionType
- property integrity_check_value
A pointer to the buffer containing the integrity check value (ICV) for this extension. Notice that any change inthis buffer will lead to a change in the extension data
- property integrity_check_value_length
The length of the integrity check value (ICV) buffer
- Returns:
unsigned int
- property next_header
Next header type
- property security_parameters_index
The 32-bit SPI value
- Returns:
unsigned int
- property sequence_number
The packet sequence number
- Returns:
unsigned int
- class mtf.libs.mtf_pybinder.pcpp.IPv6DestinationHeader
Represents IPv6 destination extension header and allows easy access to all of its data including the TLV options stored in it
- IPv6AuthenticationHdr
- IPv6Destination
- class IPv6ExtensionType
An enum representing all supported IPv6 extension types
Members:
IPv6HopByHop
IPv6Routing
IPv6Fragmentation
IPv6AuthenticationHdr
IPv6Destination
IPv6ExtensionUnknown
- IPv6AuthenticationHdr
- IPv6Destination
- IPv6ExtensionUnknown
- IPv6Fragmentation
- IPv6HopByHop
- IPv6Routing
- __init__(self: mtf.libs.mtf_pybinder.pcpp.IPv6Extension.IPv6ExtensionType, value: int) None
- __new__(**kwargs)
- property name
- property value
- IPv6ExtensionUnknown
- IPv6Fragmentation
- IPv6HopByHop
- class IPv6Option
A class representing a Type-Length-Value (TLV) options that are used inside Hop-By-Hop and Destinations IPv6 extensions. This class does not create or modify IPv6 option records, but rather serves as a wrapper and provides useful methods for retrieving data from them
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader.IPv6Option, option_raw_data: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader.IPv6Option, arg0: mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader.IPv6Option) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader.IPv6Option, arg0: mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader.IPv6Option) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader.IPv6Option, : mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader.IPv6Option) mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader.IPv6Option
- Returns:
pcpp.IPv6TLVOptionHeader.IPv6Option
- static can_assign(record_raw_data: int, tlv_data_len: int) bool
Check if a pointer can be assigned to the TLV record data
- Args:
record_raw_data (bytes): A pointer to the TLV record raw data tlv_data_len (unsigned int): The size of the TLV record raw data
- Returns:
bool: True if data is valid and can be assigned
- property data_size
- Returns:
unsigned int
- get_value_as(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t, offset: int) int
- Args:
offset (unsigned int)
- Returns:
unsigned int
- is_not_null(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t) bool
- Returns:
bool
- is_null(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t) bool
- Returns:
bool
- purge_record_data(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t) None
- property record_raw_data
- set_value(*args, **kwargs)
Overloaded function.
set_value(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t, new_value: int) -> bool
- Args:
new_value (unsigned int)
- Returns:
bool
set_value(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t, new_value: int, value_offset: int) -> bool
- Args:
new_value (unsigned int) value_offset (int)
- Returns:
bool
- property total_size
- Returns:
unsigned int
- property type
- Returns:
unsigned int
- property value
- IPv6Routing
- class IPv6TLVOptionBuilder
A class for building IPv6 Type-Length-Value (TLV) options. This builder receives the option parameters in its c’tor, builds the option raw buffer and provides a method to build a IPv6Option object out of it
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader.IPv6TLVOptionBuilder, opt_type: int, opt_value: list[int]) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader.IPv6TLVOptionBuilder, opt_type: int, opt_value: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader.IPv6TLVOptionBuilder, opt_type: int, opt_value: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader.IPv6TLVOptionBuilder, arg0: mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader.IPv6TLVOptionBuilder) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader.IPv6TLVOptionBuilder, other: mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader.IPv6TLVOptionBuilder) mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader.IPv6TLVOptionBuilder
Assignment operator that copies all data from another instance of IPv6TLVOptionBuilder
- Args:
other (pcpp.IPv6TLVOptionHeader.IPv6TLVOptionBuilder): The instance to assign from
- Returns:
pcpp.IPv6TLVOptionHeader.IPv6TLVOptionBuilder
- build(self: mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader.IPv6TLVOptionBuilder) mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader.IPv6Option
Build the IPv6Option object out of the parameters defined in the c’tor
- Returns:
pcpp.IPv6TLVOptionHeader.IPv6Option: The IPv6Option object
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv6DestinationHeader, options: list[mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader.IPv6TLVOptionBuilder]) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv6DestinationHeader, arg0: mtf.libs.mtf_pybinder.pcpp.IPv6DestinationHeader) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv6DestinationHeader, arg0: mtf.libs.mtf_pybinder.pcpp.IPv6DestinationHeader) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IPv6DestinationHeader, : mtf.libs.mtf_pybinder.pcpp.IPv6DestinationHeader) mtf.libs.mtf_pybinder.pcpp.IPv6DestinationHeader
- Returns:
pcpp.IPv6DestinationHeader
- property extension_len
The size of extension in bytes, meaning (for most extensions): 8 * ([headerLen field] + 1)
- Returns:
unsigned int
- property extension_type
The type of the extension
- Returns:
enum pcpp.IPv6Extension.IPv6ExtensionType
- get_first_option(self: mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader) pcpp::IPv6TLVOptionHeader::IPv6Option
An IPv6Option that wraps the first option data or logical NULL (IPv6Option#isNull() == true) if no optionsexist
- Returns:
pcpp.IPv6TLVOptionHeader.IPv6Option
- get_next_option(self: mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader, option: pcpp::IPv6TLVOptionHeader::IPv6Option) pcpp::IPv6TLVOptionHeader::IPv6Option
Returns a pointer to the option that comes after the option given as the parameter
- Args:
option (pcpp.IPv6TLVOptionHeader.IPv6Option): A pointer to an optioninstance
- Returns:
pcpp.IPv6TLVOptionHeader.IPv6Option: An IPv6Option object that wraps the option data. In the following cases logical NULL(IPv6Option#isNull() == true)
is returned: (1) input parameter is out-of-bounds for this extension or (2) thenext option doesn’t exist or (3) the input option is NULL
- get_option(self: mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader, option_type: int) pcpp::IPv6TLVOptionHeader::IPv6Option
Retrieve an option by its type
- Args:
option_type (unsigned int): Option type
- Returns:
pcpp.IPv6TLVOptionHeader.IPv6Option: An IPv6Option object that wraps the option data. If optionisn’t found a logical NULL is returned
(IPv6Option#isNull() == true)
- property next_header
Next header type
- property option_count
The number of options this IPv6 extension contains
- Returns:
unsigned int
- class mtf.libs.mtf_pybinder.pcpp.IPv6Extension
A base class for all supported IPv6 extensions. This class is abstract, meaning it cannot be instantiated or copied (has private c’tor and copy c’tor)
- IPv6AuthenticationHdr
- IPv6Destination
- class IPv6ExtensionType
An enum representing all supported IPv6 extension types
Members:
IPv6HopByHop
IPv6Routing
IPv6Fragmentation
IPv6AuthenticationHdr
IPv6Destination
IPv6ExtensionUnknown
- IPv6AuthenticationHdr
- IPv6Destination
- IPv6ExtensionUnknown
- IPv6Fragmentation
- IPv6HopByHop
- IPv6Routing
- __init__(self: mtf.libs.mtf_pybinder.pcpp.IPv6Extension.IPv6ExtensionType, value: int) None
- __new__(**kwargs)
- property name
- property value
- IPv6ExtensionUnknown
- IPv6Fragmentation
- IPv6HopByHop
- IPv6Routing
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv6Extension, arg0: mtf.libs.mtf_pybinder.pcpp.IPv6Extension) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv6Extension, arg0: mtf.libs.mtf_pybinder.pcpp.IPv6Extension) -> None
- __new__(**kwargs)
- property extension_len
The size of extension in bytes, meaning (for most extensions): 8 * ([headerLen field] + 1)
- Returns:
unsigned int
- property extension_type
The type of the extension
- Returns:
enum pcpp.IPv6Extension.IPv6ExtensionType
- property next_header
Next header type
- class mtf.libs.mtf_pybinder.pcpp.IPv6FragmentationHeader
Represents an IPv6 fragmentation extension header and allows easy access to all fragmentation parameters
- IPv6AuthenticationHdr
- IPv6Destination
- class IPv6ExtensionType
An enum representing all supported IPv6 extension types
Members:
IPv6HopByHop
IPv6Routing
IPv6Fragmentation
IPv6AuthenticationHdr
IPv6Destination
IPv6ExtensionUnknown
- IPv6AuthenticationHdr
- IPv6Destination
- IPv6ExtensionUnknown
- IPv6Fragmentation
- IPv6HopByHop
- IPv6Routing
- __init__(self: mtf.libs.mtf_pybinder.pcpp.IPv6Extension.IPv6ExtensionType, value: int) None
- __new__(**kwargs)
- property name
- property value
- IPv6ExtensionUnknown
- IPv6Fragmentation
- IPv6HopByHop
- IPv6Routing
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv6FragmentationHeader, frag_id: int, frag_offset: int, last_fragment: bool) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv6FragmentationHeader, arg0: mtf.libs.mtf_pybinder.pcpp.IPv6FragmentationHeader) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv6FragmentationHeader, arg0: mtf.libs.mtf_pybinder.pcpp.IPv6FragmentationHeader) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IPv6FragmentationHeader, : mtf.libs.mtf_pybinder.pcpp.IPv6FragmentationHeader) mtf.libs.mtf_pybinder.pcpp.IPv6FragmentationHeader
- Returns:
pcpp.IPv6FragmentationHeader
- property extension_len
The size of extension in bytes, meaning (for most extensions): 8 * ([headerLen field] + 1)
- Returns:
unsigned int
- property extension_type
The type of the extension
- Returns:
enum pcpp.IPv6Extension.IPv6ExtensionType
- property fragment_id
The fragment ID
- Returns:
unsigned int
- property fragment_offset
The fragment offset
- Returns:
unsigned int
- is_first_fragment(self: mtf.libs.mtf_pybinder.pcpp.IPv6FragmentationHeader) bool
True if this is the first fragment (which usually contains the L4 header), false otherwise
- Returns:
bool
- is_last_fragment(self: mtf.libs.mtf_pybinder.pcpp.IPv6FragmentationHeader) bool
True if this is the last fragment, false otherwise
- Returns:
bool
- is_more_fragments(self: mtf.libs.mtf_pybinder.pcpp.IPv6FragmentationHeader) bool
True if the “more fragments” bit is set, meaning more fragments are expected to follow this fragment
- Returns:
bool
- property next_header
Next header type
- class mtf.libs.mtf_pybinder.pcpp.IPv6HopByHopHeader
Represents IPv6 Hop-By-Hop extension header and allows easy access to all of its data including the TLV options stored
- IPv6AuthenticationHdr
- IPv6Destination
- class IPv6ExtensionType
An enum representing all supported IPv6 extension types
Members:
IPv6HopByHop
IPv6Routing
IPv6Fragmentation
IPv6AuthenticationHdr
IPv6Destination
IPv6ExtensionUnknown
- IPv6AuthenticationHdr
- IPv6Destination
- IPv6ExtensionUnknown
- IPv6Fragmentation
- IPv6HopByHop
- IPv6Routing
- __init__(self: mtf.libs.mtf_pybinder.pcpp.IPv6Extension.IPv6ExtensionType, value: int) None
- __new__(**kwargs)
- property name
- property value
- IPv6ExtensionUnknown
- IPv6Fragmentation
- IPv6HopByHop
- class IPv6Option
A class representing a Type-Length-Value (TLV) options that are used inside Hop-By-Hop and Destinations IPv6 extensions. This class does not create or modify IPv6 option records, but rather serves as a wrapper and provides useful methods for retrieving data from them
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader.IPv6Option, option_raw_data: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader.IPv6Option, arg0: mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader.IPv6Option) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader.IPv6Option, arg0: mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader.IPv6Option) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader.IPv6Option, : mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader.IPv6Option) mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader.IPv6Option
- Returns:
pcpp.IPv6TLVOptionHeader.IPv6Option
- static can_assign(record_raw_data: int, tlv_data_len: int) bool
Check if a pointer can be assigned to the TLV record data
- Args:
record_raw_data (bytes): A pointer to the TLV record raw data tlv_data_len (unsigned int): The size of the TLV record raw data
- Returns:
bool: True if data is valid and can be assigned
- property data_size
- Returns:
unsigned int
- get_value_as(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t, offset: int) int
- Args:
offset (unsigned int)
- Returns:
unsigned int
- is_not_null(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t) bool
- Returns:
bool
- is_null(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t) bool
- Returns:
bool
- purge_record_data(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t) None
- property record_raw_data
- set_value(*args, **kwargs)
Overloaded function.
set_value(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t, new_value: int) -> bool
- Args:
new_value (unsigned int)
- Returns:
bool
set_value(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t, new_value: int, value_offset: int) -> bool
- Args:
new_value (unsigned int) value_offset (int)
- Returns:
bool
- property total_size
- Returns:
unsigned int
- property type
- Returns:
unsigned int
- property value
- IPv6Routing
- class IPv6TLVOptionBuilder
A class for building IPv6 Type-Length-Value (TLV) options. This builder receives the option parameters in its c’tor, builds the option raw buffer and provides a method to build a IPv6Option object out of it
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader.IPv6TLVOptionBuilder, opt_type: int, opt_value: list[int]) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader.IPv6TLVOptionBuilder, opt_type: int, opt_value: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader.IPv6TLVOptionBuilder, opt_type: int, opt_value: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader.IPv6TLVOptionBuilder, arg0: mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader.IPv6TLVOptionBuilder) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader.IPv6TLVOptionBuilder, other: mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader.IPv6TLVOptionBuilder) mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader.IPv6TLVOptionBuilder
Assignment operator that copies all data from another instance of IPv6TLVOptionBuilder
- Args:
other (pcpp.IPv6TLVOptionHeader.IPv6TLVOptionBuilder): The instance to assign from
- Returns:
pcpp.IPv6TLVOptionHeader.IPv6TLVOptionBuilder
- build(self: mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader.IPv6TLVOptionBuilder) mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader.IPv6Option
Build the IPv6Option object out of the parameters defined in the c’tor
- Returns:
pcpp.IPv6TLVOptionHeader.IPv6Option: The IPv6Option object
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv6HopByHopHeader, options: list[mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader.IPv6TLVOptionBuilder]) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv6HopByHopHeader, arg0: mtf.libs.mtf_pybinder.pcpp.IPv6HopByHopHeader) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv6HopByHopHeader, arg0: mtf.libs.mtf_pybinder.pcpp.IPv6HopByHopHeader) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IPv6HopByHopHeader, : mtf.libs.mtf_pybinder.pcpp.IPv6HopByHopHeader) mtf.libs.mtf_pybinder.pcpp.IPv6HopByHopHeader
- Returns:
pcpp.IPv6HopByHopHeader
- property extension_len
The size of extension in bytes, meaning (for most extensions): 8 * ([headerLen field] + 1)
- Returns:
unsigned int
- property extension_type
The type of the extension
- Returns:
enum pcpp.IPv6Extension.IPv6ExtensionType
- get_first_option(self: mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader) pcpp::IPv6TLVOptionHeader::IPv6Option
An IPv6Option that wraps the first option data or logical NULL (IPv6Option#isNull() == true) if no optionsexist
- Returns:
pcpp.IPv6TLVOptionHeader.IPv6Option
- get_next_option(self: mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader, option: pcpp::IPv6TLVOptionHeader::IPv6Option) pcpp::IPv6TLVOptionHeader::IPv6Option
Returns a pointer to the option that comes after the option given as the parameter
- Args:
option (pcpp.IPv6TLVOptionHeader.IPv6Option): A pointer to an optioninstance
- Returns:
pcpp.IPv6TLVOptionHeader.IPv6Option: An IPv6Option object that wraps the option data. In the following cases logical NULL(IPv6Option#isNull() == true)
is returned: (1) input parameter is out-of-bounds for this extension or (2) thenext option doesn’t exist or (3) the input option is NULL
- get_option(self: mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader, option_type: int) pcpp::IPv6TLVOptionHeader::IPv6Option
Retrieve an option by its type
- Args:
option_type (unsigned int): Option type
- Returns:
pcpp.IPv6TLVOptionHeader.IPv6Option: An IPv6Option object that wraps the option data. If optionisn’t found a logical NULL is returned
(IPv6Option#isNull() == true)
- property next_header
Next header type
- property option_count
The number of options this IPv6 extension contains
- Returns:
unsigned int
- class mtf.libs.mtf_pybinder.pcpp.IPv6Layer
Represents an IPv6 protocol layer
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv6Layer, data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: pcpp::Packet) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv6Layer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv6Layer, src_ip: mtf.libs.mtf_pybinder.pcpp.IPv6Address, dst_ip: mtf.libs.mtf_pybinder.pcpp.IPv6Address) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv6Layer, arg0: mtf.libs.mtf_pybinder.pcpp.IPv6Layer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv6Layer, arg0: mtf.libs.mtf_pybinder.pcpp.IPv6Layer) -> None
- __new__(**kwargs)
- add_authentication_extension(self: mtf.libs.mtf_pybinder.pcpp.IPv6Layer, arg0: mtf.libs.mtf_pybinder.pcpp.IPv6AuthenticationHeader) None
- add_destination_extension(self: mtf.libs.mtf_pybinder.pcpp.IPv6Layer, arg0: mtf.libs.mtf_pybinder.pcpp.IPv6DestinationHeader) None
- add_fragmentation_extension(self: mtf.libs.mtf_pybinder.pcpp.IPv6Layer, arg0: mtf.libs.mtf_pybinder.pcpp.IPv6FragmentationHeader) None
- add_hop_by_hop_extension(self: mtf.libs.mtf_pybinder.pcpp.IPv6Layer, arg0: mtf.libs.mtf_pybinder.pcpp.IPv6HopByHopHeader) None
- add_routing_extension(self: mtf.libs.mtf_pybinder.pcpp.IPv6Layer, arg0: mtf.libs.mtf_pybinder.pcpp.IPv6RoutingHeader) None
- assign(self: mtf.libs.mtf_pybinder.pcpp.IPv6Layer, other: mtf.libs.mtf_pybinder.pcpp.IPv6Layer) mtf.libs.mtf_pybinder.pcpp.IPv6Layer
An assignment operator that first delete all data from current layer and then copy the entire header from the otherIPv6Layer (including IPv6 extensions)
- Args:
other (pcpp.IPv6Layer)
- Returns:
pcpp.IPv6Layer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- property dst_ipv6_address
Destination IP address in the form of IPv6Address
- property extension_count
Number of IPv6 extensions in this layer
- Returns:
unsigned int
- property flow_label
20-bit flow label
- get_authentication_extension(self: mtf.libs.mtf_pybinder.pcpp.IPv6Layer) mtf.libs.mtf_pybinder.pcpp.IPv6AuthenticationHeader
- get_destination_extension(self: mtf.libs.mtf_pybinder.pcpp.IPv6Layer) mtf.libs.mtf_pybinder.pcpp.IPv6DestinationHeader
- get_dst_ip_address(self: mtf.libs.mtf_pybinder.pcpp.IPLayer) mtf.libs.mtf_pybinder.pcpp.IPAddress
An abstract method to get the destination IP address
- Returns:
pcpp.IPAddress: An IPAddress object containing the destination address
- get_fragmentation_extension(self: mtf.libs.mtf_pybinder.pcpp.IPv6Layer) mtf.libs.mtf_pybinder.pcpp.IPv6FragmentationHeader
- get_hop_by_hop_extension(self: mtf.libs.mtf_pybinder.pcpp.IPv6Layer) mtf.libs.mtf_pybinder.pcpp.IPv6HopByHopHeader
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- get_routing_extension(self: mtf.libs.mtf_pybinder.pcpp.IPv6Layer) mtf.libs.mtf_pybinder.pcpp.IPv6RoutingHeader
- get_src_ip_address(self: mtf.libs.mtf_pybinder.pcpp.IPLayer) mtf.libs.mtf_pybinder.pcpp.IPAddress
An abstract method to get the source IP address
- Returns:
pcpp.IPAddress: An IPAddress object containing the source address
- property header_len
The header length in bytes
- Returns:
unsigned int
- property hop_limit
Hop limit value
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- static is_data_valid(data: int, data_len: int) bool
The static method makes validation of input data
- Args:
data (bytes): The pointer to the beginning of byte stream of IPpacket data_len (unsigned int): The length of byte stream
- Returns:
bool: True if the data is valid and can represent the IPv6packet
- is_fragment(self: mtf.libs.mtf_pybinder.pcpp.IPv6Layer) bool
True if this packet is an IPv6 fragment, meaning if it has an IPv6FragmentationHeader extension
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property next_header
Type of the next header
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property payload_length
Size of the payload, including any extension headers
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- remove_all_extensions(self: mtf.libs.mtf_pybinder.pcpp.IPv6Layer) None
Remove all IPv6 extensions in this layer
- property src_ipv6_address
Source IP address in the form of IPv6Address
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- property traffic_class
8-bit traffic class field
- property version
Internet Protocol version number (6 for IPv6)
- class mtf.libs.mtf_pybinder.pcpp.IPv6Network
A class representing IPv6 network definition
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv6Network, address: mtf.libs.mtf_pybinder.pcpp.IPv6Address, prefix_len: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv6Network, address: mtf.libs.mtf_pybinder.pcpp.IPv6Address, netmask: str) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv6Network, address_and_netmask: str) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv6Network, arg0: mtf.libs.mtf_pybinder.pcpp.IPv6Network) -> None
- __new__(**kwargs)
- get_highest_address(self: mtf.libs.mtf_pybinder.pcpp.IPv6Network) mtf.libs.mtf_pybinder.pcpp.IPv6Address
The highest IPv6 address in this network, for example: the highest address in 3546::/16 is 3546:ffff:ffff:ffff:ffff:ffff:ffff:ffff
- Returns:
pcpp.IPv6Address
- get_lowest_address(self: mtf.libs.mtf_pybinder.pcpp.IPv6Network) mtf.libs.mtf_pybinder.pcpp.IPv6Address
The lowest non-reserved IPv6 address in this network, for example: the lowest address in 3546::/16 is 3546::1
- Returns:
pcpp.IPv6Address
- get_netmask(self: mtf.libs.mtf_pybinder.pcpp.IPv6Network) str
The netmask, for example: the netmask of 3546::/16 is ffff:
- Returns:
str
- get_network_prefix(self: mtf.libs.mtf_pybinder.pcpp.IPv6Network) mtf.libs.mtf_pybinder.pcpp.IPv6Address
The network prefix, for example: the network prefix of 3546:f321::/16 is 3546:
- Returns:
pcpp.IPv6Address
- get_prefix_len(self: mtf.libs.mtf_pybinder.pcpp.IPv6Network) int
The prefix length, for example: the prefix length of 3546::/ffff:: is 16
- Returns:
unsigned int
- get_total_address_count(self: mtf.libs.mtf_pybinder.pcpp.IPv6Network) int
The number of addresses in this network, for example: the number of addresses in 16ff::/120 is 256. If the number of addresses exceeds the size of uint64_t a std::out_of_range exception is thrown
- Returns:
unsigned int
- includes(*args, **kwargs)
Overloaded function.
includes(self: mtf.libs.mtf_pybinder.pcpp.IPv6Network, address: mtf.libs.mtf_pybinder.pcpp.IPv6Address) -> bool
An IPv6 address True is the address belongs to the network, false otherwise or if the address isn’tvalid
- Args:
address (pcpp.IPv6Address)
- Returns:
bool
includes(self: mtf.libs.mtf_pybinder.pcpp.IPv6Network, network: mtf.libs.mtf_pybinder.pcpp.IPv6Network) -> bool
An IPv6 network True if the input network is completely included within this network, false otherwise, for example: 3546::/64 includes 3546::/120 but doesn’t include 3546::/16
- Args:
network (pcpp.IPv6Network)
- Returns:
bool
- to_string(self: mtf.libs.mtf_pybinder.pcpp.IPv6Network) str
A string representation of the network in a format of NETWORK_PREFIX/PREFIX_LEN, for example: fda7:9f81:6c23:275::/64
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.IPv6RoutingHeader
Represents IPv6 routing extension header and allows easy access to all of its data
- IPv6AuthenticationHdr
- IPv6Destination
- class IPv6ExtensionType
An enum representing all supported IPv6 extension types
Members:
IPv6HopByHop
IPv6Routing
IPv6Fragmentation
IPv6AuthenticationHdr
IPv6Destination
IPv6ExtensionUnknown
- IPv6AuthenticationHdr
- IPv6Destination
- IPv6ExtensionUnknown
- IPv6Fragmentation
- IPv6HopByHop
- IPv6Routing
- __init__(self: mtf.libs.mtf_pybinder.pcpp.IPv6Extension.IPv6ExtensionType, value: int) None
- __new__(**kwargs)
- property name
- property value
- IPv6ExtensionUnknown
- IPv6Fragmentation
- IPv6HopByHop
- IPv6Routing
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv6RoutingHeader, routing_type: int, segments_left: int, additional_routing_data: list[int]) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv6RoutingHeader, arg0: mtf.libs.mtf_pybinder.pcpp.IPv6RoutingHeader) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv6RoutingHeader, arg0: mtf.libs.mtf_pybinder.pcpp.IPv6RoutingHeader) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IPv6RoutingHeader, : mtf.libs.mtf_pybinder.pcpp.IPv6RoutingHeader) mtf.libs.mtf_pybinder.pcpp.IPv6RoutingHeader
- Returns:
pcpp.IPv6RoutingHeader
- property extension_len
The size of extension in bytes, meaning (for most extensions): 8 * ([headerLen field] + 1)
- Returns:
unsigned int
- property extension_type
The type of the extension
- Returns:
enum pcpp.IPv6Extension.IPv6ExtensionType
- get_routing_additional_data_as_ipv6_address(*args, **kwargs)
Overloaded function.
get_routing_additional_data_as_ipv6_address(self: mtf.libs.mtf_pybinder.pcpp.IPv6RoutingHeader) -> mtf.libs.mtf_pybinder.pcpp.IPv6Address
- Returns:
pcpp.IPv6Address
get_routing_additional_data_as_ipv6_address(self: mtf.libs.mtf_pybinder.pcpp.IPv6RoutingHeader, offset: int) -> mtf.libs.mtf_pybinder.pcpp.IPv6Address
In many cases the additional routing data is actually IPv6 address(es). This method converts the raw buffer datainto an IPv6 address An offset in the additional routing buffer pointing to where the IPv6 address begins. Insome cases there are multiple IPv6 addresses in the additional routing data buffer so this offset points to wherethe request IPv6 address begins. Also, even if there is only one IPv6 address in this buffer, sometimes it isn’twritten in the beginning of the buffer, so the offset points to where the IPv6 address begins. This is an optionalparameter and the default offset is 0 The IPv6 address stored in the additional routing data buffer from theoffset defined by the user. If offset is out-of-bounds of the extension of doesn’t have 16 bytes (== the length ofIPv6 address) until the end of the buffer - IPv6Address#Zero is returned
- Args:
offset (unsigned int)
- Returns:
pcpp.IPv6Address
- property next_header
Next header type
- property routing_additional_data
A pointer to the buffer containing the additional routing data for this extension. Notice that any change in thisbuffer will lead to a change in the extension data
- property routing_additional_data_length
The length of the additional routing parameters buffer
- Returns:
unsigned int
- property routing_type
The routing type identifier
- Returns:
unsigned int
- property segments_left
The number of route segments remaining
- Returns:
unsigned int
- class mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader
An abstract base class for Hop-By-Hop and Destination IPv6 extensions which their structure contains Type-Length-Value (TLV) options. This class provides access to these options and their data as well as methods to create new options. Notice this class is abstract and cannot be instantiated
- IPv6AuthenticationHdr
- IPv6Destination
- class IPv6ExtensionType
An enum representing all supported IPv6 extension types
Members:
IPv6HopByHop
IPv6Routing
IPv6Fragmentation
IPv6AuthenticationHdr
IPv6Destination
IPv6ExtensionUnknown
- IPv6AuthenticationHdr
- IPv6Destination
- IPv6ExtensionUnknown
- IPv6Fragmentation
- IPv6HopByHop
- IPv6Routing
- __init__(self: mtf.libs.mtf_pybinder.pcpp.IPv6Extension.IPv6ExtensionType, value: int) None
- __new__(**kwargs)
- property name
- property value
- IPv6ExtensionUnknown
- IPv6Fragmentation
- IPv6HopByHop
- class IPv6Option
A class representing a Type-Length-Value (TLV) options that are used inside Hop-By-Hop and Destinations IPv6 extensions. This class does not create or modify IPv6 option records, but rather serves as a wrapper and provides useful methods for retrieving data from them
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader.IPv6Option, option_raw_data: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader.IPv6Option, arg0: mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader.IPv6Option) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader.IPv6Option, arg0: mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader.IPv6Option) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader.IPv6Option, : mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader.IPv6Option) mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader.IPv6Option
- Returns:
pcpp.IPv6TLVOptionHeader.IPv6Option
- static can_assign(record_raw_data: int, tlv_data_len: int) bool
Check if a pointer can be assigned to the TLV record data
- Args:
record_raw_data (bytes): A pointer to the TLV record raw data tlv_data_len (unsigned int): The size of the TLV record raw data
- Returns:
bool: True if data is valid and can be assigned
- property data_size
- Returns:
unsigned int
- get_value_as(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t, offset: int) int
- Args:
offset (unsigned int)
- Returns:
unsigned int
- is_not_null(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t) bool
- Returns:
bool
- is_null(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t) bool
- Returns:
bool
- purge_record_data(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t) None
- property record_raw_data
- set_value(*args, **kwargs)
Overloaded function.
set_value(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t, new_value: int) -> bool
- Args:
new_value (unsigned int)
- Returns:
bool
set_value(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t, new_value: int, value_offset: int) -> bool
- Args:
new_value (unsigned int) value_offset (int)
- Returns:
bool
- property total_size
- Returns:
unsigned int
- property type
- Returns:
unsigned int
- property value
- IPv6Routing
- class IPv6TLVOptionBuilder
A class for building IPv6 Type-Length-Value (TLV) options. This builder receives the option parameters in its c’tor, builds the option raw buffer and provides a method to build a IPv6Option object out of it
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader.IPv6TLVOptionBuilder, opt_type: int, opt_value: list[int]) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader.IPv6TLVOptionBuilder, opt_type: int, opt_value: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader.IPv6TLVOptionBuilder, opt_type: int, opt_value: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader.IPv6TLVOptionBuilder, arg0: mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader.IPv6TLVOptionBuilder) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader.IPv6TLVOptionBuilder, other: mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader.IPv6TLVOptionBuilder) mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader.IPv6TLVOptionBuilder
Assignment operator that copies all data from another instance of IPv6TLVOptionBuilder
- Args:
other (pcpp.IPv6TLVOptionHeader.IPv6TLVOptionBuilder): The instance to assign from
- Returns:
pcpp.IPv6TLVOptionHeader.IPv6TLVOptionBuilder
- build(self: mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader.IPv6TLVOptionBuilder) mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader.IPv6Option
Build the IPv6Option object out of the parameters defined in the c’tor
- Returns:
pcpp.IPv6TLVOptionHeader.IPv6Option: The IPv6Option object
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader, arg0: mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader, arg0: mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader, : mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader) mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader
- Returns:
pcpp.IPv6TLVOptionHeader
- property extension_len
The size of extension in bytes, meaning (for most extensions): 8 * ([headerLen field] + 1)
- Returns:
unsigned int
- property extension_type
The type of the extension
- Returns:
enum pcpp.IPv6Extension.IPv6ExtensionType
- get_first_option(self: mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader) pcpp::IPv6TLVOptionHeader::IPv6Option
An IPv6Option that wraps the first option data or logical NULL (IPv6Option#isNull() == true) if no optionsexist
- Returns:
pcpp.IPv6TLVOptionHeader.IPv6Option
- get_next_option(self: mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader, option: pcpp::IPv6TLVOptionHeader::IPv6Option) pcpp::IPv6TLVOptionHeader::IPv6Option
Returns a pointer to the option that comes after the option given as the parameter
- Args:
option (pcpp.IPv6TLVOptionHeader.IPv6Option): A pointer to an optioninstance
- Returns:
pcpp.IPv6TLVOptionHeader.IPv6Option: An IPv6Option object that wraps the option data. In the following cases logical NULL(IPv6Option#isNull() == true)
is returned: (1) input parameter is out-of-bounds for this extension or (2) thenext option doesn’t exist or (3) the input option is NULL
- get_option(self: mtf.libs.mtf_pybinder.pcpp.IPv6TLVOptionHeader, option_type: int) pcpp::IPv6TLVOptionHeader::IPv6Option
Retrieve an option by its type
- Args:
option_type (unsigned int): Option type
- Returns:
pcpp.IPv6TLVOptionHeader.IPv6Option: An IPv6Option object that wraps the option data. If optionisn’t found a logical NULL is returned
(IPv6Option#isNull() == true)
- property next_header
Next header type
- property option_count
The number of options this IPv6 extension contains
- Returns:
unsigned int
- class mtf.libs.mtf_pybinder.pcpp.IcmpAddressMaskLayer
Represents an ICMP protocol layer (for IPv4 only)
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IcmpAddressMaskLayer, direction: mtf.libs.mtf_pybinder.pcpp.IcmpDirection, code: int, identifier: int, sequence_nr: int, address_mask: mtf.libs.mtf_pybinder.pcpp.IPv4Address) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IcmpAddressMaskLayer, arg0: mtf.libs.mtf_pybinder.pcpp.IcmpAddressMaskLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IcmpAddressMaskLayer, arg0: mtf.libs.mtf_pybinder.pcpp.IcmpAddressMaskLayer) -> None
- __new__(**kwargs)
- property address_mask
32-bit mask
- assign(self: mtf.libs.mtf_pybinder.pcpp.IcmpAddressMaskLayer, : mtf.libs.mtf_pybinder.pcpp.IcmpAddressMaskLayer) mtf.libs.mtf_pybinder.pcpp.IcmpAddressMaskLayer
- Returns:
pcpp.IcmpAddressMaskLayer
- property checksum
The checksum header field in host representation
- property code
The code header field
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- property identifier
Identifier in host representation
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- is_message_of_type(self: mtf.libs.mtf_pybinder.pcpp.IcmpLayer, type: mtf.libs.mtf_pybinder.pcpp.IcmpMessageType) bool
Check if the message is of a specific type
- Args:
type (enum pcpp.IcmpMessageType): Type to check
- Returns:
bool: True if the layer if of the given type, false otherwise
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property message_type
The ICMP message type
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property sequence_nr
Sequence number in host representation
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.IcmpDestUnreachableCodes
- An enum for all possible codes for a destination unreachable message type
Documentation is taken from Wikipedia: https://en.wikipedia.org/wiki/Internet_Control_Message_Protocol
Members:
IcmpNetworkUnreachable
IcmpHostUnreachable
IcmpProtocolUnreachable
IcmpPortUnreachable
IcmpDatagramTooBig
IcmpSourceRouteFailed
IcmpDestinationNetworkUnknown
IcmpDestinationHostUnknown
IcmpSourceHostIsolated
IcmpDestinationNetworkProhibited
IcmpDestinationHostProhibited
IcmpNetworkUnreachableForTypeOfService
IcmpHostUnreachableForTypeOfService
IcmpCommunicationProhibited
IcmpHostPrecedenceViolation
IcmpPrecedenceCutoff
- IcmpCommunicationProhibited
- IcmpDatagramTooBig
- IcmpDestinationHostProhibited
- IcmpDestinationHostUnknown
- IcmpDestinationNetworkProhibited
- IcmpDestinationNetworkUnknown
- IcmpHostPrecedenceViolation
- IcmpHostUnreachable
- IcmpHostUnreachableForTypeOfService
- IcmpNetworkUnreachable
- IcmpNetworkUnreachableForTypeOfService
- IcmpPortUnreachable
- IcmpPrecedenceCutoff
- IcmpProtocolUnreachable
- IcmpSourceHostIsolated
- IcmpSourceRouteFailed
- __init__(self: mtf.libs.mtf_pybinder.pcpp.IcmpDestUnreachableCodes, value: int) None
- __new__(**kwargs)
- property name
- property value
- class mtf.libs.mtf_pybinder.pcpp.IcmpDestinationUnreachableLayer
Represents an ICMP protocol layer (for IPv4 only)
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IcmpDestinationUnreachableLayer, code: int, next_hop_mtu: int = 0) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IcmpDestinationUnreachableLayer, arg0: mtf.libs.mtf_pybinder.pcpp.IcmpDestinationUnreachableLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IcmpDestinationUnreachableLayer, arg0: mtf.libs.mtf_pybinder.pcpp.IcmpDestinationUnreachableLayer) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IcmpDestinationUnreachableLayer, : mtf.libs.mtf_pybinder.pcpp.IcmpDestinationUnreachableLayer) mtf.libs.mtf_pybinder.pcpp.IcmpDestinationUnreachableLayer
- Returns:
pcpp.IcmpDestinationUnreachableLayer
- property checksum
The checksum header field in host representation
- property code
The code header field
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- is_message_of_type(self: mtf.libs.mtf_pybinder.pcpp.IcmpLayer, type: mtf.libs.mtf_pybinder.pcpp.IcmpMessageType) bool
Check if the message is of a specific type
- Args:
type (enum pcpp.IcmpMessageType): Type to check
- Returns:
bool: True if the layer if of the given type, false otherwise
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property message_type
The ICMP message type
- property next_hop_mtu
NextHopMTU field of the ICMPv4 layer, only presents if a code 4 error
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.IcmpDirection
An enum representing ICMPv4 message direction
Members:
REQUEST
REPLY
- REPLY
- REQUEST
- __init__(self: mtf.libs.mtf_pybinder.pcpp.IcmpDirection, value: int) None
- __new__(**kwargs)
- property name
- property value
- class mtf.libs.mtf_pybinder.pcpp.IcmpEchoLayer
Represents an ICMP protocol layer (for IPv4 only)
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IcmpEchoLayer, direction: mtf.libs.mtf_pybinder.pcpp.IcmpDirection, code: int, identifier: int, sequence_nr: int, echo_data: list[int]) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IcmpEchoLayer, arg0: mtf.libs.mtf_pybinder.pcpp.IcmpEchoLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IcmpEchoLayer, arg0: mtf.libs.mtf_pybinder.pcpp.IcmpEchoLayer) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IcmpEchoLayer, : mtf.libs.mtf_pybinder.pcpp.IcmpEchoLayer) mtf.libs.mtf_pybinder.pcpp.IcmpEchoLayer
- Returns:
pcpp.IcmpEchoLayer
- property checksum
The checksum header field in host representation
- property code
The code header field
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- property echo_data
Data sent in the Echo Request or returned in the Echo Reply messages
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- property identifier
Identifier in host representation
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- is_message_of_type(self: mtf.libs.mtf_pybinder.pcpp.IcmpLayer, type: mtf.libs.mtf_pybinder.pcpp.IcmpMessageType) bool
Check if the message is of a specific type
- Args:
type (enum pcpp.IcmpMessageType): Type to check
- Returns:
bool: True if the layer if of the given type, false otherwise
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property message_type
The ICMP message type
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property sequence_nr
Sequence number in host representation
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.IcmpInfoLayer
Represents an ICMP protocol layer (for IPv4 only)
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IcmpInfoLayer, direction: mtf.libs.mtf_pybinder.pcpp.IcmpDirection, code: int, identifier: int, sequence_nr: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IcmpInfoLayer, arg0: mtf.libs.mtf_pybinder.pcpp.IcmpInfoLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IcmpInfoLayer, arg0: mtf.libs.mtf_pybinder.pcpp.IcmpInfoLayer) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IcmpInfoLayer, : mtf.libs.mtf_pybinder.pcpp.IcmpInfoLayer) mtf.libs.mtf_pybinder.pcpp.IcmpInfoLayer
- Returns:
pcpp.IcmpInfoLayer
- property checksum
The checksum header field in host representation
- property code
The code header field
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- property identifier
Identifier in host representation
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- is_message_of_type(self: mtf.libs.mtf_pybinder.pcpp.IcmpLayer, type: mtf.libs.mtf_pybinder.pcpp.IcmpMessageType) bool
Check if the message is of a specific type
- Args:
type (enum pcpp.IcmpMessageType): Type to check
- Returns:
bool: True if the layer if of the given type, false otherwise
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property message_type
The ICMP message type
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property sequence_nr
Sequence number in host representation
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.IcmpLayer
Represents an ICMP protocol layer (for IPv4 only)
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IcmpLayer, type: mtf.libs.mtf_pybinder.pcpp.IcmpMessageType, code: int, data_len: int) -> None
A constructor that allocates a new ICMPv4 layer with type, code and the length of the payload, not taking the base ICMP header into account
__init__(self: mtf.libs.mtf_pybinder.pcpp.IcmpLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IcmpLayer, arg0: mtf.libs.mtf_pybinder.pcpp.IcmpLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IcmpLayer, arg0: mtf.libs.mtf_pybinder.pcpp.IcmpLayer) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IcmpLayer, : mtf.libs.mtf_pybinder.pcpp.IcmpLayer) mtf.libs.mtf_pybinder.pcpp.IcmpLayer
- Returns:
pcpp.IcmpLayer
- property checksum
The checksum header field in host representation
- property code
The code header field
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- is_message_of_type(self: mtf.libs.mtf_pybinder.pcpp.IcmpLayer, type: mtf.libs.mtf_pybinder.pcpp.IcmpMessageType) bool
Check if the message is of a specific type
- Args:
type (enum pcpp.IcmpMessageType): Type to check
- Returns:
bool: True if the layer if of the given type, false otherwise
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property message_type
The ICMP message type
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.IcmpMessageType
An enum of all supported ICMP message types
Members:
ICMP_ECHO_REPLY
ICMP_DEST_UNREACHABLE
ICMP_SOURCE_QUENCH
ICMP_REDIRECT
ICMP_ECHO_REQUEST
ICMP_ROUTER_ADV
ICMP_ROUTER_SOL
ICMP_TIME_EXCEEDED
ICMP_PARAM_PROBLEM
ICMP_TIMESTAMP_REQUEST
ICMP_TIMESTAMP_REPLY
ICMP_INFO_REQUEST
ICMP_INFO_REPLY
ICMP_ADDRESS_MASK_REQUEST
ICMP_ADDRESS_MASK_REPLY
ICMP_UNSUPPORTED
- ICMP_ADDRESS_MASK_REPLY
- ICMP_ADDRESS_MASK_REQUEST
- ICMP_DEST_UNREACHABLE
- ICMP_ECHO_REPLY
- ICMP_ECHO_REQUEST
- ICMP_INFO_REPLY
- ICMP_INFO_REQUEST
- ICMP_PARAM_PROBLEM
- ICMP_REDIRECT
- ICMP_ROUTER_ADV
- ICMP_ROUTER_SOL
- ICMP_SOURCE_QUENCH
- ICMP_TIMESTAMP_REPLY
- ICMP_TIMESTAMP_REQUEST
- ICMP_TIME_EXCEEDED
- ICMP_UNSUPPORTED
- __init__(self: mtf.libs.mtf_pybinder.pcpp.IcmpMessageType, value: int) None
- __new__(**kwargs)
- property name
- property value
- class mtf.libs.mtf_pybinder.pcpp.IcmpParamProblemLayer
Represents an ICMP protocol layer (for IPv4 only)
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IcmpParamProblemLayer, code: int, pointer: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IcmpParamProblemLayer, arg0: mtf.libs.mtf_pybinder.pcpp.IcmpParamProblemLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IcmpParamProblemLayer, arg0: mtf.libs.mtf_pybinder.pcpp.IcmpParamProblemLayer) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IcmpParamProblemLayer, : mtf.libs.mtf_pybinder.pcpp.IcmpParamProblemLayer) mtf.libs.mtf_pybinder.pcpp.IcmpParamProblemLayer
- Returns:
pcpp.IcmpParamProblemLayer
- property checksum
The checksum header field in host representation
- property code
The code header field
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- is_message_of_type(self: mtf.libs.mtf_pybinder.pcpp.IcmpLayer, type: mtf.libs.mtf_pybinder.pcpp.IcmpMessageType) bool
Check if the message is of a specific type
- Args:
type (enum pcpp.IcmpMessageType): Type to check
- Returns:
bool: True if the layer if of the given type, false otherwise
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property message_type
The ICMP message type
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property pointer
Octet where an error was detected
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.IcmpRedirectLayer
Represents an ICMP protocol layer (for IPv4 only)
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IcmpRedirectLayer, code: int, gateway_address: mtf.libs.mtf_pybinder.pcpp.IPv4Address) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IcmpRedirectLayer, arg0: mtf.libs.mtf_pybinder.pcpp.IcmpRedirectLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IcmpRedirectLayer, arg0: mtf.libs.mtf_pybinder.pcpp.IcmpRedirectLayer) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IcmpRedirectLayer, : mtf.libs.mtf_pybinder.pcpp.IcmpRedirectLayer) mtf.libs.mtf_pybinder.pcpp.IcmpRedirectLayer
- Returns:
pcpp.IcmpRedirectLayer
- property checksum
The checksum header field in host representation
- property code
The code header field
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- property gateway_internet_address
Address of the gateway to which traffic should be sent
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- is_message_of_type(self: mtf.libs.mtf_pybinder.pcpp.IcmpLayer, type: mtf.libs.mtf_pybinder.pcpp.IcmpMessageType) bool
Check if the message is of a specific type
- Args:
type (enum pcpp.IcmpMessageType): Type to check
- Returns:
bool: True if the layer if of the given type, false otherwise
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property message_type
The ICMP message type
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.IcmpRouterAdvertisementLayer
Represents an ICMP protocol layer (for IPv4 only)
- class IcmpRouterAddress
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IcmpRouterAdvertisementLayer.IcmpRouterAddress, router_address: mtf.libs.mtf_pybinder.pcpp.IPv4Address, preference_level: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IcmpRouterAdvertisementLayer.IcmpRouterAddress, arg0: mtf.libs.mtf_pybinder.pcpp.IcmpRouterAdvertisementLayer.IcmpRouterAddress) -> None
- __new__(**kwargs)
- property preference_level
Preferability of this Router Address as a default router address, relative to other router addresses on the same subnet
- property router_address
Sending router’s IP address
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IcmpRouterAdvertisementLayer, code: int, lifetime: int, router_addresses: list[pcpp::IcmpRouterAdvertisementLayer::IcmpRouterAddress], addr_entry_size: int = 2) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IcmpRouterAdvertisementLayer, arg0: mtf.libs.mtf_pybinder.pcpp.IcmpRouterAdvertisementLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IcmpRouterAdvertisementLayer, arg0: mtf.libs.mtf_pybinder.pcpp.IcmpRouterAdvertisementLayer) -> None
- __new__(**kwargs)
- property addr_entry_size
Number of 32-bit words per each router address (2)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IcmpRouterAdvertisementLayer, : mtf.libs.mtf_pybinder.pcpp.IcmpRouterAdvertisementLayer) mtf.libs.mtf_pybinder.pcpp.IcmpRouterAdvertisementLayer
- Returns:
pcpp.IcmpRouterAdvertisementLayer
- property checksum
The checksum header field in host representation
- property code
The code header field
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- is_message_of_type(self: mtf.libs.mtf_pybinder.pcpp.IcmpLayer, type: mtf.libs.mtf_pybinder.pcpp.IcmpMessageType) bool
Check if the message is of a specific type
- Args:
type (enum pcpp.IcmpMessageType): Type to check
- Returns:
bool: True if the layer if of the given type, false otherwise
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property lifetime
Maximum number of seconds that the router addresses may be considered valid
- property message_type
The ICMP message type
- property num_addrs
Number of router addresses advertised in this message
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property router_addresses
List of router addresses
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.IcmpTimestampLayer
Represents an ICMP protocol layer (for IPv4 only)
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IcmpTimestampLayer, direction: mtf.libs.mtf_pybinder.pcpp.IcmpDirection, code: int, identifier: int, sequence_nr: int, originate_timestamp: int, receive_timestamp: int, transmit_timestamp: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IcmpTimestampLayer, arg0: mtf.libs.mtf_pybinder.pcpp.IcmpTimestampLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IcmpTimestampLayer, arg0: mtf.libs.mtf_pybinder.pcpp.IcmpTimestampLayer) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IcmpTimestampLayer, : mtf.libs.mtf_pybinder.pcpp.IcmpTimestampLayer) mtf.libs.mtf_pybinder.pcpp.IcmpTimestampLayer
- Returns:
pcpp.IcmpTimestampLayer
- property checksum
The checksum header field in host representation
- property code
The code header field
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- property identifier
Identifier in host representation
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- is_message_of_type(self: mtf.libs.mtf_pybinder.pcpp.IcmpLayer, type: mtf.libs.mtf_pybinder.pcpp.IcmpMessageType) bool
Check if the message is of a specific type
- Args:
type (enum pcpp.IcmpMessageType): Type to check
- Returns:
bool: True if the layer if of the given type, false otherwise
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property message_type
The ICMP message type
- property originate_timestamp
Originate Timestamp in milliseconds
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property receive_timestamp
Receive Timestamp in milliseconds
- property sequence_nr
Sequence number in host representation
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- property transmit_timestamp
Transmit Timestamp in milliseconds
- class mtf.libs.mtf_pybinder.pcpp.IgmpLayer
A base class for all IGMP (Internet Group Management Protocol) protocol classes. This is an abstract class and cannot be instantiated, only its child classes can be instantiated. The inherited classes represent the different versions of the protocol: IGMPv1, IGMPv2 and IGMPv3
- __init__(self: mtf.libs.mtf_pybinder.pcpp.IgmpLayer, arg0: mtf.libs.mtf_pybinder.pcpp.IgmpLayer) None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IgmpLayer, : mtf.libs.mtf_pybinder.pcpp.IgmpLayer) mtf.libs.mtf_pybinder.pcpp.IgmpLayer
- Returns:
pcpp.IgmpLayer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_group_address(self: mtf.libs.mtf_pybinder.pcpp.IgmpLayer) mtf.libs.mtf_pybinder.pcpp.IPv4Address
The IPv4 multicast address stored igmp_header#groupAddress
- Returns:
pcpp.IPv4Address
- get_header_len(self: mtf.libs.mtf_pybinder.pcpp.IgmpLayer) int
Size of IGMP header = 8B
- Returns:
unsigned int
- get_igmp_header(self: mtf.libs.mtf_pybinder.pcpp.IgmpLayer) mtf.libs.mtf_pybinder.pcpp.igmp_header
Get a pointer to the raw IGMPv1/IGMPv2 header. Notice this points directly to the data, so every change will change the actual packet data A pointer to the
- Returns:
pcpp.igmp_header
- static get_igmp_ver_from_data(data: int, data_len: int, is_query: bool) int
A static method that gets raw IGMP data (byte stream) and returns the IGMP version of this IGMP message
- Args:
data (bytes): The IGMP raw data (byte stream) data_len (unsigned int): Raw data length is_query (bool): Indicate if it is query
- Returns:
unsigned int: Return true if IGMP message type is ::IgmpType_MembershipQuery and false otherwise
One of the values ::IGMPv1, ::IGMPv2, ::IGMPv3 according to detected IGMP version or ::UnknownProtocol if couldn’t detect IGMP version
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_osi_model_layer(self: mtf.libs.mtf_pybinder.pcpp.IgmpLayer) mtf.libs.mtf_pybinder.pcpp.OsiModelLayer
- Returns:
enum pcpp.OsiModelLayer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- get_type(self: mtf.libs.mtf_pybinder.pcpp.IgmpLayer) mtf.libs.mtf_pybinder.pcpp.IgmpType
IGMP type set in igmp_header#type as ::IgmpType enum. Notice that if igmp_header#type contains a value that doesn’t appear in the ::IgmpType enum, ::IgmpType_Unknown will be returned
- Returns:
enum pcpp.IgmpType
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.IgmpLayer) None
Does nothing for this layer (IGMP layer is always last)
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- set_group_address(self: mtf.libs.mtf_pybinder.pcpp.IgmpLayer, group_addr: mtf.libs.mtf_pybinder.pcpp.IPv4Address) None
Set the IPv4 multicast address
- Args:
group_addr (pcpp.IPv4Address): The IPv4 address to set
- set_type(self: mtf.libs.mtf_pybinder.pcpp.IgmpLayer, type: mtf.libs.mtf_pybinder.pcpp.IgmpType) None
Set IGMP type (will be written to igmp_header#type field)
- Args:
type (enum pcpp.IgmpType): The type to set
- to_string(self: mtf.libs.mtf_pybinder.pcpp.IgmpLayer) str
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.IgmpType
IGMP message types
Members:
IgmpType_Unknown
IgmpType_MembershipQuery
IgmpType_MembershipReportV1
IgmpType_DVMRP
IgmpType_P1Mv1
IgmpType_CiscoTrace
IgmpType_MembershipReportV2
IgmpType_LeaveGroup
IgmpType_MulticastTracerouteResponse
IgmpType_MulticastTraceroute
IgmpType_MembershipReportV3
IgmpType_MulticastRouterAdvertisement
IgmpType_MulticastRouterSolicitation
IgmpType_MulticastRouterTermination
- IgmpType_CiscoTrace
- IgmpType_DVMRP
- IgmpType_LeaveGroup
- IgmpType_MembershipQuery
- IgmpType_MembershipReportV1
- IgmpType_MembershipReportV2
- IgmpType_MembershipReportV3
- IgmpType_MulticastRouterAdvertisement
- IgmpType_MulticastRouterSolicitation
- IgmpType_MulticastRouterTermination
- IgmpType_MulticastTraceroute
- IgmpType_MulticastTracerouteResponse
- IgmpType_P1Mv1
- IgmpType_Unknown
- __init__(self: mtf.libs.mtf_pybinder.pcpp.IgmpType, value: int) None
- __new__(**kwargs)
- property name
- property value
- class mtf.libs.mtf_pybinder.pcpp.IgmpV1Layer
Represents IGMPv1 (Internet Group Management Protocol ver 1) layer. This class represents all the different messages of IGMPv1
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IgmpV1Layer, data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IgmpV1Layer, arg0: mtf.libs.mtf_pybinder.pcpp.IgmpType) -> None
doc
__init__(self: mtf.libs.mtf_pybinder.pcpp.IgmpV1Layer, type: mtf.libs.mtf_pybinder.pcpp.IgmpType, group_addr: mtf.libs.mtf_pybinder.pcpp.IPv4Address) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IgmpV1Layer, arg0: mtf.libs.mtf_pybinder.pcpp.IgmpV1Layer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IgmpV1Layer, arg0: mtf.libs.mtf_pybinder.pcpp.IgmpV1Layer) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IgmpV1Layer, : mtf.libs.mtf_pybinder.pcpp.IgmpV1Layer) mtf.libs.mtf_pybinder.pcpp.IgmpV1Layer
- Returns:
pcpp.IgmpV1Layer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.IgmpV1Layer) None
Calculate the IGMP checksum and set igmp_header#maxResponseTime to 0 (this field is unused in IGMPv1)
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_group_address(self: mtf.libs.mtf_pybinder.pcpp.IgmpLayer) mtf.libs.mtf_pybinder.pcpp.IPv4Address
The IPv4 multicast address stored igmp_header#groupAddress
- Returns:
pcpp.IPv4Address
- get_header_len(self: mtf.libs.mtf_pybinder.pcpp.IgmpLayer) int
Size of IGMP header = 8B
- Returns:
unsigned int
- get_igmp_header(self: mtf.libs.mtf_pybinder.pcpp.IgmpLayer) mtf.libs.mtf_pybinder.pcpp.igmp_header
Get a pointer to the raw IGMPv1/IGMPv2 header. Notice this points directly to the data, so every change will change the actual packet data A pointer to the
- Returns:
pcpp.igmp_header
- static get_igmp_ver_from_data(data: int, data_len: int, is_query: bool) int
A static method that gets raw IGMP data (byte stream) and returns the IGMP version of this IGMP message
- Args:
data (bytes): The IGMP raw data (byte stream) data_len (unsigned int): Raw data length is_query (bool): Indicate if it is query
- Returns:
unsigned int: Return true if IGMP message type is ::IgmpType_MembershipQuery and false otherwise
One of the values ::IGMPv1, ::IGMPv2, ::IGMPv3 according to detected IGMP version or ::UnknownProtocol if couldn’t detect IGMP version
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_osi_model_layer(self: mtf.libs.mtf_pybinder.pcpp.IgmpLayer) mtf.libs.mtf_pybinder.pcpp.OsiModelLayer
- Returns:
enum pcpp.OsiModelLayer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- get_type(self: mtf.libs.mtf_pybinder.pcpp.IgmpLayer) mtf.libs.mtf_pybinder.pcpp.IgmpType
IGMP type set in igmp_header#type as ::IgmpType enum. Notice that if igmp_header#type contains a value that doesn’t appear in the ::IgmpType enum, ::IgmpType_Unknown will be returned
- Returns:
enum pcpp.IgmpType
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.IgmpLayer) None
Does nothing for this layer (IGMP layer is always last)
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- set_group_address(self: mtf.libs.mtf_pybinder.pcpp.IgmpLayer, group_addr: mtf.libs.mtf_pybinder.pcpp.IPv4Address) None
Set the IPv4 multicast address
- Args:
group_addr (pcpp.IPv4Address): The IPv4 address to set
- set_type(self: mtf.libs.mtf_pybinder.pcpp.IgmpLayer, type: mtf.libs.mtf_pybinder.pcpp.IgmpType) None
Set IGMP type (will be written to igmp_header#type field)
- Args:
type (enum pcpp.IgmpType): The type to set
- to_string(self: mtf.libs.mtf_pybinder.pcpp.IgmpLayer) str
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.IgmpV2Layer
Represents IGMPv2 (Internet Group Management Protocol ver 2) layer. This class represents all the different messages of IGMPv2
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IgmpV2Layer, data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IgmpV2Layer, arg0: mtf.libs.mtf_pybinder.pcpp.IgmpType) -> None
doc
__init__(self: mtf.libs.mtf_pybinder.pcpp.IgmpV2Layer, arg0: mtf.libs.mtf_pybinder.pcpp.IgmpType, arg1: mtf.libs.mtf_pybinder.pcpp.IPv4Address) -> None
doc
__init__(self: mtf.libs.mtf_pybinder.pcpp.IgmpV2Layer, type: mtf.libs.mtf_pybinder.pcpp.IgmpType, group_addr: mtf.libs.mtf_pybinder.pcpp.IPv4Address, max_response_time: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IgmpV2Layer, arg0: mtf.libs.mtf_pybinder.pcpp.IgmpV2Layer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IgmpV2Layer, arg0: mtf.libs.mtf_pybinder.pcpp.IgmpV2Layer) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IgmpV2Layer, : mtf.libs.mtf_pybinder.pcpp.IgmpV2Layer) mtf.libs.mtf_pybinder.pcpp.IgmpV2Layer
- Returns:
pcpp.IgmpV2Layer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.IgmpV2Layer) None
Calculate the IGMP checksum
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_group_address(self: mtf.libs.mtf_pybinder.pcpp.IgmpLayer) mtf.libs.mtf_pybinder.pcpp.IPv4Address
The IPv4 multicast address stored igmp_header#groupAddress
- Returns:
pcpp.IPv4Address
- get_header_len(self: mtf.libs.mtf_pybinder.pcpp.IgmpLayer) int
Size of IGMP header = 8B
- Returns:
unsigned int
- get_igmp_header(self: mtf.libs.mtf_pybinder.pcpp.IgmpLayer) mtf.libs.mtf_pybinder.pcpp.igmp_header
Get a pointer to the raw IGMPv1/IGMPv2 header. Notice this points directly to the data, so every change will change the actual packet data A pointer to the
- Returns:
pcpp.igmp_header
- static get_igmp_ver_from_data(data: int, data_len: int, is_query: bool) int
A static method that gets raw IGMP data (byte stream) and returns the IGMP version of this IGMP message
- Args:
data (bytes): The IGMP raw data (byte stream) data_len (unsigned int): Raw data length is_query (bool): Indicate if it is query
- Returns:
unsigned int: Return true if IGMP message type is ::IgmpType_MembershipQuery and false otherwise
One of the values ::IGMPv1, ::IGMPv2, ::IGMPv3 according to detected IGMP version or ::UnknownProtocol if couldn’t detect IGMP version
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_osi_model_layer(self: mtf.libs.mtf_pybinder.pcpp.IgmpLayer) mtf.libs.mtf_pybinder.pcpp.OsiModelLayer
- Returns:
enum pcpp.OsiModelLayer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- get_type(self: mtf.libs.mtf_pybinder.pcpp.IgmpLayer) mtf.libs.mtf_pybinder.pcpp.IgmpType
IGMP type set in igmp_header#type as ::IgmpType enum. Notice that if igmp_header#type contains a value that doesn’t appear in the ::IgmpType enum, ::IgmpType_Unknown will be returned
- Returns:
enum pcpp.IgmpType
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.IgmpLayer) None
Does nothing for this layer (IGMP layer is always last)
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- set_group_address(self: mtf.libs.mtf_pybinder.pcpp.IgmpLayer, group_addr: mtf.libs.mtf_pybinder.pcpp.IPv4Address) None
Set the IPv4 multicast address
- Args:
group_addr (pcpp.IPv4Address): The IPv4 address to set
- set_type(self: mtf.libs.mtf_pybinder.pcpp.IgmpLayer, type: mtf.libs.mtf_pybinder.pcpp.IgmpType) None
Set IGMP type (will be written to igmp_header#type field)
- Args:
type (enum pcpp.IgmpType): The type to set
- to_string(self: mtf.libs.mtf_pybinder.pcpp.IgmpLayer) str
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.IgmpV3QueryLayer
Represents an IGMPv3 (Internet Group Management Protocol ver 3) membership query message
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IgmpV3QueryLayer, data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IgmpV3QueryLayer) -> None
doc
__init__(self: mtf.libs.mtf_pybinder.pcpp.IgmpV3QueryLayer, arg0: mtf.libs.mtf_pybinder.pcpp.IPv4Address) -> None
doc
__init__(self: mtf.libs.mtf_pybinder.pcpp.IgmpV3QueryLayer, arg0: mtf.libs.mtf_pybinder.pcpp.IPv4Address, arg1: int) -> None
doc
__init__(self: mtf.libs.mtf_pybinder.pcpp.IgmpV3QueryLayer, multicast_addr: mtf.libs.mtf_pybinder.pcpp.IPv4Address, max_response_time: int, s_qrv: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IgmpV3QueryLayer, arg0: mtf.libs.mtf_pybinder.pcpp.IgmpV3QueryLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IgmpV3QueryLayer, arg0: mtf.libs.mtf_pybinder.pcpp.IgmpV3QueryLayer) -> None
- __new__(**kwargs)
- add_source_address(self: mtf.libs.mtf_pybinder.pcpp.IgmpV3QueryLayer, addr: mtf.libs.mtf_pybinder.pcpp.IPv4Address) bool
Add a new source address at the end of the source address list. The igmpv3_query_header#numOfSources field will be incremented accordingly
- Args:
addr (pcpp.IPv4Address): The IPv4 source address to add
- Returns:
bool: True if source address was added successfully or false otherwise. If false is returned an appropriate error message
will be printed to log
- add_source_address_at_index(self: mtf.libs.mtf_pybinder.pcpp.IgmpV3QueryLayer, addr: mtf.libs.mtf_pybinder.pcpp.IPv4Address, index: int) bool
Add a new source address at a certain index of the source address list. The igmpv3_query_header#numOfSources field will be incremented accordingly
- Args:
addr (pcpp.IPv4Address): The IPv4 source address to add index (int): The index to add the new source address at
- Returns:
bool: True if source address was added successfully or false otherwise. If false is returned an appropriate error message
will be printed to log
- assign(self: mtf.libs.mtf_pybinder.pcpp.IgmpV3QueryLayer, : mtf.libs.mtf_pybinder.pcpp.IgmpV3QueryLayer) mtf.libs.mtf_pybinder.pcpp.IgmpV3QueryLayer
- Returns:
pcpp.IgmpV3QueryLayer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.IgmpV3QueryLayer) None
Calculate the IGMP checksum
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_group_address(self: mtf.libs.mtf_pybinder.pcpp.IgmpLayer) mtf.libs.mtf_pybinder.pcpp.IPv4Address
The IPv4 multicast address stored igmp_header#groupAddress
- Returns:
pcpp.IPv4Address
- get_header_len(self: mtf.libs.mtf_pybinder.pcpp.IgmpV3QueryLayer) int
The message size in bytes which include the size of the basic header + the size of the source address list
- Returns:
unsigned int
- get_igmp_header(self: mtf.libs.mtf_pybinder.pcpp.IgmpLayer) mtf.libs.mtf_pybinder.pcpp.igmp_header
Get a pointer to the raw IGMPv1/IGMPv2 header. Notice this points directly to the data, so every change will change the actual packet data A pointer to the
- Returns:
pcpp.igmp_header
- get_igmp_v3_query_header(self: mtf.libs.mtf_pybinder.pcpp.IgmpV3QueryLayer) mtf.libs.mtf_pybinder.pcpp.igmpv3_query_header
Get a pointer to the raw IGMPv3 membership query header. Notice this points directly to the data, so every change will change the actual packet data
- Returns:
pcpp.igmpv3_query_header
- static get_igmp_ver_from_data(data: int, data_len: int, is_query: bool) int
A static method that gets raw IGMP data (byte stream) and returns the IGMP version of this IGMP message
- Args:
data (bytes): The IGMP raw data (byte stream) data_len (unsigned int): Raw data length is_query (bool): Indicate if it is query
- Returns:
unsigned int: Return true if IGMP message type is ::IgmpType_MembershipQuery and false otherwise
One of the values ::IGMPv1, ::IGMPv2, ::IGMPv3 according to detected IGMP version or ::UnknownProtocol if couldn’t detect IGMP version
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_osi_model_layer(self: mtf.libs.mtf_pybinder.pcpp.IgmpLayer) mtf.libs.mtf_pybinder.pcpp.OsiModelLayer
- Returns:
enum pcpp.OsiModelLayer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- get_source_address_at_index(self: mtf.libs.mtf_pybinder.pcpp.IgmpV3QueryLayer, index: int) mtf.libs.mtf_pybinder.pcpp.IPv4Address
Get the IPV4 source address in a certain index
- Args:
index (int): The requested index of the source address
- Returns:
pcpp.IPv4Address: The IPv4 source address, or IPv4Address#Zero if index is out of bounds (of the message or of the layer)
- get_source_address_count(self: mtf.libs.mtf_pybinder.pcpp.IgmpV3QueryLayer) int
The number of source addresses in this message (as extracted from the igmpv3_query_header#numOfSources field)
- Returns:
unsigned int
- get_type(self: mtf.libs.mtf_pybinder.pcpp.IgmpLayer) mtf.libs.mtf_pybinder.pcpp.IgmpType
IGMP type set in igmp_header#type as ::IgmpType enum. Notice that if igmp_header#type contains a value that doesn’t appear in the ::IgmpType enum, ::IgmpType_Unknown will be returned
- Returns:
enum pcpp.IgmpType
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.IgmpLayer) None
Does nothing for this layer (IGMP layer is always last)
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- remove_all_source_addresses(self: mtf.libs.mtf_pybinder.pcpp.IgmpV3QueryLayer) bool
Remove all source addresses in the message. The igmpv3_query_header#numOfSources field will be set to 0 True if all source addresses were cleared successfully or false otherwise. If false is returned an appropriate error message will be printed to log
- Returns:
bool
- remove_source_address_at_index(self: mtf.libs.mtf_pybinder.pcpp.IgmpV3QueryLayer, index: int) bool
Remove a source address at a certain index. The igmpv3_query_header#numOfSources field will be decremented accordingly
- Args:
index (int): The index of the source address to be removed
- Returns:
bool: True if source address was removed successfully or false otherwise. If false is returned an appropriate error message
will be printed to log
- set_group_address(self: mtf.libs.mtf_pybinder.pcpp.IgmpLayer, group_addr: mtf.libs.mtf_pybinder.pcpp.IPv4Address) None
Set the IPv4 multicast address
- Args:
group_addr (pcpp.IPv4Address): The IPv4 address to set
- set_type(self: mtf.libs.mtf_pybinder.pcpp.IgmpLayer, type: mtf.libs.mtf_pybinder.pcpp.IgmpType) None
Set IGMP type (will be written to igmp_header#type field)
- Args:
type (enum pcpp.IgmpType): The type to set
- to_string(self: mtf.libs.mtf_pybinder.pcpp.IgmpLayer) str
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.IgmpV3ReportLayer
Represents an IGMPv3 (Internet Group Management Protocol ver 3) membership report message
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.IgmpV3ReportLayer, data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IgmpV3ReportLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IgmpV3ReportLayer, arg0: mtf.libs.mtf_pybinder.pcpp.IgmpV3ReportLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.IgmpV3ReportLayer, arg0: mtf.libs.mtf_pybinder.pcpp.IgmpV3ReportLayer) -> None
- __new__(**kwargs)
- add_group_record(self: mtf.libs.mtf_pybinder.pcpp.IgmpV3ReportLayer, record_type: int, multicast_address: mtf.libs.mtf_pybinder.pcpp.IPv4Address, source_addresses: list[mtf.libs.mtf_pybinder.pcpp.IPv4Address]) mtf.libs.mtf_pybinder.pcpp.igmpv3_group_record
Add a new group record at a the end of the group record list. The igmpv3_report_header#numOfGroupRecords field will be incremented accordingly
- Args:
record_type (unsigned int): The type of the new group record multicast_address (pcpp.IPv4Address): A vector containing all the source addresses of the new group record source_addresses (list[pcpp.IPv4Address])
- Returns:
pcpp.igmpv3_group_record: The method constructs a new group record, adds it to the end of the group record list of IGMPv3 report message and
returns a pointer to the new message. If something went wrong in creating or adding the new group record a NULL value is returned and an appropriate error message is printed to log
- add_group_record_at_index(self: mtf.libs.mtf_pybinder.pcpp.IgmpV3ReportLayer, record_type: int, multicast_address: mtf.libs.mtf_pybinder.pcpp.IPv4Address, source_addresses: list[mtf.libs.mtf_pybinder.pcpp.IPv4Address], index: int) mtf.libs.mtf_pybinder.pcpp.igmpv3_group_record
Add a new group record at a certain index of the group record list. The igmpv3_report_header#numOfGroupRecords field will be incremented accordingly
- Args:
record_type (unsigned int): The type of the new group record multicast_address (pcpp.IPv4Address): The multicast address of the new group record source_addresses (list[pcpp.IPv4Address]): A vector containing all the source addresses of the new group record index (int): The index to add the new group address at
- Returns:
pcpp.igmpv3_group_record: The method constructs a new group record, adds it to the IGMPv3 report message and returns a pointer to the new message.
If something went wrong in creating or adding the new group record a NULL value is returned and an appropriate error message is printed to log
- assign(self: mtf.libs.mtf_pybinder.pcpp.IgmpV3ReportLayer, : mtf.libs.mtf_pybinder.pcpp.IgmpV3ReportLayer) mtf.libs.mtf_pybinder.pcpp.IgmpV3ReportLayer
- Returns:
pcpp.IgmpV3ReportLayer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.IgmpV3ReportLayer) None
Calculate the IGMP checksum
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_first_group_record(self: mtf.libs.mtf_pybinder.pcpp.IgmpV3ReportLayer) mtf.libs.mtf_pybinder.pcpp.igmpv3_group_record
A pointer to the first group record or NULL if no group records exist. Notice the return value is a pointer to the real data, so changes in the return value will affect the packet data
- Returns:
pcpp.igmpv3_group_record
- get_group_address(self: mtf.libs.mtf_pybinder.pcpp.IgmpLayer) mtf.libs.mtf_pybinder.pcpp.IPv4Address
The IPv4 multicast address stored igmp_header#groupAddress
- Returns:
pcpp.IPv4Address
- get_group_record_count(self: mtf.libs.mtf_pybinder.pcpp.IgmpV3ReportLayer) int
The number of group records in this message (as extracted from the igmpv3_report_header#numOfGroupRecords field)
- Returns:
unsigned int
- get_header_len(self: mtf.libs.mtf_pybinder.pcpp.IgmpV3ReportLayer) int
The message size in bytes which include the size of the basic header + the size of the group record list
- Returns:
unsigned int
- get_igmp_header(self: mtf.libs.mtf_pybinder.pcpp.IgmpLayer) mtf.libs.mtf_pybinder.pcpp.igmp_header
Get a pointer to the raw IGMPv1/IGMPv2 header. Notice this points directly to the data, so every change will change the actual packet data A pointer to the
- Returns:
pcpp.igmp_header
- static get_igmp_ver_from_data(data: int, data_len: int, is_query: bool) int
A static method that gets raw IGMP data (byte stream) and returns the IGMP version of this IGMP message
- Args:
data (bytes): The IGMP raw data (byte stream) data_len (unsigned int): Raw data length is_query (bool): Indicate if it is query
- Returns:
unsigned int: Return true if IGMP message type is ::IgmpType_MembershipQuery and false otherwise
One of the values ::IGMPv1, ::IGMPv2, ::IGMPv3 according to detected IGMP version or ::UnknownProtocol if couldn’t detect IGMP version
- get_next_group_record(self: mtf.libs.mtf_pybinder.pcpp.IgmpV3ReportLayer, group_record: mtf.libs.mtf_pybinder.pcpp.igmpv3_group_record) mtf.libs.mtf_pybinder.pcpp.igmpv3_group_record
Get the group record that comes next to a given group record. If “groupRecord” is NULL then NULL will be returned. If “groupRecord” is the last group record or if it is out of layer bounds NULL will be returned also. Notice the return value is a pointer to the real data casted to igmpv3_group_record type (as opposed to a copy of the option data). So changes in the return value will affect the packet data
- Args:
group_record (pcpp.igmpv3_group_record): The group record to start searching from
- Returns:
pcpp.igmpv3_group_record: The next group record or NULL if “groupRecord” is NULL, last or out of layer bounds
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_osi_model_layer(self: mtf.libs.mtf_pybinder.pcpp.IgmpLayer) mtf.libs.mtf_pybinder.pcpp.OsiModelLayer
- Returns:
enum pcpp.OsiModelLayer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- get_report_header(self: mtf.libs.mtf_pybinder.pcpp.IgmpV3ReportLayer) mtf.libs.mtf_pybinder.pcpp.igmpv3_report_header
Get a pointer to the raw IGMPv3 membership report header. Notice this points directly to the data, so every change will change the actual packet data A pointer to the
- Returns:
pcpp.igmpv3_report_header
- get_type(self: mtf.libs.mtf_pybinder.pcpp.IgmpLayer) mtf.libs.mtf_pybinder.pcpp.IgmpType
IGMP type set in igmp_header#type as ::IgmpType enum. Notice that if igmp_header#type contains a value that doesn’t appear in the ::IgmpType enum, ::IgmpType_Unknown will be returned
- Returns:
enum pcpp.IgmpType
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.IgmpLayer) None
Does nothing for this layer (IGMP layer is always last)
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- remove_all_group_records(self: mtf.libs.mtf_pybinder.pcpp.IgmpV3ReportLayer) bool
Remove all group records in the message. The igmpv3_report_header#numOfGroupRecords field will be set to 0
- Returns:
bool: True if all group records were cleared successfully or false otherwise. If false is returned an appropriate error message
will be printed to log
- remove_group_record_at_index(self: mtf.libs.mtf_pybinder.pcpp.IgmpV3ReportLayer, index: int) bool
Remove a group record at a certain index. The igmpv3_report_header#numOfGroupRecords field will be decremented accordingly
- Args:
index (int): The index of the group record to be removed
- Returns:
bool: True if group record was removed successfully or false otherwise. If false is returned an appropriate error message
will be printed to log
- set_group_address(self: mtf.libs.mtf_pybinder.pcpp.IgmpLayer, group_addr: mtf.libs.mtf_pybinder.pcpp.IPv4Address) None
Set the IPv4 multicast address
- Args:
group_addr (pcpp.IPv4Address): The IPv4 address to set
- set_type(self: mtf.libs.mtf_pybinder.pcpp.IgmpLayer, type: mtf.libs.mtf_pybinder.pcpp.IgmpType) None
Set IGMP type (will be written to igmp_header#type field)
- Args:
type (enum pcpp.IgmpType): The type to set
- to_string(self: mtf.libs.mtf_pybinder.pcpp.IgmpLayer) str
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.L2tpType
An enum for L2TP message type
Members:
L2TP_DATA_MESSAGE
L2TP_CONTROL_MESSAGE
- L2TP_CONTROL_MESSAGE
- L2TP_DATA_MESSAGE
- __init__(self: mtf.libs.mtf_pybinder.pcpp.L2tpType, value: int) None
- __new__(**kwargs)
- property name
- property value
- class mtf.libs.mtf_pybinder.pcpp.L2tpV3Layer
Represents an L2TPV3 layer.
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.L2tpV3Layer, arg0: mtf.libs.mtf_pybinder.pcpp.L2tpV3Layer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.L2tpV3Layer, arg0: mtf.libs.mtf_pybinder.pcpp.L2tpV3Layer) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IDataContainer, : mtf.libs.mtf_pybinder.pcpp.IDataContainer) mtf.libs.mtf_pybinder.pcpp.IDataContainer
- Returns:
pcpp.IDataContainer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- property flag
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- has_length_bit(self: mtf.libs.mtf_pybinder.pcpp.L2tpV3Layer) bool
Check if the Flag field of the L2TPV3 header has the Length bit.
- has_sequence_bit(self: mtf.libs.mtf_pybinder.pcpp.L2tpV3Layer) bool
Check if the Flag field of the L2TPV3 header has the Sequence bit.
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property length
- property nr
- property ns
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property payload
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property session_id
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- property type
- property version
- class mtf.libs.mtf_pybinder.pcpp.LLCLayer
Represents Logical Link Control layer messages
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.LLCLayer, data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.LLCLayer, dsap: int, ssap: int, control: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.LLCLayer, arg0: mtf.libs.mtf_pybinder.pcpp.LLCLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.LLCLayer, arg0: mtf.libs.mtf_pybinder.pcpp.LLCLayer) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.LLCLayer, : mtf.libs.mtf_pybinder.pcpp.LLCLayer) mtf.libs.mtf_pybinder.pcpp.LLCLayer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- property control
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- property dsap
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- is_control_2bytes(self: mtf.libs.mtf_pybinder.pcpp.LLCLayer) bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property ssap
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.Layer
Layer is the base class for all protocol layers. Each protocol supported in PcapPlusPlus has a class that inherits Layer. The protocol layer class expose all properties and methods relevant for viewing and editing protocol fields. For example: a pointer to a structured header (e.g tcphdr, iphdr, etc.), protocol header size, payload size, compute fields that can be automatically computed, print protocol data to string, etc. Each protocol instance is obviously part of a protocol stack (which construct a packet). This protocol stack is represented in PcapPlusPlus in a linked list, and each layer is an element in this list. That’s why each layer has properties to the next and previous layer in the protocol stack The Layer class, as a base class, is abstract and the user can’t create an instance of it (it has a private constructor) Each layer holds a pointer to the relevant place in the packet. The layer sees all the data from this pointer forward until the end of the packet. Here is an example packet showing this concept:
- __init__(*args, **kwargs)
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IDataContainer, : mtf.libs.mtf_pybinder.pcpp.IDataContainer) mtf.libs.mtf_pybinder.pcpp.IDataContainer
- Returns:
pcpp.IDataContainer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.LinkLayerType
An enum describing all known link layer type. Taken from: http://www.tcpdump.org/linktypes.html .
Members:
LINKTYPE_NULL
LINKTYPE_ETHERNET
LINKTYPE_AX25
LINKTYPE_IEEE802_5
LINKTYPE_ARCNET_BSD
LINKTYPE_SLIP
LINKTYPE_PPP
LINKTYPE_FDDI
LINKTYPE_DLT_RAW1
LINKTYPE_DLT_RAW2
LINKTYPE_PPP_HDLC
LINKTYPE_PPP_ETHER
LINKTYPE_ATM_RFC1483
LINKTYPE_RAW
LINKTYPE_C_HDLC
LINKTYPE_IEEE802_11
LINKTYPE_FRELAY
LINKTYPE_LOOP
LINKTYPE_LINUX_SLL
LINKTYPE_LTALK
LINKTYPE_PFLOG
LINKTYPE_IEEE802_11_PRISM
LINKTYPE_IP_OVER_FC
LINKTYPE_SUNATM
LINKTYPE_IEEE802_11_RADIOTAP
LINKTYPE_ARCNET_LINUX
LINKTYPE_APPLE_IP_OVER_IEEE1394
LINKTYPE_MTP2_WITH_PHDR
LINKTYPE_MTP2
LINKTYPE_MTP3
LINKTYPE_SCCP
LINKTYPE_DOCSIS
LINKTYPE_LINUX_IRDA
LINKTYPE_USER0
LINKTYPE_USER1
LINKTYPE_USER2
LINKTYPE_USER3
LINKTYPE_USER4
LINKTYPE_USER5
LINKTYPE_USER6
LINKTYPE_USER7
LINKTYPE_USER8
LINKTYPE_USER9
LINKTYPE_USER10
LINKTYPE_USER11
LINKTYPE_USER12
LINKTYPE_USER13
LINKTYPE_USER14
LINKTYPE_USER15
LINKTYPE_IEEE802_11_AVS
LINKTYPE_BACNET_MS_TP
LINKTYPE_PPP_PPPD
LINKTYPE_GPRS_LLC
LINKTYPE_GPF_T
LINKTYPE_GPF_F
LINKTYPE_LINUX_LAPD
LINKTYPE_BLUETOOTH_HCI_H4
LINKTYPE_USB_LINUX
LINKTYPE_PPI
LINKTYPE_IEEE802_15_4
LINKTYPE_SITA
LINKTYPE_ERF
LINKTYPE_BLUETOOTH_HCI_H4_WITH_PHDR
LINKTYPE_AX25_KISS
LINKTYPE_LAPD
LINKTYPE_PPP_WITH_DIR
LINKTYPE_C_HDLC_WITH_DIR
LINKTYPE_FRELAY_WITH_DIR
LINKTYPE_IPMB_LINUX
LINKTYPE_IEEE802_15_4_NONASK_PHY
LINKTYPE_USB_LINUX_MMAPPED
LINKTYPE_FC_2
LINKTYPE_FC_2_WITH_FRAME_DELIMS
LINKTYPE_IPNET
LINKTYPE_CAN_SOCKETCAN
LINKTYPE_IPV4
LINKTYPE_IPV6
LINKTYPE_IEEE802_15_4_NOFCS
LINKTYPE_DBUS
LINKTYPE_DVB_CI
LINKTYPE_MUX27010
LINKTYPE_STANAG_5066_D_PDU
LINKTYPE_NFLOG
LINKTYPE_NETANALYZER
LINKTYPE_NETANALYZER_TRANSPARENT
LINKTYPE_IPOIB
LINKTYPE_MPEG_2_TS
LINKTYPE_NG40
LINKTYPE_NFC_LLCP
LINKTYPE_INFINIBAND
LINKTYPE_SCTP
LINKTYPE_USBPCAP
LINKTYPE_RTAC_SERIAL
LINKTYPE_BLUETOOTH_LE_LL
LINKTYPE_NETLINK
LINKTYPE_BLUETOOTH_LINUX_MONITOR
LINKTYPE_BLUETOOTH_BREDR_BB
LINKTYPE_BLUETOOTH_LE_LL_WITH_PHDR
LINKTYPE_PROFIBUS_DL
LINKTYPE_PKTAP
LINKTYPE_EPON
LINKTYPE_IPMI_HPM_2
LINKTYPE_ZWAVE_R1_R2
LINKTYPE_ZWAVE_R3
LINKTYPE_WATTSTOPPER_DLM
LINKTYPE_ISO_14443
LINKTYPE_LINUX_SLL2
- LINKTYPE_APPLE_IP_OVER_IEEE1394
- LINKTYPE_ARCNET_BSD
- LINKTYPE_ARCNET_LINUX
- LINKTYPE_ATM_RFC1483
- LINKTYPE_AX25
- LINKTYPE_AX25_KISS
- LINKTYPE_BACNET_MS_TP
- LINKTYPE_BLUETOOTH_BREDR_BB
- LINKTYPE_BLUETOOTH_HCI_H4
- LINKTYPE_BLUETOOTH_HCI_H4_WITH_PHDR
- LINKTYPE_BLUETOOTH_LE_LL
- LINKTYPE_BLUETOOTH_LE_LL_WITH_PHDR
- LINKTYPE_BLUETOOTH_LINUX_MONITOR
- LINKTYPE_CAN_SOCKETCAN
- LINKTYPE_C_HDLC
- LINKTYPE_C_HDLC_WITH_DIR
- LINKTYPE_DBUS
- LINKTYPE_DLT_RAW1
- LINKTYPE_DLT_RAW2
- LINKTYPE_DOCSIS
- LINKTYPE_DVB_CI
- LINKTYPE_EPON
- LINKTYPE_ERF
- LINKTYPE_ETHERNET
- LINKTYPE_FC_2
- LINKTYPE_FC_2_WITH_FRAME_DELIMS
- LINKTYPE_FDDI
- LINKTYPE_FRELAY
- LINKTYPE_FRELAY_WITH_DIR
- LINKTYPE_GPF_F
- LINKTYPE_GPF_T
- LINKTYPE_GPRS_LLC
- LINKTYPE_IEEE802_11
- LINKTYPE_IEEE802_11_AVS
- LINKTYPE_IEEE802_11_PRISM
- LINKTYPE_IEEE802_11_RADIOTAP
- LINKTYPE_IEEE802_15_4
- LINKTYPE_IEEE802_15_4_NOFCS
- LINKTYPE_IEEE802_15_4_NONASK_PHY
- LINKTYPE_IEEE802_5
- LINKTYPE_INFINIBAND
- LINKTYPE_IPMB_LINUX
- LINKTYPE_IPMI_HPM_2
- LINKTYPE_IPNET
- LINKTYPE_IPOIB
- LINKTYPE_IPV4
- LINKTYPE_IPV6
- LINKTYPE_IP_OVER_FC
- LINKTYPE_ISO_14443
- LINKTYPE_LAPD
- LINKTYPE_LINUX_IRDA
- LINKTYPE_LINUX_LAPD
- LINKTYPE_LINUX_SLL
- LINKTYPE_LINUX_SLL2
- LINKTYPE_LOOP
- LINKTYPE_LTALK
- LINKTYPE_MPEG_2_TS
- LINKTYPE_MTP2
- LINKTYPE_MTP2_WITH_PHDR
- LINKTYPE_MTP3
- LINKTYPE_MUX27010
- LINKTYPE_NETANALYZER
- LINKTYPE_NETANALYZER_TRANSPARENT
- LINKTYPE_NETLINK
- LINKTYPE_NFC_LLCP
- LINKTYPE_NFLOG
- LINKTYPE_NG40
- LINKTYPE_NULL
- LINKTYPE_PFLOG
- LINKTYPE_PKTAP
- LINKTYPE_PPI
- LINKTYPE_PPP
- LINKTYPE_PPP_ETHER
- LINKTYPE_PPP_HDLC
- LINKTYPE_PPP_PPPD
- LINKTYPE_PPP_WITH_DIR
- LINKTYPE_PROFIBUS_DL
- LINKTYPE_RAW
- LINKTYPE_RTAC_SERIAL
- LINKTYPE_SCCP
- LINKTYPE_SCTP
- LINKTYPE_SITA
- LINKTYPE_SLIP
- LINKTYPE_STANAG_5066_D_PDU
- LINKTYPE_SUNATM
- LINKTYPE_USBPCAP
- LINKTYPE_USB_LINUX
- LINKTYPE_USB_LINUX_MMAPPED
- LINKTYPE_USER0
- LINKTYPE_USER1
- LINKTYPE_USER10
- LINKTYPE_USER11
- LINKTYPE_USER12
- LINKTYPE_USER13
- LINKTYPE_USER14
- LINKTYPE_USER15
- LINKTYPE_USER2
- LINKTYPE_USER3
- LINKTYPE_USER4
- LINKTYPE_USER5
- LINKTYPE_USER6
- LINKTYPE_USER7
- LINKTYPE_USER8
- LINKTYPE_USER9
- LINKTYPE_WATTSTOPPER_DLM
- LINKTYPE_ZWAVE_R1_R2
- LINKTYPE_ZWAVE_R3
- __init__(self: mtf.libs.mtf_pybinder.pcpp.LinkLayerType, value: int) None
- __new__(**kwargs)
- property name
- property value
- class mtf.libs.mtf_pybinder.pcpp.MACsecLayer
Represents a MACsec protocol layer
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.MACsecLayer, i_data: int, i_data_len: int, i_prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, i_packet: mtf.libs.mtf_pybinder.pcpp.Packet) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.MACsecLayer, arg0: int, arg1: int, arg2: int, arg3: int) -> None
doc
__init__(self: mtf.libs.mtf_pybinder.pcpp.MACsecLayer, arg0: int, arg1: int, arg2: int, arg3: int, arg4: Annotated[list[int], FixedSize(6)]) -> None
doc
__init__(self: mtf.libs.mtf_pybinder.pcpp.MACsecLayer, arg0: int, arg1: int, arg2: int, arg3: int, arg4: Annotated[list[int], FixedSize(6)], arg5: int) -> None
doc
__init__(self: mtf.libs.mtf_pybinder.pcpp.MACsecLayer, i_header_len: int, i_tci: int, i_short_length: int, i_packet_nbr: int, i_sys_id: Annotated[list[int], FixedSize(6)], i_port: int, i_ethertype: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.MACsecLayer, arg0: mtf.libs.mtf_pybinder.pcpp.MACsecLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.MACsecLayer, arg0: mtf.libs.mtf_pybinder.pcpp.MACsecLayer) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.MACsecLayer, : mtf.libs.mtf_pybinder.pcpp.MACsecLayer) mtf.libs.mtf_pybinder.pcpp.MACsecLayer
- Returns:
pcpp.MACsecLayer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- property icv
ICV of the MACsec packet
- Returns:
list[unsigned int]
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- property packet_nbr
Packet number
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property port
Port number
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property sci
SCI comprised of sys id plus port number
- Returns:
list[unsigned int]
- property short_length
Length of the message if it’s under 48 bytes (value 0 otherwise)
- property sys_id
System identifier
- Returns:
list[unsigned int]
- property tci_an
AN of the sectag Tci
- property tci_c
C bit of the sectag Tci
- property tci_e
E bit of the sectag Tci
- property tci_es
ES bit of the sectag Tci
- property tci_sc
SC bit of the sectag Tci
- property tci_scb
Scb bit of the sectag Tci
- property tci_ver
Version bit of the sectag Tci
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.MKALayer
Represents a MKA protocol layer
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.MKALayer, i_data: int, i_data_len: int, i_prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, i_packet: mtf.libs.mtf_pybinder.pcpp.Packet) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.MKALayer, i_version: int, i_type: int, i_length: int, i_param_sets: list[int], i_icv: Annotated[list[int], FixedSize(16)]) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.MKALayer, arg0: mtf.libs.mtf_pybinder.pcpp.MKALayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.MKALayer, arg0: mtf.libs.mtf_pybinder.pcpp.MKALayer) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.MKALayer, : mtf.libs.mtf_pybinder.pcpp.MKALayer) mtf.libs.mtf_pybinder.pcpp.MKALayer
- Returns:
pcpp.MKALayer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- property icv
ICV
- Returns:
list[unsigned int]
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property length
Length
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- property parameter_sets
Parameter sets
- Returns:
list[pcpp.MkaParameterSetBase]
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- property type
Type
- property version
MKA version
- class mtf.libs.mtf_pybinder.pcpp.MacAddress
Represents L2 MAC addresses. Can be constructed from string or a series of 6 byte octets
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.MacAddress) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.MacAddress, addr: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.MacAddress, addr: str) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.MacAddress, first_octet: int, second_octet: int, third_octet: int, fourth_octet: int, fifth_octet: int, sixth_octet: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.MacAddress, arg0: mtf.libs.mtf_pybinder.pcpp.MacAddress) -> None
- __new__(**kwargs)
- copy_to(self: mtf.libs.mtf_pybinder.pcpp.MacAddress, arr: int) None
Gets a pointer to an already allocated byte array and copies the address value to it. This method assumes array allocated size is at least 6 (the size of a MAC address)
- Args:
arr (bytes): The array which address will be copied to
- get_raw_data(self: mtf.libs.mtf_pybinder.pcpp.MacAddress) int
- Returns:
bytes: The raw data
- to_string(self: mtf.libs.mtf_pybinder.pcpp.MacAddress) str
- Returns:
str: A string representation of the address
- class mtf.libs.mtf_pybinder.pcpp.MacAddressFilter
A class for filtering Ethernet traffic by MAC addresses, for example: “ether src 12:34:56:78:90:12” or “ether dst “10:29:38:47:56:10:29”<BR> For deeper understanding of the filter concept please refer to PcapFilter.h
- __init__(self: mtf.libs.mtf_pybinder.pcpp.MacAddressFilter, address: mtf.libs.mtf_pybinder.pcpp.MacAddress, dir: mtf.libs.mtf_pybinder.pcpp.Direction) None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.MacAddressFilter, : mtf.libs.mtf_pybinder.pcpp.MacAddressFilter) mtf.libs.mtf_pybinder.pcpp.MacAddressFilter
- Returns:
pcpp.MacAddressFilter
- match_packet_with_filter(self: mtf.libs.mtf_pybinder.pcpp.GeneralFilter, raw_packet: mtf.libs.mtf_pybinder.pcpp.RawPacket) bool
Match a raw packet with a given BPF filter.
A pointer to the raw packet to match the BPF filter with True if a raw packet matches the BPF filter or false otherwise
- Args:
raw_packet (str)
- Returns:
bool
- parse_to_string(self: mtf.libs.mtf_pybinder.pcpp.GeneralFilter, result: str) None
A method that parses the class instance into BPF string format
An empty string that the parsing will be written into. If the string isn’t empty, its content will be overridden
- Args:
result (str)
- Returns:
void
- set_direction(self: mtf.libs.mtf_pybinder.pcpp.IFilterWithDirection, dir: mtf.libs.mtf_pybinder.pcpp.Direction) None
Set the direction for the filter (source or destination)
The direction
- Args:
dir (str)
- Returns:
void
- set_mac_address(self: mtf.libs.mtf_pybinder.pcpp.MacAddressFilter, address: mtf.libs.mtf_pybinder.pcpp.MacAddress) None
Set the MAC address
The MAC address to use for filtering
- Args:
address (str)
- Returns:
void
- class mtf.libs.mtf_pybinder.pcpp.MkaAccessInformationTlv
/ TLV TYPES ////
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.MkaAccessInformationTlv, i_data: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.MkaAccessInformationTlv, arg0: mtf.libs.mtf_pybinder.pcpp.MkaAccessInformationTlv) -> None
- __new__(**kwargs)
- property ac_eap
- property ac_eap_mka
- property ac_eap_mka_macsec
- property ac_higher_layer
- property ac_higher_layer_fallback
- property ac_mka
- property ac_mka_macsec
- property ac_vendor_specific
- property access_requested
- property access_status
- assign(self: mtf.libs.mtf_pybinder.pcpp.MkaAccessInformationTlv, : mtf.libs.mtf_pybinder.pcpp.MkaAccessInformationTlv) mtf.libs.mtf_pybinder.pcpp.MkaAccessInformationTlv
- Returns:
pcpp.MkaAccessInformationTlv
- property data_size
TLV data size
- property group_access
- property reserved
- property total_size
TLV total size
- property type
TLV type
- property unauthenticated_access
- property value
TLV value
- Returns:
list[unsigned int]
- property virtual_port_access
- class mtf.libs.mtf_pybinder.pcpp.MkaAnnouncement
- __init__(self: mtf.libs.mtf_pybinder.pcpp.MkaAnnouncement, i_data: int) None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.MkaAnnouncement, : mtf.libs.mtf_pybinder.pcpp.MkaAnnouncement) mtf.libs.mtf_pybinder.pcpp.MkaAnnouncement
- Returns:
pcpp.MkaAnnouncement
- property body_length
Body length
- property name
Parameter set name
- property padding_length
Padding length
- property parameter_set_type
Parameter set type
- property tlv_list
TLV list
- Returns:
list[pcpp.MkaTLV]
- class mtf.libs.mtf_pybinder.pcpp.MkaBasicParameterSet
- __init__(self: mtf.libs.mtf_pybinder.pcpp.MkaBasicParameterSet, i_data: int) None
- __new__(**kwargs)
- property actor_member_identifier
Actor member identifier. (Hex string format)
- property actor_message_number
Actor message number
- property algorithm_agility
Algorith agility
- assign(self: mtf.libs.mtf_pybinder.pcpp.MkaBasicParameterSet, : mtf.libs.mtf_pybinder.pcpp.MkaBasicParameterSet) mtf.libs.mtf_pybinder.pcpp.MkaBasicParameterSet
- Returns:
pcpp.MkaBasicParameterSet
- property body_length
Body length
- property cak_name
CAK name
- property key_server
Key server role
- property key_server_priority
MKA server priority
- property macsec_capability
Macsec capability
- property macsec_desired
MACsec desired
- property mka_version
MKA version
- property name
Parameter set name
- property padding_length
Padding length
- property parameter_set_type
Parameter set type
- property sci
SCI
- Returns:
list[unsigned int]
- class mtf.libs.mtf_pybinder.pcpp.MkaCipherSuite
- __init__(self: mtf.libs.mtf_pybinder.pcpp.MkaCipherSuite, i_data: int) None
- __new__(**kwargs)
- property implementation_capability
Cipher capability
- property reference_number
Cipher reference number
- class mtf.libs.mtf_pybinder.pcpp.MkaCipherTLV
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.MkaCipherTLV, i_data: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.MkaCipherTLV, arg0: mtf.libs.mtf_pybinder.pcpp.MkaCipherTLV) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.MkaCipherTLV, : mtf.libs.mtf_pybinder.pcpp.MkaCipherTLV) mtf.libs.mtf_pybinder.pcpp.MkaCipherTLV
- Returns:
pcpp.MkaCipherTLV
- property data_size
TLV data size
- property suites
List of cipher suites
- Returns:
list[pcpp.MkaCipherSuite]
- property total_size
TLV total size
- property type
TLV type
- property value
TLV value
- Returns:
list[unsigned int]
- class mtf.libs.mtf_pybinder.pcpp.MkaDistributedCAK
- __init__(self: mtf.libs.mtf_pybinder.pcpp.MkaDistributedCAK, i_data: int) None
- __new__(**kwargs)
- property aes_key_wrap
AES key wrap
- Returns:
list[unsigned int]
- assign(self: mtf.libs.mtf_pybinder.pcpp.MkaDistributedCAK, : mtf.libs.mtf_pybinder.pcpp.MkaDistributedCAK) mtf.libs.mtf_pybinder.pcpp.MkaDistributedCAK
- Returns:
pcpp.MkaDistributedCAK
- property body_length
Body length
- property cak_key_name
CAK key name
- property name
Parameter set name
- property padding_length
Padding length
- property parameter_set_type
Parameter set type
- class mtf.libs.mtf_pybinder.pcpp.MkaDistributedSAK
- __init__(self: mtf.libs.mtf_pybinder.pcpp.MkaDistributedSAK, i_data: int) None
- __new__(**kwargs)
- property aes_key_wrap
AES key wrap
- Returns:
list[unsigned int]
- assign(self: mtf.libs.mtf_pybinder.pcpp.MkaDistributedSAK, : mtf.libs.mtf_pybinder.pcpp.MkaDistributedSAK) mtf.libs.mtf_pybinder.pcpp.MkaDistributedSAK
- Returns:
pcpp.MkaDistributedSAK
- property body_length
Body length
- property confidentiality_offset
Confidentiality offset
- property distributed_an
Distributed AN
- property key_number
Key number
- property macsec_cipher_suite
MACsec cipher suite
- Returns:
list[unsigned int]
- property name
Parameter set name
- property padding_length
Padding length
- property parameter_set_type
Parameter set type
- class mtf.libs.mtf_pybinder.pcpp.MkaKMD
- __init__(self: mtf.libs.mtf_pybinder.pcpp.MkaKMD, i_data: int) None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.MkaKMD, : mtf.libs.mtf_pybinder.pcpp.MkaKMD) mtf.libs.mtf_pybinder.pcpp.MkaKMD
- Returns:
pcpp.MkaKMD
- property body_length
Body length
- property kmd
KMD
- property name
Parameter set name
- property padding_length
Padding length
- property parameter_set_type
Parameter set type
- class mtf.libs.mtf_pybinder.pcpp.MkaKeyManagementDomainTlv
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.MkaKeyManagementDomainTlv, i_data: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.MkaKeyManagementDomainTlv, arg0: mtf.libs.mtf_pybinder.pcpp.MkaKeyManagementDomainTlv) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.MkaKeyManagementDomainTlv, : mtf.libs.mtf_pybinder.pcpp.MkaKeyManagementDomainTlv) mtf.libs.mtf_pybinder.pcpp.MkaKeyManagementDomainTlv
- Returns:
pcpp.MkaKeyManagementDomainTlv
- property data_size
TLV data size
- property kmd_name
KMD name
- Returns:
list[unsigned int]
- property total_size
TLV total size
- property type
TLV type
- property value
TLV value
- Returns:
list[unsigned int]
- class mtf.libs.mtf_pybinder.pcpp.MkaLivePeerList
- __init__(self: mtf.libs.mtf_pybinder.pcpp.MkaLivePeerList, i_data: int) None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.MkaLivePeerList, : mtf.libs.mtf_pybinder.pcpp.MkaLivePeerList) mtf.libs.mtf_pybinder.pcpp.MkaLivePeerList
- Returns:
pcpp.MkaLivePeerList
- property body_length
Body length
- property key_server_ssci
Key server ssci
- property member_list
Member list
- Returns:
str
- property name
Parameter set name
- property padding_length
Padding length
- property parameter_set_type
Parameter set type
- class mtf.libs.mtf_pybinder.pcpp.MkaNetworkIdentityTlv
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.MkaNetworkIdentityTlv, i_data: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.MkaNetworkIdentityTlv, arg0: mtf.libs.mtf_pybinder.pcpp.MkaNetworkIdentityTlv) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.MkaNetworkIdentityTlv, : mtf.libs.mtf_pybinder.pcpp.MkaNetworkIdentityTlv) mtf.libs.mtf_pybinder.pcpp.MkaNetworkIdentityTlv
- Returns:
pcpp.MkaNetworkIdentityTlv
- property data_size
TLV data size
- property nid_name
Nid name
- Returns:
list[unsigned int]
- property total_size
TLV total size
- property type
TLV type
- property value
TLV value
- Returns:
list[unsigned int]
- class mtf.libs.mtf_pybinder.pcpp.MkaParameterSetBase
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.MkaParameterSetBase, i_data: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.MkaParameterSetBase, arg0: mtf.libs.mtf_pybinder.pcpp.MkaParameterSetBase) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.MkaParameterSetBase, arg0: mtf.libs.mtf_pybinder.pcpp.MkaParameterSetBase) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.MkaParameterSetBase, : mtf.libs.mtf_pybinder.pcpp.MkaParameterSetBase) mtf.libs.mtf_pybinder.pcpp.MkaParameterSetBase
- Returns:
pcpp.MkaParameterSetBase
- property body_length
Body length
- property name
Parameter set name
- property padding_length
Padding length
- property parameter_set_type
Parameter set type
- class mtf.libs.mtf_pybinder.pcpp.MkaParameterSetType
Members:
BASIC
LIVE_PEER_LIST
POTENTIAL_PEER_LIST
SAKUSE
DISTRIBUTED_SAK
DISTRIBUTED_CAK
KMD
ANNOUNCEMENT
XPN
- ANNOUNCEMENT
- BASIC
- DISTRIBUTED_CAK
- DISTRIBUTED_SAK
- KMD
- LIVE_PEER_LIST
- POTENTIAL_PEER_LIST
- SAKUSE
- XPN
- __init__(self: mtf.libs.mtf_pybinder.pcpp.MkaParameterSetType, value: int) None
- __new__(**kwargs)
- property name
- property value
- class mtf.libs.mtf_pybinder.pcpp.MkaPeerList
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.MkaPeerList, i_data: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.MkaPeerList, arg0: mtf.libs.mtf_pybinder.pcpp.MkaPeerList) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.MkaPeerList, arg0: mtf.libs.mtf_pybinder.pcpp.MkaPeerList) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.MkaPeerList, : mtf.libs.mtf_pybinder.pcpp.MkaPeerList) mtf.libs.mtf_pybinder.pcpp.MkaPeerList
- Returns:
pcpp.MkaPeerList
- property body_length
Body length
- property key_server_ssci
Key server ssci
- property member_list
Member list
- Returns:
str
- property name
Parameter set name
- property padding_length
Padding length
- property parameter_set_type
Parameter set type
- class mtf.libs.mtf_pybinder.pcpp.MkaPotentialPeerList
- __init__(self: mtf.libs.mtf_pybinder.pcpp.MkaPotentialPeerList, i_data: int) None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.MkaPotentialPeerList, : mtf.libs.mtf_pybinder.pcpp.MkaPotentialPeerList) mtf.libs.mtf_pybinder.pcpp.MkaPotentialPeerList
- Returns:
pcpp.MkaPotentialPeerList
- property body_length
Body length
- property key_server_ssci
Key server ssci
- property member_list
Member list
- Returns:
str
- property name
Parameter set name
- property padding_length
Padding length
- property parameter_set_type
Parameter set type
- class mtf.libs.mtf_pybinder.pcpp.MkaSakUse
- __init__(self: mtf.libs.mtf_pybinder.pcpp.MkaSakUse, i_data: int) None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.MkaSakUse, : mtf.libs.mtf_pybinder.pcpp.MkaSakUse) mtf.libs.mtf_pybinder.pcpp.MkaSakUse
- Returns:
pcpp.MkaSakUse
- property body_length
Body length
- property delay_protect
Delay protect
- property latest_key_acceptable_pn
Latest key acceptable packet number
- property latest_key_an
Latest key AN
- property latest_key_number
Latest key number
- property latest_key_rx
Latest key rx
- property latest_key_sm_identifier
Latest key sm identifier
- Returns:
list[unsigned int]
- property latest_key_tx
Latest key tx
- property name
Parameter set name
- property old_key_acceptable_pn
Old key acceptable packet number
- property old_key_an
Old key AN
- property old_key_number
Old key number
- property old_key_rx
Old key rx
- property old_key_sm_identifier
Old key sm identifier
- Returns:
list[unsigned int]
- property old_key_tx
Old key tx
- property padding_length
Padding length
- property parameter_set_type
Parameter set type
- property plain_rx
Plain rx
- property plain_tx
Plain tx
- class mtf.libs.mtf_pybinder.pcpp.MkaTLV
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.MkaTLV, i_data: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.MkaTLV, arg0: mtf.libs.mtf_pybinder.pcpp.MkaTLV) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.MkaTLV, : mtf.libs.mtf_pybinder.pcpp.MkaTLV) mtf.libs.mtf_pybinder.pcpp.MkaTLV
- Returns:
pcpp.MkaTLV
- property data_size
TLV data size
- property total_size
TLV total size
- property type
TLV type
- property value
TLV value
- Returns:
list[unsigned int]
- class mtf.libs.mtf_pybinder.pcpp.MkaTlvType
Members:
ACCESS_INFORMATION_TLV
CIPHER_TLV
KEY_MANAGEMENT_DOMAIN_TLV
NETWORK_IDENTITY_TLV
- ACCESS_INFORMATION_TLV
- CIPHER_TLV
- KEY_MANAGEMENT_DOMAIN_TLV
- NETWORK_IDENTITY_TLV
- __init__(self: mtf.libs.mtf_pybinder.pcpp.MkaTlvType, value: int) None
- __new__(**kwargs)
- property name
- property value
- class mtf.libs.mtf_pybinder.pcpp.MkaXPN
- __init__(self: mtf.libs.mtf_pybinder.pcpp.MkaXPN, i_data: int) None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.MkaXPN, : mtf.libs.mtf_pybinder.pcpp.MkaXPN) mtf.libs.mtf_pybinder.pcpp.MkaXPN
- Returns:
pcpp.MkaXPN
- property body_length
Body length
- property latest_key_lowest_apn
Latest key lowest apn
- property name
Parameter set name
- property old_key_lowest_apn
Old key latest apn
- property padding_length
Padding length
- property parameter_set_type
Parameter set type
- property suspension_time
Suspension time
- class mtf.libs.mtf_pybinder.pcpp.MplsLayer
Represents a MPLS (Multi-Protocol Label Switching) layer
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.MplsLayer, data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.MplsLayer, mpls_label: int, ttl: int, experimental_use_value: int, bottom_of_stack: bool) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.MplsLayer, arg0: mtf.libs.mtf_pybinder.pcpp.MplsLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.MplsLayer, arg0: mtf.libs.mtf_pybinder.pcpp.MplsLayer) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.MplsLayer, : mtf.libs.mtf_pybinder.pcpp.MplsLayer) mtf.libs.mtf_pybinder.pcpp.MplsLayer
- Returns:
pcpp.MplsLayer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.MplsLayer) None
Set/unset the bottom-of-stack bit according to next layer: if it’s a MPLS layer then bottom-of-stack will be unset. If it’s not a MPLS layer this bit will be set
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_experimental_use_value(self: mtf.libs.mtf_pybinder.pcpp.MplsLayer) int
The exp value (3 bits) of the MPLS label
- Returns:
unsigned int
- get_header_len(self: mtf.libs.mtf_pybinder.pcpp.MplsLayer) int
Size of MPLS header (4 bytes)
- Returns:
unsigned int
- get_mpls_label(self: mtf.libs.mtf_pybinder.pcpp.MplsLayer) int
The MPLS label value (20 bits)
- Returns:
unsigned int
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_osi_model_layer(self: mtf.libs.mtf_pybinder.pcpp.MplsLayer) mtf.libs.mtf_pybinder.pcpp.OsiModelLayer
- Returns:
enum pcpp.OsiModelLayer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- get_ttl(self: mtf.libs.mtf_pybinder.pcpp.MplsLayer) int
TTL value of the MPLS header
- Returns:
unsigned int
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- is_bottom_of_stack(self: mtf.libs.mtf_pybinder.pcpp.MplsLayer) bool
Get an indication whether the next layer is also be a MPLS label or not True if it’s the last MPLS layer, false otherwise
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.MplsLayer) None
Currently identifies the following next layers: IPv4Layer, IPv6Layer, MplsLayer. Otherwise sets PayloadLayer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- set_bottom_of_stack(self: mtf.libs.mtf_pybinder.pcpp.MplsLayer, val: bool) None
Set the bottom-of-stack bit in the MPLS label Set or unset the bit
- Args:
val (bool)
- set_experimental_use_value(self: mtf.libs.mtf_pybinder.pcpp.MplsLayer, val: int) bool
Set the exp value (3 bits) of the MPLS label The exp value to set. val must be a valid number meaning between 0 and 7 (inclusive) True if exp value was set successfully or false if val has invalid value
- Args:
val (unsigned int)
- Returns:
bool
- set_mpls_label(self: mtf.libs.mtf_pybinder.pcpp.MplsLayer, label: int) bool
Set the MPLS label (20 bits) The label to set. label must be a valid number meaning between 0 and 0xFFFFF (inclusive) True if label was set successfully or false if label has invalid value
- Args:
label (unsigned int)
- Returns:
bool
- set_ttl(self: mtf.libs.mtf_pybinder.pcpp.MplsLayer, ttl: int) None
Set the TTL value The TTL value to set
- Args:
ttl (unsigned int)
- to_string(self: mtf.libs.mtf_pybinder.pcpp.MplsLayer) str
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.NDPInverseNeighborAdvertisementLayer
Represents a NDP Inverse Neighbor Discovery Advertisement message
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.NDPInverseNeighborAdvertisementLayer, code: int, source_link_layer_address: mtf.libs.mtf_pybinder.pcpp.MacAddress, target_link_layer_address: mtf.libs.mtf_pybinder.pcpp.MacAddress, target_address_list: list[mtf.libs.mtf_pybinder.pcpp.IPv6Address]) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.NDPInverseNeighborAdvertisementLayer, code: int, source_link_layer_address: mtf.libs.mtf_pybinder.pcpp.MacAddress, target_link_layer_address: mtf.libs.mtf_pybinder.pcpp.MacAddress, target_address_list: list[mtf.libs.mtf_pybinder.pcpp.IPv6Address], mtu: int) -> None
- __new__(**kwargs)
- add_ndp_option(self: mtf.libs.mtf_pybinder.pcpp.NDPLayerBase, option_builder: mtf.libs.mtf_pybinder.pcpp.NdpOptionBuilder) mtf.libs.mtf_pybinder.pcpp.NdpOption
Add a new NDP option at the end of the layer (after the last NDP option) An NdpOptionBuilder object that contains the NDP option data to be added A NdpOption object that contains the newly added NDP option data or logical NULL (NdpOption#isNull() == true) if addition failed. In case of a failure a corresponding error message will be printed to log
- Args:
option_builder (pcpp.NdpOptionBuilder): An NdpOptionBuilder object that contains the NDP option data to be added
- Returns:
pcpp.NdpOption: A NdpOption object that contains the newly added NDP option data or logical NULL
(NdpOption#isNull() == true) if addition failed. In case of a failure a corresponding error message will be printed to log
- assign(self: mtf.libs.mtf_pybinder.pcpp.NDPLayerBase, : mtf.libs.mtf_pybinder.pcpp.NDPLayerBase) mtf.libs.mtf_pybinder.pcpp.NDPLayerBase
- Returns:
pcpp.NDPLayerBase
- property checksum
Get the checksum header field in host representation
- property code
Get the code header field
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_first_ndp_option(self: mtf.libs.mtf_pybinder.pcpp.NDPLayerBase) mtf.libs.mtf_pybinder.pcpp.NdpOption
The first NDP option in the packet. If the current layer contains no options the returned value will contain a logical NULL (NdpOption#isNull() == true)
- Returns:
pcpp.NdpOption
- get_ndp_option(self: mtf.libs.mtf_pybinder.pcpp.NDPLayerBase, option_type: mtf.libs.mtf_pybinder.pcpp.NDPNeighborOptionTypes) mtf.libs.mtf_pybinder.pcpp.NdpOption
Get a NDP option by type.
- Args:
option_type (enum pcpp.NDPNeighborOptionTypes): NDP option type
- Returns:
pcpp.NdpOption: An NdpOption object that contains the first option that matches this type, or logical NULL
(NdpOption#isNull() == true) if no such option found
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_next_ndp_option(self: mtf.libs.mtf_pybinder.pcpp.NDPLayerBase, option: mtf.libs.mtf_pybinder.pcpp.NdpOption) mtf.libs.mtf_pybinder.pcpp.NdpOption
Get the NDP option that comes after a given option. If the given option was the last one, the returned value will contain a logical NULL (IdpOption#isNull() == true)
- Args:
option (pcpp.NdpOption): An NDP option object that exists in the current layer
- Returns:
pcpp.NdpOption: A NdpOption object that contains the NDP option data that comes next, or logical NULL if the given
NDP option: (1) was the last one; or (2) contains a logical NULL; or (3) doesn’t belong to this packet
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- has_mtu(self: mtf.libs.mtf_pybinder.pcpp.NDPInverseNeighborDiscoveryLayer) bool
Checks if the layer has an MTU option set
- has_source_link_layer_address(self: mtf.libs.mtf_pybinder.pcpp.NDPInverseNeighborDiscoveryLayer) bool
Checks if the layer has a source link-layer address option set
- has_target_address_list(self: mtf.libs.mtf_pybinder.pcpp.NDPInverseNeighborAdvertisementLayer) bool
Checks if the layer has a target address list option set
- has_target_link_layer_address(self: mtf.libs.mtf_pybinder.pcpp.NDPInverseNeighborDiscoveryLayer) bool
Checks if the layer has a target link-layer address option set
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- is_message_of_type(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6Layer, type: mtf.libs.mtf_pybinder.pcpp.ICMPv6MessageType) bool
Type to check True if the layer if of the given type, false otherwise
- Args:
type (enum pcpp.ICMPv6MessageType): Type to check
- Returns:
bool: True if the layer if of the given type, false otherwise
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property message_type
Get the ICMPv6 Message Type
- property mtu
Recommended MTU for the link
- property ndp_option_count
The number of NDP options in this layer
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- remove_all_ndp_options(self: mtf.libs.mtf_pybinder.pcpp.NDPLayerBase) bool
Remove all NDP options from the layer
- Returns:
bool: True if options removed successfully or false if some error occurred (an appropriate error message will
be printed to log)
- property reserved
Reserved field
- property source_link_layer_address
Source link-layer address
- property target_address_list
Target address list
- property target_link_layer_address
Target link-layer address
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.NDPInverseNeighborDiscoveryLayer
Represents a NDP Inverse Neighbor Discovery message
- __init__(*args, **kwargs)
- __new__(**kwargs)
- add_ndp_option(self: mtf.libs.mtf_pybinder.pcpp.NDPLayerBase, option_builder: mtf.libs.mtf_pybinder.pcpp.NdpOptionBuilder) mtf.libs.mtf_pybinder.pcpp.NdpOption
Add a new NDP option at the end of the layer (after the last NDP option) An NdpOptionBuilder object that contains the NDP option data to be added A NdpOption object that contains the newly added NDP option data or logical NULL (NdpOption#isNull() == true) if addition failed. In case of a failure a corresponding error message will be printed to log
- Args:
option_builder (pcpp.NdpOptionBuilder): An NdpOptionBuilder object that contains the NDP option data to be added
- Returns:
pcpp.NdpOption: A NdpOption object that contains the newly added NDP option data or logical NULL
(NdpOption#isNull() == true) if addition failed. In case of a failure a corresponding error message will be printed to log
- assign(self: mtf.libs.mtf_pybinder.pcpp.NDPLayerBase, : mtf.libs.mtf_pybinder.pcpp.NDPLayerBase) mtf.libs.mtf_pybinder.pcpp.NDPLayerBase
- Returns:
pcpp.NDPLayerBase
- property checksum
Get the checksum header field in host representation
- property code
Get the code header field
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_first_ndp_option(self: mtf.libs.mtf_pybinder.pcpp.NDPLayerBase) mtf.libs.mtf_pybinder.pcpp.NdpOption
The first NDP option in the packet. If the current layer contains no options the returned value will contain a logical NULL (NdpOption#isNull() == true)
- Returns:
pcpp.NdpOption
- get_ndp_option(self: mtf.libs.mtf_pybinder.pcpp.NDPLayerBase, option_type: mtf.libs.mtf_pybinder.pcpp.NDPNeighborOptionTypes) mtf.libs.mtf_pybinder.pcpp.NdpOption
Get a NDP option by type.
- Args:
option_type (enum pcpp.NDPNeighborOptionTypes): NDP option type
- Returns:
pcpp.NdpOption: An NdpOption object that contains the first option that matches this type, or logical NULL
(NdpOption#isNull() == true) if no such option found
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_next_ndp_option(self: mtf.libs.mtf_pybinder.pcpp.NDPLayerBase, option: mtf.libs.mtf_pybinder.pcpp.NdpOption) mtf.libs.mtf_pybinder.pcpp.NdpOption
Get the NDP option that comes after a given option. If the given option was the last one, the returned value will contain a logical NULL (IdpOption#isNull() == true)
- Args:
option (pcpp.NdpOption): An NDP option object that exists in the current layer
- Returns:
pcpp.NdpOption: A NdpOption object that contains the NDP option data that comes next, or logical NULL if the given
NDP option: (1) was the last one; or (2) contains a logical NULL; or (3) doesn’t belong to this packet
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- has_mtu(self: mtf.libs.mtf_pybinder.pcpp.NDPInverseNeighborDiscoveryLayer) bool
Checks if the layer has an MTU option set
- has_source_link_layer_address(self: mtf.libs.mtf_pybinder.pcpp.NDPInverseNeighborDiscoveryLayer) bool
Checks if the layer has a source link-layer address option set
- has_target_link_layer_address(self: mtf.libs.mtf_pybinder.pcpp.NDPInverseNeighborDiscoveryLayer) bool
Checks if the layer has a target link-layer address option set
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- is_message_of_type(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6Layer, type: mtf.libs.mtf_pybinder.pcpp.ICMPv6MessageType) bool
Type to check True if the layer if of the given type, false otherwise
- Args:
type (enum pcpp.ICMPv6MessageType): Type to check
- Returns:
bool: True if the layer if of the given type, false otherwise
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property message_type
Get the ICMPv6 Message Type
- property mtu
Recommended MTU for the link
- property ndp_option_count
The number of NDP options in this layer
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- remove_all_ndp_options(self: mtf.libs.mtf_pybinder.pcpp.NDPLayerBase) bool
Remove all NDP options from the layer
- Returns:
bool: True if options removed successfully or false if some error occurred (an appropriate error message will
be printed to log)
- property reserved
Reserved field
- property source_link_layer_address
Source link-layer address
- property target_link_layer_address
Target link-layer address
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.NDPInverseNeighborSolicitationLayer
Represents a NDP Inverse Neighbor Discovery Solicitation message
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.NDPInverseNeighborSolicitationLayer, code: int, source_link_layer_address: mtf.libs.mtf_pybinder.pcpp.MacAddress, target_link_layer_address: mtf.libs.mtf_pybinder.pcpp.MacAddress, source_address_list: list[mtf.libs.mtf_pybinder.pcpp.IPv6Address] = []) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.NDPInverseNeighborSolicitationLayer, code: int, source_link_layer_address: mtf.libs.mtf_pybinder.pcpp.MacAddress, target_link_layer_address: mtf.libs.mtf_pybinder.pcpp.MacAddress, mtu: int, source_address_list: list[mtf.libs.mtf_pybinder.pcpp.IPv6Address] = []) -> None
- __new__(**kwargs)
- add_ndp_option(self: mtf.libs.mtf_pybinder.pcpp.NDPLayerBase, option_builder: mtf.libs.mtf_pybinder.pcpp.NdpOptionBuilder) mtf.libs.mtf_pybinder.pcpp.NdpOption
Add a new NDP option at the end of the layer (after the last NDP option) An NdpOptionBuilder object that contains the NDP option data to be added A NdpOption object that contains the newly added NDP option data or logical NULL (NdpOption#isNull() == true) if addition failed. In case of a failure a corresponding error message will be printed to log
- Args:
option_builder (pcpp.NdpOptionBuilder): An NdpOptionBuilder object that contains the NDP option data to be added
- Returns:
pcpp.NdpOption: A NdpOption object that contains the newly added NDP option data or logical NULL
(NdpOption#isNull() == true) if addition failed. In case of a failure a corresponding error message will be printed to log
- assign(self: mtf.libs.mtf_pybinder.pcpp.NDPLayerBase, : mtf.libs.mtf_pybinder.pcpp.NDPLayerBase) mtf.libs.mtf_pybinder.pcpp.NDPLayerBase
- Returns:
pcpp.NDPLayerBase
- property checksum
Get the checksum header field in host representation
- property code
Get the code header field
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_first_ndp_option(self: mtf.libs.mtf_pybinder.pcpp.NDPLayerBase) mtf.libs.mtf_pybinder.pcpp.NdpOption
The first NDP option in the packet. If the current layer contains no options the returned value will contain a logical NULL (NdpOption#isNull() == true)
- Returns:
pcpp.NdpOption
- get_ndp_option(self: mtf.libs.mtf_pybinder.pcpp.NDPLayerBase, option_type: mtf.libs.mtf_pybinder.pcpp.NDPNeighborOptionTypes) mtf.libs.mtf_pybinder.pcpp.NdpOption
Get a NDP option by type.
- Args:
option_type (enum pcpp.NDPNeighborOptionTypes): NDP option type
- Returns:
pcpp.NdpOption: An NdpOption object that contains the first option that matches this type, or logical NULL
(NdpOption#isNull() == true) if no such option found
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_next_ndp_option(self: mtf.libs.mtf_pybinder.pcpp.NDPLayerBase, option: mtf.libs.mtf_pybinder.pcpp.NdpOption) mtf.libs.mtf_pybinder.pcpp.NdpOption
Get the NDP option that comes after a given option. If the given option was the last one, the returned value will contain a logical NULL (IdpOption#isNull() == true)
- Args:
option (pcpp.NdpOption): An NDP option object that exists in the current layer
- Returns:
pcpp.NdpOption: A NdpOption object that contains the NDP option data that comes next, or logical NULL if the given
NDP option: (1) was the last one; or (2) contains a logical NULL; or (3) doesn’t belong to this packet
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- has_mtu(self: mtf.libs.mtf_pybinder.pcpp.NDPInverseNeighborDiscoveryLayer) bool
Checks if the layer has an MTU option set
- has_source_address_list(self: mtf.libs.mtf_pybinder.pcpp.NDPInverseNeighborSolicitationLayer) bool
Checks if the layer has a source address list option set
- has_source_link_layer_address(self: mtf.libs.mtf_pybinder.pcpp.NDPInverseNeighborDiscoveryLayer) bool
Checks if the layer has a source link-layer address option set
- has_target_link_layer_address(self: mtf.libs.mtf_pybinder.pcpp.NDPInverseNeighborDiscoveryLayer) bool
Checks if the layer has a target link-layer address option set
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- is_message_of_type(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6Layer, type: mtf.libs.mtf_pybinder.pcpp.ICMPv6MessageType) bool
Type to check True if the layer if of the given type, false otherwise
- Args:
type (enum pcpp.ICMPv6MessageType): Type to check
- Returns:
bool: True if the layer if of the given type, false otherwise
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property message_type
Get the ICMPv6 Message Type
- property mtu
Recommended MTU for the link
- property ndp_option_count
The number of NDP options in this layer
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- remove_all_ndp_options(self: mtf.libs.mtf_pybinder.pcpp.NDPLayerBase) bool
Remove all NDP options from the layer
- Returns:
bool: True if options removed successfully or false if some error occurred (an appropriate error message will
be printed to log)
- property reserved
Reserved field
- property source_address_list
Source address list
- property source_link_layer_address
Source link-layer address
- property target_link_layer_address
Target link-layer address
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.NDPLayerBase
Represents a base for NDP packet types
- __init__(*args, **kwargs)
- __new__(**kwargs)
- add_ndp_option(self: mtf.libs.mtf_pybinder.pcpp.NDPLayerBase, option_builder: mtf.libs.mtf_pybinder.pcpp.NdpOptionBuilder) mtf.libs.mtf_pybinder.pcpp.NdpOption
Add a new NDP option at the end of the layer (after the last NDP option) An NdpOptionBuilder object that contains the NDP option data to be added A NdpOption object that contains the newly added NDP option data or logical NULL (NdpOption#isNull() == true) if addition failed. In case of a failure a corresponding error message will be printed to log
- Args:
option_builder (pcpp.NdpOptionBuilder): An NdpOptionBuilder object that contains the NDP option data to be added
- Returns:
pcpp.NdpOption: A NdpOption object that contains the newly added NDP option data or logical NULL
(NdpOption#isNull() == true) if addition failed. In case of a failure a corresponding error message will be printed to log
- assign(self: mtf.libs.mtf_pybinder.pcpp.NDPLayerBase, : mtf.libs.mtf_pybinder.pcpp.NDPLayerBase) mtf.libs.mtf_pybinder.pcpp.NDPLayerBase
- Returns:
pcpp.NDPLayerBase
- property checksum
Get the checksum header field in host representation
- property code
Get the code header field
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_first_ndp_option(self: mtf.libs.mtf_pybinder.pcpp.NDPLayerBase) mtf.libs.mtf_pybinder.pcpp.NdpOption
The first NDP option in the packet. If the current layer contains no options the returned value will contain a logical NULL (NdpOption#isNull() == true)
- Returns:
pcpp.NdpOption
- get_ndp_option(self: mtf.libs.mtf_pybinder.pcpp.NDPLayerBase, option_type: mtf.libs.mtf_pybinder.pcpp.NDPNeighborOptionTypes) mtf.libs.mtf_pybinder.pcpp.NdpOption
Get a NDP option by type.
- Args:
option_type (enum pcpp.NDPNeighborOptionTypes): NDP option type
- Returns:
pcpp.NdpOption: An NdpOption object that contains the first option that matches this type, or logical NULL
(NdpOption#isNull() == true) if no such option found
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_next_ndp_option(self: mtf.libs.mtf_pybinder.pcpp.NDPLayerBase, option: mtf.libs.mtf_pybinder.pcpp.NdpOption) mtf.libs.mtf_pybinder.pcpp.NdpOption
Get the NDP option that comes after a given option. If the given option was the last one, the returned value will contain a logical NULL (IdpOption#isNull() == true)
- Args:
option (pcpp.NdpOption): An NDP option object that exists in the current layer
- Returns:
pcpp.NdpOption: A NdpOption object that contains the NDP option data that comes next, or logical NULL if the given
NDP option: (1) was the last one; or (2) contains a logical NULL; or (3) doesn’t belong to this packet
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- is_message_of_type(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6Layer, type: mtf.libs.mtf_pybinder.pcpp.ICMPv6MessageType) bool
Type to check True if the layer if of the given type, false otherwise
- Args:
type (enum pcpp.ICMPv6MessageType): Type to check
- Returns:
bool: True if the layer if of the given type, false otherwise
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property message_type
Get the ICMPv6 Message Type
- property ndp_option_count
The number of NDP options in this layer
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- remove_all_ndp_options(self: mtf.libs.mtf_pybinder.pcpp.NDPLayerBase) bool
Remove all NDP options from the layer
- Returns:
bool: True if options removed successfully or false if some error occurred (an appropriate error message will
be printed to log)
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.NDPNeighborAdvertisementLayer
Represents a NDP Neighbor Advertisement protocol layer
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.NDPNeighborAdvertisementLayer, code: int, target_address: mtf.libs.mtf_pybinder.pcpp.IPv6Address, target_link_layer_address: mtf.libs.mtf_pybinder.pcpp.MacAddress, router_flag: bool, solicited_flag: bool, override_flag: bool) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.NDPNeighborAdvertisementLayer, code: int, target_address: mtf.libs.mtf_pybinder.pcpp.IPv6Address, router_flag: bool, solicited_flag: bool, override_flag: bool) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.NDPNeighborAdvertisementLayer, arg0: mtf.libs.mtf_pybinder.pcpp.NDPNeighborAdvertisementLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.NDPNeighborAdvertisementLayer, arg0: mtf.libs.mtf_pybinder.pcpp.NDPNeighborAdvertisementLayer) -> None
- __new__(**kwargs)
- add_ndp_option(self: mtf.libs.mtf_pybinder.pcpp.NDPLayerBase, option_builder: mtf.libs.mtf_pybinder.pcpp.NdpOptionBuilder) mtf.libs.mtf_pybinder.pcpp.NdpOption
Add a new NDP option at the end of the layer (after the last NDP option) An NdpOptionBuilder object that contains the NDP option data to be added A NdpOption object that contains the newly added NDP option data or logical NULL (NdpOption#isNull() == true) if addition failed. In case of a failure a corresponding error message will be printed to log
- Args:
option_builder (pcpp.NdpOptionBuilder): An NdpOptionBuilder object that contains the NDP option data to be added
- Returns:
pcpp.NdpOption: A NdpOption object that contains the newly added NDP option data or logical NULL
(NdpOption#isNull() == true) if addition failed. In case of a failure a corresponding error message will be printed to log
- assign(self: mtf.libs.mtf_pybinder.pcpp.NDPNeighborAdvertisementLayer, : mtf.libs.mtf_pybinder.pcpp.NDPNeighborAdvertisementLayer) mtf.libs.mtf_pybinder.pcpp.NDPNeighborAdvertisementLayer
- Returns:
pcpp.NDPNeighborAdvertisementLayer
- property checksum
Get the checksum header field in host representation
- property code
Get the code header field
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_first_ndp_option(self: mtf.libs.mtf_pybinder.pcpp.NDPLayerBase) mtf.libs.mtf_pybinder.pcpp.NdpOption
The first NDP option in the packet. If the current layer contains no options the returned value will contain a logical NULL (NdpOption#isNull() == true)
- Returns:
pcpp.NdpOption
- get_ndp_option(self: mtf.libs.mtf_pybinder.pcpp.NDPLayerBase, option_type: mtf.libs.mtf_pybinder.pcpp.NDPNeighborOptionTypes) mtf.libs.mtf_pybinder.pcpp.NdpOption
Get a NDP option by type.
- Args:
option_type (enum pcpp.NDPNeighborOptionTypes): NDP option type
- Returns:
pcpp.NdpOption: An NdpOption object that contains the first option that matches this type, or logical NULL
(NdpOption#isNull() == true) if no such option found
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_next_ndp_option(self: mtf.libs.mtf_pybinder.pcpp.NDPLayerBase, option: mtf.libs.mtf_pybinder.pcpp.NdpOption) mtf.libs.mtf_pybinder.pcpp.NdpOption
Get the NDP option that comes after a given option. If the given option was the last one, the returned value will contain a logical NULL (IdpOption#isNull() == true)
- Args:
option (pcpp.NdpOption): An NDP option object that exists in the current layer
- Returns:
pcpp.NdpOption: A NdpOption object that contains the NDP option data that comes next, or logical NULL if the given
NDP option: (1) was the last one; or (2) contains a logical NULL; or (3) doesn’t belong to this packet
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- has_target_link_layer_address(self: mtf.libs.mtf_pybinder.pcpp.NDPNeighborAdvertisementLayer) bool
Get information if the target link-layer address was added in the option field of the header
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- is_message_of_type(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6Layer, type: mtf.libs.mtf_pybinder.pcpp.ICMPv6MessageType) bool
Type to check True if the layer if of the given type, false otherwise
- Args:
type (enum pcpp.ICMPv6MessageType): Type to check
- Returns:
bool: True if the layer if of the given type, false otherwise
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property message_type
Get the ICMPv6 Message Type
- property ndp_option_count
The number of NDP options in this layer
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- property override_flag
Override flag
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- remove_all_ndp_options(self: mtf.libs.mtf_pybinder.pcpp.NDPLayerBase) bool
Remove all NDP options from the layer
- Returns:
bool: True if options removed successfully or false if some error occurred (an appropriate error message will
be printed to log)
- property reserved
Reserved field
- property router_flag
Router flag
- property solicited_flag
Unicast flag
- property target_address
Target IP address
- property target_link_layer_address
Target MAC address
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.NDPNeighborOptionTypes
An enum representing the available option types for Neighbor Discovery in IPv6 (see RFC 4861)
Members:
NDP_OPTION_SOURCE_LINK_LAYER
NDP_OPTION_TARGET_LINK_LAYER
NDP_OPTION_PREFIX_INFORMATION
NDP_OPTION_REDIRECTED_HEADER
NDP_OPTION_MTU
NDP_OPTION_SOURCE_ADDRESS_LIST
NDP_OPTION_TARGET_ADDRESS_LIST
NDP_OPTION_UNKNOWN
- NDP_OPTION_MTU
- NDP_OPTION_PREFIX_INFORMATION
- NDP_OPTION_REDIRECTED_HEADER
- NDP_OPTION_SOURCE_ADDRESS_LIST
- NDP_OPTION_SOURCE_LINK_LAYER
- NDP_OPTION_TARGET_ADDRESS_LIST
- NDP_OPTION_TARGET_LINK_LAYER
- NDP_OPTION_UNKNOWN
- __init__(self: mtf.libs.mtf_pybinder.pcpp.NDPNeighborOptionTypes, value: int) None
- __new__(**kwargs)
- property name
- property value
- class mtf.libs.mtf_pybinder.pcpp.NDPNeighborSolicitationLayer
Represents a NDP Neighbor Solicitation protocol layer
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.NDPNeighborSolicitationLayer, code: int, target_address: mtf.libs.mtf_pybinder.pcpp.IPv6Address) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.NDPNeighborSolicitationLayer, code: int, target_address: mtf.libs.mtf_pybinder.pcpp.IPv6Address, src_mac: mtf.libs.mtf_pybinder.pcpp.MacAddress) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.NDPNeighborSolicitationLayer, arg0: mtf.libs.mtf_pybinder.pcpp.NDPNeighborSolicitationLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.NDPNeighborSolicitationLayer, arg0: mtf.libs.mtf_pybinder.pcpp.NDPNeighborSolicitationLayer) -> None
- __new__(**kwargs)
- add_ndp_option(self: mtf.libs.mtf_pybinder.pcpp.NDPLayerBase, option_builder: mtf.libs.mtf_pybinder.pcpp.NdpOptionBuilder) mtf.libs.mtf_pybinder.pcpp.NdpOption
Add a new NDP option at the end of the layer (after the last NDP option) An NdpOptionBuilder object that contains the NDP option data to be added A NdpOption object that contains the newly added NDP option data or logical NULL (NdpOption#isNull() == true) if addition failed. In case of a failure a corresponding error message will be printed to log
- Args:
option_builder (pcpp.NdpOptionBuilder): An NdpOptionBuilder object that contains the NDP option data to be added
- Returns:
pcpp.NdpOption: A NdpOption object that contains the newly added NDP option data or logical NULL
(NdpOption#isNull() == true) if addition failed. In case of a failure a corresponding error message will be printed to log
- assign(self: mtf.libs.mtf_pybinder.pcpp.NDPNeighborSolicitationLayer, : mtf.libs.mtf_pybinder.pcpp.NDPNeighborSolicitationLayer) mtf.libs.mtf_pybinder.pcpp.NDPNeighborSolicitationLayer
- Returns:
pcpp.NDPNeighborSolicitationLayer
- property checksum
Get the checksum header field in host representation
- property code
Get the code header field
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_first_ndp_option(self: mtf.libs.mtf_pybinder.pcpp.NDPLayerBase) mtf.libs.mtf_pybinder.pcpp.NdpOption
The first NDP option in the packet. If the current layer contains no options the returned value will contain a logical NULL (NdpOption#isNull() == true)
- Returns:
pcpp.NdpOption
- get_ndp_option(self: mtf.libs.mtf_pybinder.pcpp.NDPLayerBase, option_type: mtf.libs.mtf_pybinder.pcpp.NDPNeighborOptionTypes) mtf.libs.mtf_pybinder.pcpp.NdpOption
Get a NDP option by type.
- Args:
option_type (enum pcpp.NDPNeighborOptionTypes): NDP option type
- Returns:
pcpp.NdpOption: An NdpOption object that contains the first option that matches this type, or logical NULL
(NdpOption#isNull() == true) if no such option found
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_next_ndp_option(self: mtf.libs.mtf_pybinder.pcpp.NDPLayerBase, option: mtf.libs.mtf_pybinder.pcpp.NdpOption) mtf.libs.mtf_pybinder.pcpp.NdpOption
Get the NDP option that comes after a given option. If the given option was the last one, the returned value will contain a logical NULL (IdpOption#isNull() == true)
- Args:
option (pcpp.NdpOption): An NDP option object that exists in the current layer
- Returns:
pcpp.NdpOption: A NdpOption object that contains the NDP option data that comes next, or logical NULL if the given
NDP option: (1) was the last one; or (2) contains a logical NULL; or (3) doesn’t belong to this packet
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- has_link_layer_address(self: mtf.libs.mtf_pybinder.pcpp.NDPNeighborSolicitationLayer) bool
Checks if the layer has a link layer address option set
- Returns:
bool: true if link layer address option is available, false otherwise
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- is_message_of_type(self: mtf.libs.mtf_pybinder.pcpp.ICMPv6Layer, type: mtf.libs.mtf_pybinder.pcpp.ICMPv6MessageType) bool
Type to check True if the layer if of the given type, false otherwise
- Args:
type (enum pcpp.ICMPv6MessageType): Type to check
- Returns:
bool: True if the layer if of the given type, false otherwise
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property link_layer_address
Mac address which is specified in the link layer address option
- property message_type
Get the ICMPv6 Message Type
- property ndp_option_count
The number of NDP options in this layer
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- remove_all_ndp_options(self: mtf.libs.mtf_pybinder.pcpp.NDPLayerBase) bool
Remove all NDP options from the layer
- Returns:
bool: True if options removed successfully or false if some error occurred (an appropriate error message will
be printed to log)
- property reserved
Reserved
- property target_address
IP address specified as the target IP address in the solicitation message
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.NdpOption
A wrapper class for NDP options. This class does not create or modify NDP option records, but rather serves as a wrapper and provides useful methods for retrieving data from them
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.NdpOption, arg0: mtf.libs.mtf_pybinder.pcpp.NdpOption) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.NdpOption, arg0: mtf.libs.mtf_pybinder.pcpp.NdpOption) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.NdpOption, : mtf.libs.mtf_pybinder.pcpp.NdpOption) mtf.libs.mtf_pybinder.pcpp.NdpOption
- Returns:
pcpp.NdpOption
- static can_assign(record_raw_data: int, tlv_data_len: int) bool
- Args:
record_raw_data (bytes) tlv_data_len (unsigned int)
- Returns:
bool
- property data_size
- get_value_as(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t, offset: int) int
- Args:
offset (unsigned int)
- Returns:
unsigned int
- is_not_null(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t) bool
- Returns:
bool
- is_null(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t) bool
- Returns:
bool
- purge_record_data(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t) None
- property record_raw_data
- set_value(*args, **kwargs)
Overloaded function.
set_value(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t, new_value: int) -> bool
- Args:
new_value (unsigned int)
- Returns:
bool
set_value(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t, new_value: int, value_offset: int) -> bool
- Args:
new_value (unsigned int) value_offset (int)
- Returns:
bool
- property total_size
- property type
NDP option type casted as pcpp.NDPNeighborOptionTypes enum. If the data is null a value of NDP_OPTION_UNKNOWN is returned
- property value
- class mtf.libs.mtf_pybinder.pcpp.NdpOptionBuilder
A class for building NDP option records. This builder receives the NDP option parameters in its c’tor, builds the NDP option raw buffer and provides a build() method to get a NdpOption object out of it
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.NdpOptionBuilder, option_type: mtf.libs.mtf_pybinder.pcpp.NDPNeighborOptionTypes, option_value: list[int]) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.NdpOptionBuilder, option_type: mtf.libs.mtf_pybinder.pcpp.NDPNeighborOptionTypes, option_value: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.NdpOptionBuilder, arg0: mtf.libs.mtf_pybinder.pcpp.NdpOptionBuilder) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.NdpOptionBuilder, : mtf.libs.mtf_pybinder.pcpp.NdpOptionBuilder) mtf.libs.mtf_pybinder.pcpp.NdpOptionBuilder
- Returns:
pcpp.NdpOptionBuilder
- build(self: mtf.libs.mtf_pybinder.pcpp.NdpOptionBuilder) mtf.libs.mtf_pybinder.pcpp.NdpOption
Build the NdpOption object out of the parameters defined in the c’tor. Padding bytes are added to the option for option length with 64-bit boundaries.
- Returns:
pcpp.NdpOption: The NdpOption object
- class mtf.libs.mtf_pybinder.pcpp.NmLayer
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.NmLayer, data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.NmLayer, cbv: int = 0, nid: int = 0) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.NmLayer, arg0: mtf.libs.mtf_pybinder.pcpp.NmLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.NmLayer, arg0: mtf.libs.mtf_pybinder.pcpp.NmLayer) -> None
- __new__(**kwargs)
- static add_nm_port(port: int) None
- static add_user_data_config(config: mtf.libs.mtf_pybinder.pcpp.user_data_config) None
- assign(self: mtf.libs.mtf_pybinder.pcpp.NmLayer, : mtf.libs.mtf_pybinder.pcpp.NmLayer) mtf.libs.mtf_pybinder.pcpp.NmLayer
- property cbv_active_wakeup
- property cbv_nm_coordinator_sleep_ready
- property cbv_partial_network_information
- property cbv_repeat_message_request
- static clear_nm_port() None
- static clear_user_data_config() None
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- static config(nid_position: mtf.libs.mtf_pybinder.pcpp.NmStartLocation = <NmStartLocation.NM_START_LOCATION_OFF: 2>, cbv_position: mtf.libs.mtf_pybinder.pcpp.NmStartLocation = <NmStartLocation.NM_START_LOCATION_OFF: 2>, user_data_length: int = 0) None
- property control_bit_vector
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- get_user_data_value(self: mtf.libs.mtf_pybinder.pcpp.NmLayer, val: str) bool
- has_cbv(self: mtf.libs.mtf_pybinder.pcpp.NmLayer) bool
- has_nid(self: mtf.libs.mtf_pybinder.pcpp.NmLayer) bool
- has_user_data(self: mtf.libs.mtf_pybinder.pcpp.NmLayer) bool
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property source_node_id
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- property user_data
- property user_data_length
- class mtf.libs.mtf_pybinder.pcpp.NmStartLocation
Members:
NM_START_LOCATION_0
NM_START_LOCATION_1
NM_START_LOCATION_OFF
- NM_START_LOCATION_0
- NM_START_LOCATION_1
- NM_START_LOCATION_OFF
- __init__(self: mtf.libs.mtf_pybinder.pcpp.NmStartLocation, value: int) None
- __new__(**kwargs)
- property name
- property value
- class mtf.libs.mtf_pybinder.pcpp.NotFilter
A class for creating a filter which is inverse to another filter<BR> For deeper understanding of the filter concept please refer to PcapFilter.h
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.NotFilter, filter_to_inverse: mtf.libs.mtf_pybinder.pcpp.GeneralFilter) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.NotFilter, arg0: mtf.libs.mtf_pybinder.pcpp.NotFilter) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.NotFilter, : mtf.libs.mtf_pybinder.pcpp.NotFilter) mtf.libs.mtf_pybinder.pcpp.NotFilter
- Returns:
pcpp.NotFilter
- match_packet_with_filter(self: mtf.libs.mtf_pybinder.pcpp.GeneralFilter, raw_packet: mtf.libs.mtf_pybinder.pcpp.RawPacket) bool
Match a raw packet with a given BPF filter.
A pointer to the raw packet to match the BPF filter with True if a raw packet matches the BPF filter or false otherwise
- Args:
raw_packet (str)
- Returns:
bool
- parse_to_string(self: mtf.libs.mtf_pybinder.pcpp.GeneralFilter, result: str) None
A method that parses the class instance into BPF string format
An empty string that the parsing will be written into. If the string isn’t empty, its content will be overridden
- Args:
result (str)
- Returns:
void
- set_filter(self: mtf.libs.mtf_pybinder.pcpp.NotFilter, filter_to_inverse: mtf.libs.mtf_pybinder.pcpp.GeneralFilter) None
Set a filter to create an inverse filter from
A pointer to filter which the created filter be the inverse of
- Args:
filter_to_inverse (str)
- Returns:
void
- class mtf.libs.mtf_pybinder.pcpp.OrFilter
A class for connecting several filters into one filter with logical “or” between them. For example: if the 2 filters are: “IPv4 address = x.x.x.x” + “TCP port dst = 80”, then the new filter will be: “IPv4 address = x.x.x.x _OR_ TCP port dst = 80”<BR> This class follows the composite design pattern<BR> For deeper understanding of the filter concept please refer to PcapFilter.h
add some methods: “addFilter”, “removeFilter”, “clearAllFilter”
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.OrFilter, filters: std::vector<pcpp::GeneralFilter * __ptr64,std::allocator<pcpp::GeneralFilter * __ptr64> >) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.OrFilter, arg0: mtf.libs.mtf_pybinder.pcpp.OrFilter) -> None
- __new__(**kwargs)
- add_filter(self: mtf.libs.mtf_pybinder.pcpp.OrFilter, filter: mtf.libs.mtf_pybinder.pcpp.GeneralFilter) None
Add filter to the or condition
The filter to add
- Args:
filter (str)
- Returns:
void
- assign(self: mtf.libs.mtf_pybinder.pcpp.OrFilter, : mtf.libs.mtf_pybinder.pcpp.OrFilter) mtf.libs.mtf_pybinder.pcpp.OrFilter
- Returns:
pcpp.OrFilter
- match_packet_with_filter(self: mtf.libs.mtf_pybinder.pcpp.GeneralFilter, raw_packet: mtf.libs.mtf_pybinder.pcpp.RawPacket) bool
Match a raw packet with a given BPF filter.
A pointer to the raw packet to match the BPF filter with True if a raw packet matches the BPF filter or false otherwise
- Args:
raw_packet (str)
- Returns:
bool
- parse_to_string(self: mtf.libs.mtf_pybinder.pcpp.GeneralFilter, result: str) None
A method that parses the class instance into BPF string format
An empty string that the parsing will be written into. If the string isn’t empty, its content will be overridden
- Args:
result (str)
- Returns:
void
- class mtf.libs.mtf_pybinder.pcpp.OsiModelLayer
An enum representing OSI model layers
Members:
OsiModelPhysicalLayer
OsiModelDataLinkLayer
OsiModelNetworkLayer
OsiModelTransportLayer
OsiModelSesionLayer
OsiModelPresentationLayer
OsiModelApplicationLayer
OsiModelLayerUnknown
- OsiModelApplicationLayer
- OsiModelDataLinkLayer
- OsiModelLayerUnknown
- OsiModelNetworkLayer
- OsiModelPhysicalLayer
- OsiModelPresentationLayer
- OsiModelSesionLayer
- OsiModelTransportLayer
- __init__(self: mtf.libs.mtf_pybinder.pcpp.OsiModelLayer, value: int) None
- __new__(**kwargs)
- property name
- property value
- class mtf.libs.mtf_pybinder.pcpp.PPP_PPTPLayer
Represent a PPP (point-to-point) protocol header that comes after GREv1 header, as part of PPTP - Point-to-Point Tunneling Protocol
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.PPP_PPTPLayer, data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.PPP_PPTPLayer, address: int, control: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.PPP_PPTPLayer, arg0: mtf.libs.mtf_pybinder.pcpp.PPP_PPTPLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.PPP_PPTPLayer, arg0: mtf.libs.mtf_pybinder.pcpp.PPP_PPTPLayer) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.PPP_PPTPLayer, : mtf.libs.mtf_pybinder.pcpp.PPP_PPTPLayer) mtf.libs.mtf_pybinder.pcpp.PPP_PPTPLayer
- Returns:
pcpp.PPP_PPTPLayer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.PPP_PPTPLayer) None
Calculate the following fields: - ppp_pptp_header#protocol
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_header_len(self: mtf.libs.mtf_pybinder.pcpp.PPP_PPTPLayer) int
The size of
- Returns:
unsigned int
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_osi_model_layer(self: mtf.libs.mtf_pybinder.pcpp.PPP_PPTPLayer) mtf.libs.mtf_pybinder.pcpp.OsiModelLayer
- Returns:
enum pcpp.OsiModelLayer
- get_ppp_pptp_header(self: mtf.libs.mtf_pybinder.pcpp.PPP_PPTPLayer) mtf.libs.mtf_pybinder.pcpp.ppp_pptp_header
Get a pointer to the PPP-PPTP header. Notice this points directly to the data, so every change will change the actual packet data A pointer to the
- Returns:
pcpp.ppp_pptp_header
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.PPP_PPTPLayer) None
Currently identifies the following next layers: IPv4Layer, IPv6Layer. Otherwise sets PayloadLayer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- to_string(self: mtf.libs.mtf_pybinder.pcpp.PPP_PPTPLayer) str
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.PPPoEDiscoveryLayer
Describes the PPPoE discovery protocol
- PPPOE_CODE_PADC
- PPPOE_CODE_PADG
- PPPOE_CODE_PADI
- PPPOE_CODE_PADM
- PPPOE_CODE_PADN
- PPPOE_CODE_PADO
- PPPOE_CODE_PADQ
- PPPOE_CODE_PADR
- PPPOE_CODE_PADS
- PPPOE_CODE_PADT
- PPPOE_CODE_SESSION
- PPPOE_TAG_AC_COOKIE
- PPPOE_TAG_AC_ERR
- PPPOE_TAG_AC_NAME
- PPPOE_TAG_CREDITS
- PPPOE_TAG_CRED_SCALE
- PPPOE_TAG_EOL
- PPPOE_TAG_GENERIC_ERR
- PPPOE_TAG_HOST_UNIQ
- PPPOE_TAG_HURL
- PPPOE_TAG_IP_RT_ADD
- PPPOE_TAG_MAX_PAYLD
- PPPOE_TAG_METRICS
- PPPOE_TAG_MOTM
- PPPOE_TAG_RELAY_ID
- PPPOE_TAG_SEQ_NUM
- PPPOE_TAG_SVC_ERR
- PPPOE_TAG_SVC_NAME
- PPPOE_TAG_VENDOR
- class PPPoECode
PPPoE possible codes
Members:
PPPOE_CODE_SESSION
PPPOE_CODE_PADO
PPPOE_CODE_PADI
PPPOE_CODE_PADG
PPPOE_CODE_PADC
PPPOE_CODE_PADQ
PPPOE_CODE_PADR
PPPOE_CODE_PADS
PPPOE_CODE_PADT
PPPOE_CODE_PADM
PPPOE_CODE_PADN
- PPPOE_CODE_PADC
- PPPOE_CODE_PADG
- PPPOE_CODE_PADI
- PPPOE_CODE_PADM
- PPPOE_CODE_PADN
- PPPOE_CODE_PADO
- PPPOE_CODE_PADQ
- PPPOE_CODE_PADR
- PPPOE_CODE_PADS
- PPPOE_CODE_PADT
- PPPOE_CODE_SESSION
- __init__(self: mtf.libs.mtf_pybinder.pcpp.PPPoELayer.PPPoECode, value: int) None
- __new__(**kwargs)
- property name
- property value
- class PPPoETagBuilder
A class for building PPPoE Tags. This builder receives the tag parameters in its c’tor, builds the PPPoE Tag raw buffer and provides a build() method to get a PPPoETag object out of it
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.PPPoEDiscoveryLayer.PPPoETagBuilder, tag_type: mtf.libs.mtf_pybinder.pcpp.PPPoEDiscoveryLayer.PPPoETagTypes) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.PPPoEDiscoveryLayer.PPPoETagBuilder, tag_type: mtf.libs.mtf_pybinder.pcpp.PPPoEDiscoveryLayer.PPPoETagTypes, tag_value: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.PPPoEDiscoveryLayer.PPPoETagBuilder, tag_type: mtf.libs.mtf_pybinder.pcpp.PPPoEDiscoveryLayer.PPPoETagTypes, tag_value: int, tag_value_len: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.PPPoEDiscoveryLayer.PPPoETagBuilder, arg0: mtf.libs.mtf_pybinder.pcpp.PPPoEDiscoveryLayer.PPPoETagBuilder) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.PPPoEDiscoveryLayer.PPPoETagBuilder, : mtf.libs.mtf_pybinder.pcpp.PPPoEDiscoveryLayer.PPPoETagBuilder) mtf.libs.mtf_pybinder.pcpp.PPPoEDiscoveryLayer.PPPoETagBuilder
- Returns:
pcpp.PPPoEDiscoveryLayer.PPPoETagBuilder
- build(self: mtf.libs.mtf_pybinder.pcpp.PPPoEDiscoveryLayer.PPPoETagBuilder) pcpp::PPPoEDiscoveryLayer::PPPoETag
Build the PPPoETag object out of the parameters defined in the c’tor The PPPoETag object
- Returns:
pcpp.PPPoEDiscoveryLayer.PPPoETag
- class PPPoETagTypes
PPPoE tag types
Members:
PPPOE_TAG_EOL
PPPOE_TAG_SVC_NAME
PPPOE_TAG_AC_NAME
PPPOE_TAG_HOST_UNIQ
PPPOE_TAG_AC_COOKIE
PPPOE_TAG_VENDOR
PPPOE_TAG_CREDITS
PPPOE_TAG_METRICS
PPPOE_TAG_SEQ_NUM
PPPOE_TAG_CRED_SCALE
PPPOE_TAG_RELAY_ID
PPPOE_TAG_HURL
PPPOE_TAG_MOTM
PPPOE_TAG_MAX_PAYLD
PPPOE_TAG_IP_RT_ADD
PPPOE_TAG_SVC_ERR
PPPOE_TAG_AC_ERR
PPPOE_TAG_GENERIC_ERR
- PPPOE_TAG_AC_COOKIE
- PPPOE_TAG_AC_ERR
- PPPOE_TAG_AC_NAME
- PPPOE_TAG_CREDITS
- PPPOE_TAG_CRED_SCALE
- PPPOE_TAG_EOL
- PPPOE_TAG_GENERIC_ERR
- PPPOE_TAG_HOST_UNIQ
- PPPOE_TAG_HURL
- PPPOE_TAG_IP_RT_ADD
- PPPOE_TAG_MAX_PAYLD
- PPPOE_TAG_METRICS
- PPPOE_TAG_MOTM
- PPPOE_TAG_RELAY_ID
- PPPOE_TAG_SEQ_NUM
- PPPOE_TAG_SVC_ERR
- PPPOE_TAG_SVC_NAME
- PPPOE_TAG_VENDOR
- __init__(self: mtf.libs.mtf_pybinder.pcpp.PPPoEDiscoveryLayer.PPPoETagTypes, value: int) None
- __new__(**kwargs)
- property name
- property value
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.PPPoEDiscoveryLayer, data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.PPPoEDiscoveryLayer, version: int, type: int, code: mtf.libs.mtf_pybinder.pcpp.PPPoELayer.PPPoECode, session_id: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.PPPoEDiscoveryLayer, arg0: mtf.libs.mtf_pybinder.pcpp.PPPoEDiscoveryLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.PPPoEDiscoveryLayer, arg0: mtf.libs.mtf_pybinder.pcpp.PPPoEDiscoveryLayer) -> None
- __new__(**kwargs)
- add_tag(self: mtf.libs.mtf_pybinder.pcpp.PPPoEDiscoveryLayer, tag_builder: pcpp::PPPoEDiscoveryLayer::PPPoETagBuilder) pcpp::PPPoEDiscoveryLayer::PPPoETag
Add a new PPPoE Tag at the end of the layer
- Args:
tag_builder (pcpp.PPPoEDiscoveryLayer.PPPoETagBuilder): A PPPoETagBuilder object that contains the requested tag data to add
- Returns:
pcpp.PPPoEDiscoveryLayer.PPPoETag: A PPPoETag object containing the newly added PPPoE Tag data or logical NULL
(PPPoETag#isNull() == true) if addition failed
- add_tag_after(self: mtf.libs.mtf_pybinder.pcpp.PPPoEDiscoveryLayer, tag_builder: pcpp::PPPoEDiscoveryLayer::PPPoETagBuilder, prev_tag_type: mtf.libs.mtf_pybinder.pcpp.PPPoEDiscoveryLayer.PPPoETagTypes) pcpp::PPPoEDiscoveryLayer::PPPoETag
Add a new PPPoE Tag after an existing one
- Args:
tag_builder (pcpp.PPPoEDiscoveryLayer.PPPoETagBuilder): A PPPoETagBuilder object that contains the requested tag data to add prev_tag_type (enum pcpp.PPPoEDiscoveryLayer.PPPoETagTypes): The PPPoE Tag which the newly added tag will come after
- Returns:
pcpp.PPPoEDiscoveryLayer.PPPoETag: A PPPoETag object containing the newly added PPPoE Tag data or logical NULL
(PPPoETag#isNull() == true) if addition failed
- assign(self: mtf.libs.mtf_pybinder.pcpp.PPPoEDiscoveryLayer, : mtf.libs.mtf_pybinder.pcpp.PPPoEDiscoveryLayer) mtf.libs.mtf_pybinder.pcpp.PPPoEDiscoveryLayer
- Returns:
pcpp.PPPoEDiscoveryLayer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.PPPoELayer) None
Calculate
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_first_tag(self: mtf.libs.mtf_pybinder.pcpp.PPPoEDiscoveryLayer) pcpp::PPPoEDiscoveryLayer::PPPoETag
The first tag in the PPPoE discovery layer. If the current layer contains no tags the returned value will contain a logical NULL (PPPoETag#isNull() == true)
- Returns:
pcpp.PPPoEDiscoveryLayer.PPPoETag
- get_header_len(self: mtf.libs.mtf_pybinder.pcpp.PPPoEDiscoveryLayer) int
The header length which is size of strcut pppoe_header plus the total size of tags
- Returns:
unsigned int
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_next_tag(self: mtf.libs.mtf_pybinder.pcpp.PPPoEDiscoveryLayer, tag: pcpp::PPPoEDiscoveryLayer::PPPoETag) pcpp::PPPoEDiscoveryLayer::PPPoETag
Get the tag that comes right after the “tag” parameter. If the given tag is the last one, the returned value will contain a logical NULL (PPPoETag#isNull() == true)
- Args:
tag (pcpp.PPPoEDiscoveryLayer.PPPoETag): A given tag
- Returns:
pcpp.PPPoEDiscoveryLayer.PPPoETag: A PPPoETag object containing the tag that comes next, or logical NULL if the given
tag: (1) was the last one; (2) contains a logical NULL or (3) doesn’t belong to this packet
- get_osi_model_layer(self: mtf.libs.mtf_pybinder.pcpp.PPPoELayer) mtf.libs.mtf_pybinder.pcpp.OsiModelLayer
- Returns:
enum pcpp.OsiModelLayer
- get_pp_po_e_header(self: mtf.libs.mtf_pybinder.pcpp.PPPoELayer) mtf.libs.mtf_pybinder.pcpp.pppoe_header
Get a pointer to the PPPoE header. Notice this points directly to the data, so every change will change the actual packet data
- Returns:
pcpp.pppoe_header: A pointer to the pppoe_header
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- get_tag(self: mtf.libs.mtf_pybinder.pcpp.PPPoEDiscoveryLayer, tag_type: mtf.libs.mtf_pybinder.pcpp.PPPoEDiscoveryLayer.PPPoETagTypes) pcpp::PPPoEDiscoveryLayer::PPPoETag
Get a PPPoE Tag by tag type.
- Args:
tag_type (enum pcpp.PPPoEDiscoveryLayer.PPPoETagTypes): The type of the tag to search
- Returns:
pcpp.PPPoEDiscoveryLayer.PPPoETag: A PPPoETag object that contains the first tag that matches this type, or logical NULL
(PPPoETag#isNull() == true) if no such tag found
- get_tag_count(self: mtf.libs.mtf_pybinder.pcpp.PPPoEDiscoveryLayer) int
The number of tags in this layer
- Returns:
int
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- static is_data_valid(data: int, data_len: int) bool
A static method that validates the input data
- Args:
data (bytes): The pointer to the beginning of byte stream of a packet data_len (unsigned int): The length of the byte stream
- Returns:
bool: True if the data is valid and can represent a PPPoED packet
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.PPPoEDiscoveryLayer) None
Does nothing for this layer (PPPoE discovery is always the last layer)
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- remove_all_tags(self: mtf.libs.mtf_pybinder.pcpp.PPPoEDiscoveryLayer) bool
Remove all tags in this layer
- Returns:
bool: True if all tags were successfully or false if removal failed for some reason (a proper error will be written to log)
- remove_tag(self: mtf.libs.mtf_pybinder.pcpp.PPPoEDiscoveryLayer, tag_type: mtf.libs.mtf_pybinder.pcpp.PPPoEDiscoveryLayer.PPPoETagTypes) bool
Remove an existing tag. Tag will be found by the tag type
- Args:
tag_type (enum pcpp.PPPoEDiscoveryLayer.PPPoETagTypes): The tag type to remove
- Returns:
bool: True if tag was removed or false if tag wasn’t found or if tag removal failed (in each case a proper error will be written
to log)
- to_string(self: mtf.libs.mtf_pybinder.pcpp.PPPoEDiscoveryLayer) str
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.PPPoELayer
An abstract class that describes the PPPoE protocol. Contains common data and logic of the two types of PPPoE packets: PPPoE session and PPPoE discovery
- PPPOE_CODE_PADC
- PPPOE_CODE_PADG
- PPPOE_CODE_PADI
- PPPOE_CODE_PADM
- PPPOE_CODE_PADN
- PPPOE_CODE_PADO
- PPPOE_CODE_PADQ
- PPPOE_CODE_PADR
- PPPOE_CODE_PADS
- PPPOE_CODE_PADT
- PPPOE_CODE_SESSION
- class PPPoECode
PPPoE possible codes
Members:
PPPOE_CODE_SESSION
PPPOE_CODE_PADO
PPPOE_CODE_PADI
PPPOE_CODE_PADG
PPPOE_CODE_PADC
PPPOE_CODE_PADQ
PPPOE_CODE_PADR
PPPOE_CODE_PADS
PPPOE_CODE_PADT
PPPOE_CODE_PADM
PPPOE_CODE_PADN
- PPPOE_CODE_PADC
- PPPOE_CODE_PADG
- PPPOE_CODE_PADI
- PPPOE_CODE_PADM
- PPPOE_CODE_PADN
- PPPOE_CODE_PADO
- PPPOE_CODE_PADQ
- PPPOE_CODE_PADR
- PPPOE_CODE_PADS
- PPPOE_CODE_PADT
- PPPOE_CODE_SESSION
- __init__(self: mtf.libs.mtf_pybinder.pcpp.PPPoELayer.PPPoECode, value: int) None
- __new__(**kwargs)
- property name
- property value
- __init__(self: mtf.libs.mtf_pybinder.pcpp.PPPoELayer, arg0: mtf.libs.mtf_pybinder.pcpp.PPPoELayer) None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.PPPoELayer, : mtf.libs.mtf_pybinder.pcpp.PPPoELayer) mtf.libs.mtf_pybinder.pcpp.PPPoELayer
- Returns:
pcpp.PPPoELayer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.PPPoELayer) None
Calculate
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_osi_model_layer(self: mtf.libs.mtf_pybinder.pcpp.PPPoELayer) mtf.libs.mtf_pybinder.pcpp.OsiModelLayer
- Returns:
enum pcpp.OsiModelLayer
- get_pp_po_e_header(self: mtf.libs.mtf_pybinder.pcpp.PPPoELayer) mtf.libs.mtf_pybinder.pcpp.pppoe_header
Get a pointer to the PPPoE header. Notice this points directly to the data, so every change will change the actual packet data
- Returns:
pcpp.pppoe_header: A pointer to the pppoe_header
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.PPPoESessionLayer
Describes the PPPoE session protocol
- PPPOE_CODE_PADC
- PPPOE_CODE_PADG
- PPPOE_CODE_PADI
- PPPOE_CODE_PADM
- PPPOE_CODE_PADN
- PPPOE_CODE_PADO
- PPPOE_CODE_PADQ
- PPPOE_CODE_PADR
- PPPOE_CODE_PADS
- PPPOE_CODE_PADT
- PPPOE_CODE_SESSION
- class PPPoECode
PPPoE possible codes
Members:
PPPOE_CODE_SESSION
PPPOE_CODE_PADO
PPPOE_CODE_PADI
PPPOE_CODE_PADG
PPPOE_CODE_PADC
PPPOE_CODE_PADQ
PPPOE_CODE_PADR
PPPOE_CODE_PADS
PPPOE_CODE_PADT
PPPOE_CODE_PADM
PPPOE_CODE_PADN
- PPPOE_CODE_PADC
- PPPOE_CODE_PADG
- PPPOE_CODE_PADI
- PPPOE_CODE_PADM
- PPPOE_CODE_PADN
- PPPOE_CODE_PADO
- PPPOE_CODE_PADQ
- PPPOE_CODE_PADR
- PPPOE_CODE_PADS
- PPPOE_CODE_PADT
- PPPOE_CODE_SESSION
- __init__(self: mtf.libs.mtf_pybinder.pcpp.PPPoELayer.PPPoECode, value: int) None
- __new__(**kwargs)
- property name
- property value
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.PPPoESessionLayer, data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.PPPoESessionLayer, version: int, type: int, session_id: int, ppp_next_protocol: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.PPPoESessionLayer, arg0: mtf.libs.mtf_pybinder.pcpp.PPPoESessionLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.PPPoESessionLayer, arg0: mtf.libs.mtf_pybinder.pcpp.PPPoESessionLayer) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.PPPoESessionLayer, : mtf.libs.mtf_pybinder.pcpp.PPPoESessionLayer) mtf.libs.mtf_pybinder.pcpp.PPPoESessionLayer
- Returns:
pcpp.PPPoESessionLayer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.PPPoELayer) None
Calculate
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_header_len(self: mtf.libs.mtf_pybinder.pcpp.PPPoESessionLayer) int
Size of
- Returns:
unsigned int
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_osi_model_layer(self: mtf.libs.mtf_pybinder.pcpp.PPPoELayer) mtf.libs.mtf_pybinder.pcpp.OsiModelLayer
- Returns:
enum pcpp.OsiModelLayer
- get_pp_po_e_header(self: mtf.libs.mtf_pybinder.pcpp.PPPoELayer) mtf.libs.mtf_pybinder.pcpp.pppoe_header
Get a pointer to the PPPoE header. Notice this points directly to the data, so every change will change the actual packet data
- Returns:
pcpp.pppoe_header: A pointer to the pppoe_header
- get_ppp_next_protocol(self: mtf.libs.mtf_pybinder.pcpp.PPPoESessionLayer) int
The protocol after the PPPoE session header. The return value is one of the PPP_* macros listed below. This method is also used when parsing a packet (this way we know which layer comes after the PPPoE session)
- Returns:
unsigned int
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- static is_data_valid(data: int, data_len: int) bool
A static method that validates the input data
- Args:
data (bytes): The pointer to the beginning of byte stream of a packet data_len (unsigned int): The length of the byte stream
- Returns:
bool: True if the data is valid and can represent a PPPoES packet
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.PPPoESessionLayer) None
Currently identifies the following next layers: IPv4Layer, IPv6Layer. Otherwise sets PayloadLayer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- set_ppp_next_protocol(self: mtf.libs.mtf_pybinder.pcpp.PPPoESessionLayer, next_protocol: int) None
Set the field that describes which header comes after the PPPoE session header
- Args:
next_protocol (unsigned int): The protocol value. Should be one of the PPP_* macros listed below
- to_string(self: mtf.libs.mtf_pybinder.pcpp.PPPoESessionLayer) str
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.Packet
This class represents a parsed packet. It contains the raw data (RawPacket instance), and a linked list of layers, each layer is a parsed protocol that this packet contains. The layers linked list is ordered where the first layer is the lowest in the packet (currently it’s always Ethernet protocol as PcapPlusPlus supports only Ethernet packets), the next layer will be L2.5 or L3 (e.g VLAN, IPv4, IPv6, etc.), and so on. etc.), etc. The last layer in the linked list will be the highest in the packet. For example: for a standard HTTP request packet the layer will look like this: EthLayer -> IPv4Layer -> TcpLayer -> HttpRequestLayer <BR> Packet instance isn’t read only. The user can add or remove layers, update current layer, etc.
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.Packet) -> None
doc
__init__(self: mtf.libs.mtf_pybinder.pcpp.Packet, max_packet_len: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.Packet, buffer: bytes) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.Packet, raw_packet: mtf.libs.mtf_pybinder.pcpp.RawPacket, free_raw_packet: bool = False, parse_until: int = 0, parse_until_layer: mtf.libs.mtf_pybinder.pcpp.OsiModelLayer = <OsiModelLayer.OsiModelLayerUnknown: 8>) -> None
A constructor for creating a packet out of already allocated RawPacket. Very useful when parsing packets that came from the network. When using this constructor a pointer to the RawPacket is saved (data isn’t copied) and the RawPacket is parsed, meaning all layers are created and linked to each other in the right order. In this overload of the constructor the user can specify whether to free the instance of raw packet when the Packet is free or not
rawPacket A pointer to the raw packet freeRawPacket Optional parameter. A flag indicating if the destructor should also call the raw packet destructor or not. Default value is false parseUntil Optional parameter. Parse the packet until you reach a certain protocol (inclusive). Can be useful for cases when you need to parse only up to a
certain layer and want to avoid the performance impact and memory consumption of parsing the whole packet. Default value is ::UnknownProtocol which means don’t take this parameter into account
parseUntilLayer Optional parameter. Parse the packet until you reach a certain layer in the OSI model (inclusive). Can be useful for cases when you need to
parse only up to a certain OSI layer (for example transport layer) and want to avoid the performance impact and memory consumption of parsing the whole packet. Default value is ::OsiModelLayerUnknown which means don’t take this parameter into account
__init__(self: mtf.libs.mtf_pybinder.pcpp.Packet, arg0: mtf.libs.mtf_pybinder.pcpp.Packet) -> None
- __new__(**kwargs)
- add_layer(self: mtf.libs.mtf_pybinder.pcpp.Packet, new_layer: mtf.libs.mtf_pybinder.pcpp.Layer, own_in_packet: bool = False) bool
Add a new layer as the last layer in the packet. This method gets a pointer to the new layer as a parameter andattaches it to the packet. Notice after calling this method the input layer is attached to the packet so everychange you make in it affect the packet; Also it cannot be attached to other packets
- Args:
new_layer (pcpp.Layer): A pointer to the newlayer to be added to the packet own_in_packet (bool): If true, Packet fully owns newLayer, including memory deletion upon destruct. Default is false.
- Returns:
bool: True if everything went well or false otherwise (an appropriate error log message will beprinted in
such cases)
- assign(self: mtf.libs.mtf_pybinder.pcpp.Packet, other: mtf.libs.mtf_pybinder.pcpp.Packet) mtf.libs.mtf_pybinder.pcpp.Packet
Assignment operator overloading. It first frees all layers allocated by this instance (Notice: it doesn’t free layersthat weren’t allocated by this class, for example layers that were added by addLayer() or insertLayer() ). Inaddition it frees the raw packet if it was allocated by this instance (meaning if it was allocated by this instanceconstructor). Afterwards it copies the data from the other packet in the same way used in the copy constructor.
- Args:
other (pcpp.Packet): The instance to copy from
- Returns:
pcpp.Packet
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Packet) None
Each layer can have fields that can be calculate automatically from other fields usingLayer#computeCalculateFields(). This method forces all layers to calculate these fields values
- detach_layer(*args, **kwargs)
Overloaded function.
detach_layer(self: mtf.libs.mtf_pybinder.pcpp.Packet, layer_type: int) -> mtf.libs.mtf_pybinder.pcpp.Layer
- Args:
layer_type (str)
detach_layer(self: mtf.libs.mtf_pybinder.pcpp.Packet, layer: mtf.libs.mtf_pybinder.pcpp.Layer) -> bool
Detach a layer from the packet. Detaching means the layer instance will not be deleted, but rather separated fromthe packet - e.g it will be removed from the layer chain of the packet and its data will be copied from the packetbuffer into an internal layer buffer. After a layer is detached, it can be added into another packet (but it’simpossible to attach a layer to multiple packets at the same time). After layer is detached, it’s the user’sresponsibility to delete it when it’s not needed anymore
- Args:
layer (pcpp.Layer): A pointer to the layer to detach
- Returns:
bool: True ifthe layer was detached successfully, or false if something went wrong. In any case of failure an
appropriate errorlog message will be printed
- get_first_layer(self: mtf.libs.mtf_pybinder.pcpp.Packet) mtf.libs.mtf_pybinder.pcpp.Layer
Get a pointer to the first (lowest) layer in the packet
- Returns:
pcpp.Layer: A pointer to the first (lowest) layer in thepacket
- get_last_layer(self: mtf.libs.mtf_pybinder.pcpp.Packet) mtf.libs.mtf_pybinder.pcpp.Layer
Get a pointer to the last (highest) layer in the packet
- Returns:
pcpp.Layer: A pointer to the last (highest) layer in thepacket
- get_layer_of_type(self: mtf.libs.mtf_pybinder.pcpp.Packet, layer_type: int) mtf.libs.mtf_pybinder.pcpp.Layer
- Args:
layer_type (str)
- get_raw_packet(self: mtf.libs.mtf_pybinder.pcpp.Packet) mtf.libs.mtf_pybinder.pcpp.RawPacket
Get a pointer to the Packet’s RawPacket
- Returns:
pcpp.RawPacket: A pointer to the Packet’s RawPacket
- get_raw_packet_read_only(self: mtf.libs.mtf_pybinder.pcpp.Packet) mtf.libs.mtf_pybinder.pcpp.RawPacket
Get a pointer to the Packet’s RawPacket in a read-only manner
- Returns:
pcpp.RawPacket: A pointer to the Packet’s RawPacket
- insert_layer(*args, **kwargs)
Overloaded function.
insert_layer(self: mtf.libs.mtf_pybinder.pcpp.Packet, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, new_layer: mtf.libs.mtf_pybinder.pcpp.Layer) -> bool
- Args:
prev_layer (pcpp.Layer a0) new_layer (pcpp.Layer a1)
- Returns:
bool
insert_layer(self: mtf.libs.mtf_pybinder.pcpp.Packet, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, new_layer: mtf.libs.mtf_pybinder.pcpp.Layer, own_in_packet: bool) -> bool
Insert a new layer after an existing layer in the packet. This method gets a pointer to the new layer as a parameter and attaches it to the packet. Notice after calling this method the input layer is attached to the packet so every change you make in it affect the packet; Also it cannot be attached to other packets
- Args:
prev_layer (pcpp.Layer): A pointer to an existing layer in the packet which the new layer should followed by. If
- this layer isn’t attached toa packet and error will be printed to log and false will be returned
new_layer (pcpp.Layer): A pointer to the new layer to be addedto the packet own_in_packet (bool): If true, Packet fully owns newLayer, including memory deletion upon destruct. Default is false.
- Returns:
bool: True if everything went well or false otherwise (an appropriate error log message will be printed in
such cases)
- is_packet_of_type(self: mtf.libs.mtf_pybinder.pcpp.Packet, protocol_type: int) bool
Check whether the packet contains a layer of a certain protocol type
- Args:
protocol_type (pcpp.ProtocolType): The protocol type to search
- Returns:
bool: True if the packet contains a layer of a certain protocol type, false otherwise
- remove_all_layers_after(self: mtf.libs.mtf_pybinder.pcpp.Packet, layer: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Remove all layers that come after a certain layer. All layers removed will be deleted if they were allocatedduring packet creation or detached if were allocated outside of the packet, please refer to removeLayer() to getmore info
- Args:
layer (pcpp.Layer): A pointer to the layer to begin removing from. Please note this layer will not be removed, onlythe
layers that come after it will be removed. Also, if removal of one layer failed, the method will returnimmediately and the following layers won’t be deleted
- Returns:
bool: True if all layers were removed successfully, orfalse if failed to remove at least one layer. In any case of
failure an appropriate error log message will be printed
- remove_first_layer(self: mtf.libs.mtf_pybinder.pcpp.Packet) bool
Remove the first layer in the packet. The layer will be deleted if it was allocated during packet creation, ordetached if was allocated outside of the packet. Please refer to removeLayer() to get more info
- Returns:
bool: True iflayer removed successfully, or false if removing the layer failed or if there are no layers in the
packet. In anycase of failure an appropriate error log message will be printed
- remove_last_layer(self: mtf.libs.mtf_pybinder.pcpp.Packet) bool
Remove the last layer in the packet. The layer will be deleted if it was allocated during packet creation, ordetached if was allocated outside of the packet. Please refer to removeLayer() to get more info
- Returns:
bool: True iflayer removed successfully, or false if removing the layer failed or if there are no layers in the
packet. In anycase of failure an appropriate error log message will be printed
- remove_layer(self: mtf.libs.mtf_pybinder.pcpp.Packet, layer_type: int) bool
- Args:
layer_type (uint8_t a0)
- Returns:
bool
- set_raw_packet(*args, **kwargs)
Overloaded function.
set_raw_packet(self: mtf.libs.mtf_pybinder.pcpp.Packet, raw_packet: mtf.libs.mtf_pybinder.pcpp.RawPacket, free_raw_packet: bool) -> None
- Args:
raw_packet (pcpp.RawPacket a0) free_raw_packet (bool a1)
set_raw_packet(self: mtf.libs.mtf_pybinder.pcpp.Packet, raw_packet: mtf.libs.mtf_pybinder.pcpp.RawPacket, free_raw_packet: bool, parse_until: int) -> None
- Args:
raw_packet (pcpp.RawPacket a0) free_raw_packet (bool a1) parse_until (unsigned int a2)
set_raw_packet(self: mtf.libs.mtf_pybinder.pcpp.Packet, raw_packet: mtf.libs.mtf_pybinder.pcpp.RawPacket, free_raw_packet: bool, parse_until: int, parse_until_layer: mtf.libs.mtf_pybinder.pcpp.OsiModelLayer) -> None
Set a RawPacket and re-construct all packet layers
- Args:
raw_packet (pcpp.RawPacket): Raw packet to set free_raw_packet (bool): A flag indicating if the destructorshould also call the raw packet destructor or not parse_until (unsigned int):Parse the packet until it reaches this protocol. Can be usefulfor cases when you need to parse only up to a certain layer and want to avoid the
- performance impact and memoryconsumption of parsing the whole packet. Default value is ::UnknownProtocol which means don’t take this parameter intoaccount
parse_until_layer (enum pcpp.OsiModelLayer):Parse the packet until certain layer in OSI model. Can be useful for cases when you need to parse onlyup to a certain layer and want to avoid the
performance impact and memory consumption of parsing the whole packet.Default value is ::OsiModelLayerUnknown which means don’t take this parameter into account
- to_string(*args, **kwargs)
Overloaded function.
to_string(self: mtf.libs.mtf_pybinder.pcpp.Packet) -> str
- Returns:
str
to_string(self: mtf.libs.mtf_pybinder.pcpp.Packet, time_as_local_time: bool) -> str
Each layer can print a string representation of the layer most important data using Layer#toString(). This methodaggregates this string from all layers and print it to a complete string containing all packet’s relevant data
- Args:
time_as_local_time (bool): Print time as local time or GMT. Default (true value) is local time, for GMT set to false
- Returns:
str: A stringcontaining most relevant data from all layers (looks like the packet description in Wireshark)
- class mtf.libs.mtf_pybinder.pcpp.PayloadLayer
Represents a generic or unknown layer or a packet payload
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.PayloadLayer, payload_as_hex_stream: str) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.PayloadLayer, arg0: mtf.libs.mtf_pybinder.pcpp.PayloadLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.PayloadLayer, arg0: mtf.libs.mtf_pybinder.pcpp.PayloadLayer) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.PayloadLayer, : mtf.libs.mtf_pybinder.pcpp.PayloadLayer) mtf.libs.mtf_pybinder.pcpp.PayloadLayer
- Returns:
pcpp.PayloadLayer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property payload
- property payload_len
Get the payload data length The payload data length in bytes
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.PcapFileReaderDevice
A class for opening a pcap file in read-only mode. This class enable to open the file and read all packets, packet-by-packet
- class PcapStats
A container for pcap device statistics
- __init__(self: mtf.libs.mtf_pybinder.pcpp.IPcapDevice.PcapStats) None
- __new__(**kwargs)
- property packets_drop
- property packets_drop_by_interface
- property packets_recv
- __init__(self: mtf.libs.mtf_pybinder.pcpp.PcapFileReaderDevice, file_name: str) None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IFileReaderDevice, : mtf.libs.mtf_pybinder.pcpp.IFileReaderDevice) mtf.libs.mtf_pybinder.pcpp.IFileReaderDevice
- Returns:
pcpp.IFileReaderDevice
- clear_filter(self: mtf.libs.mtf_pybinder.pcpp.IFilterableDevice) bool
Clear the filter currently set on the device
- Returns:
bool: True if filter was removed successfully or if no filter was set, false otherwise
- close(self: mtf.libs.mtf_pybinder.pcpp.IDevice) None
Close the device
- get_file_name(self: mtf.libs.mtf_pybinder.pcpp.IFileDevice) str
Get the name of the file
- Returns:
str: The name of the file
- get_file_size(self: mtf.libs.mtf_pybinder.pcpp.IFileReaderDevice) int
Get the file size in bytes
- Returns:
unsigned int: The file size in bytes
- get_link_layer_type(self: mtf.libs.mtf_pybinder.pcpp.PcapFileReaderDevice) mtf.libs.mtf_pybinder.pcpp.LinkLayerType
The link layer type of this file
- Returns:
enum pcpp.LinkLayerType
- get_next_packet(self: mtf.libs.mtf_pybinder.pcpp.PcapFileReaderDevice, raw_packet: mtf.libs.mtf_pybinder.pcpp.RawPacket) bool
Read the next packet from the file. Before using this method please verify the file is opened using open()
- Args:
raw_packet (pcpp.RawPacket): A reference for an empty RawPacket where the packet will be written
- Returns:
bool: True if a packet was read successfully. False will be returned if the file isn’t opened (also, an error log will be printed)
or if reached end-of-file
- static get_pcap_lib_version_info() str
A static method for retrieving pcap lib (libpcap/WinPcap/etc.) version information. This method is actually a wrapper for [pcap_lib_version()](https://www.tcpdump.org/manpages/pcap_lib_version.3pcap.html)
- Returns:
str: A string containing the pcap lib version information
- static get_reader(file_name: str) mtf.libs.mtf_pybinder.pcpp.IFileReaderDevice
A static method that creates an instance of the reader best fit to read the file. It decides by the file extension: for .pcapng files it returns an instance of PcapNgFileReaderDevice and for all other extensions it returns an instance of PcapFileReaderDevice
- Args:
file_name (str): The file name to open
- Returns:
pcpp.IFileReaderDevice: An instance of the reader to read the file. Notice you should free this instance when done using it
- get_statistics(self: mtf.libs.mtf_pybinder.pcpp.IPcapDevice, stats: pcpp::IPcapDevice::PcapStats) None
Get statistics from the device
- Args:
stats (pcpp.IPcapDevice.PcapStats): An object containing the stats
- is_opened(self: mtf.libs.mtf_pybinder.pcpp.IDevice) bool
- Returns:
bool: True if the file is opened, false otherwise
- static match_packet_with_filter(filter: mtf.libs.mtf_pybinder.pcpp.GeneralFilter, raw_packet: mtf.libs.mtf_pybinder.pcpp.RawPacket) bool
Match a raw packet with a given BPF filter. Notice this method is static which means you don’t need any device instance in order to perform this match
- Args:
filter (pcpp.GeneralFilter): A filter class to test against raw_packet (pcpp.RawPacket): A pointer to the raw packet to match the filter with
- Returns:
bool: True if raw packet matches the filter or false otherwise
- open(self: mtf.libs.mtf_pybinder.pcpp.PcapFileReaderDevice) bool
Open the file name which path was specified in the constructor in a read-only mode
- Returns:
bool: True if file was opened successfully or if file is already opened. False if opening the file failed for some reason (for example:
file path does not exist)
- set_filter(*args, **kwargs)
Overloaded function.
set_filter(self: mtf.libs.mtf_pybinder.pcpp.IFilterableDevice, filter: mtf.libs.mtf_pybinder.pcpp.GeneralFilter) -> bool
Set a filter for the device. When implemented by the device, only packets that match the filter will be received
- Args:
filter (pcpp.GeneralFilter): The filter to be set in PcapPlusPlus’ GeneralFilter format
- Returns:
bool: True if filter set successfully, false otherwise
set_filter(self: mtf.libs.mtf_pybinder.pcpp.IFilterableDevice, filter_as_string: str) -> bool
Set a filter for the device. When implemented by the device, only packets that match the filter will be received
- Args:
filter_as_string (str): The filter to be set in Berkeley Packet Filter (BPF) syntax (http://biot.com/capstats/bpf.html)
- Returns:
bool: True if filter set successfully, false otherwise
- class mtf.libs.mtf_pybinder.pcpp.PcapFileWriterDevice
A class for opening a pcap file for writing or create a new pcap file and write packets to it. This class adds a unique capability that isn’t supported in WinPcap and in older libpcap versions which is to open a pcap file in append mode where packets are written at the end of the pcap file instead of running it over
- class PcapStats
A container for pcap device statistics
- __init__(self: mtf.libs.mtf_pybinder.pcpp.IPcapDevice.PcapStats) None
- __new__(**kwargs)
- property packets_drop
- property packets_drop_by_interface
- property packets_recv
- __init__(self: mtf.libs.mtf_pybinder.pcpp.PcapFileWriterDevice, file_name: str, link_layer_type: mtf.libs.mtf_pybinder.pcpp.LinkLayerType) None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IFileWriterDevice, : mtf.libs.mtf_pybinder.pcpp.IFileWriterDevice) mtf.libs.mtf_pybinder.pcpp.IFileWriterDevice
- Returns:
pcpp.IFileWriterDevice
- clear_filter(self: mtf.libs.mtf_pybinder.pcpp.IFilterableDevice) bool
Clear the filter currently set on the device
- Returns:
bool: True if filter was removed successfully or if no filter was set, false otherwise
- close(self: mtf.libs.mtf_pybinder.pcpp.PcapFileWriterDevice) None
Flush and close the pacp file
- flush(self: mtf.libs.mtf_pybinder.pcpp.PcapFileWriterDevice) None
Flush packets to disk.
- get_file_name(self: mtf.libs.mtf_pybinder.pcpp.IFileDevice) str
Get the name of the file
- Returns:
str: The name of the file
- static get_pcap_lib_version_info() str
A static method for retrieving pcap lib (libpcap/WinPcap/etc.) version information. This method is actually a wrapper for [pcap_lib_version()](https://www.tcpdump.org/manpages/pcap_lib_version.3pcap.html)
- Returns:
str: A string containing the pcap lib version information
- get_statistics(self: mtf.libs.mtf_pybinder.pcpp.IPcapDevice, stats: pcpp::IPcapDevice::PcapStats) None
Get statistics from the device
- Args:
stats (pcpp.IPcapDevice.PcapStats): An object containing the stats
- is_opened(self: mtf.libs.mtf_pybinder.pcpp.IDevice) bool
- Returns:
bool: True if the file is opened, false otherwise
- static match_packet_with_filter(filter: mtf.libs.mtf_pybinder.pcpp.GeneralFilter, raw_packet: mtf.libs.mtf_pybinder.pcpp.RawPacket) bool
Match a raw packet with a given BPF filter. Notice this method is static which means you don’t need any device instance in order to perform this match
- Args:
filter (pcpp.GeneralFilter): A filter class to test against raw_packet (pcpp.RawPacket): A pointer to the raw packet to match the filter with
- Returns:
bool: True if raw packet matches the filter or false otherwise
- open(*args, **kwargs)
Overloaded function.
open(self: mtf.libs.mtf_pybinder.pcpp.PcapFileWriterDevice) -> bool
Open the file in a write mode. If file doesn’t exist, it will be created. If it does exist it will be overwritten, meaning all its current content will be deleted
- Returns:
bool: True if file was opened/created successfully or if file is already opened. False if opening the file failed for some reason
(an error will be printed to log)
open(self: mtf.libs.mtf_pybinder.pcpp.PcapFileWriterDevice, append_mode: bool) -> bool
Same as open(), but enables to open the file in append mode in which packets will be appended to the file instead of overwrite its current content. In append mode file must exist, otherwise opening will fail
- Args:
- append_mode (bool): A boolean indicating whether to open the file in append mode or not. If set to false, this method will act exactly like open().
If set to true, file will be opened in append mode
- Returns:
bool: True of managed to open the file successfully. In case appendMode is set to true, false will be returned
if file wasn’t found or couldn’t be read, if file type is not pcap, or if link type specified in c’tor is different from current file link type. In case appendMode is set to false, please refer to open() for return values
- set_filter(*args, **kwargs)
Overloaded function.
set_filter(self: mtf.libs.mtf_pybinder.pcpp.IFilterableDevice, filter: mtf.libs.mtf_pybinder.pcpp.GeneralFilter) -> bool
Set a filter for the device. When implemented by the device, only packets that match the filter will be received
- Args:
filter (pcpp.GeneralFilter): The filter to be set in PcapPlusPlus’ GeneralFilter format
- Returns:
bool: True if filter set successfully, false otherwise
set_filter(self: mtf.libs.mtf_pybinder.pcpp.IFilterableDevice, filter_as_string: str) -> bool
Set a filter for the device. When implemented by the device, only packets that match the filter will be received
- Args:
filter_as_string (str): The filter to be set in Berkeley Packet Filter (BPF) syntax (http://biot.com/capstats/bpf.html)
- Returns:
bool: True if filter set successfully, false otherwise
- write_packet(self: mtf.libs.mtf_pybinder.pcpp.PcapFileWriterDevice, packet: mtf.libs.mtf_pybinder.pcpp.RawPacket) bool
Write a RawPacket to the file. Before using this method please verify the file is opened using open(). This method won’t change the written packet A reference for an existing RawPcket to write to the file
- Args:
packet (pcpp.RawPacket): A reference for an existing RawPcket to write to the file
- Returns:
bool: True if a packet was written successfully. False will be returned if the file isn’t opened
or if the packet link layer type is different than the one defined for the file (in all cases, an error will be printed to log)
- class mtf.libs.mtf_pybinder.pcpp.PcapNgFileReaderDevice
A class for opening a pcap-ng file in read-only mode. This class enable to open the file and read all packets, packet-by-packet
- class PcapStats
A container for pcap device statistics
- __init__(self: mtf.libs.mtf_pybinder.pcpp.IPcapDevice.PcapStats) None
- __new__(**kwargs)
- property packets_drop
- property packets_drop_by_interface
- property packets_recv
- __init__(self: mtf.libs.mtf_pybinder.pcpp.PcapNgFileReaderDevice, file_name: str) None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IFileReaderDevice, : mtf.libs.mtf_pybinder.pcpp.IFileReaderDevice) mtf.libs.mtf_pybinder.pcpp.IFileReaderDevice
- Returns:
pcpp.IFileReaderDevice
- clear_filter(self: mtf.libs.mtf_pybinder.pcpp.IFilterableDevice) bool
Clear the filter currently set on the device
- Returns:
bool: True if filter was removed successfully or if no filter was set, false otherwise
- close(self: mtf.libs.mtf_pybinder.pcpp.IDevice) None
Close the device
- get_capture_application(self: mtf.libs.mtf_pybinder.pcpp.PcapNgFileReaderDevice) str
The pcap-ng format allows storing metadata at the header of the file. Part of this metadata is a string specifying the capture application that was used for capturing the packets. This method reads this string from the metadata (if exists) and returns it
- Returns:
str: The capture application string if exists, or an empty string otherwise
- get_capture_file_comment(self: mtf.libs.mtf_pybinder.pcpp.PcapNgFileReaderDevice) str
The pcap-ng format allows storing metadata at the header of the file. Part of this metadata is a string containing a user-defined comment (can be any string). This method reads this string from the metadata (if exists) and returns it
- Returns:
str: The comment written inside the file if exists, or an empty string otherwise
- get_file_name(self: mtf.libs.mtf_pybinder.pcpp.IFileDevice) str
Get the name of the file
- Returns:
str: The name of the file
- get_file_size(self: mtf.libs.mtf_pybinder.pcpp.IFileReaderDevice) int
Get the file size in bytes
- Returns:
unsigned int: The file size in bytes
- get_hardware(self: mtf.libs.mtf_pybinder.pcpp.PcapNgFileReaderDevice) str
The pcap-ng format allows storing metadata at the header of the file. Part of this metadata is a string specifying the hardware that was used for capturing the packets. This method reads this string from the metadata (if exists) and returns it
- Returns:
str: The hardware string if exists, or an empty string otherwise
- get_next_packet(*args, **kwargs)
Overloaded function.
get_next_packet(self: mtf.libs.mtf_pybinder.pcpp.PcapNgFileReaderDevice, raw_packet: mtf.libs.mtf_pybinder.pcpp.RawPacket, packet_comment: str, interface_name: str) -> bool
The pcap-ng format allows storing a user-defined comment for every packet (besides the comment per-file). This method reads the next packet and the comment attached to it (if such comment exists), and returns them both
- Args:
raw_packet (pcpp.RawPacket): A reference for an empty RawPacket where the packet will be written packet_comment (str): The comment attached to the packet or an empty string if no comment exists interface_name (str): The interface name
- Returns:
bool: True if a packet was read successfully. False will be returned if the file isn’t opened (also, an error log will be printed)
or if reached end-of-file
get_next_packet(self: mtf.libs.mtf_pybinder.pcpp.PcapNgFileReaderDevice, raw_packet: mtf.libs.mtf_pybinder.pcpp.RawPacket) -> bool
Read the next packet from the file. Before using this method please verify the file is opened using open()
- Args:
raw_packet (pcpp.RawPacket): A reference for an empty RawPacket where the packet will be written
- Returns:
bool: True if a packet was read successfully. False will be returned if the file isn’t opened (also, an error log will be printed)
or if reached end-of-file
- get_os(self: mtf.libs.mtf_pybinder.pcpp.PcapNgFileReaderDevice) str
The pcap-ng format allows storing metadata at the header of the file. Part of this metadata is a string specifying the operating system that was used for capturing the packets. This method reads this string from the metadata (if exists) and returns it
- Returns:
str: The operating system string if exists, or an empty string otherwise
- static get_pcap_lib_version_info() str
A static method for retrieving pcap lib (libpcap/WinPcap/etc.) version information. This method is actually a wrapper for [pcap_lib_version()](https://www.tcpdump.org/manpages/pcap_lib_version.3pcap.html)
- Returns:
str: A string containing the pcap lib version information
- static get_reader(file_name: str) mtf.libs.mtf_pybinder.pcpp.IFileReaderDevice
A static method that creates an instance of the reader best fit to read the file. It decides by the file extension: for .pcapng files it returns an instance of PcapNgFileReaderDevice and for all other extensions it returns an instance of PcapFileReaderDevice
- Args:
file_name (str): The file name to open
- Returns:
pcpp.IFileReaderDevice: An instance of the reader to read the file. Notice you should free this instance when done using it
- get_statistics(self: mtf.libs.mtf_pybinder.pcpp.IPcapDevice, stats: pcpp::IPcapDevice::PcapStats) None
Get statistics from the device
- Args:
stats (pcpp.IPcapDevice.PcapStats): An object containing the stats
- is_opened(self: mtf.libs.mtf_pybinder.pcpp.IDevice) bool
- Returns:
bool: True if the file is opened, false otherwise
- static match_packet_with_filter(filter: mtf.libs.mtf_pybinder.pcpp.GeneralFilter, raw_packet: mtf.libs.mtf_pybinder.pcpp.RawPacket) bool
Match a raw packet with a given BPF filter. Notice this method is static which means you don’t need any device instance in order to perform this match
- Args:
filter (pcpp.GeneralFilter): A filter class to test against raw_packet (pcpp.RawPacket): A pointer to the raw packet to match the filter with
- Returns:
bool: True if raw packet matches the filter or false otherwise
- open(self: mtf.libs.mtf_pybinder.pcpp.IDevice) bool
Open the device
- Returns:
bool: True if device was opened successfully, false otherwise
- set_filter(*args, **kwargs)
Overloaded function.
set_filter(self: mtf.libs.mtf_pybinder.pcpp.IFilterableDevice, filter: mtf.libs.mtf_pybinder.pcpp.GeneralFilter) -> bool
Set a filter for the device. When implemented by the device, only packets that match the filter will be received
- Args:
filter (pcpp.GeneralFilter): The filter to be set in PcapPlusPlus’ GeneralFilter format
- Returns:
bool: True if filter set successfully, false otherwise
set_filter(self: mtf.libs.mtf_pybinder.pcpp.IFilterableDevice, filter_as_string: str) -> bool
Set a filter for the device. When implemented by the device, only packets that match the filter will be received
- Args:
filter_as_string (str): The filter to be set in Berkeley Packet Filter (BPF) syntax (http://biot.com/capstats/bpf.html)
- Returns:
bool: True if filter set successfully, false otherwise
- class mtf.libs.mtf_pybinder.pcpp.PcapNgFileWriterDevice
A class for opening a pcap-ng file for writing or creating a new pcap-ng file and write packets to it. This class adds unique capabilities such as writing metadata attributes into the file header, adding comments per packet and opening the file in append mode where packets are added to a file instead of overriding it. This capabilities are part of the pcap-ng standard but aren’t supported in most tools and libraries
- class PcapStats
A container for pcap device statistics
- __init__(self: mtf.libs.mtf_pybinder.pcpp.IPcapDevice.PcapStats) None
- __new__(**kwargs)
- property packets_drop
- property packets_drop_by_interface
- property packets_recv
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.PcapNgFileWriterDevice, file_name: str, compression_level: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.PcapNgFileWriterDevice, arg0: mtf.libs.mtf_pybinder.pcpp.PcapNgFileWriterDevice) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IFileWriterDevice, : mtf.libs.mtf_pybinder.pcpp.IFileWriterDevice) mtf.libs.mtf_pybinder.pcpp.IFileWriterDevice
- Returns:
pcpp.IFileWriterDevice
- clear_filter(self: mtf.libs.mtf_pybinder.pcpp.IFilterableDevice) bool
Clear the filter currently set on the device
- Returns:
bool: True if filter was removed successfully or if no filter was set, false otherwise
- close(self: mtf.libs.mtf_pybinder.pcpp.PcapNgFileWriterDevice) None
Flush and close the pcap-ng file
- flush(self: mtf.libs.mtf_pybinder.pcpp.PcapNgFileWriterDevice) None
Flush packets to the pcap-ng file
- get_file_name(self: mtf.libs.mtf_pybinder.pcpp.IFileDevice) str
Get the name of the file
- Returns:
str: The name of the file
- static get_pcap_lib_version_info() str
A static method for retrieving pcap lib (libpcap/WinPcap/etc.) version information. This method is actually a wrapper for [pcap_lib_version()](https://www.tcpdump.org/manpages/pcap_lib_version.3pcap.html)
- Returns:
str: A string containing the pcap lib version information
- get_statistics(self: mtf.libs.mtf_pybinder.pcpp.IPcapDevice, stats: pcpp::IPcapDevice::PcapStats) None
Get statistics from the device
- Args:
stats (pcpp.IPcapDevice.PcapStats): An object containing the stats
- is_opened(self: mtf.libs.mtf_pybinder.pcpp.IDevice) bool
- Returns:
bool: True if the file is opened, false otherwise
- static match_packet_with_filter(filter: mtf.libs.mtf_pybinder.pcpp.GeneralFilter, raw_packet: mtf.libs.mtf_pybinder.pcpp.RawPacket) bool
Match a raw packet with a given BPF filter. Notice this method is static which means you don’t need any device instance in order to perform this match
- Args:
filter (pcpp.GeneralFilter): A filter class to test against raw_packet (pcpp.RawPacket): A pointer to the raw packet to match the filter with
- Returns:
bool: True if raw packet matches the filter or false otherwise
- open(*args, **kwargs)
Overloaded function.
open(self: mtf.libs.mtf_pybinder.pcpp.PcapNgFileWriterDevice, os: str, hardware: str, capture_app: str, file_comment: str) -> bool
Open the file in a write mode. If file doesn’t exist, it will be created. If it does exist it will be overwritten, meaning all its current content will be deleted. As opposed to open(), this method also allows writing several metadata attributes that will be stored in the header of the file
- Args:
os (str): A string describing the operating system that was used to capture the packets. If this string is empty or null it
- will be ignored
hardware (str): A string describing the hardware that was used to capture the packets. If this string is empty or null it
- will be ignored
capture_app (str): A string describing the application that was used to capture the packets. If this string is empty or null it
- will be ignored
file_comment (str): A string containing a user-defined comment that will be part of the metadata of the file. If this string is empty or null it will be ignored
- Returns:
bool: True if file was opened/created successfully or if file is already opened. False if opening the file failed for some reason
(an error will be printed to log)
open(self: mtf.libs.mtf_pybinder.pcpp.PcapNgFileWriterDevice) -> bool
Open the file in a write mode. If file doesn’t exist, it will be created. If it does exist it will be overwritten, meaning all its current content will be deleted
- Returns:
bool: True if file was opened/created successfully or if file is already opened. False if opening the file failed for some reason
(an error will be printed to log)
open(self: mtf.libs.mtf_pybinder.pcpp.PcapNgFileWriterDevice, append_mode: bool) -> bool
Same as open(), but enables to open the file in append mode in which packets will be appended to the file instead of overwrite its current content. In append mode file must exist, otherwise opening will fail
- Args:
append_mode (bool): A boolean indicating whether to open the file in append mode or not. If set to false
this method will act exactly like open(). If set to true, file will be opened in append mode
- Returns:
bool: True of managed to open the file successfully. In case appendMode is set to true, false will be returned
if file wasn’t found or couldn’t be read, if file type is not pcap-ng. In case appendMode is set to false, please refer to open() for return values
- set_filter(self: mtf.libs.mtf_pybinder.pcpp.PcapNgFileWriterDevice, filter_as_string: str) bool
Set a filter for PcapNG writer device. Only packets that match the filter will be persisted
- Args:
filter_as_string (str): The filter to be set in Berkeley Packet Filter (BPF) syntax (http://biot.com/capstats/bpf.html)
- Returns:
bool: True if filter set successfully, false otherwise
- write_packet(*args, **kwargs)
Overloaded function.
write_packet(self: mtf.libs.mtf_pybinder.pcpp.PcapNgFileWriterDevice, packet: mtf.libs.mtf_pybinder.pcpp.RawPacket, comment: str, interface_name: str) -> bool
The pcap-ng format allows adding a user-defined comment for each stored packet. This method writes a RawPacket to the file and adds a comment to it. Before using this method please verify the file is opened using open(). This method won’t change the written packet or the input comment
- Args:
packet (pcpp.RawPacket): A reference for an existing RawPcket to write to the file comment (str): The comment to be written for the packet. If this string is empty or null it will be ignored interface_name (str): The interface name
- Returns:
bool: True if a packet was written successfully. False will be returned if the file isn’t opened (an error will be printed to log)
write_packet(self: mtf.libs.mtf_pybinder.pcpp.PcapNgFileWriterDevice, packet: mtf.libs.mtf_pybinder.pcpp.RawPacket) -> bool
Write a RawPacket to the file. Before using this method please verify the file is opened using open(). This method won’t change the written packet
- Args:
packet (pcpp.RawPacket): A reference for an existing RawPcket to write to the file
- Returns:
bool: True if a packet was written successfully. False will be returned if the file isn’t opened (an error will be printed to log)
- class mtf.libs.mtf_pybinder.pcpp.PduTransportLayer
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.PduTransportLayer, arg0: int, arg1: list[int]) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.PduTransportLayer, arg0: mtf.libs.mtf_pybinder.pcpp.PduTransportLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.PduTransportLayer, arg0: mtf.libs.mtf_pybinder.pcpp.PduTransportLayer) -> None
- __new__(**kwargs)
- static add_port(port: int) None
- Args:
port (unsigned int)
- assign(self: mtf.libs.mtf_pybinder.pcpp.PduTransportLayer, : mtf.libs.mtf_pybinder.pcpp.PduTransportLayer) mtf.libs.mtf_pybinder.pcpp.PduTransportLayer
- Returns:
pcpp.PduTransportLayer
- static clear_ports() None
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- static get_deserialized_payload(arg0: list[int], arg1: int, arg2: str) dict[str, int | int | float | list[int] | str]
get all values of pdu signals
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- property id
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- static is_data_valid(data: int, data_len: int) bool
A static method that validates the input data
- Args:
data (bytes): The pointer to the beginning of a byte stream of PduTransport packet data_len (unsigned int): The length of the byte stream
- Returns:
bool: True if the data is valid and can represent an PduTransport packet
- static is_pdu_transport_port(port: int) bool
- Args:
port (unsigned int)
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property length
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property payload
Get the Payload of the PduTransportLayer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.PduTransportLayerModifier
- __init__(self: mtf.libs.mtf_pybinder.pcpp.PduTransportLayerModifier, arg0: mtf.libs.mtf_pybinder.pcpp.Layer) None
- __new__(**kwargs)
- property pdu_transport_layer
Get the PduTransportLayer of the PduTransportLayerModifier.
- set_payload(self: mtf.libs.mtf_pybinder.pcpp.PduTransportLayerModifier, arg0: list[int]) None
The setter for the dynamic length field payload of PduTransportLayer. It will set the payload and update the packet.
- class mtf.libs.mtf_pybinder.pcpp.PortFilter
A class for filtering TCP or UDP traffic by port, for example: “dst port 80” or “src port 12345”<BR> For deeper understanding of the filter concept please refer to PcapFilter.h
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.PortFilter, port: int, dir: mtf.libs.mtf_pybinder.pcpp.Direction) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.PortFilter, arg0: mtf.libs.mtf_pybinder.pcpp.PortFilter) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.PortFilter, : mtf.libs.mtf_pybinder.pcpp.PortFilter) mtf.libs.mtf_pybinder.pcpp.PortFilter
- Returns:
pcpp.PortFilter
- match_packet_with_filter(self: mtf.libs.mtf_pybinder.pcpp.GeneralFilter, raw_packet: mtf.libs.mtf_pybinder.pcpp.RawPacket) bool
Match a raw packet with a given BPF filter.
A pointer to the raw packet to match the BPF filter with True if a raw packet matches the BPF filter or false otherwise
- Args:
raw_packet (str)
- Returns:
bool
- parse_to_string(self: mtf.libs.mtf_pybinder.pcpp.GeneralFilter, result: str) None
A method that parses the class instance into BPF string format
An empty string that the parsing will be written into. If the string isn’t empty, its content will be overridden
- Args:
result (str)
- Returns:
void
- set_direction(self: mtf.libs.mtf_pybinder.pcpp.IFilterWithDirection, dir: mtf.libs.mtf_pybinder.pcpp.Direction) None
Set the direction for the filter (source or destination)
The direction
- Args:
dir (str)
- Returns:
void
- set_port(self: mtf.libs.mtf_pybinder.pcpp.PortFilter, port: int) None
Set the port
- Args:
port (unsigned int): The port to create the filter with
- Returns:
void
- class mtf.libs.mtf_pybinder.pcpp.PortRangeFilter
A class for filtering TCP or UDP port ranges, meaning match only packets which port is within this range, for example: “src portrange 1000-2000” will match only TCP or UDP traffic which source port is in the range of 1000 - 2000<BR> For deeper understanding of the filter concept please refer to PcapFilter.h
- __init__(self: mtf.libs.mtf_pybinder.pcpp.PortRangeFilter, from_port: int, to_port: int, dir: mtf.libs.mtf_pybinder.pcpp.Direction) None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.PortRangeFilter, : mtf.libs.mtf_pybinder.pcpp.PortRangeFilter) mtf.libs.mtf_pybinder.pcpp.PortRangeFilter
- Returns:
pcpp.PortRangeFilter
- match_packet_with_filter(self: mtf.libs.mtf_pybinder.pcpp.GeneralFilter, raw_packet: mtf.libs.mtf_pybinder.pcpp.RawPacket) bool
Match a raw packet with a given BPF filter.
A pointer to the raw packet to match the BPF filter with True if a raw packet matches the BPF filter or false otherwise
- Args:
raw_packet (str)
- Returns:
bool
- parse_to_string(self: mtf.libs.mtf_pybinder.pcpp.GeneralFilter, result: str) None
A method that parses the class instance into BPF string format
An empty string that the parsing will be written into. If the string isn’t empty, its content will be overridden
- Args:
result (str)
- Returns:
void
- set_direction(self: mtf.libs.mtf_pybinder.pcpp.IFilterWithDirection, dir: mtf.libs.mtf_pybinder.pcpp.Direction) None
Set the direction for the filter (source or destination)
The direction
- Args:
dir (str)
- Returns:
void
- set_from_port(self: mtf.libs.mtf_pybinder.pcpp.PortRangeFilter, from_port: int) None
Set the lower end of the port range
The lower end of the port range
- Args:
from_port (str)
- Returns:
void
- set_to_port(self: mtf.libs.mtf_pybinder.pcpp.PortRangeFilter, to_port: int) None
Set the higher end of the port range
The higher end of the port range
- Args:
to_port (str)
- Returns:
void
- class mtf.libs.mtf_pybinder.pcpp.ProtoFilter
A class for filtering traffic by protocol. Notice not all protocols are supported, only the following protocol are supported: ::TCP, ::UDP, ::ICMP, ::VLAN, ::IPv4, ::IPv6, ::ARP, ::Ethernet. In addition, the following protocol families are supported: ::GRE (distinguish between ::GREv0 and ::GREv1 is not supported), ::IGMP (distinguish between ::IGMPv1, ::IGMPv2 and ::IGMPv3 is not supported).
For deeper understanding of the filter concept please refer to PcapFilter.h
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.ProtoFilter, proto: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.ProtoFilter, proto_family: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.ProtoFilter, arg0: mtf.libs.mtf_pybinder.pcpp.ProtoFilter) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.ProtoFilter, : mtf.libs.mtf_pybinder.pcpp.ProtoFilter) mtf.libs.mtf_pybinder.pcpp.ProtoFilter
- Returns:
pcpp.ProtoFilter
- match_packet_with_filter(self: mtf.libs.mtf_pybinder.pcpp.GeneralFilter, raw_packet: mtf.libs.mtf_pybinder.pcpp.RawPacket) bool
Match a raw packet with a given BPF filter.
A pointer to the raw packet to match the BPF filter with True if a raw packet matches the BPF filter or false otherwise
- Args:
raw_packet (str)
- Returns:
bool
- parse_to_string(self: mtf.libs.mtf_pybinder.pcpp.GeneralFilter, result: str) None
A method that parses the class instance into BPF string format
An empty string that the parsing will be written into. If the string isn’t empty, its content will be overridden
- Args:
result (str)
- Returns:
void
- set_proto(*args, **kwargs)
Overloaded function.
set_proto(self: mtf.libs.mtf_pybinder.pcpp.ProtoFilter, proto: int) -> None
Set the protocol to filter with
The protocol to filter, only packets matching this protocol will be received. Please note not all protocol families are supported. List of supported protocols is found in the class description
- Args:
proto (str)
- Returns:
void
set_proto(self: mtf.libs.mtf_pybinder.pcpp.ProtoFilter, proto_family: int) -> None
Set the protocol family to filter with
The protocol family to filter, only packets matching this protocol will be received. Please note not all protocol families are supported. List of supported protocols is found in the class description
- Args:
proto_family (str)
- Returns:
void
- class mtf.libs.mtf_pybinder.pcpp.ProtocolType
Members:
UnknownProtocol
Ethernet
IPv4
IPv6
IP
TCP
UDP
HTTPRequest
HTTPResponse
HTTP
ARP
VLAN
ICMP
PPPoESession
PPPoEDiscovery
PPPoE
DNS
MPLS
GREv0
GREv1
GRE
PPP_PPTP
SSL
SLL
DHCP
NULL_LOOPBACK
IGMP
IGMPv1
IGMPv2
IGMPv3
GenericPayload
VXLAN
SIPRequest
SIPResponse
SIP
SDP
PacketTrailer
Radius
GTPv1
GTP
EthernetDot3
BGP
SSH
AuthenticationHeader
ESP
IPSec
DHCPv6
NTP
Telnet
FTP
ICMPv6
STP
LLC
SNAP
SomeIP
WakeOnLan
DoIP
TECMP
PTP
IKEv2
MKA
MACsec
VLANQinQ
VLANQinQNonStandard
BAP
NM
PDUTRANSPORT
XCP
DTLS
RTP
RTCP
DLT
DSA
L2TPV3
- ARP
- AuthenticationHeader
- BAP
- BGP
- DHCP
- DHCPv6
- DLT
- DNS
- DSA
- DTLS
- DoIP
- ESP
- Ethernet
- EthernetDot3
- FTP
- GRE
- GREv0
- GREv1
- GTP
- GTPv1
- GenericPayload
- HTTP
- HTTPRequest
- HTTPResponse
- ICMP
- ICMPv6
- IGMP
- IGMPv1
- IGMPv2
- IGMPv3
- IKEv2
- IP
- IPSec
- IPv4
- IPv6
- L2TPV3
- LLC
- MACsec
- MKA
- MPLS
- NM
- NTP
- NULL_LOOPBACK
- PDUTRANSPORT
- PPP_PPTP
- PPPoE
- PPPoEDiscovery
- PPPoESession
- PTP
- PacketTrailer
- RTCP
- RTP
- Radius
- SDP
- SIP
- SIPRequest
- SIPResponse
- SLL
- SNAP
- SSH
- SSL
- STP
- SomeIP
- TCP
- TECMP
- Telnet
- UDP
- UnknownProtocol
- VLAN
- VLANQinQ
- VLANQinQNonStandard
- VXLAN
- WakeOnLan
- XCP
- __init__(self: mtf.libs.mtf_pybinder.pcpp.ProtocolType, value: int) None
- __new__(**kwargs)
- property name
- property value
- class mtf.libs.mtf_pybinder.pcpp.PtpAnnounceLayer
Represents an PTPv2 Announce message https://github.com/boundary/wireshark/blob/master/epan/dissectors/packet-ptp.c.
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.PtpAnnounceLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.PtpAnnounceLayer, arg0: mtf.libs.mtf_pybinder.pcpp.PtpAnnounceLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.PtpAnnounceLayer, arg0: mtf.libs.mtf_pybinder.pcpp.PtpAnnounceLayer) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.PtpAnnounceLayer, : mtf.libs.mtf_pybinder.pcpp.PtpAnnounceLayer) mtf.libs.mtf_pybinder.pcpp.PtpAnnounceLayer
- Returns:
pcpp.PtpAnnounceLayer
- property clock_identity
uint64_t The clock_identity field of the PTP header
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- property control_field
uint8_t The control_field field of the PTP header
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property correction_field
uint64_t The correction_field field of the PTP header
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- property domain_number
uint8_t The domain_number field of the PTP header
- property flags
uint16_t The flags field of the PTP header
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property grand_master_clock_accuracy
uint8_t The grand_master_clock_accuracy field of the PTP header
- property grand_master_clock_class
uint8_t The grand_master_clock_class field of the PTP header
- property grand_master_clock_identity
uint64_t The grand_master_clock_identity field of the PTP header
- property grand_master_clock_variance
uint16_t The grand_master_clock_variance field of the PTP header
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- is_ptp_v2(self: mtf.libs.mtf_pybinder.pcpp.PtpLayer) bool
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property local_steps_removed
uint16_t The local_steps_removed field of the PTP header
- property log_message_period
uint8_t The log_message_period field of the PTP header
- property major_sdoid
uint8_t The major_sdoid field of the PTP header
- property message_length
- Returns:
unsigned int
- property message_type
uint8_t The message_type field of the PTP header
- property message_type_specific
uint32_t The message_type_specific field of the PTP header
- property minor_sdoid
uint8_t The minor_sdoid field of the PTP header
- property minor_version_ptp
uint8_t The minor_version_ptp field of the PTP header
- property origin_current_utc_offset
uint16_t The origin_current_utc_offset field of the PTP header
- property origin_timestamp_nanoseconds
uint32_t The origin_timestamp_nanoseconds field of the PTP header
- property origin_timestamp_seconds
uint64_t The origin_timestamp_seconds field of the PTP header
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property priority_1
uint16_t The priority_1 field of the PTP header
- property priority_2
uint8_t The priority_2 field of the PTP header
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property sequence_id
uint16_t The sequence_id field of the PTP header
- property source_port_id
uint16_t The source_port_id field of the PTP header
- property time_source
uint8_t The time_source field of the PTP header
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- property version_ptp
uint8_t The version_ptp field of the PTP header
- class mtf.libs.mtf_pybinder.pcpp.PtpDelayReqLayer
Represents an PTPv2 Delay Request message https://github.com/boundary/wireshark/blob/master/epan/dissectors/packet-ptp.c.
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.PtpDelayReqLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.PtpDelayReqLayer, arg0: mtf.libs.mtf_pybinder.pcpp.PtpDelayReqLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.PtpDelayReqLayer, arg0: mtf.libs.mtf_pybinder.pcpp.PtpDelayReqLayer) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.PtpDelayReqLayer, : mtf.libs.mtf_pybinder.pcpp.PtpDelayReqLayer) mtf.libs.mtf_pybinder.pcpp.PtpDelayReqLayer
- Returns:
pcpp.PtpDelayReqLayer
- property clock_identity
uint64_t The clock_identity field of the PTP header
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- property control_field
uint8_t The control_field field of the PTP header
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property correction_field
uint64_t The correction_field field of the PTP header
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- property domain_number
uint8_t The domain_number field of the PTP header
- property flags
uint16_t The flags field of the PTP header
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- is_ptp_v2(self: mtf.libs.mtf_pybinder.pcpp.PtpLayer) bool
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property log_message_period
uint8_t The log_message_period field of the PTP header
- property major_sdoid
uint8_t The major_sdoid field of the PTP header
- property message_length
- Returns:
unsigned int
- property message_type
uint8_t The message_type field of the PTP header
- property message_type_specific
uint32_t The message_type_specific field of the PTP header
- property minor_sdoid
uint8_t The minor_sdoid field of the PTP header
- property minor_version_ptp
uint8_t The minor_version_ptp field of the PTP header
- property origin_timestamp_nanoseconds
uint32_t The origin_timestamp_nanoseconds field of the PTP header
- property origin_timestamp_seconds
uint64_t The origin_timestamp_seconds field of the PTP header
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property sequence_id
uint16_t The sequence_id field of the PTP header
- property source_port_id
uint16_t The source_port_id field of the PTP header
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- property version_ptp
uint8_t The version_ptp field of the PTP header
- class mtf.libs.mtf_pybinder.pcpp.PtpDelayRespLayer
Represents an PTPv2 Delay Response message https://github.com/boundary/wireshark/blob/master/epan/dissectors/packet-ptp.c.
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.PtpDelayRespLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.PtpDelayRespLayer, arg0: mtf.libs.mtf_pybinder.pcpp.PtpDelayRespLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.PtpDelayRespLayer, arg0: mtf.libs.mtf_pybinder.pcpp.PtpDelayRespLayer) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.PtpDelayRespLayer, : mtf.libs.mtf_pybinder.pcpp.PtpDelayRespLayer) mtf.libs.mtf_pybinder.pcpp.PtpDelayRespLayer
- Returns:
pcpp.PtpDelayRespLayer
- property clock_identity
uint64_t The clock_identity field of the PTP header
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- property control_field
uint8_t The control_field field of the PTP header
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property correction_field
uint64_t The correction_field field of the PTP header
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- property domain_number
uint8_t The domain_number field of the PTP header
- property flags
uint16_t The flags field of the PTP header
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- is_ptp_v2(self: mtf.libs.mtf_pybinder.pcpp.PtpLayer) bool
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property log_message_period
uint8_t The log_message_period field of the PTP header
- property major_sdoid
uint8_t The major_sdoid field of the PTP header
- property message_length
- Returns:
unsigned int
- property message_type
uint8_t The message_type field of the PTP header
- property message_type_specific
uint32_t The message_type_specific field of the PTP header
- property minor_sdoid
uint8_t The minor_sdoid field of the PTP header
- property minor_version_ptp
uint8_t The minor_version_ptp field of the PTP header
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property receive_timestamp_nanoseconds
uint32_t The receive_timestamp_nanoseconds field of the PTP header
- property receive_timestamp_seconds
uint64_t The receive_timestamp_seconds field of the PTP header
- property requesting_source_port_id
uint16_t The requesting_source_port_id field of the PTP header
- property requesting_source_port_identity
uint64_t The requesting_source_port_identity field of the PTP header
- property sequence_id
uint16_t The sequence_id field of the PTP header
- property source_port_id
uint16_t The source_port_id field of the PTP header
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- property version_ptp
uint8_t The version_ptp field of the PTP header
- class mtf.libs.mtf_pybinder.pcpp.PtpFollowUpLayer
Represents an PTPv2 Follow Up message https://github.com/boundary/wireshark/blob/master/epan/dissectors/packet-ptp.c.
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.PtpFollowUpLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.PtpFollowUpLayer, arg0: mtf.libs.mtf_pybinder.pcpp.PtpFollowUpLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.PtpFollowUpLayer, arg0: mtf.libs.mtf_pybinder.pcpp.PtpFollowUpLayer) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.PtpFollowUpLayer, : mtf.libs.mtf_pybinder.pcpp.PtpFollowUpLayer) mtf.libs.mtf_pybinder.pcpp.PtpFollowUpLayer
- Returns:
pcpp.PtpFollowUpLayer
- property clock_identity
uint64_t The clock_identity field of the PTP header
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- property control_field
uint8_t The control_field field of the PTP header
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property correction_field
uint64_t The correction_field field of the PTP header
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- property domain_number
uint8_t The domain_number field of the PTP header
- property flags
uint16_t The flags field of the PTP header
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- has_tlv(self: mtf.libs.mtf_pybinder.pcpp.PtpFollowUpLayer) bool
A method to check if this PTP Follow-Up layer has TLV Info
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- is_ptp_v2(self: mtf.libs.mtf_pybinder.pcpp.PtpLayer) bool
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property log_message_period
uint8_t The log_message_period field of the PTP header
- property major_sdoid
uint8_t The major_sdoid field of the PTP header
- property message_length
- Returns:
unsigned int
- property message_type
uint8_t The message_type field of the PTP header
- property message_type_specific
uint32_t The message_type_specific field of the PTP header
- property minor_sdoid
uint8_t The minor_sdoid field of the PTP header
- property minor_version_ptp
uint8_t The minor_version_ptp field of the PTP header
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property precise_origin_timestamp_nanoseconds
uint32_t The precise_origin_timestamp_nanoseconds field of the PTP header
- property precise_origin_timestamp_seconds
uint64_t The precise_origin_timestamp_seconds field of the PTP header
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property sequence_id
uint16_t The sequence_id field of the PTP header
- property source_port_id
uint16_t The source_port_id field of the PTP header
- property tlv
The TLV in the PTP Follow Up layer. If there is no TLV then returned value will contain a logical NULL
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- property version_ptp
uint8_t The version_ptp field of the PTP header
- class mtf.libs.mtf_pybinder.pcpp.PtpFollowUpTlvData
A wrapper class for PTP Follow Up TLV data. This class does not create or modify PTP Follow Up TLV data, but rather serves as a wrapper and provides useful methods for setting and retrieving data to/from them
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.PtpFollowUpTlvData, tlv_type: int, tlv_length: int, tlv_value: list[int]) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.PtpFollowUpTlvData, arg0: mtf.libs.mtf_pybinder.pcpp.PtpFollowUpTlvData) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.PtpFollowUpTlvData, arg0: mtf.libs.mtf_pybinder.pcpp.PtpFollowUpTlvData) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.PtpFollowUpTlvData, : mtf.libs.mtf_pybinder.pcpp.PtpFollowUpTlvData) mtf.libs.mtf_pybinder.pcpp.PtpFollowUpTlvData
- Returns:
pcpp.PtpFollowUpTlvData
- static can_assign(record_raw_data: int, tlv_data_len: int) bool
- Args:
record_raw_data (bytes) tlv_data_len (unsigned int)
- Returns:
bool
- property cumulative_scaled_rate_offset
uint32_t The cumulative_scaled_rate_offset field of the TLV
- property data_size
- Returns:
unsigned int
- property gm_time_base_indicator
uint16_t The gm_time_base_indicator field of the TLV
- is_not_null(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_short_unsigned_short_t) bool
- Returns:
bool
- is_null(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_short_unsigned_short_t) bool
- Returns:
bool
- property last_gm_phase_change
std::array<uint8_t, 12> The last_gm_phase_change field of the TLV
- property organization_id
uint32_t The organization_id field of the TLV
- property organization_subtype
uint32_t The organization_subtype field of the TLV
- purge_record_data(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_short_unsigned_short_t) None
- property record_raw_data
- property scaled_last_gm_freq_change
uint32_t The scaled_last_gm_freq_change field of the TLV
- property total_size
- Returns:
unsigned int
- property type
Return uint16_t The Tlv type
- property value
- property value_as_hex_string
The raw option value (byte array) as a hex string
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.PtpLayer
Represents an PTPv2 protocol layer https://github.com/boundary/wireshark/blob/master/epan/dissectors/packet-ptp.c.
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.PtpLayer, type: mtf.libs.mtf_pybinder.pcpp.PtpMsgTypes = <PtpMsgTypes.kSync: 0>) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.PtpLayer, arg0: mtf.libs.mtf_pybinder.pcpp.PtpLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.PtpLayer, arg0: mtf.libs.mtf_pybinder.pcpp.PtpLayer) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.PtpLayer, : mtf.libs.mtf_pybinder.pcpp.PtpLayer) mtf.libs.mtf_pybinder.pcpp.PtpLayer
- Returns:
pcpp.PtpLayer
- property clock_identity
uint64_t The clock_identity field of the PTP header
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- property control_field
uint8_t The control_field field of the PTP header
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property correction_field
uint64_t The correction_field field of the PTP header
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- property domain_number
uint8_t The domain_number field of the PTP header
- property flags
uint16_t The flags field of the PTP header
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- is_ptp_v2(self: mtf.libs.mtf_pybinder.pcpp.PtpLayer) bool
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property log_message_period
uint8_t The log_message_period field of the PTP header
- property major_sdoid
uint8_t The major_sdoid field of the PTP header
- property message_length
- Returns:
unsigned int
- property message_type
uint8_t The message_type field of the PTP header
- property message_type_specific
uint32_t The message_type_specific field of the PTP header
- property minor_sdoid
uint8_t The minor_sdoid field of the PTP header
- property minor_version_ptp
uint8_t The minor_version_ptp field of the PTP header
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property sequence_id
uint16_t The sequence_id field of the PTP header
- property source_port_id
uint16_t The source_port_id field of the PTP header
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- property version_ptp
uint8_t The version_ptp field of the PTP header
- class mtf.libs.mtf_pybinder.pcpp.PtpMsgTypes
Members:
kSync
kDelayReq
kPDelayReq
kPDelayResp
kFollowUp
kDelayResp
kPDelayRespFollowUp
kAnnounce
kSignaling
kManagement
- __init__(self: mtf.libs.mtf_pybinder.pcpp.PtpMsgTypes, value: int) None
- __new__(**kwargs)
- kAnnounce
- kDelayReq
- kDelayResp
- kFollowUp
- kManagement
- kPDelayReq
- kPDelayResp
- kPDelayRespFollowUp
- kSignaling
- kSync
- property name
- property value
- class mtf.libs.mtf_pybinder.pcpp.PtpPdelayReqLayer
Represents an PTPv2 Peer Delay Request message https://github.com/boundary/wireshark/blob/master/epan/dissectors/packet-ptp.c.
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.PtpPdelayReqLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.PtpPdelayReqLayer, arg0: mtf.libs.mtf_pybinder.pcpp.PtpPdelayReqLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.PtpPdelayReqLayer, arg0: mtf.libs.mtf_pybinder.pcpp.PtpPdelayReqLayer) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.PtpPdelayReqLayer, : mtf.libs.mtf_pybinder.pcpp.PtpPdelayReqLayer) mtf.libs.mtf_pybinder.pcpp.PtpPdelayReqLayer
- Returns:
pcpp.PtpPdelayReqLayer
- property clock_identity
uint64_t The clock_identity field of the PTP header
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- property control_field
uint8_t The control_field field of the PTP header
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property correction_field
uint64_t The correction_field field of the PTP header
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- property domain_number
uint8_t The domain_number field of the PTP header
- property flags
uint16_t The flags field of the PTP header
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- is_ptp_v2(self: mtf.libs.mtf_pybinder.pcpp.PtpLayer) bool
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property log_message_period
uint8_t The log_message_period field of the PTP header
- property major_sdoid
uint8_t The major_sdoid field of the PTP header
- property message_length
- Returns:
unsigned int
- property message_type
uint8_t The message_type field of the PTP header
- property message_type_specific
uint32_t The message_type_specific field of the PTP header
- property minor_sdoid
uint8_t The minor_sdoid field of the PTP header
- property minor_version_ptp
uint8_t The minor_version_ptp field of the PTP header
- property origin_timestamp_nanoseconds
uint32_t The origin_timestamp_nanoseconds field of the PTP header
- property origin_timestamp_seconds
uint64_t The origin_timestamp_seconds field of the PTP header
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property reserved
std::array<uint8_t,10> The reserved field of the PTP header.
- property sequence_id
uint16_t The sequence_id field of the PTP header
- property source_port_id
uint16_t The source_port_id field of the PTP header
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- property version_ptp
uint8_t The version_ptp field of the PTP header
- class mtf.libs.mtf_pybinder.pcpp.PtpPdelayRespFollowUpLayer
Represents an PTPv2 Peer Delay Follow Up message https://github.com/boundary/wireshark/blob/master/epan/dissectors/packet-ptp.c.
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.PtpPdelayRespFollowUpLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.PtpPdelayRespFollowUpLayer, arg0: mtf.libs.mtf_pybinder.pcpp.PtpPdelayRespFollowUpLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.PtpPdelayRespFollowUpLayer, arg0: mtf.libs.mtf_pybinder.pcpp.PtpPdelayRespFollowUpLayer) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.PtpPdelayRespFollowUpLayer, : mtf.libs.mtf_pybinder.pcpp.PtpPdelayRespFollowUpLayer) mtf.libs.mtf_pybinder.pcpp.PtpPdelayRespFollowUpLayer
- Returns:
pcpp.PtpPdelayRespFollowUpLayer
- property clock_identity
uint64_t The clock_identity field of the PTP header
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- property control_field
uint8_t The control_field field of the PTP header
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property correction_field
uint64_t The correction_field field of the PTP header
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- property domain_number
uint8_t The domain_number field of the PTP header
- property flags
uint16_t The flags field of the PTP header
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- is_ptp_v2(self: mtf.libs.mtf_pybinder.pcpp.PtpLayer) bool
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property log_message_period
uint8_t The log_message_period field of the PTP header
- property major_sdoid
uint8_t The major_sdoid field of the PTP header
- property message_length
- Returns:
unsigned int
- property message_type
uint8_t The message_type field of the PTP header
- property message_type_specific
uint32_t The message_type_specific field of the PTP header
- property minor_sdoid
uint8_t The minor_sdoid field of the PTP header
- property minor_version_ptp
uint8_t The minor_version_ptp field of the PTP header
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property requesting_source_port_id
uint16_t The requesting_source_port_id field of the PTP header
- property requesting_source_port_identity
uint64_t The requesting_source_port_identity field of the PTP header
- property response_origin_timestamp_nanoseconds
uint32_t The response_origin_timestamp_nanoseconds field of the PTP header
- property response_origin_timestamp_seconds
uint64_t The response_origin_timestamp_seconds field of the PTP header
- property sequence_id
uint16_t The sequence_id field of the PTP header
- property source_port_id
uint16_t The source_port_id field of the PTP header
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- property version_ptp
uint8_t The version_ptp field of the PTP header
- class mtf.libs.mtf_pybinder.pcpp.PtpPdelayRespLayer
Represents an PTPv2 Peer Delay Response message https://github.com/boundary/wireshark/blob/master/epan/dissectors/packet-ptp.c.
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.PtpPdelayRespLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.PtpPdelayRespLayer, arg0: mtf.libs.mtf_pybinder.pcpp.PtpPdelayRespLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.PtpPdelayRespLayer, arg0: mtf.libs.mtf_pybinder.pcpp.PtpPdelayRespLayer) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.PtpPdelayRespLayer, : mtf.libs.mtf_pybinder.pcpp.PtpPdelayRespLayer) mtf.libs.mtf_pybinder.pcpp.PtpPdelayRespLayer
- Returns:
pcpp.PtpPdelayRespLayer
- property clock_identity
uint64_t The clock_identity field of the PTP header
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- property control_field
uint8_t The control_field field of the PTP header
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property correction_field
uint64_t The correction_field field of the PTP header
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- property domain_number
uint8_t The domain_number field of the PTP header
- property flags
uint16_t The flags field of the PTP header
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- is_ptp_v2(self: mtf.libs.mtf_pybinder.pcpp.PtpLayer) bool
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property log_message_period
uint8_t The log_message_period field of the PTP header
- property major_sdoid
uint8_t The major_sdoid field of the PTP header
- property message_length
- Returns:
unsigned int
- property message_type
uint8_t The message_type field of the PTP header
- property message_type_specific
uint32_t The message_type_specific field of the PTP header
- property minor_sdoid
uint8_t The minor_sdoid field of the PTP header
- property minor_version_ptp
uint8_t The minor_version_ptp field of the PTP header
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property request_receipt_timestamp_nanoseconds
uint32_t The request_receipt_timestamp_nanoseconds field of the PTP header
- property request_receipt_timestamp_seconds
uint64_t The request_receipt_timestamp_seconds field of the PTP header
- property requesting_source_port_id
uint16_t The requesting_source_port_id field of the PTP header
- property requesting_source_port_identity
uint64_t The requesting_source_port_identity field of the PTP header
- property sequence_id
uint16_t The sequence_id field of the PTP header
- property source_port_id
uint16_t The source_port_id field of the PTP header
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- property version_ptp
uint8_t The version_ptp field of the PTP header
- class mtf.libs.mtf_pybinder.pcpp.PtpSignalingLayer
Represents an PTPv2 Signaling message https://github.com/boundary/wireshark/blob/master/epan/dissectors/packet-ptp.c.
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.PtpSignalingLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.PtpSignalingLayer, arg0: mtf.libs.mtf_pybinder.pcpp.PtpSignalingLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.PtpSignalingLayer, arg0: mtf.libs.mtf_pybinder.pcpp.PtpSignalingLayer) -> None
- __new__(**kwargs)
- add_tlv(self: mtf.libs.mtf_pybinder.pcpp.PtpSignalingLayer, tlv_type: int, tlv_length: int, tlv_value: list[int]) None
The method to add the TlvInfo of the PTP Signaling message with parameters.
- Args:
tlv_type (unsigned int) tlv_length (unsigned int) tlv_value (bytes)
- assign(self: mtf.libs.mtf_pybinder.pcpp.PtpSignalingLayer, : mtf.libs.mtf_pybinder.pcpp.PtpSignalingLayer) mtf.libs.mtf_pybinder.pcpp.PtpSignalingLayer
- Returns:
pcpp.PtpSignalingLayer
- property clock_identity
uint64_t The clock_identity field of the PTP header
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- property control_field
uint8_t The control_field field of the PTP header
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property correction_field
uint64_t The correction_field field of the PTP header
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- property domain_number
uint8_t The domain_number field of the PTP header
- property first_tlv_data
Get the TLV in the PTP Signaling layer. If there is no TLV then returned value will contain a logical NULL.
- property flags
uint16_t The flags field of the PTP header
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_next_tlv_data(self: mtf.libs.mtf_pybinder.pcpp.PtpSignalingLayer, tlv: mtf.libs.mtf_pybinder.pcpp.PtpTlvData) mtf.libs.mtf_pybinder.pcpp.PtpTlvData
Get the TLV that comes after a given TLV. If the given option was the last one, then returned value will contain a logical NULL.
- Args:
tlv (pcpp.PtpTlvData)
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- is_ptp_v2(self: mtf.libs.mtf_pybinder.pcpp.PtpLayer) bool
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property log_message_period
uint8_t The log_message_period field of the PTP header
- property major_sdoid
uint8_t The major_sdoid field of the PTP header
- property message_length
- Returns:
unsigned int
- property message_type
uint8_t The message_type field of the PTP header
- property message_type_specific
uint32_t The message_type_specific field of the PTP header
- property minor_sdoid
uint8_t The minor_sdoid field of the PTP header
- property minor_version_ptp
uint8_t The minor_version_ptp field of the PTP header
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- remove_tlv(self: mtf.libs.mtf_pybinder.pcpp.PtpSignalingLayer, tlv: mtf.libs.mtf_pybinder.pcpp.PtpTlvData) None
The method to remove the given TLV of the PTP Signaling message.
- Args:
tlv (pcpp.PtpTlvData))
- property sequence_id
uint16_t The sequence_id field of the PTP header
- property source_port_id
uint16_t The source_port_id field of the PTP header
- property target_port_id
uint16_t The target_port_id field of the PTP header
- property target_port_identity
uint64_t The target_port_identity field of the PTP header.
- property tlv_count
The number of TLV in this PTP Signaling layer.
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- property version_ptp
uint8_t The version_ptp field of the PTP header
- class mtf.libs.mtf_pybinder.pcpp.PtpSyncLayer
Represents an PTPv2 Sync message https://github.com/boundary/wireshark/blob/master/epan/dissectors/packet-ptp.c.
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.PtpSyncLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.PtpSyncLayer, arg0: mtf.libs.mtf_pybinder.pcpp.PtpSyncLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.PtpSyncLayer, arg0: mtf.libs.mtf_pybinder.pcpp.PtpSyncLayer) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.PtpSyncLayer, : mtf.libs.mtf_pybinder.pcpp.PtpSyncLayer) mtf.libs.mtf_pybinder.pcpp.PtpSyncLayer
- Returns:
pcpp.PtpSyncLayer
- property clock_identity
uint64_t The clock_identity field of the PTP header
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- property control_field
uint8_t The control_field field of the PTP header
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property correction_field
uint64_t The correction_field field of the PTP header
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- property domain_number
uint8_t The domain_number field of the PTP header
- property flags
uint16_t The flags field of the PTP header
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- is_ptp_v2(self: mtf.libs.mtf_pybinder.pcpp.PtpLayer) bool
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property log_message_period
uint8_t The log_message_period field of the PTP header
- property major_sdoid
uint8_t The major_sdoid field of the PTP header
- property message_length
- Returns:
unsigned int
- property message_type
uint8_t The message_type field of the PTP header
- property message_type_specific
uint32_t The message_type_specific field of the PTP header
- property minor_sdoid
uint8_t The minor_sdoid field of the PTP header
- property minor_version_ptp
uint8_t The minor_version_ptp field of the PTP header
- property origin_timestamp_nanoseconds
uint32_t The origin_timestamp_nanoseconds field of the PTP header. Only works in one step mode.
- property origin_timestamp_seconds
uint64_t The origin_timestamp_seconds field of the PTP header. Only works in one step mode.
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property reserved
std::array<uint8_t,10> The reserved field of the PTP header. Only works in two step mode.
- property sequence_id
uint16_t The sequence_id field of the PTP header
- property source_port_id
uint16_t The source_port_id field of the PTP header
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- property version_ptp
uint8_t The version_ptp field of the PTP header
- class mtf.libs.mtf_pybinder.pcpp.PtpTlvData
A wrapper class for PTP TLV data. This class does not create or modify PTP TLV data, but rather serves as a wrapper and provides useful methods for setting and retrieving data to/from them
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.PtpTlvData, arg0: mtf.libs.mtf_pybinder.pcpp.PtpTlvData) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.PtpTlvData, arg0: mtf.libs.mtf_pybinder.pcpp.PtpTlvData) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.PtpTlvData, : mtf.libs.mtf_pybinder.pcpp.PtpTlvData) mtf.libs.mtf_pybinder.pcpp.PtpTlvData
- Returns:
pcpp.PtpTlvData
- static can_assign(record_raw_data: int, tlv_data_len: int) bool
- Args:
record_raw_data (bytes) tlv_data_len (unsigned int)
- Returns:
bool
- property data_size
- Returns:
unsigned int
- is_not_null(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_short_unsigned_short_t) bool
- Returns:
bool
- is_null(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_short_unsigned_short_t) bool
- Returns:
bool
- purge_record_data(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_short_unsigned_short_t) None
- property record_raw_data
- property total_size
- Returns:
unsigned int
- property type
Return uint16_t The Tlv type
- property value
- property value_as_hex_string
The raw option value (byte array) as a hex string
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.RadiusAttribute
A wrapper class for RADIUS attributes. This class does not create or modify RADIUS attribute records, but rather serves as a wrapper and provides useful methods for retrieving data from them
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.RadiusAttribute, attr_raw_data: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.RadiusAttribute, arg0: mtf.libs.mtf_pybinder.pcpp.RadiusAttribute) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.RadiusAttribute, arg0: mtf.libs.mtf_pybinder.pcpp.RadiusAttribute) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.RadiusAttribute, : mtf.libs.mtf_pybinder.pcpp.RadiusAttribute) mtf.libs.mtf_pybinder.pcpp.RadiusAttribute
- Returns:
pcpp.RadiusAttribute
- static can_assign(record_raw_data: int, tlv_data_len: int) bool
- Args:
record_raw_data (bytes) tlv_data_len (unsigned int)
- Returns:
bool
- property data_size
- Returns:
unsigned int
- get_data_size(self: mtf.libs.mtf_pybinder.pcpp.RadiusAttribute) int
- Returns:
unsigned int
- get_total_size(self: mtf.libs.mtf_pybinder.pcpp.RadiusAttribute) int
- Returns:
unsigned int
- get_value_as(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t, offset: int) int
- Args:
offset (unsigned int)
- Returns:
unsigned int
- is_not_null(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t) bool
- Returns:
bool
- is_null(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t) bool
- Returns:
bool
- purge_record_data(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t) None
- property record_raw_data
- set_value(*args, **kwargs)
Overloaded function.
set_value(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t, new_value: int) -> bool
- Args:
new_value (unsigned int)
- Returns:
bool
set_value(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t, new_value: int, value_offset: int) -> bool
- Args:
new_value (unsigned int) value_offset (int)
- Returns:
bool
- property total_size
- Returns:
unsigned int
- property type
- Returns:
unsigned int
- property value
- class mtf.libs.mtf_pybinder.pcpp.RadiusAttributeBuilder
A class for building RADIUS attributes. This builder receives the attribute parameters in its c’tor, builds the RADIUS attribute raw buffer and provides a build() method to get a RadiusAttribute object out of it
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.RadiusAttributeBuilder, attr_type: int, attr_value: int, attr_value_len: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.RadiusAttributeBuilder, attr_type: int, attr_value: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.RadiusAttributeBuilder, attr_type: int, attr_value: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.RadiusAttributeBuilder, attr_type: int, attr_value: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.RadiusAttributeBuilder, attr_type: int, attr_value: mtf.libs.mtf_pybinder.pcpp.IPv4Address) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.RadiusAttributeBuilder, attr_type: int, attr_value: str) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.RadiusAttributeBuilder, arg0: mtf.libs.mtf_pybinder.pcpp.RadiusAttributeBuilder) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.RadiusAttributeBuilder, other: mtf.libs.mtf_pybinder.pcpp.RadiusAttributeBuilder) mtf.libs.mtf_pybinder.pcpp.RadiusAttributeBuilder
Assignment operator that copies all data from another instance of RadiusAttributeBuilder
- Args:
other (pcpp.RadiusAttributeBuilder): The instance to assign from
- Returns:
pcpp.RadiusAttributeBuilder
- build(self: mtf.libs.mtf_pybinder.pcpp.RadiusAttributeBuilder) mtf.libs.mtf_pybinder.pcpp.RadiusAttribute
Build the RadiusAttribute object out of the parameters defined in the c’tor
- Returns:
pcpp.RadiusAttribute: The RadiusAttribute object
- class mtf.libs.mtf_pybinder.pcpp.RadiusLayer
Represents a RADIUS (Remote Authentication Dial-In User Service) protocol layer
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.RadiusLayer, data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.RadiusLayer, code: int, id: int, authenticator: int, authenticator_arr_size: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.RadiusLayer, code: int, id: int, authenticator: str) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.RadiusLayer, arg0: mtf.libs.mtf_pybinder.pcpp.RadiusLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.RadiusLayer, arg0: mtf.libs.mtf_pybinder.pcpp.RadiusLayer) -> None
- __new__(**kwargs)
- add_attribute(self: mtf.libs.mtf_pybinder.pcpp.RadiusLayer, attr_builder: mtf.libs.mtf_pybinder.pcpp.RadiusAttributeBuilder) mtf.libs.mtf_pybinder.pcpp.RadiusAttribute
Add a new RADIUS attribute at the end of the layer
- Args:
attr_builder (pcpp.RadiusAttributeBuilder): A RadiusAttributeBuilder object that contains the requested attribute data to add
- Returns:
pcpp.RadiusAttribute: A RadiusAttribute object containing the newly added RADIUS attribute data or logical NULL
(RadiusAttribute#isNull() == true) if addition failed
- add_attribute_after(self: mtf.libs.mtf_pybinder.pcpp.RadiusLayer, attr_builder: mtf.libs.mtf_pybinder.pcpp.RadiusAttributeBuilder, prev_attr_type: int) mtf.libs.mtf_pybinder.pcpp.RadiusAttribute
Add a new RADIUS attribute after an existing one
- Args:
attr_builder (pcpp.RadiusAttributeBuilder): A RadiusAttributeBuilder object that contains the requested attribute data to add prev_attr_type (unsigned int): The RADIUS attribute which the newly added attribute will come after
- Returns:
pcpp.RadiusAttribute: A RadiusAttribute object containing the newly added RADIUS attribute data or logical NULL
(RadiusAttribute#isNull() == true) if addition failed
- assign(self: mtf.libs.mtf_pybinder.pcpp.RadiusLayer, : mtf.libs.mtf_pybinder.pcpp.RadiusLayer) mtf.libs.mtf_pybinder.pcpp.RadiusLayer
- Returns:
pcpp.RadiusLayer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.RadiusLayer) None
Calculate and store the value of radius_header#length according to the layer size
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_attribute(self: mtf.libs.mtf_pybinder.pcpp.RadiusLayer, attr_type: int) mtf.libs.mtf_pybinder.pcpp.RadiusAttribute
Get a RADIUS attribute by attribute type
- Args:
attr_type (unsigned int): RADIUS attribute type
- Returns:
pcpp.RadiusAttribute: A RadiusAttribute object containing the first attribute data that matches this type, or logical NULL
(RadiusAttribute#isNull() == true) if no such attribute found
- get_attribute_count(self: mtf.libs.mtf_pybinder.pcpp.RadiusLayer) int
The number of RADIUS attributes in the packet
- Returns:
unsigned int
- get_authenticator_value(self: mtf.libs.mtf_pybinder.pcpp.RadiusLayer) str
A hex string representation of the radius_header#authenticator byte array value
- Returns:
str
- get_first_attribute(self: mtf.libs.mtf_pybinder.pcpp.RadiusLayer) mtf.libs.mtf_pybinder.pcpp.RadiusAttribute
The first RADIUS attribute in the packet. If there are no attributes the returned value will contain a logical NULL (RadiusAttribute#isNull() == true)
- Returns:
pcpp.RadiusAttribute
- get_header_len(self: mtf.libs.mtf_pybinder.pcpp.RadiusLayer) int
The size written in radius_header#length
- Returns:
unsigned int
- get_next_attribute(self: mtf.libs.mtf_pybinder.pcpp.RadiusLayer, attr: mtf.libs.mtf_pybinder.pcpp.RadiusAttribute) mtf.libs.mtf_pybinder.pcpp.RadiusAttribute
Get the RADIUS attribute that comes after a given attribute. If the given attribute was the last one, the returned value will contain a logical NULL (RadiusAttribute#isNull() == true)
- Args:
attr (pcpp.RadiusAttribute): A given attribute
- Returns:
pcpp.RadiusAttribute: A RadiusAttribute object containing the attribute data that comes next, or logical NULL if the given
attribute: (1) was the last one; (2) contains a logical NULL or (3) doesn’t belong to this packet
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_osi_model_layer(self: mtf.libs.mtf_pybinder.pcpp.RadiusLayer) mtf.libs.mtf_pybinder.pcpp.OsiModelLayer
- Returns:
enum pcpp.OsiModelLayer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- get_radius_header(self: mtf.libs.mtf_pybinder.pcpp.RadiusLayer) mtf.libs.mtf_pybinder.pcpp.radius_header
Get a pointer to the RADIUS header. Notice this points directly to the data, so every change will change the actual packet data
- Returns:
pcpp.radius_header: A pointer to the radius_header object
- static get_radius_message_string(radius_message_code: int) str
A static method that returns the RADIUS message string for a give message code. For example: the string “Access-Request” will be returned for code 1
- Args:
radius_message_code (unsigned int): RADIUS message code
- Returns:
str: RADIUS message string
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- static is_data_valid(udp_data: int, udp_data_len: int) bool
The static method makes validation of UDP data
- Args:
udp_data (bytes): The pointer to the UDP payload data. It points to the first byte of RADIUS header. udp_data_len (unsigned int): The payload data size
- Returns:
bool: True if the data is valid and can represent the RADIUS packet
- static is_radius_port(port: int) bool
A static method that checks whether the port is considered as RADIUS The port number to be checked
- Args:
port (unsigned int)
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.RadiusLayer) None
Does nothing for this layer, RADIUS is always last
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- remove_all_attributes(self: mtf.libs.mtf_pybinder.pcpp.RadiusLayer) bool
Remove all RADIUS attributes in this layer
- Returns:
bool: True if all attributes were successfully removed or false if removal failed for some reason
- remove_attribute(self: mtf.libs.mtf_pybinder.pcpp.RadiusLayer, attr_type: int) bool
Remove an existing RADIUS attribute from the layer
- Args:
attr_type (unsigned int): The RADIUS attribute type to remove
- Returns:
bool: True if the RADIUS attribute was successfully removed or false if type wasn’t found or if removal failed
- set_authenticator_value(self: mtf.libs.mtf_pybinder.pcpp.RadiusLayer, auth_value: str) None
Setter for radius_header#authenticator
- Args:
auth_value (str): A hex string representing the requested authenticator value
- to_string(self: mtf.libs.mtf_pybinder.pcpp.RadiusLayer) str
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.RawPacket
This class holds the packet as raw (not parsed) data. The data is held as byte array. In addition to the data itself every instance also holds a timestamp representing the time the packet was received by the NIC. RawPacket instance isn’t read only. The user can change the packet data, add or remove data, etc.
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.RawPacket, arg0: numpy.ndarray[numpy.uint8]) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.RawPacket, arg0: bytes) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.RawPacket) -> None
- A default constructor that initializes class’es attributes to default value:
data pointer is set to NULL
data length is set to 0
deleteRawDataAtDestructor is set to ‘true’
@todo timestamp isn’t set here to a default value
- __new__(**kwargs)
- append_data(self: mtf.libs.mtf_pybinder.pcpp.RawPacket, data_to_append: numpy.ndarray[numpy.uint8]) None
Append data to the end of current data. This method works without allocating more memory, it just uses memcpy() tocopy dataToAppend at the end of the current data. This means that the method assumes this memory was alreadyallocated by the user. If it isn’t the case then this method will cause memory corruption
- Args:
data_to_append (DataType): A pointer to thedata to append to current raw data
- clear(self: mtf.libs.mtf_pybinder.pcpp.RawPacket) None
Clears all members of this instance, meaning setting raw data to NULL, raw data length to 0, etc. Currently raw datais always freed, even if deleteRawDataAtDestructor was set to ‘false’ deleteRawDataAtDestructor was set to’true’, don’t free the raw data set timestamp to a default value as well
- property frame_length
Get frame length in bytes
- Returns:
int: frame length in bytes
- get_data_as_np_array(self: mtf.libs.mtf_pybinder.pcpp.RawPacket) numpy.ndarray[numpy.uint8]
- insert_data(self: mtf.libs.mtf_pybinder.pcpp.RawPacket, at_index: int, data_to_insert: numpy.ndarray[numpy.uint8]) None
Insert new data at some index of the current data and shift the remaining old data to the end. This method workswithout allocating more memory, it just copies dataToAppend at the relevant index and shifts the remaining data tothe end. This means that the method assumes this memory was already allocated by the user. If it isn’t the casethen this method will cause memory corruption The index to insert the new data to A pointer to the newdata to insert
- Args:
at_index (int): The index to insert the new data to data_to_insert (DataType): The newdata to insert
- static is_link_type_valid(link_type_value: int) bool
This static method validates whether a link type integer value is valid
- Args:
link_type_value (int): Link type integer value
- Returns:
bool: True if the link type value is valid and can be casted into LinkLayerType enum, false otherwise
- is_packet_set(self: mtf.libs.mtf_pybinder.pcpp.RawPacket) bool
Get an indication whether raw data was already set for this instance.
- Returns:
bool: True if raw data was set for thisinstance. Raw data can be set using the non-default constructor, using setRawData(), using
the copy constructor orusing the assignment operator. Returns false otherwise, for example: if the instance was created using the defaultconstructor or clear() was called
- property link_layer_type
Get the link layer type
- Returns:
enum pcpp.LinkLayerType: the type of the link layer
- property packet_timestamp
Raw data timestamp
- Returns:
timespec
- property raw_data_len
Get raw data length in bytes
- Returns:
int: Raw data length in bytes
- remove_data(self: mtf.libs.mtf_pybinder.pcpp.RawPacket, at_index: int, num_of_bytes_to_remove: int) bool
Remove certain number of bytes from current raw data buffer. All data after the removed bytes will be shifted back
- Args:
at_index (int): The index to start removing bytes from num_of_bytes_to_remove (unsigned int): Number of bytes to remove
- Returns:
bool: True if all bytes were removedsuccessfully, or false if atIndex+numOfBytesToRemove is out-of-bounds of the raw data buffer
- class mtf.libs.mtf_pybinder.pcpp.RtcpLayer
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.RtcpLayer, data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.RtcpLayer, data: int, data_len: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.RtcpLayer, arg0: mtf.libs.mtf_pybinder.pcpp.RtcpLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.RtcpLayer, arg0: mtf.libs.mtf_pybinder.pcpp.RtcpLayer) -> None
- __new__(**kwargs)
- static add_port(port: int) None
A static method that adds a port number for RTCP layer
- Args:
port (str)
- property as_timestamp
The absolute sender timestamp field of the RTCP header
- assign(self: mtf.libs.mtf_pybinder.pcpp.RtcpLayer, : mtf.libs.mtf_pybinder.pcpp.RtcpLayer) mtf.libs.mtf_pybinder.pcpp.RtcpLayer
- Returns:
pcpp.RtcpLayer
- static clear_ports() None
A static method that clears the port numbers for RTCP layer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.RtcpLayer) None
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_header_len(self: mtf.libs.mtf_pybinder.pcpp.RtcpLayer) int
- Returns:
unsigned int
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_osi_model_layer(self: mtf.libs.mtf_pybinder.pcpp.RtcpLayer) mtf.libs.mtf_pybinder.pcpp.OsiModelLayer
- Returns:
enum pcpp.OsiModelLayer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property gm_identity
The gm_identity field of the RTCP header
- property gm_timebase_indicator
The gm_timebase_indicator field of the RTCP header
- property header_len
The header length in bytes
- Returns:
unsigned int
- property identifier
The identifier field of the RTCP header
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- static is_data_valid(data: int, data_len: int) bool
A static method that validates the input data
- Args:
data (bytes): The pointer to the beginning of a byte stream of RTPpacket data_len (unsigned int): The length of the byte stream
- Returns:
bool: True if the data is valid and can represent an RTPpacket
- static is_rtcp_port(port: int) bool
- Args:
port (unsigned int)
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property length
The length field of the RTCP header
- property name
The name field of the RTCP header
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- property packet_type
The packet_type field of the RTCP header
- property padding
The padding field of the RTCP header
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.RtcpLayer) None
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property rtp_timestamp
The RTP timestamp field of the RTCP header
- property stream_id
The stream_id field of the RTCP header
- property sub_type
The sub_type field of the RTCP header
- to_string(self: mtf.libs.mtf_pybinder.pcpp.RtcpLayer) str
- Returns:
str
- property version
The version field of the RTCP header
- class mtf.libs.mtf_pybinder.pcpp.RtpLayer
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.RtpLayer, data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.RtpLayer, data: int, data_len: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.RtpLayer, arg0: mtf.libs.mtf_pybinder.pcpp.RtpLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.RtpLayer, arg0: mtf.libs.mtf_pybinder.pcpp.RtpLayer) -> None
- __new__(**kwargs)
- static add_port(port: int) None
A static method that adds a port number for RTP layer
- Args:
port (unsigned int)
- assign(self: mtf.libs.mtf_pybinder.pcpp.RtpLayer, : mtf.libs.mtf_pybinder.pcpp.RtpLayer) mtf.libs.mtf_pybinder.pcpp.RtpLayer
- Returns:
pcpp.RtpLayer
- static clear_ports() None
A static method that clears the port numbers for RTP layer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.RtpLayer) None
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property csrc_identifier_count
The csrc_identifier_count field of the RTP header
- property csrc_identifiers
The csrc_identifiers field of the RTP header
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- property defined_by_profile
The defined_by_profile field of the RTP header. A part of the RTP extension. Only applies when extension exists.
- property extension
The extension field of the RTP header
- property extension_length
The extension_length field of the RTP header. A part of the RTP extension. Only applies when extension exists.
- get_header_len(self: mtf.libs.mtf_pybinder.pcpp.RtpLayer) int
- Returns:
unsigned int
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_osi_model_layer(self: mtf.libs.mtf_pybinder.pcpp.RtpLayer) mtf.libs.mtf_pybinder.pcpp.OsiModelLayer
- Returns:
enum pcpp.OsiModelLayer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_extensions
Getter for the header extensions of the RTP layer. A part of the RTP extension. Only applies when extension exists.
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- static is_data_valid(data: int, data_len: int) bool
A static method that validates the input data
- Args:
data (bytes): The pointer to the beginning of a byte stream of RTPpacket data_len (unsigned int): The length of the byte stream
- Returns:
bool: True if the data is valid and can represent an RTPpacket
- static is_rtp_port(port: int) bool
- Args:
port (unsigned int)
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property marker
The marker field of the RTP header
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- property padding
The padding field of the RTP header
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.RtpLayer) None
- property payload_type
The payload_type field of the RTP header
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property rtp_payload
Getter for the RTP payload of the RTP layer
- property sequence_number
The sequence_number field of the RTP header
- property ssrc_identifier
The ssrc_identifier field of the RTP header
- property time_stamp
The time_stamp field of the RTP header
- to_string(self: mtf.libs.mtf_pybinder.pcpp.RtpLayer) str
- Returns:
str
- property version
The version field of the RTP header
- class mtf.libs.mtf_pybinder.pcpp.SNAPLayer
Represents Logical Link Control layer messages
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.SNAPLayer, data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.SNAPLayer, arg0: mtf.libs.mtf_pybinder.pcpp.SNAPLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.SNAPLayer, arg0: mtf.libs.mtf_pybinder.pcpp.SNAPLayer) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.SNAPLayer, : mtf.libs.mtf_pybinder.pcpp.SNAPLayer) mtf.libs.mtf_pybinder.pcpp.SNAPLayer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- property control
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- property dsap
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- is_control_2bytes(self: mtf.libs.mtf_pybinder.pcpp.SNAPLayer) bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property organization_code
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property pid
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property ssap
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.SSHEncryptedMessage
A class representing an SSH encrypted message. In such messages there is very little information to extract from the packet, hence this class doesn’t expose any methods or getters, other than the ones inherited from parent classes.
It is assumed that any SSH message which does not fit to any of the other SSH message types, according to the heuristics described in the SSHLayer.h file description, is considered as an encrypted message.
- __init__(self: mtf.libs.mtf_pybinder.pcpp.SSHEncryptedMessage, data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.SSHEncryptedMessage, : mtf.libs.mtf_pybinder.pcpp.SSHEncryptedMessage) mtf.libs.mtf_pybinder.pcpp.SSHEncryptedMessage
- Returns:
pcpp.SSHEncryptedMessage
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- static create_ssh_message(data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) mtf.libs.mtf_pybinder.pcpp.SSHLayer
A static method that takes raw packet data and uses the heuristics described in the SSHLayer.h file description to create an SSH layer instance. This method assumes the data is indeed SSH data and not some other arbitrary data A pointer to the raw data Size of the data in bytes A pointer to the previous layer A pointer to the Packet instance where layer will be stored in An instance of one of the classes that inherit SSHLayer as described in the SSHLayer.h file description
- Args:
data (bytes) data_len (unsigned int) prev_layer (pcpp.Layer) packet (pcpp.Packet)
- Returns:
pcpp.SSHLayer
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- property encrypted_packet
The encrypted packet of the SSH encrypted message
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- static is_ssh_port(port_src: int, port_dst: int) bool
A static method that takes src and dst ports and determines whether it’s SSH traffic or not. The source TCP port to examine The dest TCP port to examine Currently the implementation is very simple and returns “true” if either src or dst ports are equal to 22, “false” otherwise
- Args:
port_src (unsigned int) port_dst (unsigned int)
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- property packet_length
The packet length in [bytes]
- Returns:
unsigned int
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.SSHHandshakeMessage
A class representing all of the non-encrypted SSH handshake messages. An handshake message typically has the following structure:
The first 4 bytes hold the packet length, followed by 1 byte that holds the padding length (which comes at the end of the message), then 1 byte that holds the message type (which can be of type SSHHandshakeMessage#SSHHandshakeMessageType) and then the message content. At the end of the content there is typically padding.
This class provides access to all of these values. The message content itself is not parse with the exception of SSHKeyExchangeInitMessage which inherits from this class and provides parsing of the Key Exchange Init message.
- class SSHHandshakeMessageType
An enum that represents SSH non-encrypted message types
Members:
SSH_MSG_KEX_INIT
SSH_MSG_NEW_KEYS
SSH_MSG_KEX_DH_INIT
SSH_MSG_KEX_DH_REPLY
SSH_MSG_KEX_DH_GEX_INIT
SSH_MSG_KEX_DH_GEX_REPLY
SSH_MSG_KEX_DH_GEX_REQUEST
SSH_MSG_UNKNOWN
- SSH_MSG_KEX_DH_GEX_INIT
- SSH_MSG_KEX_DH_GEX_REPLY
- SSH_MSG_KEX_DH_GEX_REQUEST
- SSH_MSG_KEX_DH_INIT
- SSH_MSG_KEX_DH_REPLY
- SSH_MSG_KEX_INIT
- SSH_MSG_NEW_KEYS
- SSH_MSG_UNKNOWN
- __init__(self: mtf.libs.mtf_pybinder.pcpp.SSHHandshakeMessage.SSHHandshakeMessageType, value: int) None
- __new__(**kwargs)
- property name
- property value
- SSH_MSG_KEX_DH_GEX_INIT
- SSH_MSG_KEX_DH_GEX_REPLY
- SSH_MSG_KEX_DH_GEX_REQUEST
- SSH_MSG_KEX_DH_INIT
- SSH_MSG_KEX_DH_REPLY
- SSH_MSG_KEX_INIT
- SSH_MSG_NEW_KEYS
- SSH_MSG_UNKNOWN
- __init__(*args, **kwargs)
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.SSHHandshakeMessage, : mtf.libs.mtf_pybinder.pcpp.SSHHandshakeMessage) mtf.libs.mtf_pybinder.pcpp.SSHHandshakeMessage
- Returns:
pcpp.SSHHandshakeMessage
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- static create_ssh_message(data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) mtf.libs.mtf_pybinder.pcpp.SSHLayer
A static method that takes raw packet data and uses the heuristics described in the SSHLayer.h file description to create an SSH layer instance. This method assumes the data is indeed SSH data and not some other arbitrary data A pointer to the raw data Size of the data in bytes A pointer to the previous layer A pointer to the Packet instance where layer will be stored in An instance of one of the classes that inherit SSHLayer as described in the SSHLayer.h file description
- Args:
data (bytes) data_len (unsigned int) prev_layer (pcpp.Layer) packet (pcpp.Packet)
- Returns:
pcpp.SSHLayer
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- static is_ssh_port(port_src: int, port_dst: int) bool
A static method that takes src and dst ports and determines whether it’s SSH traffic or not. The source TCP port to examine The dest TCP port to examine Currently the implementation is very simple and returns “true” if either src or dst ports are equal to 22, “false” otherwise
- Args:
port_src (unsigned int) port_dst (unsigned int)
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property message_type
The message type
- Returns:
enum pcpp.SSHHandshakeMessage.SSHHandshakeMessageType
- property message_type_str
A string representation of the message type
- Returns:
str
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- property packet_length
The packet length in [bytes]
- Returns:
unsigned int
- property padding_length
The padding length in [bytes]
- Returns:
unsigned int
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property ssh_handshake_message
A vector of bytes of the message content
- Returns:
list[unsigned int]
- property ssh_handshake_message_length
The message content length in [bytes] which is calculated by the overall packet length minus the message header (which includes packet length, padding length and message type) and minus the padding bytes
- Returns:
unsigned int
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- static try_parse(data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) mtf.libs.mtf_pybinder.pcpp.SSHHandshakeMessage
A static method that takes raw packet data and uses some heuristics described in the SSHLayer.h file description to parse it as SSH handshake message instance A pointer to the raw data Size of the data in bytes A pointer to the previous layer A pointer to the Packet instance where layer will be stored in Upon successful parsing the return value would be an instance of SSHKeyExchangeInitMessage for Key Exchange Init message or SSHHandshakeMessage for any other message type. If parsing fails NULL will be returned
- Args:
data (bytes) data_len (unsigned int) prev_layer (pcpp.Layer) packet (pcpp.Packet)
- Returns:
pcpp.SSHHandshakeMessage
- class mtf.libs.mtf_pybinder.pcpp.SSHIdentificationMessage
A class that represents SSH identification message as described in RFC 4253: <https://tools.ietf.org/html/rfc4253#section-4.2>
The message content is typically a string that contains the protocol version, software version and a few more details. This string can be retrieved using the getIdentificationMessage() method
- __init__(*args, **kwargs)
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.SSHIdentificationMessage, : mtf.libs.mtf_pybinder.pcpp.SSHIdentificationMessage) mtf.libs.mtf_pybinder.pcpp.SSHIdentificationMessage
- Returns:
pcpp.SSHIdentificationMessage
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- static create_ssh_message(data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) mtf.libs.mtf_pybinder.pcpp.SSHLayer
A static method that takes raw packet data and uses the heuristics described in the SSHLayer.h file description to create an SSH layer instance. This method assumes the data is indeed SSH data and not some other arbitrary data A pointer to the raw data Size of the data in bytes A pointer to the previous layer A pointer to the Packet instance where layer will be stored in An instance of one of the classes that inherit SSHLayer as described in the SSHLayer.h file description
- Args:
data (bytes) data_len (unsigned int) prev_layer (pcpp.Layer) packet (pcpp.Packet)
- Returns:
pcpp.SSHLayer
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- property identification_message
The SSH identification message which is typically the content of this message
- Returns:
str
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- static is_ssh_port(port_src: int, port_dst: int) bool
A static method that takes src and dst ports and determines whether it’s SSH traffic or not. The source TCP port to examine The dest TCP port to examine Currently the implementation is very simple and returns “true” if either src or dst ports are equal to 22, “false” otherwise
- Args:
port_src (unsigned int) port_dst (unsigned int)
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- static try_parse(data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) mtf.libs.mtf_pybinder.pcpp.SSHIdentificationMessage
A static method that takes raw data and tries to parse it as an SSH identification message using the heuristics described in the SSHLayer.h file description. It returns a SSHIdentificationMessage instance if such a message can be identified or NULL otherwise. A pointer to the raw data Size of the data in bytes A pointer to the previous layer A pointer to the Packet instance where layer will be stored in An instance of SSHIdentificationMessage or NULL if this is not an identification message
- Args:
data (bytes) data_len (unsigned int) prev_layer (pcpp.Layer) packet (pcpp.Packet)
- Returns:
pcpp.SSHIdentificationMessage
- class mtf.libs.mtf_pybinder.pcpp.SSHKeyExchangeInitMessage
A class representing the SSH Key Exchange Init message. This is a non-encrypted message that contains information about the algorithms used for key exchange, encryption, MAC and compression. This class provides methods to access these details
- class SSHHandshakeMessageType
An enum that represents SSH non-encrypted message types
Members:
SSH_MSG_KEX_INIT
SSH_MSG_NEW_KEYS
SSH_MSG_KEX_DH_INIT
SSH_MSG_KEX_DH_REPLY
SSH_MSG_KEX_DH_GEX_INIT
SSH_MSG_KEX_DH_GEX_REPLY
SSH_MSG_KEX_DH_GEX_REQUEST
SSH_MSG_UNKNOWN
- SSH_MSG_KEX_DH_GEX_INIT
- SSH_MSG_KEX_DH_GEX_REPLY
- SSH_MSG_KEX_DH_GEX_REQUEST
- SSH_MSG_KEX_DH_INIT
- SSH_MSG_KEX_DH_REPLY
- SSH_MSG_KEX_INIT
- SSH_MSG_NEW_KEYS
- SSH_MSG_UNKNOWN
- __init__(self: mtf.libs.mtf_pybinder.pcpp.SSHHandshakeMessage.SSHHandshakeMessageType, value: int) None
- __new__(**kwargs)
- property name
- property value
- SSH_MSG_KEX_DH_GEX_INIT
- SSH_MSG_KEX_DH_GEX_REPLY
- SSH_MSG_KEX_DH_GEX_REQUEST
- SSH_MSG_KEX_DH_INIT
- SSH_MSG_KEX_DH_REPLY
- SSH_MSG_KEX_INIT
- SSH_MSG_NEW_KEYS
- SSH_MSG_UNKNOWN
- __init__(self: mtf.libs.mtf_pybinder.pcpp.SSHKeyExchangeInitMessage, data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.SSHKeyExchangeInitMessage, : mtf.libs.mtf_pybinder.pcpp.SSHKeyExchangeInitMessage) mtf.libs.mtf_pybinder.pcpp.SSHKeyExchangeInitMessage
- Returns:
pcpp.SSHKeyExchangeInitMessage
- property compression_algorithms_client_to_server
A comma-separated list of acceptable compression algorithms from the client to the server. Can be empty if the value is missing or the message is malformed
- Returns:
str
- property compression_algorithms_server_to_client
A comma-separated list of acceptable compression algorithms from the server to the client. Can be empty if the value is missing or the message is malformed
- Returns:
str
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- property cookie
Each SSH Key Exchange Init message contains a random 16-byte value generated by the sender. This method returns a pointer to this 16-byte cookie. To get the value as a hex string please refer to getCookieAsHexStream() A pointer to the 16-byte cookie value or NULL if the message is malformed
- Returns:
list[unsigned int]
- property cookie_as_hex_stream
Each SSH Key Exchange Init message contains a random 16-byte value generated by the sender. This method returns the 16-byte cookie as a hex stream. To get the raw data please refer to getCookie() A hex stream of the 16-byte cookie value or an empty string if the message is malformed
- Returns:
str
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- static create_ssh_message(data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) mtf.libs.mtf_pybinder.pcpp.SSHLayer
A static method that takes raw packet data and uses the heuristics described in the SSHLayer.h file description to create an SSH layer instance. This method assumes the data is indeed SSH data and not some other arbitrary data A pointer to the raw data Size of the data in bytes A pointer to the previous layer A pointer to the Packet instance where layer will be stored in An instance of one of the classes that inherit SSHLayer as described in the SSHLayer.h file description
- Args:
data (bytes) data_len (unsigned int) prev_layer (pcpp.Layer) packet (pcpp.Packet)
- Returns:
pcpp.SSHLayer
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- property encryption_algorithms_client_to_server
A comma-separated list of acceptable symmetric encryption algorithms (also known as ciphers) from the client to the server. Can be empty if the value is missing or the message is malformed
- Returns:
str
- property encryption_algorithms_server_to_client
A comma-separated list of acceptable symmetric encryption algorithms (also known as ciphers) from the server to the client. Can be empty if the value is missing or the message is malformed
- Returns:
str
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- property is_first_kex_packet_follows
Indicates whether a guessed key exchange packet follows. If a guessed packet will be sent, the return value is true. If no guessed packet will be sent or if this value is missing, the return value is false.
- Returns:
bool
- static is_ssh_port(port_src: int, port_dst: int) bool
A static method that takes src and dst ports and determines whether it’s SSH traffic or not. The source TCP port to examine The dest TCP port to examine Currently the implementation is very simple and returns “true” if either src or dst ports are equal to 22, “false” otherwise
- Args:
port_src (unsigned int) port_dst (unsigned int)
- Returns:
bool
- property key_exchange_algorithms
A comma-separated list of the key exchange algorithms used in this session. Can be empty if the value is missing or the message is malformed
- Returns:
str
- property languages_client_to_server
A comma-separated list of language tags from the client to the server. Can be empty if the value is missing or the message is malformed
- Returns:
str
- property languages_server_to_client
A comma-separated list of language tags from the server to the client. Can be empty if the value is missing or the message is malformed
- Returns:
str
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property mac_algorithms_client_to_server
A comma-separated list of acceptable MAC algorithms from the client to the server. Can be empty if the value is missing or the message is malformed
- Returns:
str
- property mac_algorithms_server_to_client
A comma-separated list of acceptable MAC algorithms from the server to the client. Can be empty if the value is missing or the message is malformed
- Returns:
str
- property message_type
The message type
- Returns:
enum pcpp.SSHHandshakeMessage.SSHHandshakeMessageType
- property message_type_str
A string representation of the message type
- Returns:
str
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- property packet_length
The packet length in [bytes]
- Returns:
unsigned int
- property padding_length
The padding length in [bytes]
- Returns:
unsigned int
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property server_host_key_algorithms
A comma-separated list of the algorithms supported for the server host key. Can be empty if the value is missing or the message is malformed
- Returns:
str
- property ssh_handshake_message
A vector of bytes of the message content
- Returns:
list[unsigned int]
- property ssh_handshake_message_length
The message content length in [bytes] which is calculated by the overall packet length minus the message header (which includes packet length, padding length and message type) and minus the padding bytes
- Returns:
unsigned int
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- static try_parse(data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) mtf.libs.mtf_pybinder.pcpp.SSHHandshakeMessage
A static method that takes raw packet data and uses some heuristics described in the SSHLayer.h file description to parse it as SSH handshake message instance A pointer to the raw data Size of the data in bytes A pointer to the previous layer A pointer to the Packet instance where layer will be stored in Upon successful parsing the return value would be an instance of SSHKeyExchangeInitMessage for Key Exchange Init message or SSHHandshakeMessage for any other message type. If parsing fails NULL will be returned
- Args:
data (bytes) data_len (unsigned int) prev_layer (pcpp.Layer) packet (pcpp.Packet)
- Returns:
pcpp.SSHHandshakeMessage
- class mtf.libs.mtf_pybinder.pcpp.SSHLayer
This is the base class for the SSH layer. It is an abstract class that cannot be instantiated. It holds some common functionality, but its most important method is createSSHMessage() which takes raw data and creates an SSH message according to the heuristics described in the SSHLayer.h file description
- __init__(self: mtf.libs.mtf_pybinder.pcpp.SSHLayer, arg0: mtf.libs.mtf_pybinder.pcpp.SSHLayer) None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.SSHLayer, : mtf.libs.mtf_pybinder.pcpp.SSHLayer) mtf.libs.mtf_pybinder.pcpp.SSHLayer
- Returns:
pcpp.SSHLayer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- static create_ssh_message(data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) mtf.libs.mtf_pybinder.pcpp.SSHLayer
A static method that takes raw packet data and uses the heuristics described in the SSHLayer.h file description to create an SSH layer instance. This method assumes the data is indeed SSH data and not some other arbitrary data A pointer to the raw data Size of the data in bytes A pointer to the previous layer A pointer to the Packet instance where layer will be stored in An instance of one of the classes that inherit SSHLayer as described in the SSHLayer.h file description
- Args:
data (bytes) data_len (unsigned int) prev_layer (pcpp.Layer) packet (pcpp.Packet)
- Returns:
pcpp.SSHLayer
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- static is_ssh_port(port_src: int, port_dst: int) bool
A static method that takes src and dst ports and determines whether it’s SSH traffic or not. The source TCP port to examine The dest TCP port to examine Currently the implementation is very simple and returns “true” if either src or dst ports are equal to 22, “false” otherwise
- Args:
port_src (unsigned int) port_dst (unsigned int)
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.SSLAlertDescription
SSL/TLS alert description types
Members:
SSL_ALERT_CLOSE_NOTIFY
SSL_ALERT_UNEXPECTED_MESSAGE
SSL_ALERT_BAD_RECORD_MAC
SSL_ALERT_DECRYPTION_FAILED
SSL_ALERT_RECORD_OVERFLOW
SSL_ALERT_DECOMPRESSION_FAILURE
SSL_ALERT_HANDSHAKE_FAILURE
SSL_ALERT_NO_CERTIFICATE
SSL_ALERT_BAD_CERTIFICATE
SSL_ALERT_UNSUPPORTED_CERTIFICATE
SSL_ALERT_CERTIFICATE_REVOKED
SSL_ALERT_CERTIFICATE_EXPIRED
SSL_ALERT_CERTIFICATE_UNKNOWN
SSL_ALERT_ILLEGAL_PARAMETER
SSL_ALERT_UNKNOWN_CA
SSL_ALERT_ACCESS_DENIED
SSL_ALERT_DECODE_ERROR
SSL_ALERT_DECRYPT_ERROR
SSL_ALERT_EXPORT_RESTRICTION
SSL_ALERT_PROTOCOL_VERSION
SSL_ALERT_INSUFFICIENT_SECURITY
SSL_ALERT_INTERNAL_ERROR
SSL_ALERT_USER_CANCELLED
SSL_ALERT_NO_RENEGOTIATION
SSL_ALERT_UNSUPPORTED_EXTENSION
SSL_ALERT_ENCRYPTED
- SSL_ALERT_ACCESS_DENIED
- SSL_ALERT_BAD_CERTIFICATE
- SSL_ALERT_BAD_RECORD_MAC
- SSL_ALERT_CERTIFICATE_EXPIRED
- SSL_ALERT_CERTIFICATE_REVOKED
- SSL_ALERT_CERTIFICATE_UNKNOWN
- SSL_ALERT_CLOSE_NOTIFY
- SSL_ALERT_DECODE_ERROR
- SSL_ALERT_DECOMPRESSION_FAILURE
- SSL_ALERT_DECRYPTION_FAILED
- SSL_ALERT_DECRYPT_ERROR
- SSL_ALERT_ENCRYPTED
- SSL_ALERT_EXPORT_RESTRICTION
- SSL_ALERT_HANDSHAKE_FAILURE
- SSL_ALERT_ILLEGAL_PARAMETER
- SSL_ALERT_INSUFFICIENT_SECURITY
- SSL_ALERT_INTERNAL_ERROR
- SSL_ALERT_NO_CERTIFICATE
- SSL_ALERT_NO_RENEGOTIATION
- SSL_ALERT_PROTOCOL_VERSION
- SSL_ALERT_RECORD_OVERFLOW
- SSL_ALERT_UNEXPECTED_MESSAGE
- SSL_ALERT_UNKNOWN_CA
- SSL_ALERT_UNSUPPORTED_CERTIFICATE
- SSL_ALERT_UNSUPPORTED_EXTENSION
- SSL_ALERT_USER_CANCELLED
- __init__(self: mtf.libs.mtf_pybinder.pcpp.SSLAlertDescription, value: int) None
- __new__(**kwargs)
- property name
- property value
- class mtf.libs.mtf_pybinder.pcpp.SSLAlertLayer
Represents SSL/TLS alert layer. Inherits from SSLLayer and adds parsing functionality such as retrieving the alert level and description
- __init__(self: mtf.libs.mtf_pybinder.pcpp.SSLAlertLayer, data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) None
- __new__(**kwargs)
- static add_ssl_port(port: int) None
Adds port to a list of ports where pcap checks for SSL/TLS communication. Each port must be removed at the end in order to have no memory leak.
- Args:
port (unsigned int): Port to add
- property alert_description
SSL/TLS alert description. Will return ::SSL_ALERT_ENCRYPTED if alert is encrypted
- Returns:
enum pcpp.SSLAlertDescription
- property alert_level
SSL/TLS alert level. Will return ::SSL_ALERT_LEVEL_ENCRYPTED if alert is encrypted
- Returns:
enum pcpp.SSLAlertLevel
- assign(self: mtf.libs.mtf_pybinder.pcpp.SSLAlertLayer, : mtf.libs.mtf_pybinder.pcpp.SSLAlertLayer) mtf.libs.mtf_pybinder.pcpp.SSLAlertLayer
- Returns:
pcpp.SSLAlertLayer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- static create_ssl_message(data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) mtf.libs.mtf_pybinder.pcpp.SSLLayer
A static method that creates SSL/TLS layers by raw data. This method parses the raw data, finds if and which SSL/TLS record it is and creates the corresponding record layer. It’s the responsibility of the user to free the created object when done using it A pointer to the raw data Size of the data in bytes A pointer to the previous layer A pointer to the Packet instance where layer will be stored in A pointer to the newly created record layer. If no SSL/TLS record could be identified from the raw data NULL is returned
- Args:
data (bytes) data_len (unsigned int) prev_layer (pcpp.Layer) packet (pcpp.Packet)
- Returns:
pcpp.SSLLayer
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- static is_ssl_message(*args, **kwargs)
Overloaded function.
is_ssl_message(src_port: int, dst_port: int, data: int, data_len: int) -> bool
- Args:
src_port (unsigned int) dst_port (unsigned int) data (bytes) data_len (unsigned int)
- Returns:
bool
is_ssl_message(src_port: int, dst_port: int, data: int, data_len: int, ignore_ports: bool) -> bool
A static methods that gets raw data of a layer and checks whether this data is a SSL/TLS record or not. This check is done using the source/dest port and matching of a legal record type in the raw data. The list of ports identified as SSL/TLS is hard-coded and includes the following ports: - Port 443 [HTTPS] - Port 261 [NSIIOPS] - Port 448 [DDM-SSL] - Port 563 [NNTPS] - Port 614 [SSHELL] - Port 465 [SMTPS] - Port 636 [LDAPS] - Port 989 [FTPS - data] - Port 990 [FTPS - control] - Port 992 [Telnet over TLS/SSL] - Port 993 [IMAPS] - Port 994 [IRCS] - Port 995 [POP3S] The source port of the packet that contains the raw data. Source port (or dest port) are a criteria to identify SSL/TLS packets The dest port of the packet that contains the raw data. Dest port (or source port) are a criteria to identify SSL/TLS packets The data to check Length (in bytes) of the data SSL/TLS ports are only relevant for parsing the first SSL/TLS message, but are not relevant for parsing subsequent messages. This parameter can be set to “true” to skip SSL/TLS ports check. This is an optional parameter and its default is “false”
- Args:
src_port (unsigned int) dst_port (unsigned int) data (bytes) data_len (unsigned int) ignore_ports (bool)
- Returns:
bool
- static is_ssl_port(port: int) bool
A static method that checks whether the port is considered as SSL/TLS
- Args:
port (unsigned int): The port number to be checked
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property record_type
The SSL/TLS record type as parsed from the record
- Returns:
enum pcpp.SSLRecordType
- property record_version
The SSL/TLS version used in this record (parsed from the record)
- Returns:
pcpp.SSLVersion
- static remove_all_ssl_ports() None
Removes all ports from a list of ports where pcap checks for SSL/TLS communication.
- static remove_ssl_port(port: int) None
Removes port from a list of ports where pcap checks for SSL/TLS communication.
- Args:
port (unsigned int): Port to remove
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.SSLAlertLevel
SSL/TLS alert levels
Members:
SSL_ALERT_LEVEL_WARNING
SSL_ALERT_LEVEL_FATAL
SSL_ALERT_LEVEL_ENCRYPTED
- SSL_ALERT_LEVEL_ENCRYPTED
- SSL_ALERT_LEVEL_FATAL
- SSL_ALERT_LEVEL_WARNING
- __init__(self: mtf.libs.mtf_pybinder.pcpp.SSLAlertLevel, value: int) None
- __new__(**kwargs)
- property name
- property value
- class mtf.libs.mtf_pybinder.pcpp.SSLApplicationDataLayer
Represents SSL/TLS application data layer. This message contains the encrypted data transferred from client to server and vice-versa after the SSL/TLS handshake was completed successfully
- __init__(self: mtf.libs.mtf_pybinder.pcpp.SSLApplicationDataLayer, data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) None
- __new__(**kwargs)
- static add_ssl_port(port: int) None
Adds port to a list of ports where pcap checks for SSL/TLS communication. Each port must be removed at the end in order to have no memory leak.
- Args:
port (unsigned int): Port to add
- assign(self: mtf.libs.mtf_pybinder.pcpp.SSLApplicationDataLayer, : mtf.libs.mtf_pybinder.pcpp.SSLApplicationDataLayer) mtf.libs.mtf_pybinder.pcpp.SSLApplicationDataLayer
- Returns:
pcpp.SSLApplicationDataLayer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- static create_ssl_message(data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) mtf.libs.mtf_pybinder.pcpp.SSLLayer
A static method that creates SSL/TLS layers by raw data. This method parses the raw data, finds if and which SSL/TLS record it is and creates the corresponding record layer. It’s the responsibility of the user to free the created object when done using it A pointer to the raw data Size of the data in bytes A pointer to the previous layer A pointer to the Packet instance where layer will be stored in A pointer to the newly created record layer. If no SSL/TLS record could be identified from the raw data NULL is returned
- Args:
data (bytes) data_len (unsigned int) prev_layer (pcpp.Layer) packet (pcpp.Packet)
- Returns:
pcpp.SSLLayer
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- property encrypted_data
Encrypted data. This data can be decrypted only if you have the symmetric key that was agreed between the client and the server during SSL/TLS handshake process
- property encrypted_data_len
The length in bytes of the encrypted data returned in getEncryptedData()
- Returns:
unsigned int
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- static is_ssl_message(*args, **kwargs)
Overloaded function.
is_ssl_message(src_port: int, dst_port: int, data: int, data_len: int) -> bool
- Args:
src_port (unsigned int) dst_port (unsigned int) data (bytes) data_len (unsigned int)
- Returns:
bool
is_ssl_message(src_port: int, dst_port: int, data: int, data_len: int, ignore_ports: bool) -> bool
A static methods that gets raw data of a layer and checks whether this data is a SSL/TLS record or not. This check is done using the source/dest port and matching of a legal record type in the raw data. The list of ports identified as SSL/TLS is hard-coded and includes the following ports: - Port 443 [HTTPS] - Port 261 [NSIIOPS] - Port 448 [DDM-SSL] - Port 563 [NNTPS] - Port 614 [SSHELL] - Port 465 [SMTPS] - Port 636 [LDAPS] - Port 989 [FTPS - data] - Port 990 [FTPS - control] - Port 992 [Telnet over TLS/SSL] - Port 993 [IMAPS] - Port 994 [IRCS] - Port 995 [POP3S] The source port of the packet that contains the raw data. Source port (or dest port) are a criteria to identify SSL/TLS packets The dest port of the packet that contains the raw data. Dest port (or source port) are a criteria to identify SSL/TLS packets The data to check Length (in bytes) of the data SSL/TLS ports are only relevant for parsing the first SSL/TLS message, but are not relevant for parsing subsequent messages. This parameter can be set to “true” to skip SSL/TLS ports check. This is an optional parameter and its default is “false”
- Args:
src_port (unsigned int) dst_port (unsigned int) data (bytes) data_len (unsigned int) ignore_ports (bool)
- Returns:
bool
- static is_ssl_port(port: int) bool
A static method that checks whether the port is considered as SSL/TLS
- Args:
port (unsigned int): The port number to be checked
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property record_type
The SSL/TLS record type as parsed from the record
- Returns:
enum pcpp.SSLRecordType
- property record_version
The SSL/TLS version used in this record (parsed from the record)
- Returns:
pcpp.SSLVersion
- static remove_all_ssl_ports() None
Removes all ports from a list of ports where pcap checks for SSL/TLS communication.
- static remove_ssl_port(port: int) None
Removes port from a list of ports where pcap checks for SSL/TLS communication.
- Args:
port (unsigned int): Port to remove
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.SSLAuthenticationAlgorithm
SSL/TLS authentication algorithms
Members:
SSL_AUTH_NULL
SSL_AUTH_RSA
SSL_AUTH_DSS
SSL_AUTH_anon
SSL_AUTH_KEA
SSL_AUTH_KRB5
SSL_AUTH_PSK
SSL_AUTH_ECDSA
SSL_AUTH_GOST
SSL_AUTH_SHA
SSL_AUTH_PCT
SSL_AUTH_DHE
SSL_AUTH_Unknown
- SSL_AUTH_DHE
- SSL_AUTH_DSS
- SSL_AUTH_ECDSA
- SSL_AUTH_GOST
- SSL_AUTH_KEA
- SSL_AUTH_KRB5
- SSL_AUTH_NULL
- SSL_AUTH_PCT
- SSL_AUTH_PSK
- SSL_AUTH_RSA
- SSL_AUTH_SHA
- SSL_AUTH_Unknown
- SSL_AUTH_anon
- __init__(self: mtf.libs.mtf_pybinder.pcpp.SSLAuthenticationAlgorithm, value: int) None
- __new__(**kwargs)
- property name
- property value
- class mtf.libs.mtf_pybinder.pcpp.SSLCertificateMessage
Represents SSL/TLS certificate message (type 11). Inherits from SSLHandshakeMessage and adds parsing functionality such as extracting the certificates data. Notice that in most cases this message is spread over more than 1 packet as its size is too big for a single packet. So SSLCertificateMessage instance will be created just for the first part of the message - the one encapsulated in the first packet. Other parts (encapsulated in the following packets) won’t be recognized as SSLCertificateMessage messages
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.SSLCertificateMessage, data: int, data_len: int, container: pcpp::SSLHandshakeLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.SSLCertificateMessage, arg0: mtf.libs.mtf_pybinder.pcpp.SSLCertificateMessage) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.SSLCertificateMessage, arg0: mtf.libs.mtf_pybinder.pcpp.SSLCertificateMessage) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.SSLCertificateMessage, : mtf.libs.mtf_pybinder.pcpp.SSLCertificateMessage) mtf.libs.mtf_pybinder.pcpp.SSLCertificateMessage
- Returns:
pcpp.SSLCertificateMessage
- static create_handshake_message(data: int, data_len: int, container: pcpp::SSLHandshakeLayer) mtf.libs.mtf_pybinder.pcpp.SSLHandshakeMessage
A factory method for creating instances of handshake messages from raw data The raw data containing 1 handshake message Raw data length in bytes A pointer to the SSLHandshakeLayer instance which will contain the created message. This parameter is required because the handshake message includes a pointer to its container
- Args:
data (bytes) data_len (unsigned int) container (pcpp.SSLHandshakeLayer)
- Returns:
pcpp.SSLHandshakeMessage
- get_certificate(self: mtf.libs.mtf_pybinder.pcpp.SSLCertificateMessage, index: int) mtf.libs.mtf_pybinder.pcpp.SSLx509Certificate
Get a certificate by index The index of the certificate to retrieve A pointer to the certificate object. Notice that if index < 0 or index > num of certificates encapsulated in current packet a NULL value will be returned
- Args:
index (int)
- Returns:
pcpp.SSLx509Certificate
- property handshake_type
The handshake message type
- Returns:
enum pcpp.SSLHandshakeType
- is_message_complete(self: mtf.libs.mtf_pybinder.pcpp.SSLHandshakeMessage) bool
True if current packet contains the entire message or false otherwise. This method is important because sometimes handshake messages are divided in consequent packets (happens a lot in certificate messages which usually contain several KB of data which is larger than standard packet size, so the message is divided between several packets)
- Returns:
bool
- property message_length
The handshake message length in bytes. Notice that sometimes the handshake message is divided between several packets, in this case this method will return the length of part of the message in the current packet
- Returns:
unsigned int
- property num_of_certificates
The number of certificates encapsulated in this message (as written in the ‘length’ field of the message). Notice that because the message may spread over several packets, not all certificates will necessarily be in this packet. So, for example, there may be a case where this method return 3 (message contains 3 certificates) but this message actually contains only 1 certificate as the other 2 are spread over the other packets
- Returns:
int
- class mtf.libs.mtf_pybinder.pcpp.SSLCertificateRequestMessage
Represents SSL/TLS certificate-request message (type 13). Inherits from SSLHandshakeMessage and adds parsing functionality such as retrieving client certificate types and authority data
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.SSLCertificateRequestMessage, data: int, data_len: int, container: pcpp::SSLHandshakeLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.SSLCertificateRequestMessage, arg0: mtf.libs.mtf_pybinder.pcpp.SSLCertificateRequestMessage) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.SSLCertificateRequestMessage, arg0: mtf.libs.mtf_pybinder.pcpp.SSLCertificateRequestMessage) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.SSLCertificateRequestMessage, : mtf.libs.mtf_pybinder.pcpp.SSLCertificateRequestMessage) mtf.libs.mtf_pybinder.pcpp.SSLCertificateRequestMessage
- Returns:
pcpp.SSLCertificateRequestMessage
- property certificate_authority_data
Certificate authority data as raw data (byte array). Parsing of this data may be added in the future. Notice that if this message is spread over several packets in a way none of the certificate authority data exists in this packet, NULL will be returned
- property certificate_authority_length
The length of certificate authority data returned by getCertificateAuthorityData(). Notice that if this message is spread over several packets in a way none of certificate authority data exists in the current packet, 0 will be returned. Also, if some of the data exists in the consequent packets, the length that will be returned is the length of data exists in the current packet only (and not the total length)
- Returns:
unsigned int
- property certificate_types
A reference to a vector containing all client certificate types exist in this message
- Returns:
list[enum pcpp.SSLClientCertificateType]
- static create_handshake_message(data: int, data_len: int, container: pcpp::SSLHandshakeLayer) mtf.libs.mtf_pybinder.pcpp.SSLHandshakeMessage
A factory method for creating instances of handshake messages from raw data The raw data containing 1 handshake message Raw data length in bytes A pointer to the SSLHandshakeLayer instance which will contain the created message. This parameter is required because the handshake message includes a pointer to its container
- Args:
data (bytes) data_len (unsigned int) container (pcpp.SSLHandshakeLayer)
- Returns:
pcpp.SSLHandshakeMessage
- property handshake_type
The handshake message type
- Returns:
enum pcpp.SSLHandshakeType
- is_message_complete(self: mtf.libs.mtf_pybinder.pcpp.SSLHandshakeMessage) bool
True if current packet contains the entire message or false otherwise. This method is important because sometimes handshake messages are divided in consequent packets (happens a lot in certificate messages which usually contain several KB of data which is larger than standard packet size, so the message is divided between several packets)
- Returns:
bool
- property message_length
The handshake message length in bytes. Notice that sometimes the handshake message is divided between several packets, in this case this method will return the length of part of the message in the current packet
- Returns:
unsigned int
- class mtf.libs.mtf_pybinder.pcpp.SSLCertificateVerifyMessage
Represents SSL/TLS certificate-verify message (type 15). Inherits from SSLHandshakeMessage and adds parsing functionality such as retrieving signed hash data as raw data (parsing may be added in the future)
This message type wasn’t tested in unit-tests
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.SSLCertificateVerifyMessage, data: int, data_len: int, container: pcpp::SSLHandshakeLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.SSLCertificateVerifyMessage, arg0: mtf.libs.mtf_pybinder.pcpp.SSLCertificateVerifyMessage) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.SSLCertificateVerifyMessage, arg0: mtf.libs.mtf_pybinder.pcpp.SSLCertificateVerifyMessage) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.SSLCertificateVerifyMessage, : mtf.libs.mtf_pybinder.pcpp.SSLCertificateVerifyMessage) mtf.libs.mtf_pybinder.pcpp.SSLCertificateVerifyMessage
- Returns:
pcpp.SSLCertificateVerifyMessage
- static create_handshake_message(data: int, data_len: int, container: pcpp::SSLHandshakeLayer) mtf.libs.mtf_pybinder.pcpp.SSLHandshakeMessage
A factory method for creating instances of handshake messages from raw data The raw data containing 1 handshake message Raw data length in bytes A pointer to the SSLHandshakeLayer instance which will contain the created message. This parameter is required because the handshake message includes a pointer to its container
- Args:
data (bytes) data_len (unsigned int) container (pcpp.SSLHandshakeLayer)
- Returns:
pcpp.SSLHandshakeMessage
- property handshake_type
The handshake message type
- Returns:
enum pcpp.SSLHandshakeType
- is_message_complete(self: mtf.libs.mtf_pybinder.pcpp.SSLHandshakeMessage) bool
True if current packet contains the entire message or false otherwise. This method is important because sometimes handshake messages are divided in consequent packets (happens a lot in certificate messages which usually contain several KB of data which is larger than standard packet size, so the message is divided between several packets)
- Returns:
bool
- property message_length
The handshake message length in bytes. Notice that sometimes the handshake message is divided between several packets, in this case this method will return the length of part of the message in the current packet
- Returns:
unsigned int
- property signed_hash
Signed hash data as raw data (byte array). Parsing of this data may be added in the future. Notice that if this message is spread over several packets in a way none of the signed hash data exists in this packet, NULL will be returned
- property signed_hash_length
The length of signed hash data returned by getSignedHash(). Notice that if this message is spread over several packets in a way none of this data exists in the current packet, 0 will be returned. Also, if some of the data exists in the consequent packets, the length that will be returned will be the length of data exists in the current packet only (and not the total length)
- Returns:
unsigned int
- class mtf.libs.mtf_pybinder.pcpp.SSLChangeCipherSpecLayer
Represents SSL/TLS change-cipher-spec layer. This layer has no additional fields besides common fields described in SSLLayer
- __init__(self: mtf.libs.mtf_pybinder.pcpp.SSLChangeCipherSpecLayer, data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) None
- __new__(**kwargs)
- static add_ssl_port(port: int) None
Adds port to a list of ports where pcap checks for SSL/TLS communication. Each port must be removed at the end in order to have no memory leak.
- Args:
port (unsigned int): Port to add
- assign(self: mtf.libs.mtf_pybinder.pcpp.SSLChangeCipherSpecLayer, : mtf.libs.mtf_pybinder.pcpp.SSLChangeCipherSpecLayer) mtf.libs.mtf_pybinder.pcpp.SSLChangeCipherSpecLayer
- Returns:
pcpp.SSLChangeCipherSpecLayer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- static create_ssl_message(data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) mtf.libs.mtf_pybinder.pcpp.SSLLayer
A static method that creates SSL/TLS layers by raw data. This method parses the raw data, finds if and which SSL/TLS record it is and creates the corresponding record layer. It’s the responsibility of the user to free the created object when done using it A pointer to the raw data Size of the data in bytes A pointer to the previous layer A pointer to the Packet instance where layer will be stored in A pointer to the newly created record layer. If no SSL/TLS record could be identified from the raw data NULL is returned
- Args:
data (bytes) data_len (unsigned int) prev_layer (pcpp.Layer) packet (pcpp.Packet)
- Returns:
pcpp.SSLLayer
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- static is_ssl_message(*args, **kwargs)
Overloaded function.
is_ssl_message(src_port: int, dst_port: int, data: int, data_len: int) -> bool
- Args:
src_port (unsigned int) dst_port (unsigned int) data (bytes) data_len (unsigned int)
- Returns:
bool
is_ssl_message(src_port: int, dst_port: int, data: int, data_len: int, ignore_ports: bool) -> bool
A static methods that gets raw data of a layer and checks whether this data is a SSL/TLS record or not. This check is done using the source/dest port and matching of a legal record type in the raw data. The list of ports identified as SSL/TLS is hard-coded and includes the following ports: - Port 443 [HTTPS] - Port 261 [NSIIOPS] - Port 448 [DDM-SSL] - Port 563 [NNTPS] - Port 614 [SSHELL] - Port 465 [SMTPS] - Port 636 [LDAPS] - Port 989 [FTPS - data] - Port 990 [FTPS - control] - Port 992 [Telnet over TLS/SSL] - Port 993 [IMAPS] - Port 994 [IRCS] - Port 995 [POP3S] The source port of the packet that contains the raw data. Source port (or dest port) are a criteria to identify SSL/TLS packets The dest port of the packet that contains the raw data. Dest port (or source port) are a criteria to identify SSL/TLS packets The data to check Length (in bytes) of the data SSL/TLS ports are only relevant for parsing the first SSL/TLS message, but are not relevant for parsing subsequent messages. This parameter can be set to “true” to skip SSL/TLS ports check. This is an optional parameter and its default is “false”
- Args:
src_port (unsigned int) dst_port (unsigned int) data (bytes) data_len (unsigned int) ignore_ports (bool)
- Returns:
bool
- static is_ssl_port(port: int) bool
A static method that checks whether the port is considered as SSL/TLS
- Args:
port (unsigned int): The port number to be checked
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property record_type
The SSL/TLS record type as parsed from the record
- Returns:
enum pcpp.SSLRecordType
- property record_version
The SSL/TLS version used in this record (parsed from the record)
- Returns:
pcpp.SSLVersion
- static remove_all_ssl_ports() None
Removes all ports from a list of ports where pcap checks for SSL/TLS communication.
- static remove_ssl_port(port: int) None
Removes port from a list of ports where pcap checks for SSL/TLS communication.
- Args:
port (unsigned int): Port to remove
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.SSLCipherSuite
Represents a cipher-suite and enables access all information about it such as all algorithms it encapsulates, its ID (as appears in the client-hello or server-hello messages), its name (e.g “TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA”) etc. PcapPlusPlus contains static instances of this type for all known cipher-suites and enables access to them through name or ID (see getCipherSuiteByID() and getCipherSuiteByName() ). List of cipher-suite was taken from here: http://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.SSLCipherSuite, id: int, key_ex_alg: mtf.libs.mtf_pybinder.pcpp.SSLKeyExchangeAlgorithm, auth_alg: mtf.libs.mtf_pybinder.pcpp.SSLAuthenticationAlgorithm, sym_key_alg: mtf.libs.mtf_pybinder.pcpp.SSLSymetricEncryptionAlgorithm, mac_alg: mtf.libs.mtf_pybinder.pcpp.SSLHashingAlgorithm, name: str) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.SSLCipherSuite, arg0: mtf.libs.mtf_pybinder.pcpp.SSLCipherSuite) -> None
- __new__(**kwargs)
- property auth_alg
Authentication algorithm used in this cipher-suite
- Returns:
enum pcpp.SSLAuthenticationAlgorithm
- static get_cipher_suite_by_id(id: int) mtf.libs.mtf_pybinder.pcpp.SSLCipherSuite
A static method that returns a cipher-suite instance by ID Cipher-suite ID A cipher-suite instance matching this ID or NULL if ID not found
- Args:
id (unsigned int)
- Returns:
pcpp.SSLCipherSuite
- static get_cipher_suite_by_name(name: str) mtf.libs.mtf_pybinder.pcpp.SSLCipherSuite
A static method that returns a cipher-suite instance by name Cipher-suite name (e.g “TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA”) A cipher-suite instance matching this name or NULL if name not found
- Args:
name (str)
- Returns:
pcpp.SSLCipherSuite
- property id
Cipher-suite ID
- Returns:
unsigned int
- property key_exchange_alg
Key-exchange algorithm used in this cipher-suite
- Returns:
enum pcpp.SSLKeyExchangeAlgorithm
- property mac_alg
MAC algorithm used in this cipher-suite
- Returns:
enum pcpp.SSLHashingAlgorithm
- property sym_key_alg
Symmetric key algorithm used in this cipher-suite
- Returns:
enum pcpp.SSLSymetricEncryptionAlgorithm
- class mtf.libs.mtf_pybinder.pcpp.SSLClientCertificateType
SSL/TLS client certificate types
Members:
SSL_CCT_RSA_SIGN
SSL_CCT_DSS_SIGN
SSL_CCT_RSA_FIXED_DH
SSL_CCT_DSS_FIXED_DH
SSL_CCT_RSA_EPHEMERAL_DH_RESERVED
SSL_CCT_DSS_EPHEMERAL_DH_RESERVED
SSL_CCT_FORTEZZA_DMS_RESERVED
SSL_CCT_ECDSA_SIGN
SSL_CCT_RSA_FIXED_ECDH
SSL_CCT_ECDSA_FIXED_ECDH
SSL_CCT_UNKNOWN
- SSL_CCT_DSS_EPHEMERAL_DH_RESERVED
- SSL_CCT_DSS_FIXED_DH
- SSL_CCT_DSS_SIGN
- SSL_CCT_ECDSA_FIXED_ECDH
- SSL_CCT_ECDSA_SIGN
- SSL_CCT_FORTEZZA_DMS_RESERVED
- SSL_CCT_RSA_EPHEMERAL_DH_RESERVED
- SSL_CCT_RSA_FIXED_DH
- SSL_CCT_RSA_FIXED_ECDH
- SSL_CCT_RSA_SIGN
- SSL_CCT_UNKNOWN
- __init__(self: mtf.libs.mtf_pybinder.pcpp.SSLClientCertificateType, value: int) None
- __new__(**kwargs)
- property name
- property value
- class mtf.libs.mtf_pybinder.pcpp.SSLClientHelloMessage
Represents a client-hello message (type 1). Inherits from SSLHandshakeMessage and adds parsing of all fields of this message including the message extensions, cipher-suite list, etc.
- class ClientHelloTLSFingerprint
A struct that contains all the elements needed for creating a Client Hello TLS fingerprinting: TLS version, a list of Cipher Suite IDs, a list of Extensions IDs, a list of support groups and a list of EC point formats. You can read more about this in SSLClientHelloMessage#generateTLSFingerprint(). This struct contains methods to extract the TLS fingerprint itself: toString() and toMD5()
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.SSLClientHelloMessage.ClientHelloTLSFingerprint) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.SSLClientHelloMessage.ClientHelloTLSFingerprint, arg0: mtf.libs.mtf_pybinder.pcpp.SSLClientHelloMessage.ClientHelloTLSFingerprint) -> None
- __new__(**kwargs)
- property cipher_suites
- property ec_point_formats
- property extensions
- property supported_groups
- property tls_version
- to_md5(self: mtf.libs.mtf_pybinder.pcpp.SSLClientHelloMessage.ClientHelloTLSFingerprint) str
An MD5 hash of the string generated by toString()
- Returns:
str
- to_string(self: mtf.libs.mtf_pybinder.pcpp.SSLClientHelloMessage.ClientHelloTLSFingerprint) str
A string representing the TLS fingerprint, for example: 771,4866-4867-4865-255,0-11-10-35-22-23-13-43-45-51,29-23-30-25-24,0-1-2 This string has the following format: TLSVersion,CipherSuiteIDs,ExtensionIDs,SupportedGroups,ECPointFormats The extension IDs, supported groups and EC point formats are each separated by a “-“. If the message doesn’t include the “supported groups” or “EC point formats” extensions, they will be replaced by an empty string for example: 771,4866-4867-4865-255,0-11-10-35-22-23-13-43-45-51,,
- Returns:
str
- to_string_and_md5(self: mtf.libs.mtf_pybinder.pcpp.SSLClientHelloMessage.ClientHelloTLSFingerprint) tuple[str, str]
A pair of the string and MD5 hash (string is first, MD5 is second). If you want both this method is more efficient than calling toString() and toMD5() separately
- Returns:
str
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.SSLClientHelloMessage, data: int, data_len: int, container: pcpp::SSLHandshakeLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.SSLClientHelloMessage, arg0: mtf.libs.mtf_pybinder.pcpp.SSLClientHelloMessage) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.SSLClientHelloMessage, arg0: mtf.libs.mtf_pybinder.pcpp.SSLClientHelloMessage) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.SSLHandshakeMessage, : mtf.libs.mtf_pybinder.pcpp.SSLHandshakeMessage) mtf.libs.mtf_pybinder.pcpp.SSLHandshakeMessage
- Returns:
pcpp.SSLHandshakeMessage
- property cipher_suite_count
The number of cipher-suites included in this message
- Returns:
int
- property compression_methods_value
The value of the compression method byte
- Returns:
unsigned int
- static create_handshake_message(data: int, data_len: int, container: pcpp::SSLHandshakeLayer) mtf.libs.mtf_pybinder.pcpp.SSLHandshakeMessage
A factory method for creating instances of handshake messages from raw data The raw data containing 1 handshake message Raw data length in bytes A pointer to the SSLHandshakeLayer instance which will contain the created message. This parameter is required because the handshake message includes a pointer to its container
- Args:
data (bytes) data_len (unsigned int) container (pcpp.SSLHandshakeLayer)
- Returns:
pcpp.SSLHandshakeMessage
- property extension_count
The number of extensions in this message
- Returns:
int
- property extensions_length
The size (in bytes) of all extensions data in this message. Extracted from the “extensions length” field
- Returns:
unsigned int
- generate_tls_fingerprint(self: mtf.libs.mtf_pybinder.pcpp.SSLClientHelloMessage) pcpp::SSLClientHelloMessage::ClientHelloTLSFingerprint
TLS fingerprinting is a way to identify client applications using the details in the TLS Client Hello packet. It was initially introduced by Lee Brotherston in his 2015 research: <https://blog.squarelemon.com/tls-fingerprinting/> This implementation of TLS fingerprint is a C++ version of Salesforce’s JA3 open source project (originally written in Python and Zeek): <https://engineering.salesforce.com/tls-fingerprinting-with-ja3-and-ja3s-247362855967> A SSLClientHelloMessage#ClientHelloTLSFingerprint struct that contains all the elements needed for creating a TLS fingerprint out of this Client Hello message. This struct has also methods to extract the TLS fingerprint itself in a string or MD5 formats
- Returns:
pcpp.SSLClientHelloMessage.ClientHelloTLSFingerprint
- get_cipher_suite(self: mtf.libs.mtf_pybinder.pcpp.SSLClientHelloMessage, index: int) mtf.libs.mtf_pybinder.pcpp.SSLCipherSuite
Get a pointer to a cipher-suite by index. The cipher-suites are numbered according to their order of appearance in the message. If index is out of bounds (less than 0 or larger than total amount of cipher suites) NULL will be returned. NULL will also be returned if the cipher-suite ID is unknown. If you still want to get the cipher-suite ID you can use getCipherSuiteID() The index of the cipher-suite to return The pointer to the cipher-suite object or NULL if index is out of bounds
- Args:
index (int)
- Returns:
pcpp.SSLCipherSuite
- get_cipher_suite_id(self: mtf.libs.mtf_pybinder.pcpp.SSLClientHelloMessage, index: int) int
Get the cipher-suite ID by index. This method just parses the ID from the client-hello message and returns it. To get more information on the cipher-suite you can use the getCipherSuite() method The index of the cipher-suite to return Set to “true” if parsing succeeded and the return value is valid or “false” if: (1) the index is out-of-bounds (less than 0 or larger than total amount of cipher suites) or (2) the parsing failed. If the value is “false” the return value can be ignored The cipher-suite ID if “isValid” is set to “true”. If “isValid” is set to “false” the return value can be ignored
- Args:
index (int)
- get_extension(self: mtf.libs.mtf_pybinder.pcpp.SSLClientHelloMessage, index: int) mtf.libs.mtf_pybinder.pcpp.SSLExtension
Get a pointer to an extension by index. The extensions are numbered according to their order of appearance in the message. If index is out of bounds (less than 0 or larger than total amount of extensions) NULL will be returned The index of the extension to return The pointer to the extension or NULL if index is out of bounds
- Args:
index (int)
- Returns:
pcpp.SSLExtension
- get_extension_of_type(*args, **kwargs)
Overloaded function.
get_extension_of_type(self: mtf.libs.mtf_pybinder.pcpp.SSLClientHelloMessage, type: int) -> mtf.libs.mtf_pybinder.pcpp.SSLExtension
Get a pointer to an extension by numeric type field. Every extension has a 2-byte numeric value representing its type (for example: renegotiation info extension type is 0x1ff). This method gets the type and returns a pointer to the extension object The 2-byte numeric type of the extension A pointer to the extension object of NULL if this type doesn’t exist in this message
- Args:
type (unsigned int)
- Returns:
pcpp.SSLExtension
get_extension_of_type(self: mtf.libs.mtf_pybinder.pcpp.SSLClientHelloMessage, type: mtf.libs.mtf_pybinder.pcpp.SSLExtensionType) -> mtf.libs.mtf_pybinder.pcpp.SSLExtension
Get a pointer to an extension by its enum type The type of extension to return A pointer to the extension object or NULL if this type doesn’t exist in this message
- Args:
type (enum pcpp.SSLExtensionType)
- Returns:
pcpp.SSLExtension
- property handshake_type
The handshake message type
- Returns:
enum pcpp.SSLHandshakeType
- property handshake_version
Handshake SSL/TLS version (notice it may be different than SSLLayer#getRecordVersion(). Each client-hello or server-hello message has both record version and handshake version and they may differ from one another)
- Returns:
pcpp.SSLVersion
- is_message_complete(self: mtf.libs.mtf_pybinder.pcpp.SSLHandshakeMessage) bool
True if current packet contains the entire message or false otherwise. This method is important because sometimes handshake messages are divided in consequent packets (happens a lot in certificate messages which usually contain several KB of data which is larger than standard packet size, so the message is divided between several packets)
- Returns:
bool
- property message_length
The handshake message length in bytes. Notice that sometimes the handshake message is divided between several packets, in this case this method will return the length of part of the message in the current packet
- Returns:
unsigned int
- property random
Handshake random number
- property session_id
Session ID as byte array. If server-hello message doesn’t include session ID NULL will be returned
- property session_id_length
Session ID length in bytes. If server-hello message doesn’t include session ID 0 will be returned
- Returns:
unsigned int
- class mtf.libs.mtf_pybinder.pcpp.SSLClientKeyExchangeMessage
Represents SSL/TLS client-key-exchange message (type 16). Inherits from SSLHandshakeMessage and adds parsing functionality such as getting the server key exchange params as raw data (parsing of this may be added in the future)
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.SSLClientKeyExchangeMessage, data: int, data_len: int, container: pcpp::SSLHandshakeLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.SSLClientKeyExchangeMessage, arg0: mtf.libs.mtf_pybinder.pcpp.SSLClientKeyExchangeMessage) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.SSLClientKeyExchangeMessage, arg0: mtf.libs.mtf_pybinder.pcpp.SSLClientKeyExchangeMessage) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.SSLClientKeyExchangeMessage, : mtf.libs.mtf_pybinder.pcpp.SSLClientKeyExchangeMessage) mtf.libs.mtf_pybinder.pcpp.SSLClientKeyExchangeMessage
- Returns:
pcpp.SSLClientKeyExchangeMessage
- property client_key_exchange_params
Raw data of the client key exchange params. Currently this data can only be returned as raw, parsing may be added in the future. Notice that if the message is spread over more than 1 packet in a way params doesn’t exist in the first packet, NULL will be returned
- property client_key_exchange_params_length
The size of the params field. Notice that if the message is spread over more than 1 packet in a way the ssl_tls_handshake_layer cannot be parsed from the packet, 0 will be returned. Also, if only part of the params exist in current packet (and the rest are on consequent packets), the size that will be returned is the size of the part that exists in the current packet (and not the total size of params)
- Returns:
unsigned int
- static create_handshake_message(data: int, data_len: int, container: pcpp::SSLHandshakeLayer) mtf.libs.mtf_pybinder.pcpp.SSLHandshakeMessage
A factory method for creating instances of handshake messages from raw data The raw data containing 1 handshake message Raw data length in bytes A pointer to the SSLHandshakeLayer instance which will contain the created message. This parameter is required because the handshake message includes a pointer to its container
- Args:
data (bytes) data_len (unsigned int) container (pcpp.SSLHandshakeLayer)
- Returns:
pcpp.SSLHandshakeMessage
- property handshake_type
The handshake message type
- Returns:
enum pcpp.SSLHandshakeType
- is_message_complete(self: mtf.libs.mtf_pybinder.pcpp.SSLHandshakeMessage) bool
True if current packet contains the entire message or false otherwise. This method is important because sometimes handshake messages are divided in consequent packets (happens a lot in certificate messages which usually contain several KB of data which is larger than standard packet size, so the message is divided between several packets)
- Returns:
bool
- property message_length
The handshake message length in bytes. Notice that sometimes the handshake message is divided between several packets, in this case this method will return the length of part of the message in the current packet
- Returns:
unsigned int
- class mtf.libs.mtf_pybinder.pcpp.SSLExtension
Represents a SSL/TLS extension. This is a base class that can represent any type of extension. Inherited classes may contain parsing logic for specific extensions. This class provides capabilities such as getting the extension type, length and viewing the extension data as raw (byte array)
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.SSLExtension, data: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.SSLExtension, arg0: mtf.libs.mtf_pybinder.pcpp.SSLExtension) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.SSLExtension, : mtf.libs.mtf_pybinder.pcpp.SSLExtension) mtf.libs.mtf_pybinder.pcpp.SSLExtension
- Returns:
pcpp.SSLExtension
- property data
Raw data of the extension
- property length
The length of the extension data in bytes (not including the type and length fields)
- Returns:
unsigned int
- property total_length
The total length of the extension, including type and length fields and the extension data field
- Returns:
unsigned int
- property type
The type of the extension as enum
- Returns:
enum pcpp.SSLExtensionType
- property type_as_int
The type of the extension as a numeric value
- Returns:
unsigned int
- class mtf.libs.mtf_pybinder.pcpp.SSLExtensionType
SSL/TLS extension types
Members:
SSL_EXT_SERVER_NAME
SSL_EXT_MAX_FRAGMENT_LENGTH
SSL_EXT_CLIENT_CERTIFICATE_URL
SSL_EXT_TRUSTED_CA_KEYS
SSL_EXT_TRUNCATED_HMAC
SSL_EXT_STATUS_REQUEST
SSL_EXT_USER_MAPPING
SSL_EXT_CLIENT_AUTHZ
SSL_EXT_SERVER_AUTHZ
SSL_EXT_CERT_TYPE
SSL_EXT_SUPPORTED_GROUPS
SSL_EXT_EC_POINT_FORMATS
SSL_EXT_SRP
SSL_EXT_SIGNATURE_ALGORITHMS
SSL_EXT_USE_SRTP
SSL_EXT_HEARTBEAT
SSL_EXT_APPLICATION_LAYER_PROTOCOL_NEGOTIATION
SSL_EXT_STATUS_REQUEST_V2
SSL_EXT_SIGNED_CERTIFICATE_TIMESTAMP
SSL_EXT_CLIENT_CERTIFICATE_TYPE
SSL_EXT_SERVER_CERTIFICATE_TYPE
SSL_EXT_PADDING
SSL_EXT_ENCRYPT_THEN_MAC
SSL_EXT_EXTENDED_MASTER_SECRET
SSL_EXT_TOKEN_BINDING
SSL_EXT_SESSIONTICKET_TLS
SSL_EXT_RESERVED_KEY_SHARE
SSL_EXT_PRE_SHARED_KEY
SSL_EXT_EARLY_DATA
SSL_EXT_SUPPORTED_VERSIONS
SSL_EXT_COOKIE
SSL_EXT_PSK_KEY_EXCHANGE_MODES
SSL_EXT_CERTIFICATE_AUTHORITIES
SSL_EXT_OLD_FILTERS
SSL_EXT_POST_HANDSHAKE_AUTH
SSL_EXT_SIGNATURE_ALGORITHM_CERT
SSL_EXT_KEY_SHARE
SSL_EXT_RENEGOTIATION_INFO
SSL_EXT_Unknown
- SSL_EXT_APPLICATION_LAYER_PROTOCOL_NEGOTIATION
- SSL_EXT_CERTIFICATE_AUTHORITIES
- SSL_EXT_CERT_TYPE
- SSL_EXT_CLIENT_AUTHZ
- SSL_EXT_CLIENT_CERTIFICATE_TYPE
- SSL_EXT_CLIENT_CERTIFICATE_URL
- SSL_EXT_COOKIE
- SSL_EXT_EARLY_DATA
- SSL_EXT_EC_POINT_FORMATS
- SSL_EXT_ENCRYPT_THEN_MAC
- SSL_EXT_EXTENDED_MASTER_SECRET
- SSL_EXT_HEARTBEAT
- SSL_EXT_KEY_SHARE
- SSL_EXT_MAX_FRAGMENT_LENGTH
- SSL_EXT_OLD_FILTERS
- SSL_EXT_PADDING
- SSL_EXT_POST_HANDSHAKE_AUTH
- SSL_EXT_PRE_SHARED_KEY
- SSL_EXT_PSK_KEY_EXCHANGE_MODES
- SSL_EXT_RENEGOTIATION_INFO
- SSL_EXT_RESERVED_KEY_SHARE
- SSL_EXT_SERVER_AUTHZ
- SSL_EXT_SERVER_CERTIFICATE_TYPE
- SSL_EXT_SERVER_NAME
- SSL_EXT_SESSIONTICKET_TLS
- SSL_EXT_SIGNATURE_ALGORITHMS
- SSL_EXT_SIGNATURE_ALGORITHM_CERT
- SSL_EXT_SIGNED_CERTIFICATE_TIMESTAMP
- SSL_EXT_SRP
- SSL_EXT_STATUS_REQUEST
- SSL_EXT_STATUS_REQUEST_V2
- SSL_EXT_SUPPORTED_GROUPS
- SSL_EXT_SUPPORTED_VERSIONS
- SSL_EXT_TOKEN_BINDING
- SSL_EXT_TRUNCATED_HMAC
- SSL_EXT_TRUSTED_CA_KEYS
- SSL_EXT_USER_MAPPING
- SSL_EXT_USE_SRTP
- SSL_EXT_Unknown
- __init__(self: mtf.libs.mtf_pybinder.pcpp.SSLExtensionType, value: int) None
- __new__(**kwargs)
- property name
- property value
- class mtf.libs.mtf_pybinder.pcpp.SSLFinishedMessage
Represents SSL/TLS finished message (type 20). Inherits from SSLHandshakeMessage and adds parsing functionality such as retrieving signed hash data as raw data (parsing may be added in the future)
This message type wasn’t tested in unit-tests
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.SSLFinishedMessage, data: int, data_len: int, container: pcpp::SSLHandshakeLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.SSLFinishedMessage, arg0: mtf.libs.mtf_pybinder.pcpp.SSLFinishedMessage) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.SSLFinishedMessage, arg0: mtf.libs.mtf_pybinder.pcpp.SSLFinishedMessage) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.SSLFinishedMessage, : mtf.libs.mtf_pybinder.pcpp.SSLFinishedMessage) mtf.libs.mtf_pybinder.pcpp.SSLFinishedMessage
- Returns:
pcpp.SSLFinishedMessage
- static create_handshake_message(data: int, data_len: int, container: pcpp::SSLHandshakeLayer) mtf.libs.mtf_pybinder.pcpp.SSLHandshakeMessage
A factory method for creating instances of handshake messages from raw data The raw data containing 1 handshake message Raw data length in bytes A pointer to the SSLHandshakeLayer instance which will contain the created message. This parameter is required because the handshake message includes a pointer to its container
- Args:
data (bytes) data_len (unsigned int) container (pcpp.SSLHandshakeLayer)
- Returns:
pcpp.SSLHandshakeMessage
- property handshake_type
The handshake message type
- Returns:
enum pcpp.SSLHandshakeType
- is_message_complete(self: mtf.libs.mtf_pybinder.pcpp.SSLHandshakeMessage) bool
True if current packet contains the entire message or false otherwise. This method is important because sometimes handshake messages are divided in consequent packets (happens a lot in certificate messages which usually contain several KB of data which is larger than standard packet size, so the message is divided between several packets)
- Returns:
bool
- property message_length
The handshake message length in bytes. Notice that sometimes the handshake message is divided between several packets, in this case this method will return the length of part of the message in the current packet
- Returns:
unsigned int
- property signed_hash
Signed hash data as raw data (byte array). Parsing of this data may be added in the future. Notice that if this message is spread over several packets in a way none of the signed hash data exists in this packet, NULL will be returned
- property signed_hash_length
The length of signed hash data returned by getSignedHash(). Notice that if the message is spread over several packets in a way none of this data exists in the current packet, 0 will be returned. Also, if some of the data exists in the consequent packets, the length that will be returned will be the length of data exists in the current packet only (and not the total length)
- Returns:
unsigned int
- class mtf.libs.mtf_pybinder.pcpp.SSLHandshakeLayer
Represents SSL/TLS handshake layer. This layer may contain one or more handshake messages (all of them inherit from the base class SSLHandshakeMessage) which are the SSL/TLS handshake message sent between a client and a server until they establish a secure connection (e.g client-hello, server-hello, certificate, client-key-exchange, server-key-exchange, etc.). Usually this layer will contain just one message (as the first example below demonstrates). But there are cases a layer may contain more than 1 message. To better explain this layer structure we’ll use 2 examples. The first will be client-hello message. The layer structure will look like this:
Second example is a multiple-message handshake layer comprises of server-hello, certificate and server-key-exchange messages:
- __init__(self: mtf.libs.mtf_pybinder.pcpp.SSLHandshakeLayer, data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) None
- __new__(**kwargs)
- static add_ssl_port(port: int) None
Adds port to a list of ports where pcap checks for SSL/TLS communication. Each port must be removed at the end in order to have no memory leak.
- Args:
port (unsigned int): Port to add
- assign(self: mtf.libs.mtf_pybinder.pcpp.SSLLayer, : mtf.libs.mtf_pybinder.pcpp.SSLLayer) mtf.libs.mtf_pybinder.pcpp.SSLLayer
- Returns:
pcpp.SSLLayer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- static create_ssl_message(data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) mtf.libs.mtf_pybinder.pcpp.SSLLayer
A static method that creates SSL/TLS layers by raw data. This method parses the raw data, finds if and which SSL/TLS record it is and creates the corresponding record layer. It’s the responsibility of the user to free the created object when done using it A pointer to the raw data Size of the data in bytes A pointer to the previous layer A pointer to the Packet instance where layer will be stored in A pointer to the newly created record layer. If no SSL/TLS record could be identified from the raw data NULL is returned
- Args:
data (bytes) data_len (unsigned int) prev_layer (pcpp.Layer) packet (pcpp.Packet)
- Returns:
pcpp.SSLLayer
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_handshake_message_at(self: mtf.libs.mtf_pybinder.pcpp.SSLHandshakeLayer, index: int) mtf.libs.mtf_pybinder.pcpp.SSLHandshakeMessage
Get a pointer to an handshake message by index. The message are numbered according to their order of appearance in the layer. If index is out of bounds (less than 0 or larger than total amount of message) NULL will be returned The index of the message to return The pointer to the message object or NULL if index is out of bounds
- Args:
index (int)
- Returns:
pcpp.SSLHandshakeMessage
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property handshake_messages_count
The number of messages in this layer instance
- Returns:
unsigned int
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- static is_ssl_message(*args, **kwargs)
Overloaded function.
is_ssl_message(src_port: int, dst_port: int, data: int, data_len: int) -> bool
- Args:
src_port (unsigned int) dst_port (unsigned int) data (bytes) data_len (unsigned int)
- Returns:
bool
is_ssl_message(src_port: int, dst_port: int, data: int, data_len: int, ignore_ports: bool) -> bool
A static methods that gets raw data of a layer and checks whether this data is a SSL/TLS record or not. This check is done using the source/dest port and matching of a legal record type in the raw data. The list of ports identified as SSL/TLS is hard-coded and includes the following ports: - Port 443 [HTTPS] - Port 261 [NSIIOPS] - Port 448 [DDM-SSL] - Port 563 [NNTPS] - Port 614 [SSHELL] - Port 465 [SMTPS] - Port 636 [LDAPS] - Port 989 [FTPS - data] - Port 990 [FTPS - control] - Port 992 [Telnet over TLS/SSL] - Port 993 [IMAPS] - Port 994 [IRCS] - Port 995 [POP3S] The source port of the packet that contains the raw data. Source port (or dest port) are a criteria to identify SSL/TLS packets The dest port of the packet that contains the raw data. Dest port (or source port) are a criteria to identify SSL/TLS packets The data to check Length (in bytes) of the data SSL/TLS ports are only relevant for parsing the first SSL/TLS message, but are not relevant for parsing subsequent messages. This parameter can be set to “true” to skip SSL/TLS ports check. This is an optional parameter and its default is “false”
- Args:
src_port (unsigned int) dst_port (unsigned int) data (bytes) data_len (unsigned int) ignore_ports (bool)
- Returns:
bool
- static is_ssl_port(port: int) bool
A static method that checks whether the port is considered as SSL/TLS
- Args:
port (unsigned int): The port number to be checked
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property record_type
The SSL/TLS record type as parsed from the record
- Returns:
enum pcpp.SSLRecordType
- property record_version
The SSL/TLS version used in this record (parsed from the record)
- Returns:
pcpp.SSLVersion
- static remove_all_ssl_ports() None
Removes all ports from a list of ports where pcap checks for SSL/TLS communication.
- static remove_ssl_port(port: int) None
Removes port from a list of ports where pcap checks for SSL/TLS communication.
- Args:
port (unsigned int): Port to remove
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.SSLHandshakeMessage
A base class for SSL/TLS handshake messages. This is an abstract class and cannot be instantiated. SSL/TLS handshake messages are contained in SSLHandshakeLayer, meaning a SSLHandshakeLayer instance can contain one or more SSLHandshakeMessage instances. For example: one SSLHandshakeLayer may contain a server-hello, certificate, server-key-exchange, and server-hello-done messages (although it’s not such a common case, most handshake layers contain 1 handshake message only)
- __init__(self: mtf.libs.mtf_pybinder.pcpp.SSLHandshakeMessage, arg0: mtf.libs.mtf_pybinder.pcpp.SSLHandshakeMessage) None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.SSLHandshakeMessage, : mtf.libs.mtf_pybinder.pcpp.SSLHandshakeMessage) mtf.libs.mtf_pybinder.pcpp.SSLHandshakeMessage
- Returns:
pcpp.SSLHandshakeMessage
- static create_handshake_message(data: int, data_len: int, container: pcpp::SSLHandshakeLayer) mtf.libs.mtf_pybinder.pcpp.SSLHandshakeMessage
A factory method for creating instances of handshake messages from raw data The raw data containing 1 handshake message Raw data length in bytes A pointer to the SSLHandshakeLayer instance which will contain the created message. This parameter is required because the handshake message includes a pointer to its container
- Args:
data (bytes) data_len (unsigned int) container (pcpp.SSLHandshakeLayer)
- Returns:
pcpp.SSLHandshakeMessage
- property handshake_type
The handshake message type
- Returns:
enum pcpp.SSLHandshakeType
- is_message_complete(self: mtf.libs.mtf_pybinder.pcpp.SSLHandshakeMessage) bool
True if current packet contains the entire message or false otherwise. This method is important because sometimes handshake messages are divided in consequent packets (happens a lot in certificate messages which usually contain several KB of data which is larger than standard packet size, so the message is divided between several packets)
- Returns:
bool
- property message_length
The handshake message length in bytes. Notice that sometimes the handshake message is divided between several packets, in this case this method will return the length of part of the message in the current packet
- Returns:
unsigned int
- class mtf.libs.mtf_pybinder.pcpp.SSLHandshakeType
SSL/TLS handshake message types
Members:
SSL_HELLO_REQUEST
SSL_CLIENT_HELLO
SSL_SERVER_HELLO
SSL_HELLO_VERIFY_REQUEST
SSL_NEW_SESSION_TICKET
SSL_END_OF_EARLY_DATE
SSL_ENCRYPTED_EXTENSIONS
SSL_REQUEST_CONNECTION_ID
SSL_NEW_CONNECTION_ID
SSL_CERTIFICATE
SSL_SERVER_KEY_EXCHANGE
SSL_CERTIFICATE_REQUEST
SSL_SERVER_DONE
SSL_CERTIFICATE_VERIFY
SSL_CLIENT_KEY_EXCHANGE
SSL_FINISHED
SSL_KEY_UPDATE
SSL_HANDSHAKE_UNKNOWN
- SSL_CERTIFICATE
- SSL_CERTIFICATE_REQUEST
- SSL_CERTIFICATE_VERIFY
- SSL_CLIENT_HELLO
- SSL_CLIENT_KEY_EXCHANGE
- SSL_ENCRYPTED_EXTENSIONS
- SSL_END_OF_EARLY_DATE
- SSL_FINISHED
- SSL_HANDSHAKE_UNKNOWN
- SSL_HELLO_REQUEST
- SSL_HELLO_VERIFY_REQUEST
- SSL_KEY_UPDATE
- SSL_NEW_CONNECTION_ID
- SSL_NEW_SESSION_TICKET
- SSL_REQUEST_CONNECTION_ID
- SSL_SERVER_DONE
- SSL_SERVER_HELLO
- SSL_SERVER_KEY_EXCHANGE
- __init__(self: mtf.libs.mtf_pybinder.pcpp.SSLHandshakeType, value: int) None
- __new__(**kwargs)
- property name
- property value
- class mtf.libs.mtf_pybinder.pcpp.SSLHashingAlgorithm
SSL/TLS hashing algorithms
Members:
SSL_HASH_NULL
SSL_HASH_MD5
SSL_HASH_SHA
SSL_HASH_SHA256
SSL_HASH_GOST28147
SSL_HASH_GOSTR3411
SSL_HASH_SHA384
SSL_HASH_CCM
SSL_HASH_CCM_8
SSL_HASH_Unknown
- SSL_HASH_CCM
- SSL_HASH_CCM_8
- SSL_HASH_GOST28147
- SSL_HASH_GOSTR3411
- SSL_HASH_MD5
- SSL_HASH_NULL
- SSL_HASH_SHA
- SSL_HASH_SHA256
- SSL_HASH_SHA384
- SSL_HASH_Unknown
- __init__(self: mtf.libs.mtf_pybinder.pcpp.SSLHashingAlgorithm, value: int) None
- __new__(**kwargs)
- property name
- property value
- class mtf.libs.mtf_pybinder.pcpp.SSLHelloRequestMessage
Represents SSL/TLS hello-request message (type 0). This message has no additional payload except for the common payload described in SSLHandshakeMessage
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.SSLHelloRequestMessage, data: int, data_len: int, container: pcpp::SSLHandshakeLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.SSLHelloRequestMessage, arg0: mtf.libs.mtf_pybinder.pcpp.SSLHelloRequestMessage) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.SSLHelloRequestMessage, arg0: mtf.libs.mtf_pybinder.pcpp.SSLHelloRequestMessage) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.SSLHelloRequestMessage, : mtf.libs.mtf_pybinder.pcpp.SSLHelloRequestMessage) mtf.libs.mtf_pybinder.pcpp.SSLHelloRequestMessage
- Returns:
pcpp.SSLHelloRequestMessage
- static create_handshake_message(data: int, data_len: int, container: pcpp::SSLHandshakeLayer) mtf.libs.mtf_pybinder.pcpp.SSLHandshakeMessage
A factory method for creating instances of handshake messages from raw data The raw data containing 1 handshake message Raw data length in bytes A pointer to the SSLHandshakeLayer instance which will contain the created message. This parameter is required because the handshake message includes a pointer to its container
- Args:
data (bytes) data_len (unsigned int) container (pcpp.SSLHandshakeLayer)
- Returns:
pcpp.SSLHandshakeMessage
- property handshake_type
The handshake message type
- Returns:
enum pcpp.SSLHandshakeType
- is_message_complete(self: mtf.libs.mtf_pybinder.pcpp.SSLHandshakeMessage) bool
True if current packet contains the entire message or false otherwise. This method is important because sometimes handshake messages are divided in consequent packets (happens a lot in certificate messages which usually contain several KB of data which is larger than standard packet size, so the message is divided between several packets)
- Returns:
bool
- property message_length
The handshake message length in bytes. Notice that sometimes the handshake message is divided between several packets, in this case this method will return the length of part of the message in the current packet
- Returns:
unsigned int
- class mtf.libs.mtf_pybinder.pcpp.SSLKeyExchangeAlgorithm
SSL/TLS key exchange algorithms
Members:
SSL_KEYX_NULL
SSL_KEYX_RSA
SSL_KEYX_DH
SSL_KEYX_DHE
SSL_KEYX_ECDH
SSL_KEYX_ECDHE
SSL_KEYX_FORTEZZA
SSL_KEYX_KRB5
SSL_KEYX_PSK
SSL_KEYX_GOST
SSL_KEYX_SRP
SSL_KEYX_PCT
SSL_KEYX_Unknown
- SSL_KEYX_DH
- SSL_KEYX_DHE
- SSL_KEYX_ECDH
- SSL_KEYX_ECDHE
- SSL_KEYX_FORTEZZA
- SSL_KEYX_GOST
- SSL_KEYX_KRB5
- SSL_KEYX_NULL
- SSL_KEYX_PCT
- SSL_KEYX_PSK
- SSL_KEYX_RSA
- SSL_KEYX_SRP
- SSL_KEYX_Unknown
- __init__(self: mtf.libs.mtf_pybinder.pcpp.SSLKeyExchangeAlgorithm, value: int) None
- __new__(**kwargs)
- property name
- property value
- class mtf.libs.mtf_pybinder.pcpp.SSLLayer
The base class for the 4 record type classes. Each record type is represented as a layer. See SSLLayer.h for detailed explanation of the TLS/SSL protocol support in PcapPlusPlus. This class provides the common functionality used by all record types and also contains static methods for identifying an creating SSL/TLS record type layers
- __init__(self: mtf.libs.mtf_pybinder.pcpp.SSLLayer, arg0: mtf.libs.mtf_pybinder.pcpp.SSLLayer) None
- __new__(**kwargs)
- static add_ssl_port(port: int) None
Adds port to a list of ports where pcap checks for SSL/TLS communication. Each port must be removed at the end in order to have no memory leak.
- Args:
port (unsigned int): Port to add
- assign(self: mtf.libs.mtf_pybinder.pcpp.SSLLayer, : mtf.libs.mtf_pybinder.pcpp.SSLLayer) mtf.libs.mtf_pybinder.pcpp.SSLLayer
- Returns:
pcpp.SSLLayer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- static create_ssl_message(data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) mtf.libs.mtf_pybinder.pcpp.SSLLayer
A static method that creates SSL/TLS layers by raw data. This method parses the raw data, finds if and which SSL/TLS record it is and creates the corresponding record layer. It’s the responsibility of the user to free the created object when done using it A pointer to the raw data Size of the data in bytes A pointer to the previous layer A pointer to the Packet instance where layer will be stored in A pointer to the newly created record layer. If no SSL/TLS record could be identified from the raw data NULL is returned
- Args:
data (bytes) data_len (unsigned int) prev_layer (pcpp.Layer) packet (pcpp.Packet)
- Returns:
pcpp.SSLLayer
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- static is_ssl_message(*args, **kwargs)
Overloaded function.
is_ssl_message(src_port: int, dst_port: int, data: int, data_len: int) -> bool
- Args:
src_port (unsigned int) dst_port (unsigned int) data (bytes) data_len (unsigned int)
- Returns:
bool
is_ssl_message(src_port: int, dst_port: int, data: int, data_len: int, ignore_ports: bool) -> bool
A static methods that gets raw data of a layer and checks whether this data is a SSL/TLS record or not. This check is done using the source/dest port and matching of a legal record type in the raw data. The list of ports identified as SSL/TLS is hard-coded and includes the following ports: - Port 443 [HTTPS] - Port 261 [NSIIOPS] - Port 448 [DDM-SSL] - Port 563 [NNTPS] - Port 614 [SSHELL] - Port 465 [SMTPS] - Port 636 [LDAPS] - Port 989 [FTPS - data] - Port 990 [FTPS - control] - Port 992 [Telnet over TLS/SSL] - Port 993 [IMAPS] - Port 994 [IRCS] - Port 995 [POP3S] The source port of the packet that contains the raw data. Source port (or dest port) are a criteria to identify SSL/TLS packets The dest port of the packet that contains the raw data. Dest port (or source port) are a criteria to identify SSL/TLS packets The data to check Length (in bytes) of the data SSL/TLS ports are only relevant for parsing the first SSL/TLS message, but are not relevant for parsing subsequent messages. This parameter can be set to “true” to skip SSL/TLS ports check. This is an optional parameter and its default is “false”
- Args:
src_port (unsigned int) dst_port (unsigned int) data (bytes) data_len (unsigned int) ignore_ports (bool)
- Returns:
bool
- static is_ssl_port(port: int) bool
A static method that checks whether the port is considered as SSL/TLS
- Args:
port (unsigned int): The port number to be checked
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property record_type
The SSL/TLS record type as parsed from the record
- Returns:
enum pcpp.SSLRecordType
- property record_version
The SSL/TLS version used in this record (parsed from the record)
- Returns:
pcpp.SSLVersion
- static remove_all_ssl_ports() None
Removes all ports from a list of ports where pcap checks for SSL/TLS communication.
- static remove_ssl_port(port: int) None
Removes port from a list of ports where pcap checks for SSL/TLS communication.
- Args:
port (unsigned int): Port to remove
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.SSLNewSessionTicketMessage
Represents SSL/TLS new-session-ticket message (type 4). Inherits from SSLHandshakeMessage and adds parsing functionality such as retrieving session ticket data as raw data (parsing may be added in the future)
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.SSLNewSessionTicketMessage, data: int, data_len: int, container: pcpp::SSLHandshakeLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.SSLNewSessionTicketMessage, arg0: mtf.libs.mtf_pybinder.pcpp.SSLNewSessionTicketMessage) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.SSLNewSessionTicketMessage, arg0: mtf.libs.mtf_pybinder.pcpp.SSLNewSessionTicketMessage) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.SSLNewSessionTicketMessage, : mtf.libs.mtf_pybinder.pcpp.SSLNewSessionTicketMessage) mtf.libs.mtf_pybinder.pcpp.SSLNewSessionTicketMessage
- Returns:
pcpp.SSLNewSessionTicketMessage
- static create_handshake_message(data: int, data_len: int, container: pcpp::SSLHandshakeLayer) mtf.libs.mtf_pybinder.pcpp.SSLHandshakeMessage
A factory method for creating instances of handshake messages from raw data The raw data containing 1 handshake message Raw data length in bytes A pointer to the SSLHandshakeLayer instance which will contain the created message. This parameter is required because the handshake message includes a pointer to its container
- Args:
data (bytes) data_len (unsigned int) container (pcpp.SSLHandshakeLayer)
- Returns:
pcpp.SSLHandshakeMessage
- property handshake_type
The handshake message type
- Returns:
enum pcpp.SSLHandshakeType
- is_message_complete(self: mtf.libs.mtf_pybinder.pcpp.SSLHandshakeMessage) bool
True if current packet contains the entire message or false otherwise. This method is important because sometimes handshake messages are divided in consequent packets (happens a lot in certificate messages which usually contain several KB of data which is larger than standard packet size, so the message is divided between several packets)
- Returns:
bool
- property message_length
The handshake message length in bytes. Notice that sometimes the handshake message is divided between several packets, in this case this method will return the length of part of the message in the current packet
- Returns:
unsigned int
- property session_ticket_data
Session ticket data as raw data (byte array). Parsing of this data may be added in the future. Notice that if this message is spread over several packets in a way none of the signed hash data exists in current packet, NULL will be returned
- property session_ticket_data_length
The length of session ticket data returned by getSessionTicketData(). Notice that if this message is spread over several packets in a way none of this data exists in the current packet, 0 will be returned. Also, if some of the data exist in the consequent packets, the length that will be returned will be the length of the data existing in the current packet only (and not the total length)
- Returns:
unsigned int
- class mtf.libs.mtf_pybinder.pcpp.SSLRecordType
SSL/TLS message types
Members:
SSL_CHANGE_CIPHER_SPEC
SSL_ALERT
SSL_HANDSHAKE
SSL_APPLICATION_DATA
- SSL_ALERT
- SSL_APPLICATION_DATA
- SSL_CHANGE_CIPHER_SPEC
- SSL_HANDSHAKE
- __init__(self: mtf.libs.mtf_pybinder.pcpp.SSLRecordType, value: int) None
- __new__(**kwargs)
- property name
- property value
- class mtf.libs.mtf_pybinder.pcpp.SSLServerHelloDoneMessage
Represents SSL/TLS server-hello-done message (type 14). This message has no additional payload except for the common payload described in SSLHandshakeMessage
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.SSLServerHelloDoneMessage, data: int, data_len: int, container: pcpp::SSLHandshakeLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.SSLServerHelloDoneMessage, arg0: mtf.libs.mtf_pybinder.pcpp.SSLServerHelloDoneMessage) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.SSLServerHelloDoneMessage, arg0: mtf.libs.mtf_pybinder.pcpp.SSLServerHelloDoneMessage) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.SSLServerHelloDoneMessage, : mtf.libs.mtf_pybinder.pcpp.SSLServerHelloDoneMessage) mtf.libs.mtf_pybinder.pcpp.SSLServerHelloDoneMessage
- Returns:
pcpp.SSLServerHelloDoneMessage
- static create_handshake_message(data: int, data_len: int, container: pcpp::SSLHandshakeLayer) mtf.libs.mtf_pybinder.pcpp.SSLHandshakeMessage
A factory method for creating instances of handshake messages from raw data The raw data containing 1 handshake message Raw data length in bytes A pointer to the SSLHandshakeLayer instance which will contain the created message. This parameter is required because the handshake message includes a pointer to its container
- Args:
data (bytes) data_len (unsigned int) container (pcpp.SSLHandshakeLayer)
- Returns:
pcpp.SSLHandshakeMessage
- property handshake_type
The handshake message type
- Returns:
enum pcpp.SSLHandshakeType
- is_message_complete(self: mtf.libs.mtf_pybinder.pcpp.SSLHandshakeMessage) bool
True if current packet contains the entire message or false otherwise. This method is important because sometimes handshake messages are divided in consequent packets (happens a lot in certificate messages which usually contain several KB of data which is larger than standard packet size, so the message is divided between several packets)
- Returns:
bool
- property message_length
The handshake message length in bytes. Notice that sometimes the handshake message is divided between several packets, in this case this method will return the length of part of the message in the current packet
- Returns:
unsigned int
- class mtf.libs.mtf_pybinder.pcpp.SSLServerHelloMessage
Represents SSL/TLS server-hello message (type 2). Inherits from SSLHandshakeMessage and adds parsing of all fields of this message including the message extensions, cipher-suite, etc.
- class ServerHelloTLSFingerprint
A struct that contains all the elements needed for creating a Server Hello TLS fingerprinting: TLS version, Cipher Suite ID, and a list of Extensions IDs. You can read more about this in SSLServerHelloMessage#generateTLSFingerprint(). This struct contains methods to extract the TLS fingerprint itself: toString() and toMD5()
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.SSLServerHelloMessage.ServerHelloTLSFingerprint) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.SSLServerHelloMessage.ServerHelloTLSFingerprint, arg0: mtf.libs.mtf_pybinder.pcpp.SSLServerHelloMessage.ServerHelloTLSFingerprint) -> None
- __new__(**kwargs)
- property cipher_suite
- property extensions
- property tls_version
- to_md5(self: mtf.libs.mtf_pybinder.pcpp.SSLServerHelloMessage.ServerHelloTLSFingerprint) str
An MD5 hash of the string generated by toString()
- Returns:
str
- to_string(self: mtf.libs.mtf_pybinder.pcpp.SSLServerHelloMessage.ServerHelloTLSFingerprint) str
A string representing the TLS fingerprint, for example: 771,49195,65281-16-11 This string has the following format: TLSVersion,Cipher,Extensions The extension ID are separated with a “-”
- Returns:
str
- to_string_and_md5(self: mtf.libs.mtf_pybinder.pcpp.SSLServerHelloMessage.ServerHelloTLSFingerprint) tuple[str, str]
A pair of the string and MD5 hash (string is first, MD5 is second). If you want both this method is more efficient than calling toString() and toMD5() separately
- Returns:
tuple[str, str]
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.SSLServerHelloMessage, data: int, data_len: int, container: pcpp::SSLHandshakeLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.SSLServerHelloMessage, arg0: mtf.libs.mtf_pybinder.pcpp.SSLServerHelloMessage) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.SSLServerHelloMessage, arg0: mtf.libs.mtf_pybinder.pcpp.SSLServerHelloMessage) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.SSLServerHelloMessage, : mtf.libs.mtf_pybinder.pcpp.SSLServerHelloMessage) mtf.libs.mtf_pybinder.pcpp.SSLServerHelloMessage
- Returns:
pcpp.SSLServerHelloMessage
- property compression_methods_value
The value of the compression method byte
- Returns:
unsigned int
- static create_handshake_message(data: int, data_len: int, container: pcpp::SSLHandshakeLayer) mtf.libs.mtf_pybinder.pcpp.SSLHandshakeMessage
A factory method for creating instances of handshake messages from raw data The raw data containing 1 handshake message Raw data length in bytes A pointer to the SSLHandshakeLayer instance which will contain the created message. This parameter is required because the handshake message includes a pointer to its container
- Args:
data (bytes) data_len (unsigned int) container (pcpp.SSLHandshakeLayer)
- Returns:
pcpp.SSLHandshakeMessage
- property extension_count
The number of extensions in this message
- Returns:
int
- property extensions_length
The size (in bytes) of all extensions data in this message. Extracted from the “extensions length” field
- Returns:
unsigned int
- generate_tls_fingerprint(self: mtf.libs.mtf_pybinder.pcpp.SSLServerHelloMessage) pcpp::SSLServerHelloMessage::ServerHelloTLSFingerprint
ServerHello TLS fingerprinting is a way to fingerprint TLS Server Hello messages. In conjunction with ClientHello TLS fingerprinting it can assist in identifying specific client-server communication (for example: a malware connecting to its backend server). ServerHello TLS fingerprinting was introduced in Salesforce’s JA3S open source project: <https://engineering.salesforce.com/tls-fingerprinting-with-ja3-and-ja3s-247362855967> This implementation is a C++ version of Salesforce’s JAS3 (originally written in Python and Zeek) A SSLServerHelloMessage#ServerHelloTLSFingerprint struct that contains all the elements needed for creating a TLS fingerprint out of this Server Hello message. This struct has also methods to extract the TLS fingerprint itself in a string or MD5 formats
- Returns:
pcpp.SSLServerHelloMessage.ServerHelloTLSFingerprint
- get_cipher_suite(self: mtf.libs.mtf_pybinder.pcpp.SSLServerHelloMessage) mtf.libs.mtf_pybinder.pcpp.SSLCipherSuite
A pointer to the cipher suite encapsulated in this message (server-hello message contains one cipher-suite, the one that will be used to for encryption between client and server). May return NULL if the parsing of the message failed or the cipher-suite ID is unknown. If you still want to get the cipher-suite ID you can use the getCipherSuiteID() method
- Returns:
pcpp.SSLCipherSuite
- get_cipher_suite_id(self: mtf.libs.mtf_pybinder.pcpp.SSLServerHelloMessage) int
Get the cipher-suite ID. This method just parses the ID from the server-hello message and returns it. To get more information on the cipher-suite you can use the getCipherSuite() method Set to “true” if parsing succeeded and the return value is valid or “false” otherwise. If the value is “false” the return value can be ignored The cipher-suite ID if “isValid” is set to “true”. If “isValid” is set to “false” the return value can be ignored
- get_extension(self: mtf.libs.mtf_pybinder.pcpp.SSLServerHelloMessage, index: int) mtf.libs.mtf_pybinder.pcpp.SSLExtension
Get a pointer to an extension by index. The extensions are numbered according to their order of appearance in the message. If index is out of bounds (less than 0 or larger than total amount of extensions) NULL will be returned The index of the extension to return The pointer to the extension or NULL if index is out of bounds
- Args:
index (int)
- Returns:
pcpp.SSLExtension
- get_extension_of_type(*args, **kwargs)
Overloaded function.
get_extension_of_type(self: mtf.libs.mtf_pybinder.pcpp.SSLServerHelloMessage, type: int) -> mtf.libs.mtf_pybinder.pcpp.SSLExtension
Get a pointer to an extension by numeric type field. Every extension has a 2-byte numeric value representing its type (for example: renegotiation info extension type is 0x1ff). This method gets the type and returns a pointer to the extension object The 2-byte numeric type of the extension A pointer to the extension object of NULL if this type doesn’t exist in this message
- Args:
type (unsigned int)
- Returns:
pcpp.SSLExtension
get_extension_of_type(self: mtf.libs.mtf_pybinder.pcpp.SSLServerHelloMessage, type: mtf.libs.mtf_pybinder.pcpp.SSLExtensionType) -> mtf.libs.mtf_pybinder.pcpp.SSLExtension
Get a pointer to an extension by its enum type The type of extension to return A pointer to the extension object or NULL if this type doesn’t exist in this message
- Args:
type (enum pcpp.SSLExtensionType)
- Returns:
pcpp.SSLExtension
- property handshake_type
The handshake message type
- Returns:
enum pcpp.SSLHandshakeType
- property handshake_version
Handshake SSL/TLS version (notice it may be different than SSLLayer#getRecordVersion(). Each client-hello or server-hello message has both record version and handshake version and they may differ from one another). NOTE: for TLS 1.3 the handshake version written in ssl_tls_client_server_hello::handshakeVersion is still TLS 1.2, so a special check is made here see if a SupportedVersions extension exists and if so extract the version from it. This is the most straight-forward way to detect TLS 1.3.
- Returns:
pcpp.SSLVersion
- is_message_complete(self: mtf.libs.mtf_pybinder.pcpp.SSLHandshakeMessage) bool
True if current packet contains the entire message or false otherwise. This method is important because sometimes handshake messages are divided in consequent packets (happens a lot in certificate messages which usually contain several KB of data which is larger than standard packet size, so the message is divided between several packets)
- Returns:
bool
- property message_length
The handshake message length in bytes. Notice that sometimes the handshake message is divided between several packets, in this case this method will return the length of part of the message in the current packet
- Returns:
unsigned int
- property random
Handshake random number
- property session_id
Session ID as byte array. If server-hello message doesn’t include session ID NULL will be returned
- property session_id_length
Session ID length in bytes. If server-hello message doesn’t include session ID 0 will be returned
- Returns:
unsigned int
- class mtf.libs.mtf_pybinder.pcpp.SSLServerKeyExchangeMessage
Represents SSL/TLS server-key-exchange message (type 12). Inherits from SSLHandshakeMessage and adds parsing functionality such as getting the server key exchange params as raw data (parsing of this may be added in the future)
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.SSLServerKeyExchangeMessage, data: int, data_len: int, container: pcpp::SSLHandshakeLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.SSLServerKeyExchangeMessage, arg0: mtf.libs.mtf_pybinder.pcpp.SSLServerKeyExchangeMessage) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.SSLServerKeyExchangeMessage, arg0: mtf.libs.mtf_pybinder.pcpp.SSLServerKeyExchangeMessage) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.SSLServerKeyExchangeMessage, : mtf.libs.mtf_pybinder.pcpp.SSLServerKeyExchangeMessage) mtf.libs.mtf_pybinder.pcpp.SSLServerKeyExchangeMessage
- Returns:
pcpp.SSLServerKeyExchangeMessage
- static create_handshake_message(data: int, data_len: int, container: pcpp::SSLHandshakeLayer) mtf.libs.mtf_pybinder.pcpp.SSLHandshakeMessage
A factory method for creating instances of handshake messages from raw data The raw data containing 1 handshake message Raw data length in bytes A pointer to the SSLHandshakeLayer instance which will contain the created message. This parameter is required because the handshake message includes a pointer to its container
- Args:
data (bytes) data_len (unsigned int) container (pcpp.SSLHandshakeLayer)
- Returns:
pcpp.SSLHandshakeMessage
- property handshake_type
The handshake message type
- Returns:
enum pcpp.SSLHandshakeType
- is_message_complete(self: mtf.libs.mtf_pybinder.pcpp.SSLHandshakeMessage) bool
True if current packet contains the entire message or false otherwise. This method is important because sometimes handshake messages are divided in consequent packets (happens a lot in certificate messages which usually contain several KB of data which is larger than standard packet size, so the message is divided between several packets)
- Returns:
bool
- property message_length
The handshake message length in bytes. Notice that sometimes the handshake message is divided between several packets, in this case this method will return the length of part of the message in the current packet
- Returns:
unsigned int
- property server_key_exchange_params
Raw data of the server key exchange params. Currently this data can only returned as raw, parsing may be added in the future. Notice that if the message is spread over more than 1 packet in a way params doesn’t exist in the first packet, NULL will be returned
- property server_key_exchange_params_length
The size of the params field. Notice that if the message is spread over more than 1 packet in a way the ssl_tls_handshake_layer cannot be parsed from the packet, 0 will be returned. Also, if only part of the params exist in current packet (and the rest are on consequent packets), the size that will be returned is the size of the part that exists in the current packet (and not total size of params)
- Returns:
unsigned int
- class mtf.libs.mtf_pybinder.pcpp.SSLServerNameIndicationExtension
Represents SSL/TLS Server Name Indication extension. Inherits from SSLExtension and add parsing of the hostname written in the extension data
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.SSLServerNameIndicationExtension, data: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.SSLServerNameIndicationExtension, arg0: mtf.libs.mtf_pybinder.pcpp.SSLServerNameIndicationExtension) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.SSLServerNameIndicationExtension, : mtf.libs.mtf_pybinder.pcpp.SSLServerNameIndicationExtension) mtf.libs.mtf_pybinder.pcpp.SSLServerNameIndicationExtension
- Returns:
pcpp.SSLServerNameIndicationExtension
- property data
Raw data of the extension
- property host_name
The hostname written in the extension data
- Returns:
str
- property length
The length of the extension data in bytes (not including the type and length fields)
- Returns:
unsigned int
- property total_length
The total length of the extension, including type and length fields and the extension data field
- Returns:
unsigned int
- property type
The type of the extension as enum
- Returns:
enum pcpp.SSLExtensionType
- property type_as_int
The type of the extension as a numeric value
- Returns:
unsigned int
- class mtf.libs.mtf_pybinder.pcpp.SSLSupportedVersionsExtension
Represents TLS Supported Versions extension. Inherits from SSLExtension and adds parsing of the list of supported versions mentioned in the extension data
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.SSLSupportedVersionsExtension, data: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.SSLSupportedVersionsExtension, arg0: mtf.libs.mtf_pybinder.pcpp.SSLSupportedVersionsExtension) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.SSLExtension, : mtf.libs.mtf_pybinder.pcpp.SSLExtension) mtf.libs.mtf_pybinder.pcpp.SSLExtension
- Returns:
pcpp.SSLExtension
- property data
Raw data of the extension
- property length
The length of the extension data in bytes (not including the type and length fields)
- Returns:
unsigned int
- property supported_versions
The list of supported versions mentioned in the extension data
- Returns:
list[pcpp.SSLVersion]
- property total_length
The total length of the extension, including type and length fields and the extension data field
- Returns:
unsigned int
- property type
The type of the extension as enum
- Returns:
enum pcpp.SSLExtensionType
- property type_as_int
The type of the extension as a numeric value
- Returns:
unsigned int
- class mtf.libs.mtf_pybinder.pcpp.SSLSymetricEncryptionAlgorithm
SSL/TLS symmetric encryption algorithms
Members:
SSL_SYM_NULL
SSL_SYM_RC4_40
SSL_SYM_RC4_128
SSL_SYM_RC2_CBC_40
SSL_SYM_IDEA_CBC
SSL_SYM_DES40_CBC
SSL_SYM_DES_CBC
SSL_SYM_3DES_EDE_CBC
SSL_SYM_FORTEZZA_CBC
SSL_SYM_DES_CBC_40
SSL_SYM_AES_128_CBC
SSL_SYM_AES_256_CBC
SSL_SYM_CAMELLIA_128_CBC
SSL_SYM_CAMELLIA_128_GCM
SSL_SYM_CAMELLIA_256_GCM
SSL_SYM_RC4_56
SSL_SYM_RC2_CBC_56
SSL_SYM_GOST28147
SSL_SYM_CAMELLIA_256_CBC
SSL_SYM_SEED_CBC
SSL_SYM_AES_128
SSL_SYM_AES_256
SSL_SYM_AES_128_GCM
SSL_SYM_AES_256_GCM
SSL_SYM_RC4_128_EXPORT40
SSL_SYM_RC2_CBC_128_CBC
SSL_SYM_IDEA_128_CBC
SSL_SYM_DES_64_CBC
SSL_SYM_DES_192_EDE3_CBC
SSL_SYM_RC4_64
SSL_SYM_ARIA_128_CBC
SSL_SYM_ARIA_256_CBC
SSL_SYM_ARIA_128_GCM
SSL_SYM_ARIA_256_GCM
SSL_SYM_CHACHA20_POLY1305
SSL_SYM_AES_128_CCM
SSL_SYM_AES_128_CCM_8
SSL_SYM_Unknown
- SSL_SYM_3DES_EDE_CBC
- SSL_SYM_AES_128
- SSL_SYM_AES_128_CBC
- SSL_SYM_AES_128_CCM
- SSL_SYM_AES_128_CCM_8
- SSL_SYM_AES_128_GCM
- SSL_SYM_AES_256
- SSL_SYM_AES_256_CBC
- SSL_SYM_AES_256_GCM
- SSL_SYM_ARIA_128_CBC
- SSL_SYM_ARIA_128_GCM
- SSL_SYM_ARIA_256_CBC
- SSL_SYM_ARIA_256_GCM
- SSL_SYM_CAMELLIA_128_CBC
- SSL_SYM_CAMELLIA_128_GCM
- SSL_SYM_CAMELLIA_256_CBC
- SSL_SYM_CAMELLIA_256_GCM
- SSL_SYM_CHACHA20_POLY1305
- SSL_SYM_DES40_CBC
- SSL_SYM_DES_192_EDE3_CBC
- SSL_SYM_DES_64_CBC
- SSL_SYM_DES_CBC
- SSL_SYM_DES_CBC_40
- SSL_SYM_FORTEZZA_CBC
- SSL_SYM_GOST28147
- SSL_SYM_IDEA_128_CBC
- SSL_SYM_IDEA_CBC
- SSL_SYM_NULL
- SSL_SYM_RC2_CBC_128_CBC
- SSL_SYM_RC2_CBC_40
- SSL_SYM_RC2_CBC_56
- SSL_SYM_RC4_128
- SSL_SYM_RC4_128_EXPORT40
- SSL_SYM_RC4_40
- SSL_SYM_RC4_56
- SSL_SYM_RC4_64
- SSL_SYM_SEED_CBC
- SSL_SYM_Unknown
- __init__(self: mtf.libs.mtf_pybinder.pcpp.SSLSymetricEncryptionAlgorithm, value: int) None
- __new__(**kwargs)
- property name
- property value
- class mtf.libs.mtf_pybinder.pcpp.SSLUnknownMessage
Represents an unknown type of message or an encrypted message that PcapPlusPlus can’t determine its type. In these cases length can’t always be determined from the message itself (especially if the message is encrypted), so the length of this message will always be the size counted from message start until the end of the layer
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.SSLUnknownMessage, data: int, data_len: int, container: pcpp::SSLHandshakeLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.SSLUnknownMessage, arg0: mtf.libs.mtf_pybinder.pcpp.SSLUnknownMessage) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.SSLUnknownMessage, arg0: mtf.libs.mtf_pybinder.pcpp.SSLUnknownMessage) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.SSLUnknownMessage, : mtf.libs.mtf_pybinder.pcpp.SSLUnknownMessage) mtf.libs.mtf_pybinder.pcpp.SSLUnknownMessage
- Returns:
pcpp.SSLUnknownMessage
- static create_handshake_message(data: int, data_len: int, container: pcpp::SSLHandshakeLayer) mtf.libs.mtf_pybinder.pcpp.SSLHandshakeMessage
A factory method for creating instances of handshake messages from raw data The raw data containing 1 handshake message Raw data length in bytes A pointer to the SSLHandshakeLayer instance which will contain the created message. This parameter is required because the handshake message includes a pointer to its container
- Args:
data (bytes) data_len (unsigned int) container (pcpp.SSLHandshakeLayer)
- Returns:
pcpp.SSLHandshakeMessage
- property handshake_type
The handshake message type
- Returns:
enum pcpp.SSLHandshakeType
- is_message_complete(self: mtf.libs.mtf_pybinder.pcpp.SSLHandshakeMessage) bool
True if current packet contains the entire message or false otherwise. This method is important because sometimes handshake messages are divided in consequent packets (happens a lot in certificate messages which usually contain several KB of data which is larger than standard packet size, so the message is divided between several packets)
- Returns:
bool
- property message_length
The handshake message length in bytes. Notice that sometimes the handshake message is divided between several packets, in this case this method will return the length of part of the message in the current packet
- Returns:
unsigned int
- class mtf.libs.mtf_pybinder.pcpp.SSLVersion
A wrapper class for SSL/TLS versions. The SSL/TLS version is typically represented by a 2-byte number, for example TLS 1.2 is represented by 0x0303. This class wraps the numeric value and provides methods to convert it into an enum, string, etc.
- DTLS1_0
- DTLS1_2
- DTLS1_3
- SSL2
- SSL3
- class SSLVersionEnum
SSL/TLS versions enum
Members:
SSL2
SSL3
TLS1_0
TLS1_1
TLS1_2
TLS1_3
TLS1_3_D14
TLS1_3_D15
TLS1_3_D16
TLS1_3_D17
TLS1_3_D18
TLS1_3_D19
TLS1_3_D20
TLS1_3_D21
TLS1_3_D22
TLS1_3_D23
TLS1_3_D24
TLS1_3_D25
TLS1_3_D26
TLS1_3_D27
TLS1_3_D28
TLS1_3_FBD23
TLS1_3_FBD26
DTLS1_0
DTLS1_2
DTLS1_3
Unknown
- DTLS1_0
- DTLS1_2
- DTLS1_3
- SSL2
- SSL3
- TLS1_0
- TLS1_1
- TLS1_2
- TLS1_3
- TLS1_3_D14
- TLS1_3_D15
- TLS1_3_D16
- TLS1_3_D17
- TLS1_3_D18
- TLS1_3_D19
- TLS1_3_D20
- TLS1_3_D21
- TLS1_3_D22
- TLS1_3_D23
- TLS1_3_D24
- TLS1_3_D25
- TLS1_3_D26
- TLS1_3_D27
- TLS1_3_D28
- TLS1_3_FBD23
- TLS1_3_FBD26
- Unknown
- __init__(self: mtf.libs.mtf_pybinder.pcpp.SSLVersion.SSLVersionEnum, value: int) None
- __new__(**kwargs)
- property name
- property value
- TLS1_0
- TLS1_1
- TLS1_2
- TLS1_3
- TLS1_3_D14
- TLS1_3_D15
- TLS1_3_D16
- TLS1_3_D17
- TLS1_3_D18
- TLS1_3_D19
- TLS1_3_D20
- TLS1_3_D21
- TLS1_3_D22
- TLS1_3_D23
- TLS1_3_D24
- TLS1_3_D25
- TLS1_3_D26
- TLS1_3_D27
- TLS1_3_D28
- TLS1_3_FBD23
- TLS1_3_FBD26
- Unknown
- __init__(self: mtf.libs.mtf_pybinder.pcpp.SSLVersion, ssl_version_value: int) None
- __new__(**kwargs)
- as_enum(*args, **kwargs)
Overloaded function.
as_enum(self: mtf.libs.mtf_pybinder.pcpp.SSLVersion) -> mtf.libs.mtf_pybinder.pcpp.SSLVersion.SSLVersionEnum
- Returns:
pcpp.SSLVersion.SSLVersionEnum
as_enum(self: mtf.libs.mtf_pybinder.pcpp.SSLVersion, count_tls_drafts_as1_3: bool) -> mtf.libs.mtf_pybinder.pcpp.SSLVersion.SSLVersionEnum
An enum value of type SSLVersion::SSLVersionEnum representing the SSL/TLS version. If the numeric value is an invalid SSL/TLS version SSLVersion::Unknown will be returned. A flag indicating whether to return the enum value SSLVersion::TLS1_3 for all TLS 1.3 drafts. If set to “true” all TLS 1.3 draft values (i.e 0x7f0e - 0x7f1c, 0xfb17, 0xfb1a) will return SSLVersion::TLS1_3, otherwise the corresponding enum values will be returned. The default value is “false”.
- Args:
count_tls_drafts_as1_3 (bool)
- Returns:
enum pcpp.SSLVersion.SSLVersionEnum
- as_u_int(self: mtf.libs.mtf_pybinder.pcpp.SSLVersion) int
The numeric value of the SSL/TLs version
- Returns:
unsigned int
- to_string(*args, **kwargs)
Overloaded function.
to_string(self: mtf.libs.mtf_pybinder.pcpp.SSLVersion) -> str
- Returns:
str
to_string(self: mtf.libs.mtf_pybinder.pcpp.SSLVersion, count_tls_drafts_as1_3: bool) -> str
A string representation of the SSL/TLS version. For example: for TLS 1.2 the string “TLS 1.2” is returned. If the numeric value is an invalid SSL/TLS version the string “Unknown” will be returned. A flag indicating whether to return the string value “TLS 1.3” for all TLS 1.3 drafts. If set to “true” all TLS 1.3 draft values (i.e 0x7f0e - 0x7f1c, 0xfb17, 0xfb1a) will return “TLS 1.3”, otherwise the corresponding string values will be returned. The default value is “false”.
- Args:
count_tls_drafts_as1_3 (bool)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.SSLx509Certificate
Represents a x509v3 certificate. the SSLCertificateMessage class returns an instance of this class as the certificate. Currently this class doesn’t do much as it doesn’t parse the certificate. It only acts as container to the raw data and returns general info as data as raw, length, etc. In the future I may add full parsing of the certificate
- __init__(self: mtf.libs.mtf_pybinder.pcpp.SSLx509Certificate, data: int, data_len: int, all_data_exists: bool) None
- __new__(**kwargs)
- property all_data_exists
Certificate messages usually spread on more than 1 packet. So a certificate is likely to split between 2 packets or more. This method provides an indication whether all certificate data exists or only part of it True if this data contains all certificate data, false otherwise
- Returns:
bool
- property data
Raw data
- property data_length
Raw data length
- Returns:
unsigned int
- class mtf.libs.mtf_pybinder.pcpp.SegmentedFctIdExtendedMsg
- __init__(self: mtf.libs.mtf_pybinder.pcpp.SegmentedFctIdExtendedMsg) None
- __new__(**kwargs)
- property bap_info
- property extended_fct_id
- get_suffix_data(self: mtf.libs.mtf_pybinder.pcpp.SegmentedFctIdExtendedMsg, length: int) list[int]
- Args:
length (unsigned int)
- Returns:
list[unsigned int]
- property segmented_bap_info
- class mtf.libs.mtf_pybinder.pcpp.SegmentedLengthExtendedMsg
- __init__(self: mtf.libs.mtf_pybinder.pcpp.SegmentedLengthExtendedMsg) None
- __new__(**kwargs)
- property bap_info
- property extended_length
- get_suffix_data(self: mtf.libs.mtf_pybinder.pcpp.SegmentedLengthExtendedMsg, length: int) list[int]
- Args:
length (unsigned int)
- Returns:
list[unsigned int]
- property segmented_bap_info
- class mtf.libs.mtf_pybinder.pcpp.SegmentedLengthFctIdExtendedMsg
- __init__(self: mtf.libs.mtf_pybinder.pcpp.SegmentedLengthFctIdExtendedMsg) None
- __new__(**kwargs)
- property bap_info
- property extended_fct_id
- property extended_length
- get_suffix_data(self: mtf.libs.mtf_pybinder.pcpp.SegmentedLengthFctIdExtendedMsg, length: int) list[int]
- Args:
length (unsigned int)
- Returns:
list[unsigned int]
- property segmented_bap_info
- class mtf.libs.mtf_pybinder.pcpp.SegmentedMsg
- __init__(self: mtf.libs.mtf_pybinder.pcpp.SegmentedMsg) None
- __new__(**kwargs)
- property bap_info
- get_suffix_data(self: mtf.libs.mtf_pybinder.pcpp.SegmentedMsg, length: int) list[int]
- Args:
length (unsigned int)
- Returns:
list[unsigned int]
- property segmented_bap_info
- class mtf.libs.mtf_pybinder.pcpp.SegmentedSequenceMsg
- __init__(self: mtf.libs.mtf_pybinder.pcpp.SegmentedSequenceMsg) None
- __new__(**kwargs)
- property channel
- property frame_type
- get_suffix_data(self: mtf.libs.mtf_pybinder.pcpp.SegmentedSequenceMsg, length: int) list[int]
- Args:
length (unsigned int)
- Returns:
list[unsigned int]
- property sequence_number
- property start_flag
- class mtf.libs.mtf_pybinder.pcpp.SingleCommandTextProtocol
Class for single command text based protocol (FTP, SMTP) messages
- __init__(self: mtf.libs.mtf_pybinder.pcpp.SingleCommandTextProtocol, arg0: mtf.libs.mtf_pybinder.pcpp.SingleCommandTextProtocol) None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.SingleCommandTextProtocol, : mtf.libs.mtf_pybinder.pcpp.SingleCommandTextProtocol) mtf.libs.mtf_pybinder.pcpp.SingleCommandTextProtocol
- Returns:
pcpp.SingleCommandTextProtocol
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- static is_data_valid(data: int, data_size: int) bool
A static method that takes a byte array and detects whether it is a single command text based message. All single command text based message terminated with single.
- Args:
data (bytes): A byte array data_size (unsigned int): The byte array size (in bytes)
- Returns:
bool: True if the data is identified as single command text based message
- is_multi_line(self: mtf.libs.mtf_pybinder.pcpp.SingleCommandTextProtocol) bool
Checks if the current message is a multi-line reply. Multi-line messages are indicated with a Hyphen (-) immediately after reply code.
- Returns:
bool: true If this is a multi-line reply, false Otherwise
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.Sll2Layer
Represents an SLL2 (Linux cooked capture) protocol layer
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.Sll2Layer, data: int, data_len: int, packet: mtf.libs.mtf_pybinder.pcpp.Packet) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.Sll2Layer, interface_index: int, arphrd_type: int, packet_type: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.Sll2Layer, arg0: mtf.libs.mtf_pybinder.pcpp.Sll2Layer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.Sll2Layer, arg0: mtf.libs.mtf_pybinder.pcpp.Sll2Layer) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.Sll2Layer, : mtf.libs.mtf_pybinder.pcpp.Sll2Layer) mtf.libs.mtf_pybinder.pcpp.Sll2Layer
- Returns:
pcpp.Sll2Layer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Sll2Layer) None
Calculate the next protocol type for known protocols: IPv4, IPv6, ARP, VLAN
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_arphrd_type(self: mtf.libs.mtf_pybinder.pcpp.Sll2Layer) int
Get arphrd type of this layer arphrd type
- Returns:
unsigned int
- get_header_len(self: mtf.libs.mtf_pybinder.pcpp.Sll2Layer) int
Size of sll2_header
- Returns:
unsigned int
- get_interface_index(self: mtf.libs.mtf_pybinder.pcpp.Sll2Layer) int
Get interface index of this layer interface index
- Returns:
unsigned int
- get_link_layer_addr(self: mtf.libs.mtf_pybinder.pcpp.Sll2Layer) int
Get link layer address data pointer link layer address data pointer
- Returns:
bytes
- get_link_layer_addr_len(self: mtf.libs.mtf_pybinder.pcpp.Sll2Layer) int
Get link layer address length link layer address length
- Returns:
unsigned int
- get_link_layer_as_mac_address(self: mtf.libs.mtf_pybinder.pcpp.Sll2Layer) mtf.libs.mtf_pybinder.pcpp.MacAddress
Get a MAC address in the link layer address field return macAddress pointer was set successfully, null pointer if d MAC address isn’t valid or if set failed
- Returns:
pcpp.MacAddress
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_osi_model_layer(self: mtf.libs.mtf_pybinder.pcpp.Sll2Layer) mtf.libs.mtf_pybinder.pcpp.OsiModelLayer
- Returns:
enum pcpp.OsiModelLayer
- get_packet_type(self: mtf.libs.mtf_pybinder.pcpp.Sll2Layer) int
Get packet type of this layer packet type
- Returns:
unsigned int
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- get_protocol_type(self: mtf.libs.mtf_pybinder.pcpp.Sll2Layer) int
Get a protocol type of this layer protocol type
- Returns:
unsigned int
- get_sll2_header(self: mtf.libs.mtf_pybinder.pcpp.Sll2Layer) mtf.libs.mtf_pybinder.pcpp.sll2_header
Get a pointer to the Sll header. Notice this points directly to the data, so every change will change the actual packet data A pointer to the sll2_header
- Returns:
pcpp.sll2_header
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- static is_data_valid(data: int, data_len: int) bool
A static method that validates the input data The pointer to the beginning of a byte stream of an IEEE 802.3 Eth packet The length of the byte stream True if the data is valid and can represent an IEEE 802.3 Eth packet
- Args:
data (bytes) data_len (unsigned int)
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Sll2Layer) None
Currently identifies the following next layers: IPv4Layer, IPv6Layer, ArpLayer, VlanLayer, PPPoESessionLayer, PPPoEDiscoveryLayer, MplsLayer. Otherwise sets PayloadLayer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- set_arphrd_type(self: mtf.libs.mtf_pybinder.pcpp.Sll2Layer, arphrd_type: int) None
Set arphrd type of this layer arphrd type to set
- Args:
arphrd_type (unsigned int)
- set_interface_index(self: mtf.libs.mtf_pybinder.pcpp.Sll2Layer, interface_index: int) None
Set interface index of this layer interface index to set
- Args:
interface_index (unsigned int)
- set_link_layer_addr(self: mtf.libs.mtf_pybinder.pcpp.Sll2Layer, addr: int, addr_length: int) bool
A setter for the link layer address field The address to set. Memory will be copied to packet Address length, must be lower or equal to 8 (which is max length for SLL2 address) True if address was set successfully, or false of addrLength is out of bounds (0 or larger than 8)
- Args:
addr (bytes) addr_length (unsigned int)
- Returns:
bool
- set_mac_address_as_link_layer(self: mtf.libs.mtf_pybinder.pcpp.Sll2Layer, mac_addr: mtf.libs.mtf_pybinder.pcpp.MacAddress) bool
Set a MAC address in the link layer address field MAC address to set True if address was set successfully, false if MAC address isn’t valid or if set failed
- Args:
mac_addr (pcpp.MacAddress)
- Returns:
bool
- set_packet_type(self: mtf.libs.mtf_pybinder.pcpp.Sll2Layer, packet_type: int) None
Set packet type of this layer packet type to set
- Args:
packet_type (unsigned int)
- set_protocol_type(self: mtf.libs.mtf_pybinder.pcpp.Sll2Layer, protocol_type: int) None
Set protocol type of this layer type to set
- Args:
protocol_type (unsigned int)
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Sll2Layer) str
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.SllLayer
Represents an SLL (Linux cooked capture) protocol layer
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.SllLayer, data: int, data_len: int, packet: mtf.libs.mtf_pybinder.pcpp.Packet) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.SllLayer, packet_type: int, arphrd_type: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.SllLayer, arg0: mtf.libs.mtf_pybinder.pcpp.SllLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.SllLayer, arg0: mtf.libs.mtf_pybinder.pcpp.SllLayer) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.SllLayer, : mtf.libs.mtf_pybinder.pcpp.SllLayer) mtf.libs.mtf_pybinder.pcpp.SllLayer
- Returns:
pcpp.SllLayer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.SllLayer) None
Calculate the next protocol type for known protocols: IPv4, IPv6, ARP, VLAN
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_header_len(self: mtf.libs.mtf_pybinder.pcpp.SllLayer) int
Size of sll_header
- Returns:
unsigned int
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_osi_model_layer(self: mtf.libs.mtf_pybinder.pcpp.SllLayer) mtf.libs.mtf_pybinder.pcpp.OsiModelLayer
- Returns:
enum pcpp.OsiModelLayer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- get_sll_header(self: mtf.libs.mtf_pybinder.pcpp.SllLayer) mtf.libs.mtf_pybinder.pcpp.sll_header
Get a pointer to the Sll header. Notice this points directly to the data, so every change will change the actual packet data A pointer to the sll_header
- Returns:
pcpp.sll_header
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.SllLayer) None
Currently identifies the following next layers: IPv4Layer, IPv6Layer, ArpLayer, VlanLayer, PPPoESessionLayer, PPPoEDiscoveryLayer, MplsLayer. Otherwise sets PayloadLayer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- set_link_layer_addr(self: mtf.libs.mtf_pybinder.pcpp.SllLayer, addr: int, addr_length: int) bool
A setter for the link layer address field The address to set. Memory will be copied to packet Address length, must be lower or equal to 8 (which is max length for SLL address) True if address was set successfully, or false of addrLength is out of bounds (0 or larger than 8)
- Args:
addr (bytes) addr_length (unsigned int)
- Returns:
bool
- set_mac_address_as_link_layer(self: mtf.libs.mtf_pybinder.pcpp.SllLayer, mac_addr: mtf.libs.mtf_pybinder.pcpp.MacAddress) bool
Set a MAC address in the link layer address field MAC address to set True if address was set successfully, false if MAC address isn’t valid or if set failed
- Args:
mac_addr (pcpp.MacAddress)
- Returns:
bool
- to_string(self: mtf.libs.mtf_pybinder.pcpp.SllLayer) str
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.SnoopFileReaderDevice
A class for opening a snoop file in read-only mode. This class enable to open the file and read all packets, packet-by-packet
- class PcapStats
A container for pcap device statistics
- __init__(self: mtf.libs.mtf_pybinder.pcpp.IPcapDevice.PcapStats) None
- __new__(**kwargs)
- property packets_drop
- property packets_drop_by_interface
- property packets_recv
- __init__(self: mtf.libs.mtf_pybinder.pcpp.SnoopFileReaderDevice, file_name: str) None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.IFileReaderDevice, : mtf.libs.mtf_pybinder.pcpp.IFileReaderDevice) mtf.libs.mtf_pybinder.pcpp.IFileReaderDevice
- Returns:
pcpp.IFileReaderDevice
- clear_filter(self: mtf.libs.mtf_pybinder.pcpp.IFilterableDevice) bool
Clear the filter currently set on the device
- Returns:
bool: True if filter was removed successfully or if no filter was set, false otherwise
- close(self: mtf.libs.mtf_pybinder.pcpp.SnoopFileReaderDevice) None
Close the snoop file
- get_file_name(self: mtf.libs.mtf_pybinder.pcpp.IFileDevice) str
Get the name of the file
- Returns:
str: The name of the file
- get_file_size(self: mtf.libs.mtf_pybinder.pcpp.IFileReaderDevice) int
Get the file size in bytes
- Returns:
unsigned int: The file size in bytes
- get_link_layer_type(self: mtf.libs.mtf_pybinder.pcpp.SnoopFileReaderDevice) mtf.libs.mtf_pybinder.pcpp.LinkLayerType
Get the link layer type of this file
- Returns:
enum pcpp.LinkLayerType: The link layer type of this file
- get_next_packet(self: mtf.libs.mtf_pybinder.pcpp.SnoopFileReaderDevice, raw_packet: mtf.libs.mtf_pybinder.pcpp.RawPacket) bool
Read the next packet from the file. Before using this method please verify the file is opened using open()
- Args:
raw_packet (pcpp.RawPacket): A reference for an empty RawPacket where the packet will be written
- Returns:
bool: True if a packet was read successfully. False will be returned if the file isn’t opened (also, an error log will be printed)
or if reached end-of-file
- static get_pcap_lib_version_info() str
A static method for retrieving pcap lib (libpcap/WinPcap/etc.) version information. This method is actually a wrapper for [pcap_lib_version()](https://www.tcpdump.org/manpages/pcap_lib_version.3pcap.html)
- Returns:
str: A string containing the pcap lib version information
- static get_reader(file_name: str) mtf.libs.mtf_pybinder.pcpp.IFileReaderDevice
A static method that creates an instance of the reader best fit to read the file. It decides by the file extension: for .pcapng files it returns an instance of PcapNgFileReaderDevice and for all other extensions it returns an instance of PcapFileReaderDevice
- Args:
file_name (str): The file name to open
- Returns:
pcpp.IFileReaderDevice: An instance of the reader to read the file. Notice you should free this instance when done using it
- get_statistics(self: mtf.libs.mtf_pybinder.pcpp.IPcapDevice, stats: pcpp::IPcapDevice::PcapStats) None
Get statistics from the device
- Args:
stats (pcpp.IPcapDevice.PcapStats): An object containing the stats
- is_opened(self: mtf.libs.mtf_pybinder.pcpp.IDevice) bool
- Returns:
bool: True if the file is opened, false otherwise
- static match_packet_with_filter(filter: mtf.libs.mtf_pybinder.pcpp.GeneralFilter, raw_packet: mtf.libs.mtf_pybinder.pcpp.RawPacket) bool
Match a raw packet with a given BPF filter. Notice this method is static which means you don’t need any device instance in order to perform this match
- Args:
filter (pcpp.GeneralFilter): A filter class to test against raw_packet (pcpp.RawPacket): A pointer to the raw packet to match the filter with
- Returns:
bool: True if raw packet matches the filter or false otherwise
- open(self: mtf.libs.mtf_pybinder.pcpp.SnoopFileReaderDevice) bool
Open the file name which path was specified in the constructor in a read-only mode
- Returns:
bool: True if file was opened successfully or if file is already opened. False if opening the file failed for some reason (for example:
file path does not exist)
- set_filter(*args, **kwargs)
Overloaded function.
set_filter(self: mtf.libs.mtf_pybinder.pcpp.IFilterableDevice, filter: mtf.libs.mtf_pybinder.pcpp.GeneralFilter) -> bool
Set a filter for the device. When implemented by the device, only packets that match the filter will be received
- Args:
filter (pcpp.GeneralFilter): The filter to be set in PcapPlusPlus’ GeneralFilter format
- Returns:
bool: True if filter set successfully, false otherwise
set_filter(self: mtf.libs.mtf_pybinder.pcpp.IFilterableDevice, filter_as_string: str) -> bool
Set a filter for the device. When implemented by the device, only packets that match the filter will be received
- Args:
filter_as_string (str): The filter to be set in Berkeley Packet Filter (BPF) syntax (http://biot.com/capstats/bpf.html)
- Returns:
bool: True if filter set successfully, false otherwise
- class mtf.libs.mtf_pybinder.pcpp.SomeIpLayer
Represents a SOME/IP protocol layer
- ERRORS
- ERROR_ACK
- class MsgType
SOME/IP message types
Members:
REQUEST
REQUEST_ACK
REQUEST_NO_RETURN
REQUEST_NO_RETURN_ACK
NOTIFICATION
NOTIFICATION_ACK
RESPONSE
RESPONSE_ACK
ERRORS
ERROR_ACK
TP_REQUEST
TP_REQUEST_NO_RETURN
TP_NOTIFICATION
TP_RESPONSE
TP_ERROR
- ERRORS
- ERROR_ACK
- NOTIFICATION
- NOTIFICATION_ACK
- REQUEST
- REQUEST_ACK
- REQUEST_NO_RETURN
- REQUEST_NO_RETURN_ACK
- RESPONSE
- RESPONSE_ACK
- TP_ERROR
- TP_NOTIFICATION
- TP_REQUEST
- TP_REQUEST_NO_RETURN
- TP_RESPONSE
- __init__(self: mtf.libs.mtf_pybinder.pcpp.SomeIpLayer.MsgType, value: int) None
- __new__(**kwargs)
- property name
- property value
- NOTIFICATION
- NOTIFICATION_ACK
- REQUEST
- REQUEST_ACK
- REQUEST_NO_RETURN
- REQUEST_NO_RETURN_ACK
- RESPONSE
- RESPONSE_ACK
- TP_ERROR
- TP_NOTIFICATION
- TP_REQUEST
- TP_REQUEST_NO_RETURN
- TP_RESPONSE
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.SomeIpLayer, data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: pcpp::Packet) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.SomeIpLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.SomeIpLayer, arg0: int, arg1: int, arg2: int, arg3: int, arg4: int, arg5: pcpp::SomeIpLayer::MsgType, arg6: int) -> None
doc
__init__(self: mtf.libs.mtf_pybinder.pcpp.SomeIpLayer, arg0: int, arg1: int, arg2: int, arg3: int, arg4: int, arg5: pcpp::SomeIpLayer::MsgType, arg6: int, arg7: int) -> None
doc
__init__(self: mtf.libs.mtf_pybinder.pcpp.SomeIpLayer, service_id: int, method_id: int, client_id: int, session_id: int, interface_version: int, type: pcpp::SomeIpLayer::MsgType, return_code: int, data: numpy.ndarray[numpy.uint8]) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.SomeIpLayer, arg0: mtf.libs.mtf_pybinder.pcpp.SomeIpLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.SomeIpLayer, arg0: mtf.libs.mtf_pybinder.pcpp.SomeIpLayer) -> None
- __new__(**kwargs)
- static add_some_ip_port(port: int) None
Adds port to a list of ports where pcap checks for SOME/IP communication. Each port must be removed at the end inorder to have no memory leak.
- Args:
port (unsigned int): Port to add
- assign(self: mtf.libs.mtf_pybinder.pcpp.SomeIpLayer, : mtf.libs.mtf_pybinder.pcpp.SomeIpLayer) mtf.libs.mtf_pybinder.pcpp.SomeIpLayer
- Returns:
pcpp.SomeIpLayer
- property client_id
Client ID
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_pdu_payload(self: mtf.libs.mtf_pybinder.pcpp.SomeIpLayer) numpy.ndarray[numpy.uint8]
A pointer for the layer payload, meaning the first byte after the header
- get_pdu_payload_size(self: mtf.libs.mtf_pybinder.pcpp.SomeIpLayer) int
The size in bytes of the payload
- Returns:
unsigned int
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- property interface_version
Interface Version
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- static is_some_ip_port(port: int) bool
Checks if given port is a SOME/IP protocol port (only Service Discovery ports are checked for now)
- Args:
port (unsigned int): Port to check
- Returns:
bool: true if SOME/IP protocol port, false if not
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property length_field
The length field of the SOME/IP header
- property message_id
Message ID
- property message_type
Message type
- property message_type_as_int
Message type as int
- property method_id
Method ID
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- static parse_some_ip_layer(data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: pcpp::Packet) mtf.libs.mtf_pybinder.pcpp.Layer
A static method that creates a SOME/IP or SOME/IP-TP layer from packet raw data. Returns PayloadLayer if datais not valid.
- Args:
data (bytes): A pointer to the raw data data_len (unsigned int): Size of the data in bytes prev_layer (pcpp.Layer): A pointer to theprevious layer packet (pcpp.Packet): A pointer to the Packet instance where layer will be stored
- Returns:
pcpp.Layer: Layer* A newlyallocated layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property protocol_version
Protocol Version
- static remove_all_some_ip_ports() None
Removes all ports from a list of ports where pcap checks for SOME/IP communication.
- static remove_some_ip_port(port: int) None
Removes port from a list of ports where pcap checks for SOME/IP communication.
- Args:
port (unsigned int): Port to remove
- property request_id
Request ID
- property return_code
Return Code
- property service_id
Service ID
- property session_id
Session ID
- set_payload_length(self: mtf.libs.mtf_pybinder.pcpp.SomeIpLayer, payload_length: int) None
Set the length field of the SOME/IP header
- Args:
payload_length (unsigned int): Length of the payload
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.SomeIpSdConfigurationOption
Implements the Configuration option of SOME/IP-SD protocol
- class OptionType
Types of options currently available for the SOME/IP-SD protocol
Members:
Unknown
ConfigurationString
LoadBalancing
IPv4Endpoint
IPv6Endpoint
IPv4Multicast
IPv6Multicast
IPv4SdEndpoint
IPv6SdEndpoint
- ConfigurationString
- IPv4Endpoint
- IPv4Multicast
- IPv4SdEndpoint
- IPv6Endpoint
- IPv6Multicast
- IPv6SdEndpoint
- LoadBalancing
- Unknown
- __init__(self: mtf.libs.mtf_pybinder.pcpp.SomeIpSdOption.OptionType, value: int) None
- __new__(**kwargs)
- property name
- property value
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.SomeIpSdConfigurationOption, configuration_string: str) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.SomeIpSdConfigurationOption, data_container: mtf.libs.mtf_pybinder.pcpp.IDataContainer, offset: int) -> None
- __new__(**kwargs)
- property configuration_string
Get the configuration string std::string
- Returns:
str
- property length
Get the Length of the SOME/IP-SD option size_t
- Returns:
unsigned int
- property type
Get the Option Type
- Returns:
enum pcpp.SomeIpSdOption.OptionType: OptionType
- class mtf.libs.mtf_pybinder.pcpp.SomeIpSdEntry
Implementation of the SOME/IP-SD Service Entry and Eventgroup Entry Type
- class EntryType
Types of entries that can occur in SOME/IP-SD
Members:
FindService
OfferService
StopOfferService
SubscribeEventgroup
StopSubscribeEventgroup
SubscribeEventgroupAck
SubscribeEventgroupNack
UnknownEntryType
- FindService
- OfferService
- StopOfferService
- StopSubscribeEventgroup
- SubscribeEventgroup
- SubscribeEventgroupAck
- SubscribeEventgroupNack
- UnknownEntryType
- __init__(self: mtf.libs.mtf_pybinder.pcpp.SomeIpSdEntry.EntryType, value: int) None
- __new__(**kwargs)
- property name
- property value
- FindService
- OfferService
- StopOfferService
- StopSubscribeEventgroup
- SubscribeEventgroup
- SubscribeEventgroupAck
- SubscribeEventgroupNack
- UnknownEntryType
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.SomeIpSdEntry, type: pcpp::SomeIpSdEntry::EntryType, service_id: int, instance_id: int, major_version: int, ttl: int, minor_version: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.SomeIpSdEntry, type: pcpp::SomeIpSdEntry::EntryType, service_id: int, instance_id: int, major_version: int, ttl: int, counter: int, event_group_id: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.SomeIpSdEntry, p_some_ip_sd_layer: mtf.libs.mtf_pybinder.pcpp.SomeIpSdLayer, offset: int) -> None
- __new__(**kwargs)
- property counter
Counter value
- property event_group_id
Event Group Id
- property index_first_option
Index 1st option
- property index_second_option
Index 2nd option
- property instance_id
Instance Id
- property length
Length of the SomeIpSd Entry
- property major_version
Major version
- property minor_version
Minor version
- property num_options
Number of Options of this Entry
- property num_options_1
Number of Options 1 of this Entry
- property num_options_2
Number of Options 2 of this Entry
- property service_id
Service Id
- property ttl
Time to Live value
- property type
Entry Type
- class mtf.libs.mtf_pybinder.pcpp.SomeIpSdIPv4Option
Implements the following SOME/IP-SD Options: IPv4 Endpoint, IPv4 Multicast, IPv4 SD Endpoint
- IPv4Endpoint
- IPv4Multicast
- IPv4SdEndpoint
- class OptionType
Types of options currently available for the SOME/IP-SD protocol
Members:
Unknown
ConfigurationString
LoadBalancing
IPv4Endpoint
IPv6Endpoint
IPv4Multicast
IPv6Multicast
IPv4SdEndpoint
IPv6SdEndpoint
- ConfigurationString
- IPv4Endpoint
- IPv4Multicast
- IPv4SdEndpoint
- IPv6Endpoint
- IPv6Multicast
- IPv6SdEndpoint
- LoadBalancing
- Unknown
- __init__(self: mtf.libs.mtf_pybinder.pcpp.SomeIpSdOption.OptionType, value: int) None
- __new__(**kwargs)
- property name
- property value
- class SomeIpSdIPv4OptionType
Types of options which are implemented with this class
Members:
IPv4Endpoint
IPv4Multicast
IPv4SdEndpoint
- IPv4Endpoint
- IPv4Multicast
- IPv4SdEndpoint
- __init__(self: mtf.libs.mtf_pybinder.pcpp.SomeIpSdIPv4Option.SomeIpSdIPv4OptionType, value: int) None
- __new__(**kwargs)
- property name
- property value
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.SomeIpSdIPv4Option, type: pcpp::SomeIpSdIPv4Option::IPv4OptionType, ip_address: mtf.libs.mtf_pybinder.pcpp.IPv4Address, port: int, l4_protocol: mtf.libs.mtf_pybinder.pcpp.SomeIpSdProtocolType) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.SomeIpSdIPv4Option, data_container: mtf.libs.mtf_pybinder.pcpp.IDataContainer, offset: int) -> None
- __new__(**kwargs)
- property ip_address
Get the Ip Address IPv4Address
- Returns:
pcpp.IPv4Address
- property length
Get the Length of the SOME/IP-SD option size_t
- Returns:
unsigned int
- property port
Get the Port uint16_t
- Returns:
unsigned int
- property protocol
Get the Protocol SomeIpSdProtocolType
- Returns:
enum pcpp.SomeIpSdProtocolType
- property type
Get the Option Type
- Returns:
enum pcpp.SomeIpSdOption.OptionType: OptionType
- class mtf.libs.mtf_pybinder.pcpp.SomeIpSdIPv6Option
Implements the following SOME/IP-SD Options: IPv6 Endpoint, IPv6 Multicast, IPv6 SD Endpoint
- IPv6Endpoint
- IPv6Multicast
- IPv6SdEndpoint
- class OptionType
Types of options currently available for the SOME/IP-SD protocol
Members:
Unknown
ConfigurationString
LoadBalancing
IPv4Endpoint
IPv6Endpoint
IPv4Multicast
IPv6Multicast
IPv4SdEndpoint
IPv6SdEndpoint
- ConfigurationString
- IPv4Endpoint
- IPv4Multicast
- IPv4SdEndpoint
- IPv6Endpoint
- IPv6Multicast
- IPv6SdEndpoint
- LoadBalancing
- Unknown
- __init__(self: mtf.libs.mtf_pybinder.pcpp.SomeIpSdOption.OptionType, value: int) None
- __new__(**kwargs)
- property name
- property value
- class SomeIpSdIPv6OptionType
Types of options which are implemented with this class
Members:
IPv6Endpoint
IPv6Multicast
IPv6SdEndpoint
- IPv6Endpoint
- IPv6Multicast
- IPv6SdEndpoint
- __init__(self: mtf.libs.mtf_pybinder.pcpp.SomeIpSdIPv6Option.SomeIpSdIPv6OptionType, value: int) None
- __new__(**kwargs)
- property name
- property value
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.SomeIpSdIPv6Option, type: pcpp::SomeIpSdIPv6Option::IPv6OptionType, ip_address: mtf.libs.mtf_pybinder.pcpp.IPv6Address, port: int, l4_protocol: mtf.libs.mtf_pybinder.pcpp.SomeIpSdProtocolType) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.SomeIpSdIPv6Option, data_container: mtf.libs.mtf_pybinder.pcpp.IDataContainer, offset: int) -> None
- __new__(**kwargs)
- property ip_address
Get the Ip Address IPv6Address
- Returns:
pcpp.IPv6Address
- property length
Get the Length of the SOME/IP-SD option size_t
- Returns:
unsigned int
- property port
Get the Port uint16_t
- Returns:
unsigned int
- property protocol
Get the Protocol SomeIpSdProtocolType
- Returns:
enum pcpp.SomeIpSdProtocolType
- property type
Get the Option Type
- Returns:
enum pcpp.SomeIpSdOption.OptionType: OptionType
- class mtf.libs.mtf_pybinder.pcpp.SomeIpSdLayer
Implementation of the SOME/IP-SD protocol
- ERRORS
- ERROR_ACK
- class MsgType
SOME/IP message types
Members:
REQUEST
REQUEST_ACK
REQUEST_NO_RETURN
REQUEST_NO_RETURN_ACK
NOTIFICATION
NOTIFICATION_ACK
RESPONSE
RESPONSE_ACK
ERRORS
ERROR_ACK
TP_REQUEST
TP_REQUEST_NO_RETURN
TP_NOTIFICATION
TP_RESPONSE
TP_ERROR
- ERRORS
- ERROR_ACK
- NOTIFICATION
- NOTIFICATION_ACK
- REQUEST
- REQUEST_ACK
- REQUEST_NO_RETURN
- REQUEST_NO_RETURN_ACK
- RESPONSE
- RESPONSE_ACK
- TP_ERROR
- TP_NOTIFICATION
- TP_REQUEST
- TP_REQUEST_NO_RETURN
- TP_RESPONSE
- __init__(self: mtf.libs.mtf_pybinder.pcpp.SomeIpLayer.MsgType, value: int) None
- __new__(**kwargs)
- property name
- property value
- NOTIFICATION
- NOTIFICATION_ACK
- REQUEST
- REQUEST_ACK
- REQUEST_NO_RETURN
- REQUEST_NO_RETURN_ACK
- RESPONSE
- RESPONSE_ACK
- TP_ERROR
- TP_NOTIFICATION
- TP_REQUEST
- TP_REQUEST_NO_RETURN
- TP_RESPONSE
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.SomeIpSdLayer, data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: pcpp::Packet) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.SomeIpSdLayer, service_id: int = 0, method_id: int = 0, client_id: int = 0, session_id: int = 0, interface_version: int = 0, type: mtf.libs.mtf_pybinder.pcpp.SomeIpLayer.MsgType = <MsgType.REQUEST: 0>, return_code: int = 0, flags: int = 0) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.SomeIpSdLayer, arg0: mtf.libs.mtf_pybinder.pcpp.SomeIpSdLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.SomeIpSdLayer, arg0: mtf.libs.mtf_pybinder.pcpp.SomeIpSdLayer) -> None
- __new__(**kwargs)
- add_entry(self: mtf.libs.mtf_pybinder.pcpp.SomeIpSdLayer, entry: pcpp::SomeIpSdEntry) int
Adds a given entry to the layer and returns the index of the entry
- Args:
entry (pcpp.SomeIpSdEntry): The entry that shall be addedto the layer
- Returns:
unsigned int: uint32_t Returns the index of the entry starting with 0
- add_option_to(self: mtf.libs.mtf_pybinder.pcpp.SomeIpSdLayer, index_entry: int, option: pcpp::SomeIpSdOption) bool
Adds an option to an entry that has already been added to the layer by using addEntry(). The option is also addedto the layer itself. If the option cannot by assigned to the entry, the option is not copied into the layer.
- Args:
index_entry (unsigned int): Index of the entry where the option shall be added. First Entry has index 0 option (pcpp.SomeIpSdOption): The option that shall be added
- Returns:
bool: True if the option could be assigned to the entry and was copied into the layer, false otherwise
- static add_some_ip_port(port: int) None
Adds port to a list of ports where pcap checks for SOME/IP communication. Each port must be removed at the end inorder to have no memory leak.
- Args:
port (unsigned int): Port to add
- assign(self: mtf.libs.mtf_pybinder.pcpp.SomeIpSdLayer, : mtf.libs.mtf_pybinder.pcpp.SomeIpSdLayer) mtf.libs.mtf_pybinder.pcpp.SomeIpSdLayer
- Returns:
pcpp.SomeIpSdLayer
- property client_id
Client ID
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- property flags
Flags of the layer
- get_entries(self: mtf.libs.mtf_pybinder.pcpp.SomeIpSdLayer) list[pcpp::SomeIpSdEntry]
Get the Entries from SomeIpSd layer
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_options(self: mtf.libs.mtf_pybinder.pcpp.SomeIpSdLayer) list[pcpp::SomeIpSdOption]
Get the Options from SomeIpSd layer
- get_pdu_payload(self: mtf.libs.mtf_pybinder.pcpp.SomeIpLayer) numpy.ndarray[numpy.uint8]
A pointer for the layer payload, meaning the first byte after the header
- get_pdu_payload_size(self: mtf.libs.mtf_pybinder.pcpp.SomeIpLayer) int
The size in bytes of the payload
- Returns:
unsigned int
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- property interface_version
Interface Version
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- static is_data_valid(data: int, data_len: int) bool
The static method makes validation of input data
- Args:
data (bytes): The byte stream of IPpacket data_len (unsigned int): The length of byte stream
- Returns:
bool: True if the data is valid and can represent the packet
- static is_some_ip_port(port: int) bool
Checks if given port is a SOME/IP protocol port (only Service Discovery ports are checked for now)
- Args:
port (unsigned int): Port to check
- Returns:
bool: true if SOME/IP protocol port, false if not
- static is_someip_sd_port(port: int) bool
Checks if given port is a SOME/IP-SD protocol port
- Args:
port (unsigned int): Port to check
- Returns:
bool: true if SOME/IP-SD protocolport, false if not
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property len_entries
Length of entries in this layer
- property len_options
Length of options in this layer
- property length_field
The length field of the SOME/IP header
- property message_id
Message ID
- property message_type
Message type
- property message_type_as_int
Message type as int
- property method_id
Method ID
- property num_entries
Number of entries in this layer
- property num_options
Number of options in this layer
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- static parse_some_ip_layer(data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: pcpp::Packet) mtf.libs.mtf_pybinder.pcpp.Layer
A static method that creates a SOME/IP or SOME/IP-TP layer from packet raw data. Returns PayloadLayer if datais not valid.
- Args:
data (bytes): A pointer to the raw data data_len (unsigned int): Size of the data in bytes prev_layer (pcpp.Layer): A pointer to theprevious layer packet (pcpp.Packet): A pointer to the Packet instance where layer will be stored
- Returns:
pcpp.Layer: Layer* A newlyallocated layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property protocol_version
Protocol Version
- static remove_all_some_ip_ports() None
Removes all ports from a list of ports where pcap checks for SOME/IP communication.
- static remove_some_ip_port(port: int) None
Removes port from a list of ports where pcap checks for SOME/IP communication.
- Args:
port (unsigned int): Port to remove
- property request_id
Request ID
- property return_code
Return Code
- property service_id
Service ID
- property session_id
Session ID
- set_payload_length(self: mtf.libs.mtf_pybinder.pcpp.SomeIpLayer, payload_length: int) None
Set the length field of the SOME/IP header
- Args:
payload_length (unsigned int): Length of the payload
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.SomeIpSdLoadBalancingOption
Implements the Load Balancing option of SOME/IP-SD protocol
- class OptionType
Types of options currently available for the SOME/IP-SD protocol
Members:
Unknown
ConfigurationString
LoadBalancing
IPv4Endpoint
IPv6Endpoint
IPv4Multicast
IPv6Multicast
IPv4SdEndpoint
IPv6SdEndpoint
- ConfigurationString
- IPv4Endpoint
- IPv4Multicast
- IPv4SdEndpoint
- IPv6Endpoint
- IPv6Multicast
- IPv6SdEndpoint
- LoadBalancing
- Unknown
- __init__(self: mtf.libs.mtf_pybinder.pcpp.SomeIpSdOption.OptionType, value: int) None
- __new__(**kwargs)
- property name
- property value
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.SomeIpSdLoadBalancingOption, priority: int, weight: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.SomeIpSdLoadBalancingOption, data_container: mtf.libs.mtf_pybinder.pcpp.IDataContainer, offset: int) -> None
- __new__(**kwargs)
- property length
Get the Length of the SOME/IP-SD option size_t
- Returns:
unsigned int
- property priority
Get the priority fild uint16_t
- Returns:
unsigned int
- property type
Get the Option Type
- Returns:
enum pcpp.SomeIpSdOption.OptionType: OptionType
- property weight
Get the weight field uint16_t
- Returns:
unsigned int
- class mtf.libs.mtf_pybinder.pcpp.SomeIpSdOption
Base class of the SOME/IP-SD options. Cannot be instantiated.
- class OptionType
Types of options currently available for the SOME/IP-SD protocol
Members:
Unknown
ConfigurationString
LoadBalancing
IPv4Endpoint
IPv6Endpoint
IPv4Multicast
IPv6Multicast
IPv4SdEndpoint
IPv6SdEndpoint
- ConfigurationString
- IPv4Endpoint
- IPv4Multicast
- IPv4SdEndpoint
- IPv6Endpoint
- IPv6Multicast
- IPv6SdEndpoint
- LoadBalancing
- Unknown
- __init__(self: mtf.libs.mtf_pybinder.pcpp.SomeIpSdOption.OptionType, value: int) None
- __new__(**kwargs)
- property name
- property value
- __init__(*args, **kwargs)
- __new__(**kwargs)
- property length
Get the Length of the SOME/IP-SD option size_t
- Returns:
unsigned int
- property type
Get the Option Type
- Returns:
enum pcpp.SomeIpSdOption.OptionType: OptionType
- class mtf.libs.mtf_pybinder.pcpp.SomeIpSdProtocolType
Types of protocols that can be referenced in SOME/IP-SD
Members:
SD_TCP
SD_UDP
- SD_TCP
- SD_UDP
- __init__(self: mtf.libs.mtf_pybinder.pcpp.SomeIpSdProtocolType, value: int) None
- __new__(**kwargs)
- property name
- property value
- class mtf.libs.mtf_pybinder.pcpp.SomeIpTpLayer
Represents an SOME/IP Transport Protocol Layer
- ERRORS
- ERROR_ACK
- class MsgType
SOME/IP message types
Members:
REQUEST
REQUEST_ACK
REQUEST_NO_RETURN
REQUEST_NO_RETURN_ACK
NOTIFICATION
NOTIFICATION_ACK
RESPONSE
RESPONSE_ACK
ERRORS
ERROR_ACK
TP_REQUEST
TP_REQUEST_NO_RETURN
TP_NOTIFICATION
TP_RESPONSE
TP_ERROR
- ERRORS
- ERROR_ACK
- NOTIFICATION
- NOTIFICATION_ACK
- REQUEST
- REQUEST_ACK
- REQUEST_NO_RETURN
- REQUEST_NO_RETURN_ACK
- RESPONSE
- RESPONSE_ACK
- TP_ERROR
- TP_NOTIFICATION
- TP_REQUEST
- TP_REQUEST_NO_RETURN
- TP_RESPONSE
- __init__(self: mtf.libs.mtf_pybinder.pcpp.SomeIpLayer.MsgType, value: int) None
- __new__(**kwargs)
- property name
- property value
- NOTIFICATION
- NOTIFICATION_ACK
- REQUEST
- REQUEST_ACK
- REQUEST_NO_RETURN
- REQUEST_NO_RETURN_ACK
- RESPONSE
- RESPONSE_ACK
- TP_ERROR
- TP_NOTIFICATION
- TP_REQUEST
- TP_REQUEST_NO_RETURN
- TP_RESPONSE
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.SomeIpTpLayer, service_id: int, method_id: int, client_id: int, session_id: int, interface_version: int, type: mtf.libs.mtf_pybinder.pcpp.SomeIpLayer.MsgType, return_code: int, offset: int, more_segments_flag: bool, data: int, data_len: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.SomeIpTpLayer, arg0: mtf.libs.mtf_pybinder.pcpp.SomeIpTpLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.SomeIpTpLayer, arg0: mtf.libs.mtf_pybinder.pcpp.SomeIpTpLayer) -> None
- __new__(**kwargs)
- static add_some_ip_port(port: int) None
Adds port to a list of ports where pcap checks for SOME/IP communication. Each port must be removed at the end inorder to have no memory leak.
- Args:
port (unsigned int): Port to add
- assign(self: mtf.libs.mtf_pybinder.pcpp.SomeIpTpLayer, : mtf.libs.mtf_pybinder.pcpp.SomeIpTpLayer) mtf.libs.mtf_pybinder.pcpp.SomeIpTpLayer
- Returns:
pcpp.SomeIpTpLayer
- property client_id
Client ID
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- static deserialize_someip_payload(arg0: list[int], arg1: int | str, arg2: int | str) dict[str, str | float | int | int]
deserialize someIp payload
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_pdu_payload(self: mtf.libs.mtf_pybinder.pcpp.SomeIpLayer) numpy.ndarray[numpy.uint8]
A pointer for the layer payload, meaning the first byte after the header
- get_pdu_payload_size(self: mtf.libs.mtf_pybinder.pcpp.SomeIpLayer) int
The size in bytes of the payload
- Returns:
unsigned int
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- property interface_version
Interface Version
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- static is_some_ip_port(port: int) bool
Checks if given port is a SOME/IP protocol port (only Service Discovery ports are checked for now)
- Args:
port (unsigned int): Port to check
- Returns:
bool: true if SOME/IP protocol port, false if not
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property length_field
The length field of the SOME/IP header
- property message_id
Message ID
- property message_type
Message type
- property message_type_as_int
Message type as int
- property method_id
Method ID
- property more_segments_flag
More Segments Flag
- property offset
Offset in multiple of 16 bytes
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- static parse_some_ip_layer(data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: pcpp::Packet) mtf.libs.mtf_pybinder.pcpp.Layer
A static method that creates a SOME/IP or SOME/IP-TP layer from packet raw data. Returns PayloadLayer if datais not valid.
- Args:
data (bytes): A pointer to the raw data data_len (unsigned int): Size of the data in bytes prev_layer (pcpp.Layer): A pointer to theprevious layer packet (pcpp.Packet): A pointer to the Packet instance where layer will be stored
- Returns:
pcpp.Layer: Layer* A newlyallocated layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property protocol_version
Protocol Version
- static remove_all_some_ip_ports() None
Removes all ports from a list of ports where pcap checks for SOME/IP communication.
- static remove_some_ip_port(port: int) None
Removes port from a list of ports where pcap checks for SOME/IP communication.
- Args:
port (unsigned int): Port to remove
- property request_id
Request ID
- property return_code
Return Code
- property service_id
Service ID
- property session_id
Session ID
- set_payload_length(self: mtf.libs.mtf_pybinder.pcpp.SomeIpLayer, payload_length: int) None
Set the length field of the SOME/IP header
- Args:
payload_length (unsigned int): Length of the payload
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.TECMPLayer
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.TECMPLayer, data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.TECMPLayer, data: int, data_len: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.TECMPLayer, arg0: mtf.libs.mtf_pybinder.pcpp.TECMPLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.TECMPLayer, arg0: mtf.libs.mtf_pybinder.pcpp.TECMPLayer) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.TECMPLayer, : mtf.libs.mtf_pybinder.pcpp.TECMPLayer) mtf.libs.mtf_pybinder.pcpp.TECMPLayer
- Returns:
pcpp.TECMPLayer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property counter
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- property data_type
- property device_flags
- property device_id
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property message_type
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property reserved
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- property version
- class mtf.libs.mtf_pybinder.pcpp.TECMPPayloadLayer
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.TECMPPayloadLayer, data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.TECMPPayloadLayer, data: int, data_len: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.TECMPPayloadLayer, arg0: mtf.libs.mtf_pybinder.pcpp.TECMPPayloadLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.TECMPPayloadLayer, arg0: mtf.libs.mtf_pybinder.pcpp.TECMPPayloadLayer) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.TECMPPayloadLayer, : mtf.libs.mtf_pybinder.pcpp.TECMPPayloadLayer) mtf.libs.mtf_pybinder.pcpp.TECMPPayloadLayer
- Returns:
pcpp.TECMPPayloadLayer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_flags
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- property data_type
- get_bus_data_num(self: mtf.libs.mtf_pybinder.pcpp.TECMPPayloadLayer) int
- get_bus_datas(self: mtf.libs.mtf_pybinder.pcpp.TECMPPayloadLayer) list[mtf.libs.mtf_pybinder.pcpp.bus_data]
Get the bus data as a list of BusData objects
- get_bus_datas_without_vendor(self: mtf.libs.mtf_pybinder.pcpp.TECMPPayloadLayer) list[mtf.libs.mtf_pybinder.pcpp.bus_data_without_vendor]
Get the bus data as a list of bus_data_without_vendor objects
- get_ethernet2_status_bus(self: mtf.libs.mtf_pybinder.pcpp.TECMPPayloadLayer) mtf.libs.mtf_pybinder.pcpp.tecmp_header_none
- Returns:
pcpp.tecmp_header_none
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- get_tecmp10base_t1s(self: mtf.libs.mtf_pybinder.pcpp.TECMPPayloadLayer) mtf.libs.mtf_pybinder.pcpp.tecmp_header_10base_t1s
- Returns:
pcpp.tecmp_header_10base_t1s
- get_tecmp_header_analog(self: mtf.libs.mtf_pybinder.pcpp.TECMPPayloadLayer) mtf.libs.mtf_pybinder.pcpp.tecmp_header_analog
- Returns:
pcpp.tecmp_header_analog
- get_tecmp_header_can(self: mtf.libs.mtf_pybinder.pcpp.TECMPPayloadLayer) mtf.libs.mtf_pybinder.pcpp.tecmp_header_can
- Returns:
pcpp.tecmp_header_can
- get_tecmp_header_can_fd(self: mtf.libs.mtf_pybinder.pcpp.TECMPPayloadLayer) mtf.libs.mtf_pybinder.pcpp.tecmp_header_can_fd
- Returns:
pcpp.tecmp_header_can_fd
- get_tecmp_header_control_message(self: mtf.libs.mtf_pybinder.pcpp.TECMPPayloadLayer) mtf.libs.mtf_pybinder.pcpp.tecmp_header_control_message
get Tecmp Control Message
- Returns:
pcpp.tecmp_header_control_message
- get_tecmp_header_flexray(self: mtf.libs.mtf_pybinder.pcpp.TECMPPayloadLayer) mtf.libs.mtf_pybinder.pcpp.tecmp_header_flexray
- Returns:
pcpp.tecmp_header_flexray
- get_tecmp_header_lin(self: mtf.libs.mtf_pybinder.pcpp.TECMPPayloadLayer) mtf.libs.mtf_pybinder.pcpp.tecmp_header_lin
- Returns:
pcpp.tecmp_header_lin
- get_tecmp_header_none(self: mtf.libs.mtf_pybinder.pcpp.TECMPPayloadLayer) mtf.libs.mtf_pybinder.pcpp.tecmp_header_none
- Returns:
pcpp.tecmp_header_none
- get_vendor_data(self: mtf.libs.mtf_pybinder.pcpp.TECMPPayloadLayer) mtf.libs.mtf_pybinder.pcpp.te_vendor_data
Get the vendor data (TeVendorData pointer)
- property header_len
The header length in bytes
- Returns:
unsigned int
- property interface_id
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- is_bus_datas_without_vendor(self: mtf.libs.mtf_pybinder.pcpp.TECMPPayloadLayer) bool
- is_bus_status_message(self: mtf.libs.mtf_pybinder.pcpp.TECMPPayloadLayer) bool
- Returns:
bool
- is_ethernet2_status_bus(self: mtf.libs.mtf_pybinder.pcpp.TECMPPayloadLayer) bool
- is_wakeup_symbol(self: mtf.libs.mtf_pybinder.pcpp.TECMPPayloadLayer) bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property length
- property message_type
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property timestamp_ns
- property timestamp_sync_reserved
- property timestamp_sync_status
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.TLSECPointFormatExtension
Represents TLS EC (Elliptic Curves) Point Format extension. Inherits from SSLExtension and adds parsing of the EC point formats mentioned in the extension data
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.TLSECPointFormatExtension, data: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.TLSECPointFormatExtension, arg0: mtf.libs.mtf_pybinder.pcpp.TLSECPointFormatExtension) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.SSLExtension, : mtf.libs.mtf_pybinder.pcpp.SSLExtension) mtf.libs.mtf_pybinder.pcpp.SSLExtension
- Returns:
pcpp.SSLExtension
- property data
Raw data of the extension
- property ec_point_format_list
A vector of the elliptic curves point formats
- Returns:
list[unsigned int]
- property length
The length of the extension data in bytes (not including the type and length fields)
- Returns:
unsigned int
- property total_length
The total length of the extension, including type and length fields and the extension data field
- Returns:
unsigned int
- property type
The type of the extension as enum
- Returns:
enum pcpp.SSLExtensionType
- property type_as_int
The type of the extension as a numeric value
- Returns:
unsigned int
- class mtf.libs.mtf_pybinder.pcpp.TLSSupportedGroupsExtension
Represents TLS Supported Groups extension. Inherits from SSLExtension and adds parsing of the supported groups (Elliptic Curves) mentioned in the extension data
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.TLSSupportedGroupsExtension, data: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.TLSSupportedGroupsExtension, arg0: mtf.libs.mtf_pybinder.pcpp.TLSSupportedGroupsExtension) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.SSLExtension, : mtf.libs.mtf_pybinder.pcpp.SSLExtension) mtf.libs.mtf_pybinder.pcpp.SSLExtension
- Returns:
pcpp.SSLExtension
- property data
Raw data of the extension
- property length
The length of the extension data in bytes (not including the type and length fields)
- Returns:
unsigned int
- property supported_groups
A vector of the supported groups (also known as “Elliptic Curves”)
- Returns:
list[unsigned int]
- property total_length
The total length of the extension, including type and length fields and the extension data field
- Returns:
unsigned int
- property type
The type of the extension as enum
- Returns:
enum pcpp.SSLExtensionType
- property type_as_int
The type of the extension as a numeric value
- Returns:
unsigned int
- class mtf.libs.mtf_pybinder.pcpp.TLVRecordBuilder
A base class for building Type-Length-Value (TLV) records. This builder receives the record parameters in its c’tor, builds the record raw buffer and provides a method to build a TLVRecord object out of it. Please notice this is a base class that lacks the capability of actually building TLVRecord objects and also cannot be instantiated. The reason for that is that different protocols build TLV records in different ways, so these missing capabilities will be implemented by the derived classes which are specific to each protocol. This class only provides the common infrastructure that will be used by them
- __init__(*args, **kwargs)
- __new__(**kwargs)
- class mtf.libs.mtf_pybinder.pcpp.TLVRecordReader_pcpp_IPv4Option_t
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.TLVRecordReader_pcpp_IPv4Option_t) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.TLVRecordReader_pcpp_IPv4Option_t, arg0: mtf.libs.mtf_pybinder.pcpp.TLVRecordReader_pcpp_IPv4Option_t) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.TLVRecordReader_pcpp_IPv4Option_t, other: mtf.libs.mtf_pybinder.pcpp.TLVRecordReader_pcpp_IPv4Option_t) mtf.libs.mtf_pybinder.pcpp.TLVRecordReader_pcpp_IPv4Option_t
Overload of an assignment operator. Returns:
pcpp.IPv4Option
- change_tlv_record_count(self: mtf.libs.mtf_pybinder.pcpp.TLVRecordReader_pcpp_IPv4Option_t, changed_by: int) None
- Args:
changed_by (int)
- get_first_tlv_record(self: mtf.libs.mtf_pybinder.pcpp.TLVRecordReader_pcpp_IPv4Option_t, tlv_data_base_ptr: int, tlv_data_len: int) pcpp::IPv4Option
- Args:
tlv_data_base_ptr (bytes) tlv_data_len (unsigned int)
- Returns:
pcpp.IPv4Option
- get_next_tlv_record(self: mtf.libs.mtf_pybinder.pcpp.TLVRecordReader_pcpp_IPv4Option_t, record: pcpp::IPv4Option, tlv_data_base_ptr: int, tlv_data_len: int) pcpp::IPv4Option
- Args:
record (pcpp.IPv4Option) tlv_data_base_ptr (bytes) tlv_data_len (unsigned int)
- Returns:
pcpp.IPv4Option
- get_tlv_record(self: mtf.libs.mtf_pybinder.pcpp.TLVRecordReader_pcpp_IPv4Option_t, record_type: int, tlv_data_base_ptr: int, tlv_data_len: int) pcpp::IPv4Option
- Args:
record_type (unsigned int) tlv_data_base_ptr (bytes) tlv_data_len (unsigned int)
- Returns:
pcpp.IPv4Option
- get_tlv_record_count(self: mtf.libs.mtf_pybinder.pcpp.TLVRecordReader_pcpp_IPv4Option_t, tlv_data_base_ptr: int, tlv_data_len: int) int
- Args:
tlv_data_base_ptr (bytes) tlv_data_len (unsigned int)
- Returns:
unsigned int
- class mtf.libs.mtf_pybinder.pcpp.TLVRecordReader_pcpp_IPv6TLVOptionHeader_IPv6Option_t
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.TLVRecordReader_pcpp_IPv6TLVOptionHeader_IPv6Option_t) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.TLVRecordReader_pcpp_IPv6TLVOptionHeader_IPv6Option_t, arg0: mtf.libs.mtf_pybinder.pcpp.TLVRecordReader_pcpp_IPv6TLVOptionHeader_IPv6Option_t) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.TLVRecordReader_pcpp_IPv6TLVOptionHeader_IPv6Option_t, other: mtf.libs.mtf_pybinder.pcpp.TLVRecordReader_pcpp_IPv6TLVOptionHeader_IPv6Option_t) mtf.libs.mtf_pybinder.pcpp.TLVRecordReader_pcpp_IPv6TLVOptionHeader_IPv6Option_t
- Args:
other (pcpp.TLVRecordReader< class pcpp.IPv6TLVOptionHeader.IPv6Option>)
- Returns:
pcpp.TLVRecordReader<class pcpp.IPv6TLVOptionHeader.IPv6Option>
- change_tlv_record_count(self: mtf.libs.mtf_pybinder.pcpp.TLVRecordReader_pcpp_IPv6TLVOptionHeader_IPv6Option_t, changed_by: int) None
- Args:
changed_by (int)
- get_first_tlv_record(self: mtf.libs.mtf_pybinder.pcpp.TLVRecordReader_pcpp_IPv6TLVOptionHeader_IPv6Option_t, tlv_data_base_ptr: int, tlv_data_len: int) pcpp::IPv6TLVOptionHeader::IPv6Option
- Args:
tlv_data_base_ptr (bytes) tlv_data_len (unsigned int)
- Returns:
pcpp.IPv6TLVOptionHeader.IPv6Option
- get_next_tlv_record(self: mtf.libs.mtf_pybinder.pcpp.TLVRecordReader_pcpp_IPv6TLVOptionHeader_IPv6Option_t, record: pcpp::IPv6TLVOptionHeader::IPv6Option, tlv_data_base_ptr: int, tlv_data_len: int) pcpp::IPv6TLVOptionHeader::IPv6Option
- Args:
record (pcpp.IPv6TLVOptionHeader.IPv6Option) tlv_data_base_ptr (bytes) tlv_data_len (unsigned int)
- Returns:
pcpp.IPv6TLVOptionHeader.IPv6Option
- get_tlv_record(self: mtf.libs.mtf_pybinder.pcpp.TLVRecordReader_pcpp_IPv6TLVOptionHeader_IPv6Option_t, record_type: int, tlv_data_base_ptr: int, tlv_data_len: int) pcpp::IPv6TLVOptionHeader::IPv6Option
- Args:
record_type (unsigned int) tlv_data_base_ptr (bytes) tlv_data_len (unsigned int)
- Returns:
pcpp.IPv6TLVOptionHeader.IPv6Option
- get_tlv_record_count(self: mtf.libs.mtf_pybinder.pcpp.TLVRecordReader_pcpp_IPv6TLVOptionHeader_IPv6Option_t, tlv_data_base_ptr: int, tlv_data_len: int) int
- Args:
tlv_data_base_ptr (bytes) tlv_data_len (unsigned int)
- Returns:
unsigned int
- class mtf.libs.mtf_pybinder.pcpp.TLVRecordReader_pcpp_PPPoEDiscoveryLayer_PPPoETag_t
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.TLVRecordReader_pcpp_PPPoEDiscoveryLayer_PPPoETag_t) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.TLVRecordReader_pcpp_PPPoEDiscoveryLayer_PPPoETag_t, arg0: mtf.libs.mtf_pybinder.pcpp.TLVRecordReader_pcpp_PPPoEDiscoveryLayer_PPPoETag_t) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.TLVRecordReader_pcpp_PPPoEDiscoveryLayer_PPPoETag_t, other: mtf.libs.mtf_pybinder.pcpp.TLVRecordReader_pcpp_PPPoEDiscoveryLayer_PPPoETag_t) mtf.libs.mtf_pybinder.pcpp.TLVRecordReader_pcpp_PPPoEDiscoveryLayer_PPPoETag_t
- Args:
other (pcpp.TLVRecordReader<class pcpp.PPPoEDiscoveryLayer.PPPoETag>)
- Returns:
pcpp.TLVRecordReader<class pcpp.PPPoEDiscoveryLayer.PPPoETag>
- change_tlv_record_count(self: mtf.libs.mtf_pybinder.pcpp.TLVRecordReader_pcpp_PPPoEDiscoveryLayer_PPPoETag_t, changed_by: int) None
- Args:
changed_by (int)
- get_first_tlv_record(self: mtf.libs.mtf_pybinder.pcpp.TLVRecordReader_pcpp_PPPoEDiscoveryLayer_PPPoETag_t, tlv_data_base_ptr: int, tlv_data_len: int) pcpp::PPPoEDiscoveryLayer::PPPoETag
- Args:
tlv_data_base_ptr (bytes) tlv_data_len (unsigned int)
- Returns:
pcpp.PPPoEDiscoveryLayer.PPPoETag
- get_next_tlv_record(self: mtf.libs.mtf_pybinder.pcpp.TLVRecordReader_pcpp_PPPoEDiscoveryLayer_PPPoETag_t, record: pcpp::PPPoEDiscoveryLayer::PPPoETag, tlv_data_base_ptr: int, tlv_data_len: int) pcpp::PPPoEDiscoveryLayer::PPPoETag
- Args:
record (pcpp.PPPoEDiscoveryLayer.PPPoETag) tlv_data_base_ptr (bytes) tlv_data_len (unsigned int)
- Returns:
pcpp.PPPoEDiscoveryLayer.PPPoETag
- get_tlv_record(self: mtf.libs.mtf_pybinder.pcpp.TLVRecordReader_pcpp_PPPoEDiscoveryLayer_PPPoETag_t, record_type: int, tlv_data_base_ptr: int, tlv_data_len: int) pcpp::PPPoEDiscoveryLayer::PPPoETag
- Args:
record_type (unsigned int) tlv_data_base_ptr (bytes) tlv_data_len (unsigned int)
- Returns:
pcpp.PPPoEDiscoveryLayer.PPPoETag
- get_tlv_record_count(self: mtf.libs.mtf_pybinder.pcpp.TLVRecordReader_pcpp_PPPoEDiscoveryLayer_PPPoETag_t, tlv_data_base_ptr: int, tlv_data_len: int) int
- Args:
tlv_data_base_ptr (bytes) tlv_data_len (unsigned int)
- Returns:
unsigned int
- class mtf.libs.mtf_pybinder.pcpp.TLVRecordReader_pcpp_RadiusAttribute_t
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.TLVRecordReader_pcpp_RadiusAttribute_t) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.TLVRecordReader_pcpp_RadiusAttribute_t, arg0: mtf.libs.mtf_pybinder.pcpp.TLVRecordReader_pcpp_RadiusAttribute_t) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.TLVRecordReader_pcpp_RadiusAttribute_t, other: mtf.libs.mtf_pybinder.pcpp.TLVRecordReader_pcpp_RadiusAttribute_t) mtf.libs.mtf_pybinder.pcpp.TLVRecordReader_pcpp_RadiusAttribute_t
- Args:
other (pcpp.TLVRecordReader<class pcpp.RadiusAttribute>)
- Returns:
pcpp.TLVRecordReader<class pcpp.RadiusAttribute>
- change_tlv_record_count(self: mtf.libs.mtf_pybinder.pcpp.TLVRecordReader_pcpp_RadiusAttribute_t, changed_by: int) None
- Args:
changed_by (int)
- get_first_tlv_record(self: mtf.libs.mtf_pybinder.pcpp.TLVRecordReader_pcpp_RadiusAttribute_t, tlv_data_base_ptr: int, tlv_data_len: int) pcpp::RadiusAttribute
- Args:
tlv_data_base_ptr (bytes) tlv_data_len (unsigned int)
- Returns:
pcpp.RadiusAttribute
- get_next_tlv_record(self: mtf.libs.mtf_pybinder.pcpp.TLVRecordReader_pcpp_RadiusAttribute_t, record: pcpp::RadiusAttribute, tlv_data_base_ptr: int, tlv_data_len: int) pcpp::RadiusAttribute
- Args:
record (pcpp.RadiusAttribute) tlv_data_base_ptr (bytes) tlv_data_len (unsigned int)
- Returns:
pcpp.RadiusAttribute
- get_tlv_record(self: mtf.libs.mtf_pybinder.pcpp.TLVRecordReader_pcpp_RadiusAttribute_t, record_type: int, tlv_data_base_ptr: int, tlv_data_len: int) pcpp::RadiusAttribute
- Args:
record_type (unsigned int) tlv_data_base_ptr (bytes) tlv_data_len (unsigned int)
- Returns:
pcpp.RadiusAttribute
- get_tlv_record_count(self: mtf.libs.mtf_pybinder.pcpp.TLVRecordReader_pcpp_RadiusAttribute_t, tlv_data_base_ptr: int, tlv_data_len: int) int
- Args:
tlv_data_base_ptr (bytes) tlv_data_len (unsigned int)
- Returns:
unsigned int
- class mtf.libs.mtf_pybinder.pcpp.TLVRecordReader_pcpp_TcpOption_t
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.TLVRecordReader_pcpp_TcpOption_t) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.TLVRecordReader_pcpp_TcpOption_t, arg0: mtf.libs.mtf_pybinder.pcpp.TLVRecordReader_pcpp_TcpOption_t) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.TLVRecordReader_pcpp_TcpOption_t, other: mtf.libs.mtf_pybinder.pcpp.TLVRecordReader_pcpp_TcpOption_t) mtf.libs.mtf_pybinder.pcpp.TLVRecordReader_pcpp_TcpOption_t
- Args:
other (pcpp.TLVRecordReader<class pcpp.TcpOption>)
- Returns:
pcpp.TLVRecordReader<class pcpp.TcpOption>
- change_tlv_record_count(self: mtf.libs.mtf_pybinder.pcpp.TLVRecordReader_pcpp_TcpOption_t, changed_by: int) None
- Args:
changed_by (int)
- get_first_tlv_record(self: mtf.libs.mtf_pybinder.pcpp.TLVRecordReader_pcpp_TcpOption_t, tlv_data_base_ptr: int, tlv_data_len: int) pcpp::TcpOption
- Args:
tlv_data_base_ptr (bytes) tlv_data_len (unsigned int)
- Returns:
pcpp.TcpOption
- get_next_tlv_record(self: mtf.libs.mtf_pybinder.pcpp.TLVRecordReader_pcpp_TcpOption_t, record: pcpp::TcpOption, tlv_data_base_ptr: int, tlv_data_len: int) pcpp::TcpOption
- Args:
record (pcpp.TcpOption) tlv_data_base_ptr (bytes) tlv_data_len (unsigned int)
- Returns:
pcpp.TcpOption
- get_tlv_record(self: mtf.libs.mtf_pybinder.pcpp.TLVRecordReader_pcpp_TcpOption_t, record_type: int, tlv_data_base_ptr: int, tlv_data_len: int) pcpp::TcpOption
- Args:
record_type (unsigned int) tlv_data_base_ptr (bytes) tlv_data_len (unsigned int)
- Returns:
pcpp.TcpOption
- get_tlv_record_count(self: mtf.libs.mtf_pybinder.pcpp.TLVRecordReader_pcpp_TcpOption_t, tlv_data_base_ptr: int, tlv_data_len: int) int
- Args:
tlv_data_base_ptr (bytes) tlv_data_len (unsigned int)
- Returns:
unsigned int
- class mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t, record_raw_data: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t, arg0: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t) -> None
- __new__(**kwargs)
- assign(*args, **kwargs)
Overloaded function.
assign(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t, record_raw_data: int) -> None
- Args:
record_raw_data (bytes)
assign(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t, other: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t) -> mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t
- Args:
other (pcpp.TLVRecord<uint8_t, uint8_t>)
- Returns:
pcpp.TLVRecord<uint8_t, uint8_t>
- static can_assign(record_raw_data: int, tlv_data_len: int) bool
- Args:
record_raw_data (bytes) tlv_data_len (unsigned int)
- Returns:
bool
- property data_size
- Returns:
unsigned int
- get_value_as(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t, offset: int) int
- Args:
offset (unsigned int)
- Returns:
unsigned int
- is_not_null(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t) bool
- Returns:
bool
- is_null(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t) bool
- Returns:
bool
- purge_record_data(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t) None
- property record_raw_data
- set_value(*args, **kwargs)
Overloaded function.
set_value(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t, new_value: int) -> bool
- Args:
new_value (unsigned int)
- Returns:
bool
set_value(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t, new_value: int, value_offset: int) -> bool
- Args:
new_value (unsigned int) value_offset (int)
- Returns:
bool
- property total_size
- Returns:
unsigned int
- property type
- Returns:
unsigned int
- property value
- class mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_short_unsigned_short_t
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_short_unsigned_short_t, record_raw_data: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_short_unsigned_short_t, arg0: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_short_unsigned_short_t) -> None
- __new__(**kwargs)
- assign(*args, **kwargs)
Overloaded function.
assign(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_short_unsigned_short_t, record_raw_data: int) -> None
- Args:
record_raw_data (bytes)
assign(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_short_unsigned_short_t, other: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_short_unsigned_short_t) -> mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_short_unsigned_short_t
- Args:
other (pcpp.TLVRecord<uint16_t, uint16_t>)
- Returns:
pcpp.TLVRecord<uint16_t, uint16_t>
- static can_assign(record_raw_data: int, tlv_data_len: int) bool
- Args:
record_raw_data (bytes) tlv_data_len (unsigned int)
- Returns:
bool
- property data_size
- Returns:
unsigned int
- is_not_null(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_short_unsigned_short_t) bool
- Returns:
bool
- is_null(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_short_unsigned_short_t) bool
- Returns:
bool
- purge_record_data(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_short_unsigned_short_t) None
- property record_raw_data
- property total_size
- Returns:
unsigned int
- property type
- Returns:
unsigned int
- property value
- class mtf.libs.mtf_pybinder.pcpp.TcpFlagsFilter
A class for filtering only TCP packets which certain TCP flags are set in them <BR> For deeper understanding of the filter concept please refer to PcapFilter.h
- MatchAll
- MatchOneAtLeast
- class MatchOptions
- An enum for representing 2 type of matches: match only packets that contain all flags defined in the filter or match packets that
contain at least one of the flags defined in the filter
Members:
MatchAll
MatchOneAtLeast
- MatchAll
- MatchOneAtLeast
- __init__(self: mtf.libs.mtf_pybinder.pcpp.TcpFlagsFilter.MatchOptions, value: int) None
- __new__(**kwargs)
- property name
- property value
- class TcpFlags
An enum of all TCP flags that can be use in the filter
Members:
tcpFin
tcpSyn
tcpRst
tcpPush
tcpAck
tcpUrg
- __init__(self: mtf.libs.mtf_pybinder.pcpp.TcpFlagsFilter.TcpFlags, value: int) None
- __new__(**kwargs)
- property name
- tcpAck
- tcpFin
- tcpPush
- tcpRst
- tcpSyn
- tcpUrg
- property value
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.TcpFlagsFilter, tcp_flag_bit_mask: int, match_option: pcpp::TcpFlagsFilter::MatchOptions) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.TcpFlagsFilter, arg0: mtf.libs.mtf_pybinder.pcpp.TcpFlagsFilter) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.TcpFlagsFilter, : mtf.libs.mtf_pybinder.pcpp.TcpFlagsFilter) mtf.libs.mtf_pybinder.pcpp.TcpFlagsFilter
- Returns:
pcpp.TcpFlagsFilter
- match_packet_with_filter(self: mtf.libs.mtf_pybinder.pcpp.GeneralFilter, raw_packet: mtf.libs.mtf_pybinder.pcpp.RawPacket) bool
Match a raw packet with a given BPF filter.
A pointer to the raw packet to match the BPF filter with True if a raw packet matches the BPF filter or false otherwise
- Args:
raw_packet (str)
- Returns:
bool
- parse_to_string(self: mtf.libs.mtf_pybinder.pcpp.GeneralFilter, result: str) None
A method that parses the class instance into BPF string format
An empty string that the parsing will be written into. If the string isn’t empty, its content will be overridden
- Args:
result (str)
- Returns:
void
- set_tcp_flags_bit_mask(self: mtf.libs.mtf_pybinder.pcpp.TcpFlagsFilter, tcp_flag_bit_mask: int, match_option: mtf.libs.mtf_pybinder.pcpp.TcpFlagsFilter.MatchOptions) None
Set the TCP flags and the match option
A 1-byte bitmask containing all TCP flags participating in the filter. This parameter can contain the following value for example: TcpFlagsFilter::tcpSyn | TcpFlagsFilter::tcpAck | TcpFlagsFilter::tcpUrg The match option: TcpFlagsFilter::MatchAll or TcpFlagsFilter::MatchOneAtLeast
- Args:
tcp_flag_bit_mask (str)
- Returns:
void
- tcpAck
- tcpFin
- tcpPush
- tcpRst
- tcpSyn
- tcpUrg
- class mtf.libs.mtf_pybinder.pcpp.TcpLayer
Represents a TCP (Transmission Control Protocol) protocol layer
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.TcpLayer, data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: pcpp::Packet) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.TcpLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.TcpLayer, port_src: int, port_dst: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.TcpLayer, arg0: mtf.libs.mtf_pybinder.pcpp.TcpLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.TcpLayer, arg0: mtf.libs.mtf_pybinder.pcpp.TcpLayer) -> None
- __new__(**kwargs)
- property ack_flag
TCP Acknowledgement flag
- property ack_number
TCP acknowledgment number
- add_tcp_option(self: mtf.libs.mtf_pybinder.pcpp.TcpLayer, option_builder: mtf.libs.mtf_pybinder.pcpp.TcpOptionBuilder) mtf.libs.mtf_pybinder.pcpp.TcpOption
Add a new TCP option at the end of the layer (after the last TCP option) A TcpOptionBuilder object that containsthe TCP option data to be added A TcpOption object that contains the newly added TCP option data or logicalNULL (TcpOption#isNull() == true) if addition failed. In case of a failure a corresponding error message will be printed to log
- Args:
option_builder (pcpp.TcpOptionBuilder)
- Returns:
pcpp.TcpOption
- add_tcp_option_after(*args, **kwargs)
Overloaded function.
add_tcp_option_after(self: mtf.libs.mtf_pybinder.pcpp.TcpLayer, option_builder: mtf.libs.mtf_pybinder.pcpp.TcpOptionBuilder) -> mtf.libs.mtf_pybinder.pcpp.TcpOption
- Args:
option_builder (pcpp.TcpOptionBuilder a0)
- Returns:
pcpp.TcpOption
add_tcp_option_after(self: mtf.libs.mtf_pybinder.pcpp.TcpLayer, option_builder: mtf.libs.mtf_pybinder.pcpp.TcpOptionBuilder, prev_option_type: mtf.libs.mtf_pybinder.pcpp.TcpOptionType) -> mtf.libs.mtf_pybinder.pcpp.TcpOption
This method is deprecated, please use insertTcpOptionAfter(const TcpOptionBuilder& optionBuilder, TcpOptionEnumTypeprevOptionType = TcpOptionEnumType::Unknown)
- Args:
option_builder (pcpp.TcpOptionBuilder) prev_option_type (enum pcpp.TcpOptionType)
- Returns:
pcpp.TcpOption
- assign(self: mtf.libs.mtf_pybinder.pcpp.TcpLayer, other: mtf.libs.mtf_pybinder.pcpp.TcpLayer) mtf.libs.mtf_pybinder.pcpp.TcpLayer
An assignment operator that first delete all data from current layer and then copy the entire header from the otherTcpLayer (including TCP options)
- Args:
other (pcpp.TcpLayer)
- Returns:
pcpp.TcpLayer
- calculate_checksum(self: mtf.libs.mtf_pybinder.pcpp.TcpLayer, write_result_to_packet: bool) int
Calculate the checksum from header and data and possibly write the result to If set to true then checksumresult will be written to The checksum result
- Args:
write_result_to_packet (bool)
- Returns:
unsigned int
- property checksum
TCP checksum
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property cwr_flag
TCP CWR flag
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- property dst_port
TCP destination port
- Returns:
unsigned int
- property ece_flag
TCP ECE flag
- property fin_flag
TCP FIN flag
- get_first_tcp_option(self: mtf.libs.mtf_pybinder.pcpp.TcpLayer) mtf.libs.mtf_pybinder.pcpp.TcpOption
The first TCP option in the packet. If the current layer contains no options the returned value will contain alogical NULL (TcpOption#isNull() == true)
- Returns:
pcpp.TcpOption
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_next_tcp_option(self: mtf.libs.mtf_pybinder.pcpp.TcpLayer, tcp_option: mtf.libs.mtf_pybinder.pcpp.TcpOption) mtf.libs.mtf_pybinder.pcpp.TcpOption
Get the TCP option that comes after a given option. If the given option was the last one, the returned value willcontain a logical NULL (TcpOption#isNull() == true) A TCP option object that exists in the current layer A TcpOption object that contains the TCP option data that comes next, or logical NULL if the given TCPoption: (1) was the last one; or (2) contains a logical NULL; or (3) doesn’t belong to this packet
- Args:
tcp_option (pcpp.TcpOption)
- Returns:
pcpp.TcpOption
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- get_tcp_option(*args, **kwargs)
Overloaded function.
get_tcp_option(self: mtf.libs.mtf_pybinder.pcpp.TcpLayer, option: mtf.libs.mtf_pybinder.pcpp.TcpOptionType) -> mtf.libs.mtf_pybinder.pcpp.TcpOption
This method is deprecated, please use getTcpOption(TcpOptionEnumType option)
- Args:
option (enum pcpp.TcpOptionType)
- Returns:
pcpp.TcpOption
get_tcp_option(self: mtf.libs.mtf_pybinder.pcpp.TcpLayer, option: mtf.libs.mtf_pybinder.pcpp.TcpOptionType) -> mtf.libs.mtf_pybinder.pcpp.TcpOption
Get a TCP option by type TCP option type to retrieve An TcpOption object that contains the firstoption that matches this type, or logical NULL (TcpOption#isNull() == true) if no such option found
- Args:
option (enum pcpp.TcpOptionType)
- Returns:
pcpp.TcpOption
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- static is_data_valid(data: int, data_len: int) bool
The static method makes validation of input data The pointer to the beginning of byte stream of TCPpacket The length of byte stream True if the data is valid and can represent a TCPpacket
- Args:
data (bytes) data_len (unsigned int)
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property psh_flag
TCP Push flag
- remove_all_tcp_options(self: mtf.libs.mtf_pybinder.pcpp.TcpLayer) bool
Remove all TCP options in this layer True if all TCP options were successfully removed or false if removalfailed for some reason (a proper error will be written to log)
- Returns:
bool
- remove_tcp_option(*args, **kwargs)
Overloaded function.
remove_tcp_option(self: mtf.libs.mtf_pybinder.pcpp.TcpLayer, option_type: mtf.libs.mtf_pybinder.pcpp.TcpOptionType) -> bool
This method is deprecated, please use removeTcpOption(TcpOptionEnumType)
- Args:
option_type (enum pcpp.TcpOptionType)
- Returns:
bool
remove_tcp_option(self: mtf.libs.mtf_pybinder.pcpp.TcpLayer, option_type: mtf.libs.mtf_pybinder.pcpp.TcpOptionType) -> bool
Remove an existing TCP option from the layer. TCP option is found by type The TCP option type to remove True if TCP option was removed or false if type wasn’t found or if removal failed (in each case a propererror will be written to log)
- Args:
option_type (enum pcpp.TcpOptionType)
- Returns:
bool
- property rst_flag
TCP Reset flag
- property sequence_number
TCP sequence number
- property src_port
TCP source port
- Returns:
unsigned int
- property syn_flag
TCP SYN flag
- property tcp_option_count
The number of TCP options in this layer
- Returns:
unsigned int
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- property urg_flag
TCP Urgent flag
- property urgent_pointer
TCP urgent pointer
- property window_size
TCP window size
- class mtf.libs.mtf_pybinder.pcpp.TcpOption
A wrapper class for TCP options. This class does not create or modify TCP option records, but rather serves as a wrapper and provides useful methods for retrieving data from them
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.TcpOption, option_raw_data: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.TcpOption, arg0: mtf.libs.mtf_pybinder.pcpp.TcpOption) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.TcpOption, arg0: mtf.libs.mtf_pybinder.pcpp.TcpOption) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.TcpOption, : mtf.libs.mtf_pybinder.pcpp.TcpOption) mtf.libs.mtf_pybinder.pcpp.TcpOption
- Returns:
pcpp.TcpOption
- static can_assign(record_raw_data: int, tlv_data_len: int) bool
Check if a pointer can be assigned to the TLV record data
- Args:
record_raw_data (bytes): A pointer to the TLV record raw data tlv_data_len (unsigned int): The size of the TLV record raw data
- Returns:
bool: True if data is valid and can be assigned
- property data_size
- Returns:
unsigned int
- get_value_as(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t, offset: int) int
- Args:
offset (unsigned int)
- Returns:
unsigned int
- is_not_null(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t) bool
- Returns:
bool
- is_null(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t) bool
- Returns:
bool
- purge_record_data(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t) None
- property record_raw_data
- set_value(*args, **kwargs)
Overloaded function.
set_value(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t, new_value: int) -> bool
- Args:
new_value (unsigned int)
- Returns:
bool
set_value(self: mtf.libs.mtf_pybinder.pcpp.TLVRecord_unsigned_char_unsigned_char_t, new_value: int, value_offset: int) -> bool
- Args:
new_value (unsigned int) value_offset (int)
- Returns:
bool
- property tcp_option_enum_type
TCP option type casted as pcpp.TcpOptionEnumType enum. If the data is null a value of TcpOptionEnumType.Unknownis returned
- Returns:
enum pcpp.TcpOptionType
- property tcp_option_type
This method is deprecated, please use getTcpOptionEnumType()
- property total_size
- Returns:
unsigned int
- property type
- Returns:
unsigned int
- property value
- class mtf.libs.mtf_pybinder.pcpp.TcpOptionBuilder
A class for building TCP option records. This builder receives the TCP option parameters in its c’tor, builds the TCP option raw buffer and provides a build() method to get a TcpOption object out of it
- EOL
- NOP
- class NopEolOptionTypes
An enum to describe NOP and EOL TCP options. Used in one of this class’s c’tors
Members:
NOP
EOL
- EOL
- NOP
- __init__(self: mtf.libs.mtf_pybinder.pcpp.TcpOptionBuilder.NopEolOptionTypes, value: int) None
- __new__(**kwargs)
- property name
- property value
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.TcpOptionBuilder, arg0: mtf.libs.mtf_pybinder.pcpp.TcpOptionType, arg1: list[int]) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.TcpOptionBuilder, option_type: mtf.libs.mtf_pybinder.pcpp.TcpOptionType, option_value: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.TcpOptionBuilder, option_type: mtf.libs.mtf_pybinder.pcpp.TcpOptionType, option_value: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.TcpOptionBuilder, option_type: mtf.libs.mtf_pybinder.pcpp.TcpOptionType, option_value: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.TcpOptionBuilder, option_type: pcpp::TcpOptionBuilder::NopEolOptionTypes) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.TcpOptionBuilder, arg0: mtf.libs.mtf_pybinder.pcpp.TcpOptionBuilder) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.TcpOptionBuilder, : mtf.libs.mtf_pybinder.pcpp.TcpOptionBuilder) mtf.libs.mtf_pybinder.pcpp.TcpOptionBuilder
- Returns:
pcpp.TcpOptionBuilder
- build(self: mtf.libs.mtf_pybinder.pcpp.TcpOptionBuilder) mtf.libs.mtf_pybinder.pcpp.TcpOption
Build the TcpOption object out of the parameters defined in the c’tor The TcpOption object
- Returns:
pcpp.TcpOption
- class mtf.libs.mtf_pybinder.pcpp.TcpOptionType
TCP options types
Members:
PCPP_TCPOPT_NOP
PCPP_TCPOPT_EOL
TCPOPT_MSS
PCPP_TCPOPT_WINDOW
TCPOPT_SACK_PERM
PCPP_TCPOPT_SACK
TCPOPT_ECHO
TCPOPT_ECHOREPLY
PCPP_TCPOPT_TIMESTAMP
TCPOPT_CC
TCPOPT_CCNEW
TCPOPT_CCECHO
TCPOPT_MD5
TCPOPT_MPTCP
TCPOPT_SCPS
TCPOPT_SNACK
TCPOPT_RECBOUND
TCPOPT_CORREXP
TCPOPT_QS
TCPOPT_USER_TO
TCPOPT_EXP_FD
TCPOPT_EXP_FE
TCPOPT_RVBD_PROBE
TCPOPT_RVBD_TRPY
TCPOPT_Unknown
- PCPP_TCPOPT_EOL
- PCPP_TCPOPT_NOP
- PCPP_TCPOPT_SACK
- PCPP_TCPOPT_TIMESTAMP
- PCPP_TCPOPT_WINDOW
- TCPOPT_CC
- TCPOPT_CCECHO
- TCPOPT_CCNEW
- TCPOPT_CORREXP
- TCPOPT_ECHO
- TCPOPT_ECHOREPLY
- TCPOPT_EXP_FD
- TCPOPT_EXP_FE
- TCPOPT_MD5
- TCPOPT_MPTCP
- TCPOPT_MSS
- TCPOPT_QS
- TCPOPT_RECBOUND
- TCPOPT_RVBD_PROBE
- TCPOPT_RVBD_TRPY
- TCPOPT_SACK_PERM
- TCPOPT_SCPS
- TCPOPT_SNACK
- TCPOPT_USER_TO
- TCPOPT_Unknown
- __init__(self: mtf.libs.mtf_pybinder.pcpp.TcpOptionType, value: int) None
- __new__(**kwargs)
- property name
- property value
- class mtf.libs.mtf_pybinder.pcpp.TcpReassembly
A class containing the TCP reassembly logic. Please refer to the documentation at the top of TcpReassembly.h for understanding how to use this class
- class ConnectionEndReason
An enum for connection end reasons
Members:
TcpReassemblyConnectionClosedByFIN_RST
TcpReassemblyConnectionClosedManually
- TcpReassemblyConnectionClosedByFIN_RST
- TcpReassemblyConnectionClosedManually
- __init__(self: mtf.libs.mtf_pybinder.pcpp.TcpReassembly.ConnectionEndReason, value: int) None
- __new__(**kwargs)
- property name
- property value
- Error_PacketDoesNotMatchFlow
- FIN_RSTWithNoData
- Ignore_PacketOfClosedFlow
- Ignore_PacketWithNoData
- Ignore_Retransimission
- NonIpPacket
- NonTcpPacket
- OutOfOrderTcpMessageBuffered
- class ReassemblyStatus
An enum for providing reassembly status for each processed packet
Members:
TcpMessageHandled
OutOfOrderTcpMessageBuffered
FIN_RSTWithNoData
Ignore_PacketWithNoData
Ignore_PacketOfClosedFlow
Ignore_Retransimission
NonIpPacket
NonTcpPacket
Error_PacketDoesNotMatchFlow
- Error_PacketDoesNotMatchFlow
- FIN_RSTWithNoData
- Ignore_PacketOfClosedFlow
- Ignore_PacketWithNoData
- Ignore_Retransimission
- NonIpPacket
- NonTcpPacket
- OutOfOrderTcpMessageBuffered
- TcpMessageHandled
- __init__(self: mtf.libs.mtf_pybinder.pcpp.TcpReassembly.ReassemblyStatus, value: int) None
- __new__(**kwargs)
- property name
- property value
- TcpMessageHandled
- TcpReassemblyConnectionClosedByFIN_RST
- TcpReassemblyConnectionClosedManually
- __init__(self: mtf.libs.mtf_pybinder.pcpp.TcpReassembly, arg0: mtf.libs.mtf_pybinder.pcpp.TcpReassembly) None
- __new__(**kwargs)
- close_all_connections(self: mtf.libs.mtf_pybinder.pcpp.TcpReassembly) None
Close all open connections manually. This method will cause the TcpReassembly#OnTcpConnectionEnd to be invoked for each connection with a reason of TcpReassembly#TcpReassemblyConnectionClosedManually
- close_connection(self: mtf.libs.mtf_pybinder.pcpp.TcpReassembly, flow_key: int) None
Close a connection manually. If the connection doesn’t exist or already closed an error log is printed. This method will cause the TcpReassembly#OnTcpConnectionEnd to be invoked with a reason of TcpReassembly#TcpReassemblyConnectionClosedManually A 4-byte hash key representing the connection. Can be taken from a ConnectionData instance
- Args:
flow_key (unsigned int)
- get_connection_information(self: mtf.libs.mtf_pybinder.pcpp.TcpReassembly) dict[int, mtf.libs.mtf_pybinder.pcpp.ConnectionData]
Get a map of all connections managed by this TcpReassembly instance (both connections that are open and those that are already closed) A map of all connections managed. Notice this map is constant and cannot be changed by the user
- Returns:
dict[unsigned int, pcpp.ConnectionData]
- is_connection_open(self: mtf.libs.mtf_pybinder.pcpp.TcpReassembly, connection: mtf.libs.mtf_pybinder.pcpp.ConnectionData) int
Check if a certain connection managed by this TcpReassembly instance is currently opened or closed The connection to check A positive number (> 0) if connection is opened, zero (0) if connection is closed, and a negative number (< 0) if this connection isn’t managed by this TcpReassembly instance
- Args:
connection (pcpp.ConnectionData)
- Returns:
int
- purge_closed_connections(*args, **kwargs)
Overloaded function.
purge_closed_connections(self: mtf.libs.mtf_pybinder.pcpp.TcpReassembly) -> int
purge_closed_connections(self: mtf.libs.mtf_pybinder.pcpp.TcpReassembly, max_num_to_clean: int) -> int
Clean up the closed connections from the memory The maximum number of items to be cleaned up per one call. This parameter, when its value is not zero, overrides the value that was set by the constructor. The number of cleared items
- Args:
max_num_to_clean (unsigned int)
- Returns:
unsigned int
- reassemble_packet(*args, **kwargs)
Overloaded function.
reassemble_packet(self: mtf.libs.mtf_pybinder.pcpp.TcpReassembly, tcp_data: mtf.libs.mtf_pybinder.pcpp.Packet) -> mtf.libs.mtf_pybinder.pcpp.TcpReassembly.ReassemblyStatus
The most important method of this class which gets a packet from the user and processes it. If this packet opens a new connection, ends a connection or contains new data on an existing connection, the relevant callback will be called (TcpReassembly#OnTcpMessageReady, TcpReassembly#OnTcpConnectionStart, TcpReassembly#OnTcpConnectionEnd) A reference to the packet to process A enum of TcpReassembly::ReassemblyStatus, indicating status of TCP reassembly
- Args:
tcp_data (pcpp.Packet)
- Returns:
enum pcpp.TcpReassembly.ReassemblyStatus
reassemble_packet(self: mtf.libs.mtf_pybinder.pcpp.TcpReassembly, tcp_raw_data: mtf.libs.mtf_pybinder.pcpp.RawPacket) -> mtf.libs.mtf_pybinder.pcpp.TcpReassembly.ReassemblyStatus
The most important method of this class which gets a raw packet from the user and processes it. If this packet opens a new connection, ends a connection or contains new data on an existing connection, the relevant callback will be invoked (TcpReassembly#OnTcpMessageReady, TcpReassembly#OnTcpConnectionStart, TcpReassembly#OnTcpConnectionEnd) A reference to the raw packet to process A enum of TcpReassembly::ReassemblyStatus, indicating status of TCP reassembly
- Args:
tcp_raw_data (pcpp.RawPacket)
- Returns:
enum pcpp.TcpReassembly.ReassemblyStatus
- class mtf.libs.mtf_pybinder.pcpp.TcpReassemblyConfiguration
A structure for configuring the TcpReassembly class
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.TcpReassemblyConfiguration) -> None
doc
__init__(self: mtf.libs.mtf_pybinder.pcpp.TcpReassemblyConfiguration, remove_conn_info: bool) -> None
doc
__init__(self: mtf.libs.mtf_pybinder.pcpp.TcpReassemblyConfiguration, remove_conn_info: bool, closed_connection_delay: int) -> None
doc
__init__(self: mtf.libs.mtf_pybinder.pcpp.TcpReassemblyConfiguration, remove_conn_info: bool, closed_connection_delay: int, max_num_to_clean: int) -> None
doc
__init__(self: mtf.libs.mtf_pybinder.pcpp.TcpReassemblyConfiguration, remove_conn_info: bool, closed_connection_delay: int, max_num_to_clean: int, max_out_of_order_fragments: int) -> None
doc
__init__(self: mtf.libs.mtf_pybinder.pcpp.TcpReassemblyConfiguration, remove_conn_info: bool, closed_connection_delay: int, max_num_to_clean: int, max_out_of_order_fragments: int, enable_base_buffer_clear_condition: bool) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.TcpReassemblyConfiguration, arg0: mtf.libs.mtf_pybinder.pcpp.TcpReassemblyConfiguration) -> None
- __new__(**kwargs)
- property closed_connection_delay
- property enable_base_buffer_clear_condition
- property max_num_to_clean
- property max_out_of_order_fragments
- property remove_conn_info
- class mtf.libs.mtf_pybinder.pcpp.TcpStreamData
When following a TCP connection each packet may contain a piece of the data transferred between the client and the server. This class represents these pieces: each instance of it contains a piece of data, usually extracted from a single packet, as well as information about the connection
- __init__(self: mtf.libs.mtf_pybinder.pcpp.TcpStreamData, tcp_data: int, tcp_data_length: int, missing_bytes: int, conn_data: mtf.libs.mtf_pybinder.pcpp.ConnectionData, timestamp: mtf.libs.mtf_pybinder.pcpp.timeval) None
- __new__(**kwargs)
- get_connection_data(self: mtf.libs.mtf_pybinder.pcpp.TcpStreamData) mtf.libs.mtf_pybinder.pcpp.ConnectionData
A getter for the connection data The const reference to connection data
- Returns:
pcpp.ConnectionData
- get_data(self: mtf.libs.mtf_pybinder.pcpp.TcpStreamData) int
A getter for the data buffer A pointer to the buffer
- Returns:
bytes
- get_data_length(self: mtf.libs.mtf_pybinder.pcpp.TcpStreamData) int
A getter for buffer length Buffer length
- Returns:
unsigned int
- get_missing_byte_count(self: mtf.libs.mtf_pybinder.pcpp.TcpStreamData) int
A getter for missing byte count due to packet loss. Missing byte count
- Returns:
unsigned int
- get_time_stamp(self: mtf.libs.mtf_pybinder.pcpp.TcpStreamData) mtf.libs.mtf_pybinder.pcpp.timeval
A getter for the timestamp of this packet The const timeval object with timestamp of this packet
- Returns:
timeval
- is_bytes_missing(self: mtf.libs.mtf_pybinder.pcpp.TcpStreamData) bool
Determine if bytes are missing. getMissingByteCount can be called to determine the number of missing bytes. true if bytes are missing.
- Returns:
bool
- class mtf.libs.mtf_pybinder.pcpp.TcpWindowSizeFilter
A class for filtering TCP packets that matches TCP window-size criteria <BR> For deeper understanding of the filter concept please refer to PcapFilter.h
- __init__(self: mtf.libs.mtf_pybinder.pcpp.TcpWindowSizeFilter, window_size: int, op: mtf.libs.mtf_pybinder.pcpp.FilterOperator) None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.TcpWindowSizeFilter, : mtf.libs.mtf_pybinder.pcpp.TcpWindowSizeFilter) mtf.libs.mtf_pybinder.pcpp.TcpWindowSizeFilter
- Returns:
pcpp.TcpWindowSizeFilter
- match_packet_with_filter(self: mtf.libs.mtf_pybinder.pcpp.GeneralFilter, raw_packet: mtf.libs.mtf_pybinder.pcpp.RawPacket) bool
Match a raw packet with a given BPF filter.
A pointer to the raw packet to match the BPF filter with True if a raw packet matches the BPF filter or false otherwise
- Args:
raw_packet (str)
- Returns:
bool
- parse_to_string(self: mtf.libs.mtf_pybinder.pcpp.GeneralFilter, result: str) None
A method that parses the class instance into BPF string format
An empty string that the parsing will be written into. If the string isn’t empty, its content will be overridden
- Args:
result (str)
- Returns:
void
- set_operator(self: mtf.libs.mtf_pybinder.pcpp.IFilterWithOperator, op: mtf.libs.mtf_pybinder.pcpp.FilterOperator) None
Set the operator for the filter
The operator to set
- Args:
op (str)
- Returns:
void
- set_window_size(self: mtf.libs.mtf_pybinder.pcpp.TcpWindowSizeFilter, window_size: int) None
Set window-size value
The window-size value that will be used in the filter
- Args:
window_size (str)
- Returns:
void
- class mtf.libs.mtf_pybinder.pcpp.TecmpAnalogSampleTime
Enum for analog sample times
Members:
TECMP_ANALOG_SAMPLE_TIME_RESERVED
TECMP_ANALOG_SAMPLE_TIME_2500_MS
TECMP_ANALOG_SAMPLE_TIME_1000_MS
TECMP_ANALOG_SAMPLE_TIME_500_MS
TECMP_ANALOG_SAMPLE_TIME_250_MS
TECMP_ANALOG_SAMPLE_TIME_100_MS
TECMP_ANALOG_SAMPLE_TIME_50_MS
TECMP_ANALOG_SAMPLE_TIME_25_MS
TECMP_ANALOG_SAMPLE_TIME_10_MS
TECMP_ANALOG_SAMPLE_TIME_5_MS
TECMP_ANALOG_SAMPLE_TIME_2_5_MS
TECMP_ANALOG_SAMPLE_TIME_1_MS
- TECMP_ANALOG_SAMPLE_TIME_1000_MS
- TECMP_ANALOG_SAMPLE_TIME_100_MS
- TECMP_ANALOG_SAMPLE_TIME_10_MS
- TECMP_ANALOG_SAMPLE_TIME_1_MS
- TECMP_ANALOG_SAMPLE_TIME_2500_MS
- TECMP_ANALOG_SAMPLE_TIME_250_MS
- TECMP_ANALOG_SAMPLE_TIME_25_MS
- TECMP_ANALOG_SAMPLE_TIME_2_5_MS
- TECMP_ANALOG_SAMPLE_TIME_500_MS
- TECMP_ANALOG_SAMPLE_TIME_50_MS
- TECMP_ANALOG_SAMPLE_TIME_5_MS
- TECMP_ANALOG_SAMPLE_TIME_RESERVED
- __init__(self: mtf.libs.mtf_pybinder.pcpp.TecmpAnalogSampleTime, value: int) None
- __new__(**kwargs)
- property name
- property value
- class mtf.libs.mtf_pybinder.pcpp.TecmpAnalogUnit
Enum for analog units
Members:
TECMP_ANALOG_UNIT_VOLT
TECMP_ANALOG_UNIT_AMPERE
TECMP_ANALOG_UNIT_WATT
TECMP_ANALOG_UNIT_AMPERE_HOUR
TECMP_ANALOG_UNIT_DEGREE_CELSIUS
- TECMP_ANALOG_UNIT_AMPERE
- TECMP_ANALOG_UNIT_AMPERE_HOUR
- TECMP_ANALOG_UNIT_DEGREE_CELSIUS
- TECMP_ANALOG_UNIT_VOLT
- TECMP_ANALOG_UNIT_WATT
- __init__(self: mtf.libs.mtf_pybinder.pcpp.TecmpAnalogUnit, value: int) None
- __new__(**kwargs)
- property name
- property value
- class mtf.libs.mtf_pybinder.pcpp.TelnetLayer
Class for representing the Telnet Layer
- class TelnetCommand
Telnet Command Indicator
Members:
TelnetCommandEndOfPacket
EndOfFile
Suspend
Abort
EndOfRecordCommand
SubnegotiationEnd
NoOperation
DataMark
Break
InterruptProcess
AbortOutput
AreYouThere
EraseCharacter
EraseLine
GoAhead
Subnegotiation
WillPerform
WontPerform
DoPerform
DontPerform
InterpretAsCommand
- Abort
- AbortOutput
- AreYouThere
- Break
- DataMark
- DoPerform
- DontPerform
- EndOfFile
- EndOfRecordCommand
- EraseCharacter
- EraseLine
- GoAhead
- InterpretAsCommand
- InterruptProcess
- NoOperation
- Subnegotiation
- SubnegotiationEnd
- Suspend
- TelnetCommandEndOfPacket
- WillPerform
- WontPerform
- __init__(self: mtf.libs.mtf_pybinder.pcpp.TelnetLayer.TelnetCommand, value: int) None
- __new__(**kwargs)
- property name
- property value
- class TelnetOption
Telnet Options
Members:
TelnetOptionNoOption
TransmitBinary
Echo
Reconnection
SuppressGoAhead
ApproxMsgSizeNegotiation
Status
TimingMark
RemoteControlledTransAndEcho
OutputLineWidth
OutputPageSize
OutputCarriageReturnDisposition
OutputHorizontalTabStops
OutputHorizontalTabDisposition
OutputFormfeedDisposition
OutputVerticalTabStops
OutputVerticalTabDisposition
OutputLinefeedDisposition
ExtendedASCII
Logout
ByteMacro
DataEntryTerminal
SUPDUP
SUPDUPOutput
SendLocation
TerminalType
EndOfRecordOption
TACACSUserIdentification
OutputMarking
TerminalLocationNumber
Telnet3270Regime
X3Pad
NegotiateAboutWindowSize
TerminalSpeed
RemoteFlowControl
Linemode
XDisplayLocation
EnvironmentOption
AuthenticationOption
EncryptionOption
NewEnvironmentOption
TN3270E
XAuth
Charset
TelnetRemoteSerialPort
ComPortControlOption
TelnetSuppressLocalEcho
TelnetStartTLS
Kermit
SendURL
ForwardX
TelOptPragmaLogon
TelOptSSPILogon
TelOptPragmaHeartbeat
ExtendedOptions
- ApproxMsgSizeNegotiation
- AuthenticationOption
- ByteMacro
- Charset
- ComPortControlOption
- DataEntryTerminal
- Echo
- EncryptionOption
- EndOfRecordOption
- EnvironmentOption
- ExtendedASCII
- ExtendedOptions
- ForwardX
- Kermit
- Linemode
- Logout
- NegotiateAboutWindowSize
- NewEnvironmentOption
- OutputCarriageReturnDisposition
- OutputFormfeedDisposition
- OutputHorizontalTabDisposition
- OutputHorizontalTabStops
- OutputLineWidth
- OutputLinefeedDisposition
- OutputMarking
- OutputPageSize
- OutputVerticalTabDisposition
- OutputVerticalTabStops
- Reconnection
- RemoteControlledTransAndEcho
- RemoteFlowControl
- SUPDUP
- SUPDUPOutput
- SendLocation
- SendURL
- Status
- SuppressGoAhead
- TACACSUserIdentification
- TN3270E
- TelOptPragmaHeartbeat
- TelOptPragmaLogon
- TelOptSSPILogon
- Telnet3270Regime
- TelnetOptionNoOption
- TelnetRemoteSerialPort
- TelnetStartTLS
- TelnetSuppressLocalEcho
- TerminalLocationNumber
- TerminalSpeed
- TerminalType
- TimingMark
- TransmitBinary
- X3Pad
- XAuth
- XDisplayLocation
- __init__(self: mtf.libs.mtf_pybinder.pcpp.TelnetLayer.TelnetOption, value: int) None
- __new__(**kwargs)
- property name
- property value
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.TelnetLayer, data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.TelnetLayer, arg0: mtf.libs.mtf_pybinder.pcpp.TelnetLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.TelnetLayer, arg0: mtf.libs.mtf_pybinder.pcpp.TelnetLayer) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.TelnetLayer, : mtf.libs.mtf_pybinder.pcpp.TelnetLayer) mtf.libs.mtf_pybinder.pcpp.TelnetLayer
- Returns:
pcpp.TelnetLayer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.TelnetLayer) None
Does nothing for this layer
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_data_as_string(*args, **kwargs)
Overloaded function.
get_data_as_string(self: mtf.libs.mtf_pybinder.pcpp.TelnetLayer) -> str
- Returns:
str
get_data_as_string(self: mtf.libs.mtf_pybinder.pcpp.TelnetLayer, remove_escape_characters: bool) -> str
Get the Telnet data as readable string Whether non-alphanumerical characters should be removed or not Full payload as readable string, empty if Telnet packet contains control commands/options.
- Args:
remove_escape_characters (bool)
- Returns:
str
- get_first_command(self: mtf.libs.mtf_pybinder.pcpp.TelnetLayer) mtf.libs.mtf_pybinder.pcpp.TelnetLayer.TelnetCommand
Returns the first command of packet TelnetCommand First detected command value, TelnetCommandEndOfPacket if there is no command field
- Returns:
enum pcpp.TelnetLayer.TelnetCommand
- get_header_len(self: mtf.libs.mtf_pybinder.pcpp.TelnetLayer) int
Get the size of the layer
- Returns:
unsigned int
- get_next_command(self: mtf.libs.mtf_pybinder.pcpp.TelnetLayer) mtf.libs.mtf_pybinder.pcpp.TelnetLayer.TelnetCommand
Returns the next command of packet. Uses an internal iterator. The iterator resets when reached end of packet. TelnetCommand Detected command value, TelnetCommandEndOfPacket if reached the end of packet.
- Returns:
enum pcpp.TelnetLayer.TelnetCommand
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_number_of_commands(self: mtf.libs.mtf_pybinder.pcpp.TelnetLayer, command: mtf.libs.mtf_pybinder.pcpp.TelnetLayer.TelnetCommand) int
Returns the number of occurrences of provided command Telnet command to count size_t Number of occurrences of command
- Args:
command (enum pcpp.TelnetLayer.TelnetCommand)
- Returns:
unsigned int
- get_option(*args, **kwargs)
Overloaded function.
get_option(self: mtf.libs.mtf_pybinder.pcpp.TelnetLayer) -> mtf.libs.mtf_pybinder.pcpp.TelnetLayer.TelnetOption
Returns the option of current command. Uses an internal iterator. Iterator can be moved with getNextCommand TelnetOption Option of current command
- Returns:
enum pcpp.TelnetLayer.TelnetOption
get_option(self: mtf.libs.mtf_pybinder.pcpp.TelnetLayer, command: mtf.libs.mtf_pybinder.pcpp.TelnetLayer.TelnetCommand) -> mtf.libs.mtf_pybinder.pcpp.TelnetLayer.TelnetOption
Returns the option of provided command. It will return option of first occurrence of the command Telnet command to search TelnetOption Option of the command. Returns TelnetOptionNoOption if the provided command not found.
- Args:
command (enum pcpp.TelnetLayer.TelnetCommand)
- Returns:
enum pcpp.TelnetLayer.TelnetOption
- get_option_data(*args, **kwargs)
Overloaded function.
get_option_data(self: mtf.libs.mtf_pybinder.pcpp.TelnetLayer, length: int) -> int
Returns the data of current command. Uses an internal iterator. Iterator can be moved with getNextCommand Length of the data of current command uint8_t* Pointer to the data of current command. NULL if there is no data for this command.
- Args:
length (unsigned int)
- Returns:
bytes
get_option_data(self: mtf.libs.mtf_pybinder.pcpp.TelnetLayer, command: mtf.libs.mtf_pybinder.pcpp.TelnetLayer.TelnetCommand, length: int) -> int
Returns the data of provided command. It will return data of first occurrence of the command Telnet command to search Length of the data of current command uint8_t* Pointer to the data of current command. NULL if there is no data for this command or if can’t find the command.
- Args:
command (enum pcpp.TelnetLayer.TelnetCommand) length (unsigned int)
- Returns:
bytes
- get_osi_model_layer(self: mtf.libs.mtf_pybinder.pcpp.TelnetLayer) mtf.libs.mtf_pybinder.pcpp.OsiModelLayer
The OSI layer level of Telnet (Application Layer).
- Returns:
enum pcpp.OsiModelLayer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- static get_telnet_command_as_string(val: mtf.libs.mtf_pybinder.pcpp.TelnetLayer.TelnetCommand) str
Convert the Telnet Command to readable string Value of the command The Telnet Command as readable string
- Args:
val (enum pcpp.TelnetLayer.TelnetCommand)
- Returns:
str
- static get_telnet_option_as_string(val: mtf.libs.mtf_pybinder.pcpp.TelnetLayer.TelnetOption) str
Convert the Telnet option to readable string Value of the option The Telnet Option as readable string
- Args:
val (enum pcpp.TelnetLayer.TelnetOption)
- Returns:
str
- get_total_number_of_commands(self: mtf.libs.mtf_pybinder.pcpp.TelnetLayer) int
Get the total number of detected Telnet commands size_t The number of Telnet commands
- Returns:
unsigned int
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- static is_data_valid(data: int, data_size: int) bool
A static method that takes a byte array and detects whether it is a Telnet message A byte array The byte array size (in bytes) True if the data is identified as Telnet message
- Args:
data (bytes) data_size (unsigned int)
- Returns:
bool
- static is_telnet_port(port: int) bool
A static method that checks whether the port is considered as Telnet The port number to be checked
- Args:
port (unsigned int)
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.TelnetLayer) None
Parses the next layer. Telnet is the always last so does nothing for this layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- to_string(self: mtf.libs.mtf_pybinder.pcpp.TelnetLayer) str
Returns the protocol info as readable string
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.TextBasedProtocolMessage
An abstract base class that wraps text-based-protocol header layers (both requests and responses). It is the base class for all those layers. This class is not meant to be instantiated, hence the protected c’tor
- __init__(*args, **kwargs)
- __new__(**kwargs)
- add_end_of_header(self: mtf.libs.mtf_pybinder.pcpp.TextBasedProtocolMessage) mtf.libs.mtf_pybinder.pcpp.HeaderField
Add the special end-of-header field (see the explanation in HeaderField) A pointer to the newly created header field, or NULL if the field could not be created
- Returns:
pcpp.HeaderField
- add_field(*args, **kwargs)
Overloaded function.
add_field(self: mtf.libs.mtf_pybinder.pcpp.TextBasedProtocolMessage, field_name: str, field_value: str) -> mtf.libs.mtf_pybinder.pcpp.HeaderField
Add a new header field to this message. This field will be added last (before the end-of-header field)
- Args:
field_name (str): The field name field_value (str): The field value
- Returns:
pcpp.HeaderField: A pointer to the newly created header field, or NULL if the field could not be created
add_field(self: mtf.libs.mtf_pybinder.pcpp.TextBasedProtocolMessage, new_field: mtf.libs.mtf_pybinder.pcpp.HeaderField) -> mtf.libs.mtf_pybinder.pcpp.HeaderField
Add a new header field to this message. This field will be added last (before the end-of-header field)
- Args:
new_field (pcpp.HeaderField): The header field to add
- Returns:
pcpp.HeaderField: A pointer to the newly created header field, or NULL if the field could not be created
- assign(self: mtf.libs.mtf_pybinder.pcpp.IDataContainer, : mtf.libs.mtf_pybinder.pcpp.IDataContainer) mtf.libs.mtf_pybinder.pcpp.IDataContainer
- Returns:
pcpp.IDataContainer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.TextBasedProtocolMessage) None
Does nothing for this class
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- property field_count
The number of header fields currently in the layer (not including CRLF at the end of the header)
- Returns:
int
- get_field_by_name(*args, **kwargs)
Overloaded function.
get_field_by_name(self: mtf.libs.mtf_pybinder.pcpp.TextBasedProtocolMessage, field_name: str) -> mtf.libs.mtf_pybinder.pcpp.HeaderField
- Args:
field_name (str)
- Returns:
pcpp.HeaderField
get_field_by_name(self: mtf.libs.mtf_pybinder.pcpp.TextBasedProtocolMessage, field_name: str, index: int = 0) -> mtf.libs.mtf_pybinder.pcpp.HeaderField
Get a pointer to a header field by name. The search is case insensitive, meaning if a field with name Host exists and the fieldName parameter is host (all letter are lower case), this method will return a pointer to Host field
- Args:
field_name (str): The field name index (int): Optional parameter. If the field name appears more than once, this parameter will indicate which field to get.
The default value is 0 (get the first appearance of the field name as appears on the packet)
- Returns:
pcpp.HeaderField: A pointer to an HeaderField instance, or NULL if field doesn’t exist
- get_first_field(self: mtf.libs.mtf_pybinder.pcpp.TextBasedProtocolMessage) mtf.libs.mtf_pybinder.pcpp.HeaderField
A pointer to the first header field exists in this message, or NULL if no such field exists
- Returns:
pcpp.HeaderField
- get_header_len(self: mtf.libs.mtf_pybinder.pcpp.TextBasedProtocolMessage) int
The message length
- Returns:
unsigned int
- get_next_field(self: mtf.libs.mtf_pybinder.pcpp.TextBasedProtocolMessage, prev_field: mtf.libs.mtf_pybinder.pcpp.HeaderField) mtf.libs.mtf_pybinder.pcpp.HeaderField
Get the field which appears after a certain field
- Args:
prev_field (pcpp.HeaderField): A pointer to the field
- Returns:
pcpp.HeaderField: The field after prevField or NULL if prevField is the last field. If prevField is NULL, this method will return NULL
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- insert_field(*args, **kwargs)
Overloaded function.
insert_field(self: mtf.libs.mtf_pybinder.pcpp.TextBasedProtocolMessage, prev_field: mtf.libs.mtf_pybinder.pcpp.HeaderField, field_name: str, field_value: str) -> mtf.libs.mtf_pybinder.pcpp.HeaderField
Insert a new field after an existing field
- Args:
prev_field (pcpp.HeaderField): A pointer to the existing field. If it’s NULL the new field will be added as first field field_name (str): The field name field_value (str): The field value
- Returns:
pcpp.HeaderField: A pointer to the newly created header field, or NULL if the field could not be created
insert_field(self: mtf.libs.mtf_pybinder.pcpp.TextBasedProtocolMessage, prev_field_name: str, field_name: str, field_value: str) -> mtf.libs.mtf_pybinder.pcpp.HeaderField
Insert a new field after an existing field
- Args:
prev_field_name (str): A name of an existing field. If the field doesn’t exist NULL will be returned. If field name is empty (‘’) the new field will be added as first field field_name (str): The field name field_value (str): The field value
- Returns:
pcpp.HeaderField: A pointer to the newly created header field, or NULL if the field could not be created
insert_field(self: mtf.libs.mtf_pybinder.pcpp.TextBasedProtocolMessage, prev_field: mtf.libs.mtf_pybinder.pcpp.HeaderField, new_field: mtf.libs.mtf_pybinder.pcpp.HeaderField) -> mtf.libs.mtf_pybinder.pcpp.HeaderField
Insert a new field after an existing field
- Args:
prev_field (pcpp.HeaderField): A pointer to the existing field new_field (pcpp.HeaderField): The header field to add
- Returns:
pcpp.HeaderField: A pointer to the newly created header field, or NULL if the field could not be created
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- is_header_complete(self: mtf.libs.mtf_pybinder.pcpp.TextBasedProtocolMessage) bool
Indicate whether the header is complete (ending with end-of-header “” or “”) or spread over more packets
- Returns:
bool: True if the header is complete or false if not
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.TextBasedProtocolMessage) None
Currently set only PayloadLayer for the rest of the data
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- remove_field(*args, **kwargs)
Overloaded function.
remove_field(self: mtf.libs.mtf_pybinder.pcpp.TextBasedProtocolMessage, field_to_remove: mtf.libs.mtf_pybinder.pcpp.HeaderField) -> bool
Remove a field from the message
- Args:
field_to_remove (pcpp.HeaderField): A pointer to the field that should be removed
- Returns:
bool: True if the field was removed successfully, or false otherwise (for example: if fieldToRemove is NULL, if it doesn’t exist in the message, or if the removal failed)
remove_field(self: mtf.libs.mtf_pybinder.pcpp.TextBasedProtocolMessage, field_name: str) -> bool
- Args:
field_name (str)
- Returns:
bool
remove_field(self: mtf.libs.mtf_pybinder.pcpp.TextBasedProtocolMessage, field_name: str, index: int) -> bool
Remove a field from the message
- Args:
field_name (str): The name of the field that should be removed index (int): Optional parameter. If the field name appears more than once, this parameter will indicate which field to remove.
The default value is 0 (remove the first appearance of the field name as appears on the packet)
- Returns:
bool: True if the field was removed successfully, or false otherwise (for example: if fieldName doesn’t exist in the message, or if the removal failed)
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.UdpLayer
Represents an UDP (User Datagram Protocol) protocol layer
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.UdpLayer, data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: pcpp::Packet) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.UdpLayer, port_src: int = 0, port_dst: int = 0) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.UdpLayer, arg0: mtf.libs.mtf_pybinder.pcpp.UdpLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.UdpLayer, arg0: mtf.libs.mtf_pybinder.pcpp.UdpLayer) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.UdpLayer, : mtf.libs.mtf_pybinder.pcpp.UdpLayer) mtf.libs.mtf_pybinder.pcpp.UdpLayer
- Returns:
pcpp.UdpLayer
- calculate_checksum(self: mtf.libs.mtf_pybinder.pcpp.UdpLayer, write_result_to_packet: bool) int
Calculate the checksum from header and data and possibly write the result to If set to true then checksumresult will be written to The checksum result
- Args:
write_result_to_packet (bool)
- Returns:
unsigned int
- property checksum
Checksum value
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- property dst_port
UDP destination port
- Returns:
unsigned int
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- property src_port
UDP source port
- Returns:
unsigned int
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- property total_length
Length of header and payload in bytes
- class mtf.libs.mtf_pybinder.pcpp.UdpLengthFilter
A class for filtering UDP packets that matches UDP length criteria <BR> For deeper understanding of the filter concept please refer to PcapFilter.h
- __init__(self: mtf.libs.mtf_pybinder.pcpp.UdpLengthFilter, length: int, op: mtf.libs.mtf_pybinder.pcpp.FilterOperator) None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.UdpLengthFilter, : mtf.libs.mtf_pybinder.pcpp.UdpLengthFilter) mtf.libs.mtf_pybinder.pcpp.UdpLengthFilter
- Returns:
pcpp.UdpLengthFilter
- match_packet_with_filter(self: mtf.libs.mtf_pybinder.pcpp.GeneralFilter, raw_packet: mtf.libs.mtf_pybinder.pcpp.RawPacket) bool
Match a raw packet with a given BPF filter.
A pointer to the raw packet to match the BPF filter with True if a raw packet matches the BPF filter or false otherwise
- Args:
raw_packet (str)
- Returns:
bool
- parse_to_string(self: mtf.libs.mtf_pybinder.pcpp.GeneralFilter, result: str) None
A method that parses the class instance into BPF string format
An empty string that the parsing will be written into. If the string isn’t empty, its content will be overridden
- Args:
result (str)
- Returns:
void
- set_length(self: mtf.libs.mtf_pybinder.pcpp.UdpLengthFilter, length: int) None
Set length value
The length value that will be used in the filter
- Args:
length (str)
- Returns:
void
- set_operator(self: mtf.libs.mtf_pybinder.pcpp.IFilterWithOperator, op: mtf.libs.mtf_pybinder.pcpp.FilterOperator) None
Set the operator for the filter
The operator to set
- Args:
op (str)
- Returns:
void
- class mtf.libs.mtf_pybinder.pcpp.UnsegmentedFctIdExtendedMsg
- __init__(self: mtf.libs.mtf_pybinder.pcpp.UnsegmentedFctIdExtendedMsg) None
- __new__(**kwargs)
- property bap_info
- property extended_fct_id
- get_suffix_data(self: mtf.libs.mtf_pybinder.pcpp.UnsegmentedFctIdExtendedMsg, length: int) list[int]
- Args:
length (unsigned int)
- Returns:
list[unsigned int]
- class mtf.libs.mtf_pybinder.pcpp.UnsegmentedMsg
- __init__(self: mtf.libs.mtf_pybinder.pcpp.UnsegmentedMsg) None
- __new__(**kwargs)
- property bap_info
- get_suffix_data(self: mtf.libs.mtf_pybinder.pcpp.UnsegmentedMsg, length: int) list[int]
- Args:
length (unsigned int)
- Returns:
list[unsigned int]
- class mtf.libs.mtf_pybinder.pcpp.VlanFilter
A class for filtering VLAN tagged packets by VLAN ID. When using this filter only packets tagged with VLAN which has the specific VLAN ID will be received <BR> For deeper understanding of the filter concept please refer to PcapFilter.h
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.VlanFilter, vlan_id: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.VlanFilter, arg0: mtf.libs.mtf_pybinder.pcpp.VlanFilter) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.VlanFilter, : mtf.libs.mtf_pybinder.pcpp.VlanFilter) mtf.libs.mtf_pybinder.pcpp.VlanFilter
- Returns:
pcpp.VlanFilter
- match_packet_with_filter(self: mtf.libs.mtf_pybinder.pcpp.GeneralFilter, raw_packet: mtf.libs.mtf_pybinder.pcpp.RawPacket) bool
Match a raw packet with a given BPF filter.
A pointer to the raw packet to match the BPF filter with True if a raw packet matches the BPF filter or false otherwise
- Args:
raw_packet (str)
- Returns:
bool
- parse_to_string(self: mtf.libs.mtf_pybinder.pcpp.GeneralFilter, result: str) None
A method that parses the class instance into BPF string format
An empty string that the parsing will be written into. If the string isn’t empty, its content will be overridden
- Args:
result (str)
- Returns:
void
- set_vlan_id(self: mtf.libs.mtf_pybinder.pcpp.VlanFilter, vlan_id: int) None
Set the VLAN ID of the filter
The VLAN ID to use for the filter
- Args:
vlan_id (str)
- Returns:
void
- class mtf.libs.mtf_pybinder.pcpp.VlanLayer
Represents a VLAN tunnel layer
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.VlanLayer, data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: pcpp::Packet) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.VlanLayer, arg0: int, arg1: bool, arg2: int) -> None
doc
__init__(self: mtf.libs.mtf_pybinder.pcpp.VlanLayer, vlan_id: int, cfi: bool, priority: int, ether_type: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.VlanLayer, arg0: mtf.libs.mtf_pybinder.pcpp.VlanLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.VlanLayer, arg0: mtf.libs.mtf_pybinder.pcpp.VlanLayer) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.VlanLayer, : mtf.libs.mtf_pybinder.pcpp.VlanLayer) mtf.libs.mtf_pybinder.pcpp.VlanLayer
- Returns:
pcpp.VlanLayer
- property cfi
CFI bit value
- Returns:
unsigned int
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- property ethertype
EtherType value
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property priority
Priority value
- Returns:
unsigned int
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- property vlan_id
VLAN ID value
- Returns:
unsigned int
- class mtf.libs.mtf_pybinder.pcpp.VrrpLayer
A base class for all VRRP (Virtual Router Redundancy Protocol) protocol classes. This is an abstract class and cannot be instantiated, only its child classes can be instantiated. The inherited classes represent the different versions of the protocol: VRRPv2 and VRRPv3
- Default
- Other
- Owner
- Stop
- class VrrpPriority
An enum describing VRRP special priority values
Members:
Default
Stop
Owner
Other
- Default
- Other
- Owner
- Stop
- __init__(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer.VrrpPriority, value: int) None
- __new__(**kwargs)
- property name
- property value
- class VrrpType
VRRP message types
Members:
VrrpType_Unknown
VrrpType_Advertisement
- VrrpType_Advertisement
- VrrpType_Unknown
- __init__(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer.VrrpType, value: int) None
- __new__(**kwargs)
- property name
- property value
- VrrpType_Advertisement
- VrrpType_Unknown
- __init__(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer, arg0: mtf.libs.mtf_pybinder.pcpp.VrrpLayer) None
- __new__(**kwargs)
- add_ip_address(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer, ip_address: mtf.libs.mtf_pybinder.pcpp.IPAddress) bool
Add a virtual IP address at a the end of the virtual IP address list. The vrrp_header#ipAddressCount field will be incremented accordingly Virtual IP address to add true if add successfully, false otherwise
- Args:
ip_address (pcpp.IPAddress)
- Returns:
bool
- add_ip_addresses(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer, ip_addresses: list[mtf.libs.mtf_pybinder.pcpp.IPAddress]) bool
Add a list of virtual IP addresses at a the end of the virtual IP address list. The vrrp_header#ipAddressCount field will be incremented accordingly A vector containing all the virtual IP address true if added successfully, false otherwise
- Args:
ip_addresses (list[pcpp.IPAddress])
- Returns:
bool
- assign(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer, : mtf.libs.mtf_pybinder.pcpp.VrrpLayer) mtf.libs.mtf_pybinder.pcpp.VrrpLayer
- Returns:
pcpp.VrrpLayer
- calculate_and_set_checksum(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer) None
Fill the checksum from header and data and write the result to
- calculate_checksum(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer) int
Calculate the checksum from header and data and write the result to The checksum result
- Returns:
unsigned int
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer) None
Calculate the VRRP checksum
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_address_type(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer) mtf.libs.mtf_pybinder.pcpp.IPAddress.AddressType
The VRRP IP Address type
- Returns:
enum pcpp.IPAddress.AddressType
- get_checksum(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer) int
VRRP checksum of this message
- Returns:
unsigned int
- get_header_len(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer) int
The message size in bytes which include the size of the basic header + the size of the IP address(es)
- Returns:
unsigned int
- get_ip_addresses(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer) list[mtf.libs.mtf_pybinder.pcpp.IPAddress]
A list of the virtual IP addresses in this message
- Returns:
list[pcpp.IPAddress]
- get_ip_addresses_count(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer) int
The count of VRRP virtual IP addresses in this message
- Returns:
unsigned int
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_osi_model_layer(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer) mtf.libs.mtf_pybinder.pcpp.OsiModelLayer
- Returns:
enum pcpp.OsiModelLayer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- get_priority(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer) int
The priority in this message
- Returns:
unsigned int
- get_priority_as_enum(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer) mtf.libs.mtf_pybinder.pcpp.VrrpLayer.VrrpPriority
An enum describing VRRP priority
- Returns:
enum pcpp.VrrpLayer.VrrpPriority
- get_type(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer) mtf.libs.mtf_pybinder.pcpp.VrrpLayer.VrrpType
VRRP type set in vrrp_header#type as VrrpLayer::VrrpType enum.
- Returns:
enum pcpp.VrrpLayer.VrrpType
- get_version(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer) int
VRRP version of this message
- Returns:
unsigned int
- static get_version_from_data(data: int, data_len: int) int
A static method that validates the input data VRRP raw data (byte stream) The length of the byte stream One of the values ::VRRPv2, ::VRRPv3 according to detected VRRP version or ::UnknownProtocol if couldn’t detect VRRP version
- Args:
data (bytes) data_len (unsigned int)
- Returns:
unsigned int
- get_virtual_router_id(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer) int
The virtual router id (vrId) in this message
- Returns:
unsigned int
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- is_checksum_correct(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer) bool
True if VRRP checksum is correct
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer) None
Does nothing for this layer (VRRP layer is always last)
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- remove_all_ip_addresses(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer) bool
Remove all virtual IP addresses in the message. The vrrp_header#ipAddressCount field will be set to 0 True if virtual IP addresses were cleared successfully or false otherwise. If false is returned an appropriate error message will be printed to log
- Returns:
bool
- remove_ip_address_at_index(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer, index: int) bool
Remove a virtual IP address at a certain index. The vrrp_header#ipAddressCount field will be decremented accordingly The index of the virtual IP address to be removed True if virtual IP address was removed successfully or false otherwise. If false is returned an appropriate error message will be printed to log
- Args:
index (int)
- Returns:
bool
- set_priority(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer, priority: int) None
Set the priority new priority to set
- Args:
priority (unsigned int)
- set_virtual_router_id(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer, virtual_router_id: int) None
Set the virtual router ID new ID to set
- Args:
virtual_router_id (unsigned int)
- to_string(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer) str
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.VrrpV2Layer
Represents VRRPv2 (Virtual Router Redundancy Protocol ver 2) layer. This class represents all the different messages of VRRPv2
- Default
- Other
- Owner
- Stop
- class VrrpAuthType
VRRP v2 authentication types
Members:
NoAuthentication
SimpleTextPassword
IPAuthenticationHeader
MD5
Other
- IPAuthenticationHeader
- MD5
- NoAuthentication
- Other
- SimpleTextPassword
- __init__(self: mtf.libs.mtf_pybinder.pcpp.VrrpV2Layer.VrrpAuthType, value: int) None
- __new__(**kwargs)
- property name
- property value
- class VrrpPriority
An enum describing VRRP special priority values
Members:
Default
Stop
Owner
Other
- Default
- Other
- Owner
- Stop
- __init__(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer.VrrpPriority, value: int) None
- __new__(**kwargs)
- property name
- property value
- class VrrpType
VRRP message types
Members:
VrrpType_Unknown
VrrpType_Advertisement
- VrrpType_Advertisement
- VrrpType_Unknown
- __init__(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer.VrrpType, value: int) None
- __new__(**kwargs)
- property name
- property value
- VrrpType_Advertisement
- VrrpType_Unknown
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.VrrpV2Layer, data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.VrrpV2Layer, arg0: int, arg1: int, arg2: int) -> None
doc
__init__(self: mtf.libs.mtf_pybinder.pcpp.VrrpV2Layer, virtual_router_id: int, priority: int, adv_int: int, auth_type: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.VrrpV2Layer, arg0: mtf.libs.mtf_pybinder.pcpp.VrrpV2Layer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.VrrpV2Layer, arg0: mtf.libs.mtf_pybinder.pcpp.VrrpV2Layer) -> None
- __new__(**kwargs)
- add_ip_address(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer, ip_address: mtf.libs.mtf_pybinder.pcpp.IPAddress) bool
Add a virtual IP address at a the end of the virtual IP address list. The vrrp_header#ipAddressCount field will be incremented accordingly Virtual IP address to add true if add successfully, false otherwise
- Args:
ip_address (pcpp.IPAddress)
- Returns:
bool
- add_ip_addresses(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer, ip_addresses: list[mtf.libs.mtf_pybinder.pcpp.IPAddress]) bool
Add a list of virtual IP addresses at a the end of the virtual IP address list. The vrrp_header#ipAddressCount field will be incremented accordingly A vector containing all the virtual IP address true if added successfully, false otherwise
- Args:
ip_addresses (list[pcpp.IPAddress])
- Returns:
bool
- assign(self: mtf.libs.mtf_pybinder.pcpp.VrrpV2Layer, : mtf.libs.mtf_pybinder.pcpp.VrrpV2Layer) mtf.libs.mtf_pybinder.pcpp.VrrpV2Layer
- Returns:
pcpp.VrrpV2Layer
- calculate_and_set_checksum(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer) None
Fill the checksum from header and data and write the result to
- calculate_checksum(self: mtf.libs.mtf_pybinder.pcpp.VrrpV2Layer) int
Calculate the checksum from header and data and write the result to The checksum result
- Returns:
unsigned int
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer) None
Calculate the VRRP checksum
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_address_type(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer) mtf.libs.mtf_pybinder.pcpp.IPAddress.AddressType
The VRRP IP Address type
- Returns:
enum pcpp.IPAddress.AddressType
- get_adv_int(self: mtf.libs.mtf_pybinder.pcpp.VrrpV2Layer) int
The VRRP advertisement interval in this message
- Returns:
unsigned int
- get_auth_type(self: mtf.libs.mtf_pybinder.pcpp.VrrpV2Layer) int
The authentication type in this message
- Returns:
unsigned int
- get_auth_type_as_enum(self: mtf.libs.mtf_pybinder.pcpp.VrrpV2Layer) mtf.libs.mtf_pybinder.pcpp.VrrpV2Layer.VrrpAuthType
The VRRP authentication type as enum
- Returns:
enum pcpp.VrrpV2Layer.VrrpAuthType
- get_checksum(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer) int
VRRP checksum of this message
- Returns:
unsigned int
- get_header_len(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer) int
The message size in bytes which include the size of the basic header + the size of the IP address(es)
- Returns:
unsigned int
- get_ip_addresses(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer) list[mtf.libs.mtf_pybinder.pcpp.IPAddress]
A list of the virtual IP addresses in this message
- Returns:
list[pcpp.IPAddress]
- get_ip_addresses_count(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer) int
The count of VRRP virtual IP addresses in this message
- Returns:
unsigned int
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_osi_model_layer(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer) mtf.libs.mtf_pybinder.pcpp.OsiModelLayer
- Returns:
enum pcpp.OsiModelLayer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- get_priority(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer) int
The priority in this message
- Returns:
unsigned int
- get_priority_as_enum(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer) mtf.libs.mtf_pybinder.pcpp.VrrpLayer.VrrpPriority
An enum describing VRRP priority
- Returns:
enum pcpp.VrrpLayer.VrrpPriority
- get_type(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer) mtf.libs.mtf_pybinder.pcpp.VrrpLayer.VrrpType
VRRP type set in vrrp_header#type as VrrpLayer::VrrpType enum.
- Returns:
enum pcpp.VrrpLayer.VrrpType
- get_version(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer) int
VRRP version of this message
- Returns:
unsigned int
- static get_version_from_data(data: int, data_len: int) int
A static method that validates the input data VRRP raw data (byte stream) The length of the byte stream One of the values ::VRRPv2, ::VRRPv3 according to detected VRRP version or ::UnknownProtocol if couldn’t detect VRRP version
- Args:
data (bytes) data_len (unsigned int)
- Returns:
unsigned int
- get_virtual_router_id(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer) int
The virtual router id (vrId) in this message
- Returns:
unsigned int
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- is_checksum_correct(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer) bool
True if VRRP checksum is correct
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer) None
Does nothing for this layer (VRRP layer is always last)
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- remove_all_ip_addresses(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer) bool
Remove all virtual IP addresses in the message. The vrrp_header#ipAddressCount field will be set to 0 True if virtual IP addresses were cleared successfully or false otherwise. If false is returned an appropriate error message will be printed to log
- Returns:
bool
- remove_ip_address_at_index(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer, index: int) bool
Remove a virtual IP address at a certain index. The vrrp_header#ipAddressCount field will be decremented accordingly The index of the virtual IP address to be removed True if virtual IP address was removed successfully or false otherwise. If false is returned an appropriate error message will be printed to log
- Args:
index (int)
- Returns:
bool
- set_adv_int(self: mtf.libs.mtf_pybinder.pcpp.VrrpV2Layer, adv_int: int) None
Set advertisement interval value in this message value to set
- Args:
adv_int (unsigned int)
- set_auth_type(self: mtf.libs.mtf_pybinder.pcpp.VrrpV2Layer, auth_type: int) None
Set VRRP authentication type value to set
- Args:
auth_type (unsigned int)
- set_priority(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer, priority: int) None
Set the priority new priority to set
- Args:
priority (unsigned int)
- set_virtual_router_id(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer, virtual_router_id: int) None
Set the virtual router ID new ID to set
- Args:
virtual_router_id (unsigned int)
- to_string(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer) str
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.VrrpV3Layer
Represents VRRPv3 (Virtual Router Redundancy Protocol ver 3) layer. This class represents all the different messages of VRRP
- Default
- Other
- Owner
- Stop
- class VrrpPriority
An enum describing VRRP special priority values
Members:
Default
Stop
Owner
Other
- Default
- Other
- Owner
- Stop
- __init__(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer.VrrpPriority, value: int) None
- __new__(**kwargs)
- property name
- property value
- class VrrpType
VRRP message types
Members:
VrrpType_Unknown
VrrpType_Advertisement
- VrrpType_Advertisement
- VrrpType_Unknown
- __init__(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer.VrrpType, value: int) None
- __new__(**kwargs)
- property name
- property value
- VrrpType_Advertisement
- VrrpType_Unknown
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.VrrpV3Layer, data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet, address_type: mtf.libs.mtf_pybinder.pcpp.IPAddress.AddressType) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.VrrpV3Layer, address_type: mtf.libs.mtf_pybinder.pcpp.IPAddress.AddressType, virtual_router_id: int, priority: int, max_adv_int: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.VrrpV3Layer, arg0: mtf.libs.mtf_pybinder.pcpp.VrrpV3Layer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.VrrpV3Layer, arg0: mtf.libs.mtf_pybinder.pcpp.VrrpV3Layer) -> None
- __new__(**kwargs)
- add_ip_address(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer, ip_address: mtf.libs.mtf_pybinder.pcpp.IPAddress) bool
Add a virtual IP address at a the end of the virtual IP address list. The vrrp_header#ipAddressCount field will be incremented accordingly Virtual IP address to add true if add successfully, false otherwise
- Args:
ip_address (pcpp.IPAddress)
- Returns:
bool
- add_ip_addresses(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer, ip_addresses: list[mtf.libs.mtf_pybinder.pcpp.IPAddress]) bool
Add a list of virtual IP addresses at a the end of the virtual IP address list. The vrrp_header#ipAddressCount field will be incremented accordingly A vector containing all the virtual IP address true if added successfully, false otherwise
- Args:
ip_addresses (list[pcpp.IPAddress])
- Returns:
bool
- assign(self: mtf.libs.mtf_pybinder.pcpp.VrrpV3Layer, : mtf.libs.mtf_pybinder.pcpp.VrrpV3Layer) mtf.libs.mtf_pybinder.pcpp.VrrpV3Layer
- Returns:
pcpp.VrrpV3Layer
- calculate_and_set_checksum(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer) None
Fill the checksum from header and data and write the result to
- calculate_checksum(self: mtf.libs.mtf_pybinder.pcpp.VrrpV3Layer) int
Calculate the checksum from header and data and write the result to The checksum result
- Returns:
unsigned int
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer) None
Calculate the VRRP checksum
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_address_type(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer) mtf.libs.mtf_pybinder.pcpp.IPAddress.AddressType
The VRRP IP Address type
- Returns:
enum pcpp.IPAddress.AddressType
- get_checksum(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer) int
VRRP checksum of this message
- Returns:
unsigned int
- get_header_len(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer) int
The message size in bytes which include the size of the basic header + the size of the IP address(es)
- Returns:
unsigned int
- get_ip_addresses(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer) list[mtf.libs.mtf_pybinder.pcpp.IPAddress]
A list of the virtual IP addresses in this message
- Returns:
list[pcpp.IPAddress]
- get_ip_addresses_count(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer) int
The count of VRRP virtual IP addresses in this message
- Returns:
unsigned int
- get_max_adv_int(self: mtf.libs.mtf_pybinder.pcpp.VrrpV3Layer) int
The maximum advertisement interval in this message
- Returns:
unsigned int
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_osi_model_layer(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer) mtf.libs.mtf_pybinder.pcpp.OsiModelLayer
- Returns:
enum pcpp.OsiModelLayer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- get_priority(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer) int
The priority in this message
- Returns:
unsigned int
- get_priority_as_enum(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer) mtf.libs.mtf_pybinder.pcpp.VrrpLayer.VrrpPriority
An enum describing VRRP priority
- Returns:
enum pcpp.VrrpLayer.VrrpPriority
- get_type(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer) mtf.libs.mtf_pybinder.pcpp.VrrpLayer.VrrpType
VRRP type set in vrrp_header#type as VrrpLayer::VrrpType enum.
- Returns:
enum pcpp.VrrpLayer.VrrpType
- get_version(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer) int
VRRP version of this message
- Returns:
unsigned int
- static get_version_from_data(data: int, data_len: int) int
A static method that validates the input data VRRP raw data (byte stream) The length of the byte stream One of the values ::VRRPv2, ::VRRPv3 according to detected VRRP version or ::UnknownProtocol if couldn’t detect VRRP version
- Args:
data (bytes) data_len (unsigned int)
- Returns:
unsigned int
- get_virtual_router_id(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer) int
The virtual router id (vrId) in this message
- Returns:
unsigned int
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- is_checksum_correct(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer) bool
True if VRRP checksum is correct
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer) None
Does nothing for this layer (VRRP layer is always last)
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- remove_all_ip_addresses(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer) bool
Remove all virtual IP addresses in the message. The vrrp_header#ipAddressCount field will be set to 0 True if virtual IP addresses were cleared successfully or false otherwise. If false is returned an appropriate error message will be printed to log
- Returns:
bool
- remove_ip_address_at_index(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer, index: int) bool
Remove a virtual IP address at a certain index. The vrrp_header#ipAddressCount field will be decremented accordingly The index of the virtual IP address to be removed True if virtual IP address was removed successfully or false otherwise. If false is returned an appropriate error message will be printed to log
- Args:
index (int)
- Returns:
bool
- set_max_adv_int(self: mtf.libs.mtf_pybinder.pcpp.VrrpV3Layer, max_adv_int: int) None
Set the maximum advertisement interval value Value to set
- Args:
max_adv_int (unsigned int)
- set_priority(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer, priority: int) None
Set the priority new priority to set
- Args:
priority (unsigned int)
- set_virtual_router_id(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer, virtual_router_id: int) None
Set the virtual router ID new ID to set
- Args:
virtual_router_id (unsigned int)
- to_string(self: mtf.libs.mtf_pybinder.pcpp.VrrpLayer) str
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.VxlanLayer
Represents a VXLAN (Virtual eXtensible Local Area Network) protocol layer
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.VxlanLayer, data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.VxlanLayer) -> None
doc
__init__(self: mtf.libs.mtf_pybinder.pcpp.VxlanLayer, arg0: int) -> None
doc
__init__(self: mtf.libs.mtf_pybinder.pcpp.VxlanLayer, arg0: int, arg1: int) -> None
doc
__init__(self: mtf.libs.mtf_pybinder.pcpp.VxlanLayer, arg0: int, arg1: int, arg2: bool) -> None
doc
__init__(self: mtf.libs.mtf_pybinder.pcpp.VxlanLayer, arg0: int, arg1: int, arg2: bool, arg3: bool) -> None
doc
__init__(self: mtf.libs.mtf_pybinder.pcpp.VxlanLayer, vni: int, group_policy_id: int, set_gbp_flag: bool, set_policy_applied_flag: bool, set_dont_learn_flag: bool) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.VxlanLayer, arg0: mtf.libs.mtf_pybinder.pcpp.VxlanLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.VxlanLayer, arg0: mtf.libs.mtf_pybinder.pcpp.VxlanLayer) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.VxlanLayer, : mtf.libs.mtf_pybinder.pcpp.VxlanLayer) mtf.libs.mtf_pybinder.pcpp.VxlanLayer
- Returns:
pcpp.VxlanLayer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.VxlanLayer) None
Does nothing for this layer
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_header_len(self: mtf.libs.mtf_pybinder.pcpp.VxlanLayer) int
Size of vxlan_header
- Returns:
unsigned int
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_osi_model_layer(self: mtf.libs.mtf_pybinder.pcpp.VxlanLayer) mtf.libs.mtf_pybinder.pcpp.OsiModelLayer
- Returns:
enum pcpp.OsiModelLayer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- get_vni(self: mtf.libs.mtf_pybinder.pcpp.VxlanLayer) int
The VXLAN Network ID (VNI) value
- Returns:
unsigned int
- get_vxlan_header(self: mtf.libs.mtf_pybinder.pcpp.VxlanLayer) mtf.libs.mtf_pybinder.pcpp.vxlan_header
Get a pointer to the VXLAN header. Notice this points directly to the data, so every change will change the actual packet data A pointer to the vxlan_header
- Returns:
pcpp.vxlan_header
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- static is_vxlan_port(port: int) bool
A static method that checks whether the port is considered as VxLAN The port number to be checked
- Args:
port (unsigned int)
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.VxlanLayer) None
Next layer for VXLAN is always Ethernet
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- set_vni(self: mtf.libs.mtf_pybinder.pcpp.VxlanLayer, vni: int) None
Set VXLAN Network ID (VNI) value VNI value to set
- Args:
vni (unsigned int)
- to_string(self: mtf.libs.mtf_pybinder.pcpp.VxlanLayer) str
- Returns:
str
- class mtf.libs.mtf_pybinder.pcpp.WakeOnLanLayer
Class for representing the Wake on LAN Layer
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.WakeOnLanLayer, data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.WakeOnLanLayer, target_addr: mtf.libs.mtf_pybinder.pcpp.MacAddress) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.WakeOnLanLayer, target_addr: mtf.libs.mtf_pybinder.pcpp.MacAddress, password: int, len: int) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.WakeOnLanLayer, target_addr: mtf.libs.mtf_pybinder.pcpp.MacAddress, password: mtf.libs.mtf_pybinder.pcpp.MacAddress) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.WakeOnLanLayer, target_addr: mtf.libs.mtf_pybinder.pcpp.MacAddress, password: mtf.libs.mtf_pybinder.pcpp.IPv4Address) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.WakeOnLanLayer, arg0: mtf.libs.mtf_pybinder.pcpp.WakeOnLanLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.WakeOnLanLayer, arg0: mtf.libs.mtf_pybinder.pcpp.WakeOnLanLayer) -> None
- __new__(**kwargs)
- assign(self: mtf.libs.mtf_pybinder.pcpp.WakeOnLanLayer, : mtf.libs.mtf_pybinder.pcpp.WakeOnLanLayer) mtf.libs.mtf_pybinder.pcpp.WakeOnLanLayer
- Returns:
pcpp.WakeOnLanLayer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.WakeOnLanLayer) None
Does nothing for this layer
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_header_len(self: mtf.libs.mtf_pybinder.pcpp.WakeOnLanLayer) int
Get the size of the layer
- Returns:
unsigned int
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_osi_model_layer(self: mtf.libs.mtf_pybinder.pcpp.WakeOnLanLayer) mtf.libs.mtf_pybinder.pcpp.OsiModelLayer
The OSI layer level of Wake on LAN (Data Link Layer)
- Returns:
enum pcpp.OsiModelLayer
- get_password(self: mtf.libs.mtf_pybinder.pcpp.WakeOnLanLayer) str
Get the password of the command Returns the password if exists, empty string otherwise
- Returns:
str
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- get_target_addr(self: mtf.libs.mtf_pybinder.pcpp.WakeOnLanLayer) mtf.libs.mtf_pybinder.pcpp.MacAddress
Get the target MAC address of the command MAC address of the target
- Returns:
pcpp.MacAddress
- get_wake_on_lan_header(self: mtf.libs.mtf_pybinder.pcpp.WakeOnLanLayer) pcpp::WakeOnLanLayer::wol_header
Get a pointer to the Wake On LAN header. Notice this points directly to the data, so every change will change the actual packet data A pointer to the wol_header
- Returns:
pcpp.WakeOnLanLayer.wol_header
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- static is_data_valid(data: int, data_size: int) bool
A static method that takes a byte array and detects whether it is a Wake on LAN message A byte array The byte array size (in bytes) True if the data is identified as Wake on LAN message
- Args:
data (bytes) data_size (unsigned int)
- Returns:
bool
- static is_wake_on_lan_port(port: int) bool
A static method that checks whether the port is considered as Wake on LAN The port number to be checked
- Args:
port (unsigned int)
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.WakeOnLanLayer) None
Parses the next layer. Wake on LAN is the always last so does nothing for this layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- set_password(*args, **kwargs)
Overloaded function.
set_password(self: mtf.libs.mtf_pybinder.pcpp.WakeOnLanLayer, password: int, len: int) -> bool
Set the password of the command Password as array Length of the password array, length of the password should be less than 6 bytes True if operation successful, false otherwise
- Args:
password (bytes) len (unsigned int)
- Returns:
bool
set_password(self: mtf.libs.mtf_pybinder.pcpp.WakeOnLanLayer, password: str) -> bool
Set the password of the command Password as string. Length of the password should be less than 6 bytes True if operation successful, false otherwise
- Args:
password (str)
- Returns:
bool
set_password(self: mtf.libs.mtf_pybinder.pcpp.WakeOnLanLayer, addr: mtf.libs.mtf_pybinder.pcpp.MacAddress) -> bool
Set the password of the command Password as MAC address True if operation successful, false otherwise
- Args:
addr (pcpp.MacAddress)
- Returns:
bool
set_password(self: mtf.libs.mtf_pybinder.pcpp.WakeOnLanLayer, addr: mtf.libs.mtf_pybinder.pcpp.IPv4Address) -> bool
Set the password of the command Password as IPv4 address True if operation successful, false otherwise
- Args:
addr (pcpp.IPv4Address)
- Returns:
bool
- set_target_addr(self: mtf.libs.mtf_pybinder.pcpp.WakeOnLanLayer, target_addr: mtf.libs.mtf_pybinder.pcpp.MacAddress) None
Set the target MAC address MAC address of the target
- Args:
target_addr (pcpp.MacAddress)
- to_string(self: mtf.libs.mtf_pybinder.pcpp.WakeOnLanLayer) str
Returns the protocol info as readable string
- Returns:
str
- class wol_header
- __init__(self: mtf.libs.mtf_pybinder.pcpp.WakeOnLanLayer.wol_header) None
- __new__(**kwargs)
- class mtf.libs.mtf_pybinder.pcpp.XcpCommandConnectLayer
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.XcpCommandConnectLayer, data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.XcpCommandConnectLayer, arg0: mtf.libs.mtf_pybinder.pcpp.XcpCommandConnectLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.XcpCommandConnectLayer, arg0: mtf.libs.mtf_pybinder.pcpp.XcpCommandConnectLayer) -> None
- __new__(**kwargs)
- static add_config(address: str, port: int) None
Add user config for XCP Layer:
- assign(self: mtf.libs.mtf_pybinder.pcpp.IDataContainer, : mtf.libs.mtf_pybinder.pcpp.IDataContainer) mtf.libs.mtf_pybinder.pcpp.IDataContainer
- Returns:
pcpp.IDataContainer
- static clear_config() None
Clear user config for XCP Layer
- property command_code
XCP Command packet header attribute command_code
- property command_type
XCP Command type
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property counter
XCP packet header attribute counter
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property length
XCP packet header attribute length
- property mode
XCP Command Connect packet attribute command_code
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- property xcp_message_type
XCP message type
- property xcp_packet_payload
XCP packet payload without XCP header
- class mtf.libs.mtf_pybinder.pcpp.XcpCommandLayer
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.XcpCommandLayer, data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.XcpCommandLayer, arg0: mtf.libs.mtf_pybinder.pcpp.XcpCommandLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.XcpCommandLayer, arg0: mtf.libs.mtf_pybinder.pcpp.XcpCommandLayer) -> None
- __new__(**kwargs)
- static add_config(address: str, port: int) None
Add user config for XCP Layer:
- assign(self: mtf.libs.mtf_pybinder.pcpp.IDataContainer, : mtf.libs.mtf_pybinder.pcpp.IDataContainer) mtf.libs.mtf_pybinder.pcpp.IDataContainer
- Returns:
pcpp.IDataContainer
- static clear_config() None
Clear user config for XCP Layer
- property command_code
XCP Command packet header attribute command_code
- property command_type
XCP Command type
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property counter
XCP packet header attribute counter
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property length
XCP packet header attribute length
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- property xcp_message_type
XCP message type
- property xcp_packet_payload
XCP packet payload without XCP header
- class mtf.libs.mtf_pybinder.pcpp.XcpCommandType
Members:
CONNECT
DISCONNECT
GET_STATUS
SYNCH
GET_COMM_MODE_INFO
GET_ID
SET_REQUEST
GET_SEED
UNLOCK
SET_MTA
UPLOAD
SHORT_UPLOAD
BUILD_CHECKSUM
TRANSPORT_LAYER_CMD
USER_CMD
GET_VERSION
DOWNLOAD
DOWNLOAD_NEXT
DOWNLOAD_MAX
SHORT_DOWNLOAD
MODIFY_BITS
SET_CAL_PAGE
GET_CAL_PAGE
GET_PAG_PROCESSOR_INFO
GET_SEGMENT_INFO
GET_PAGE_INFO
SET_SEGMENT_MODE
GET_SEGMENT_MODE
COPY_CAL_PAGE
SET_DAQ_PTR
WRITE_DAQ
SET_DAQ_LIST_MODE
START_STOP_DAQ_LIST
START_STOP_SYNCH
WRITE_DAQ_MULTIPLE
READ_DAQ
GET_DAQ_CLOCK
GET_DAQ_PROCESSOR_INFO
GET_DAQ_RESOLUTION_INFO
GET_DAQ_LIST_MODE
GET_DAQ_EVENT_INFO
DTO_CTR_PROPERTIES
DAQ_PACKED_MODE
CLEAR_DAQ_LIST
GET_DAQ_LIST_INFO
FREE_DAQ
ALLOC_DAQ
ALLOC_ODT
ALLOC_ODT_ENTRY
PROGRAM_START
PROGRAM_CLEAR
PROGRAM
PROGRAM_RESET
GET_PGM_PROCESSOR_INFO
GET_SECTOR_INFO
PROGRAM_PREPARE
PROGRAM_FORMAT
PROGRAM_NEXT
PROGRAM_MAX
PROGRAM_VERIFY
TIME_CORRELATION_PROPERTIES
- ALLOC_DAQ
- ALLOC_ODT
- ALLOC_ODT_ENTRY
- BUILD_CHECKSUM
- CLEAR_DAQ_LIST
- CONNECT
- COPY_CAL_PAGE
- DAQ_PACKED_MODE
- DISCONNECT
- DOWNLOAD
- DOWNLOAD_MAX
- DOWNLOAD_NEXT
- DTO_CTR_PROPERTIES
- FREE_DAQ
- GET_CAL_PAGE
- GET_COMM_MODE_INFO
- GET_DAQ_CLOCK
- GET_DAQ_EVENT_INFO
- GET_DAQ_LIST_INFO
- GET_DAQ_LIST_MODE
- GET_DAQ_PROCESSOR_INFO
- GET_DAQ_RESOLUTION_INFO
- GET_ID
- GET_PAGE_INFO
- GET_PAG_PROCESSOR_INFO
- GET_PGM_PROCESSOR_INFO
- GET_SECTOR_INFO
- GET_SEED
- GET_SEGMENT_INFO
- GET_SEGMENT_MODE
- GET_STATUS
- GET_VERSION
- MODIFY_BITS
- PROGRAM
- PROGRAM_CLEAR
- PROGRAM_FORMAT
- PROGRAM_MAX
- PROGRAM_NEXT
- PROGRAM_PREPARE
- PROGRAM_RESET
- PROGRAM_START
- PROGRAM_VERIFY
- READ_DAQ
- SET_CAL_PAGE
- SET_DAQ_LIST_MODE
- SET_DAQ_PTR
- SET_MTA
- SET_REQUEST
- SET_SEGMENT_MODE
- SHORT_DOWNLOAD
- SHORT_UPLOAD
- START_STOP_DAQ_LIST
- START_STOP_SYNCH
- SYNCH
- TIME_CORRELATION_PROPERTIES
- TRANSPORT_LAYER_CMD
- UNLOCK
- UPLOAD
- USER_CMD
- WRITE_DAQ
- WRITE_DAQ_MULTIPLE
- __init__(self: mtf.libs.mtf_pybinder.pcpp.XcpCommandType, value: int) None
- __new__(**kwargs)
- property name
- property value
- class mtf.libs.mtf_pybinder.pcpp.XcpEventLayer
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.XcpEventLayer, data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.XcpEventLayer, arg0: mtf.libs.mtf_pybinder.pcpp.XcpEventLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.XcpEventLayer, arg0: mtf.libs.mtf_pybinder.pcpp.XcpEventLayer) -> None
- __new__(**kwargs)
- static add_config(address: str, port: int) None
Add user config for XCP Layer:
- assign(self: mtf.libs.mtf_pybinder.pcpp.IDataContainer, : mtf.libs.mtf_pybinder.pcpp.IDataContainer) mtf.libs.mtf_pybinder.pcpp.IDataContainer
- Returns:
pcpp.IDataContainer
- static clear_config() None
Clear user config for XCP Layer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property counter
XCP packet header attribute counter
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property length
XCP packet header attribute length
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- property xcp_message_type
XCP message type
- property xcp_packet_payload
XCP packet payload without XCP header
- class mtf.libs.mtf_pybinder.pcpp.XcpLayer
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.XcpLayer, data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.XcpLayer, arg0: mtf.libs.mtf_pybinder.pcpp.XcpLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.XcpLayer, arg0: mtf.libs.mtf_pybinder.pcpp.XcpLayer) -> None
- __new__(**kwargs)
- static add_config(address: str, port: int) None
Add user config for XCP Layer:
- assign(self: mtf.libs.mtf_pybinder.pcpp.IDataContainer, : mtf.libs.mtf_pybinder.pcpp.IDataContainer) mtf.libs.mtf_pybinder.pcpp.IDataContainer
- Returns:
pcpp.IDataContainer
- static clear_config() None
Clear user config for XCP Layer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property counter
XCP packet header attribute counter
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property length
XCP packet header attribute length
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- property xcp_message_type
XCP message type
- property xcp_packet_payload
XCP packet payload without XCP header
- class mtf.libs.mtf_pybinder.pcpp.XcpMessageType
Members:
OTHER
COMMAND
RESPONSE_POSITIVE
RESPONSE_NEGATIVE
EVENT
DATA
- COMMAND
- DATA
- EVENT
- OTHER
- RESPONSE_NEGATIVE
- RESPONSE_POSITIVE
- __init__(self: mtf.libs.mtf_pybinder.pcpp.XcpMessageType, value: int) None
- __new__(**kwargs)
- property name
- property value
- class mtf.libs.mtf_pybinder.pcpp.XcpResponseNegativeLayer
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.XcpResponseNegativeLayer, data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.XcpResponseNegativeLayer, arg0: mtf.libs.mtf_pybinder.pcpp.XcpResponseNegativeLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.XcpResponseNegativeLayer, arg0: mtf.libs.mtf_pybinder.pcpp.XcpResponseNegativeLayer) -> None
- __new__(**kwargs)
- static add_config(address: str, port: int) None
Add user config for XCP Layer:
- assign(self: mtf.libs.mtf_pybinder.pcpp.IDataContainer, : mtf.libs.mtf_pybinder.pcpp.IDataContainer) mtf.libs.mtf_pybinder.pcpp.IDataContainer
- Returns:
pcpp.IDataContainer
- static clear_config() None
Clear user config for XCP Layer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property counter
XCP packet header attribute counter
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property length
XCP packet header attribute length
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- property xcp_message_type
XCP message type
- property xcp_packet_payload
XCP packet payload without XCP header
- class mtf.libs.mtf_pybinder.pcpp.XcpResponsePositiveLayer
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.XcpResponsePositiveLayer, data: int, data_len: int, prev_layer: mtf.libs.mtf_pybinder.pcpp.Layer, packet: mtf.libs.mtf_pybinder.pcpp.Packet) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.XcpResponsePositiveLayer, arg0: mtf.libs.mtf_pybinder.pcpp.XcpResponsePositiveLayer) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.XcpResponsePositiveLayer, arg0: mtf.libs.mtf_pybinder.pcpp.XcpResponsePositiveLayer) -> None
- __new__(**kwargs)
- static add_config(address: str, port: int) None
Add user config for XCP Layer:
- assign(self: mtf.libs.mtf_pybinder.pcpp.IDataContainer, : mtf.libs.mtf_pybinder.pcpp.IDataContainer) mtf.libs.mtf_pybinder.pcpp.IDataContainer
- Returns:
pcpp.IDataContainer
- static clear_config() None
Clear user config for XCP Layer
- compute_calculate_fields(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer can compute field values automatically using this method. This is an abstract method
- copy_data(self: mtf.libs.mtf_pybinder.pcpp.Layer, to_arr: int) None
Copy the raw data of this layer to another array The destination byte array
- Args:
to_arr (bytes)
- property counter
XCP packet header attribute counter
- property data
- property data_len
The length in bytes of the data from the first byte of the header until the end of the packet
- get_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the next layer in the protocol stack or NULL if the layer is the last one
- Returns:
pcpp.Layer
- get_prev_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) mtf.libs.mtf_pybinder.pcpp.Layer
A pointer to the previous layer in the protocol stack or NULL if the layer is the first one
- Returns:
pcpp.Layer
- property header_len
The header length in bytes
- Returns:
unsigned int
- is_allocated_to_packet(self: mtf.libs.mtf_pybinder.pcpp.Layer) bool
Raw data in layers can come from one of sources: 1. from an existing packet - this is the case when parsing packets received from files or the network. In this case the data was already allocated by someone else, and layer only holds the pointer to the relevant place inside this data 2. when creating packets, data is allocated when layer is created. In this case the layer is responsible for freeing it as well Returns true if the data was allocated by an external source (a packet) or false if it was allocated by the layer itself
- Returns:
bool
- property layer_payload
The payload from the first byte after the current layer header until the end of the data, which includes all the following layers if present.
- property layer_payload_size
The size in bytes of the layer_payload, that is from the first byte after the current layer header until the end of the data, including all the following layers if present.
- Returns:
unsigned int
- property length
XCP packet header attribute length
- property osi_model_layer
The OSI Model layer this protocol belongs to
- Returns:
enum pcpp.OsiModelLayer
- parse_next_layer(self: mtf.libs.mtf_pybinder.pcpp.Layer) None
Each layer is responsible for parsing the next layer
- property protocol_type
The protocol enum
- Returns:
pcpp.ProtocolType
- to_string(self: mtf.libs.mtf_pybinder.pcpp.Layer) str
A string representation of the layer most important data (should look like the layer description in Wireshark)
- Returns:
str
- property xcp_message_type
XCP message type
- property xcp_packet_payload
XCP packet payload without XCP header
- class mtf.libs.mtf_pybinder.pcpp.bap_information
- __init__(self: mtf.libs.mtf_pybinder.pcpp.bap_information) None
- __new__(**kwargs)
- property frame_type
- property function_id
- property lcu_id
- property op_code
- class mtf.libs.mtf_pybinder.pcpp.bus_data
- __init__(self: mtf.libs.mtf_pybinder.pcpp.bus_data) None
- __new__(**kwargs)
- property error_total
- property interface_id
- property message_total
- property vendor_data
- class mtf.libs.mtf_pybinder.pcpp.bus_data_without_vendor
- __init__(self: mtf.libs.mtf_pybinder.pcpp.bus_data_without_vendor) None
- __new__(**kwargs)
- property error_total
- property interface_id
- property message_total
- class mtf.libs.mtf_pybinder.pcpp.bus_vendor_data
- __init__(self: mtf.libs.mtf_pybinder.pcpp.bus_vendor_data) None
- __new__(**kwargs)
- property link_quality
- property link_status
- property linkup_time
- class mtf.libs.mtf_pybinder.pcpp.ether_dot3_header
- __init__(self: mtf.libs.mtf_pybinder.pcpp.ether_dot3_header) None
- __new__(**kwargs)
- property length
- class mtf.libs.mtf_pybinder.pcpp.ether_header
- __init__(self: mtf.libs.mtf_pybinder.pcpp.ether_header) None
- __new__(**kwargs)
- property ether_type
- class mtf.libs.mtf_pybinder.pcpp.gre1_header
- __init__(self: mtf.libs.mtf_pybinder.pcpp.gre1_header) None
- __new__(**kwargs)
- property ack_sequence_num_bit
- property call_id
- property checksum_bit
- property flags
- property key_bit
- property payload_length
- property protocol
- property recursion_control
- property routing_bit
- property sequence_num_bit
- property strict_source_route_bit
- property version
- class mtf.libs.mtf_pybinder.pcpp.gre_basic_header
- __init__(self: mtf.libs.mtf_pybinder.pcpp.gre_basic_header) None
- __new__(**kwargs)
- property ack_sequence_num_bit
- property checksum_bit
- property flags
- property key_bit
- property protocol
- property recursion_control
- property routing_bit
- property sequence_num_bit
- property strict_source_route_bit
- property version
- class mtf.libs.mtf_pybinder.pcpp.gtpv1_header
GTP v1 common message header
- __init__(self: mtf.libs.mtf_pybinder.pcpp.gtpv1_header) None
- __new__(**kwargs)
- property extension_header_flag
- property message_length
- property message_type
- property npdu_number_flag
- property protocol_type
- property reserved
- property sequence_number_flag
- property teid
- property version
- class mtf.libs.mtf_pybinder.pcpp.hardware_version
- __init__(self: mtf.libs.mtf_pybinder.pcpp.hardware_version) None
- __new__(**kwargs)
- property version_1
First part of the version
- property version_2
Second part of the version
- class mtf.libs.mtf_pybinder.pcpp.igmp_header
IGMPv1 and IGMPv2 basic protocol header
- __init__(self: mtf.libs.mtf_pybinder.pcpp.igmp_header) None
- __new__(**kwargs)
- property checksum
- property group_address
- property max_response_time
- property type
- class mtf.libs.mtf_pybinder.pcpp.igmpv3_group_record
A block of fields containing information pertaining to the sender’s membership in a single multicast group on the interface from which the Report is sent. Relevant only for IGMPv3 membership report messages
- __init__(self: mtf.libs.mtf_pybinder.pcpp.igmpv3_group_record) None
- __new__(**kwargs)
- property aux_data_len
- get_multicast_address(self: mtf.libs.mtf_pybinder.pcpp.igmpv3_group_record) mtf.libs.mtf_pybinder.pcpp.IPv4Address
The multicast address in igmpv3_group_record#multicastAddress as IPv4Address instance
- Returns:
pcpp.IPv4Address
- get_record_len(self: mtf.libs.mtf_pybinder.pcpp.igmpv3_group_record) int
The total size in bytes of the group record
- Returns:
unsigned int
- get_source_address_at_index(self: mtf.libs.mtf_pybinder.pcpp.igmpv3_group_record, index: int) mtf.libs.mtf_pybinder.pcpp.IPv4Address
Get the source address at a certain index
- Args:
index (int): The index of the source address in the group record
- Returns:
pcpp.IPv4Address: The source address in the requested index. If index is negative or higher than the number of source addresses in this
group record the value if IPv4Address#Zero is returned
- get_source_address_count(self: mtf.libs.mtf_pybinder.pcpp.igmpv3_group_record) int
The number of source addresses in this group record
- Returns:
unsigned int
- property multicast_address
- property num_of_sources
- property record_type
- class mtf.libs.mtf_pybinder.pcpp.igmpv3_query_header
IGMPv3 membership query basic header
- __init__(self: mtf.libs.mtf_pybinder.pcpp.igmpv3_query_header) None
- __new__(**kwargs)
- property checksum
- property group_address
- property max_response_time
- property num_of_sources
- property qqic
- property s_qrv
- property type
- class mtf.libs.mtf_pybinder.pcpp.igmpv3_report_header
IGMPv3 membership report basic header
- __init__(self: mtf.libs.mtf_pybinder.pcpp.igmpv3_report_header) None
- __new__(**kwargs)
- property checksum
- property num_of_group_records
- property reserved1
- property reserved2
- property type
- class mtf.libs.mtf_pybinder.pcpp.iphdr
- __init__(self: mtf.libs.mtf_pybinder.pcpp.iphdr) None
- __new__(**kwargs)
- property fragment_offset
- property header_checksum
- property internet_header_length
- property ip_dst
- property ip_id
- property ip_src
- property ip_version
- property protocol
- property time_to_live
- property total_length
- property type_of_service
- class mtf.libs.mtf_pybinder.pcpp.macsec_header
- __init__(self: mtf.libs.mtf_pybinder.pcpp.macsec_header) None
- __new__(**kwargs)
- property ethertype
- property packet_nbr
- property port
- property short_length
- property tci
- class mtf.libs.mtf_pybinder.pcpp.mka_header
- __init__(self: mtf.libs.mtf_pybinder.pcpp.mka_header) None
- __new__(**kwargs)
- property length
- property type
- property version
- class mtf.libs.mtf_pybinder.pcpp.ppp_pptp_header
- __init__(self: mtf.libs.mtf_pybinder.pcpp.ppp_pptp_header) None
- __new__(**kwargs)
- property address
- property control
- property protocol
- class mtf.libs.mtf_pybinder.pcpp.pppoe_header
- __init__(self: mtf.libs.mtf_pybinder.pcpp.pppoe_header) None
- __new__(**kwargs)
- property code
- property payload_length
- property session_id
- property type
- property version
- class mtf.libs.mtf_pybinder.pcpp.radius_header
- __init__(self: mtf.libs.mtf_pybinder.pcpp.radius_header) None
- __new__(**kwargs)
- property code
- property id
- property length
- class mtf.libs.mtf_pybinder.pcpp.segmented_bap_information
- __init__(self: mtf.libs.mtf_pybinder.pcpp.segmented_bap_information) None
- __new__(**kwargs)
- property channel
- property frame_type
- is_segmented(self: mtf.libs.mtf_pybinder.pcpp.segmented_bap_information) bool
- Returns:
bool
- is_start_flag(self: mtf.libs.mtf_pybinder.pcpp.segmented_bap_information) bool
- Returns:
bool
- property length
- property start_flag
- class mtf.libs.mtf_pybinder.pcpp.sll2_header
- __init__(self: mtf.libs.mtf_pybinder.pcpp.sll2_header) None
- __new__(**kwargs)
- property arphrd_type
- property interface_index
- property link_layer_addr_len
- property packet_type
- property protocol_type
- property reserved
- class mtf.libs.mtf_pybinder.pcpp.sll_header
- __init__(self: mtf.libs.mtf_pybinder.pcpp.sll_header) None
- __new__(**kwargs)
- property arphrd_type
- property link_layer_addr_len
- property packet_type
- property protocol_type
- class mtf.libs.mtf_pybinder.pcpp.software_version
- __init__(self: mtf.libs.mtf_pybinder.pcpp.software_version) None
- __new__(**kwargs)
- property version_1
First part of the version
- property version_2
Second part of the version
- property version_3
Third part of the version
- class mtf.libs.mtf_pybinder.pcpp.tcphdr
- __init__(self: mtf.libs.mtf_pybinder.pcpp.tcphdr) None
- __new__(**kwargs)
- property ack_number
- property header_checksum
- property port_dst
- property port_src
- property sequence_number
- property urgent_pointer
- property window_size
- class mtf.libs.mtf_pybinder.pcpp.te_vendor_data
- __init__(self: mtf.libs.mtf_pybinder.pcpp.te_vendor_data) None
- __new__(**kwargs)
- property buffer_fill_level
- property buffer_overflow
- property buffer_size
- property hardware_ver
- property lifecycle
- property reserved
- property software_ver
- property temperature_chassis
- property temperature_silicon
- property voltage
- class mtf.libs.mtf_pybinder.pcpp.tecmp_can_replay_fill_level
- __init__(self: mtf.libs.mtf_pybinder.pcpp.tecmp_can_replay_fill_level) None
- __new__(**kwargs)
- property buffer_overflow
buffer overflow
- property fill_level
fill level
- property queue_data
get queue data
- Returns:
bytes
- property queue_size
queue size
- class mtf.libs.mtf_pybinder.pcpp.tecmp_flexray_poc_state
- __init__(self: mtf.libs.mtf_pybinder.pcpp.tecmp_flexray_poc_state) None
- __new__(**kwargs)
- property interface_id
interface id
- property state
- class mtf.libs.mtf_pybinder.pcpp.tecmp_header
- __init__(self: mtf.libs.mtf_pybinder.pcpp.tecmp_header) None
- __new__(**kwargs)
- property counter
- property data_type
- property device_flags
- property device_id
- property message_type
- property reserved
- property version
- class mtf.libs.mtf_pybinder.pcpp.tecmp_header_10base_t1s
- __init__(self: mtf.libs.mtf_pybinder.pcpp.tecmp_header_10base_t1s) None
- __new__(**kwargs)
- property beacon_timestamp
- property hdr
- class mtf.libs.mtf_pybinder.pcpp.tecmp_header_analog
- __init__(self: mtf.libs.mtf_pybinder.pcpp.tecmp_header_analog) None
- __new__(**kwargs)
- property factor
Get factor for conversion
- get_analog_values(self: mtf.libs.mtf_pybinder.pcpp.tecmp_header_analog) list[int]
Get analog values as a vector
- property hdr
- is_overflow(self: mtf.libs.mtf_pybinder.pcpp.tecmp_header_analog) bool
Check if overflow occurred
- property sample_time_enum
Get sample time as enum
- property sample_time_int
Get sample time as uint8_t
- property threshold_exceeded
Check if threshold is exceeded
- property threshold_undershot
Check if threshold is undershot
- property unit_enum
Get unit as enum
- property unit_str
Get unit as string
- class mtf.libs.mtf_pybinder.pcpp.tecmp_header_can
- __init__(self: mtf.libs.mtf_pybinder.pcpp.tecmp_header_can) None
- __new__(**kwargs)
- property crc15
- property hdr
- property id_field
- property payload_data
- property payload_length
- class mtf.libs.mtf_pybinder.pcpp.tecmp_header_can_fd
- __init__(self: mtf.libs.mtf_pybinder.pcpp.tecmp_header_can_fd) None
- __new__(**kwargs)
- property crc17
- property hdr
- property id_field
- property payload_data
- property payload_length
- class mtf.libs.mtf_pybinder.pcpp.tecmp_header_control_message
- __init__(self: mtf.libs.mtf_pybinder.pcpp.tecmp_header_control_message) None
- __new__(**kwargs)
- property device_id
device id
- get_can_replay_fill_level(self: mtf.libs.mtf_pybinder.pcpp.tecmp_header_control_message) mtf.libs.mtf_pybinder.pcpp.tecmp_can_replay_fill_level
get can replay fill level
- Returns:
pcpp.tecmp_can_replay_fill_level
- get_flexray_poc_state(self: mtf.libs.mtf_pybinder.pcpp.tecmp_header_control_message) mtf.libs.mtf_pybinder.pcpp.tecmp_flexray_poc_state
get flexray poc state
- Returns:
pcpp.tecmp_flexray_poc_state
- property hdr
- property type
- class mtf.libs.mtf_pybinder.pcpp.tecmp_header_flexray
- __init__(self: mtf.libs.mtf_pybinder.pcpp.tecmp_header_flexray) None
- __new__(**kwargs)
- property cycle
- property frame_crc
- property frame_id
- property hdr
- property header_crc
- property payload_data
Get the payload data as a list of bytes
- property payload_length
- class mtf.libs.mtf_pybinder.pcpp.tecmp_header_lin
- __init__(self: mtf.libs.mtf_pybinder.pcpp.tecmp_header_lin) None
- __new__(**kwargs)
- property checksum
- property hdr
- property id
- property payload_data
- Returns:
bytes
- property payload_length
- class mtf.libs.mtf_pybinder.pcpp.tecmp_header_none
- __init__(self: mtf.libs.mtf_pybinder.pcpp.tecmp_header_none) None
- __new__(**kwargs)
- property device_id
- property device_type
- property device_version
- property hdr
- property reserved
- property serial_number
- property vendor_data_length
- property vendor_id
- class mtf.libs.mtf_pybinder.pcpp.tecmp_payload_header
- __init__(self: mtf.libs.mtf_pybinder.pcpp.tecmp_payload_header) None
- __new__(**kwargs)
- property data_flags
- property interface_id
- property length
- property timestamp_ns
- property timestamp_sync_reserved
- property timestamp_sync_status
- class mtf.libs.mtf_pybinder.pcpp.timespec
- __init__(self: mtf.libs.mtf_pybinder.pcpp.timespec, arg0: int, arg1: int) None
- __new__(**kwargs)
- property tv_nsec
- property tv_sec
- class mtf.libs.mtf_pybinder.pcpp.timeval
- __init__(self: mtf.libs.mtf_pybinder.pcpp.timeval, arg0: int, arg1: int) None
- __new__(**kwargs)
- property tv_sec
- property tv_usec
- class mtf.libs.mtf_pybinder.pcpp.user_data_config
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: mtf.libs.mtf_pybinder.pcpp.user_data_config) -> None
__init__(self: mtf.libs.mtf_pybinder.pcpp.user_data_config, name: str, desc: str, offset: int, length: int, mask: int, value: str) -> None
- __new__(**kwargs)
- property desc
- property length
- property mask
- property name
- property offset
- property value
- class mtf.libs.mtf_pybinder.pcpp.vendor_voltage
- __init__(self: mtf.libs.mtf_pybinder.pcpp.vendor_voltage) None
- __new__(**kwargs)
- property volt_1
First part of the voltage
- property volt_2
Second part of the voltage
- class mtf.libs.mtf_pybinder.pcpp.vrrp_header
VRRP generic header
- __init__(self: mtf.libs.mtf_pybinder.pcpp.vrrp_header) None
- __new__(**kwargs)
- property auth_type_adv_int
- property checksum
- property ip_addr_count
- property priority
- property type
- property version
- property vr_id
- class mtf.libs.mtf_pybinder.pcpp.vxlan_header
- __init__(self: mtf.libs.mtf_pybinder.pcpp.vxlan_header) None
- __new__(**kwargs)
- property dont_learn_flag
- property gbp_flag
- property group_policy_id
- property pad
- property policy_applied_flag
- property reserved11_12
- property reserved14_16
- property reserved2_4
- property reserved6_8
- property reserved9
- property vni
- property vni_present_flag