mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-05-28 15:34:33 +00:00
Show more debug messages
This commit is contained in:
parent
20064c05ff
commit
ad1c2214ef
@ -64,11 +64,13 @@ namespace NetworkARP
|
|||||||
|
|
||||||
ARP::ARP(NetworkEthernet::Ethernet *Ethernet) : NetworkEthernet::EthernetEvents(NetworkEthernet::TYPE_ARP)
|
ARP::ARP(NetworkEthernet::Ethernet *Ethernet) : NetworkEthernet::EthernetEvents(NetworkEthernet::TYPE_ARP)
|
||||||
{
|
{
|
||||||
|
debug("ARP interface %#lx created.", this);
|
||||||
this->Ethernet = Ethernet;
|
this->Ethernet = Ethernet;
|
||||||
}
|
}
|
||||||
|
|
||||||
ARP::~ARP()
|
ARP::~ARP()
|
||||||
{
|
{
|
||||||
|
debug("ARP interface %#lx destroyed.", this);
|
||||||
}
|
}
|
||||||
|
|
||||||
MediaAccessControl InvalidMAC;
|
MediaAccessControl InvalidMAC;
|
||||||
|
@ -7,10 +7,12 @@ namespace NetworkDNS
|
|||||||
{
|
{
|
||||||
DNS::DNS(NetworkUDP::Socket *Socket) : NetworkUDP::UDPEvents()
|
DNS::DNS(NetworkUDP::Socket *Socket) : NetworkUDP::UDPEvents()
|
||||||
{
|
{
|
||||||
|
debug("DNS interface %#lx created.", this);
|
||||||
this->UDPSocket = Socket;
|
this->UDPSocket = Socket;
|
||||||
}
|
}
|
||||||
|
|
||||||
DNS::~DNS()
|
DNS::~DNS()
|
||||||
{
|
{
|
||||||
|
debug("DNS interface %#lx destroyed.", this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,7 @@ namespace NetworkDHCP
|
|||||||
{
|
{
|
||||||
DHCP::DHCP(NetworkUDP::Socket *Socket, NetworkInterfaceManager::DeviceInterface *Interface)
|
DHCP::DHCP(NetworkUDP::Socket *Socket, NetworkInterfaceManager::DeviceInterface *Interface)
|
||||||
{
|
{
|
||||||
|
debug("DHCP interface %#lx created.", this);
|
||||||
this->UDPSocket = Socket;
|
this->UDPSocket = Socket;
|
||||||
this->Interface = Interface;
|
this->Interface = Interface;
|
||||||
Socket->LocalPort = b16(68);
|
Socket->LocalPort = b16(68);
|
||||||
@ -29,6 +30,7 @@ namespace NetworkDHCP
|
|||||||
|
|
||||||
DHCP::~DHCP()
|
DHCP::~DHCP()
|
||||||
{
|
{
|
||||||
|
debug("DHCP interface %#lx destroyed.", this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DHCP::CreatePacket(DHCPHeader *Packet, uint8_t MessageType, uint32_t RequestIP)
|
void DHCP::CreatePacket(DHCPHeader *Packet, uint8_t MessageType, uint32_t RequestIP)
|
||||||
|
@ -13,8 +13,15 @@ namespace NetworkEthernet
|
|||||||
|
|
||||||
Vector<EthernetEventHelperStruct> RegisteredEvents;
|
Vector<EthernetEventHelperStruct> RegisteredEvents;
|
||||||
|
|
||||||
Ethernet::Ethernet(NetworkInterfaceManager::DeviceInterface *Interface) : NetworkInterfaceManager::Events(Interface) { this->Interface = Interface; }
|
Ethernet::Ethernet(NetworkInterfaceManager::DeviceInterface *Interface) : NetworkInterfaceManager::Events(Interface)
|
||||||
Ethernet::~Ethernet() {}
|
{
|
||||||
|
debug("Ethernet interface %#lx created.", this);
|
||||||
|
this->Interface = Interface;
|
||||||
|
}
|
||||||
|
Ethernet::~Ethernet()
|
||||||
|
{
|
||||||
|
debug("Ethernet interface %#lx destroyed.", this);
|
||||||
|
}
|
||||||
|
|
||||||
void Ethernet::Send(MediaAccessControl MAC, FrameType Type, uint8_t *Data, uint64_t Length)
|
void Ethernet::Send(MediaAccessControl MAC, FrameType Type, uint8_t *Data, uint64_t Length)
|
||||||
{
|
{
|
||||||
|
@ -6,8 +6,16 @@
|
|||||||
|
|
||||||
namespace NetworkICMPv4
|
namespace NetworkICMPv4
|
||||||
{
|
{
|
||||||
ICMPv4::ICMPv4(NetworkInterfaceManager::DeviceInterface *Interface) { this->Interface = Interface; }
|
ICMPv4::ICMPv4(NetworkInterfaceManager::DeviceInterface *Interface)
|
||||||
ICMPv4::~ICMPv4() {}
|
{
|
||||||
|
debug("ICMPv4 interface %#lx created.", this);
|
||||||
|
this->Interface = Interface;
|
||||||
|
}
|
||||||
|
|
||||||
|
ICMPv4::~ICMPv4()
|
||||||
|
{
|
||||||
|
debug("ICMPv4 interface %#lx destroyed.", this);
|
||||||
|
}
|
||||||
|
|
||||||
void ICMPv4::Send(/* ???? */)
|
void ICMPv4::Send(/* ???? */)
|
||||||
{
|
{
|
||||||
|
@ -7,12 +7,14 @@ namespace NetworkIPv4
|
|||||||
{
|
{
|
||||||
IPv4::IPv4(NetworkARP::ARP *ARP, NetworkEthernet::Ethernet *Ethernet) : NetworkEthernet::EthernetEvents(NetworkEthernet::TYPE_IPV4)
|
IPv4::IPv4(NetworkARP::ARP *ARP, NetworkEthernet::Ethernet *Ethernet) : NetworkEthernet::EthernetEvents(NetworkEthernet::TYPE_IPV4)
|
||||||
{
|
{
|
||||||
|
debug("IPv4 interface %#lx created.", this);
|
||||||
this->ARP = ARP;
|
this->ARP = ARP;
|
||||||
this->Ethernet = Ethernet;
|
this->Ethernet = Ethernet;
|
||||||
}
|
}
|
||||||
|
|
||||||
IPv4::~IPv4()
|
IPv4::~IPv4()
|
||||||
{
|
{
|
||||||
|
debug("IPv4 interface %#lx destroyed.", this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void IPv4::Send(uint8_t *Data, uint64_t Length, uint8_t Protocol, InternetProtocol DestinationIP)
|
void IPv4::Send(uint8_t *Data, uint64_t Length, uint8_t Protocol, InternetProtocol DestinationIP)
|
||||||
|
@ -13,6 +13,8 @@
|
|||||||
#include "../DAPI.hpp"
|
#include "../DAPI.hpp"
|
||||||
#include "../Fex.hpp"
|
#include "../Fex.hpp"
|
||||||
|
|
||||||
|
/* FIXME: The functions MUST have little endian parameters and return values. */
|
||||||
|
|
||||||
namespace NetworkInterfaceManager
|
namespace NetworkInterfaceManager
|
||||||
{
|
{
|
||||||
Vector<Events *> RegisteredEvents;
|
Vector<Events *> RegisteredEvents;
|
||||||
@ -96,6 +98,7 @@ namespace NetworkInterfaceManager
|
|||||||
NetworkUDP::UDP *udp = new NetworkUDP::UDP(ipv4, DefaultDevice);
|
NetworkUDP::UDP *udp = new NetworkUDP::UDP(ipv4, DefaultDevice);
|
||||||
NetworkUDP::Socket *DHCP_Socket = udp->Connect(InternetProtocol() /* Default value is 255.255.255.255 */, 67);
|
NetworkUDP::Socket *DHCP_Socket = udp->Connect(InternetProtocol() /* Default value is 255.255.255.255 */, 67);
|
||||||
NetworkDHCP::DHCP *dhcp = new NetworkDHCP::DHCP(DHCP_Socket, DefaultDevice);
|
NetworkDHCP::DHCP *dhcp = new NetworkDHCP::DHCP(DHCP_Socket, DefaultDevice);
|
||||||
|
debug("eth: %p; arp: %p; ipv4: %p; udp: %p; dhcp: %p", eth, arp, ipv4, udp, dhcp);
|
||||||
udp->Bind(DHCP_Socket, dhcp);
|
udp->Bind(DHCP_Socket, dhcp);
|
||||||
dhcp->Request();
|
dhcp->Request();
|
||||||
|
|
||||||
@ -110,13 +113,6 @@ namespace NetworkInterfaceManager
|
|||||||
DbgWriteScreen("DNS: %s", dhcp->DomainNameSystem.v4.ToStringLittleEndian());
|
DbgWriteScreen("DNS: %s", dhcp->DomainNameSystem.v4.ToStringLittleEndian());
|
||||||
TaskManager->Sleep(200);
|
TaskManager->Sleep(200);
|
||||||
|
|
||||||
/*
|
|
||||||
I HAVE TO REWRITE THE ENTIRE NETWORK STACK BECAUSE IT'S A MESS. I HATE BYTE SWAPPING!!!!!
|
|
||||||
|
|
||||||
Rules to follow:
|
|
||||||
- The functions MUST have little endian parameters and return values.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* TODO: This is a quick workaround we need DNS resolver asap. IP is time-a-g.nist.gov; https://tf.nist.gov/tf-cgi/servers.cgi */
|
/* TODO: This is a quick workaround we need DNS resolver asap. IP is time-a-g.nist.gov; https://tf.nist.gov/tf-cgi/servers.cgi */
|
||||||
InternetProtocol ip = {.v4 = {.Address = {129, 6, 15, 28}},
|
InternetProtocol ip = {.v4 = {.Address = {129, 6, 15, 28}},
|
||||||
.v6 = {.Address = {}}};
|
.v6 = {.Address = {}}};
|
||||||
@ -158,8 +154,10 @@ namespace NetworkInterfaceManager
|
|||||||
|
|
||||||
void NetworkInterface::StartService()
|
void NetworkInterface::StartService()
|
||||||
{
|
{
|
||||||
|
CPU::Interrupts(CPU::Disable);
|
||||||
this->NetSvcThread = TaskManager->CreateThread(TaskManager->GetCurrentProcess(), (Tasking::IP)CallStartNetworkStackWrapper);
|
this->NetSvcThread = TaskManager->CreateThread(TaskManager->GetCurrentProcess(), (Tasking::IP)CallStartNetworkStackWrapper);
|
||||||
this->NetSvcThread->Rename("Network Service");
|
this->NetSvcThread->Rename("Network Service");
|
||||||
|
CPU::Interrupts(CPU::Enable);
|
||||||
}
|
}
|
||||||
|
|
||||||
void NetworkInterface::DrvSend(unsigned int DriverID, unsigned char *Data, unsigned short Size)
|
void NetworkInterface::DrvSend(unsigned int DriverID, unsigned char *Data, unsigned short Size)
|
||||||
|
@ -12,8 +12,16 @@ namespace NetworkNTP
|
|||||||
netdbg("Received UDP packet for NTP.");
|
netdbg("Received UDP packet for NTP.");
|
||||||
}
|
}
|
||||||
|
|
||||||
NTP::NTP(NetworkUDP::Socket *Socket) : NetworkUDP::UDPEvents() { this->UDPSocket = Socket; }
|
NTP::NTP(NetworkUDP::Socket *Socket) : NetworkUDP::UDPEvents()
|
||||||
NTP::~NTP() {}
|
{
|
||||||
|
debug("NTP interface %#lx created.", this);
|
||||||
|
this->UDPSocket = Socket;
|
||||||
|
}
|
||||||
|
|
||||||
|
NTP::~NTP()
|
||||||
|
{
|
||||||
|
debug("NTP interface %#lx destroyed.", this);
|
||||||
|
}
|
||||||
|
|
||||||
int NTP::ReadTime()
|
int NTP::ReadTime()
|
||||||
{
|
{
|
||||||
|
@ -20,11 +20,15 @@ namespace NetworkUDP
|
|||||||
|
|
||||||
UDP::UDP(NetworkIPv4::IPv4 *ipv4, NetworkInterfaceManager::DeviceInterface *Interface) : NetworkIPv4::IPv4Events(NetworkIPv4::PROTOCOL_UDP)
|
UDP::UDP(NetworkIPv4::IPv4 *ipv4, NetworkInterfaceManager::DeviceInterface *Interface) : NetworkIPv4::IPv4Events(NetworkIPv4::PROTOCOL_UDP)
|
||||||
{
|
{
|
||||||
|
debug("UDP interface %#lx created.", this);
|
||||||
this->ipv4 = ipv4;
|
this->ipv4 = ipv4;
|
||||||
this->Interface = Interface;
|
this->Interface = Interface;
|
||||||
}
|
}
|
||||||
|
|
||||||
UDP::~UDP() {}
|
UDP::~UDP()
|
||||||
|
{
|
||||||
|
debug("UDP interface %#lx destroyed.", this);
|
||||||
|
}
|
||||||
|
|
||||||
uint16_t UsablePort = 0x200;
|
uint16_t UsablePort = 0x200;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user