diff --git a/Zenith-latest-2021-01-17-04_25_08.iso b/Zenith-latest-2021-01-17-15_19_25.iso similarity index 99% rename from Zenith-latest-2021-01-17-04_25_08.iso rename to Zenith-latest-2021-01-17-15_19_25.iso index 7c754007..033a12c4 100755 Binary files a/Zenith-latest-2021-01-17-04_25_08.iso and b/Zenith-latest-2021-01-17-15_19_25.iso differ diff --git a/src/Home/Net/DNS.CC b/src/Home/Net/DNS.CC index 465dd18d..1a98240f 100755 --- a/src/Home/Net/DNS.CC +++ b/src/Home/Net/DNS.CC @@ -16,9 +16,9 @@ #define DNS_CLASS_IN 1 -#define DNS_TIMEOUT 5000 +#define DNS_TIMEOUT 1000 -#define DNS_MAX_RETRIES 5 // Shrine has 3, why not 5? :^) +#define DNS_MAX_RETRIES 20 // Shrine has 3, why not 5? :^) class CDNSHash:CHash { // store U8 *hostname as CHash->str U8 * diff --git a/src/Home/Net/Tests/ARPSendTrash.CC b/src/Home/Net/Tests/ARPSendTrash.CC index afbdf322..233cc9cb 100755 --- a/src/Home/Net/Tests/ARPSendTrash.CC +++ b/src/Home/Net/Tests/ARPSendTrash.CC @@ -2,8 +2,8 @@ U8 dest_mac[6] = {0xF0, 0x0D, 0xBE, 0xAD, 0xDE, 0xAF}; U8 send_mac[6] = {0xDE, 0xAD, 0xBE, 0xEF, 0xC0, 0xDE}; U8 trgt_mac[6] = {0xB0, 0xDE, 0xCA, 0x5E, 0xD0, 0xD0}; -U32 send_ip = EndianU32(0xFEEDBABE); -U32 trgt_ip = EndianU32(0x01234567); +U32 send_ip = EndianU32(0x30313233); +U32 trgt_ip = EndianU32(0x01020304); U0 ARPSendTrash() { diff --git a/src/Home/Net/Tests/DNSSendTrash.CC b/src/Home/Net/Tests/DNSSendTrash.CC new file mode 100755 index 00000000..5ce21172 --- /dev/null +++ b/src/Home/Net/Tests/DNSSendTrash.CC @@ -0,0 +1,31 @@ +U8 dns_mac[6] = {0xF0, 0x0D, 0xBE, 0xAD, 0xDE, 0xAF}; + +U32 dns_ip = 0x51525354; + +U0 DNSSendTrash() +{ + + U8 **labels = CAlloc(4); + U8 **l = labels; + CDNSQuestion *q = CAlloc(sizeof(CDNSQuestion)); + + ARPCachePut(dns_ip, dns_mac); // Force entry into ARP Cache so IPV4 can match it with GetMACAddressForIP + DNSSetResolverIPV4(dns_ip); // Forcing so DNSSendQuestion succeeds + + q->q_name.labels = labels; + q->q_name.num_labels = 4; + + *(l++) = StrNew("test1"); + *(l++) = StrNew("test2"); + *(l++) = StrNew("test3"); + *(l++) = StrNew("test4"); + + while (TRUE) + { + + DNSSendQuestion(0xDEAD, 0xBEEF, q); + Sleep(300); + } +} + +DNSSendTrash; \ No newline at end of file diff --git a/src/Home/Net/Tests/HostTest.CC b/src/Home/Net/Tests/HostTest0.CC similarity index 100% rename from src/Home/Net/Tests/HostTest.CC rename to src/Home/Net/Tests/HostTest0.CC diff --git a/src/Home/Net/Tests/HostTest1.CC b/src/Home/Net/Tests/HostTest1.CC new file mode 100755 index 00000000..ecb84315 --- /dev/null +++ b/src/Home/Net/Tests/HostTest1.CC @@ -0,0 +1,17 @@ +U8 dns_mac[6] = {0xF0, 0x0D, 0xBE, 0xAD, 0xDE, 0xAF}; + +U32 dns_ip = 0x51525354; + + +U0 HostTest() +{ + ARPCachePut(dns_ip, dns_mac); // Force entry into ARP Cache so IPV4 can match it with GetMACAddressForIP + DNSSetResolverIPV4(dns_ip); // Forcing so DNSSendQuestion succeeds + + + "\n$BG,8$Type $FG,0$G2;$FG$ if it crashes$BG$\n\n"; + Host("zenithos.org"); + +} + +HostTest; \ No newline at end of file diff --git a/src/Home/Net/Tests/ICMPSendTrash.CC b/src/Home/Net/Tests/ICMPSendTrash.CC new file mode 100755 index 00000000..8b6e8b57 --- /dev/null +++ b/src/Home/Net/Tests/ICMPSendTrash.CC @@ -0,0 +1,22 @@ + +U8 dst_mac[6] = {0xF0, 0x0D, 0xBE, 0xAD, 0xDE, 0xAF}; + +U32 dst_ip = 0x01020304; + +U0 ICMPSendTrash() +{ + U8 *data_payload = CAlloc(8); + + *(data_payload(U64 *)) = EndianU64(0xDEADBEEFC0DEFADE); + + ARPCachePut(dst_ip, dst_mac); // Force entry into ARP Cache so IPV4 can match it with GetMACAddressForIP + + while (TRUE) + { + ICMPSendReply(dst_ip, EndianU16(0xDEAD), EndianU16(0xBEEF), EndianU16(0xC0DE), data_payload, 8); + Sleep(300); + } + +} + +ICMPSendTrash; \ No newline at end of file diff --git a/src/Home/Net/Tests/IPV4SendTrash.CC b/src/Home/Net/Tests/IPV4SendTrash.CC new file mode 100755 index 00000000..44eec3cf --- /dev/null +++ b/src/Home/Net/Tests/IPV4SendTrash.CC @@ -0,0 +1,24 @@ +U8 dst_mac[6] = {0xF0, 0x0D, 0xBE, 0xAD, 0xDE, 0xAF}; + +U32 src_ip = 0x30313233; +U32 dst_ip = 0x01020304; + +U0 IPV4SendTrash() +{ + U8 *ipv4_packet_buffer; + I64 de_index; + + ARPCachePut(dst_ip, dst_mac); // Force entry into ARP Cache so IPV4 can match it with GetMACAddressForIP + + while (TRUE) + { + de_index = IPV4PacketAllocate(&ipv4_packet_buffer, 0xFF, src_ip, dst_ip, 8); + + *(ipv4_packet_buffer(U64 *)) = EndianU64(0xDEADBEEFC0DEFADE); + + IPV4PacketFinish(de_index); + Sleep(300); + } +} + +IPV4SendTrash; \ No newline at end of file diff --git a/src/Home/Net/Tests/UDPSendTrash0.CC b/src/Home/Net/Tests/UDPSendTrash0.CC new file mode 100755 index 00000000..0e8fb139 --- /dev/null +++ b/src/Home/Net/Tests/UDPSendTrash0.CC @@ -0,0 +1,26 @@ +U8 dst_mac[6] = {0xF0, 0x0D, 0xBE, 0xAD, 0xDE, 0xAF}; + +U32 src_ip = 0x30313233; +U32 dst_ip = 0x01020304; + +U0 UDPSendTrash() +{ + U8 *udp_payload; + I64 de_index; + + ARPCachePut(dst_ip, dst_mac); // Force entry into ARP Cache so IPV4 can match it with GetMACAddressForIP + + while (TRUE) + { + de_index = UDPPacketAllocate(&udp_payload, src_ip, 0xDEAD, dst_ip, 0xBEEF, 8); + + *(udp_payload(U64 *)) = EndianU64(0xDEADBEEFC0DEFADE); + + UDPPacketFinish(de_index); + Sleep(300); + + } + +} + +UDPSendTrash; diff --git a/src/Home/Net/Tests/UDPSendTrash.CC b/src/Home/Net/Tests/UDPSendTrash1.CC similarity index 68% rename from src/Home/Net/Tests/UDPSendTrash.CC rename to src/Home/Net/Tests/UDPSendTrash1.CC index dcde98f7..8d72ba44 100755 --- a/src/Home/Net/Tests/UDPSendTrash.CC +++ b/src/Home/Net/Tests/UDPSendTrash1.CC @@ -2,10 +2,15 @@ U0 UDPSendTrash() { CAddressInfo *result = NULL; - I64 error = DNSGetAddressInfo("zenithos.org", NULL, &result); - I64 i = 0; + I64 error; U8 *b; + if (ipv4_globals.local_ip == 0) + { // This test needs to have the network configured first. + NetConfigure; + } + + error = DNSGetAddressInfo("zenithos.org", NULL, &result); if (error < 0) { ZenithErr("failed at DNS Get Address Info.\n");