Skip to content

Commit

Permalink
Update incorrect EFCP header (rlite's is different from ETSI docs)
Browse files Browse the repository at this point in the history
  • Loading branch information
masonticehurst committed Jan 27, 2024
1 parent 8c18679 commit 9e08817
Showing 1 changed file with 45 additions and 23 deletions.
68 changes: 45 additions & 23 deletions eRINA_STM32F7/src/net/efcp.ads
Original file line number Diff line number Diff line change
Expand Up @@ -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;

0 comments on commit 9e08817

Please sign in to comment.