net module: production network baseline for TezzNative. Scope in v1.0: - TCP + UDP socket wrappers - DNS endpoint helpers + URL utilities - TLS socket handle wrappers - HTTP/HTTPS convenience helpers (client + minimal server helpers) - WebSocket handshake + frame helpers - Native runtime-backed URL downloader Notes: - This module is the production baseline for app/service networking. - HTTP/2, QUIC, SMTP/IMAP, and full proxy stacks remain future milestones.
fn _starts_with(s:str, p:str) -> int
fn _streq(a:str, b:str) -> int
fn _streq_nocase(a:str, b:str) -> int
fn _join2(a:str, b:str) -> str
fn _join3(a:str, b:str, c:str) -> str
fn _itoa(v:int) -> str
fn _byte_at(s:str, i:int) -> int
fn af_inet() -> int
fn af_inet6() -> int
fn sock_stream() -> int
fn sock_dgram() -> int
fn ipproto_tcp() -> int
fn ipproto_udp() -> int
fn init() -> int
fn cleanup() -> int
fn last_error() -> int
fn socket(fam:int, typ:int, proto:int) -> int
fn close(sock:int) -> int
fn connect(sock:int, host:str, port:int) -> int
fn bind(sock:int, host:str, port:int) -> int
fn listen(sock:int, backlog:int) -> int
fn accept(sock:int) -> int
fn send(sock:int, buf:*char, n:int) -> int
fn recv(sock:int, buf:*char, n:int) -> int
fn set_blocking(sock:int, on:int) -> int
fn set_timeout(sock:int, ms:int) -> int
fn resolve(host:str, port:int) -> str
fn http_port() -> int
fn https_port() -> int
fn default_timeout_ms() -> int
fn default_max_read() -> int
fn is_http_url(url:str) -> int
fn is_https_url(url:str) -> int
fn tcp_socket() -> int
fn tcp_connect(host:str, port:int) -> int
fn tcp_connect_timeout(host:str, port:int, timeout_ms:int) -> int
fn tcp_listen(host:str, port:int, backlog:int) -> int
fn tcp_send_all(sock:int, buf:*char, n:int) -> int
fn tcp_send_text(sock:int, payload:str) -> int
fn tcp_recv_all(sock:int, max_bytes:int) -> str
fn tcp_request(host:str, port:int, request:str, timeout_ms:int, max_bytes:int) -> str
fn _http_request_ex(method:str, host:str, path:str, body:str, content_type:str, extra_headers:str) -> str
fn _http_request(method:str, host:str, path:str, body:str, content_type:str) -> str
fn http_get(host:str, path:str, timeout_ms:int, max_bytes:int) -> str
fn http_post(host:str, path:str, body:str, content_type:str, timeout_ms:int, max_bytes:int) -> str
fn udp_socket() -> int
fn udp_connect(host:str, port:int) -> int
fn udp_send_text(sock:int, payload:str) -> int
fn udp_recv_text(sock:int, max_bytes:int) -> str
fn tls_open(host:str, port:int) -> int
fn tls_open_with_policy(host:str, port:int, min_version:int, handshake_timeout_ms:int, pin_sha256_hex:str) -> int
fn tls_close_h(h:int) -> int
fn tls_send_text(h:int, payload:str) -> int
fn tls_send_all(h:int, buf:*char, n:int) -> int
fn tls_recv_all(h:int, max_bytes:int) -> str
fn https_get(host:str, path:str, max_bytes:int) -> str
fn https_post(host:str, path:str, body:str, content_type:str, max_bytes:int) -> str
fn download(url:str, out_path:str) -> int
fn download_http(url:str, out_path:str) -> int
fn download_https(url:str, out_path:str) -> int
fn _tolower_ascii(c:int) -> int
fn _eq_nocase_range(s:str, from_i:int, to_i:int, name:str) -> int
fn _substr_dup(s:str, start:int, end:int) -> str
fn _parse_int_dec(s:str) -> int
fn _find_header_end_index(buf:*char, n:int) -> int
fn _recv_exact(sock:int, buf:*char, n:int) -> int
fn _contains_nocase(hay:str, needle:str) -> int
fn http_server_listen(host:str, port:int, backlog:int) -> int
fn http_server_accept(listener:int, timeout_ms:int) -> int
fn http_read_request(sock:int, max_bytes:int) -> str
fn http_method(req:str) -> str
fn http_path(req:str) -> str
fn http_version(req:str) -> str
fn http_get_header(req:str, name:str) -> str
fn http_content_length(req:str) -> int
fn http_status_text(code:int) -> str
fn http_write_response_ex(sock:int, status:int, content_type:str, body:str, extra_headers:str) -> int
fn http_write_response(sock:int, status:int, content_type:str, body:str) -> int
fn http_respond_text(sock:int, status:int, text:str) -> int
fn http_respond_json(sock:int, status:int, json:str) -> int
fn http_respond_not_found(sock:int) -> int
fn http_respond_bad_request(sock:int) -> int
fn http_route_path(path_or_req:str) -> str
fn http_route_match(path_or_req:str, pattern:str) -> int
fn http_route_request_match(req:str, method:str, pattern:str) -> int
fn _http_method_dup_norm(method:str) -> str
fn _http_route_method_match(route_method:str, req_method:str) -> int
fn _http_route_pattern_score(path:str, pattern:str) -> int
fn http_route_respond_ex_if(req:str, sock:int, method:str, pattern:str, status:int, content_type:str, body:str, extra_headers:str) -> int
fn http_route_respond_text_if(req:str, sock:int, method:str, pattern:str, status:int, text:str) -> int
fn http_route_respond_json_if(req:str, sock:int, method:str, pattern:str, status:int, json:str) -> int
fn _http_route_table_dup_str(s:str) -> str
fn _http_route_table_entry_release(e:*HttpRouteEntry) -> int
fn _http_route_table_grow(tab:*HttpRouteTable, min_cap:int) -> int
fn http_route_table_new(capacity:int) -> *HttpRouteTable
fn http_route_table_free(tab:*HttpRouteTable) -> int
fn http_route_table_count(tab:*HttpRouteTable) -> int
fn http_route_table_capacity(tab:*HttpRouteTable) -> int
fn http_route_table_clear(tab:*HttpRouteTable) -> int
fn http_route_table_add(tab:*HttpRouteTable, method:str, pattern:str, handler:*char) -> int
fn http_route_table_remove_at(tab:*HttpRouteTable, index:int) -> int
fn http_route_table_find(tab:*HttpRouteTable, req:str) -> int
fn http_route_table_match_kind(tab:*HttpRouteTable, req:str) -> int
fn http_route_table_dispatch(tab:*HttpRouteTable, sock:int, req:str) -> int
fn http_route_table_serve_or_404(tab:*HttpRouteTable, sock:int, req:str) -> int
fn http_request_start_line_valid(req:str) -> int
fn http_server_session_new(listener:int, routes:*HttpRouteTable, timeout_ms:int, max_req_bytes:int) -> *HttpServerSession
fn http_server_session_free(ses:*HttpServerSession) -> int
fn http_server_session_set_limits(ses:*HttpServerSession, max_clients:int, max_errors:int) -> int
fn http_server_session_served(ses:*HttpServerSession) -> int
fn http_server_session_errors(ses:*HttpServerSession) -> int
fn http_server_session_reset_stats(ses:*HttpServerSession) -> int
fn http_server_session_serve_once(ses:*HttpServerSession) -> int
fn http_server_session_serve_loop(ses:*HttpServerSession, max_clients:int) -> int
fn http_route_table_add_crud(tab:*HttpRouteTable, resource_path:str, create_handler:*char, read_handler:*char, update_handler:*char, delete_handler:*char) -> int
fn http_server_serve_route_once(listener:int, timeout_ms:int, max_req_bytes:int, method:str, pattern:str, status:int, content_type:str, body:str) -> int
fn http_server_serve_table_once(listener:int, timeout_ms:int, max_req_bytes:int, tab:*HttpRouteTable) -> int
fn _rotl32(x:int, shift:int) -> int
fn _sha1_bytes(data:*char, n:int, out20:*char) -> int
fn _base64_encode(data:*char, n:int) -> str
fn ws_accept_key(client_key:str) -> str
fn ws_is_upgrade_request(req:str) -> int
fn ws_server_handshake(sock:int, req:str) -> int
fn ws_send_frame(sock:int, opcode:int, payload:*char, n:int) -> int
fn ws_send_text(sock:int, text:str) -> int
fn ws_send_binary(sock:int, payload:*char, n:int) -> int
fn _drain_bytes(sock:int, n:int) -> int
fn ws_recv_frame(sock:int, max_bytes:int, opcode_out:*int) -> str
fn ws_recv_text(sock:int, max_bytes:int) -> str
fn ws_send_ping(sock:int, payload:str) -> int
fn ws_send_pong(sock:int, payload:str) -> int
fn ws_session_echo_loop(sock:int, max_bytes:int, max_frames:int) -> int
fn ws_upgrade_and_session_echo(sock:int, req:str, max_bytes:int, max_frames:int) -> int
fn dns_lookup(host:str) -> str
fn dns_lookup_port(host:str, port:int) -> str
fn dns_is_ipv4(addr:str) -> int
fn dns_is_ipv6(addr:str) -> int
fn _rfind_char(s:str, ch:int) -> int
fn dns_endpoint_host(endpoint:str) -> str
fn dns_endpoint_port(endpoint:str, default_port:int) -> int
fn dns_resolve_endpoint(endpoint:str, default_port:int) -> str
fn _find_char_from(s:str, ch:int, start:int) -> int
fn _url_scheme_end(url:str) -> int
fn url_scheme(url:str) -> str
fn _url_authority_start(url:str) -> int
fn _url_path_start(url:str) -> int
fn url_authority(url:str) -> str
fn url_host(url:str) -> str
fn url_default_port(url:str) -> int
fn url_port(url:str) -> int
fn url_path(url:str) -> str
fn url_query(url:str) -> str
fn url_fragment(url:str) -> str
fn url_path_query(url:str) -> str
fn url_is_secure(url:str) -> int
fn _is_url_unreserved(c:int) -> int
fn _hex_upper(n:int) -> int
fn _trim_range_dup(s:str, from_i:int, to_i:int) -> str
fn url_encode_component(s:str) -> str
fn url_decode_component(s:str) -> str
fn query_param(query_or_url:str, key:str) -> str
fn query_has_key(query_or_url:str, key:str) -> int
fn query_param_int(query_or_url:str, key:str, default_value:int) -> int
fn http_has_header(req:str, name:str) -> int
fn http_auth_scheme(req:str) -> str
fn http_auth_token(req:str) -> str
fn http_bearer_token(req:str) -> str
fn http_get_cookie(req:str, name:str) -> str
fn http_request_url(method:str, url:str, body:str, content_type:str, extra_headers:str, timeout_ms:int, max_bytes:int) -> str
fn http_get_url(url:str, timeout_ms:int, max_bytes:int) -> str
fn http_post_url(url:str, body:str, content_type:str, timeout_ms:int, max_bytes:int) -> str
fn http_fetch(url:str, timeout_ms:int, max_bytes:int) -> str
fn _hex_val(c:int) -> int
fn _parse_hex_slice(s:str, a:int, b:int) -> int
fn http_status_code(resp:str) -> int
fn http_reason_phrase(resp:str) -> str
fn http_response_header(resp:str, name:str) -> str
fn http_response_body(resp:str) -> str
fn http_is_chunked(resp:str) -> int
fn http_decode_chunked_body(body:str) -> str
fn http_response_body_decoded(resp:str) -> str
fn http_fetch_body(url:str, timeout_ms:int, max_bytes:int) -> str
fn dns_endpoint_join(host:str, port:int) -> str
fn tcp_recv_line(sock:int, max_bytes:int) -> str
fn http_server_serve_text_once(listener:int, max_req_bytes:int, status:int, text:str) -> int