Skip to content

roadshow

Nick Andrews edited this page Jul 29, 2026 · 8 revisions

AROSTCP -- Roadshow bsdsocket.library Extensions

This document covers the Roadshow bsdsocket.library extended API (slots 51-138): BPF, routing, interface management, DNS, mbuf access, address conversion, name resolution, and more.

Related pages: Core network stack · Miami compatibility library

Last updated against codebase: July 2026.

Primary source file: api/amiga_roadshow.c (2042 lines, 71 AROS_LH functions) Function table: api/amiga_libtables.c (slots 51-138 in UserLibrary_funcTable) Prototypes: clib/bsdsocket_protos.h (AROS_LP macros for all functions)


Complete Slot Map (Slots 51-138)

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

Slots 51-60: Reserved (10 Null entries)

Legacy Miami reserved slots.

Slots 61-68: BPF

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

AddRouteTagList, DeleteRouteTagList, ChangeRouteTagList, FreeRouteInfo, GetRouteInfo.

Slots 74-82: Interface Management

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

AddNetMonitorHookTagList, RemoveNetMonitorHook, GetNetworkStatistics.

Slots 86-98: DNS / Database Enumeration

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

Slot 99: inet_aton

inet_aton (real -- in amiga_libcalls.c).

Slots 100-101: Address Conversion

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

Slots 102-103: Address Classification

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

Slots 104-114: Mbuf Access API

mbuf_copym, mbuf_copydata, mbuf_copyback, mbuf_free, mbuf_freem, mbuf_get, mbuf_gethdr, mbuf_prepend, mbuf_adj, mbuf_cat, mbuf_pullup.

Slots 115-116: Server Socket API

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

Slots 117-118: Default Domain Name

GetDefaultDomainName (real), SetDefaultDomainName (No-op).

Slots 119-121: Roadshow Data API

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

Slot 122: RemoveInterface

RemoveInterface (returns ENOSYS).

Slots 123-124: Thread-Safe Resolver

gethostbyname_r (ENOSYS), gethostbyaddr_r (ENOSYS).

Slots 125-127: Reserved (3 Null entries)

Slots 128-134: IP Filter User-Space API

ipf_open, ipf_close, ipf_read, ipf_write, ipf_ioctl, ipf_set_notify_mask, ipf_set_interrupt_mask -- all ENOSYS.

Slots 135-138: Name Resolution

freeaddrinfo (real), getaddrinfo (real), gai_strerror (real), getnameinfo (real).


Detailed Status

BPF (Berkeley Packet Filter)

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

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

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

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

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)

Network Database Enumeration

All nine enumeration functions are fully implemented in api/amiga_ndbent.c. Each triplet follows the same pattern: acquire semaphore, iterate the NDB linked list, release semaphore.

Network entries (slots 90-92):

  • setnetent() -- resets iteration to start of NDB->ndb_Networks
  • endnetent() -- clears iterator, releases semaphore
  • getnetent() -- returns next struct netent from network database

Protocol entries (slots 93-94 + existing getprotoent):

  • setprotoent() -- resets iteration to start of NDB->ndb_Protocols
  • endprotoent() -- clears iterator, releases semaphore
  • getprotoent() -- returns next struct protoent from protocol database

Service entries (slots 95-97):

  • setservent() -- resets iteration to start of NDB->ndb_Services
  • endservent() -- clears iterator, releases semaphore
  • getservent() -- returns next struct servent from service database

Address Conversion & Classification (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 (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 (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 (Slots 123-124)

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

IP Filter User-Space API (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) (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

Roadshow Extensions Remaining Backlog

  1. Implement real SetDefaultDomainName() (currently no-op; would need domain list rebuild)
  2. Implement interface management API (AddInterfaceTagList, ConfigureInterfaceTagList, ObtainInterfaceList, RemoveInterface, etc.)
  3. Implement network monitoring hooks + statistics wrapper (GetNetworkStatistics, AddNetMonitorHookTagList)
  4. Implement ProcessIsServer() / ObtainServerSocket() (currently return FALSE/-1)
  5. Implement RoadshowData API (ObtainRoadshowData, ReleaseRoadshowData, ChangeRoadshowData)
  6. Implement thread-safe resolvers (gethostbyname_r, gethostbyaddr_r)
  7. Implement IPF user-space API (if/when specification is finalized)

Change history

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
DNS server management (all 6 functions) Not implemented -> Implemented (5 real + 1 No-op)
QueryInterfaceTagList() Not implemented -> Implemented
Packet filter framework (pfil + ipfilter) (not listed) -> Implemented
Missing spec functions (5 functions) NOT PRESENT -> ENTRY POINTS ADDED (Stub)
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
Network database enumeration (9 functions) Stub -> Implemented (setnetent/endnetent/getnetent, setprotoent/endprotoent/getprotoent, setservent/endservent/getservent)

Clone this wiki locally