code wiki / _hdl_build / nx_sites_reconciled.nx

nx_sites_reconciled.nx

buildroot/runtime/_hdl_build/nx_sites_reconciled.nx

13104 B269 linesdepth 14pulls 73 transitivereach 0 importersview sourcekind tooltopic sites
docsdependenciesstructsconstsfunctions

about

nx_sites_reconciled.nx -- the ONE reconciled sovereign sites daemon (R3-assembly): cleanly LAYERED + fully DATA-DRIVEN, replacing the two divergent F-level daemons. Composes the PROVEN TLS primitives (handshake/recv/ send, reused unchanged) with the GATED data-driven cores: io: accept (fork-per-conn) -> MSG_PEEK ClientHello -> scs_pick_from_clienthello -> SNI host data: cl_load(certs_generated.conf, sni) -> chain+key bytes (default-cert fallback) ; tables read at startup TLS: nx_tls13_server_session_run(cfd, rnd, priv, chain, len, key) [proven] logic: sh_handle(request, proxy_routes.conf, sites_generated.conf) -> PROXY-signal | static-200 | 404 io: PROXY -> buffered reverse-proxy relay to the backend ; else app_send the response NO hardcoded routes/certs/hosts -- routes/certs/vhosts are the 3 data tables nx_domain_forge emits. Operator: "fix the hardcoding, s-class exceed; append a domain -> the builders emit it." (Buffered proxy; streaming large media = a later perf rung.) license_tier: ORIGINAL

dependencies 10 imports · 0 importers

nx_syscalls.nx nx_connect.nx nx_csprng.nx nx_tls13_server_session.nx nx_tls13_server_session_run.nx nx_tls13_server_session_app_data.n nx_sni_cert_select.nx nx_cert_loader.nx nx_site_handler.nx nx_tls13_read_record_from_fd.nx nx_sites_reconciled.nx

imports: nx_syscalls.nxnx_connect.nxnx_csprng.nxnx_tls13_server_session.nxnx_tls13_server_session_run.nxnx_tls13_server_session_app_data.nxnx_sni_cert_select.nxnx_cert_loader.nxnx_site_handler.nxnx_tls13_read_record_from_fd.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_mmap rd_readfile sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close sys_write sys_socket sys_setsockopt sys_bind sys_listen sys_set_socket_timeout sys_mmap ↻ sys_setsockopt ↻ sys_munmap sys_wait4 sys_accept sys_fork sys_close ↻ nx_csprng_fill sys_mmap ↻ nx_csprng_urandom_path sys_openat_rd ↻ sys_read ↻ sys_close ↻ sys_recvfrom scs_pick_from_clienthello sni_extract_hostname sni_u16 scs_pick_index scs_label_endswith scs_lc cl_load cr_match sys_mmap ↻ cr_eol cr_split

structs

none

consts

22const RD_MAGIC_20480: i64 = 20480
24const RD_PORT: i64 = 8443
25const RD_MSG_PEEK: i64 = 2
26const RD_PEEK_CAP: i64 = 8192
27const RD_OUTCAP: i64 = 4194304
28const RD_RELAYCAP: i64 = 4194304
29const RD_BUDGET: i64 = 1000000000
30const RD_MAXCHILD: i64 = 64
32const RD_REG: *u8 = "/volume1/homes/elderwesto/nishihost/certs_generated.conf" as *u8
33const RD_RT: *u8 = "/volume1/homes/elderwesto/nishihost/proxy_routes.conf" as *u8
34const RD_VT: *u8 = "/volume1/homes/elderwesto/nishihost/sites_generated.conf" as *u8
35const RD_DEF_CHAIN: *u8 = "/volume1/homes/elderwesto/nishihost/certs/le_fullchain.der" as *u8
36const RD_DEF_KEY: *u8 = "/volume1/homes/elderwesto/nishihost/certs/le_ecdsa_key.bin" as *u8
46const RD_RECCAP: i64 = 20480 // one TLS record (16384 payload + header/tag slack)
47const RD_PLAINCAP: i64 = 65536 // full-request reassembly cap: headers + up to a ~63KB chunked-upload chunk

functions

38func rd_readfile(path: *u8, szbox: *i64) -> *u8 { szbox[0] = 0; return sys_read_file(path, szbox) }
called by 1: main calls 1: sys_read_file
49func rd_lower(c: u8) -> u8
called by 1: rd_content_length
54func rd_contains(hay: *u8, hlen: i64, needle: *u8, nlen: i64) -> i64
called by 1: rd_recv_request
71func rd_body_start(hay: *u8, hlen: i64) -> i64
called by 1: rd_recv_request
84func rd_content_length(req: *u8, reqn: i64) -> i64
called by 1: rd_recv_request calls 1: rd_lower
118func rd_recv_request(s: *Tls13ServerSession, cfd: i64, rec_buf: *u8, plain: *u8, plain_cap: i64) -> i64
148func rd_relay(s: *Tls13ServerSession, port: i64, plain: *u8, plain_n: i64, out_rec: *u8, cfd: i64) -> i64
175func main() -> i64