From 9e08817d0980778f812775d230ae8437e25067a4 Mon Sep 17 00:00:00 2001 From: Mason Ticehurst Date: Sat, 27 Jan 2024 00:20:03 -0500 Subject: [PATCH] Update incorrect EFCP header (rlite's is different from ETSI docs) --- eRINA_STM32F7/src/net/efcp.ads | 68 ++++++++++++++++++++++------------ 1 file changed, 45 insertions(+), 23 deletions(-) diff --git a/eRINA_STM32F7/src/net/efcp.ads b/eRINA_STM32F7/src/net/efcp.ads index fdbc7e0..a9fcf13 100644 --- a/eRINA_STM32F7/src/net/efcp.ads +++ b/eRINA_STM32F7/src/net/efcp.ads @@ -11,35 +11,57 @@ package EFCP is subtype Uint32 is Interfaces.Unsigned_32; subtype Uint64 is Interfaces.Unsigned_64; - -- EFCP header as defined by GR-NGP-009. + -- PCI header to be used for transfer PDUs. + -- The order of the fields is extremely important, because we only + -- accept struct layouts where the compiler does not insert any + -- padding. + -- + -- struct rina_pci { + -- uint8_t pdu_version; + -- uint8_t pdu_type; + -- uint16_t pdu_flags; + -- uint16_t pdu_csum; + -- uint16_t pdu_ttl; + -- rl_seq_t seqnum; + -- rl_addr_t dst_addr; + -- rl_addr_t src_addr; + -- rl_cepid_t dst_cep; + -- rl_cepid_t src_cep; + -- rl_pdulen_t pdu_len; + -- rl_qosid_t qos_id; + -- } __attribute__((__packed__)); + + -- EFCP header as defined by rLite PDUs type EFCP_Header is record - Version : Uint8; - Daddr : Uint16; -- This is the IPC process that hosts the endpoint (not an IP) - Saddr : Uint16; - Qosid : Uint32; - Dcepid : Uint32; -- Connection Endpoint Id field in EFCP PDUs - Scepid : Uint32; - Pdutype : Uint8; - Flags : Uint8; - Len : Uint32; - Seq : Uint32; + PDU_Version : Uint8; + PDU_Type : Uint8; + PDU_Flags : Uint16; + PDU_CSum : Uint16; + PDU_TTL : Uint16; + PDU_SeqNum : Uint32; + Dst_Addr : Uint32; + Src_Addr : Uint32; + Dst_Cep : Uint16; + Src_Cep : Uint16; + PDU_Len : Uint16; + QOS_Id : Uint16; end record; type EFCP_Header_Access is access all EFCP_Header; - -- Sizes consistent with - -- https://github.com/rlite/rlite/blob/6ac276b11a36832d58a9674f100a705614947d34/user/uipcps/uipcp-gpb/BaseRIB.proto#L19 for EFCP_Header use record - Version at 0 range 0 .. 7; - Daddr at 1 range 0 .. 15; - Saddr at 3 range 0 .. 15; - Qosid at 5 range 0 .. 39; - Dcepid at 10 range 0 .. 31; - Scepid at 14 range 0 .. 31; - Pdutype at 18 range 0 .. 7; - Flags at 19 range 0 .. 7; - Len at 20 range 0 .. 55; - Seq at 27 range 0 .. 47; + PDU_Version at 0 range 0 .. 7; + PDU_Type at 1 range 0 .. 7; + PDU_Flags at 2 range 0 .. 15; + PDU_CSum at 4 range 0 .. 15; + PDU_TTL at 6 range 0 .. 15; + PDU_SeqNum at 8 range 0 .. 31; + Dst_Addr at 12 range 0 .. 31; + Src_Addr at 16 range 0 .. 31; + Dst_Cep at 20 range 0 .. 15; + Src_Cep at 22 range 0 .. 15; + PDU_Len at 24 range 0 .. 15; + QOS_Id at 26 range 0 .. 15; end record; end EFCP; \ No newline at end of file