From af8a516fc22865abd80d6e26f1541fa3d6bebfdc Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Thu, 9 May 2024 00:42:44 +0200 Subject: MHR-23: :boom:, refactors. - Move NewBoot to /Boot, thus making Kernel directory only containing the kernel. Signed-off-by: Amlal El Mahrouss --- Kernel/NetworkKit/IPCEP.hxx | 57 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 Kernel/NetworkKit/IPCEP.hxx (limited to 'Kernel/NetworkKit/IPCEP.hxx') diff --git a/Kernel/NetworkKit/IPCEP.hxx b/Kernel/NetworkKit/IPCEP.hxx new file mode 100644 index 00000000..5c34d47e --- /dev/null +++ b/Kernel/NetworkKit/IPCEP.hxx @@ -0,0 +1,57 @@ +/* ------------------------------------------- + + Copyright SoftwareLabs. + + File: IPCEP.hxx, Purpose: Common IPC protocol. + +------------------------------------------- */ + +#ifndef _INC_IPC_ENDPOINT_HXX_ +#define _INC_IPC_ENDPOINT_HXX_ + +#include +#include + +/// @brief Common IPC Endpoint Protocol (Common IPC for short). + +/// IA separator. +#define kRemoteSeparator "." + +/// Interchange address, consists of domain:namespace. +#define kRemoteInvalid "00.00.00.00:0000" +#define kRemoteBitWidth 96 /* 96-bit address space. */ + +#define kRemoteHeaderMagic 0xFEEDFACE + +namespace NewOS +{ + /// @brief 96-bit number to represent the domain and namespace + struct PACKED IPCEPAddress + { + UInt32 RemoteAddress; + UInt64 RemoteNamespace; + }; + + typedef struct IPCEPAddress IPCEPAddressType; + + enum + { + kIPCEPLittleEndian = 0, + kIPCEPBigEndian = 1 + }; + + /// @brief IPCEP connection header + typedef struct IPCEPConnectionHeader + { + UInt32 IpcHeader; // kRemoteHeaderMagic + UInt8 IpcEndianess; // 0 : LE, 1 : BE + SizeT IpcPacketSize; + IPCEPAddressType IpcFrom; + IPCEPAddressType IpcTo; + UInt32 IpcCRC32; + SizeT IpcDataSize; + Char IpcData[]; + } PACKED IPCEPConnectionHeader; +} // namespace NewOS + +#endif // _INC_IPC_ENDPOINT_HXX_ -- cgit v1.2.3