Add initial layered IPv4 networking stack (Ethernet/ARP/IPv4/ICMP/UDP/DNS + ping/wget scaffolding)#49
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
pingand attempt HTTP downloads.netif_*boundary that hidesrtl8139details from protocol code.Description
source/includes/net/net.handnet_packet_tto allow safe prepend/append/pull operations and headroom management.net_core.c(byte-order, checksum, packet buffer,netif_*wrapper),ethernet.c(Ethernet II parsing/construction and EtherType dispatch), andarp_ipv4_icmp_udp.c(ARP cache & resolution, IPv4 parsing/building/checksum, ICMP echo, UDP send/receive queues).dns_tcp_http_dhcp.cwith a UDP DNS resolver and an HTTP client that is wired to the networking API while TCP is provided as a scaffold (TCP state machine/retransmit/congestion features are noted as pending full wire-mode implementation); DHCP is a placeholder.pingandwgetcommands, register them in the shell table, and initialize the stack during startup with QEMU user-network defaults viaipv4_init(...); document architecture and QEMU testing notes insource/kernel/C/net/README.md.Testing
make -C sourcewhich compiled the new networking C files and integrated objects into the build, but the final link failed due to pre-existing build environment issues whereversions.shcould not generateversions/datesymbols (xorrisomissing), so the linker reported unrelated undefined references; all new networking objects compiled successfully before the link step.netif_send/netif_pollare wired to the existingrtl8139_send_packet/rtl8139_receive_packetpolling path as intended.-netdev user,id=n0 -device rtl8139,netdev=n0andping 10.0.2.2/wget http://...).Codex Task