summaryrefslogtreecommitdiffhomepage
path: root/dev/ZKA/NetworkKit
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-08-28 08:00:52 +0200
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-08-28 08:00:52 +0200
commit3c233e380524d6842d396fd0a1fb9aeacf34d35f (patch)
tree30ea7f65f614c96e60cb514d8402c352cdc05879 /dev/ZKA/NetworkKit
parentcdaf8e9379f1756a9416f455ff5552fb8871c16d (diff)
[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 <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'dev/ZKA/NetworkKit')
-rw-r--r--dev/ZKA/NetworkKit/IPC.hxx23
1 files changed, 16 insertions, 7 deletions
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 <NewKit/Defines.hxx>
#include <NewKit/String.hxx>
-
+#include <HintKit/CompilerHint.hxx>
#include <CompressKit/RLE.hxx>
/// @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_