code wiki / wiki / nx_wiki_vhost_table.nx

nx_wiki_vhost_table.nx

buildroot/runtime/wiki/nx_wiki_vhost_table.nx

7713 B199 linesdepth 15pulls 54 transitivereach 1 importersview sourcekind librarytopic wiki
docsdependenciesstructsconstsfunctions

about

nx_wiki_vhost_table.nx -- V-HOST-2.5: per-vhost wiki state table. Extends V-HOST-2 single-vhost daemon to N-vhost. Operator hosts nishifamily.com + andelinwest.com + jasonewest.com on a single substrate process; per-request Host header picks which site's wiki state to dispatch to. COMPOSES (per "avoid duplicate primitives"): nx_syscalls (caller-allocated structs) hub/nx_admin_login_flow / nx_search_handler_flow / nx_search_inverted wiki/nx_wiki_index_builder + nx_wiki_archive_router + nx_artifact_store COMPOSED BY: wiki/nx_wiki_https_daemon (V-HOST-2.5 multi-vhost dispatch) V-HOST-2.5 SCOPE: - NxWikiVHost struct: hostname + per-site wiki state pointers - NxWikiVHostTable: array of NxWikiVHost; bounded by NX_WVT_MAX_VHOSTS - nx_wiki_vhost_add: register a site at startup - nx_wiki_vhost_lookup_by_host: case-insensitive Host header match - Sealed fallback policy: 0=no fallback (404 on no match); idx=fallback to that vhost V-HOST-2.5 NON-SCOPE (queued): - SNI-aware cert selection during TLS handshake (currently shared multi-SAN cert across all vhosts; V-HOST-2.5.5) - Per-vhost cert (requires extending nx_tls13_server_session_run with cert-picker callback; V-HOST-2.5.5) - Per-vhost admin auth (currently shared admin across vhosts; operator may want per-vhost in V-HOST-2.5.7) Status: V-HOST-2.5. 2026-05-27.

dependencies 7 imports · 1 importers

nx_syscalls.nx nx_modern_auth_flow.nx nx_search_handler_flow.nx nx_search_inverted.nx nx_wiki_index_builder.nx nx_wiki_archive_router.nx nx_artifact_store.nx nx_wiki_vhost_table.nx nx_wiki_https_daemon_mv.nx

imports: nx_syscalls.nxnx_modern_auth_flow.nxnx_search_handler_flow.nxnx_search_inverted.nxnx_wiki_index_builder.nxnx_wiki_archive_router.nxnx_artifact_store.nx

imported by: nx_wiki_https_daemon_mv.nx

structs

58struct NxWikiVHost
73struct NxWikiVHostTable

consts

42const NX_WVT_OK: i64 = 0
43const NX_WVT_BAD_INPUT: i64 = 3820
44const NX_WVT_TABLE_FULL: i64 = 3821
45const NX_WVT_NOT_FOUND: i64 = 3822
46const NX_WVT_HOSTNAME_TOO_LONG: i64 = 3823
49const NX_WVT_MAX_VHOSTS: i64 = 16 // bounded; V+1 increases when corpus grows
50const NX_WVT_MAX_HOSTNAME_LEN: i64 = 253 // RFC 1035 per-label * total
51const NX_WVT_FALLBACK_NONE: i64 = 0 - 1
69const NX_WVT_VHOST_BYTES: i64 = 72

functions

81func nx_wiki_vhost_table_init(t: *NxWikiVHostTable) -> i64
called by 1: main calls 1: sys_mmap
91func nx_wiki_vhost_add(t: *NxWikiVHostTable,
called by 1: main
119func nx_wiki_vhost_set_fallback(t: *NxWikiVHostTable, idx: i64) -> i64
called by 1: main
132func _nx_wvt_lc(b: i64) -> i64
called by 1: _nx_wvt_eq_ci
137func _nx_wvt_eq_ci(a: *u8, a_n: i64, b: *u8, b_n: i64) -> i64
157func nx_wiki_vhost_lookup_by_host(t: *NxWikiVHostTable,
called by 1: nx_mv_handle_one calls 1: _nx_wvt_eq_ci
189func nx_wiki_vhost_at(t: *NxWikiVHostTable, idx: i64) -> *NxWikiVHost
called by 1: nx_mv_handle_one
196func nx_wiki_vhost_count(t: *NxWikiVHostTable) -> i64