From 5026f823fa2708404302aa59d03401635a435c0b Mon Sep 17 00:00:00 2001 From: Anton Kling Date: Fri, 27 Oct 2023 00:48:21 +0200 Subject: Kernel/Networking/LibC: Add syscalls and libc functions for UDP This allows a UDP server to be created in userland and read data. Currently it can't send data and is very very simplistic. Code is horrible and probably needs some fixing until it can be further built upon. --- network/arp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'network/arp.c') diff --git a/network/arp.c b/network/arp.c index eb8aca3..f86c732 100644 --- a/network/arp.c +++ b/network/arp.c @@ -43,7 +43,7 @@ void print_ip(const char *str, uint8_t *ip) { kprintf("\n"); } -void handle_arp(uint8_t *payload) { +void handle_arp(const uint8_t *payload) { struct ARP_DATA *data = (struct ARP_DATA *)payload; // Assert that communication is over ethernet @@ -79,5 +79,6 @@ void handle_arp(uint8_t *payload) { memcpy(response.dsthw, data->srchw, sizeof(uint8_t[6])); memcpy(response.dstpr, data->srcpr, sizeof(uint8_t[4])); - send_ethernet_packet(data->srchw, 0x0806, (uint8_t*)&response, sizeof(response)); + send_ethernet_packet(data->srchw, 0x0806, (uint8_t *)&response, + sizeof(response)); } -- cgit v1.2.3