-
-
Notifications
You must be signed in to change notification settings - Fork 89
AROSTCP
This document covers the AmiTCP-derived core network stack: protocols, kernel infrastructure, BSD socket API (slots 1-50), IPv6 support, configuration services, and command-line utilities.
For Roadshow bsdsocket.library extensions (slots 51-138), see Roadshow TODO. For Miami compatibility library, see Miami TODO.
Last updated against codebase: March 2026.
| 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
|
| 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 |
| 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) |
| 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) |
The core bsdsocket.library function table provides 50 slots for standard AmiTCP BSD socket operations. All are fully implemented.
| Slot | Function | Slot | Function |
|---|---|---|---|
| 1 | socket |
26 | ReleaseCopyOfSocket |
| 2 | bind |
27 | Errno |
| 3 | listen |
28 | SetErrnoPtr |
| 4 | accept |
29 | Inet_NtoA |
| 5 | connect |
30 | inet_addr |
| 6 | sendto |
31 | Inet_LnaOf |
| 7 | send |
32 | Inet_NetOf |
| 8 | recvfrom |
33 | Inet_MakeAddr |
| 9 | recv |
34 | inet_network |
| 10 | shutdown |
35 | gethostbyname |
| 11 | setsockopt |
36 | gethostbyaddr |
| 12 | getsockopt |
37 | getnetbyname |
| 13 | getsockname |
38 | getnetbyaddr |
| 14 | getpeername |
39 | getservbyname |
| 15 | IoctlSocket |
40 | getservbyport |
| 16 | CloseSocket |
41 | getprotobyname |
| 17 | WaitSelect |
42 | getprotobynumber |
| 18 | SetSocketSignals |
43 | Syslog |
| 19 | getdtablesize |
44 | Dup2Socket |
| 20 | ObtainSocket |
45 | sendmsg |
| 21 | ReleaseSocket |
46 | recvmsg |
| 22 | ReleaseCopyOfSocket |
47 | gethostname |
| 23 | Errno |
48 | gethostid |
| 24 | SetErrnoPtr |
49 | SocketBaseTagList |
| 25 | ObtainSocket |
50 | GetSocketEvents |
Implementation files: api/amiga_libcalls.c (address conversion), api/gethostnamadr.c (name resolution), api/getxbyy.c (service/protocol/network lookups), kern/uipc_socket.c + uipc_socket2.c (socket core).
BSD-standard behavior is implemented in netinet/in_pcb.c:
- Multicast addresses:
SO_REUSEADDRis treated asSO_REUSEPORT(allows full duplication) - Unicast addresses:
SO_REUSEPORTrequired on both sockets for shared binds - This matches FreeBSD/macOS semantics; differs from Linux where
SO_REUSEADDRalone enables UDP port sharing
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-- callsin6_joingroup_inp()->in6_addmulti()-> MLD report -
IPV6_LEAVE_GROUP-- callsin6_leavegroup_inp()->in6_delmulti()-> MLD done -
IPV6_MULTICAST_IF-- setsim6o->im6o_multicast_ifp -
IPV6_MULTICAST_HOPS-- setsim6o->im6o_multicast_hlim(validated 0-255 or -1) -
IPV6_MULTICAST_LOOP-- setsim6o->im6o_multicast_loop -
IPV6_V6ONLY-- setsinp->in6p_v6only -
IPV6_RECVPKTINFO-- sets/clearsIN6P_PKTINFOflag -
IPV6_TCLASS-- setsinp->in6p_tclass -
IPV6_UNICAST_HOPS-- setsinp->in6p_hops -
IPV6_HOPLIMIT-- NOT HANDLED (get/set hop limit ancillary data)
| Feature | Status | Key Files |
|---|---|---|
| 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) |
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_multilinked 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)
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 bygetifaddrs)
| 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
|
| 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) |
| File | Description |
|---|---|
amiga_main.c |
Stack initialization & main event loop |
uipc_socket.c |
Socket creation/management core logic |
uipc_socket2.c |
Socket additional operations & queuing |
uipc_domain.c |
Protocol domain/family registration |
uipc_mbuf.c |
Memory buffer (mbuf) allocation & manipulation |
kern_malloc.c |
Kernel memory allocator |
kern_subr.c |
Kernel subroutines (sleep, wakeup, etc.) |
kern_synch.c |
Amiga-specific synchronization primitives |
amiga_config.c |
Configuration file parsing for network setup |
amiga_netdb.c |
Name database (hosts, services) caching |
amiga_time.c |
Time management & timers |
amiga_log.c |
Logging subsystem |
amiga_rexx.c |
ARexx command interface |
amiga_dhcp.c |
DHCP client implementation (v4 + v6) |
amiga_cx.c |
Commodities Exchange interface |
amiga_gui.c |
GUI components for configuration |
accesscontrol.c |
Access control lists |
subr_prf.c |
Printf-style formatting utilities |
| File | Description |
|---|---|
in_proto.c |
IPv4 protocol family/domain initialization |
ip_input.c |
IPv4 packet reception & routing |
ip_output.c |
IPv4 packet transmission & fragmentation |
ip_icmp.c |
ICMP (ping, error messages) |
in_pcb.c |
Protocol control blocks (TCP/UDP connection state) |
in_cksum.c |
IPv4/TCP checksum calculation |
in_cksum_sse2.c |
Optimized SSE2 checksum |
in.c |
IPv4 address utilities & interface configuration |
tcp_input.c |
TCP segment reception & state machine |
tcp_output.c |
TCP segment transmission |
tcp_usrreq.c |
TCP user request processing |
tcp_subr.c |
TCP support routines |
tcp_timer.c |
TCP retransmit & keepalive timers |
tcp_debug.c |
TCP debug tracing |
udp_usrreq.c |
UDP datagram handling |
raw_ip.c |
Raw IPv4 socket support |
| File | Description |
|---|---|
ip6_input.c |
IPv6 packet reception & routing (273 lines) |
ip6_output.c |
IPv6 packet transmission, multicast output (298 lines) |
in6.c |
IPv6 address management, ioctls, multicast (788 lines) |
in6_pcb.c |
IPv6 PCB bind/connect/lookup (223 lines) |
in6_proto.c |
IPv6 protocol switch, ip6_ctloutput (512 lines) |
in6_cksum.c |
IPv6 checksum calculation |
in6_cksum_sse2.c |
Optimized SSE2 IPv6 checksum |
icmp6.c |
ICMPv6 echo, parameter problem, time exceeded (548 lines) |
nd6.c |
Neighbor cache, NUD, ND option parsing (1007 lines) |
nd6_nbr.c |
NS/NA processing, DAD (750 lines) |
nd6_rtr.c |
RS/RA processing, SLAAC, prefix management (906 lines) |
mld6.c |
MLDv1 multicast listener discovery (386 lines) |
udp6_usrreq.c |
UDP over IPv6 |
| File | Description |
|---|---|
if.c |
Network interface management |
if_sana.c |
SANA-II device driver integration |
if_loop.c |
Loopback interface |
route.c |
Routing table management (611 lines) |
rtsock.c |
PF_ROUTE routing socket (886 lines) |
radix.c |
Radix tree for route lookups (710 lines) |
raw_cb.c |
Raw socket control blocks |
raw_usrreq.c |
Raw socket user requests |
netisr.c |
Network interrupt scheduler |
sana2arp.c |
ARP (Address Resolution Protocol) |
sana2config.c |
SANA-II device configuration |
sana2copybuff.c |
Buffer copying utilities |
sana2perror.c |
SANA-II error reporting |
bpf.c |
Berkeley Packet Filter, packet capture (493 lines) |
bpf_filter.c |
BPF packet filtering VM/interpreter (401 lines) |
pfil.c |
Packet filter hooks framework (147 lines) |
ipfilter.c |
IP packet filtering rules engine (566 lines) |
- Implement
IPV6_HOPLIMITsocket option (ancillary data for received hop limit)