scapy.contrib.pnio

class scapy.contrib.pnio.PNIORealTimeCyclicDefaultRawData(_pkt, /, *, data=b'')[源代码]

基类:Packet

aliastypes
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|              DATA             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

              Fig. PNIORealTimeCyclicDefaultRawData               
PNIORealTimeCyclicDefaultRawData fields

data

StrField

b''

guess_payload_class(payload)[源代码]
class scapy.contrib.pnio.PNIORealTimeCyclicPDU(_pkt, /, *, data=[], padding=b'', cycleCounter=0, dataStatus=<Flag 53 (primary+validData+run+no_problem)>, transferStatus=0)[源代码]

基类:Packet

PROFINET cyclic real-time

aliastypes
static build_fixed_len_raw_type(length)[源代码]
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|              DATA             |            PADDING            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|          CYCLECOUNTER         |   DATASTATUS  | TRANSFERSTATUS|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                    Fig. PNIORealTimeCyclicPDU                    
PNIORealTimeCyclicPDU fields

data

PacketListField

[]

padding

StrFixedLenField

b''

cycleCounter

ShortField

0

dataStatus

FlagsField

<Flag 53 (primary+validData+run+no_problem)>

transferStatus

ByteField

0

static get_layout_from_config(ether_src, ether_dst, frame_id)[源代码]
get_padding_length()[源代码]
next_cls_cb(_lst, _p, _remain)[源代码]
pre_dissect(s)[源代码]
class scapy.contrib.pnio.PNIORealTime_IOxS(_pkt, /, *, dataState=1, instance=0, reserved=0, extension=0)[源代码]

基类:Packet

IOCS and IOPS packets for PROFINET Real-Time payload

aliastypes
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|D|INS|RESERVE|E|
+-+-+-+-+-+-+-+-+

                      Fig. PNIORealTime_IOxS                      
PNIORealTime_IOxS fields

dataState

BitEnumField

1

instance

BitEnumField

0

reserved

XBitField (4 bits)

0

extension

BitField (1 bit)

0

classmethod get_len()[源代码]
guess_payload_class(p)[源代码]
classmethod is_extension_set(_pkt, _lst, p, _remain)[源代码]
class scapy.contrib.pnio.PROFIsafe(_pkt, /)[源代码]

基类:Packet

aliastypes
static build_PROFIsafe_class(cls, data_length)[源代码]
comment: bytes | None
default_fields: Dict[str, Any]
direction: int | None
explicit
fields: Dict[str, Any]
fieldtype: Dict[str, AnyField]
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)[源代码]
name
original
overload_fields: Dict[Type[Packet], Dict[str, Any]]
overloaded_fields: Dict[str, Any]
packetfields: List[AnyField]
parent
payload: Packet
post_transforms
raw_packet_cache: bytes | None
raw_packet_cache_fields: Dict[str, Any] | None
sent_time: EDecimal | float | None
sniffed_on: _GlobInterfaceType | None
time: EDecimal | float
underlayer
wirelen: int | None
class scapy.contrib.pnio.PROFIsafeCRCSeed(_pkt, /)[源代码]

基类:Packet

aliastypes
comment: bytes | None
default_fields: Dict[str, Any]
direction: int | None
explicit
fields: Dict[str, Any]
fieldtype: Dict[str, AnyField]
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)[源代码]
name
original
overload_fields: Dict[Type[Packet], Dict[str, Any]]
overloaded_fields: Dict[str, Any]
packetfields: List[AnyField]
parent
payload: Packet
post_transforms
raw_packet_cache: bytes | None
raw_packet_cache_fields: Dict[str, Any] | None
sent_time: EDecimal | float | None
sniffed_on: _GlobInterfaceType | None
time: EDecimal | float
underlayer
wirelen: int | None
class scapy.contrib.pnio.PROFIsafeControl(_pkt, /, *, data=b'', control=<Flag 0 ()>, crc=0)[源代码]

基类:PROFIsafe

aliastypes
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|              DATA             |    CONTROL    |      CRC      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                      Fig. PROFIsafeControl                       
PROFIsafeControl fields

data

StrFixedLenField

b''

control

FlagsField

<Flag 0 ()>

crc

X3BytesField

0

class scapy.contrib.pnio.PROFIsafeControlCRCSeed(_pkt, /, *, data=b'', control=<Flag 0 ()>, crc=0)[源代码]

基类:PROFIsafeCRCSeed

aliastypes
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|              DATA             |    CONTROL    |      CRC      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                   Fig. PROFIsafeControlCRCSeed                   
PROFIsafeControlCRCSeed fields

data

StrFixedLenField

b''

control

FlagsField

<Flag 0 ()>

crc

XIntField

0

class scapy.contrib.pnio.PROFIsafeStatus(_pkt, /, *, data=b'', status=<Flag 0 ()>, crc=0)[源代码]

基类:PROFIsafe

aliastypes
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|              DATA             |     STATUS    |      CRC      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                       Fig. PROFIsafeStatus                       
PROFIsafeStatus fields

data

StrFixedLenField

b''

status

FlagsField

<Flag 0 ()>

crc

X3BytesField

0

class scapy.contrib.pnio.PROFIsafeStatusCRCSeed(_pkt, /, *, data=b'', status=<Flag 0 ()>, crc=0)[源代码]

基类:PROFIsafeCRCSeed

aliastypes
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|              DATA             |     STATUS    |      CRC      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                   Fig. PROFIsafeStatusCRCSeed                    
PROFIsafeStatusCRCSeed fields

data

StrFixedLenField

b''

status

FlagsField

<Flag 0 ()>

crc

XIntField

0

class scapy.contrib.pnio.ProfinetIO(_pkt, /, *, frameID=0)[源代码]

基类:Packet

Basic PROFINET IO dispatcher

aliastypes
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|            FRAMEID            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                         Fig. ProfinetIO                          
ProfinetIO fields

frameID

XShortEnumField

0

guess_payload_class(payload)[源代码]
scapy.contrib.pnio.i2s_frameid(x)[源代码]

Get representation name of a pnio frame ID

参数:

x -- a key of the PNIO_FRAME_IDS dictionary

返回:

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

参数:

x -- a value of PNIO_FRAME_IDS dict

返回:

integer