summaryrefslogtreecommitdiffhomepage
path: root/Kernel/NetworkKit
diff options
context:
space:
mode:
authorAmlal <amlalelmahrouss@icloud.com>2024-06-19 07:59:04 +0000
committerAmlal <amlalelmahrouss@icloud.com>2024-06-19 07:59:04 +0000
commitb820eb6a5a7948597d81998137b05ddc0eb0dbad (patch)
treedb4eaea0b6863076c4f1476f361e2317823a663a /Kernel/NetworkKit
parent36ff25861676cd1f5fb94b901fa59b015c614bc5 (diff)
parent6735570c44516661260546dadb81f0f5c238d1db (diff)
Merged in MHR-31 (pull request #16)
MHR-31: Round robin scheduler.
Diffstat (limited to 'Kernel/NetworkKit')
-rw-r--r--Kernel/NetworkKit/GSM.hxx2
-rw-r--r--Kernel/NetworkKit/IPCEP.hxx19
-rw-r--r--Kernel/NetworkKit/NetworkDevice.hpp23
3 files changed, 30 insertions, 14 deletions
diff --git a/Kernel/NetworkKit/GSM.hxx b/Kernel/NetworkKit/GSM.hxx
index 9a785344..f4b040b3 100644
--- a/Kernel/NetworkKit/GSM.hxx
+++ b/Kernel/NetworkKit/GSM.hxx
@@ -3,7 +3,7 @@
Copyright Zeta Electronics Corporation.
File: GSM.hxx.
- Purpose: GSM protocol.
+ Purpose: GSM protocol classes.
------------------------------------------- */
diff --git a/Kernel/NetworkKit/IPCEP.hxx b/Kernel/NetworkKit/IPCEP.hxx
index a00fa98e..6c7578b3 100644
--- a/Kernel/NetworkKit/IPCEP.hxx
+++ b/Kernel/NetworkKit/IPCEP.hxx
@@ -27,7 +27,7 @@
namespace NewOS
{
/// @brief 96-bit number to represent the domain and namespace
- struct PACKED IPCEPAddress
+ struct PACKED IPCEPAddress final
{
UInt32 RemoteAddress;
UInt64 RemoteNamespace;
@@ -41,17 +41,20 @@ namespace NewOS
eIPCEPBigEndian = 1
};
- /// @brief IPCEP connection header
+ /// @brief IPCEP connection header, must be the same on
+ /// user side as well.
+
typedef struct IPCEPConnectionHeader
{
- UInt32 IpcHeader; // cRemoteHeaderMagic
- UInt8 IpcEndianess; // 0 : LE, 1 : BE
- SizeT IpcPacketSize;
+ UInt32 IpcHeader; // cRemoteHeaderMagic
+ UInt8 IpcEndianess; // 0 : LE, 1 : BE
+ SizeT IpcPacketSize;
IPCEPAddressType IpcFrom;
IPCEPAddressType IpcTo;
- UInt32 IpcCRC32;
- UInt32 IpcMsg;
- UInt32 IpcMsgSz;
+ UInt32 IpcCRC32;
+ UInt32 IpcMsg;
+ UInt32 IpcMsgSz;
+ UInt8 IpcData[];
} PACKED IPCEPConnectionHeader;
} // namespace NewOS
diff --git a/Kernel/NetworkKit/NetworkDevice.hpp b/Kernel/NetworkKit/NetworkDevice.hpp
index 49b142d5..9b251c2e 100644
--- a/Kernel/NetworkKit/NetworkDevice.hpp
+++ b/Kernel/NetworkKit/NetworkDevice.hpp
@@ -4,12 +4,14 @@
------------------------------------------- */
-#ifndef __NETWORK_DEVICE__
-#define __NETWORK_DEVICE__
+#ifndef __INC_NETWORK_DEVICE_HPP__
+#define __INC_NETWORK_DEVICE_HPP__
#include <KernelKit/DeviceManager.hpp>
#include <NetworkKit/IP.hpp>
+/// @note Can either work with: Ethernet, GPRS, WiFi
+
namespace NewOS
{
struct NetworkDeviceCommand;
@@ -33,12 +35,17 @@ namespace NewOS
public:
const char* Name() const override;
+ Boolean Name(const char* strView);
private:
- void (*fCleanup)(void);
+ static constexpr auto cNetworkNameLen = 512;
+
+ Void (*fCleanup)(void);
+ Char fNetworkName[cNetworkNameLen];
+
};
- struct PACKED NetworkDeviceCommand final
+ struct NetworkDeviceCommand final
{
UInt32 CommandName;
UInt32 CommandType;
@@ -58,8 +65,14 @@ namespace NewOS
/// @brief IPCEP device.
using IPCEPNetworkDevice = NetworkDevice;
+
+ /// @brief GRPS device.
+ using GPRSNetworkDevice = NetworkDevice;
+
+ /// @brief GSM device.
+ using GSMNetworkDevice = NetworkDevice;
} // namespace NewOS
#include <NetworkKit/NetworkDevice.inl>
-#endif // !__NETWORK_DEVICE__
+#endif // !__INC_NETWORK_DEVICE_HPP__