mirror of
https://github.com/SerenityOS/serenity
synced 2026-05-09 00:22:43 +02:00
Kernel/Net: Rename IPv4-specific files and structs
This commit is contained in:
@@ -273,7 +273,7 @@ set(KERNEL_SOURCES
|
||||
Net/Intel/E1000NetworkAdapter.cpp
|
||||
Net/Realtek/RTL8168NetworkAdapter.cpp
|
||||
Net/VirtIO/VirtIONetworkAdapter.cpp
|
||||
Net/IPv4Socket.cpp
|
||||
Net/IPv4/Socket.cpp
|
||||
Net/LocalSocket.cpp
|
||||
Net/LoopbackAdapter.cpp
|
||||
Net/NetworkAdapter.cpp
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#include <AK/JsonObjectSerializer.h>
|
||||
#include <Kernel/FileSystem/SysFS/Subsystems/Kernel/Network/ARP.h>
|
||||
#include <Kernel/Net/ARP.h>
|
||||
#include <Kernel/Net/IPv4/ARP.h>
|
||||
#include <Kernel/Net/Routing.h>
|
||||
#include <Kernel/Sections.h>
|
||||
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <AK/MACAddress.h>
|
||||
#include <Kernel/Net/IPv4.h>
|
||||
#include <Kernel/Net/IPv4/IPv4.h>
|
||||
|
||||
struct ICMPType {
|
||||
struct ICMPv4Type {
|
||||
enum {
|
||||
EchoReply = 0,
|
||||
EchoRequest = 8,
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include <AK/Endian.h>
|
||||
#include <AK/MACAddress.h>
|
||||
#include <Kernel/Net/EtherType.h>
|
||||
#include <Kernel/Net/IPv4.h>
|
||||
#include <Kernel/Net/IPv4/IPv4.h>
|
||||
|
||||
namespace Kernel {
|
||||
|
||||
@@ -11,10 +11,10 @@
|
||||
#include <Kernel/API/POSIX/errno.h>
|
||||
#include <Kernel/Debug.h>
|
||||
#include <Kernel/FileSystem/OpenFileDescription.h>
|
||||
#include <Kernel/Net/ARP.h>
|
||||
#include <Kernel/Net/ICMP.h>
|
||||
#include <Kernel/Net/IPv4.h>
|
||||
#include <Kernel/Net/IPv4Socket.h>
|
||||
#include <Kernel/Net/IPv4/ARP.h>
|
||||
#include <Kernel/Net/IPv4/IPv4.h>
|
||||
#include <Kernel/Net/IPv4/Socket.h>
|
||||
#include <Kernel/Net/NetworkAdapter.h>
|
||||
#include <Kernel/Net/NetworkingManagement.h>
|
||||
#include <Kernel/Net/Routing.h>
|
||||
@@ -12,8 +12,8 @@
|
||||
#include <Kernel/Library/DoubleBuffer.h>
|
||||
#include <Kernel/Library/KBuffer.h>
|
||||
#include <Kernel/Locking/MutexProtected.h>
|
||||
#include <Kernel/Net/IPv4.h>
|
||||
#include <Kernel/Net/IPv4SocketTuple.h>
|
||||
#include <Kernel/Net/IPv4/IPv4.h>
|
||||
#include <Kernel/Net/IPv4/SocketTuple.h>
|
||||
#include <Kernel/Net/Socket.h>
|
||||
|
||||
namespace Kernel {
|
||||
@@ -11,7 +11,7 @@
|
||||
#include <Kernel/Library/KBuffer.h>
|
||||
#include <Kernel/Library/KString.h>
|
||||
#include <Kernel/Locking/Mutex.h>
|
||||
#include <Kernel/Net/IPv4.h>
|
||||
#include <Kernel/Net/IPv4/IPv4.h>
|
||||
#include <Kernel/Net/Socket.h>
|
||||
|
||||
namespace Kernel {
|
||||
@@ -17,10 +17,10 @@
|
||||
#include <Kernel/Library/LockWeakPtr.h>
|
||||
#include <Kernel/Library/LockWeakable.h>
|
||||
#include <Kernel/Library/UserOrKernelBuffer.h>
|
||||
#include <Kernel/Net/ARP.h>
|
||||
#include <Kernel/Net/EthernetFrameHeader.h>
|
||||
#include <Kernel/Net/ICMP.h>
|
||||
#include <Kernel/Net/IPv4.h>
|
||||
#include <Kernel/Net/IPv4/ARP.h>
|
||||
#include <Kernel/Net/IPv4/IPv4.h>
|
||||
|
||||
namespace Kernel {
|
||||
|
||||
|
||||
@@ -7,12 +7,12 @@
|
||||
#include <Kernel/Debug.h>
|
||||
#include <Kernel/Locking/Mutex.h>
|
||||
#include <Kernel/Locking/MutexProtected.h>
|
||||
#include <Kernel/Net/ARP.h>
|
||||
#include <Kernel/Net/EtherType.h>
|
||||
#include <Kernel/Net/EthernetFrameHeader.h>
|
||||
#include <Kernel/Net/ICMP.h>
|
||||
#include <Kernel/Net/IPv4.h>
|
||||
#include <Kernel/Net/IPv4Socket.h>
|
||||
#include <Kernel/Net/IPv4/ARP.h>
|
||||
#include <Kernel/Net/IPv4/IPv4.h>
|
||||
#include <Kernel/Net/IPv4/Socket.h>
|
||||
#include <Kernel/Net/LoopbackAdapter.h>
|
||||
#include <Kernel/Net/NetworkTask.h>
|
||||
#include <Kernel/Net/NetworkingManagement.h>
|
||||
@@ -242,7 +242,7 @@ void handle_icmp(EthernetFrameHeader const& eth, IPv4Packet const& ipv4_packet,
|
||||
if (!adapter)
|
||||
return;
|
||||
|
||||
if (icmp_header.type() == ICMPType::EchoRequest) {
|
||||
if (icmp_header.type() == ICMPv4Type::EchoRequest) {
|
||||
auto& request = reinterpret_cast<ICMPEchoPacket const&>(icmp_header);
|
||||
dbgln("handle_icmp: EchoRequest from {}: id={}, seq={}", ipv4_packet.source(), (u16)request.identifier, (u16)request.sequence_number);
|
||||
size_t icmp_packet_size = ipv4_packet.payload_size();
|
||||
@@ -259,7 +259,7 @@ void handle_icmp(EthernetFrameHeader const& eth, IPv4Packet const& ipv4_packet,
|
||||
adapter->fill_in_ipv4_header(*packet, adapter->ipv4_address(), eth.source(), ipv4_packet.source(), IPv4Protocol::ICMP, icmp_packet_size, 0, 64);
|
||||
memset(packet->buffer->data() + ipv4_payload_offset, 0, sizeof(ICMPEchoPacket));
|
||||
auto& response = *(ICMPEchoPacket*)(packet->buffer->data() + ipv4_payload_offset);
|
||||
response.header.set_type(ICMPType::EchoReply);
|
||||
response.header.set_type(ICMPv4Type::EchoReply);
|
||||
response.header.set_code(0);
|
||||
response.identifier = request.identifier;
|
||||
response.sequence_number = request.sequence_number;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include <Kernel/API/POSIX/errno.h>
|
||||
#include <Kernel/Debug.h>
|
||||
#include <Kernel/FileSystem/OpenFileDescription.h>
|
||||
#include <Kernel/Net/IPv4Socket.h>
|
||||
#include <Kernel/Net/IPv4/Socket.h>
|
||||
#include <Kernel/Net/LocalSocket.h>
|
||||
#include <Kernel/Net/NetworkingManagement.h>
|
||||
#include <Kernel/Net/Socket.h>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <Kernel/Net/IPv4.h>
|
||||
#include <Kernel/Net/IPv4/IPv4.h>
|
||||
|
||||
namespace Kernel {
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include <Kernel/FileSystem/OpenFileDescription.h>
|
||||
#include <Kernel/Locking/MutexProtected.h>
|
||||
#include <Kernel/Net/EthernetFrameHeader.h>
|
||||
#include <Kernel/Net/IPv4.h>
|
||||
#include <Kernel/Net/IPv4/IPv4.h>
|
||||
#include <Kernel/Net/NetworkAdapter.h>
|
||||
#include <Kernel/Net/NetworkingManagement.h>
|
||||
#include <Kernel/Net/Routing.h>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#include <AK/Time.h>
|
||||
#include <Kernel/Library/LockWeakPtr.h>
|
||||
#include <Kernel/Locking/MutexProtected.h>
|
||||
#include <Kernel/Net/IPv4Socket.h>
|
||||
#include <Kernel/Net/IPv4/Socket.h>
|
||||
#include <Kernel/Time/TimerQueue.h>
|
||||
|
||||
namespace Kernel {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <Kernel/Net/IPv4.h>
|
||||
#include <Kernel/Net/IPv4/IPv4.h>
|
||||
|
||||
namespace Kernel {
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
#include <AK/Error.h>
|
||||
#include <Kernel/Locking/MutexProtected.h>
|
||||
#include <Kernel/Net/IPv4Socket.h>
|
||||
#include <Kernel/Net/IPv4/Socket.h>
|
||||
|
||||
namespace Kernel {
|
||||
|
||||
|
||||
@@ -696,7 +696,7 @@ executable("Kernel_bin") {
|
||||
"Memory/SharedInodeVMObject.cpp",
|
||||
"Memory/VMObject.cpp",
|
||||
"Memory/VirtualRange.cpp",
|
||||
"Net/IPv4Socket.cpp",
|
||||
"Net/IPv4/Socket.cpp",
|
||||
"Net/Intel/E1000ENetworkAdapter.cpp",
|
||||
"Net/Intel/E1000NetworkAdapter.cpp",
|
||||
"Net/LocalSocket.cpp",
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include <AK/ByteBuffer.h>
|
||||
#include <AK/ByteString.h>
|
||||
#include <AK/ScopeGuard.h>
|
||||
#include <Kernel/Net/IPv4.h>
|
||||
#include <Kernel/Net/IPv4/IPv4.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <errno.h>
|
||||
#include <netdb.h>
|
||||
|
||||
Reference in New Issue
Block a user