From 3c233e380524d6842d396fd0a1fb9aeacf34d35f Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Wed, 28 Aug 2024 08:00:52 +0200 Subject: [IMP] Add ipc_construct_packet function to IPC protocol implementation. [IMP] Update Endian enum to match the one from the IPC protocol. [IMP] MUST_PASS works in debug only now. Signed-off-by: Amlal El Mahrouss --- dev/ZKA/NetworkKit/IPC.hxx | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'dev/ZKA/NetworkKit') diff --git a/dev/ZKA/NetworkKit/IPC.hxx b/dev/ZKA/NetworkKit/IPC.hxx index eb62f433..069a2c66 100644 --- a/dev/ZKA/NetworkKit/IPC.hxx +++ b/dev/ZKA/NetworkKit/IPC.hxx @@ -12,22 +12,25 @@ #include #include - +#include #include /// @file IPC.hxx -/// @brief IPC protocol. +/// @brief IPC EP protocol. /// IA separator. -#define cRemoteSeparator "." +#define cIPCEPRemoteSeparator ":" /// Interchange address, consists of PID:TEAM. -#define cRemoteInvalid "00:00" +#define cIPCEPRemoteInvalid "00:00" -#define cRemoteHeaderMagic (0x4950434) +#define cIPCEPHeaderMagic (0x4950434) namespace Kernel { + struct IPC_ADDRESS_STRUCT; + struct IPC_MESSAGE_STRUCT; + /// @brief 128-bit IPC address. struct PACKED IPC_ADDRESS_STRUCT final { @@ -54,7 +57,8 @@ namespace Kernel enum { eIPCEPLittleEndian = 0, - eIPCEPBigEndian = 1 + eIPCEPBigEndian = 1, + eIPCEPMixedEndian = 2, }; constexpr auto cIPCEPMsgSize = 6094U; @@ -76,7 +80,12 @@ namespace Kernel /// @brief Sanitize packet function /// @retval true packet is correct. /// @retval false packet is incorrect and process has crashed. - Bool ipc_sanitize_packet(IPC_MESSAGE_STRUCT* pckt); + Bool ipc_sanitize_packet(_Input IPC_MESSAGE_STRUCT* pckt_in); + + /// @brief Construct packet function + /// @retval true packet is correct. + /// @retval false packet is incorrect and process has crashed. + Bool ipc_construct_packet(_Output IPC_MESSAGE_STRUCT** pckt_in); } // namespace Kernel #endif // _INC_IPC_ENDPOINT_HXX_ -- cgit v1.2.3