NeKernel dev
Loading...
Searching...
No Matches
IPC.h
Go to the documentation of this file.
1/* ========================================
3 Copyright (C) 2024-2025, Amlal El Mahrouss, licensed under the Apache 2.0 license..
5 File: IPC.h.
6 Purpose: IPC protocol.
8======================================== */
10#ifndef INC_IPC_H
11#define INC_IPC_H
12
13#include <NeKit/Config.h>
14#include <NeKit/KString.h>
15#include <hint/CompilerHint.h>
16
19
21#define kIPCRemoteSeparator ":"
22
24#define kIPCRemoteInvalid "00:00"
25
26#define kIPCHeaderMagic (0x4950434)
27
28namespace Kernel {
29struct IPC_ADDR;
30struct IPC_MSG;
31
33struct PACKED IPC_ADDR final {
36
38 // some operators.
40
41 BOOL operator==(const IPC_ADDR& addr);
43 BOOL operator!=(const IPC_ADDR& addr);
45};
46
47typedef struct IPC_ADDR IPC_ADDR;
48
49enum {
53};
54
55constexpr inline auto kIPCMsgSize = 6094U;
56
57enum {
61};
62
78
83
88} // namespace Kernel
89
90#endif // INC_IPC_H
#define _Output
Definition CompilerHint.h:15
#define _Input
Definition CompilerHint.h:14
BOOL operator!=(const Kernel::Types::PciDeviceKind &lhs, Kernel::UChar rhs)
Definition Database.h:37
BOOL operator==(const Kernel::Types::PciDeviceKind &lhs, Kernel::UChar rhs)
Definition Database.h:41
#define PACKED
#define ALIGN(X)
#define BOOL
UPS inline definitions.
Definition Device.h:12
@ kIPCLockFree
Definition IPC.h:59
@ kIPCLockUsed
Definition IPC.h:60
@ kIPCLockInvalid
Definition IPC.h:58
struct IPC_ADDR IPC_ADDR
Definition IPC.h:47
__SIZE_TYPE__ SizeT
Definition Config.h:60
constexpr auto kIPCMsgSize
Definition IPC.h:55
BOOL ipc_sanitize_packet(_Input IPC_MSG *pckt_in)
Sanitize packet function.
__UINT8_TYPE__ UInt8
Definition Config.h:55
__UINT32_TYPE__ UInt32
Definition Config.h:44
@ kIPCBigEndian
Definition IPC.h:51
@ kIPCMixedEndian
Definition IPC.h:52
@ kIPCLittleEndian
Definition IPC.h:50
BOOL ipc_construct_packet(_Output _Input IPC_MSG **pckt_in)
Construct packet function.
__UINT64_TYPE__ UInt64
Definition Config.h:48
bool Bool
Definition Config.h:50
128-bit IPC address.
Definition IPC.h:33
UInt64 UserProcessID
Definition IPC.h:34
UInt64 UserProcessTeam
Definition IPC.h:35
IPC connection header, message cannot be greater than 6K.
Definition IPC.h:64
static Bool Pass(IPC_MSG *self, IPC_MSG *target)
Passes the message to target, could be anything, HTTP packet, JSON or whatever.
Definition IPCMessage.cc:103
UInt8 IpcData[kIPCMsgSize]
Definition IPC.h:73
UInt32 IpcHeaderMagic
Definition IPC.h:65
UInt32 IpcCRC32
Definition IPC.h:70
IPC_ADDR IpcTo
Definition IPC.h:69
UInt8 IpcEndianess
Definition IPC.h:66
UInt32 IpcMsg
Definition IPC.h:71
SizeT IpcPacketSize
Definition IPC.h:67
IPC_ADDR IpcFrom
Definition IPC.h:68
UInt32 IpcMsgSz
Definition IPC.h:72
UInt32 IpcLock
Definition IPC.h:74