# NCP endpoint audit Provider and status vocabulary for future endpoint table work is declared in `include/ncp_endpoint.h`. The current tables remain documentation/audit data; the enum header must not be treated as runtime dispatch until the `nwconn` to `nwbind` magic-return paths are fully annotated. This file is the detailed endpoint audit for MARS-NWE. It is deliberately more mechanical than `TODO.md`: it records the NetWare SDK/NDK endpoint numbers, the wire/code selectors used by MARS-NWE, the implementation state, and the source files that should be checked when changing an endpoint. Patch chronology belongs in `AI.md`. Architecture discussion belongs in `REDESIGN.md`. This file is the cross-reference used while implementing and reviewing protocol handlers. ## Numbering convention Novell documentation usually names grouped endpoints as decimal `function / subfunction` values, for example `22/35` for **Get Directory Disk Space Restriction**. In MARS-NWE source code those selectors are normally written in hex C switch cases. Therefore: ```text NCP packet type: 0x2222 PDF/SDK decimal group 22 == top-level wire/code case 0x16 PDF/SDK decimal group 23 == top-level wire/code case 0x17 PDF/SDK decimal group 35 == top-level wire/code case 0x23 PDF/SDK decimal group 86 == top-level wire/code case 0x56 PDF/SDK decimal group 87 == top-level wire/code case 0x57 PDF/SDK decimal group 89 == top-level wire/code case 0x59, LONG/namespace variant in the NDK PDF/SDK decimal group 90 == top-level wire/code case 0x5a PDF/SDK decimal group 104 == top-level wire/code case 0x68 PDF/SDK decimal group 123 == top-level wire/code case 0x7b ``` For nested groups, both numbers must be kept in comments and docs. Example: ```text NCP 0x2222 / decimal 22/35 == MARS top-level case 0x16, subcase 0x23. ``` ## Reference inputs used for this audit - `ncp__enu.pdf` / extracted `ncp_pdf/ncp.txt`: canonical NDK **NetWare Core Protocols** endpoint list and request/reply tables. This PDF is newer than the current MARS-NWE default scope and includes later NetWare/OES material, so it must be filtered by scope. - `websdk.tar(6).gz`: easier-to-grep WebSDK HTML/API material, especially CAL/client-call names and topic grouping. - `include.tar(12).gz`: NetWare SDK include headers. These are often the quickest source for request/reply structures exposed through client APIs. Useful examples: - `include/nwdirect.h`: directory trustees, directory-space limit/list/info, `DIR_SPACE_INFO`, `NW_LIMIT_LIST`. - `include/nwbindry.h`: bindery object rights and `NWGetObjectEffectiveRights*` prototypes. - `include/nwvol.h`: volume name/number/stats and `NWGetExtendedVolumeInfo`. - `include/*cal*.imp` / `include/delphi/*`: client API names and ordinal groupings. - MARS-NWE implementation files: - `src/nwconn.c`: main `0x2222` dispatch, NCP 22/23/35/36/37/90/104/111/112/114/123 families. - `src/nwbind.c`: bindery/message/queue/userquota prehandling and many forwarded NCP 23 selectors. - `src/namspace.c`: NCP 86/87 namespace and extended attribute groups. - `src/connect.c`, `src/nwfile.c`, `src/nwvolume.c`, `src/nwsalvage.c`: backend helpers used by handlers. ## Status vocabulary | Status | Meaning | | --- | --- | | `done` | Implemented and covered by current unit/live/DOS smoke enough to leave the active queue. | | `implemented` | Active handler exists and should behave for normal clients, but may lack current direct tests. | | `partial` | Active useful implementation exists, but reply fields, edge cases, or backend semantics need audit/tests. | | `forwarded` | `nwconn.c` intentionally delegates to `nwbind.c` or another module. Check the target module before marking missing. | | `stub/no-op` | Handler returns a compatibility/dummy result or success without full server semantics. | | `guarded-4x` | Present only under `#if MARS_NWE_4` or documented as future 4.x scope. | | `open` | Documented endpoint with no reliable implementation found. | | `reference-only` | Later/OES/MOAB/NDS scope; record for reference, but not default runtime work. | ## 3.x/default endpoint queue These are the default-runtime endpoint families that matter for NetWare 1.x/2.x/3.x compatibility. ### NCP 22 Directory Services group (`0x2222`, decimal 22 == wire/code `0x16`) The group request header is the classic three-byte nested header after the NCP envelope: ```text word SubFuncStrucLen (Hi-Lo) byte SubFunctionCode ... subfunction payload ``` `src/nwconn.c` parses `SubFunctionCode` as `*(requestdata + 2)`. The table below lists PDF decimal selectors and the MARS hex subcase. | PDF decimal | Code hex | PDF/WebSDK name | MARS status | Handler / notes | | ---: | ---: | --- | --- | --- | | 22/00 | 0x00 | Set Directory Handle | implemented | `src/nwconn.c`; old directory handle remap. | | 22/01 | 0x01 | Get Directory Path | implemented | `src/nwconn.c`; returns length + path. | | 22/02 | 0x02 | Scan Directory Information | partial | `src/nwconn.c`; old DOS layout; needs edge-case tests. | | 22/03 | 0x03 | Get Effective Directory Rights | implemented | Uses trustee rights conversion; keep old 8-bit mask semantics. | | 22/04 | 0x04 | Modify Maximum Rights Mask | partial | IRM mutation works; review DOS client edge cases. | | 22/05 | 0x05 | Get Volume Number | implemented | Name-to-volume lookup. | | 22/06 | 0x06 | Get Volume Name | implemented | Volume number-to-name lookup. | | 22/0A | 0x0a | Create Directory | implemented | DOS namespace path create. | | 22/0B | 0x0b | Delete Directory | implemented | Directory delete path; salvage interactions need continued tests. | | 22/0C | 0x0c | Scan Directory for Trustees | implemented | Do not confuse with `22/12`; current code documents this. | | 22/0D | 0x0d | Add Trustee to Directory | implemented | Trustee xattr/backend path. | | 22/0E | 0x0e | Delete Trustee from Directory | implemented | Trustee remove path. | | 22/0F | 0x0f | Rename Directory | partial | Old dir rename; namespace conflict handling still belongs to DOS namespace work. | | 22/10 | 0x10 | Purge Erased Files (old) | partial | Salvage compatibility. Check `.recycle`/`.salvage` sidecars. | | 22/11 | 0x11 | Recover Erased File (old) | partial | Salvage recover compatibility. | | 22/12 | 0x12 | Allocate Permanent Directory Handle | implemented | Shares active handler with `22/13`/`22/16`. | | 22/13 | 0x13 | Allocate Temporary Directory Handle | implemented | Shares active handler with `22/12`/`22/16`. | | 22/14 | 0x14 | Deallocate Directory Handle | implemented | Handle release. | | 22/15 | 0x15 | Get Volume Info with Handle | implemented | Old volume info reply. | | 22/16 | 0x16 | Allocate Special Temporary Directory Handle | implemented | Shares active handler with handle allocation. | | 22/17 | 0x17 | Extract a Base Handle | implemented | Base-handle extraction. | | 22/18 | 0x18 | Restore an Extracted Base Handle | implemented | Returns bad station for invalid state. | | 22/19 | 0x19 | Set Directory Information | partial | Old metadata setter; align with NSS-shaped metadata helpers. | | 22/1A | 0x1a | Get Path Name of a Volume-Directory Number Pair | implemented | Path lookup. | | 22/1B | 0x1b | Scan Salvageable Files (old) | partial | Active bridge to salvage backend; next work is deleted metadata snapshot. | | 22/1C | 0x1c | Recover Salvageable File (old) | partial | Active bridge to salvage backend. | | 22/1D | 0x1d | Purge Salvageable File (old) | partial | Active bridge to salvage backend. | | 22/1E | 0x1e | Scan a Directory | partial | Used by `ndir.exe`; search/namespace edge cases remain. | | 22/1F | 0x1f | Scan root directory / old root scan | partial | Current code has uncertain old-client comments; needs doc/test. | | 22/20 | 0x20 | Scan Volume's User Disk Restrictions | partial | Userquota scan; covered by quota smokes for core behaviour, scan reply needs audit. | | 22/21 | 0x21 | Add User Disk Space Restriction | done | Forwarded/prehandled by `nwbind.c`; QUOTA and SYS backends live/DOS-smoked. | | 22/22 | 0x22 | Remove User Disk Space Restrictions | done | Forwarded/prehandled by `nwbind.c`; clear/remove covered. | | 22/23 | 0x23 | Get Directory Disk Space Restriction | done | Directory quota get; PDF decimal `22/35`, code `0x23`; all-smoke covered. | | 22/24 | 0x24 | Set Directory Disk Space Restriction | done | Directory quota set/clear; PDF decimal `22/36`, code `0x24`; all-smoke covered. | | 22/25 | 0x25 | Set Directory Entry Information | partial | Metadata setter; keep NSS-shaped init comments consistent. | | 22/26 | 0x26 | Scan File or Directory for Extended Trustees | implemented | Extended trustee scan; test more object/right edge cases. | | 22/27 | 0x27 | Add Extended Trustee to Directory or File | implemented | Extended trustee add. | | 22/28 | 0x28 | Scan Directory Disk Space | partial | Sequence and basic usage path exist; reply semantics still need audit. | | 22/29 | 0x29 | Get Object Disk Usage and Restrictions | done | Forwarded/prehandled by `nwbind.c`; userquota smokes exercise key behaviour. | | 22/2A | 0x2a | Get Effective Rights for Directory Entry | partial | Active compatibility implementation; PDF/WebSDK also list 4.x clients. | | 22/2B | 0x2b | Remove Extended Trustee from Dir or File | implemented | Extended trustee remove. | | 22/2C | 0x2c | Get Volume and Purge Information | partial | Active volume/salvage info; align purge counters with salvage snapshot. | | 22/2D | 0x2d | Get Directory Information | partial | Old volume/directory info variant. | | 22/2E | 0x2e | Rename Or Move (old) | partial | Active move/rename; namespace conflict handling pending. | | 22/2F | 0x2f | Get Name Space Information / fill namespace buffer | partial | Used by `ncopy`; current code has historical uncertainty. | | 22/30 | 0x30 | Get Name Space Directory Entry | partial | Active reply; verify structure against PDF/WebSDK. | | 22/31 | 0x31 | Open Data Stream | partial | Active compatibility slot; data-stream semantics require tests. | | 22/32 | 0x32 | Get Object Effective Rights for Directory Entry | partial | Active compatibility code; keep out of “missing 4.x” bucket. | | 22/33 | 0x33 | Get Extended Volume Information | partial | Active compatibility code; verify `NWGetExtendedVolumeInfo` fields. | | 22/34 | 0x34 | Get Mount Volume List | guarded-4x | Present behind `MARS_NWE_4`; do not enable by default until layout/tests exist. | Header/API cross-checks: `include/nwdirect.h` exposes `NWSetDirSpaceLimit`, `NWGetDirSpaceLimitList`, `NWGetDirSpaceInfo`, `NW_LIMIT_LIST`, `DIR_SPACE_INFO`, trustee APIs and rights masks. `include/nwbindry.h` exposes `NWGetObjectEffectiveRights*`. `include/nwvol.h` exposes `NWGetExtendedVolumeInfo`. ### NCP 23 Bindery / File Server Environment group (`0x2222`, decimal 23 == wire/code `0x17`) MARS routes many NCP 23 selectors through `src/nwbind.c`; some FSE monitor/admin selectors remain in `src/nwconn.c`. Do not mark a selector missing until both files are checked. | Selector area | PDF examples | MARS status | Handler / notes | | --- | --- | --- | --- | | Bindery login/keyed login/password/object/property operations | `23/00`, `23/14`, `23/18`, `23/32`-`23/4C` | partial/implemented | Mostly `src/nwbind.c`; test bindery object/property edge cases and `List Relations Of an Object` (`23/4C`). | | Connection info and internet address | `23/13`, `23/1A`-`23/1E`, `23/FE` | partial | `src/nwbind.c` and dispatcher glue. | | Scan File Information / Set File Information | `23/0F`, `23/10` | partial | `src/nwconn.c`; metadata field layouts need endpoint comments where missing. | | Queue calls | `23/64`, `23/68`, `23/69`, `23/6C`, `23/79`, `23/7A`, `23/7C`, `23/7F`, `23/83`, `23/84` | partial | `src/nwconn.c`/`src/nwbind.c`; queue path case and operator model remain TODO. | | Map Directory Number to Path / Convert Path to Dir Entry | `23/F3`, `23/F4` | partial | Active compatibility helpers; verify against old admin/DOS utilities. | | File Server Environment monitor selectors | many CAL/FSE APIs in `include/*calfse*` | partial/stub | `src/nwconn.c`; some return dummy/no-op replies; keep comments explicit. | ### Direct file and lock NCPs | PDF decimal / code | Name | MARS status | Handler / notes | | --- | --- | --- | --- | | `0x2222/03` | Log File | implemented | `src/nwconn.c`; old lock/log path. | | `0x2222/04`, `0x2222/6A` | Lock File Set old/new | partial | Lock semantics are compatibility-level. | | `0x2222/05`, `0x2222/06`, `0x2222/07`, `0x2222/08` | Release/Clear File and File Set | partial | Check old-client locking behaviour. | | `0x2222/09`-`0x2222/0E`, `0x2222/6B`, `0x2222/6C` | Logical record log/lock/release/clear | partial | Active compatibility paths; tests needed. | | `0x2222/1A`-`0x2222/1F`, `0x2222/6D`, `0x2222/6E` | Physical record log/lock/release/clear | partial | Active compatibility paths; tests needed. | | `0x2222/41`-`0x2222/4D`, `0x2222/54` | Old direct file open/create/close/read/write/rename/erase | implemented/partial | Active in `src/nwconn.c`; file write now covered indirectly by quota smokes. | | `0x2222/4F` | Set File Extended Attributes | stub/no-op | Active compatibility stub; document request layout before changing. | | `0x2222/55` | Get Sparse File Data Block Bit Map | stub/no-op | Active compatibility stub for later sparse data semantics. | ### NCP 86 Extended Attribute group (`0x2222`, decimal 86 == wire/code `0x56`) Handled by `src/namspace.c` through the EA group dispatcher. | PDF decimal | Code hex | Name | MARS status | Notes | | ---: | ---: | --- | --- | --- | | 86/01 | 0x01 | Close Extended Attribute Handle | partial | Active in `namspace.c`; xattr lifetime semantics need audit. | | 86/02 | 0x02 | Write Extended Attribute | partial | Active; tied to backup metadata compatibility. | | 86/03 | 0x03 | Read Extended Attribute | partial | Active; xattr roundtrip tests cover local helpers. | | 86/04 | 0x04 | Enumerate Extended Attribute | partial | Active; verify enumerate buffer layout. | | 86/05 | 0x05 | Duplicate Extended Attributes | partial | Active helper path. | ### NCP 87 Name Space group (`0x2222`, decimal 87 == wire/code `0x57`) Handled by `src/namspace.c`. This group is a core 3.x namespace target. Some 4.x-era selectors are deliberately present as documented stubs or compatibility slots. | PDF decimal | Code hex | Name | MARS status | Notes | | ---: | ---: | --- | --- | --- | | 87/01 | 0x01 | Open/Create File or Subdirectory | partial | Active; DOS namespace rules still being aligned. | | 87/02 | 0x02 | Initialize Search | partial | Active. | | 87/03 | 0x03 | Search for File or Subdirectory | partial | Active; wildcard/case rules pending. | | 87/04 | 0x04 | Rename Or Move a File or Subdirectory | partial | Active. | | 87/05 | 0x05 | Scan File or Subdirectory for Trustees | partial | Active. | | 87/06 | 0x06 | Obtain File or Subdirectory Information | partial | Active. | | 87/07 | 0x07 | Modify File or Subdirectory DOS Information | partial | Active; metadata layout needs continued audit. | | 87/08 | 0x08 | Delete a File or Subdirectory | partial | Active; salvage snapshot integration pending. | | 87/09 | 0x09 | Set Short Directory Handle | partial | Active. | | 87/10-12 | 0x0a-0x0c | Trustee add/delete/allocate handle | partial | Active. | | 87/16-18 | 0x10-0x12 | Scan/Recover/Purge Salvageable File | partial | Active; align with NSS-shaped deleted metadata. | | 87/19-28 | 0x13-0x1c | NS information, path and directory entry queries | partial | Active; request/reply comments need consistent layouts. | | 87/29 | 0x1d | Get Effective Directory Rights | partial | Active. | | 87/30-33 | 0x1e-0x21 | Open/Create II and callback variants | partial/stub | Active compatibility or documented no-op depending selector. | | 87/34-38 | 0x22-0x26 | Callback/file log/release/clear | stub/no-op | Documented but limited semantics. | | 87/39 | 0x27 | Get Directory Disk Space Restriction | partial | Namespace variant of dirquota; core 22/35 path is done. | | 87/40 | 0x28 | Search for File or Subdirectory Set extended errors | partial | Active search variant. | | 87/41-42 | 0x29-0x2a | Salvageable file list scan/purge | partial/open | PDF-listed 4.x-style list variants; active comments identify missing semantics. | | 87/43-44 | 0x2b-0x2c | File handle rights revoke/update | partial/open | Layout documented in comments; backend semantics incomplete. | ### NCP 89 Enhanced Name Space group (`0x2222`, decimal 89 == wire/code `0x59`) The NDK/PDF lists this LONG/enhanced namespace family. Current MARS-NWE does not have a separate active top-level `0x59` dispatcher. Treat these rows as audit input for future LONG/OS2 namespace work; do not silently alias them to NCP 87 unless a client trace proves compatibility. | PDF decimal | Code hex | Name | MARS status | Notes | | ---: | ---: | --- | --- | --- | | 89/01, 89/30, 89/33 | 0x01, 0x1e, 0x21 | Open/Create variants | open | Compare to NCP 87 before implementing. | | 89/02-09 | 0x02-0x09 | Search, rename, trustee, info, delete, short handle | open | Future LONG/OS2 namespace work. | | 89/16, 89/20, 89/28, 89/29, 89/35, 89/39, 89/40 | various | Salvage/search/path/rights/dirquota variants | open | Use PDF/WebSDK request layouts before adding runtime handlers. | | 89/50-54, 89/71 | 0x32-0x36, 0x47 | Enhanced rights and EA operations | open | Later enhanced namespace/EA work. | ### AFP, NCP extension and miscellaneous 3.x-adjacent groups | Family | PDF decimal / code | MARS status | Handler / notes | | --- | --- | --- | --- | | AFP | `35/01`-`35/19`, top-level `0x23` | partial | `src/nwconn.c`; backend boundary exists. Keep metadata changes isolated from DOS namespace. | | NCP extension info/execute | `36/00`-`36/06`, `37`, top-level `0x24`/`0x25` | guarded-4x/stub | Mostly `MARS_NWE_4` planned scope; not default 3.x runtime. | | TTS | `34/00`-`34/10`, top-level `0x22` | stub/no-op | Compatibility replies; no real transaction subsystem. | | Semaphores | direct old group and `111/00`-`111/04` | partial | Active compatibility semantics. | | Packet burst | `101`, top-level `0x65` | implemented/partial | Packet burst connection request exists. | ## 4.x / guarded endpoint queue These endpoints are either 4.x-era, later than the current default runtime scope, or already have limited active compatibility code. The table separates “already active compatibility” from “guarded/later”. | PDF decimal / code | Name | MARS status | Policy | | --- | --- | --- | --- | | 22/50 (`0x32`) | Get Object Effective Rights for Directory Entry | partial / active compatibility | Keep active; verify layout. Do not move behind `MARS_NWE_4` because clients may already use it. | | 22/51 (`0x33`) | Get Extended Volume Information | partial / active compatibility | Keep active; compare `include/nwvol.h` `NWGetExtendedVolumeInfo`. | | 22/52 (`0x34`) | Get Mount Volume List | guarded-4x | Present behind `MARS_NWE_4`; keep guarded. | | 90/00, 90/10-12, 90/128-136, 90/150 | Data migration / compression / migration requests | guarded-4x/reference | Do not enable default runtime without migration backend. | | 104 (`0x68`) | NDS NCP / NDS Fragger | guarded-4x/reference | Current code has selector skeleton under `MARS_NWE_4`; needs real NDS/nwnds layer. | | 112 (`0x70`) | Clear Lock Wait Node | partial/stub | Old compatibility slot; verify if 3.x clients need it. | | 114 (`0x72`) | Time Synchronization group | guarded-4x/reference | Keep guarded until time-sync compatibility is explicitly required. | | 123 (`0x7b`) | Server information/statistics group | guarded-4x/reference | Many CAL FSE APIs map here; current skeleton is 4.x planned scope. | | NCP extension registration/execute | 36/xx, 37 | guarded-4x/reference | Keep as reference/stub unless a concrete test requires it. | ## In-code documentation rules 1. Comments next to switch cases should use this form: ```c /* NCP 0x2222 / decimal 22/35 == wire/code 0x16/0x23: Get Directory Disk Space Restriction. */ ``` 2. For nested groups, document the group header once and then only the subfunction payload in each case. 3. If a selector is forwarded, the comment must say **where** it is completed, for example `forwarded to src/nwbind.c for prehandling/reply`. 4. If a selector is a stub/no-op, say that explicitly. Do not leave `return 0` or dummy replies undocumented. 5. If a selector is in `#if MARS_NWE_4`, keep the comment clear that it is not default runtime scope. 6. When the PDF uses decimal and the code uses hex, keep both values in comments for auditability. ## Immediate follow-up from this audit - Keep `TODO.md` endpoint tables short and use this file for detailed rows. - Add or normalize inline comments only when touching a handler; avoid noisy churn across all old switch cases in one patch. - Highest-value implementation work after quota: 1. DOS namespace rules and search semantics. 2. Salvage snapshot / NSS-shaped deleted metadata export. 3. NCP 22/87 search/namespace edge-case tests. 4. Bindery relation listing and group membership tests. 5. Queue path case/operator model cleanup.