ipv4: checksumming and processing

This commit is contained in:
Matheus
2024-04-07 16:32:01 -03:00
parent 219635a48a
commit 12612218ad
2 changed files with 62 additions and 5 deletions
+1 -2
View File
@@ -15,12 +15,11 @@ void eth_process(netdev_t *netdev, void *buffer) {
if (!(MAC_EQUAL(&dst, &netdev->mac) || MAC_EQUAL(&dst, &broadcast)))
return;
printf("our machine!\n");
void *nextbuff = (void *)((uintptr_t)buffer + sizeof(ethframe_t));
switch (be_to_cpu_w(frame->type)) {
case ETH_PROTO_IP:
ipv4_process(netdev, nextbuff);
break;
case ETH_PROTO_ARP:
arp_process(netdev, nextbuff);