Skip to content

AROSTCP

Nick Andrews edited this page Mar 5, 2026 · 12 revisions

AROSTCP bsdsocket.library -- Implementation Status & To-Do Summary

This document tracks what is implemented, partially implemented, and not yet implemented in the AROSTCP network stack.

Last updated against codebase: March 2026.


Feature Overview

Core Protocol Support -- IMPLEMENTED

Protocol Status Key Files
IPv4 Complete netinet/ip_input.c, ip_output.c, in.c, in_pcb.c
IPv6 Complete netinet6/ip6_input.c, ip6_output.c, in6.c, in6_pcb.c
TCP (v4+v6) Complete netinet/tcp_input.c, tcp_output.c, tcp_usrreq.c, netinet6/
UDP (v4+v6) Complete netinet/udp_usrreq.c, netinet6/udp6_usrreq.c
ICMP Complete netinet/ip_icmp.c
ICMPv6 Complete netinet6/icmp6.c (548 lines)
Raw IP (v4+v6) Complete netinet/raw_ip.c
ARP Complete net/sana2arp.c

IPv6 Control Plane -- IMPLEMENTED

Feature Status Key Files
NDP (Neighbor Discovery) Complete netinet6/nd6.c (1007 lines), nd6_nbr.c (750), nd6_rtr.c (906)
DAD (Duplicate Address Detection) Complete netinet6/nd6.c (nd6_dad_start/timer)
SLAAC (Stateless Auto-config) Complete netinet6/nd6_rtr.c (RA processing, prefix handling)
Router Discovery Complete netinet6/nd6_rtr.c (RS/RA)
MLD (Multicast Listener Discovery) Complete netinet6/mld6.c (386 lines), mld6.h (MLDv1, RFC 2710)
IPv6 Multicast membership Complete netinet6/in6.c (in6_addmulti/delmulti), in6_proto.c
IPv6 socket options Complete netinet6/in6_proto.c (ip6_ctloutput, 247 lines)
IPv6 ioctls Complete netinet6/in6.c (in6_control, 788 lines)

Network Interface Layer -- IMPLEMENTED

Feature Status Key Files
SANA-II device integration Complete net/if_sana.c, sana2config.c
Loopback interface Complete net/if_loop.c
Interface management Complete net/if.c
Routing table (radix tree) Complete net/route.c (611 lines), net/radix.c (710 lines)
PF_ROUTE routing socket Complete net/rtsock.c (886 lines, RTM_ADD/DELETE/CHANGE/GET + notifications)
BPF (packet capture/filter) Complete net/bpf.c (493 lines), net/bpf_filter.c (401 lines)
Packet filter framework Complete net/pfil.c (147 lines, conditional on ENABLE_PACKET_FILTER)
IP Filter / firewall Complete net/ipfilter.c (566 lines, rule engine, NAT support)

BSD Socket API -- IMPLEMENTED

Feature Status Key Files
Core socket ops Complete kern/uipc_socket.c, uipc_socket2.c
DNS resolver Complete api/res_init.c, res_query.c, res_send.c, res_mkquery.c
Name resolution Complete api/gethostnamadr.c, getxbyy.c
inet_ntop / inet_pton Complete api/inet_ntop.c
if_nameindex / getifaddrs Complete api/if_nameindex.c, getifaddrs.c

Configuration & Services -- IMPLEMENTED

Feature Status Key Files
DHCPv4 client Complete kern/amiga_dhcp.c (external dhclient launcher)
DHCPv6 client Complete kern/amiga_dhcp.c (conditional on INET6 && DHCP6)
Network database Complete kern/amiga_netdb.c
ARexx interface Complete kern/amiga_rexx.c
GUI configuration Complete kern/amiga_gui.c
Logging / debug Complete kern/amiga_log.c, kern/subr_prf.c
RC file configuration Complete kern/amiga_rc.c, amiga_config.c

Network Utilities -- IMPLEMENTED

Utility Location
arp common/C/arp.c
ifconfig common/C/ifconfig.c
ping common/C/ping.c
route common/C/route.c
netstat common/C/netstat/ (inet, inet6, route, if, mbuf stats)
traceroute common/C/traceroute/
nslookup common/C/nslookup/ (interactive mode)
hostname common/C/hostname.c
resolve common/C/resolve.c
logger common/C/logger.c
whoami common/C/whoami.c
ipf common/C/ipf/ (IP Filter rule management)
ipnat common/C/ipnat/ (NAT rule management)

Roadshow bsdsocket.library API -- Complete Slot Map

The library dispatch table contains 138 slots (plus sentinel). All slots have entry points -- no null vectors remain for documented functions.

Slots 1-50: Core BSD Socket API (IMPLEMENTED)

Standard AmiTCP-derived socket functions: socket, bind, listen, accept, connect, send/recv/sendto/recvfrom/sendmsg/recvmsg, shutdown, setsockopt/getsockopt, getsockname/getpeername, IoctlSocket, CloseSocket, WaitSelect, SetSocketSignals, SetErrnoPtr/getdtablesize, ObtainSocket/ReleaseSocket/ReleaseCopyOfSocket, Errno/SetErrnoPtr, inet_ntoa/inet_addr/inet_network/inet_makeaddr/inet_lnaof/inet_netof, gethostbyname/gethostbyaddr, getnetbyname/getnetbyaddr, getservbyname/getservbyport, getprotobyname/getprotobynumber, Dup2Socket, select, SocketBaseTagList, GetSocketEvents.

Slots 51-60: Reserved (10 Null entries)

Legacy Miami reserved slots.

Slots 61-68: BPF (IMPLEMENTED)

bpf_open, bpf_close, bpf_read, bpf_write, bpf_set_notify_mask, bpf_set_interrupt_mask, bpf_ioctl, bpf_data_waiting.

Slots 69-73: Route Management (IMPLEMENTED)

AddRouteTagList, DeleteRouteTagList, ChangeRouteTagList, FreeRouteInfo, GetRouteInfo.

Slots 74-82: Interface Management (PARTIALLY IMPLEMENTED)

AddInterfaceTagList (stub), ConfigureInterfaceTagList (stub), ReleaseInterfaceList (stub), ObtainInterfaceList (stub), QueryInterfaceTagList (real -- in amiga_netstat.c), CreateAddrAllocMessageA (stub), DeleteAddrAllocMessage (stub), BeginInterfaceConfig (stub), AbortInterfaceConfig (stub).

Slots 83-85: Network Monitoring (STUBS)

AddNetMonitorHookTagList, RemoveNetMonitorHook, GetNetworkStatistics.

Slots 86-98: DNS / Database Enumeration (PARTIALLY IMPLEMENTED)

AddDomainNameServer (real), RemoveDomainNameServer (real), ReleaseDomainNameServerList (real), ObtainDomainNameServerList (real), setnetent (stub), endnetent (stub), getnetent (stub), setprotoent (stub), getprotoent (real -- in amiga_ndbent.c), setservent (stub), endservent (stub), getservent (stub).

Slot 99: inet_aton (IMPLEMENTED)

inet_aton (real -- in amiga_libcalls.c).

Slots 100-101: Address Conversion (IMPLEMENTED)

inet_ntop (wrapper to __inet_ntop), inet_pton (wrapper to __inet_pton).

Slots 102-103: Address Classification (IMPLEMENTED)

In_LocalAddr (wrapper to in_localaddr), In_CanForward (wrapper to in_canforward).

Slots 104-114: Mbuf Access API (IMPLEMENTED)

mbuf_copym, mbuf_copydata, mbuf_copyback, mbuf_free, mbuf_freem, mbuf_get, mbuf_gethdr, mbuf_prepend, mbuf_adj, mbuf_cat, mbuf_pullup -- all delegate to kernel m_* functions.

Slots 115-116: Server Socket API (STUBS)

ProcessIsServer (returns FALSE), ObtainServerSocket (returns -1/ENOSYS).

Slots 117-118: Default Domain Name (PARTIALLY IMPLEMENTED)

GetDefaultDomainName (real -- reads first domain from NDB), SetDefaultDomainName (no-op).

Slots 119-121: Roadshow Data API (STUBS)

ObtainRoadshowData (ENOSYS), ReleaseRoadshowData (no-op), ChangeRoadshowData (ENOSYS).

Slot 122: RemoveInterface (STUB)

RemoveInterface (returns ENOSYS).

Slots 123-124: Thread-Safe Resolver (STUBS)

gethostbyname_r (ENOSYS), gethostbyaddr_r (ENOSYS).

Slots 125-127: Reserved (3 Null entries)

Slots 128-134: IP Filter User-Space API (STUBS)

ipf_open, ipf_close, ipf_read, ipf_write, ipf_ioctl, ipf_set_notify_mask, ipf_set_interrupt_mask -- all ENOSYS. (The IPF API is intentionally undocumented per Roadshow spec and subject to change.)

Slots 135-138: Name Resolution (IMPLEMENTED)

freeaddrinfo (real), getaddrinfo (real -- 150+ line implementation with IPv4/IPv6), gai_strerror (real), getnameinfo (real -- 70+ line implementation with NI_* flags).


Roadshow "extended" API -- Detailed Status

BPF (Berkeley Packet Filter) -- IMPLEMENTED

Full kernel BPF engine with RX/TX hook points and Roadshow API layer.

  • bpf_open() -- allocates & initializes BPF descriptor
  • bpf_close() -- closes descriptor and frees resources
  • bpf_read() -- reads captured packets from hold buffer
  • bpf_write() -- transmits raw packets via interface
  • bpf_set_notify_mask() -- sets EXEC signal notification
  • bpf_set_interrupt_mask() -- sets interrupt mask
  • bpf_ioctl() -- handles 16+ ioctl commands (BIOCGBLEN, BIOCSBLEN, BIOCSETF, BIOCFLUSH, BIOCPROMISC, BIOCGDLT, BIOCSETIF, BIOCGSTATS, BIOCVERSION, etc.)
  • bpf_data_waiting() -- returns bytes available for reading

Kernel infrastructure:

  • BPF VM/interpreter (net/bpf_filter.c -- full instruction set, 401 lines)
  • Attach/detach hooks in SANA-II RX/TX paths (net/if_sana.c)
  • Per-interface filter lists and frame dispatch (net/bpf.c, 493 lines)
  • Notify/interrupt signal semantics

Route Management -- IMPLEMENTED

Full TagItem-based route API with BSD 4.4 routing socket support.

  • AddRouteTagList() -- parses tags, calls rtrequest(RTM_ADD, ...)
  • DeleteRouteTagList() -- parses tags, calls rtrequest(RTM_DELETE, ...)
  • ChangeRouteTagList() -- atomic delete+re-add under splnet
  • FreeRouteInfo() -- frees allocated route info buffer via bsd_free()
  • GetRouteInfo() -- two-pass radix walk, returns rt_msghdr array with filtering

Kernel infrastructure:

  • PF_ROUTE domain registered (net/rtsock.c, 886 lines)
  • RTM_ADD / RTM_DELETE / RTM_GET / RTM_CHANGE / RTM_LOCK messages
  • RTM_MISS / RTM_RESOLVE / RTM_REDIRECT / RTM_IFINFO / RTM_NEWADDR / RTM_DELADDR notifications

Interface Management -- PARTIALLY IMPLEMENTED

Most are stubs; QueryInterfaceTagList and RemoveInterface entry points exist.

  • AddInterfaceTagList() -- STUB (returns -1, ENOSYS)
  • ConfigureInterfaceTagList() -- STUB (returns -1, ENOSYS)
  • QueryInterfaceTagList() -- IMPLEMENTED (full implementation in amiga_netstat.c)
  • ObtainInterfaceList() -- STUB (returns NULL)
  • ReleaseInterfaceList() -- STUB
  • BeginInterfaceConfig() -- STUB
  • AbortInterfaceConfig() -- STUB
  • CreateAddrAllocMessageA() -- STUB (returns 0)
  • DeleteAddrAllocMessage() -- STUB
  • RemoveInterface() -- STUB (entry point present, returns ENOSYS)

Work remaining:

  • Dynamic SANA-II device open/close and interface lifecycle management
  • TagItem parsing for Add/Configure
  • Runtime address allocation / configuration hooks
  • ObtainInterfaceList / ReleaseInterfaceList list management

Network Monitoring -- NOT IMPLEMENTED

All are stubs.

  • AddNetMonitorHookTagList() -- STUB (returns -1, ENOSYS)
  • RemoveNetMonitorHook() -- STUB
  • GetNetworkStatistics() -- STUB (returns -1, ENOSYS)

Work required:

  • Stats wrapper over existing if_data counters (low effort)
  • Monitor hook callback injection points into RX/TX paths (medium effort)

DNS Server Management -- IMPLEMENTED

Runtime add/remove/list and default domain name API are all present.

  • AddDomainNameServer() -- IMPLEMENTED (parses address, adds to DynDB.dyn_NameServers)
  • RemoveDomainNameServer() -- IMPLEMENTED (finds and removes from list)
  • ObtainDomainNameServerList() -- IMPLEMENTED (returns populated list from static + dynamic entries)
  • ReleaseDomainNameServerList() -- IMPLEMENTED (walks list, frees all nodes)
  • GetDefaultDomainName() -- IMPLEMENTED (reads first domain from NDB->ndb_Domains)
  • SetDefaultDomainName() -- NO-OP (entry point present, but does nothing -- would need domain list rebuild)

Address Conversion & Classification -- IMPLEMENTED (Slots 99-103)

All have entry points and delegate to internal kernel functions.

  • inet_aton() -- delegates to __inet_aton (in amiga_libcalls.c)
  • inet_ntop() -- delegates to __inet_ntop (in inet_ntop.c)
  • inet_pton() -- delegates to __inet_pton (in inet_ntop.c)
  • In_LocalAddr() -- delegates to in_localaddr() kernel function
  • In_CanForward() -- delegates to in_canforward() kernel function

Mbuf Access API -- IMPLEMENTED (Slots 104-114)

All 11 mbuf functions delegate to kernel m_* equivalents with simplified Roadshow calling conventions (no wait/type parameters).

  • mbuf_copym() -- m_copym(buffer, offset, length, M_DONTWAIT)
  • mbuf_copydata() -- m_copydata(buffer, offset, length, dest)
  • mbuf_copyback() -- m_copyback(buffer, offset, length, src)
  • mbuf_free() -- m_free(buffer)
  • mbuf_freem() -- m_freem(buffer)
  • mbuf_get() -- m_get(M_DONTWAIT, MT_DATA)
  • mbuf_gethdr() -- m_gethdr(M_DONTWAIT, MT_DATA)
  • mbuf_prepend() -- M_PREPEND(buffer, length, M_DONTWAIT)
  • mbuf_adj() -- m_adj(buffer, length)
  • mbuf_cat() -- m_cat(first, second)
  • mbuf_pullup() -- m_pullup(buffer, length)

Server Socket & Roadshow Data APIs -- STUBS (Slots 115-116, 119-121)

Entry points exist but return error/no-op.

  • ProcessIsServer() -- STUB (always returns FALSE)
  • ObtainServerSocket() -- STUB (returns -1, ENOSYS)
  • ObtainRoadshowData() -- STUB (returns NULL, ENOSYS)
  • ReleaseRoadshowData() -- NO-OP (accepts call, does nothing)
  • ChangeRoadshowData() -- STUB (returns 0, ENOSYS)

Thread-Safe Resolver -- STUBS (Slots 123-124)

  • gethostbyname_r() -- STUB (returns NULL, ENOSYS)
  • gethostbyaddr_r() -- STUB (returns NULL, ENOSYS)

IP Filter User-Space API -- STUBS (Slots 128-134)

The IPF API is intentionally undocumented per Roadshow spec ("subject to change, intentionally not documented or otherwise supported by public source code"). All 7 functions return ENOSYS.

Note: The kernel-side packet filter framework (net/pfil.c, net/ipfilter.c) is fully implemented and accessible via MiamiPFAddHook/MiamiPFRemoveHook. The IPF user-space API stubs are a separate access path that has not been implemented.

  • ipf_open() -- STUB
  • ipf_close() -- STUB
  • ipf_read() -- STUB
  • ipf_write() -- STUB
  • ipf_ioctl() -- STUB
  • ipf_set_notify_mask() -- STUB
  • ipf_set_interrupt_mask() -- STUB

Name Resolution (getaddrinfo family) -- IMPLEMENTED (Slots 135-138)

Full implementations with IPv4/IPv6 support, independent of Miami equivalents.

  • freeaddrinfo() -- walks addrinfo chain, frees all nodes
  • getaddrinfo() -- 150+ line implementation with hints processing, hostname resolution, service lookup
  • gai_strerror() -- returns static error strings for all EAI_* codes
  • getnameinfo() -- 70+ line implementation with NI_NUMERICHOST, NI_NUMERICSERV, NI_NAMEREQD flags

IPv6 Control Plane -- IMPLEMENTED

IPPROTO_IPV6 Socket Options -- FUNCTIONAL

ip6_ctloutput() in netinet6/in6_proto.c (lines 261-508) implements real option handling with backing kernel state for both PRCO_SETOPT and PRCO_GETOPT.

  • IPV6_JOIN_GROUP -- calls in6_joingroup_inp() -> in6_addmulti() -> MLD report
  • IPV6_LEAVE_GROUP -- calls in6_leavegroup_inp() -> in6_delmulti() -> MLD done
  • IPV6_MULTICAST_IF -- sets im6o->im6o_multicast_ifp
  • IPV6_MULTICAST_HOPS -- sets im6o->im6o_multicast_hlim (validated 0-255 or -1)
  • IPV6_MULTICAST_LOOP -- sets im6o->im6o_multicast_loop
  • IPV6_V6ONLY -- sets inp->in6p_v6only
  • IPV6_RECVPKTINFO -- sets/clears IN6P_PKTINFO flag
  • IPV6_TCLASS -- sets inp->in6p_tclass
  • IPV6_UNICAST_HOPS -- sets inp->in6p_hops
  • IPV6_HOPLIMIT -- NOT HANDLED (get/set hop limit ancillary data)

IPv6 Multicast -- IMPLEMENTED

Full multicast stack with MLD protocol support.

  • Per-socket IPv6 group membership list (struct ip6_moptions, max 20 groups)
  • Per-interface multicast group table (struct in6_multi linked list, in6_multihead)
  • MLD (Multicast Listener Discovery) -- MLDv1 per RFC 2710 (netinet6/mld6.c, 386 lines)
    • Query/Report/Done message handling
    • Per-group state machine (IDLE/LAZY/SLEEPING/AWAKENING)
    • Report timer with random delay
    • Report suppression on hearing other reports
    • Unsolicited reports on join, Done on leave
    • ff02::1 (all-nodes) exemption per RFC 2710 Section 6
  • SANA-II multicast MAC registration (sana_add_mcast6 / sana_del_mcast6)
  • IPv6 multicast output (ip6_output.c -- interface selection, hop limit, loopback)

IoctlSocket() -- IPv6 Ioctls -- IMPLEMENTED

IPv6 address management ioctls are handled in in6_control():

  • SIOCGIFADDR_IN6 -- get IPv6 interface address
  • SIOCAIFADDR_IN6 -- add/configure IPv6 interface address
  • SIOCDIFADDR_IN6 -- delete IPv6 interface address
  • SIOCGIFDSTADDR_IN6 -- get destination address (point-to-point)
  • SIOCGIFNETMASK_IN6 -- get network mask
  • SIOCGLIFADDR -- enumerate addresses (used by getifaddrs)

Compatibility / Spec Gaps

Miami Compatibility Extensions -- PARTIALLY IMPLEMENTED

  • MiamiSysCtl() -- STUB (returns ENOSYS)
  • MiamiGetHardwareLen() -- STUB (returns 0)
  • MiamiSetSocksConn() -- STUB (returns FALSE)
  • MiamiOpenSSL() -- returns NULL (no SSL support; intentional, not an error)
  • MiamiCloseSSL() -- no-op (intentional)
  • sockatmark() -- STUB (returns 0)
  • MiamiPFAddHook() -- IMPLEMENTED (allocates hook, adds to pfil_list)
  • MiamiPFRemoveHook() -- IMPLEMENTED (removes from pfil_list, frees)

SO_REUSEPORT vs SO_REUSEADDR Semantics

BSD-standard behavior is implemented in netinet/in_pcb.c:

  • Multicast addresses: SO_REUSEADDR is treated as SO_REUSEPORT (allows full duplication)
  • Unicast addresses: SO_REUSEPORT required on both sockets for shared binds
  • This matches FreeBSD/macOS semantics; differs from Linux where SO_REUSEADDR alone enables UDP port sharing

Remaining Implementation Backlog (ordered by priority)

  1. Implement IPV6_HOPLIMIT socket option (ancillary data for received hop limit)
  2. Implement real SetDefaultDomainName() (currently no-op; would need domain list rebuild)
  3. Implement interface management API (AddInterfaceTagList, ConfigureInterfaceTagList, ObtainInterfaceList, RemoveInterface, etc.)
  4. Implement network monitoring hooks + statistics wrapper (GetNetworkStatistics, AddNetMonitorHookTagList)
  5. Implement ProcessIsServer() / ObtainServerSocket() (currently return FALSE/-1)
  6. Implement RoadshowData API (ObtainRoadshowData, ReleaseRoadshowData, ChangeRoadshowData)
  7. Implement thread-safe resolvers (gethostbyname_r, gethostbyaddr_r)
  8. Implement remaining Miami stubs (MiamiSysCtl, MiamiGetHardwareLen, sockatmark)
  9. Implement IPF user-space API (if/when specification is finalized)
  10. Implement remaining network database enumeration (setnetent/endnetent/getnetent, setservent/endservent/getservent)

What Changed Since the Original Wiki Page

The following items from the original to-do list have been completed:

Item Status Change
BPF (all 8 API functions + kernel engine) NOT IMPLEMENTED -> IMPLEMENTED
Route management (all 5 API functions) NOT IMPLEMENTED -> IMPLEMENTED
PF_ROUTE routing socket + RTM messages NOT IMPLEMENTED -> IMPLEMENTED
IPv6 socket options (ip6_ctloutput) SILENT NO-OP -> IMPLEMENTED (9 of 10 options)
IPv6 multicast (membership + MLD + delivery) NOT IMPLEMENTED -> IMPLEMENTED (MLDv1 RFC 2710)
IPv6 ioctls (SIOCGIFADDR_IN6, etc.) NOT IMPLEMENTED -> IMPLEMENTED (6 ioctl types)
DNS server management (all 6 functions) NOT IMPLEMENTED -> IMPLEMENTED (5 real + 1 no-op)
QueryInterfaceTagList() NOT IMPLEMENTED -> IMPLEMENTED
MiamiPFAddHook() / MiamiPFRemoveHook() PARTIAL -> IMPLEMENTED
Packet filter framework (pfil + ipfilter) (not listed) -> IMPLEMENTED
IP Filter / firewall engine + NAT (not listed) -> IMPLEMENTED
MLD (Multicast Listener Discovery) NOT IMPLEMENTED -> IMPLEMENTED
DHCPv4 + DHCPv6 client (not listed) -> IMPLEMENTED
NDP / DAD / SLAAC / Router Discovery (not listed) -> IMPLEMENTED
Missing spec functions (5 functions) NOT PRESENT -> ENTRY POINTS ADDED (stubs)
RemoveInterface() NOT PRESENT -> ENTRY POINT ADDED (stub)
Roadshow slots 100-138 (39 entries) NOT PRESENT -> ALL POPULATED
inet_ntop/inet_pton (Roadshow slots) NOT PRESENT -> IMPLEMENTED
In_LocalAddr / In_CanForward NOT PRESENT -> IMPLEMENTED
mbuf_* access API (11 functions) NOT PRESENT -> IMPLEMENTED
getaddrinfo/getnameinfo family NOT PRESENT -> IMPLEMENTED
GetDefaultDomainName NOT PRESENT -> IMPLEMENTED

Original backlog of 10 items: 7 fully completed, 2 partially completed, 1 remaining (interface management). Additionally, 39 new Roadshow API slots (100-138) have been added to the function table, providing entry points for all documented bsdsocket.library functions.

Clone this wiki locally