diff --git a/TODO.md b/TODO.md index e00b0c3..3c65c2c 100644 --- a/TODO.md +++ b/TODO.md @@ -191,6 +191,9 @@ Follow-up: Current status: - `NCP 0x23` AFP calls still return invalid namespace. +- The AFP dispatcher now decodes the WebSDK/NWAFP subfunction number in + diagnostics so real client probes can be mapped to the corresponding AFP + call before implementation work starts. - Optional build-time detection/linking for Netatalk/libatalk exists as a first local metadata backend hook. It is deliberately not an AFP protocol implementation yet. diff --git a/src/nwconn.c b/src/nwconn.c index 5ef3b6c..1ad0337 100644 --- a/src/nwconn.c +++ b/src/nwconn.c @@ -456,6 +456,26 @@ static void handle_nwbind_request(void) /* mst:25-Apr-00 */ } } + +static const char *afp_call_name(int ufunc) +{ + switch (ufunc) { + case 0x03: return("AFP Delete"); + case 0x04: return("AFP Get Entry ID From Name"); + case 0x06: return("AFP Get Entry ID From NetWare Handle"); + case 0x07: return("AFP Rename"); + case 0x08: return("AFP Open File Fork"); + case 0x0b: return("AFP Alloc Temporary Dir Handle"); + case 0x0c: return("AFP Get Entry ID From Path Name"); + case 0x0d: return("AFP 2.0 Create Directory"); + case 0x0e: return("AFP 2.0 Create File"); + case 0x0f: return("AFP 2.0 Get File Information"); + case 0x10: return("AFP 2.0 Set File Information"); + case 0x11: return("AFP 2.0 Scan File Information"); + default: return("unknown AFP call"); + } +} + static int handle_ncp_serv(void) { int function = (int)ncprequest->function; @@ -2384,12 +2404,22 @@ static int handle_ncp_serv(void) } break; case 0x23 : { /* div AFP Calls */ + int ufunc = (int) *requestdata; /* * NetWare AFP calls are server-side NCP entry points for * Mac namespace semantics: AFP entry IDs, Finder Info, * AppleDouble metadata, resource forks, and per-volume Mac * namespace state. * + * WebSDK / headers identify the old NCP 0x2222/35 AFP + * subfunctions used by nwafp.h, including AFP Delete + * (0x03), Get Entry ID From Name (0x04), Get Entry ID From + * NetWare Handle (0x06), Rename (0x07), Open File Fork + * (0x08), Alloc Temporary Dir Handle (0x0b), Get Entry ID + * From Path Name (0x0c), the AFP 2.0 create calls + * (0x0d/0x0e), Get/Set File Information (0x0f/0x10), and + * Scan File Information (0x11). + * * Netatalk/libatalk can be enabled at build time as an * optional local metadata backend for AppleDouble/Finder * Info/resource-fork access, but mars_nwe must still @@ -2397,10 +2427,8 @@ static int handle_ncp_serv(void) * proxy these calls to afpd or report success until the * required Mac namespace semantics exist. */ -#if 0 - int ufunc = (int) *requestdata; -#endif - XDPRINTF((3,0, "AFP call rejected: Mac namespace unavailable, libatalk backend=%s", + XDPRINTF((3,0, "AFP call rejected: ufunc=0x%02x (%s), Mac namespace unavailable, libatalk backend=%s", + ufunc, afp_call_name(ufunc), nwatalk_backend_available() ? "enabled" : "disabled")); completition=0xbf; /* we say invalid namespace here */ } break;