scapy.contrib.pnio module

class scapy.contrib.pnio.PNIORealTimeCyclicDefaultRawData

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.pnio.PNIORealTimeCyclicDefaultRawData'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (PNIORealTimeCyclicDefaultRawData).data>]
guess_payload_class(payload)

DEV: Guesses the next payload class from layer bonds. Can be overloaded to use a different mechanism.

Parameters:payload (str) – the layer’s payload
Returns:the payload class
class scapy.contrib.pnio.PNIORealTimeCyclicPDU

Bases: scapy.packet.Packet

PROFINET cyclic real-time

aliastypes = [<class 'scapy.contrib.pnio.PNIORealTimeCyclicPDU'>, <class 'scapy.packet.Packet'>]
static build_fixed_len_raw_type(length)
fields_desc = [<Field (PNIORealTimeCyclicPDU).data>, <Field (PNIORealTimeCyclicPDU).padding>, <Field (PNIORealTimeCyclicPDU).cycleCounter>, <Field (PNIORealTimeCyclicPDU).dataStatus>, <Field (PNIORealTimeCyclicPDU).transferStatus>]
static get_layout_from_config(ether_src, ether_dst, frame_id)
get_padding_length()
next_cls_cb(_lst, _p, _remain)
pre_dissect(s)

DEV: is called right before the current layer is dissected

class scapy.contrib.pnio.PNIORealTime_IOxS

Bases: scapy.packet.Packet

IOCS and IOPS packets for PROFINET Real-Time payload

aliastypes = [<class 'scapy.contrib.pnio.PNIORealTime_IOxS'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (PNIORealTime_IOxS).dataState>, <Field (PNIORealTime_IOxS).instance>, <Field (PNIORealTime_IOxS).reserved>, <Field (PNIORealTime_IOxS).extension>]
classmethod get_len()
guess_payload_class(p)

DEV: Guesses the next payload class from layer bonds. Can be overloaded to use a different mechanism.

Parameters:payload (str) – the layer’s payload
Returns:the payload class
classmethod is_extension_set(_pkt, _lst, p, _remain)
class scapy.contrib.pnio.PROFIsafe

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.pnio.PROFIsafe'>, <class 'scapy.packet.Packet'>]
static build_PROFIsafe_class(cls, data_length)
default_fields
direction
explicit
fields
fieldtype
get_data_length()

Must be overridden in a subclass to return the correct value

get_mandatory_fields_len()
static get_max_data_length()
guess_payload_class(p)

DEV: Guesses the next payload class from layer bonds. Can be overloaded to use a different mechanism.

Parameters:payload (str) – the layer’s payload
Returns:the payload class
name
original
overload_fields
overloaded_fields
packetfields
payload
post_transforms
raw_packet_cache
raw_packet_cache_fields
sent_time
sniffed_on
time
underlayer
wirelen
class scapy.contrib.pnio.PROFIsafeCRCSeed

Bases: scapy.packet.Packet

aliastypes = [<class 'scapy.contrib.pnio.PROFIsafeCRCSeed'>, <class 'scapy.packet.Packet'>]
default_fields
direction
explicit
fields
fieldtype
get_data_length()

Must be overridden in a subclass to return the correct value

get_mandatory_fields_len()
static get_max_data_length()
guess_payload_class(p)

DEV: Guesses the next payload class from layer bonds. Can be overloaded to use a different mechanism.

Parameters:payload (str) – the layer’s payload
Returns:the payload class
name
original
overload_fields
overloaded_fields
packetfields
payload
post_transforms
raw_packet_cache
raw_packet_cache_fields
sent_time
sniffed_on
time
underlayer
wirelen
class scapy.contrib.pnio.PROFIsafeControl

Bases: scapy.contrib.pnio.PROFIsafe

aliastypes = [<class 'scapy.contrib.pnio.PROFIsafeControl'>, <class 'scapy.contrib.pnio.PROFIsafe'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (PROFIsafeControl).data>, <Field (PROFIsafeControl).control>, <Field (PROFIsafeControl).crc>]
class scapy.contrib.pnio.PROFIsafeControlCRCSeed

Bases: scapy.contrib.pnio.PROFIsafeCRCSeed

aliastypes = [<class 'scapy.contrib.pnio.PROFIsafeControlCRCSeed'>, <class 'scapy.contrib.pnio.PROFIsafeCRCSeed'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (PROFIsafeControlCRCSeed).data>, <Field (PROFIsafeControlCRCSeed).control>, <Field (PROFIsafeControlCRCSeed).crc>]
class scapy.contrib.pnio.PROFIsafeStatus

Bases: scapy.contrib.pnio.PROFIsafe

aliastypes = [<class 'scapy.contrib.pnio.PROFIsafeStatus'>, <class 'scapy.contrib.pnio.PROFIsafe'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (PROFIsafeStatus).data>, <Field (PROFIsafeStatus).status>, <Field (PROFIsafeStatus).crc>]
class scapy.contrib.pnio.PROFIsafeStatusCRCSeed

Bases: scapy.contrib.pnio.PROFIsafeCRCSeed

aliastypes = [<class 'scapy.contrib.pnio.PROFIsafeStatusCRCSeed'>, <class 'scapy.contrib.pnio.PROFIsafeCRCSeed'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (PROFIsafeStatusCRCSeed).data>, <Field (PROFIsafeStatusCRCSeed).status>, <Field (PROFIsafeStatusCRCSeed).crc>]
class scapy.contrib.pnio.ProfinetIO

Bases: scapy.packet.Packet

Basic PROFINET IO dispatcher

aliastypes = [<class 'scapy.contrib.pnio.ProfinetIO'>, <class 'scapy.packet.Packet'>]
fields_desc = [<Field (ProfinetIO).frameID>]
guess_payload_class(payload)

DEV: Guesses the next payload class from layer bonds. Can be overloaded to use a different mechanism.

Parameters:payload (str) – the layer’s payload
Returns:the payload class
scapy.contrib.pnio.i2s_frameid(x)

Get representation name of a pnio frame ID

Parameters:x – a key of the PNIO_FRAME_IDS dictionary
Returns:str
scapy.contrib.pnio.s2i_frameid(x)

Get pnio frame ID from a representation name

Performs a reverse look-up in PNIO_FRAME_IDS dictionary

Parameters:x – a value of PNIO_FRAME_IDS dict
Returns:integer