scapy.contrib.pnio_rpc

PNIO RPC endpoints

class scapy.contrib.pnio_rpc.ARBlockReq

Bases: scapy.contrib.pnio_rpc.Block

Application relationship block request

aliastypes
fields_desc
ARBlockReq fields

block_type

ShortEnumField

257

block_length

ShortField

None

block_version_high

ByteField

1

block_version_low

ByteField

0

ARType

XShortEnumField

1

ARUUID

UUIDField

None

SessionKey

ShortField

0

CMInitiatorMacAdd

MACField

None

CMInitiatorObjectUUID

UUIDField

None

ARProperties_PullModuleAlarmAllowed

BitField (1 bit)

0

ARProperties_StartupMode

BitEnumField (1 bit)

0

ARProperties_reserved_3

BitField (6 bits)

0

ARProperties_reserved_2

BitField (12 bits)

0

ARProperties_AcknowledgeCompanionAR

BitField (1 bit)

0

ARProperties_CompanionAR

BitEnumField (2 bits)

0

ARProperties_DeviceAccess

BitEnumField (1 bit)

0

ARProperties_reserved_1

BitField (3 bits)

0

ARProperties_ParametrizationServer

BitEnumField (1 bit)

0

ARProperties_SupervisorTakeoverAllowed

BitField (1 bit)

0

ARProperties_State

BitEnumField (3 bits)

1

CMInitiatorActivityTimeoutFactor

ShortField

1000

CMInitiatorUDPRTPort

ShortField

34962

StationNameLength

FieldLenField

None

CMInitiatorStationName

StrLenField

b''

get_response()

Generate the response block of this request. Careful: it only sets the fields which can be set from the request

class scapy.contrib.pnio_rpc.ARBlockRes

Bases: scapy.contrib.pnio_rpc.Block

Application relationship block response

aliastypes
fields_desc
ARBlockRes fields

block_type

ShortEnumField

33025

block_length

ShortField

None

block_version_high

ByteField

1

block_version_low

ByteField

0

ARType

XShortEnumField

1

ARUUID

UUIDField

None

SessionKey

ShortField

0

CMResponderMacAdd

MACField

None

CMResponderUDPRTPort

ShortField

34962

class scapy.contrib.pnio_rpc.Block

Bases: scapy.packet.Packet

A generic block packet for PNIO RPC

aliastypes
extract_padding(s)
fields_desc
Block fields

block_type

ShortEnumField

0

block_length

ShortField

None

block_version_high

ByteField

1

block_version_low

ByteField

0

load

StrLenField

b''

payload_length()

A function for each block, to determine the length of the payload

post_build(p, pay)
class scapy.contrib.pnio_rpc.BlockHeader

Bases: scapy.packet.Packet

Abstract packet to centralize block headers fields

aliastypes
fields_desc
BlockHeader fields

block_type

ShortEnumField

None

block_length

ShortField

None

block_version_high

ByteField

1

block_version_low

ByteField

0

class scapy.contrib.pnio_rpc.ExpectedSubmodule

Bases: scapy.packet.Packet

Description of a submodule in an API of an expected submodule

aliastypes
extract_padding(s)
fields_desc
ExpectedSubmodule fields

SubslotNumber

XShortField

0

SubmoduleIdentNumber

XIntField

0

SubmoduleProperties_reserved_2

XByteField

0

SubmoduleProperties_reserved_1

BitField (2 bits)

0

SubmoduleProperties_DiscardIOXS

BitField (1 bit)

0

SubmoduleProperties_ReduceOutputSubmoduleDataLength

BitField (1 bit)

0

SubmoduleProperties_ReduceInputSubmoduleDataLength

BitField (1 bit)

0

SubmoduleProperties_SharedInput

BitField (1 bit)

0

SubmoduleProperties_Type

BitEnumField (2 bits)

0

DataDescription

PacketListField

[]

class scapy.contrib.pnio_rpc.ExpectedSubmoduleAPI

Bases: scapy.packet.Packet

Description of an API in the expected submodules blocks

aliastypes
extract_padding(s)
fields_desc
ExpectedSubmoduleAPI fields

API

XIntField

0

SlotNumber

XShortField

0

ModuleIdentNumber

XIntField

0

ModuleProperties

XShortField

0

NumberOfSubmodules

FieldLenField

None

Submodules

PacketListField

[]

class scapy.contrib.pnio_rpc.ExpectedSubmoduleBlockReq

Bases: scapy.contrib.pnio_rpc.Block

Expected submodule block request

aliastypes
fields_desc
ExpectedSubmoduleBlockReq fields

block_type

ShortEnumField

260

block_length

ShortField

None

block_version_high

ByteField

1

block_version_low

ByteField

0

NumberOfAPIs

FieldLenField

None

APIs

PacketListField

[]

get_response()

Generate the response block of this request. Careful: it only sets the fields which can be set from the request

class scapy.contrib.pnio_rpc.ExpectedSubmoduleDataDescription

Bases: scapy.packet.Packet

Description of the data of a submodule

aliastypes
extract_padding(s)
fields_desc
ExpectedSubmoduleDataDescription fields

DataDescription

XShortEnumField

0

SubmoduleDataLength

ShortField

0

LengthIOCS

ByteField

0

LengthIOPS

ByteField

0

class scapy.contrib.pnio_rpc.FParametersBlock

Bases: scapy.packet.Packet

F-Parameters configuration block

aliastypes
fields_desc
FParametersBlock fields

F_Prm_Flag1_Reserved_7

BitField (1 bit)

0

F_CRC_Seed

BitField (1 bit)

0

F_CRC_Length

BitEnumField (2 bits)

0

F_SIL

BitEnumField (2 bits)

2

F_Check_iPar

BitField (1 bit)

0

F_Check_SeqNr

BitField (1 bit)

0

F_Par_Version

BitEnumField (2 bits)

1

F_Block_ID

BitEnumField (3 bits)

0

F_Prm_Flag2_Reserved

BitField (2 bits)

0

F_Passivation

BitField (1 bit)

0

F_Source_Add

XShortField

0

F_Dest_Add

XShortField

0

F_WD_Time

ShortField

0

F_WD_Time_2

ShortField (Cond)

0

F_iPar_CRC

XIntField (Cond)

0

F_Par_CRC

XShortField

0

payload_guess

Possible sublayers: Padding

class scapy.contrib.pnio_rpc.IOCRAPI

Bases: scapy.packet.Packet

API description used in IOCR block

aliastypes
extract_padding(s)
fields_desc
IOCRAPI fields

API

XIntField

0

NumberOfIODataObjects

FieldLenField

None

IODataObjects

PacketListField

[]

NumberOfIOCS

FieldLenField

None

IOCSs

PacketListField

[]

class scapy.contrib.pnio_rpc.IOCRAPIObject

Bases: scapy.packet.Packet

API item descriptor used in API description of IOCR blocks

aliastypes
extract_padding(s)
fields_desc
IOCRAPIObject fields

SlotNumber

XShortField

0

SubslotNumber

XShortField

0

FrameOffset

ShortField

0

class scapy.contrib.pnio_rpc.IOCRBlockReq

Bases: scapy.contrib.pnio_rpc.Block

IO Connection Relationship block request

aliastypes
fields_desc
IOCRBlockReq fields

block_type

ShortEnumField

258

block_length

ShortField

None

block_version_high

ByteField

1

block_version_low

ByteField

0

IOCRType

XShortEnumField

1

IOCRReference

XShortField

1

LT

XShortField

34962

IOCRProperties_reserved3

BitField (8 bits)

0

IOCRProperties_reserved2

BitField (11 bits)

0

IOCRProperties_reserved1

BitField (9 bits)

0

IOCRProperties_RTClass

BitEnumField (4 bits)

0

DataLength

ShortField

40

FrameID

XShortField

32768

SendClockFactor

ShortField

32

ReductionRatio

ShortField

32

Phase

ShortField

1

Sequence

ShortField

0

FrameSendOffset

XIntField

4294967295

WatchdogFactor

ShortField

10

DataHoldFactor

ShortField

10

IOCRTagHeader_IOUserPriority

BitEnumField (3 bits)

6

IOCRTagHeader_reserved

BitField (1 bit)

0

IOCRTagHeader_IOCRVLANID

BitField (12 bits)

0

IOCRMulticastMACAdd

MACField

None

NumberOfAPIs

FieldLenField

None

APIs

PacketListField

[]

get_response()

Generate the response block of this request. Careful: it only sets the fields which can be set from the request

class scapy.contrib.pnio_rpc.IOCRBlockRes

Bases: scapy.contrib.pnio_rpc.Block

IO Connection Relationship block response

aliastypes
fields_desc
IOCRBlockRes fields

block_type

ShortEnumField

33026

block_length

ShortField

None

block_version_high

ByteField

1

block_version_low

ByteField

0

IOCRType

XShortEnumField

1

IOCRReference

XShortField

1

FrameID

XShortField

32768

class scapy.contrib.pnio_rpc.IODControlReq

Bases: scapy.contrib.pnio_rpc.Block

IODControl request block

aliastypes
fields_desc
IODControlReq fields

block_type

ShortEnumField

None

block_length

ShortField

None

block_version_high

ByteField

1

block_version_low

ByteField

0

padding

StrFixedLenField

b''

ARUUID

UUIDField

None

SessionKey

ShortField

0

AlarmSequenceNumber

XShortField

0

ControlCommand_reserved

BitField (9 bits)

0

ControlCommand_PrmBegin

BitField (1 bit)

0

ControlCommand_ReadyForRT_CLASS_3

BitField (1 bit)

0

ControlCommand_ReadyForCompanion

BitField (1 bit)

0

ControlCommand_Done

BitField (1 bit)

0

ControlCommand_Release

BitField (1 bit)

0

ControlCommand_ApplicationReady

BitField (1 bit)

0

ControlCommand_PrmEnd

BitField (1 bit)

0

ControlBlockProperties

XShortField

0

get_response()

Generate the response block of this request. Careful: it only sets the fields which can be set from the request

post_build(p, pay)
class scapy.contrib.pnio_rpc.IODControlRes

Bases: scapy.contrib.pnio_rpc.Block

IODControl response block

aliastypes
fields_desc
IODControlRes fields

block_type

ShortEnumField

33040

block_length

ShortField

None

block_version_high

ByteField

1

block_version_low

ByteField

0

padding

StrFixedLenField

b''

ARUUID

UUIDField

None

SessionKey

ShortField

0

AlarmSequenceNumber

XShortField

0

ControlCommand_reserved

BitField (9 bits)

0

ControlCommand_PrmBegin

BitField (1 bit)

0

ControlCommand_ReadyForRT_CLASS_3

BitField (1 bit)

0

ControlCommand_ReadyForCompanion

BitField (1 bit)

0

ControlCommand_Done

BitField (1 bit)

1

ControlCommand_Release

BitField (1 bit)

0

ControlCommand_ApplicationReady

BitField (1 bit)

0

ControlCommand_PrmEnd

BitField (1 bit)

0

ControlBlockProperties

XShortField

0

class scapy.contrib.pnio_rpc.IODWriteMultipleReq

Bases: scapy.contrib.pnio_rpc.Block

IODWriteMultiple request

aliastypes
fields_desc
IODWriteMultipleReq fields

block_type

ShortEnumField

8

block_length

ShortField

None

block_version_high

ByteField

1

block_version_low

ByteField

0

seqNum

ShortField

0

ARUUID

UUIDField

None

API

XIntField

4294967295

slotNumber

XShortField

65535

subslotNumber

XShortField

65535

padding

StrFixedLenField

b''

index

XShortEnumField

57408

recordDataLength

FieldLenField

None

RWPadding

StrFixedLenField

b''

blocks

FieldListField

[]

get_response()

Generate the response block of this request. Careful: it only sets the fields which can be set from the request

post_build(p, pay)
class scapy.contrib.pnio_rpc.IODWriteMultipleRes

Bases: scapy.contrib.pnio_rpc.Block

IODWriteMultiple response

aliastypes
fields_desc
IODWriteMultipleRes fields

block_type

ShortEnumField

32776

block_length

ShortField

None

block_version_high

ByteField

1

block_version_low

ByteField

0

seqNum

ShortField

0

ARUUID

UUIDField

None

API

XIntField

4294967295

slotNumber

XShortField

65535

subslotNumber

XShortField

65535

padding

StrFixedLenField

b''

index

XShortEnumField

57408

recordDataLength

FieldLenField

None

additionalValue1

XShortField

0

additionalValue2

XShortField

0

status

IntEnumField

0

RWPadding

StrFixedLenField

b''

blocks

FieldListField

[]

post_build(p, pay)
class scapy.contrib.pnio_rpc.IODWriteReq

Bases: scapy.contrib.pnio_rpc.Block

IODWrite request block

aliastypes
fields_desc
IODWriteReq fields

block_type

ShortEnumField

8

block_length

ShortField

None

block_version_high

ByteField

1

block_version_low

ByteField

0

seqNum

ShortField

0

ARUUID

UUIDField

None

API

XIntField

0

slotNumber

XShortField

0

subslotNumber

XShortField

0

padding

StrFixedLenField

b''

index

XShortEnumField

0

recordDataLength

LenField

None

RWPadding

StrFixedLenField

b''

get_response()

Generate the response block of this request. Careful: it only sets the fields which can be set from the request

payload_guess

Possible sublayers: FParametersBlock

payload_length()
class scapy.contrib.pnio_rpc.IODWriteRes

Bases: scapy.contrib.pnio_rpc.Block

IODWrite response block

aliastypes
fields_desc
IODWriteRes fields

block_type

ShortEnumField

32776

block_length

ShortField

None

block_version_high

ByteField

1

block_version_low

ByteField

0

seqNum

ShortField

0

ARUUID

UUIDField

None

API

XIntField

0

slotNumber

XShortField

0

subslotNumber

XShortField

0

padding

StrFixedLenField

b''

index

XShortEnumField

0

recordDataLength

LenField

None

additionalValue1

XShortField

0

additionalValue2

XShortField

0

status

IntEnumField

0

RWPadding

StrFixedLenField

b''

class scapy.contrib.pnio_rpc.NDRData

Bases: scapy.packet.Packet

Base NDRData to centralize some fields. It can’t be instantiated

aliastypes
fields_desc
NDRData fields

args_length

EndiannessField

None

max_count

EndiannessField

None

offset

EndiannessField

0

actual_count

EndiannessField

None

blocks

PacketListField

[]

class scapy.contrib.pnio_rpc.PNIOServiceReqPDU

Bases: scapy.packet.Packet

PNIO PDU for RPC Request

aliastypes
classmethod can_handle(pkt, rpc)

heuristic guess_payload_class

fields_desc
PNIOServiceReqPDU fields

args_max

EndiannessField

None

args_length

EndiannessField

None

max_count

EndiannessField

None

offset

EndiannessField

0

actual_count

EndiannessField

None

blocks

PacketListField

[]

class scapy.contrib.pnio_rpc.PNIOServiceResPDU

Bases: scapy.packet.Packet

PNIO PDU for RPC Response

aliastypes
classmethod can_handle(pkt, rpc)

heuristic guess_payload_class

fields_desc
PNIOServiceResPDU fields

status

EndiannessField

0

args_length

EndiannessField

None

max_count

EndiannessField

None

offset

EndiannessField

0

actual_count

EndiannessField

None

blocks

PacketListField

[]

class scapy.contrib.pnio_rpc.PadFieldWithLen(fld, align, padwith=None)

Bases: scapy.fields.PadField

PadField which handles the i2len function to include padding

i2len(pkt, val)

get the length of the field, including the padding length

scapy.contrib.pnio_rpc.dce_rpc_endianess(pkt)

determine the symbol for the endianness of a the DCE/RPC