summaryrefslogtreecommitdiffhomepage
path: root/Kernel/NetworkKit
diff options
context:
space:
mode:
authorAmlal <amlalelmahrouss@icloud.com>2024-05-23 07:53:50 +0000
committerAmlal <amlalelmahrouss@icloud.com>2024-05-23 07:53:50 +0000
commitf5081a8f9a8537ad5be5d639955cd1d0e68a9e1d (patch)
treec9305701aa2d4ee0235c85c67cd6633e5763ec21 /Kernel/NetworkKit
parentca675beb41dba8d7d16c5793b55d1672f38be3b4 (diff)
parent06b1a4bb12b4043b606d8bb0d55942d636c6833e (diff)
Merged in MHR-23 (pull request #13)
MHR-23
Diffstat (limited to 'Kernel/NetworkKit')
-rw-r--r--Kernel/NetworkKit/IP.hpp10
-rw-r--r--Kernel/NetworkKit/IPCEP.hxx21
-rw-r--r--Kernel/NetworkKit/MAC.hxx2
-rw-r--r--Kernel/NetworkKit/NetworkDevice.hpp10
-rw-r--r--Kernel/NetworkKit/NetworkDevice.inl34
5 files changed, 41 insertions, 36 deletions
diff --git a/Kernel/NetworkKit/IP.hpp b/Kernel/NetworkKit/IP.hpp
index 94d0d3be..0598c1de 100644
--- a/Kernel/NetworkKit/IP.hpp
+++ b/Kernel/NetworkKit/IP.hpp
@@ -1,6 +1,6 @@
/* -------------------------------------------
- Copyright SoftwareLabs
+ Copyright SoftwareLabs
------------------------------------------- */
@@ -42,8 +42,8 @@ namespace NewOS
};
/**
- * @brief IPv6 address.
- */
+ * @brief IPv6 address.
+ */
class RawIPAddress6 final
{
private:
@@ -71,8 +71,8 @@ namespace NewOS
};
/**
- * @brief IP Creation helpers
- */
+ * @brief IP Creation helpers
+ */
class IPFactory final
{
public:
diff --git a/Kernel/NetworkKit/IPCEP.hxx b/Kernel/NetworkKit/IPCEP.hxx
index 5c34d47e..6b30ec04 100644
--- a/Kernel/NetworkKit/IPCEP.hxx
+++ b/Kernel/NetworkKit/IPCEP.hxx
@@ -1,8 +1,9 @@
/* -------------------------------------------
- Copyright SoftwareLabs.
+ Copyright SoftwareLabs.
- File: IPCEP.hxx, Purpose: Common IPC protocol.
+ File: IPCEP.hxx.
+ Purpose: IPC protocol.
------------------------------------------- */
@@ -12,16 +13,16 @@
#include <NewKit/Defines.hpp>
#include <NewKit/String.hpp>
-/// @brief Common IPC Endpoint Protocol (Common IPC for short).
+/// @brief IPC Endpoint Protocol (IPCEP for short).
/// IA separator.
-#define kRemoteSeparator "."
+#define cRemoteSeparator "."
/// Interchange address, consists of domain:namespace.
-#define kRemoteInvalid "00.00.00.00:0000"
-#define kRemoteBitWidth 96 /* 96-bit address space. */
+#define cRemoteInvalid "00.00.00.00:0000"
+#define cRemoteBitWidth (96) /* 96-bit address space. */
-#define kRemoteHeaderMagic 0xFEEDFACE
+#define cRemoteHeaderMagic (0x4950434550)
namespace NewOS
{
@@ -36,14 +37,14 @@ namespace NewOS
enum
{
- kIPCEPLittleEndian = 0,
- kIPCEPBigEndian = 1
+ eIPCEPLittleEndian = 0,
+ eIPCEPBigEndian = 1
};
/// @brief IPCEP connection header
typedef struct IPCEPConnectionHeader
{
- UInt32 IpcHeader; // kRemoteHeaderMagic
+ UInt32 IpcHeader; // cRemoteHeaderMagic
UInt8 IpcEndianess; // 0 : LE, 1 : BE
SizeT IpcPacketSize;
IPCEPAddressType IpcFrom;
diff --git a/Kernel/NetworkKit/MAC.hxx b/Kernel/NetworkKit/MAC.hxx
index 30a865ac..cc76022a 100644
--- a/Kernel/NetworkKit/MAC.hxx
+++ b/Kernel/NetworkKit/MAC.hxx
@@ -1,6 +1,6 @@
/* -------------------------------------------
- Copyright SoftwareLabs
+ Copyright SoftwareLabs
------------------------------------------- */
diff --git a/Kernel/NetworkKit/NetworkDevice.hpp b/Kernel/NetworkKit/NetworkDevice.hpp
index b00ce7a6..ecbc80b7 100644
--- a/Kernel/NetworkKit/NetworkDevice.hpp
+++ b/Kernel/NetworkKit/NetworkDevice.hpp
@@ -1,6 +1,6 @@
/* -------------------------------------------
- Copyright SoftwareLabs
+ Copyright SoftwareLabs
------------------------------------------- */
@@ -16,8 +16,8 @@ namespace NewOS
class NetworkDevice;
/**
-* \brief Network device interface, establishes a connection to the NIC.
-*/
+ * \brief Network device interface, establishes a connection to the NIC.
+ */
class NetworkDevice final : public DeviceInterface<NetworkDeviceCommand>
{
public:
@@ -56,8 +56,8 @@ namespace NewOS
/// @brief PPP device.
using PPPNetworkDevice = NetworkDevice;
- /// @brief HPC device.
- using HPCNetworkDevice = NetworkDevice;
+ /// @brief IPCEP device.
+ using IPCEPNetworkDevice = NetworkDevice;
} // namespace NewOS
#include <NetworkKit/NetworkDevice.inl>
diff --git a/Kernel/NetworkKit/NetworkDevice.inl b/Kernel/NetworkKit/NetworkDevice.inl
index 0b927d0e..614ccadf 100644
--- a/Kernel/NetworkKit/NetworkDevice.inl
+++ b/Kernel/NetworkKit/NetworkDevice.inl
@@ -1,27 +1,31 @@
/* -------------------------------------------
- Copyright SoftwareLabs
+ Copyright SoftwareLabs
------------------------------------------- */
/***
- Dtor and ctors.
+ Dtor and ctors.
*/
-namespace NewOS {
-NetworkDevice::NetworkDevice(void (*out)(NetworkDeviceCommand),
- void (*in)(NetworkDeviceCommand),
- void (*on_cleanup)(void))
- : DeviceInterface<NetworkDeviceCommand>(out, in), fCleanup(on_cleanup) {
- kcout << "NK: NetworkDevice initialize.\r";
+namespace NewOS
+{
+ NetworkDevice::NetworkDevice(void (*out)(NetworkDeviceCommand),
+ void (*in)(NetworkDeviceCommand),
+ void (*on_cleanup)(void))
+ : DeviceInterface<NetworkDeviceCommand>(out, in), fCleanup(on_cleanup)
+ {
+ kcout << "New OS: NetworkDevice initialized.\r";
- MUST_PASS(out && in && on_cleanup);
-}
+ MUST_PASS(out && in && on_cleanup);
+ }
-NetworkDevice::~NetworkDevice() {
- MUST_PASS(fCleanup);
+ NetworkDevice::~NetworkDevice()
+ {
+ MUST_PASS(fCleanup);
- kcout << "NK: NetworkDevice cleanup.\r";
- if (fCleanup) fCleanup();
-}
+ kcout << "New OS: NetworkDevice cleanup.\r";
+ if (fCleanup)
+ fCleanup();
+ }
} // namespace NewOS