-
-
Notifications
You must be signed in to change notification settings - Fork 89
miami
This document covers the Miami compatibility layer that allows applications written for the Miami TCP/IP stack to run on AROSTCP. The Miami library acts as a wrapper, opening bsdsocket.library internally and delegating most calls to the core stack.
For AmiTCP core stack and protocols, see aros-wiki-arostcp.md. For Roadshow bsdsocket.library extensions (slots 51-138), see aros-wiki-arostcp-roadshow.md.
Last updated against codebase: March 2026.
Primary source files:
-
api/miami_api.c(~2000 lines) -- All Miami AROS_LH function implementations -
api/miami_functable.c-- Function dispatch table (60 user slots + 4 library management) -
api/miami_api.h-- MiamiBase structure definition
Architecture: Miami library opens are handled by Miami_Open() which creates a MiamiBase containing a pointer to the underlying SocketBase. All Miami functions receive struct MiamiBase * as the library base, and internally use #define SocketBase MiamiBase->_SocketBase to delegate to bsdsocket.library.
| Slot | Function | Status | Description |
|---|---|---|---|
| 1 | Open |
REAL | Creates MiamiBase, opens bsdsocket.library |
| 2 | Close |
REAL | Closes bsdsocket connection, frees MiamiBase |
| 3 | Expunge |
NOOP | Standard library expunge (never called at runtime) |
| Slot | Function | Status | Description |
|---|---|---|---|
| 5 | MiamiSysCtl() |
STUB | System control -- returns ENOSYS |
| 6 | SetSysLogPort() |
REAL | Locates and sets SysLog port via FindPort() |
| 7 | QueryInterfaceTagList() |
REAL | Query interface configuration via taglist (delegates to __QueryInterfaceTagList) |
| Slot | Function | Status | Description |
|---|---|---|---|
| 9 | ClearDynNameServ() |
REAL | Clear dynamic nameserver list |
| 10 | gethostent() |
REAL | Get next hostent from dynamic DB |
| 11 | MiamiDisallowDNS() |
REAL | Enable/disable DNS resolution via res_state.options |
| 12 | endhostent() |
REAL | End hostent iteration, release semaphore |
| 19 | EndDynDomain() |
REAL | End domain iteration, unlock semaphore |
| 20 | EndDynNameServ() |
REAL | End nameserver iteration, unlock semaphore |
| 21 | AddDynNameServ() |
REAL | Add nameserver to dynamic list (sockaddr_in) |
| 22 | AddDynDomain() |
REAL | Add domain to dynamic list (string) |
| 23 | sethostname() |
REAL | Set system hostname |
| 24 | ClearDynDomain() |
REAL | Clear dynamic domain list |
| Slot | Function | Status | Description |
|---|---|---|---|
| 14 | getprotoent() |
REAL | Get next protocol entry from NDB |
| 15 | endprotoent() |
REAL | End protocol enumeration |
| Slot | Function | Status | Description |
|---|---|---|---|
| 16 | MiamiPFAddHook() |
REAL | Register packet filter hook on interface (requires ENABLE_PACKET_FILTER) |
| 17 | MiamiPFRemoveHook() |
REAL | Unregister packet filter hook, free resources |
| Slot | Function | Status | Description |
|---|---|---|---|
| 13 | MiamiGetPid() |
REAL | Returns current task pointer (FindTask) |
| 18 | MiamiGetHardwareLen() |
STUB | Get hardware address length -- returns 0 |
| 35 | MiamiIsOnline() |
REAL | Check if interface/any interface is online (IFF_UP) |
| 36 | MiamiOnOffline() |
REAL | Bring interface up/down via ifupdown() |
| Slot | Function | Status | Description |
|---|---|---|---|
| 25 | MiamiOpenSSL() |
STUB | SSL support -- returns NULL (no SSL; intentional) |
| 26 | MiamiCloseSSL() |
STUB | SSL cleanup -- no-op (intentional) |
| 33 | MiamiSetSocksConn() |
STUB | SOCKS connection setup -- returns FALSE |
| Slot | Function | Status | Description |
|---|---|---|---|
| 38 | inet_ntop() |
REAL | Convert network address to presentation format (IPv4/IPv6) |
| 39 | inet_aton() |
REAL | Parse IPv4 address string to binary |
| 40 | inet_pton() |
REAL | Parse IPv4/IPv6 address string to binary |
| Slot | Function | Status | Description |
|---|---|---|---|
| 41 | gethostbyname2() |
REAL | Lookup hostname by address family (IPv4/IPv6) |
| Slot | Function | Status | Description |
|---|---|---|---|
| 42 | gai_strerror() |
REAL | Convert EAI_* error code to string |
| 43 | freeaddrinfo() |
REAL | Free addrinfo chain |
| 44 | getaddrinfo() |
REAL | Full DNS/address resolution with IPv4/IPv6, hints parsing |
| 45 | getnameinfo() |
REAL | Reverse DNS & port-to-service lookup, NI_* flags |
| Slot | Function | Status | Description |
|---|---|---|---|
| 46 | if_nametoindex() |
REAL | Convert interface name to index |
| 47 | if_indextoname() |
REAL | Convert interface index to name |
| 48 | if_nameindex() |
REAL | Get all interfaces as name/index array |
| 49 | if_freenameindex() |
REAL | Free if_nameindex array |
| Slot | Function | Status | Description |
|---|---|---|---|
| 50 | MiamiSupportsIPV6() |
REAL | Returns TRUE if INET6 enabled, else FALSE |
| 51 | MiamiGetResOptions() |
REAL | Get DNS resolver options (res_state.options) |
| 52 | MiamiSetResOptions() |
REAL | Set DNS resolver options |
| 53 | sockatmark() |
STUB | Check socket at out-of-band mark -- returns 0 |
| Slot | Function | Status | Description |
|---|---|---|---|
| 54 | MiamiSupportedCPUs() |
REAL | Report supported architectures (M68K APIs/callbacks, PPC kernel) |
| 55 | MiamiGetFdCallback() |
REAL | Get file descriptor change callback, return CPU type |
| 56 | MiamiSetFdCallback() |
REAL | Set file descriptor change callback (M68KREG only) |
| 58 | MiamiGetCredentials() |
REAL | Get user credentials (opens usergroup.library) |
| Slot | Function | Status | Description |
|---|---|---|---|
| 59 | FindKernelVar() |
REAL | Look up kernel variable by name (mbstat, ipstat, tcb, routing tables, etc.) |
Slots 4, 8, 27-32, 34, 37, 57 are Null entries (reserved or unused gaps).
| Category | Count | Details |
|---|---|---|
| REAL implementations | 42 | Full working code |
| STUBS | 5 |
MiamiSysCtl, MiamiGetHardwareLen, MiamiOpenSSL, MiamiSetSocksConn, sockatmark
|
| Intentional NO-OPs | 1 |
MiamiCloseSSL (no SSL to close; not a bug) |
| Reserved/Null slots | 12 | Unused gaps in function table |
| Total user slots | 60 | Slots 0-59 in Miami_UserFuncTable |
Several Miami functions have Roadshow counterparts in bsdsocket.library slots 100-138. These are independent implementations because of a key architectural difference:
-
Miami functions receive
struct MiamiBase *and use#define SocketBase MiamiBase->_SocketBase -
Roadshow functions receive
struct SocketBase *directly
Functions with parallel implementations:
| Miami Slot | Roadshow Slot | Function |
|---|---|---|
| 38 | 100 | inet_ntop |
| 40 | 101 | inet_pton |
| 42 | 137 | gai_strerror |
| 43 | 135 | freeaddrinfo |
| 44 | 136 | getaddrinfo |
| 45 | 138 | getnameinfo |
Both implementations use the same internal functions (__inet_ntop, __inet_pton, __gethostbyname, etc.) but are compiled separately with different library base types.
- Implement
MiamiSysCtl()(system control interface) - Implement
MiamiGetHardwareLen()(return interface hardware address length) - Implement
sockatmark()(check socket at out-of-band mark) - Consider
MiamiSetSocksConn()(SOCKS proxy -- low priority, rarely used) - Consider SSL shim library for
MiamiOpenSSL()/MiamiCloseSSL()(would need external SSL implementation)