IENA Documentation¶
IENA Packet is an AIRBUS packet format that is used in FTI. The packet format is fully described in a technical document issued by Airbus Referemce:RP0701637
This module supports the creating and analysis of IENA-P, IENA-M, IENA-Q, IENA-N and IENA-D packet formats.
Examples and details are available below
IENA Objects¶
- class AcraNetwork.IENA.IENA¶
Class to
IENA.pack()andIENA.unpack()IENA payloads.IENA is an proprietary payload format developed by Airbus for use in FTI networks. It is usually transmitted in a UDP packet containing parameter data acquired from sensors and buses:
---2B--- ---2B-- -----------6B----------- -1B- -1B- ---2B--- ------0B to 65490B----- ---2B--- | KEY | SIZE | TIME SINCE START YR(US)| ST | N2 | SEQNUM | PARAMETERS | END | -------- ------- ------------------------ ---- ---- -------- ----------------------- --------
Create an IENA packet and return the packed buffer
>>> i = IENA() >>> i.key = 0xDC >>> i.sequence = 1 >>> i.endfield = 0xDEAD >>> i.keystatus = 0 >>> i.status = 0x0 >>> i.timeusec = int(10e6) >>> i.payload = struct.pack('H',0x5) >>> i.pack() b'\x00\xdc\x00\t\x00\x00\x00\x98\x96\x80\x00\x00\x00\x01\x05\x00\xde\xad'
Read in some data stored in a UDP packet in a pcap file
>>> import AcraNetwork.Pcap as pcap >>> p = pcap.Pcap("test/iena_test.pcap") >>> rec_payload = p[0].payload >>> i = IENA() >>> i.unpack(rec_payload[0x2a:]) # Offset into the pcap record True >>> print("{:#0X}".format(i.key)) 0X1A
- pack() bytes¶
Pack the IENA payload into a binary string
- Return type:
bytes
- unpack(buf: bytes) bool¶
Unpack a raw byte stream to an IENA object Accepts a buffer to unpack as the required argument
- Parameters:
buf (bytes) – The string buffer to unpack
- Return type:
- property key¶
The IENA Key. Identifies the IENA packet type
- property n2¶
Alias of the N2 Status.
- payload: bytes¶
Payload of the IENA packet
- property streamid¶
Alias of the IENA key.
IENA-M Objects¶
- class AcraNetwork.IENA.IENAM¶
Support for IENA-M packets. Message Parameters with delay field
This payload includes a defined parameter ID, a delay and a length field
All this is encapsulated inside an IENA packet as defined above:
---2B--- ---2B-- ---2B--- ------0B to 65490B---------- |PARAM | DELAY | LENGTH | Dataset with opt 1B pad | -------- ------- -------------------------------------
Unpack some received packet from the network
>>> from base64 import b64decode >>> data = b64decode('ANwADAAAAAAAAAAAAAIAAQACAAEAAN6t') >>> i = IENAM() >>> i.unpack(data) >>> for param in i: ... print(param.paramid) 1
- pack()¶
Pack the IENA-M payload into a binary string
- Return type:
bytes
- unpack(buf: bytes) None¶
Unpack a raw byte stream to an IENA-M object Accepts a buffer to unpack as the required argument
- Parameters:
buf (bytes) – The string buffer to unpack
- Return type:
- parameters: List[MParameter]¶
The list of all MParameters in thie IENA-M packet Each entry is of class
MParameter
MParameter Objects¶
IENA-Q Objects¶
- class AcraNetwork.IENA.IENAQ¶
Support for IENA-Q packets. Message Parameters without delay field
This payload includes a defined parameter ID and a length field
All this is encapsulated inside an IENA packet as defined above:
---2B--- ---2B--- ------0B to 65490B---------- |PARAM | LENGTH | Dataset with opt 1B pad | -------- ------- -----------------------------
Unpack some received packet from the network
>>> from base64 import b64decode >>> data = b64decode('ANwACwAAAAAAAAAAAAIAAgABAADerQ==') >>> i = IENAQ() >>> i.unpack(data) >>> for param in i: ... print(param.paramid) 2
- pack() bytes¶
Pack the IENA-Q payload into a binary string
- Return type:
bytes
- unpack(buf: bytes)¶
Unpack a raw byte stream to an IENA-Q object Accepts a buffer to unpack as the required argument
- Parameters:
buf (bytes) – The string buffer to unpack
- Return type:
- parameters¶
The list of all QParameters in thie IENA-Q packet Each entry is of class
QParameter
QParameter Objects¶
IENA-N Objects¶
- class AcraNetwork.IENA.IENAN¶
Support for IENA-N packets. Std parameters without delay field
This payload includes a defined parameter ID and payload
All this is encapsulated inside an IENA packet as defined above with this pattern repeated
The number of D-words are defined in the N2 field of the IENA header:
---2B--- ---2B-- ---2B--- ---2B---- ---2B--- ---2B--- |PARAM | D#N | D#N-1 | D#-1 | ... | D0 | -------- ------- ------------------------------------
Unpack some received packet from the network
>>> from base64 import b64decode >>> data = b64decode('ABoAGAAB0QYFQAAAAMX/////AAAAAAAAAAAAAAAAAAABFAAAARQBEAGALpMAAN6t') >>> i = IENAN() >>> i.unpack(data) >>> print(len(i.parameters)) 16 >>> print(i.parameters[0].paramid) 65535
- unpack(buf: bytes) None¶
Unpack a raw byte stream to an IENA-M object Accepts a buffer to unpack as the required argument
- Parameters:
buf (bytes) – The string buffer to unpack
- Return type:
- parameters: List[NParameter]¶
List of all N-type parameters. Each entry is of class
NParameter
NParameter Objects¶
IENA-D Objects¶
- class AcraNetwork.IENA.IENAD¶
Support for IENA-D packets. Std parameters with delay field
This payload includes a defined parameter ID, a delay and a length field
All this is encapsulated inside an IENA packet as defined above with this pattern repeated
The number of D-words are defined in the N2 field of the IENA header:
---2B--- ---2B-- ---2B--- ---2B---- ---2B--- ---2B--- |PARAM | DELAY | D#N | D#-1 | ... | D0 | -------- ------- ------------------------------------
Unpack some received packet from the network
>>> from base64 import b64decode >>> data = b64decode('ABoAGAAB0QYFQAAAAMX/////AAAAAAAAAAAAAAAAAAABFAAAARQBEAGALpMAAN6t') >>> i = IENAD() >>> i.unpack(data) >>> print(len(i.parameters)) 8
- unpack(buf: bytes)¶
Unpack a raw byte stream to an IENA-M object Accepts a buffer to unpack as the required argument
- Parameters:
buf (bytes) – The string buffer to unpack
- Return type:
- parameters: List[DParameter]¶
The list of all DParameters in thie IENA-D packet Each entry is of class
DParameter