6.9 KiB
NSS namespace and storage import audit
This note records the namespace follow-up after the Unicode/codepage/GUID import
series. The goal is to replace the old MARS namedos/nameos2 logic with the
more complete NSS namespace implementation. Do not add a permanent wrapper
around the old MARS namespace code; import/adapt NSS namespace sources directly
and then retire the duplicate MARS implementation in controlled steps.
Source tree
Primary NSS namespace source locations:
public_core/comn/namespace/nameSpace.c
public_core/comn/namespace/dosNSpace.c
public_core/comn/namespace/dosNSWild.c
public_core/comn/namespace/longNSpace.c
public_core/comn/namespace/macNSpace.c
public_core/comn/namespace/unixNSpace.c
public_core/comn/namespace/dataStreamNSpace.c
public_core/comn/namespace/extAttrNSpace.c
public_core/comn/namespace/*NSpace.h
public_core/comn/namespace/nspaceStartup.h
shared/sdk/include/nameSpace.h
shared/sdk/internal/macNSpace.h
shared/sdk/internal/unixNSpace.h
The NSS namespace set covers the target replacement area:
- DOS namespace
- LONG namespace
- MAC namespace
- UNIX namespace
- Data Stream namespace
- Extended Attribute namespace
Why this is not a small helper import
The namespace implementation is not just string parsing. The real NSS files use common-layer/file-system state:
comnPublics.h
comnParams.h
comnBeasts.h
comnVariableData.h
adminVolume.h
comnBeastClass.h
pssStartup.h
name.h
msgName.h
msgGen.h
zParams.h
sysimp.h
Important runtime hooks include:
- namespace registration through
COMN_RegisterNameSpace() - AdminVolume namespace beasts
- root variable-data registration for MAC/UNIX metadata
- name-beast/cache structures
- unique-name generation against directories
- message/error plumbing
So the namespace block should not be treated like the earlier pure helper libs
(crc, unicode, utc, guid, xString). It is closer to an NSS common-layer
subsystem and belongs on the path toward libnwfs.
Import direction
libnwcore
libnwcore should receive only stable reusable primitives needed by several
other imports:
- public NSS namespace IDs/flags/types
- component scan/compare/convert helpers once their common-layer dependencies are adapted
- wildcard helpers
- DOS/LONG/MAC/UNIX legal-character logic
- Data Stream / Extended Attribute namespace constants and parser helpers
libnwfs
libnwfs is the target for direct NSS namespace runtime integration:
- namespace registration
- DOS/LONG/MAC/UNIX namespace objects
- Data Stream namespace objects
- Extended Attribute namespace objects
- volume/pool namespace exposure
- metadata/salvage/stream integration
- future
_ADMINvirtual management volume
The old MARS files are replacement targets, not extension points:
include/namedos.h
include/nameos2.h
src/namedos.c
src/nameos2.c
src/namspace.c
namedos/nameos2 should be retired after NSS DOS/LONG/MAC/UNIX namespace code
is imported and tests show identical or better NetWare 3.x DOS behavior.
libnwnds
NDS/eDirectory helpers stay out of libnwcore:
public_core/library/eDir/getDSGuid.c
public_core/library/eDir/parseDSObjectName.c
getDSGuid.c depends on DDC/DS read APIs and belongs in a future libnwnds.
A simple DS object-name parser can be imported there later if 4.x guarded
endpoints need it.
libnwbind
Bindery/auth/object-ID bridging remains separate:
public_core/comn/authsys/*
That code references bindery/auth/common-layer internals and should become a
future libnwbind or libnwauth block, not a core namespace import.
_ADMIN virtual volume
NSS also carries the _ADMIN management volume model. It is storage/filesystem
management state, not a primitive core helper and not an eDirectory library by
itself.
Known NSS/OES shape to preserve later:
SYS => reserved volume ID 0
_ADMIN => reserved volume ID 1
_ADMIN is a virtual system/management NCP volume. It should not be treated as
a normal exported data volume and should not be enabled by default for NetWare
3.x behavior. Later libnwfs work can model it as hidden/admin-only and expose
NSS management trees such as:
_ADMIN:/Pools
_ADMIN:/Volumes
_ADMIN:/NameSpaces
_ADMIN:/BeastClasses
_ADMIN:/AuthModels
_ADMIN:/Manage_NSS/...
Use libnwnds only for the eDirectory backend portions behind this virtual
filesystem when those are imported. The virtual volume/runtime belongs to
libnwfs.
Compression follow-up
NSS compression is another libnwfs candidate, not libnwcore.
Lowlevel algorithm sources found under public_core/comn/compression/:
cdcomp.c
cdcompa.c
cduncomp.c
cduncompa.c
copyAlgo.c
nwAlgo.c
nwAlgo.h
cdcommon.h
cdcomp.h
cduncomp.h
Larger compression manager/runtime sources also exist there:
cmActivity.c
cmAlgoMan.c
cmBgCompress.c
cmCompDecomp.c
cmCompFile.c
cmControl.c
cmRuntime.c
comnCompress.c
Import order should be:
- Data stream / namespace / volume metadata basis.
- Lowlevel NetWare/NSS compression algorithm.
- Compression metadata/accounting and active compression/decompression state.
- NCP providers.
Relevant NCP endpoints already audited in decimal and wire/code notation:
decimal 90/12 == wire/code 0x5a/0x0c Set Compressed File Size
decimal 123/70 == wire/code 0x7b/0x46 Get Current Compressing File
decimal 123/71 == wire/code 0x7b/0x47 Get Current DeCompressing File Info List
decimal 123/72 == wire/code 0x7b/0x48 Get Compression and Decompression Time and Counts
decimal 22/51 == wire/code 0x16/0x33 Extended Volume Info compression counters
Do not synthesize fake compression state. Those endpoints should remain
stubbed/guarded until libnwfs has real stream/volume compression state.
Patch plan
Recommended next patches:
- Import namespace headers/constants and the smallest buildable NSS namespace primitives directly.
- Import/adapt DOS and LONG namespace scan/compare/convert functions.
- Import/adapt MAC and UNIX namespace functions, with metadata hooks tied to NSS-shaped metadata rather than private parallel state.
- Import/adapt Data Stream and Extended Attribute namespace helpers.
- Add regression tests against current MARS DOS/OS2 behavior.
- Switch
namspace.ccallsites from old MARSnamedos/nameos2logic to the imported NSS namespace code. - Remove old
namedos/nameos2after behavior is covered. - Add
libnwfsfollow-ups for_ADMIN, namespace registration visibility, and compression after the namespace/storage basis is present.
Endpoint relevance
The namespace replacement primarily supports NCP namespace/file endpoints,
especially decimal 87 == wire/code 0x57. Data stream and extended attribute
namespace support also feeds NSS-shaped metadata and future 4.x guarded work.
This does not change the NetWare 3.x priority: DOS behavior must remain correct, and 4.x/MAC/UNIX/DataStream/EA pieces can stay guarded until callsites are ready.