Purpose: how an IPv4 host runs on a ude_conn, and how to extend it.
Template. An essay with examples, not a copy of the header: replace each TODO with prose. Every function is in libude-ipv4(3) and
include/ude_ipv4.h.
TODO: An IPv4 host on a connection
ude_ipv4_new,ude_ipv4_configureor a DHCP client.
TODO: Driving it
ude_ipv4_pollversusude_ipv4_input,ude_ipv4_tickandude_ipv4_timeout_ms;ude_ipv4_new_iofor tests and emulators.
TODO: ARP and ICMP
- The cache, retries and the queue; echo answered automatically.
TODO: Extension points
ude_ipv4_set_proto,ude_ipv4_set_proto_err, modules; theUDE_NET_*codes.- Routers:
ude_ipv4_set_route_hook(take or deliver any packet sent to our MAC) andude_ipv4_set_arp_proxy; see udeslirp and Routing and NAT. - Static routes:
ude_ipv4_add_route,ude_ipv4_clear_routesandude_ipv4_next_hopsend what is for a network through a gateway other than the default router (udeslirp--route). - Forwarding:
ude_ipv4_send_packetsends a whole IPv4 packet, unchanged, to an on-link next hop through the ARP queue, andude_ipv4_set_arp_failreports the packets ARP gave up on, so a router can answer with host unreachable (uderouter).
C: box "ude_conn" fit I: box "ude_ipv4" "ARP, IPv4, ICMP" fit at C + (0, 1.0) P: box "protocol handlers" "and modules" fit at I + (0, 1.0) arrow <-> from C.n to I.s arrow <-> from I.n to P.s text "TODO: layers plug in from above" at I + (2.2, 0)→ /pikchrshow