code wiki / (root) / nx_lan_signup.nx

nx_lan_signup.nx

buildroot/runtime/nx_lan_signup.nx

3077 B40 linesdepth 12pulls 22 transitivereach 11 importersview sourcekind librarytopic lan
docsdependenciesstructsconstsfunctions

about

nx_lan_signup.nx -- the SIGNUP-ALLOWED decision, BY CONSTRUCTION. The operator's law: "signup exposed only on LAN, for the family to sign up." Two independent gates must BOTH hold before any registration is permitted: (a) the PEER SOURCE IP is LAN -- RFC1918 private (10/8, 172.16/12, 192.168/16) or loopback (127/8). A WAN client can NEVER register, regardless of any flag, because the daemon reads the real connecting address from accept() (sys_accept_with_addr) -- not a spoofable header. This is the "only on LAN" guarantee. (b) the HANDLE is INVITED in this realm's HR store (the operator provisioned it via nx_hr_admin.hra_invite). A LAN stranger with an un-provisioned handle is denied; a handle already CLAIMED (active) is denied (re-registration blocked) because a claimed record is no longer "invited". This is the "only the family". So the registration surface is closed to the world AND closed to anyone the operator did not invite -- replacing the old single global open/closed flag with an invite-governed, LAN-scoped gate. Pure decision (no I/O beyond the HR read inside hra_is_invited); the daemon supplies the 4 peer-IP octets + handle + the HR store/realm.

dependencies 2 imports · 8 importers

nx_hr_admin.nx nx_syscalls.nx nx_lan_signup.nx nx_account_admin_exceed_gate.nx nx_lan_signup_daemon.nx nx_lan_signup_gate.nx nx_lan_signup_routes.nx nx_lan_signup_socket_gate.nx nx_opaque_login_daemon.nx nx_opaque_login_routes.nx nx_realm_multi_gate.nx

imports: nx_hr_admin.nxnx_syscalls.nx

imported by: nx_account_admin_exceed_gate.nxnx_lan_signup_daemon.nxnx_lan_signup_gate.nxnx_lan_signup_routes.nxnx_lan_signup_socket_gate.nxnx_opaque_login_daemon.nxnx_opaque_login_routes.nxnx_realm_multi_gate.nx

structs

none

consts

none

functions

20func ls_ip_is_lan(ip4: *u8) -> i64
31func ls_ip4_from_sockaddr(sa: *u8, out4: *u8) -> i64 { out4[0]=sa[4]; out4[1]=sa[5]; out4[2]=sa[6]; out4[3]=sa[7]; return 0 }
called by 3: mainserve_onemain
36func ls_signup_allowed(ip4: *u8, hr_store: *u8, realm: *u8, realm_n: i64, handle: *u8, hn: i64) -> i64