From 649c81a714e120a300439ca5d3fdd5e7f6f6b34d Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 2 Apr 2019 19:54:38 +0200 Subject: [PATCH] Kernel: Move networking related files into Kernel/Net/. --- Kernel/Makefile | 12 +++++------ Kernel/{ => Net}/ARP.h | 6 +++--- Kernel/{ => Net}/E1000NetworkAdapter.cpp | 2 +- Kernel/{ => Net}/E1000NetworkAdapter.h | 2 +- Kernel/{ => Net}/EtherType.h | 0 Kernel/{ => Net}/EthernetFrameHeader.h | 2 +- Kernel/{ => Net}/ICMP.h | 4 ++-- Kernel/{ => Net}/IPv4.h | 0 Kernel/{ => Net}/IPv4Socket.cpp | 18 ++++++++-------- Kernel/{ => Net}/IPv4Socket.h | 2 +- Kernel/Net/LoopbackAdapter.h | 2 +- Kernel/{ => Net}/MACAddress.h | 0 Kernel/{ => Net}/NetworkAdapter.cpp | 6 +++--- Kernel/{ => Net}/NetworkAdapter.h | 8 +++---- Kernel/{ => Net}/NetworkTask.cpp | 27 ++++++++++++------------ Kernel/{ => Net}/NetworkTask.h | 0 Kernel/Net/Routing.h | 2 +- Kernel/{ => Net}/TCP.h | 2 +- Kernel/{ => Net}/TCPSocket.cpp | 8 +++---- Kernel/{ => Net}/TCPSocket.h | 2 +- Kernel/{ => Net}/UDP.h | 2 +- Kernel/{ => Net}/UDPSocket.cpp | 6 +++--- Kernel/{ => Net}/UDPSocket.h | 2 +- Kernel/Process.cpp | 3 --- Kernel/Socket.cpp | 2 +- Kernel/init.cpp | 4 ++-- 26 files changed, 61 insertions(+), 63 deletions(-) rename Kernel/{ => Net}/ARP.h (95%) rename Kernel/{ => Net}/E1000NetworkAdapter.cpp (99%) rename Kernel/{ => Net}/E1000NetworkAdapter.h (98%) rename Kernel/{ => Net}/EtherType.h (100%) rename Kernel/{ => Net}/EthernetFrameHeader.h (96%) rename Kernel/{ => Net}/ICMP.h (93%) rename Kernel/{ => Net}/IPv4.h (100%) rename Kernel/{ => Net}/IPv4Socket.cpp (95%) rename Kernel/{ => Net}/IPv4Socket.h (99%) rename Kernel/{ => Net}/MACAddress.h (100%) rename Kernel/{ => Net}/NetworkAdapter.cpp (96%) rename Kernel/{ => Net}/NetworkAdapter.h (92%) rename Kernel/{ => Net}/NetworkTask.cpp (97%) rename Kernel/{ => Net}/NetworkTask.h (100%) rename Kernel/{ => Net}/TCP.h (98%) rename Kernel/{ => Net}/TCPSocket.cpp (98%) rename Kernel/{ => Net}/TCPSocket.h (98%) rename Kernel/{ => Net}/UDP.h (96%) rename Kernel/{ => Net}/UDPSocket.cpp (97%) rename Kernel/{ => Net}/UDPSocket.h (97%) diff --git a/Kernel/Makefile b/Kernel/Makefile index 11cc3a41429..85ef1c7e553 100644 --- a/Kernel/Makefile +++ b/Kernel/Makefile @@ -34,14 +34,14 @@ KERNEL_OBJS = \ PS2MouseDevice.o \ Socket.o \ LocalSocket.o \ - IPv4Socket.o \ - TCPSocket.o \ - UDPSocket.o \ - NetworkAdapter.o \ - E1000NetworkAdapter.o \ + Net/IPv4Socket.o \ + Net/TCPSocket.o \ + Net/UDPSocket.o \ + Net/NetworkAdapter.o \ + Net/E1000NetworkAdapter.o \ Net/LoopbackAdapter.o \ Net/Routing.o \ - NetworkTask.o + Net/NetworkTask.o VFS_OBJS = \ DiskDevice.o \ diff --git a/Kernel/ARP.h b/Kernel/Net/ARP.h similarity index 95% rename from Kernel/ARP.h rename to Kernel/Net/ARP.h index 934995d4408..ddfcd54f63d 100644 --- a/Kernel/ARP.h +++ b/Kernel/Net/ARP.h @@ -1,8 +1,8 @@ #pragma once -#include -#include -#include +#include +#include +#include struct ARPOperation { enum : word { diff --git a/Kernel/E1000NetworkAdapter.cpp b/Kernel/Net/E1000NetworkAdapter.cpp similarity index 99% rename from Kernel/E1000NetworkAdapter.cpp rename to Kernel/Net/E1000NetworkAdapter.cpp index 05e1c792537..b73ddc70e2e 100644 --- a/Kernel/E1000NetworkAdapter.cpp +++ b/Kernel/Net/E1000NetworkAdapter.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include diff --git a/Kernel/E1000NetworkAdapter.h b/Kernel/Net/E1000NetworkAdapter.h similarity index 98% rename from Kernel/E1000NetworkAdapter.h rename to Kernel/Net/E1000NetworkAdapter.h index 0bd47cda8b0..c0afa4cc26b 100644 --- a/Kernel/E1000NetworkAdapter.h +++ b/Kernel/Net/E1000NetworkAdapter.h @@ -1,6 +1,6 @@ #pragma once -#include +#include #include #include #include diff --git a/Kernel/EtherType.h b/Kernel/Net/EtherType.h similarity index 100% rename from Kernel/EtherType.h rename to Kernel/Net/EtherType.h diff --git a/Kernel/EthernetFrameHeader.h b/Kernel/Net/EthernetFrameHeader.h similarity index 96% rename from Kernel/EthernetFrameHeader.h rename to Kernel/Net/EthernetFrameHeader.h index af9713d30b7..2b549497d93 100644 --- a/Kernel/EthernetFrameHeader.h +++ b/Kernel/Net/EthernetFrameHeader.h @@ -1,6 +1,6 @@ #pragma once -#include +#include #include class [[gnu::packed]] EthernetFrameHeader { diff --git a/Kernel/ICMP.h b/Kernel/Net/ICMP.h similarity index 93% rename from Kernel/ICMP.h rename to Kernel/Net/ICMP.h index c8dc818195f..efc6cf4ca60 100644 --- a/Kernel/ICMP.h +++ b/Kernel/Net/ICMP.h @@ -1,7 +1,7 @@ #pragma once -#include -#include +#include +#include struct ICMPType { enum { diff --git a/Kernel/IPv4.h b/Kernel/Net/IPv4.h similarity index 100% rename from Kernel/IPv4.h rename to Kernel/Net/IPv4.h diff --git a/Kernel/IPv4Socket.cpp b/Kernel/Net/IPv4Socket.cpp similarity index 95% rename from Kernel/IPv4Socket.cpp rename to Kernel/Net/IPv4Socket.cpp index 3a327e1a4ed..7c7b1fdb4f7 100644 --- a/Kernel/IPv4Socket.cpp +++ b/Kernel/Net/IPv4Socket.cpp @@ -1,14 +1,14 @@ -#include -#include -#include +#include +#include +#include #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/Kernel/IPv4Socket.h b/Kernel/Net/IPv4Socket.h similarity index 99% rename from Kernel/IPv4Socket.h rename to Kernel/Net/IPv4Socket.h index d4729dd7f02..1cae3b17ed5 100644 --- a/Kernel/IPv4Socket.h +++ b/Kernel/Net/IPv4Socket.h @@ -2,7 +2,7 @@ #include #include -#include +#include #include #include #include diff --git a/Kernel/Net/LoopbackAdapter.h b/Kernel/Net/LoopbackAdapter.h index 56cf6c4283c..a852123733f 100644 --- a/Kernel/Net/LoopbackAdapter.h +++ b/Kernel/Net/LoopbackAdapter.h @@ -1,6 +1,6 @@ #pragma once -#include +#include class LoopbackAdapter final : public NetworkAdapter { public: diff --git a/Kernel/MACAddress.h b/Kernel/Net/MACAddress.h similarity index 100% rename from Kernel/MACAddress.h rename to Kernel/Net/MACAddress.h diff --git a/Kernel/NetworkAdapter.cpp b/Kernel/Net/NetworkAdapter.cpp similarity index 96% rename from Kernel/NetworkAdapter.cpp rename to Kernel/Net/NetworkAdapter.cpp index aa4d45b9b1a..a1e5e31c9d0 100644 --- a/Kernel/NetworkAdapter.cpp +++ b/Kernel/Net/NetworkAdapter.cpp @@ -1,8 +1,8 @@ -#include +#include +#include +#include #include -#include #include -#include #include #include diff --git a/Kernel/NetworkAdapter.h b/Kernel/Net/NetworkAdapter.h similarity index 92% rename from Kernel/NetworkAdapter.h rename to Kernel/Net/NetworkAdapter.h index a040aaced26..3a7d0755c71 100644 --- a/Kernel/NetworkAdapter.h +++ b/Kernel/Net/NetworkAdapter.h @@ -3,10 +3,10 @@ #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include class NetworkAdapter; diff --git a/Kernel/NetworkTask.cpp b/Kernel/Net/NetworkTask.cpp similarity index 97% rename from Kernel/NetworkTask.cpp rename to Kernel/Net/NetworkTask.cpp index 9132765dc35..fbd73671af3 100644 --- a/Kernel/NetworkTask.cpp +++ b/Kernel/Net/NetworkTask.cpp @@ -1,17 +1,18 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include +#include + //#define ETHERNET_DEBUG #define IPV4_DEBUG diff --git a/Kernel/NetworkTask.h b/Kernel/Net/NetworkTask.h similarity index 100% rename from Kernel/NetworkTask.h rename to Kernel/Net/NetworkTask.h diff --git a/Kernel/Net/Routing.h b/Kernel/Net/Routing.h index 85eb72a1161..48143520eb4 100644 --- a/Kernel/Net/Routing.h +++ b/Kernel/Net/Routing.h @@ -1,5 +1,5 @@ #pragma once -#include +#include NetworkAdapter* adapter_for_route_to(const IPv4Address&); diff --git a/Kernel/TCP.h b/Kernel/Net/TCP.h similarity index 98% rename from Kernel/TCP.h rename to Kernel/Net/TCP.h index 989f7b3739c..e2eac614496 100644 --- a/Kernel/TCP.h +++ b/Kernel/Net/TCP.h @@ -1,6 +1,6 @@ #pragma once -#include +#include struct TCPFlags { enum : word { diff --git a/Kernel/TCPSocket.cpp b/Kernel/Net/TCPSocket.cpp similarity index 98% rename from Kernel/TCPSocket.cpp rename to Kernel/Net/TCPSocket.cpp index dd856314e4a..af37186395f 100644 --- a/Kernel/TCPSocket.cpp +++ b/Kernel/Net/TCPSocket.cpp @@ -1,8 +1,8 @@ -#include -#include -#include -#include +#include +#include +#include #include +#include #include Lockable>& TCPSocket::sockets_by_port() diff --git a/Kernel/TCPSocket.h b/Kernel/Net/TCPSocket.h similarity index 98% rename from Kernel/TCPSocket.h rename to Kernel/Net/TCPSocket.h index 1d59a41e83a..5a1d88b2f73 100644 --- a/Kernel/TCPSocket.h +++ b/Kernel/Net/TCPSocket.h @@ -1,6 +1,6 @@ #pragma once -#include +#include class TCPSocket final : public IPv4Socket { public: diff --git a/Kernel/UDP.h b/Kernel/Net/UDP.h similarity index 96% rename from Kernel/UDP.h rename to Kernel/Net/UDP.h index c4da36b7a5e..ba6d02af376 100644 --- a/Kernel/UDP.h +++ b/Kernel/Net/UDP.h @@ -1,6 +1,6 @@ #pragma once -#include +#include class [[gnu::packed]] UDPPacket { public: diff --git a/Kernel/UDPSocket.cpp b/Kernel/Net/UDPSocket.cpp similarity index 97% rename from Kernel/UDPSocket.cpp rename to Kernel/Net/UDPSocket.cpp index c54d94a16fe..ff8c2baa82f 100644 --- a/Kernel/UDPSocket.cpp +++ b/Kernel/Net/UDPSocket.cpp @@ -1,6 +1,6 @@ -#include -#include -#include +#include +#include +#include #include #include #include diff --git a/Kernel/UDPSocket.h b/Kernel/Net/UDPSocket.h similarity index 97% rename from Kernel/UDPSocket.h rename to Kernel/Net/UDPSocket.h index 69c3a66a244..904243db34b 100644 --- a/Kernel/UDPSocket.h +++ b/Kernel/Net/UDPSocket.h @@ -1,6 +1,6 @@ #pragma once -#include +#include class UDPSocketHandle; diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp index e4445667bd2..e8781ab0478 100644 --- a/Kernel/Process.cpp +++ b/Kernel/Process.cpp @@ -22,9 +22,6 @@ #include "MasterPTY.h" #include "elf.h" #include -#include -#include -#include //#define DEBUG_IO //#define TASK_DEBUG diff --git a/Kernel/Socket.cpp b/Kernel/Socket.cpp index e6e26114b68..78adac287a0 100644 --- a/Kernel/Socket.cpp +++ b/Kernel/Socket.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include #include #include #include diff --git a/Kernel/init.cpp b/Kernel/init.cpp index d31ce1013a6..e896dce1dcc 100644 --- a/Kernel/init.cpp +++ b/Kernel/init.cpp @@ -23,8 +23,8 @@ #include "PTYMultiplexer.h" #include "DevPtsFS.h" #include "BXVGADevice.h" -#include "E1000NetworkAdapter.h" -#include +#include +#include #define SPAWN_LAUNCHER //#define SPAWN_GUITEST2