|
ProtoCore v1.0.16
Deterministic, zero-heap network stack for embedded targets
|
Every capacity, buffer extent and pool borrow the enabled features are sized on. More...
Go to the source code of this file.
Macros | |
| #define | MAX_CONNS 8 |
| Maximum simultaneous TCP connections (fixed static pool; ~3.95 KB of internal RAM per slot). | |
| #define | PROTOCORE_TCP_NODELAY 1 |
| Disable Nagle's algorithm (set TCP_NODELAY) on every accepted connection. | |
| #define | PROTOCORE_BASE64_SWAR 1 |
| Use the SWAR base64 decoder (classify 4 characters per 32-bit word). Default on. | |
| #define | RX_BUF_SIZE 1024 |
| Ring-buffer capacity in bytes per connection slot (feature floors enforced last, in derived_sizing.h - a value below what an enabled feature needs is raised there). | |
| #define | CONN_TIMEOUT_MS 5000 |
| Compile-time default for connection idle timeout in milliseconds. | |
| #define | PROTOCORE_REQUEST_TIMEOUT_MS 10000 |
| Request-header read deadline in milliseconds (slow-loris defense). Default 10 s; 0 disables. | |
| #define | PROTOCORE_CLOSING_TIMEOUT_MS 2000 |
| Upper bound (ms) a slot may dwell in CONN_CLOSING after a graceful close before the idle sweep force-aborts it. | |
| #define | PROTOCORE_WORKER_COUNT 1 |
| Number of server worker tasks (slots partitioned i % N). Default 1. | |
| #define | PROTOCORE_GHOST_WORKER_SLOT (PROTOCORE_WORKER_COUNT) |
| #define | PROTOCORE_SSH_ANY 0 |
| Stack (bytes) for each server worker task (ESP32). | |
| #define | PROTOCORE_WORKER_TASK_STACK 8192 |
| #define | PROTOCORE_WORKER_STACK_RSA_MIN 8192 |
| Minimum worker-task stack (bytes) required once an RSA-2048 verifier is compiled in (OIDC / SSH). | |
| #define | PROTOCORE_WORKER_STACK_CURVE_MIN 12288 |
| Minimum worker-task stack (bytes) required once SSH is compiled in. | |
| #define | PROTOCORE_WORKER_TASK_PRIORITY 5 |
| FreeRTOS priority for each server worker task (ESP32). | |
| #define | PROTOCORE_WORKER_CORE 1 |
| Core that worker 0 pins to (ESP32). Worker k pins to (PROTOCORE_WORKER_CORE. | |
| #define | PROTOCORE_DEFER_QUEUE_DEPTH 8 |
| Depth of each worker's deferred-callback queue. | |
| #define | PROTOCORE_WORKER_POLL_TICKS 1 |
| Idle-sweep timeout, in FreeRTOS ticks, that a worker blocks between service iterations when no events are pending. | |
| #define | PROTOCORE_PQ_DEPTH 16 |
| Capacity of the preempting queue in items (static-allocated). | |
| #define | PROTOCORE_PQ_ITEM_SIZE 32 |
| Bytes per preempting-queue item (the posted item must fit). | |
| #define | PROTOCORE_PQ_STACK 4096 |
| Stack (bytes) for each preempting-queue processing task (ESP32). | |
| #define | PROTOCORE_PQ_INTERNAL_PRIORITY 8 |
| Base FreeRTOS priority for the internal preempting lanes (DMA / forwarding / device access). They run at this and just above, so internal ingest preempts the user lane; keep it above the user lane's priority and below the lwIP tcpip (18) / WiFi tasks so networking is never starved. See preempt_queue.h. | |
| #define | PROTOCORE_DMA_CHANNELS 2 |
| Number of DMA channels (static-allocated; each is one peripheral link). | |
| #define | PROTOCORE_DMA_BUF_SIZE 256 |
| Bytes per DMA transfer buffer (RX is double-buffered at this size). | |
| #define | PROTOCORE_TC_MAX_WINDOW_SAMPLES 4096 |
| HttpRoute DMA transfers through the ingress/egress simulator (default on). Set to 0 to drive real silicon via the protocore_dma_hw_* backend hooks. | |
| #define | PROTOCORE_PHY_MAX_IFACES 4 |
| Interfaces layer 1 can carry: wifi station and softAP, ethernet, a bridged bus, a radio. The registry is L1's because an interface is a physical thing; the forwarding plane reads it. | |
| #define | PROTOCORE_FWD_MAX_RULES 8 |
| Max forwarding rules (src -> dst allow/deny + rate cap; static-allocated). | |
| #define | PROTOCORE_FWD_MAX_ACL 8 |
| Max ingress access-control entries (byte-pattern permit/deny; static). | |
| #define | PROTOCORE_FWD_ACL_PATLEN 4 |
| Bytes an ACL entry can match (its pattern / mask length). | |
| #define | PROTOCORE_FWD_MAX_ROUTES 8 |
| Max policy routes (byte-pattern -> egress interface; static). Policy routes take precedence over the src->dst rules, so tagged traffic leaves a chosen interface. | |
| #define | PROTOCORE_FWD_INSPECT 0 |
| Build-time toggle for the forwarding-path inspection hook (default off, for cost + privacy). When 1, Forward.inspect.fn + Forward.set_inspector install a runtime callback that observes / filters each ingress frame before it is forwarded; when 0 the hook is compiled out entirely (no call site). Runtime toggle: register or clear (null) the inspector. | |
| #define | PROTOCORE_GW_MAX_PORTS 4 |
| Max southbound gateway ports (radios / buses; static-allocated). | |
| #define | PROTOCORE_GW_DEFAULT_PREFIX "gw" |
| Default northbound topic prefix (overridable at runtime via protocore_gateway_set_topic_prefix). | |
| #define | PROTOCORE_LORA_MAX_PAYLOAD 251 |
| Max LoRa payload bytes (SX127x FIFO is 256; RadioHead uses 251 + 4 header). | |
| #define | PROTOCORE_NRF24_PAYLOAD 32 |
| nRF24 fixed payload width in bytes (1..32; the chip's static payload size). | |
| #define | PROTOCORE_ENOCEAN_MAX_DATA 512 |
| Reject an ESP3 telegram whose declared data length exceeds this (framing sanity). | |
| #define | PROTOCORE_PN532_MAX_DATA 254 |
| Reject a PN532 normal frame whose declared length exceeds this (framing sanity). | |
| #define | PROTOCORE_SIGFOX_MAX_PAYLOAD 12 |
| Maximum Sigfox uplink payload (the network caps a message at 12 bytes). | |
| #define | PROTOCORE_ZWAVE_MAX_DATA 64 |
| Reject a Z-Wave frame whose declared length exceeds this data cap (sanity). | |
| #define | PROTOCORE_ZIGBEE_MAX_DATA 128 |
| Max ASH payload bytes (an EZSP frame; the ASH data field caps near 128). | |
| #define | PROTOCORE_THREAD_MAX_DATA 256 |
| Max spinel payload bytes carried in one HDLC-lite frame. | |
| #define | PROTOCORE_ETH_W5500 0 |
| #define | PROTOCORE_ETH_W5500_CS 7 |
| chip select | |
| #define | PROTOCORE_ETH_W5500_RST 6 |
| reset | |
| #define | PROTOCORE_ETH_W5500_INT 5 |
| interrupt | |
| #define | PROTOCORE_ETH_W5500_SCK 12 |
| HSPI clock (S3-DevKitC default) | |
| #define | PROTOCORE_ETH_W5500_MISO 13 |
| HSPI MISO (S3-DevKitC default) | |
| #define | PROTOCORE_ETH_W5500_MOSI 11 |
| HSPI MOSI (S3-DevKitC default) | |
| #define | PROTOCORE_ETH_W5500_SPI_MHZ 20 |
| W5500 SPI clock (MHz); raise for throughput on clean wiring. | |
| #define | MAX_HEADERS 8 |
| Maximum HTTP headers stored per request. | |
| #define | MAX_PATH_LEN 64 |
Maximum URL path length (including leading /). | |
| #define | MAX_KEY_LEN 32 |
Maximum header field-name length (e.g. "Content-Type"). | |
| #define | MAX_VAL_LEN 48 |
| Maximum header field-value length. | |
| #define | MAX_QUERY_LEN 128 |
Maximum raw query-string length (everything after ?). | |
| #define | MAX_QUERY_PARAMS 8 |
| Maximum number of parsed query-string parameters. | |
| #define | MAX_PATH_PARAMS 4 |
Maximum number of :name path parameters captured per route match. | |
| #define | DIGEST_AUTH_HDR_MAX 384 |
Capacity for the full Authorization header value (Digest auth). | |
| #define | PROTOCORE_DIGEST_NONCE_LIFETIME_MS (5u * 60u * 1000u) |
Lifetime of a Digest nonce, in milliseconds (default 5 minutes). | |
| #define | QUERY_KEY_LEN 24 |
| Maximum query-parameter key length. | |
| #define | QUERY_VAL_LEN 48 |
| Maximum query-parameter value length. | |
| #define | BODY_BUF_SIZE 256 |
Maximum request body bytes stored in HttpReq::body. | |
| #define | MAX_ROUTES 16 |
| Maximum simultaneously registered routes. | |
| #define | MAX_MIDDLEWARE 4 |
| Maximum globally-registered middleware functions. | |
| #define | CHUNK_BUF_SIZE 1440 |
| Per-chunk staging buffer for send_chunked()'s ChunkSource (max bytes a source produces per call, hence the largest single chunk on the wire). | |
| #define | JSON_MAX_DEPTH 8 |
| Maximum object/array nesting depth for the JsonWriter (see json.h). | |
| #define | RE_MAX_STEPS 2000 |
| Step budget for the regex route matcher (see on_regex()). | |
| #define | MAX_WS_CONNS 2 |
| Maximum simultaneous WebSocket connections. | |
| #define | WS_FRAME_SIZE 512 |
| Maximum WebSocket frame payload in bytes. | |
| #define | PROTOCORE_WS_DEFLATE_MAX WS_FRAME_SIZE |
| Largest outbound payload permessage-deflate will compress, in bytes. | |
| #define | MAX_SSE_CONNS 2 |
| Maximum simultaneous SSE connections. | |
| #define | SSE_BUF_SIZE 256 |
| Output buffer size in bytes for a single SSE event. | |
| #define | FILE_CHUNK_SIZE 1024 |
| Bytes read from the filesystem and passed to tcp_write() per loop(). | |
| #define | MAX_AUTH_LEN 32 |
| Maximum username or password length for HTTP Basic Authentication. | |
| #define | MAX_MULTIPART_PARTS 4 |
| Maximum simultaneously parsed multipart parts per request. | |
| #define | MAX_BOUNDARY_LEN 72 |
| Maximum MIME boundary length (RFC 2046 allows up to 70 characters). | |
| #define | EVT_QUEUE_DEPTH (MAX_CONNS * 4) |
| Depth of the FreeRTOS event queue shared between lwIP callbacks and the main-loop task. | |
| #define | RESP_HDR_BUF_SIZE 768 |
| Stack buffer for HTTP response header lines in send() / send_empty() / send_unauth() / serve_file(). | |
| #define | EXTRA_HDR_BUF_SIZE 256 |
| Per-connection buffer for app-supplied custom response headers and cookies. | |
| #define | WS_HDR_BUF_SIZE 256 |
| Stack buffer for the HTTP 101 Switching Protocols response sent during the WebSocket handshake. | |
| #define | CORS_HDR_BUF_SIZE 192 |
| Size of the pre-built CORS header block stored in PC. | |
| #define | CACHE_CONTROL_BUF_SIZE 64 |
| Size of the optional Cache-Control header line stored in PC. | |
| #define | PROTOCORE_WS_FRAG_SIZE 0 |
| WebSocket outbound fragmentation size (RFC 6455 sec 5.4), in payload bytes. 0 = off. | |
| #define | PROTOCORE_WEBDAV_BUF_SIZE 2048 |
| Buffer (BSS) for a WebDAV 207 Multi-Status response, in bytes (see PROTOCORE_ENABLE_WEBDAV). | |
| #define | PROTOCORE_WEBDAV_MAX_ENTRIES 32 |
| Maximum children listed in a WebDAV Depth-1 PROPFIND (bounds the response). | |
| #define | PROTOCORE_DAV_MAX_DEPTH 8 |
| Deepest tree a WebDAV DELETE / COPY walks before refusing (see PROTOCORE_ENABLE_WEBDAV). | |
| #define | PROTOCORE_WEBDAV_MAX_PROPS 16 |
| Maximum properties echoed in a WebDAV PROPPATCH 207 response (bounds the response). | |
| #define | PROTOCORE_METHOD_BUF_SIZE 8 |
| HTTP method-token buffer size (bytes, including the NUL). | |
| #define | PROTOCORE_STOMP_MAX_HEADERS 16 |
| Max header lines parsed per STOMP frame (extras beyond this are ignored). | |
| #define | PROTOCORE_SIMATIC_BLOCK_MAX 256 |
| 3964R block-body buffer size (built/received bytes: DLE-stuffed payload + DLE ETX + BCC). | |
| #define | PROTOCORE_SIMATIC_QVZ_MS 2000 |
| 3964R QVZ (Quittungsverzugszeit): handshake acknowledge-delay timeout, ms. Siemens AcknDelayTime, default 16#07D0. | |
| #define | PROTOCORE_SIMATIC_ZVZ_MS 220 |
| 3964R ZVZ (Zeichenverzugszeit): inter-character timeout while receiving a block, ms. Siemens CharacterDelayTime, default 16#00DC. | |
| #define | PROTOCORE_SPB_METRIC_MAX 256 |
| Max serialized size of one Sparkplug B metric submessage (stack temp, bytes). | |
| #define | PROTOCORE_MODBUS_COILS 64 |
| Number of Modbus coils (FC 1/5/15), single-bit R/W (BSS, bit-packed). | |
| #define | PROTOCORE_MODBUS_DISCRETE_INPUTS 64 |
| Number of Modbus discrete inputs (FC 2), single-bit read-only (BSS, bit-packed). | |
| #define | PROTOCORE_MODBUS_HOLDING_REGS 64 |
| Number of Modbus holding registers (FC 3/6/16), 16-bit R/W (BSS). | |
| #define | PROTOCORE_MODBUS_INPUT_REGS 64 |
| Number of Modbus input registers (FC 4), 16-bit read-only (BSS). | |
| #define | MAX_TLS_CONNS 1 |
| Maximum simultaneous TLS connections (each holds mbedTLS record buffers). | |
| #define | PROTOCORE_TLS_TICKET_LIFETIME_S 86400 |
| Session-ticket lifetime / key-rotation period in seconds (see PROTOCORE_ENABLE_TLS_RESUMPTION). | |
| #define | PROTOCORE_MTLS_SUBJECT_MAX 128 |
| Maximum length of a verified mTLS peer subject DN string (incl. NUL). | |
| #define | PROTOCORE_SNMP_TRAP_MAX_VARBINDS 8 |
| Maximum extra variable-bindings (beyond sysUpTime/snmpTrapOID) in one notification. | |
| #define | PROTOCORE_SNMP_TRAP_BUF_SIZE 1024 |
| Static datagram buffer for an outbound SNMP notification, bytes. | |
| #define | SNMP_MAX_OID_LEN 32 |
| Maximum sub-identifiers (arcs) in an SNMP object identifier. | |
| #define | SNMP_MAX_MIB_ENTRIES 16 |
| Maximum registered MIB objects (the agent's fixed OID table). | |
| #define | SNMP_MAX_VARBINDS 16 |
| Maximum variable bindings the agent will emit in one response. | |
| #define | SNMP_MSG_BUF_SIZE 1472 |
| Static request/response datagram buffers for the SNMP UDP agent. | |
| #define | SNMP_COMMUNITY_MAX 32 |
| Maximum SNMP community-string length (including null terminator). | |
| #define | PROTOCORE_SNMP_DEFAULT_RO_COMMUNITY "public" |
| Default read-only community (overridable at runtime via SnmpAgent.community.ro + SnmpAgent.init). Deployments SHOULD change this from the RFC-1157 well-known "public" for anything but a closed network. | |
| #define | SNMP_V3_USER_MAX 32 |
| Maximum SNMPv3 USM user-name length (including null terminator). | |
| #define | SNMP_V3_ENGINEID_MAX 32 |
| Maximum SNMPv3 authoritative engine-ID length in bytes (RFC 3411 allows 5..32). | |
| #define | PROTOCORE_COAP_MAX_OBSERVERS 4 |
| Maximum simultaneous CoAP observers (one slot per observed resource per client). | |
| #define | PROTOCORE_COAP_DEDUP_ENTRIES 4 |
| CoAP message de-duplication cache size (RFC 7252 sec 4.5). A Confirmable request the server has already answered is recognized by its (source endpoint, Message-ID) and re-answered with the cached response WITHOUT re-running the handler - so a client's CON retransmission cannot execute a non-idempotent request (POST/PUT/DELETE) twice. Set to 0 to compile the dedup cache out. | |
| #define | PROTOCORE_COAP_DEDUP_RESP_MAX 256 |
| Largest cached response the dedup cache retains per entry; a bigger response is not cached (a retransmission re-processes it, fine for the idempotent GET whose block-wise reply exceeds this). | |
| #define | PROTOCORE_COAP_DEDUP_LIFETIME_MS 247000u |
| How long (ms) a dedup entry stays fresh - RFC 7252 EXCHANGE_LIFETIME (~247 s) by default, past which a repeat Message-ID is treated as a new exchange. | |
| #define | PROTOCORE_COAP_BLOCK_SZX_MAX 6 |
| Largest block-size exponent (SZX) the server will use: block size = 2^(SZX+4) bytes, SZX 0..6 (16..1024). | |
| #define | PROTOCORE_COAP_BLOCK1_MAX 1024 |
| Reassembly buffer for a block-wise (Block1) request upload, in bytes. | |
| #define | PROTOCORE_COAP_MAX_RESOURCES 8 |
| Maximum registered CoAP resources (the server's fixed routing table). | |
| #define | PROTOCORE_COAP_MAX_PATH 64 |
| Maximum reconstructed Uri-Path length, including separators and the leading '/'. | |
| #define | PROTOCORE_COAP_MAX_QUERY 64 |
| Maximum reconstructed Uri-Query length (segments joined by '&'). | |
| #define | PROTOCORE_COAP_MAX_PAYLOAD 256 |
| Maximum CoAP request/response payload in bytes. | |
| #define | PROTOCORE_COAP_MSG_BUF_SIZE 512 |
| Static response-datagram buffer for the CoAP UDP server. | |
| #define | PROTOCORE_COAP_OBSERVE_PORT 5683 |
| Default UDP port the CoAP observe transport notifies from (IANA well-known 5683). | |
| #define | PROTOCORE_TLS_ARENA_SIZE (49152 + (MAX_TLS_CONNS - 1) * 32768) |
| Bytes of the static BSS arena mbedTLS allocates from (PROTOCORE_ENABLE_TLS). | |
| #define | PROTOCORE_TLS_ARENA_IN_PSRAM 0 |
| Place the TLS arena in external PSRAM instead of internal DRAM (ESP32). | |
| #define | PROTOCORE_TLS_MAX_FRAG_LEN 0 |
| Cap TLS records via the Maximum Fragment Length extension (RFC 6066). | |
| #define | PROTOCORE_TLS_ECDHE_PREFER_P256 PROTOCORE_HW_ECC |
| Lead the ECDHE curve/group preference with secp256r1 (P-256) instead of x25519. | |
| #define | PROTOCORE_TLS_ACK_MULTI_CONN_DRAM 0 |
| Acknowledge that a MAX_TLS_CONNS > 1 build has been sized to fit. | |
| #define | PROTOCORE_MDNS_MAX_SERVICES 4 |
Services the responder advertises at once, _http._tcp included. | |
| #define | PROTOCORE_MDNS_TXT_MAX 128 |
Bytes of packed key=value TXT strings, each with its own length byte ahead of it. | |
| #define | PROTOCORE_MDNS_LABEL_MAX 32 |
| Longest host label, service type or proto label the responder holds, NUL included. | |
| #define | PROTOCORE_MDNS_TX_MAX 512 |
| Response datagram the responder composes. | |
| #define | PROTOCORE_NTP_CLIENT_PORT 1123 |
| Local UDP port the portable SNTP client asks from. | |
| #define | PROTOCORE_NTP_SERVER_STRATUM 3 |
| Stratum the NTP server advertises (distance from a reference clock; 1-15). | |
| #define | PROTOCORE_DNS_SERVER_MAX_RECORDS 8 |
| Max A records in the DNS server's fixed table. | |
| #define | PROTOCORE_DNS_SERVER_TTL 60 |
| TTL (seconds) the DNS server puts on its answers. | |
| #define | PROTOCORE_DNS_NAME_MAX 128 |
| Max length of a queried/stored DNS name (bytes, incl NUL). | |
| #define | PROTOCORE_ENABLE_HTTP_CLOCK 0 |
Auto-inject a Date response header (RFC 7231 7.1.1.2) when a wall-clock time is available. | |
| #define | PROTOCORE_TIME_SOURCE_MAX 4 |
| Maximum registered time sources (PROTOCORE_ENABLE_TIME_SOURCE). | |
| #define | PROTOCORE_I2C_SDA_PIN -1 |
| Shared I2C bus pins for the sensor / peripheral drivers (RTC, SHT3x, MPR121, ADS1115, INA219, PCA9685). All of them share one bus via protocore_i2c_begin() (server/peripherals/i2c.h), so this is the single place to move it. The default -1 uses the platform's default pins (GPIO 21 SDA / 22 SCL on the classic ESP32). Set both to free GPIOs when those pins are taken - most importantly a wired-Ethernet PHY: the LAN8720 RMII uses GPIO 21 (TX_EN) and GPIO 22 (TXD1) on the classic ESP32 (WROOM/WROVER) and the ESP32-P4 (which have the RMII EMAC), so with that Ethernet on, move the I2C bus off them (e.g. 32 / 33). The ESP32-S3/C3 have no RMII MAC and use an SPI Ethernet (W5500) instead - relocate the bus off whatever SPI pins that uses. UART peripherals (LD2410) take their RX/TX pins at protocore_ld2410_begin(), so remap those too. | |
| #define | PROTOCORE_I2C_SCL_PIN -1 |
| #define | PROTOCORE_SPI_MOSI_PIN -1 |
| Shared SPI bus pins for the peripheral drivers, the same way the I2C pins above are shared. The default -1 uses the platform's default pins for its VSPI/HSPI host. Set them when those pins are taken, most often by a W5500 SPI Ethernet on a part with no RMII MAC (the ESP32-S3 / C3), which drives this same bus. | |
| #define | PROTOCORE_SPI_MISO_PIN -1 |
| #define | PROTOCORE_SPI_SCLK_PIN -1 |
| #define | PROTOCORE_RTC_I2C_ADDR 0x68 |
| I2C address of the RTC (DS1307/DS3231 are fixed at 0x68). | |
| #define | PROTOCORE_HMMD_BAUD 115200 |
| HMMD UART baud rate (the module's factory default is 115200). | |
| #define | PROTOCORE_HMMD_UART 2 |
| UART unit the HMMD is wired to. Unit 2 is the one free of the console on most boards. | |
| #define | PROTOCORE_LD2410_BAUD 256000 |
| LD2410 UART baud rate (the module's fixed factory default is 256000). | |
| #define | PROTOCORE_LD2410_UART 2 |
| UART unit the LD2410 is wired to. Unit 2 is the one free of the console on most boards. | |
| #define | PROTOCORE_SEN0192_PIN 4 |
| GPIO the SEN0192 OUT line is wired to. | |
| #define | PROTOCORE_SEN0192_HOLD_MS 2000 |
| Presence is held this many ms after the last active (motion) sample before it clears. | |
| #define | PROTOCORE_SEN0192_ACTIVE_HIGH 1 |
| SEN0192 OUT polarity: 1 = the OUT line reads HIGH on motion, 0 = active-LOW. | |
| #define | PROTOCORE_MPR121_I2C_ADDR 0x5A |
| I2C address of the MPR121 (0x5A default; 0x5B/0x5C/0x5D via the ADDR pin). | |
| #define | PROTOCORE_MPR121_TOUCH_THRESHOLD 12 |
| MPR121 per-electrode touch threshold (delta counts from baseline; NXP AN3944 suggests ~4..12). Higher = less sensitive. Keep the release threshold below it for hysteresis. | |
| #define | PROTOCORE_MPR121_RELEASE_THRESHOLD 6 |
| MPR121 per-electrode release threshold (delta counts; should be below the touch threshold). | |
| #define | PROTOCORE_SHT3X_I2C_ADDR 0x44 |
| I2C address of the SHT3x (0x44 with ADDR low; 0x45 with ADDR high). | |
| #define | PROTOCORE_PCA9685_I2C_ADDR 0x40 |
| I2C address of the PCA9685 (0x40 default; the six address pins select 0x40..0x7F). | |
| #define | PROTOCORE_PCA9685_FREQ 50 |
| Default PWM output frequency in Hz (50 Hz suits hobby servos). | |
| #define | PROTOCORE_ADS1115_I2C_ADDR 0x48 |
| I2C address of the ADS1115 (0x48 with ADDR to GND; 0x49/0x4A/0x4B for VDD/SDA/SCL). | |
| #define | PROTOCORE_ADS1115_GAIN 2 |
| Default ADS1115 PGA gain code (ADS1115_GAIN_*): 0=+/-6.144V, 1=+/-4.096V, 2=+/-2.048V (default), 3=+/-1.024V, 4=+/-0.512V, 5=+/-0.256V. Also the fallback when a read passes an invalid gain. | |
| #define | PROTOCORE_ADS1115_DR 4 |
| Default ADS1115 data-rate code (ADS1115_DR_*): 0=8, 1=16, 2=32, 3=64, 4=128 (default), 5=250, 6=475, 7=860 SPS. The single-shot read waits the matching conversion time. | |
| #define | PROTOCORE_ADS1115_DIFFERENTIAL 0 |
| ADS1115 input mode: 0 = single-ended (AINx vs GND), 1 = differential. In differential mode the channel selects the pair: 0=AIN0-AIN1, 1=AIN0-AIN3, 2=AIN1-AIN3, 3=AIN2-AIN3. | |
| #define | PROTOCORE_INA219_I2C_ADDR 0x40 |
| I2C address of the INA219 (0x40 default; the A0/A1 pins select 0x40..0x4F). | |
| #define | PROTOCORE_INA219_CURRENT_LSB_UA 100 |
| Default INA219 current LSB in microamps per bit (calibration input). The fallback when Ina219.begin is passed 0. 100 uA/bit with a 100 mohm shunt -> a 2 A full-scale range. | |
| #define | PROTOCORE_INA219_SHUNT_MOHM 100 |
| Default INA219 shunt resistance in milliohms (calibration input). The fallback when Ina219.begin is passed 0. 100 mohm is the common breakout value. | |
| #define | PROTOCORE_CONFIG_MAX_ENTRIES 16 |
| Max key/value entries in the host (test) config backend. | |
| #define | PROTOCORE_CONFIG_KEY_MAX 16 |
| Max key length incl. null (NVS caps keys at 15 chars). | |
| #define | PROTOCORE_CONFIG_VAL_MAX 2048 |
| Max value bytes per entry in the host (test) config backend. | |
| #define | PROTOCORE_THEMES_INCLUDE_TRADEMARKED 1 |
| Include the trademark-named themes in the embedded set (default on / open-source). | |
| #define | PROTOCORE_DASHBOARD_MAX_WIDGETS 16 |
| Maximum widgets in the dashboard table (BSS value array). | |
| #define | PROTOCORE_DASHBOARD_JSON_BUF 1024 |
| Stack buffer for the dashboard layout / values JSON (bytes). | |
| #define | PROTOCORE_PARTITION_MAX 16 |
| Maximum partitions the monitor reports (BSS table). | |
| #define | PROTOCORE_PARTITION_JSON_BUF 1024 |
| Stack buffer for the partition-map JSON (bytes). | |
| #define | PROTOCORE_GPIO_MAX 40 |
| Maximum GPIO pins the mapper reports (BSS table). | |
| #define | PROTOCORE_GPIO_JSON_BUF 1024 |
| Stack buffer for the GPIO-map JSON (bytes). | |
| #define | PROTOCORE_UDP_TELEMETRY_BUF 256 |
| Stack buffer for one telemetry line (bytes). | |
| #define | PROTOCORE_STATSD_PORT 8125 |
| Default StatsD collector UDP port (StatsD/Graphite standard). | |
| #define | PROTOCORE_STATSD_LINE_MAX 256 |
| Stack buffer for one StatsD line (bytes; caps metric name + value + tags). | |
| #define | PROTOCORE_GUARDRAIL_HEAP_MIN 8192 |
| Free-heap floor (bytes); below this trips the heap guardrail. | |
| #define | PROTOCORE_GUARDRAIL_FRAG_MIN_BLOCK 4096 |
| Largest-free-block floor (bytes); below this trips the fragmentation guardrail. | |
| #define | PROTOCORE_GUARDRAIL_STACK_MIN 512 |
| Task remaining-stack floor (bytes); below this trips the stack guardrail. | |
| #define | PROTOCORE_FAILSAFE_MAX_LIFELINES 8 |
| Max monitored lifelines in the fail-safe registry (static, zero-heap). | |
| #define | PROTOCORE_POWER_MHZ_MAX 240 |
| CPU clock (MHz) when there is work to do. | |
| #define | PROTOCORE_POWER_MHZ_MIN 80 |
| CPU clock (MHz) when idle, thermally throttled, or recovering from a brownout. | |
| #define | PROTOCORE_POWER_BUSY_PCT 40 |
| Load percentage at/above which the ceiling clock is used. | |
| #define | PROTOCORE_POWER_TEMP_HOT_C 80 |
| Die temperature (C) at/above which the clock is throttled. | |
| #define | PROTOCORE_POWER_TEMP_COOL_C 70 |
| Die temperature (C) at/below which the throttle is released. | |
| #define | PROTOCORE_POWER_RECOVER_MS 10000 |
| How long (ms) to hold the floor clock after a brownout reset before ramping back up. | |
| #define | PROTOCORE_HOTSWAP_FAIL_THRESHOLD 3 |
| Consecutive I/O failures that declare a removable volume gone. | |
| #define | PROTOCORE_HOTSWAP_PROBE_MS 2000 |
| Minimum gap between remount attempts while a volume is absent or faulted (ms). | |
| #define | PROTOCORE_MTC_SAMPLE_BUFFER 32 |
| MTConnect rolling sample buffer sizing (PROTOCORE_ENABLE_MTCONNECT). | |
| #define | PROTOCORE_MTC_STR_MAX 24 |
| #define | PROTOCORE_MTC_TS_MAX 32 |
| #define | PROTOCORE_MTC_VAL_MAX 32 |
| #define | PROTOCORE_MTCONNECT_BORROW |
| The bytes an MTConnect document runs out of: the running context and the observation ring. | |
| #define | PROTOCORE_PLAINTEXT_WORK_MTCONNECT 0 |
| #define | PROTOCORE_DNC_LINE_MAX 128 |
| Largest G-code block (one line) the DNC decoder reassembles (PROTOCORE_ENABLE_DNC). | |
| #define | PROTOCORE_DNC_LEADER_LEN 32 |
| Default leader/trailer runout length for the DNC encoder (PROTOCORE_ENABLE_DNC). | |
| #define | PROTOCORE_DNC_XOFF_MAX_POLLS 200000 |
| Safety cap on how many times the DNC stream engine polls the reverse channel while paused by an XOFF, before giving up with an I/O error (PROTOCORE_ENABLE_DNC). | |
| #define | PROTOCORE_BRIDGE_MAX_RULES 8 |
| Max concurrent address:port -> bus rules (server/net/iface_bridge). | |
| #define | PROTOCORE_BRIDGE_TXN_MAX 256 |
| Max write / read payload (bytes) per TRANSACTION frame (server/net/iface_bridge). | |
| #define | PROTOCORE_BRIDGE_STREAM_CHUNK 256 |
| STREAM (UART) pipe chunk size (bytes) for server/net/iface_bridge - one socket<->UART hop. | |
| #define | PROTOCORE_BRIDGE_MAX_DRAIN 8 |
| Chunks a STREAM target moves per poll before yielding, bounding the UART drain loop. | |
| #define | PROTOCORE_BRIDGE_UART_TXN_MS 50 |
| UART TRANSACTION read window (ms): how long a write-then-read waits for the read_len reply. | |
| #define | PROTOCORE_NTRIP_MAX_ROVERS 4 |
| Max concurrent rover connections a caster serves corrections to (services/timing_position/gnss). | |
| #define | PROTOCORE_ENABLE_NTRIP_CASTER_NEEDS_NMEA0183 PROTOCORE_ENABLE_NMEA0183 |
| #define | PROTOCORE_NTRIP_MOUNT_MAX 32 |
| Max length (incl. NUL) of an NTRIP mountpoint name the caster serves. | |
| #define | PROTOCORE_NTRIP_REQ_MAX 512 |
| Max NTRIP client request size (bytes) the caster buffers while reading the request headers. | |
| #define | PROTOCORE_NTRIP_MAX_MOUNTS 2 |
| Max distinct mountpoints a single caster serves (each = one RTCM stream). | |
| #define | PROTOCORE_RELAY_BUF 2048 |
| Per-direction relay buffer size (bytes) for server/net/relay (PROTOCORE_ENABLE_RELAY). | |
| #define | PROTOCORE_RELAY_DRAIN_MAX 8 |
| Max protocore_relay_step passes per poll for the relay listener (PROTOCORE_ENABLE_RELAY). | |
| #define | PROTOCORE_RELAY_MAX_PUBLISH 4 |
| Max published relay ports (bind table size) for the relay listener (PROTOCORE_ENABLE_RELAY). | |
| #define | PROTOCORE_RELAY_MAX_CONNS 4 |
| Max concurrent relayed connections (bridge table size) for the relay listener (PROTOCORE_ENABLE_RELAY). Each holds a protocore_relay (two PROTOCORE_RELAY_BUF buffers) + an origin slot. | |
| #define | PROTOCORE_RELAY_HOST_MAX 64 |
| Max origin hostname length (bytes, incl. NUL) stored per published relay port. | |
| #define | PROTOCORE_RELAY_CONNECT_MS 5000 |
| Blocking connect timeout (ms) when the relay listener dials the origin on a new inbound. | |
| #define | PROTOCORE_FTP_CMD_MAX 256 |
| Suggested FTP control-command buffer size (PROTOCORE_ENABLE_FTP). | |
| #define | PROTOCORE_FTP_REPLY_BUF 512 |
| Control-reply accumulator for the FTP session driver (PROTOCORE_ENABLE_FTP_SESSION). | |
| #define | PROTOCORE_FTP_CHUNK 512 |
| Bytes staged per data-channel write when the session driver streams a payload. | |
| #define | PROTOCORE_FTP_TIMEOUT_MS 8000 |
| Per-step timeout for the FTP session driver: connect, and each control reply. | |
| #define | PROTOCORE_EDGE_SD_VALUE_MAX |
| Worst-case serialized L2 entry (edge_sd_serialize). | |
| #define | PROTOCORE_EDGE_MESH_TRAILER (8 /*date*/ + 8 /*expires*/ + 4 /*lifetime_s*/ + 4 /*age_hdr*/ + 4 /*age*/) |
| Fixed timing trailer prepended to a mesh entry frame (age propagation). | |
| #define | PROTOCORE_EDGE_MESH_ENTRY_MAX (PROTOCORE_EDGE_MESH_TRAILER + PROTOCORE_EDGE_SD_VALUE_MAX) |
| Worst-case mesh entry frame (trailer + a full serialized entry). | |
| #define | PROTOCORE_EDGE_MESH_RESP_MAX (2 + 1 + 1 + 2 + PROTOCORE_EDGE_MESH_ENTRY_MAX) |
| Worst-case mesh response frame (header + entry on a HIT). | |
| #define | PROTOCORE_EDGE_MESH_REQ_MAX (2 + 1 + 1 + 32 + 2 + PROTOCORE_EDGE_KEY_MAX + 2 + PROTOCORE_MESH_HDRS_MAX) |
| Worst-case mesh request frame (bounded request-header snapshot for Vary matching). | |
| #define | PROTOCORE_EDGE_FETCH_BUF_MIN 2560 |
| #define | PROTOCORE_EDGE_KEY_MAX 128 |
| #define | PROTOCORE_EDGE_VARY_MAX 64 |
| #define | PROTOCORE_EDGE_CTYPE_MAX 64 |
| Stored Content-Type to replay. | |
| #define | PROTOCORE_EDGE_ETAG_MAX 64 |
| Stored validator (ETag, quotes included). | |
| #define | PROTOCORE_EDGE_LASTMOD_MAX 40 |
| Stored Last-Modified (RFC 1123 date). | |
| #define | PROTOCORE_EDGE_CENC_MAX 32 |
| Stored Content-Encoding to replay (e.g. gzip). | |
| #define | PROTOCORE_EDGE_MAP_MAX 4 |
| #define | PROTOCORE_EDGE_ORIGIN_URL_MAX 128 |
| #define | PROTOCORE_EDGE_FETCH_BUF PROTOCORE_EDGE_FETCH_BUF_MIN |
| #define | PROTOCORE_EDGE_FETCH_TIMEOUT_MS 8000 |
| #define | PROTOCORE_EDGE_DEFAULT_TTL_S 60 |
| #define | PROTOCORE_SMB_BUF 1024 |
| SMB2 client work-buffer size (bytes) for smb_client's request/response framing. | |
| #define | PROTOCORE_EXC_COREDUMP_CHUNK 512 |
| Chunk the core-dump image is streamed out of flash in (PROTOCORE_EXC_COREDUMP_CHUNK). | |
| #define | PROTOCORE_DELIVERY_PRECACHE_MAX 16 |
| Most asset paths a service-worker precache manifest may list (PROTOCORE_DELIVERY_PRECACHE_MAX). | |
| #define | PROTOCORE_DELIVERY_MANIFEST_BUF 512 |
| Buffer the precache manifest JSON is built into (PROTOCORE_DELIVERY_MANIFEST_BUF). | |
| #define | PROTOCORE_WIFI_SNIFFER_MAX_CHANNELS 14 |
| Channels tracked by the WiFi sniffer's per-channel survey (PROTOCORE_WIFI_SNIFFER_MAX_CHANNELS). | |
| #define | PROTOCORE_FDC2214_I2C_ADDR 0x2A |
| I2C address of the FDC2214, set by the ADDR pin: 0x2A when it is low, 0x2B when it is high. | |
| #define | PROTOCORE_LDC1614_I2C_ADDR 0x2A |
| I2C address of the LDC1614, set by the ADDR pin: 0x2A when it is low, 0x2B when it is high. | |
| #define | PROTOCORE_VL53L0X_I2C_ADDR 0x29 |
| I2C address of the VL53L0X. DS11555 gives the device address as 0x52, which is the 8-bit form with the R/W bit in it; on a 7-bit API that is 0x29. | |
| #define | PROTOCORE_LOG_LINES 32 |
| Number of log lines retained in the ring. | |
| #define | PROTOCORE_LOG_LINE_LEN 96 |
| Maximum length of one stored log line (bytes, including null). | |
| #define | PROTOCORE_LOG_LEVEL_DEBUG 0 |
| Compile-time severity floor for the PROTOCORE_LOG* macros (shared/log/log.h). | |
| #define | PROTOCORE_LOG_LEVEL_INFO 1 |
| #define | PROTOCORE_LOG_LEVEL_WARN 2 |
| #define | PROTOCORE_LOG_LEVEL_ERROR 3 |
| #define | PROTOCORE_LOG_LEVEL_NONE 4 |
| #define | PROTOCORE_LOG_LEVEL PROTOCORE_LOG_LEVEL_NONE |
| Lowest severity the PROTOCORE_LOG* macros emit code for. | |
| #define | PROTOCORE_OTA_CONFIRM_WINDOW_MS 30000 |
| Confirm window (ms): a pending image not confirmed within this rolls back. | |
| #define | PROTOCORE_RADIO_WIFI_PS 0 |
| WiFi modem-sleep mode: 0 = none (max perf), 1 = min modem, 2 = max modem. | |
| #define | PROTOCORE_RADIO_MAX_TX_DBM 0 |
| Max TX power cap in dBm (2..20); 0 = leave the platform default. | |
| #define | PROTOCORE_DNS_SERVER "9.9.9.9" |
| DNS resolve timeout in milliseconds. | |
| #define | PROTOCORE_DNS_CLIENT_PORT 1153 |
| Local UDP port the portable resolver asks from and hears the answer on. | |
| #define | PROTOCORE_DNS_TIMEOUT_MS 5000 |
| #define | PROTOCORE_OIDC_MAX_LEN 1600 |
| Max accepted OIDC ID-token length (also sizes the Authorization buffer). | |
| #define | PROTOCORE_UMATI_NS 1 |
| NamespaceIndex the umati MachineTool nodes live at (default 1). | |
| #define | PROTOCORE_ROBOTICS_NS 1 |
| NamespaceIndex the robotics MotionDeviceSystem nodes live at (default 1). | |
| #define | PROTOCORE_ROBOTICS_AXES 6 |
| Number of Axes the robotics MotionDevice exposes (default 6; must fit PROTOCORE_OPCUA_REF_MAX). | |
| #define | PROTOCORE_EM77_NS 1 |
| NamespaceIndex the EUROMAP 77 IMM_MES_Interface nodes live at (default 1). | |
| #define | PROTOCORE_SYSLOG_MSG_MAX 256 |
| Maximum formatted syslog datagram length in bytes (RFC 5424 line). | |
| #define | PROTOCORE_SYSLOG_FIELD_MAX 32 |
| Maximum syslog HOSTNAME / APP-NAME field length (including NUL). | |
| #define | PROTOCORE_SYSLOG_DEFAULT_PORT 514 |
| Default syslog collector UDP port (RFC 5426 well-known 514; overridable at runtime via Syslog.collector.port + Syslog.init and here for a non-standard collector). | |
| #define | PROTOCORE_JWT_MAX_LEN 512 |
| Maximum accepted JWT length in bytes (header.payload.signature). | |
| #define | PROTOCORE_HTTP_CLIENT_BUF_SIZE 2048 |
| Receive buffer (and max response size) for the outbound HTTP client, bytes. | |
| #define | PROTOCORE_HTTP_CLIENT_TIMEOUT_MS 8000 |
| Outbound HTTP client connect/response timeout in milliseconds. | |
| #define | PROTOCORE_SMTP_LINE_MAX 256 |
| Max length of one SMTP command / address line (bytes, incl. CRLF). | |
| #define | PROTOCORE_SMTP_MSG_MAX 2048 |
| Max size of the assembled DATA payload (headers + dot-stuffed body), bytes. | |
| #define | PROTOCORE_SMTP_REPLY_MAX 512 |
| Max size of one (possibly multi-line) server reply held while parsing, bytes. | |
| #define | PROTOCORE_SMTP_TIMEOUT_MS 10000 |
| SMTP connect / per-reply timeout in milliseconds. | |
| #define | PROTOCORE_SMTP_CT_BUF_SIZE 4096 |
| Ciphertext receive-ring size for SMTPS, bytes (only used when the message is TLS). | |
| #define | PROTOCORE_MQTT_BUF_SIZE 1024 |
| MQTT packet buffer size in bytes (bounds one outgoing/incoming packet). | |
| #define | PROTOCORE_MQTT_CONNECT_MS 8000 |
| What the whole MQTT connect is given, in milliseconds. | |
| #define | PROTOCORE_MQTT_KEEPALIVE_S 30 |
| Default MQTT keep-alive interval in seconds (PINGREQ cadence / CONNECT field). | |
| #define | PROTOCORE_MQTT_CT_BUF_SIZE 4096 |
| Ciphertext receive-ring size for MQTTS (draining ring; must exceed one TCP_MSS). | |
| #define | PROTOCORE_MQTT_MAX_TOPIC 128 |
| Maximum inbound MQTT topic length (including NUL) delivered to the callback. | |
| #define | PROTOCORE_MQTT_MAX_INFLIGHT 4 |
| Outbound QoS 1/2 in-flight slots (unacknowledged exchanges awaiting their acknowledgement). | |
| #define | PROTOCORE_MQTT_RETRANSMIT_MS 5000 |
| Retransmit timeout (ms) for an unacknowledged in-flight QoS 1/2 message. | |
| #define | PROTOCORE_MQTT_RX_QOS2_SLOTS 8 |
| Inbound QoS 2 packet-id de-duplication ring depth (PUBREC-acknowledged, awaiting PUBREL). | |
| #define | PROTOCORE_WS_CLIENT_BUF_SIZE 1024 |
| WebSocket client send/receive buffer size in bytes (bounds one frame). | |
| #define | PROTOCORE_WS_CLIENT_CT_BUF_SIZE 4096 |
| Ciphertext receive-ring size for wss:// (draining ring; must exceed one TCP_MSS). | |
| #define | PROTOCORE_ENABLE_HTTP_CLIENT_NEEDS_TCP_CLIENT PROTOCORE_ENABLE_TCP_CLIENT |
| #define | PROTOCORE_ENABLE_MQTT_NEEDS_TCP_CLIENT PROTOCORE_ENABLE_TCP_CLIENT |
| #define | PROTOCORE_ENABLE_WS_CLIENT_NEEDS_TCP_CLIENT PROTOCORE_ENABLE_TCP_CLIENT |
| #define | PROTOCORE_ENABLE_RELAY_NEEDS_TCP_CLIENT PROTOCORE_ENABLE_TCP_CLIENT |
| #define | PROTOCORE_ENABLE_SMTP_NEEDS_TCP_CLIENT PROTOCORE_ENABLE_TCP_CLIENT |
| #define | PROTOCORE_ENABLE_SMB_NEEDS_TCP_CLIENT PROTOCORE_ENABLE_TCP_CLIENT |
| #define | PROTOCORE_ENABLE_DNC_NEEDS_TCP_CLIENT PROTOCORE_ENABLE_TCP_CLIENT |
| #define | PROTOCORE_ENABLE_FTP_SESSION_NEEDS_TCP_CLIENT PROTOCORE_ENABLE_TCP_CLIENT |
| #define | PROTOCORE_ENABLE_SSH_CLIENT_NEEDS_TCP_CLIENT PROTOCORE_ENABLE_TCP_CLIENT |
| #define | PROTOCORE_SSH_PORT_FORWARD_NEEDS_TCP_CLIENT PROTOCORE_ENABLE_TCP_CLIENT |
| #define | PROTOCORE_ENABLE_TCP_CLIENT_NEEDS_DNS_RESOLVER PROTOCORE_ENABLE_DNS_RESOLVER |
| #define | PROTOCORE_ENABLE_COAP_NEEDS_UDP PROTOCORE_ENABLE_UDP |
| #define | PROTOCORE_ENABLE_DTLS_NEEDS_UDP PROTOCORE_ENABLE_UDP |
| #define | PROTOCORE_ENABLE_STATSD_NEEDS_UDP PROTOCORE_ENABLE_UDP |
| #define | PROTOCORE_ENABLE_UDP_TELEMETRY_NEEDS_UDP PROTOCORE_ENABLE_UDP |
| #define | PROTOCORE_ENABLE_SNMP_NEEDS_UDP PROTOCORE_ENABLE_UDP |
| #define | PROTOCORE_ENABLE_SNMP_TRAP_NEEDS_UDP PROTOCORE_ENABLE_UDP |
| #define | PROTOCORE_ENABLE_SNMP_V3_NEEDS_UDP PROTOCORE_ENABLE_UDP |
| #define | PROTOCORE_ENABLE_SYSLOG_NEEDS_UDP PROTOCORE_ENABLE_UDP |
| #define | PROTOCORE_ENABLE_FLOW_EXPORT_NEEDS_UDP PROTOCORE_ENABLE_UDP |
| #define | PROTOCORE_ENABLE_PROVISIONING_NEEDS_UDP PROTOCORE_ENABLE_UDP |
| #define | PROTOCORE_ENABLE_NTP_SERVER_NEEDS_UDP PROTOCORE_ENABLE_UDP |
| #define | PROTOCORE_ENABLE_DNS_SERVER_NEEDS_UDP PROTOCORE_ENABLE_UDP |
| #define | PROTOCORE_ENABLE_HTTP3_NEEDS_UDP PROTOCORE_ENABLE_UDP |
| #define | PROTOCORE_CAPTURE_AUTH_HEADER 0 |
| True when the parser must capture the full Authorization header value. | |
| #define | PROTOCORE_AUTH_HDR_CAP_OIDC 0 |
| Capacity of HttpReq::authorization (full Authorization header value). | |
| #define | PROTOCORE_AUTH_HDR_CAP_JWT 0 |
| #define | PROTOCORE_AUTH_HDR_CAP_M1 (PROTOCORE_AUTH_HDR_CAP_JWT > DIGEST_AUTH_HDR_MAX ? PROTOCORE_AUTH_HDR_CAP_JWT : DIGEST_AUTH_HDR_MAX) |
| #define | PROTOCORE_AUTH_HDR_CAP (PROTOCORE_AUTH_HDR_CAP_OIDC > PROTOCORE_AUTH_HDR_CAP_M1 ? PROTOCORE_AUTH_HDR_CAP_OIDC : PROTOCORE_AUTH_HDR_CAP_M1) |
| #define | TERM_TX_BUF_SIZE 256 |
| Stack scratch for protocore_web_terminal_println() line building. | |
| #define | PROTOCORE_KEEPALIVE_MAX_REQUESTS 100 |
| Maximum requests served on one keep-alive connection before it is closed. | |
| #define | PROTOCORE_HPACK_TABLE_BYTES 4096 |
| Per-connection HPACK dynamic-table size in bytes (our decoder; advertised to the peer as SETTINGS_HEADER_TABLE_SIZE). RFC 7541's default is 4096; lower it to save per-connection RAM (each active HTTP/2 connection holds one table). | |
| #define | PROTOCORE_HPACK_MAX_ENTRIES 128 |
| Max HPACK dynamic-table entries (>= PROTOCORE_HPACK_TABLE_BYTES / 32, the min entry size). | |
| #define | PROTOCORE_H2_MAX_FRAME 16384 |
| Largest HTTP/2 frame we accept, in bytes (advertised as SETTINGS_MAX_FRAME_SIZE). RFC 9113 requires accepting at least 16384; a whole frame is buffered for reassembly, so this (plus the HPACK table) sets the per-HTTP/2-connection RAM. Range: [16384, 16777215]. | |
| #define | PROTOCORE_H2_MAX_STREAMS 8 |
| Max concurrent HTTP/2 streams per connection (advertised as MAX_CONCURRENT_STREAMS). | |
| #define | PROTOCORE_H2_HDR_BLOCK 4096 |
| Header-block reassembly buffer for HTTP/2 requests that span HEADERS + CONTINUATION frames (a single END_HEADERS frame decodes in place and needs no copy). Caps the compressed request-header size; a larger block is rejected (RFC 9113 sec 6.10). | |
| #define | PROTOCORE_H2_MAX_CONTINUATION 8 |
| CONTINUATION frames one header block may span (RFC 9113 sec 6.10). | |
| #define | PROTOCORE_DTLS_PMTU_DEFAULT 1232 |
| Largest datagram a DTLS handshake flight will put on the wire, before a connection overrides it (RFC 9147 sec 4.3). | |
| #define | PROTOCORE_H2_POOL_IN_PSRAM 0 |
| Place the HTTP/2 connection-engine pool in external PSRAM (ESP32). | |
| #define | PROTOCORE_INTERNAL_SLOTS 0 |
| #define | CONN_POOL_SLOTS (MAX_CONNS + PROTOCORE_INTERNAL_SLOTS) |
| #define | PROTOCORE_HTTP3_PORT 443 |
| UDP port the HTTP/3 (QUIC) server binds by default (used by protocore_h3_cert). | |
| #define | PROTOCORE_H3_CRYPTO_BUF 2048 |
| Maximum bytes of one QUIC/TLS handshake CRYPTO flight (RFC 9001). | |
| #define | PROTOCORE_H3_MAX_STREAMS 8 |
| Maximum concurrent request streams per HTTP/3 connection. | |
| #define | PROTOCORE_QUIC_MAX_CONNS 2 |
| Simultaneous HTTP/3 connections. Each is a QuicConn plus an H3Conn. | |
| #define | PROTOCORE_QUIC_INGEST_RING 8 |
| Datagrams buffered from the lwIP thread until the server poll drains them. | |
| #define | PROTOCORE_QUIC_MAX_DATAGRAM 1350 |
| Largest UDP payload the QUIC transport sends or accepts (conservative, under a 1500 MTU). | |
| #define | PROTOCORE_H3_STREAM_BUF 2048 |
| per-request-stream reassembly buffer (HEADERS + DATA) | |
| #define | PROTOCORE_H3_PATH_LEN 256 |
| captured :path length cap | |
| #define | PROTOCORE_H3_AUTHORITY_LEN 128 |
| captured :authority length cap | |
| #define | PROTOCORE_H3_METHOD_LEN 16 |
| captured :method length cap | |
| #define | PROTOCORE_H3_QPACK_SCRATCH 512 |
| #define | PROTOCORE_H3_QPACK_BLOCK 256 |
| #define | PROTOCORE_QUIC_STREAM_TX 2048 |
| per-stream outbound buffer (drained into STREAM frames) | |
| #define | PROTOCORE_QUIC_CRYPTO_RX 2048 |
| per-level inbound CRYPTO reassembly window (ClientHello, Finished) | |
| #define | PROTOCORE_QUIC_MAX_STREAMS PROTOCORE_H3_MAX_STREAMS |
| tracked streams (request + control/QPACK) | |
| #define | PROTOCORE_ENFORCE_HOST_HEADER 1 |
| Enforce the RFC 7230 ยง5.4 Host-header requirement (default on). | |
| #define | PROTOCORE_SSH_ALLOW_PASSWORD 1 |
| Allow SSH password authentication (default on). | |
| #define | SSH_MAX_AUTH_ATTEMPTS 6 |
| Maximum failed SSH authentication attempts per connection. | |
| #define | PROTOCORE_SSH_PW_CHANGE_COOLDOWN_MS 60000u |
| #define | PROTOCORE_SSH_HOST_KEY_NS "ssh_host_key" |
| Where the SSH RSA host private key is stored: the NVS namespace and the item in it. | |
| #define | PROTOCORE_SSH_HOST_KEY_ITEM "priv_der" |
| #define | MAX_LISTENERS 3 |
| Maximum number of simultaneously active listener ports. | |
| #define | PROTOCORE_MAX_UDP_LISTENERS 2 |
| Maximum simultaneously bound UDP ports (transport-layer UDP service). | |
| #define | PROTOCORE_UDP_RX_BUF_SIZE 1472 |
| Largest UDP datagram a bound port accepts, in bytes. | |
| #define | PROTOCORE_UDP_RX_RING 2048 |
| Per-slot UDP receive ring, in bytes. | |
| #define | PROTOCORE_ACCEPT_THROTTLE_MAX 20 |
| Max accepted connections per throttle window (see PROTOCORE_ENABLE_ACCEPT_THROTTLE). | |
| #define | PROTOCORE_ACCEPT_THROTTLE_WINDOW_MS 1000 |
| Throttle window length in milliseconds (see PROTOCORE_ENABLE_ACCEPT_THROTTLE). | |
| #define | PROTOCORE_PER_IP_THROTTLE_SLOTS 16 |
| Number of source IPv4 addresses tracked by the per-IP throttle (BSS bucket table). | |
| #define | PROTOCORE_PER_IP_THROTTLE_MAX 10 |
| Max accepted connections per window from one source IP (see PROTOCORE_ENABLE_PER_IP_THROTTLE). | |
| #define | PROTOCORE_PER_IP_THROTTLE_WINDOW_MS 10000 |
| Per-IP throttle window length in milliseconds (see PROTOCORE_ENABLE_PER_IP_THROTTLE). | |
| #define | PROTOCORE_IP_ALLOWLIST_SLOTS 8 |
| Number of CIDR rules the source-IP allowlist can hold (BSS table). | |
| #define | PROTOCORE_TRUSTED_PROXY_MAX 2 |
| Number of trusted-upstream CIDR rules the forwarded-client resolver holds (BSS table). | |
| #define | PROTOCORE_AUTH_LOCKOUT_SLOTS 16 |
| Number of source IPs the auth lockout tracks (BSS bucket table). | |
| #define | PROTOCORE_AUTH_LOCKOUT_THRESHOLD 5 |
| Consecutive failed auths from one IP before it is locked out. | |
| #define | PROTOCORE_AUTH_LOCKOUT_BASE_MS 1000 |
| First lockout duration in ms; doubles on each further failure. | |
| #define | PROTOCORE_AUTH_LOCKOUT_MAX_MS 300000 |
| Maximum lockout duration in ms (the exponential backoff cap). | |
| #define | MAX_TELNET_CONNS 2 |
| Maximum simultaneous Telnet connections. | |
| #define | TELNET_BUF_SIZE 256 |
| Stack buffer for one Telnet I/O chunk. | |
| #define | MAX_SSH_CONNS 1 |
| Maximum simultaneous SSH connections. | |
| #define | PROTOCORE_SSH_SLOT_BYTES 183616u |
| One connection's whole span: the wire, the session, the exchange, the packet and the rx regions end to end, which ssh.c hands out one slot at a time. | |
| #define | PROTOCORE_SSH_BORROW ((size_t)MAX_SSH_CONNS * PROTOCORE_SSH_SLOT_BYTES) |
| Every slot's span together: the bytes ssh.c takes from the secure pool. | |
| #define | PROTOCORE_SSH_PORT_FORWARD 0 |
SSH TCP port forwarding (direct-tcpip, i.e. ssh -L). Default off. | |
| #define | PROTOCORE_SSH_FWD_MAX 2 |
| Maximum concurrent forwarded TCP connections (must be <= PROTOCORE_CLIENT_CONNS). | |
| #define | PROTOCORE_SSH_FWD_HOST_MAX 64 |
| Maximum forward target hostname length including null terminator. | |
| #define | PROTOCORE_SSH_FWD_CONNECT_MS 3000 |
| Blocking connect timeout (ms) when opening a forward target. | |
| #define | PROTOCORE_SSH_FWD_CHUNK 1024 |
| Max bytes moved per forward channel per poll, target -> client (<= SSH_PKT_BUF_SIZE). | |
| #define | PROTOCORE_SSH_RFWD_MAX 1 |
Maximum concurrent remote-forward listeners (ssh -R / tcpip-forward). | |
| #define | PROTOCORE_SSH_RFWD_BRIDGE_MAX 2 |
| Maximum concurrent bridged connections across all remote forwards. | |
| #define | SSH_PKT_BUF_SIZE 2048 |
| Packet assembly buffer per SSH connection (bytes). | |
| #define | PROTOCORE_SFTP_MAX_HANDLES 4 |
| Max concurrent open SFTP handles (files + dirs) per SSH connection. | |
| #define | PROTOCORE_SFTP_PKT_BUF 2048 |
| SFTP packet-assembly buffer per SFTP channel (bytes); bounds one non-streamed request/response. | |
| #define | PROTOCORE_SFTP_MAX_READ 1024 |
| Largest PROTOCORE_SSH_FXP_DATA payload returned for one READ (a short read - the client re-requests). Kept within one SSH packet (SSH_PKT_BUF_SIZE minus framing), so bump SSH_PKT_BUF_SIZE too for throughput. | |
| #define | PROTOCORE_FILESYSTEM_PATH_MAX 256 |
| Largest absolute path the SFTP/SCP server resolves (mount root + request path). | |
| #define | PROTOCORE_SFTP_ENTRY_MAX (PROTOCORE_FILESYSTEM_PATH_MAX + 320) |
Largest serialized SSH_FXP_NAME entry one READDIR emits: filename, ls -l longname and attributes. Sizes the per-handle stash an entry that did not fit is held in, which is a field of SftpHandle in session.h, so it is stated here rather than in the server's own .c. | |
| #define | PROTOCORE_SSH_ZLIB_IN_PSRAM 0 |
| Place the per-connection SSH compression state in external PSRAM (ESP32). | |
| #define | PROTOCORE_SSH_ZLIB_ACK_DRAM 0 |
| Acknowledge placing the SSH compressor in internal DRAM (no PSRAM). | |
| #define | PROTOCORE_SSH_ZLIB_WINDOW 8192 |
| SSH s2c DEFLATE sliding-window size in bytes (max back-reference distance). Power of two, 256..32768. Larger = better ratio + more per-connection RAM (the compressor holds a window-sized work buffer + a window-sized hash chain). The client always allocates a 32 KB inflate window, so any value here interoperates; 8 KB is a good ratio/RAM balance for terminal + command output. | |
| #define | PROTOCORE_SSH_ZLIB_MAX_IN 2048 |
| Largest uncompressed payload the s2c compressor accepts in one call (bytes). Outbound SSH payloads are bounded by SSH_PKT_BUF_SIZE; this sizes the compressor's history+input work buffer. | |
| #define | SSH_MAX_USERNAME_LEN 32 |
| Maximum SSH username length including null terminator. | |
| #define | SSH_MAX_PASSWORD_LEN 64 |
| Maximum SSH password length including null terminator. | |
| #define | PROTOCORE_PLAINTEXT_SCRATCH 10240 |
| Size in bytes of the shared per-dispatch scratch arena. | |
| #define | PROTOCORE_PLAINTEXT_WORK_H3CONN 0 |
| #define | PROTOCORE_PLAINTEXT_WORK_EDGEPROXY 0 |
| #define | PROTOCORE_PLAINTEXT_WORK_EUROMAP77 0 |
| #define | PROTOCORE_PLAINTEXT_WORK_UMATI 0 |
| #define | PROTOCORE_PLAINTEXT_WORK_ROBOTICS 0 |
| #define | PROTOCORE_PLAINTEXT_WORK_SIMATIC 0 |
| #define | PROTOCORE_PLAINTEXT_WORK_J1939 0 |
| #define | PROTOCORE_PLAINTEXT_WORK_MODBUS 0 |
| #define | PROTOCORE_PLAINTEXT_WORK_ESPNOW 0 |
| #define | PROTOCORE_PLAINTEXT_WORK_PROMISC 0 |
| #define | PROTOCORE_PLAINTEXT_WORK_WIFISNIFF 0 |
| #define | PROTOCORE_PLAINTEXT_WORK_RADIOPOWER 0 |
| #define | PROTOCORE_PLAINTEXT_WORK_DNSSERVER 0 |
| #define | PROTOCORE_PLAINTEXT_WORK_FORWARD 0 |
| #define | PROTOCORE_SESSION_BORROW ((size_t)PROTO_MAX_HANDLERS * 8u + 32u) |
| #define | PROTOCORE_PLAINTEXT_WORK_SESSION PROTOCORE_SESSION_BORROW |
| #define | PROTOCORE_SIGNALING_BORROW 64u |
| #define | PROTOCORE_PLAINTEXT_WORK_SIGNALING PROTOCORE_SIGNALING_BORROW |
| #define | PROTOCORE_TRACE_CAPTURE_BORROW 256u |
| #define | PROTOCORE_PLAINTEXT_WORK_TRACECAPTURE 0 |
| #define | PROTOCORE_POWER_MGMT_BORROW 8u |
| #define | PROTOCORE_PLAINTEXT_WORK_POWERMGMT 0 |
| #define | PROTOCORE_GUARDRAILS_BORROW 16u |
| #define | PROTOCORE_PLAINTEXT_WORK_GUARDRAILS 0 |
| #define | PROTOCORE_FAILSAFE_BORROW 256u |
| #define | PROTOCORE_PLAINTEXT_WORK_FAILSAFE 0 |
| #define | PROTOCORE_WORKER_BORROW ((size_t)PROTOCORE_WORKER_COUNT * ((size_t)PROTOCORE_DEFER_QUEUE_DEPTH * 16u + 64u) + 64u) |
| #define | PROTOCORE_PLAINTEXT_WORK_WORKER 0 |
| #define | PROTOCORE_PREEMPT_QUEUE_BORROW 512u |
| #define | PROTOCORE_PLAINTEXT_WORK_PREEMPTQUEUE 0 |
| #define | PROTOCORE_LOGBUF_BORROW 3584u |
| #define | PROTOCORE_PLAINTEXT_WORK_LOGBUF 0 |
| #define | PROTOCORE_FLOW_EXPORT_BORROW 64u |
| #define | PROTOCORE_PLAINTEXT_WORK_FLOWEXPORT 0 |
| #define | PROTOCORE_SYSLOG_BORROW 512u |
| #define | PROTOCORE_PLAINTEXT_WORK_SYSLOG 0 |
| #define | PROTOCORE_SNMP_NOTIFY_BORROW 1536u |
| #define | PROTOCORE_SECURE_WORK_SNMPNOTIFY 0 |
| #define | PROTOCORE_HTTP_CLIENT_BORROW 3584u |
| #define | PROTOCORE_SECURE_WORK_HTTPCLIENT 0 |
| #define | PROTOCORE_SMTP_BORROW 3584u |
| #define | PROTOCORE_SECURE_WORK_SMTP 0 |
| #define | PROTOCORE_WS_CLIENT_BORROW 4608u |
| #define | PROTOCORE_SECURE_WORK_WSCLIENT 0 |
| #define | PROTOCORE_SNMP_V3_BORROW 9216u |
| #define | PROTOCORE_SECURE_WORK_SNMPV3 0 |
| #define | PROTOCORE_SNMP_AGENT_BORROW 13312u |
| #define | PROTOCORE_SECURE_WORK_SNMPAGENT 0 |
| #define | PROTOCORE_OAUTH2_BORROW 3072u |
| #define | PROTOCORE_SECURE_WORK_OAUTH2 0 |
| #define | PROTOCORE_FILESYSTEM_BORROW 3072u |
| #define | PROTOCORE_PLAINTEXT_WORK_FILESYSTEM PROTOCORE_FILESYSTEM_BORROW |
| #define | PROTOCORE_SOUTHBOUND_BORROW 128u |
| #define | PROTOCORE_PLAINTEXT_WORK_SOUTHBOUND 0 |
| #define | PROTOCORE_SSH_SCP_BORROW ((size_t)PROTOCORE_FILESYSTEM_PATH_MAX + 16u) |
| #define | PROTOCORE_PLAINTEXT_WORK_SSHSCP 0 |
| #define | PROTOCORE_SSH_COMP_SLOT_BYTES 81000u |
| One SSH connection's zlib@.nosp@m.open.nosp@m.ssh.c.nosp@m.om compressor: both streams and their windows. | |
| #define | PROTOCORE_SSH_COMP_BORROW ((size_t)MAX_SSH_CONNS * PROTOCORE_SSH_COMP_SLOT_BYTES) |
| Every connection's compressor together: the bytes comp.c takes from the plaintext pool. | |
| #define | PROTOCORE_PLAINTEXT_WORK_SSHCOMP 0 |
| #define | PROTOCORE_SSH_SFTP_BORROW ((size_t)SSH_PKT_BUF_SIZE + PROTOCORE_SFTP_MAX_READ + 5u * PROTOCORE_FILESYSTEM_PATH_MAX + 656u) |
| #define | PROTOCORE_PLAINTEXT_WORK_SSHSFTP 0 |
| #define | PROTOCORE_FILE_SERVING_BORROW 16u |
| #define | PROTOCORE_PLAINTEXT_WORK_FILESERVING 0 |
| #define | PROTOCORE_HTTP_PARSER_BORROW 32u |
| #define | PROTOCORE_PLAINTEXT_WORK_HTTPPARSER 0 |
| #define | PROTOCORE_MDNS_ADAPTIVE_BORROW 96u |
| #define | PROTOCORE_PLAINTEXT_WORK_MDNSADAPTIVE 0 |
| #define | PROTOCORE_UPLOAD_SERVICE_BORROW 48u |
| #define | PROTOCORE_PLAINTEXT_WORK_UPLOADSERVICE 0 |
| #define | PROTOCORE_NTP_SERVICE_BORROW 64u |
| #define | PROTOCORE_PLAINTEXT_WORK_NTPSERVICE 0 |
| #define | PROTOCORE_HTTP_CLOCK_BORROW 32u |
| #define | PROTOCORE_PLAINTEXT_WORK_HTTPCLOCK 0 |
| #define | PROTOCORE_NTP_SERVER_BORROW 16u |
| #define | PROTOCORE_PLAINTEXT_WORK_NTPSERVER 0 |
| #define | PROTOCORE_MDNS_SERVICE_BORROW 320u |
| #define | PROTOCORE_PLAINTEXT_WORK_MDNSSERVICE 0 |
| #define | PROTOCORE_TELNET_BORROW ((size_t)MAX_TELNET_CONNS * (TELNET_BUF_SIZE + 16u) + (size_t)RX_BUF_SIZE + 32u) |
| #define | PROTOCORE_PLAINTEXT_WORK_TELNET 0 |
| #define | PROTOCORE_HTTP_CONN_BORROW ((size_t)RX_BUF_SIZE + 32u) |
| #define | PROTOCORE_PLAINTEXT_WORK_HTTPCONN PROTOCORE_HTTP_CONN_BORROW |
| #define | PROTOCORE_HTTP_BORROW 32u |
| #define | PROTOCORE_PLAINTEXT_WORK_HTTP PROTOCORE_HTTP_BORROW |
| #define | PROTOCORE_SSH_NETWORK_BORROW ((size_t)MAX_SSH_CONNS * (4u + 4u * PROTOCORE_SSH_MAX_CHANNELS) + 16u) |
| #define | PROTOCORE_PLAINTEXT_WORK_SSHNETWORK 0 |
| #define | PROTOCORE_SSH_SERVER_BORROW ((size_t)MAX_SSH_CONNS + 8u) |
| #define | PROTOCORE_PLAINTEXT_WORK_SSHSERVER 0 |
| #define | PROTOCORE_RCWL0516_BORROW 32u |
| #define | PROTOCORE_PLAINTEXT_WORK_RCWL0516 0 |
| #define | PROTOCORE_SEN0192_BORROW 32u |
| #define | PROTOCORE_PLAINTEXT_WORK_SEN0192 0 |
| #define | PROTOCORE_FTP_SESSION_BORROW 1536u |
| #define | PROTOCORE_PLAINTEXT_WORK_FTPSESSION 0 |
| #define | PROTOCORE_STATSD_BORROW 512u |
| #define | PROTOCORE_PLAINTEXT_WORK_STATSD 0 |
| #define | PROTOCORE_GRAPHQL_BORROW 5120u |
| #define | PROTOCORE_PLAINTEXT_WORK_GRAPHQL 0 |
| #define | PROTOCORE_LWM2M_TLV_BORROW 128u |
| #define | PROTOCORE_PLAINTEXT_WORK_LWM2MTLV 0 |
| #define | PROTOCORE_COAP_BORROW 3584u |
| #define | PROTOCORE_PLAINTEXT_WORK_COAP 0 |
| #define | PROTOCORE_COAPS_SERVER_BORROW 34816u |
| #define | PROTOCORE_SECURE_WORK_COAPSSERVER 0 |
| #define | PROTOCORE_MQTT_BORROW 512u |
| #define | PROTOCORE_SECURE_WORK_MQTT 0 |
| #define | PROTOCORE_PROTOBUF_BORROW 512u |
| #define | PROTOCORE_PLAINTEXT_WORK_PROTOBUF 0 |
| #define | PROTOCORE_SPARKPLUG_BORROW 512u |
| #define | PROTOCORE_PLAINTEXT_WORK_SPARKPLUG 0 |
| #define | PROTOCORE_UDP_TELEMETRY_BORROW 128u |
| #define | PROTOCORE_PLAINTEXT_WORK_UDPTELEMETRY 0 |
| #define | PROTOCORE_PLAINTEXT_WORK_LOG PROTOCORE_LOG_BORROW |
| #define | PROTOCORE_PLAINTEXT_WORK_DIFFSERV 0 |
| #define | PROTOCORE_PLAINTEXT_WORK_UDPCLIENT PROTOCORE_UDP_CLIENT_BORROW |
| #define | PROTOCORE_PLAINTEXT_WORK_UDPLISTENER PROTOCORE_UDP_LISTENER_BORROW |
| #define | PROTOCORE_PLAINTEXT_WORK_TCPLOWER PROTOCORE_TCP_LOWER_BORROW |
| #define | PROTOCORE_PLAINTEXT_WORK_CONNPOOL PROTOCORE_CONN_POOL_BORROW |
| #define | PROTOCORE_PLAINTEXT_WORK_TCPLISTENER PROTOCORE_TCP_LISTENER_BORROW |
| #define | PROTOCORE_PLAINTEXT_WORK_TCPCLIENT PROTOCORE_TCP_CLIENT_BORROW |
| #define | PROTOCORE_PLAINTEXT_WORK_HAPPYEYEBALLS 0 |
| #define | PROTOCORE_PLAINTEXT_WORK_PHYSICAL PROTOCORE_PHYSICAL_BORROW |
| #define | PROTOCORE_PLAINTEXT_ARENA_SIZE |
| #define | PROTOCORE_DEBUG_CHECKS 0 |
| Compile the library's internal debug checks (default 0 = off). | |
| #define | PROTOCORE_RAND_RESEED_BYTES (1u << 20) |
| Bytes a worker's generator draws before it redraws its seed from the platform. | |
| #define | PROTOCORE_IKE_BORROW PROTOCORE_CRYPTO_BORROW_MAX |
| #define | PROTOCORE_CRYPTO_BORROW_MAX PROTOCORE_HMAC_SHA512_BORROW |
| #define | PROTOCORE_QUIC_KEYS_BORROW (PROTOCORE_HKDF_BORROW + 32) |
| #define | PROTOCORE_ECDSA_BORROW (PROTOCORE_SHA256_BORROW + PROTOCORE_HMAC_SHA256_BORROW) |
| #define | PROTOCORE_HKDF_SHA384_BORROW (PROTOCORE_HMAC_SHA384_BORROW + 48 + 514) |
| #define | PROTOCORE_HKDF_BORROW (PROTOCORE_HMAC_SHA256_BORROW + 32 + 514) |
| #define | PROTOCORE_SSH_KDF_BORROW (PROTOCORE_SSH_KEXHASH_BORROW + 128) |
| #define | PROTOCORE_WORK_ROUTE_TABLE (MAX_ROUTES * 104 + 16) |
| #define | PROTOCORE_HTTP_ROUTE_BORROW PROTOCORE_WORK_ROUTE_TABLE |
| The route table's borrow: every entry plus the count. Proved in http_route.c. | |
| #define | PROTOCORE_SECURE_WORK_ROUTETABLE 0 |
| #define | PROTOCORE_HTTP_AUTH_BORROW ((size_t)PROTOCORE_WORK_AUTH_TABLE + PROTOCORE_SHA256_BORROW) |
| The HTTP auth borrow: the credential table, then the SHA-256 bytes behind it. | |
| #define | PROTOCORE_WORK_AUTH_TABLE (MAX_ROUTES * (3 * MAX_AUTH_LEN + 8) + 32) |
| #define | PROTOCORE_WORK_SSH_HOST_KEY (256 + 1700 + 16) |
| #define | PROTOCORE_H2_SERVER_BORROW ((size_t)MAX_CONNS * 16 + 64) |
| #define | PROTOCORE_CLIENT_CONNS 2 |
| Number of simultaneous outbound client connections (BSS pool size). | |
| #define | PROTOCORE_CLIENT_RX_BUF 8192 |
| Per-connection wire receive ring size (bytes). | |
| #define | SSH_CHAN_WINDOW 32768u |
| Initial receive window the SSH server advertises (RFC 4254 ยง5.1). | |
| #define | SSH_CHAN_MAX_PACKET (SSH_PKT_BUF_SIZE - 64u) |
| Maximum SSH channel data payload the server advertises it can receive per message. | |
| #define | SSH_REKEY_PACKET_THRESHOLD (0x20000000u / SSH_PKT_BUF_SIZE) |
| Re-key when either packet sequence number reaches this value. | |
| #define | SSH_REKEY_TIME_MS 3600000u |
| Elapsed-time re-key trigger in milliseconds (RFC 4253 ยง9: "after each hour"). Default 1 hour. | |
| #define | SSH_AUTH_TIMEOUT_MS 600000u |
| How long a connection may stay unauthenticated before it is disconnected, milliseconds. | |
| #define | SSH_AUTH_USER_MAX 32 |
| Max stored user name (RFC 4252 imposes no limit; we cap for BSS). | |
| #define | PROTOCORE_SSH_PTY_TERM_MAX 24 |
| Max stored TERM value from a pty-req (RFC 4254 sec 6.2). | |
| #define | SSH_AUTH_PASS_MAX 64 |
| Max stored password length. | |
| #define | SSH_AUTH_ALGO_MAX 20 |
| Max stored public-key algorithm name ("rsa-sha2-512", "ecdsa-sha2-nistp256", RFC 4253 sec 6.6). | |
| #define | SSH_KEXINIT_MAX 2048 |
| Max stored size of the CLIENT KEXINIT payload (I_C, for the exchange hash). | |
| #define | PROTOCORE_SCPI_ERR_QUEUE 8 |
| SCPI error/event queue depth (entries). The SCPI status model requires a queue; when it overflows the tail entry is replaced with -350 "Queue overflow" per the standard. | |
| #define | PROTOCORE_WAL_PAGE_SIZE 32768 |
| #define | PROTOCORE_WAL_MAX_RECORD 4096 |
| #define | PROTOCORE_DBM_SLOTS 256 |
| #define | PROTOCORE_DBM_KEY_MAX 32 |
| #define | PROTOCORE_DBM_VAL_MAX 256 |
| #define | PROTOCORE_DOCSTORE_FIELD_MAX 128 |
| #define | PROTOCORE_MESH_QUERY_MS 300 |
| #define | PROTOCORE_MESH_HOST_MAX 64 |
| #define | PROTOCORE_MESH_HDRS_MAX 384 |
Typedefs | |
| typedef enum PROTO_ENUM_PACKED | ProtoConn |
| Application protocol spoken on a listener port or connection slot. | |
| typedef enum PROTO_ENUM_PACKED | protocore_if_kind |
| What an interface is, and the filter that selects one. | |
Enumerations | |
| enum | PROTO_ENUM_PACKED { PROTO_NONE = 0 , PROTO_HTTP = 1 , PROTO_TELNET = 2 , PROTO_SSH = 3 , PROTO_MODBUS = 4 , PROTO_OPCUA = 5 , PROTO_SSH_RFWD = 6 , PROTO_RELAY = 7 , PROTO_BRIDGE = 8 , PROTO_NTRIP_CASTER = 9 , PROTO_MESH , PROTO_UDP = 11 , PROTOCORE_IF_ANY = 0 , PROTOCORE_IF_WIFI_STA = 1 , PROTOCORE_IF_WIFI_AP = 2 , PROTOCORE_IF_ETH = 3 , PROTOCORE_IF_BUS = 4 , PROTOCORE_IF_RADIO = 5 } |
| Application protocol spoken on a listener port or connection slot. More... | |
| enum | PROTO_ENUM_PACKED { PROTO_NONE = 0 , PROTO_HTTP = 1 , PROTO_TELNET = 2 , PROTO_SSH = 3 , PROTO_MODBUS = 4 , PROTO_OPCUA = 5 , PROTO_SSH_RFWD = 6 , PROTO_RELAY = 7 , PROTO_BRIDGE = 8 , PROTO_NTRIP_CASTER = 9 , PROTO_MESH , PROTO_UDP = 11 , PROTOCORE_IF_ANY = 0 , PROTOCORE_IF_WIFI_STA = 1 , PROTOCORE_IF_WIFI_AP = 2 , PROTOCORE_IF_ETH = 3 , PROTOCORE_IF_BUS = 4 , PROTOCORE_IF_RADIO = 5 } |
| What an interface is, and the filter that selects one. More... | |
Every capacity, buffer extent and pool borrow the enabled features are sized on.
Reached from protocore_config.h, which is the single entry point and states the feature flags every block here is gated on. Including this file on its own would read those flags before they are settled.
Definition in file buffer_sizing.h.
| #define MAX_CONNS 8 |
Maximum simultaneous TCP connections (fixed static pool; ~3.95 KB of internal RAM per slot).
Default 8: a keep-alive/concurrency server needs headroom above its peak concurrent client count, because a connection closed by the keep-alive fairness cap (PROTOCORE_KEEPALIVE_MAX_REQUESTS) briefly holds its slot in CONN_CLOSING while it drains, and a reconnecting client needs a free slot mean- while - if concurrency equals the pool size there is none, and the overflow connection is refused (correct backpressure, but it caps clean throughput at concurrency == MAX_CONNS - 1). Set lower (e.g. -DMAX_CONNS=4, ~16 KB less RAM) on a RAM-constrained target, or higher (16/32) for a connection-heavy HTTP server; the event queue tracks it automatically (EVT_QUEUE_DEPTH below).
Definition at line 39 of file buffer_sizing.h.
| #define PROTOCORE_TCP_NODELAY 1 |
Disable Nagle's algorithm (set TCP_NODELAY) on every accepted connection.
A request/response server is latency-first: the response is buffered whole (tcp_write) and pushed with a single tcp_output, so Nagle only ever delays the final sub-MSS segment of a multi-segment response (or a streamed chunk) - it waits for the peer's ACK of the prior segment, costing a ~40-200 ms delayed-ACK stall for no bandwidth benefit here. Disabling it lets that tail go out immediately. Set to 0 only if the device mainly streams bulk data and you prefer Nagle's segment coalescing over per-response latency.
Definition at line 52 of file buffer_sizing.h.
| #define PROTOCORE_BASE64_SWAR 1 |
Use the SWAR base64 decoder (classify 4 characters per 32-bit word). Default on.
base64 decode is the one base64 path that touches a secret (the Basic-auth credential, RFC 7617, and the JWT / JWS segments, RFC 7515), so it must be constant-time - the character -> value mapping evaluated with branchless arithmetic masks, no data-dependent branch or table. Two constant-time implementations are available: a scalar one that classifies a character at a time, and this SWAR one that packs 4 characters into a word and classifies all four lanes in parallel with guard-bit range masks (every base64 character is < 0x80, so borrows never cross lanes). Both are byte-identical (test_base64 runs against each) and both are constant-time; measured on the ESP32-S3, SWAR is ~1.9x faster than the scalar path and 5.36x faster than mbedTLS (882 vs 1639 vs 4728 cyc on a credential), at 0.00-cycle input-dependent variance. SWAR is the default; set to 0 for the smaller, simpler scalar decoder if code size matters more than the ~1.9x once-per-request decode win. Portable (any 32-bit target); encode is unaffected (always software).
Definition at line 70 of file buffer_sizing.h.
| #define RX_BUF_SIZE 1024 |
Ring-buffer capacity in bytes per connection slot (feature floors enforced last, in derived_sizing.h - a value below what an enabled feature needs is raised there).
Definition at line 76 of file buffer_sizing.h.
| #define CONN_TIMEOUT_MS 5000 |
Compile-time default for connection idle timeout in milliseconds.
The actual runtime value is stored in WebServerConfig::conn_timeout_ms, loaded by Tcp.conn->init() and read back with Tcp.conn->timeout_ms().
Definition at line 87 of file buffer_sizing.h.
| #define PROTOCORE_REQUEST_TIMEOUT_MS 10000 |
Request-header read deadline in milliseconds (slow-loris defense). Default 10 s; 0 disables.
The idle timeout (CONN_TIMEOUT_MS) refreshes on every accepted byte, so a slow-loris that trickles one header byte just under the idle window holds a connection slot forever and, with a few connections, denies the whole fixed pool to legitimate clients (a connection-slot DoS - verified on HW). This is an ABSOLUTE deadline from the first byte of a request to the end of its HEADERS that a trickle cannot reset: a connection whose request headers are not complete within PROTOCORE_REQUEST_TIMEOUT_MS is answered 408 and closed, freeing the slot (the nginx client_header_timeout semantic). It is scoped to the header phase, so it never reaps a legitimate slow body: a large streaming upload (PARSE_BODY) is governed by the streaming handler + idle timer, not this deadline. It also does not touch WebSocket / SSE slots (long-lived by design). Lower it to tighten the window on a trusted LAN; 0 turns the defense off.
Definition at line 104 of file buffer_sizing.h.
| #define PROTOCORE_CLOSING_TIMEOUT_MS 2000 |
Upper bound (ms) a slot may dwell in CONN_CLOSING after a graceful close before the idle sweep force-aborts it.
On a graceful (local) close the slot stays in CONN_CLOSING - keeping its PCB and callbacks - until the peer ACKs the response (then it frees itself in the sent callback). If the peer never ACKs (dead/black-holed), this bound lets the timeout sweep reclaim the slot so the fixed pool cannot leak.
Definition at line 117 of file buffer_sizing.h.
| #define PROTOCORE_WORKER_COUNT 1 |
Number of server worker tasks (slots partitioned i % N). Default 1.
Definition at line 137 of file buffer_sizing.h.
| #define PROTOCORE_GHOST_WORKER_SLOT (PROTOCORE_WORKER_COUNT) |
Definition at line 144 of file buffer_sizing.h.
| #define PROTOCORE_SSH_ANY 0 |
Stack (bytes) for each server worker task (ESP32).
Floor note: two heavy computations run on the worker.
Definition at line 171 of file buffer_sizing.h.
| #define PROTOCORE_WORKER_TASK_STACK 8192 |
Definition at line 199 of file buffer_sizing.h.
| #define PROTOCORE_WORKER_STACK_RSA_MIN 8192 |
Minimum worker-task stack (bytes) required once an RSA-2048 verifier is compiled in (OIDC / SSH).
The mbedTLS bignum modexp alone consumes ~7 KB; 8 KB leaves room for the rest of the request call chain. Overridable only for an advanced build that marshals every RSA verify onto a dedicated larger-stack task (then the worker itself never runs one) - otherwise leave it at the default.
Definition at line 213 of file buffer_sizing.h.
| #define PROTOCORE_WORKER_STACK_CURVE_MIN 12288 |
Minimum worker-task stack (bytes) required once SSH is compiled in.
SSH can negotiate curve25519-sha256 + ssh-ed25519, whose software field arithmetic peaks at ~10.5 KB of worker stack; 12 KB leaves ~1.8 KB of margin for the rest of the handshake call chain (comparable to the RSA floor's margin). Raise both this and PROTOCORE_WORKER_TASK_STACK together if you extend the handshake, or force RSA/DH only (ssh_kex_set_prefer_rsa) on a very tight build - but the server still advertises the modern suite, so a modern-only client would still exercise it.
Definition at line 228 of file buffer_sizing.h.
| #define PROTOCORE_WORKER_TASK_PRIORITY 5 |
FreeRTOS priority for each server worker task (ESP32).
Definition at line 233 of file buffer_sizing.h.
| #define PROTOCORE_WORKER_CORE 1 |
Core that worker 0 pins to (ESP32). Worker k pins to (PROTOCORE_WORKER_CORE.
Definition at line 242 of file buffer_sizing.h.
| #define PROTOCORE_DEFER_QUEUE_DEPTH 8 |
Depth of each worker's deferred-callback queue.
App code on loop() or another task submits work to a slot's owning worker via Session.workers->defer() / protocore_defer_slot(); the worker runs it in its own single-thread context, so an async push (ws_send / protocore_sse_send from a timer) is race-free. Each worker has one queue of this depth (entries are a {fn, arg} pair, ~8 bytes).
Definition at line 254 of file buffer_sizing.h.
| #define PROTOCORE_WORKER_POLL_TICKS 1 |
Idle-sweep timeout, in FreeRTOS ticks, that a worker blocks between service iterations when no events are pending.
The worker no longer free-runs a poll: it blocks on a task notification and a producer (a new connection event or a deferred submission) wakes it the moment work arrives, so event latency is independent of this value. The block still times out after this many ticks so the idle timeout sweep (check_timeouts) keeps reaping stale connections when nothing is in flight.
Default 1 (1 tick at the Arduino 1 kHz FreeRTOS config) preserves the original idle cadence byte-for-byte. Because events now wake the worker immediately, raising it lowers idle wakeups (CPU/power on a battery device) WITHOUT the latency penalty the old poll-based knob carried - e.g. 100 -> a ~10 Hz idle sweep, still far below any connection timeout. The internal time base stays 1000 Hz regardless (see server/clock/clock.h).
Definition at line 275 of file buffer_sizing.h.
| #define PROTOCORE_PQ_DEPTH 16 |
Capacity of the preempting queue in items (static-allocated).
Definition at line 292 of file buffer_sizing.h.
| #define PROTOCORE_PQ_ITEM_SIZE 32 |
Bytes per preempting-queue item (the posted item must fit).
Definition at line 297 of file buffer_sizing.h.
| #define PROTOCORE_PQ_STACK 4096 |
Stack (bytes) for each preempting-queue processing task (ESP32).
Definition at line 302 of file buffer_sizing.h.
| #define PROTOCORE_PQ_INTERNAL_PRIORITY 8 |
Base FreeRTOS priority for the internal preempting lanes (DMA / forwarding / device access). They run at this and just above, so internal ingest preempts the user lane; keep it above the user lane's priority and below the lwIP tcpip (18) / WiFi tasks so networking is never starved. See preempt_queue.h.
Definition at line 312 of file buffer_sizing.h.
| #define PROTOCORE_DMA_CHANNELS 2 |
Number of DMA channels (static-allocated; each is one peripheral link).
Definition at line 335 of file buffer_sizing.h.
| #define PROTOCORE_DMA_BUF_SIZE 256 |
Bytes per DMA transfer buffer (RX is double-buffered at this size).
Definition at line 340 of file buffer_sizing.h.
| #define PROTOCORE_TC_MAX_WINDOW_SAMPLES 4096 |
HttpRoute DMA transfers through the ingress/egress simulator (default on). Set to 0 to drive real silicon via the protocore_dma_hw_* backend hooks.
Max samples a window may hold (pretrigger_samples + posttrigger_samples), static-allocated.
Definition at line 364 of file buffer_sizing.h.
| #define PROTOCORE_PHY_MAX_IFACES 4 |
Interfaces layer 1 can carry: wifi station and softAP, ethernet, a bridged bus, a radio. The registry is L1's because an interface is a physical thing; the forwarding plane reads it.
Definition at line 394 of file buffer_sizing.h.
| #define PROTOCORE_FWD_MAX_RULES 8 |
Max forwarding rules (src -> dst allow/deny + rate cap; static-allocated).
Definition at line 399 of file buffer_sizing.h.
| #define PROTOCORE_FWD_MAX_ACL 8 |
Max ingress access-control entries (byte-pattern permit/deny; static).
Definition at line 404 of file buffer_sizing.h.
| #define PROTOCORE_FWD_ACL_PATLEN 4 |
Bytes an ACL entry can match (its pattern / mask length).
Definition at line 409 of file buffer_sizing.h.
| #define PROTOCORE_FWD_MAX_ROUTES 8 |
Max policy routes (byte-pattern -> egress interface; static). Policy routes take precedence over the src->dst rules, so tagged traffic leaves a chosen interface.
Definition at line 415 of file buffer_sizing.h.
| #define PROTOCORE_FWD_INSPECT 0 |
Build-time toggle for the forwarding-path inspection hook (default off, for cost + privacy). When 1, Forward.inspect.fn + Forward.set_inspector install a runtime callback that observes / filters each ingress frame before it is forwarded; when 0 the hook is compiled out entirely (no call site). Runtime toggle: register or clear (null) the inspector.
Definition at line 424 of file buffer_sizing.h.
| #define PROTOCORE_GW_MAX_PORTS 4 |
Max southbound gateway ports (radios / buses; static-allocated).
Definition at line 443 of file buffer_sizing.h.
| #define PROTOCORE_GW_DEFAULT_PREFIX "gw" |
Default northbound topic prefix (overridable at runtime via protocore_gateway_set_topic_prefix).
Definition at line 448 of file buffer_sizing.h.
| #define PROTOCORE_LORA_MAX_PAYLOAD 251 |
Max LoRa payload bytes (SX127x FIFO is 256; RadioHead uses 251 + 4 header).
Definition at line 464 of file buffer_sizing.h.
| #define PROTOCORE_NRF24_PAYLOAD 32 |
nRF24 fixed payload width in bytes (1..32; the chip's static payload size).
Definition at line 481 of file buffer_sizing.h.
| #define PROTOCORE_ENOCEAN_MAX_DATA 512 |
Reject an ESP3 telegram whose declared data length exceeds this (framing sanity).
Definition at line 497 of file buffer_sizing.h.
| #define PROTOCORE_PN532_MAX_DATA 254 |
Reject a PN532 normal frame whose declared length exceeds this (framing sanity).
Definition at line 514 of file buffer_sizing.h.
| #define PROTOCORE_SIGFOX_MAX_PAYLOAD 12 |
Maximum Sigfox uplink payload (the network caps a message at 12 bytes).
Definition at line 529 of file buffer_sizing.h.
| #define PROTOCORE_ZWAVE_MAX_DATA 64 |
Reject a Z-Wave frame whose declared length exceeds this data cap (sanity).
Definition at line 546 of file buffer_sizing.h.
| #define PROTOCORE_ZIGBEE_MAX_DATA 128 |
Max ASH payload bytes (an EZSP frame; the ASH data field caps near 128).
Definition at line 564 of file buffer_sizing.h.
| #define PROTOCORE_THREAD_MAX_DATA 256 |
Max spinel payload bytes carried in one HDLC-lite frame.
Definition at line 581 of file buffer_sizing.h.
| #define PROTOCORE_ETH_W5500 0 |
Definition at line 600 of file buffer_sizing.h.
| #define PROTOCORE_ETH_W5500_CS 7 |
chip select
Definition at line 603 of file buffer_sizing.h.
| #define PROTOCORE_ETH_W5500_RST 6 |
reset
Definition at line 606 of file buffer_sizing.h.
| #define PROTOCORE_ETH_W5500_INT 5 |
interrupt
Definition at line 609 of file buffer_sizing.h.
| #define PROTOCORE_ETH_W5500_SCK 12 |
HSPI clock (S3-DevKitC default)
Definition at line 612 of file buffer_sizing.h.
| #define PROTOCORE_ETH_W5500_MISO 13 |
HSPI MISO (S3-DevKitC default)
Definition at line 615 of file buffer_sizing.h.
| #define PROTOCORE_ETH_W5500_MOSI 11 |
HSPI MOSI (S3-DevKitC default)
Definition at line 618 of file buffer_sizing.h.
| #define PROTOCORE_ETH_W5500_SPI_MHZ 20 |
W5500 SPI clock (MHz); raise for throughput on clean wiring.
Definition at line 624 of file buffer_sizing.h.
| #define MAX_HEADERS 8 |
Maximum HTTP headers stored per request.
Definition at line 633 of file buffer_sizing.h.
| #define MAX_PATH_LEN 64 |
Maximum URL path length (including leading /).
Definition at line 638 of file buffer_sizing.h.
| #define MAX_KEY_LEN 32 |
Maximum header field-name length (e.g. "Content-Type").
Must accommodate the longest header name the app needs to read by key. Standard names reach 30+ chars (Sec-WebSocket-Extensions = 24, Access-Control-Request-Headers = 30), so the default leaves margin; an over-long key is truncated (not rejected) by the parser.
Definition at line 650 of file buffer_sizing.h.
| #define MAX_VAL_LEN 48 |
Maximum header field-value length.
Definition at line 655 of file buffer_sizing.h.
| #define MAX_QUERY_LEN 128 |
Maximum raw query-string length (everything after ?).
Definition at line 660 of file buffer_sizing.h.
| #define MAX_QUERY_PARAMS 8 |
Maximum number of parsed query-string parameters.
Definition at line 665 of file buffer_sizing.h.
| #define MAX_PATH_PARAMS 4 |
Maximum number of :name path parameters captured per route match.
Definition at line 670 of file buffer_sizing.h.
| #define DIGEST_AUTH_HDR_MAX 384 |
Capacity for the full Authorization header value (Digest auth).
A Digest Authorization header (username, realm, nonce, uri, response, qop, nc, cnonce) is far longer than MAX_VAL_LEN, so when PROTOCORE_ENABLE_AUTH is set the parser captures it whole into a dedicated per-request buffer.
Definition at line 681 of file buffer_sizing.h.
| #define PROTOCORE_DIGEST_NONCE_LIFETIME_MS (5u * 60u * 1000u) |
Lifetime of a Digest nonce, in milliseconds (default 5 minutes).
The server mints a stateless, keyed, timestamped nonce (RFC 7616 3.3) rather than a fixed one: each challenge carries the issue time plus a MAC over the server secret, so no per-nonce table is needed. A client Authorization whose nonce is older than this window is treated as stale - the credentials are re-checked and, if correct, the server reissues a fresh challenge with stale=true so the client retries transparently (no re-prompt). This bounds how long a captured Digest response can be replayed without any server-side state, which the shared-nothing worker model could not hold safely.
Definition at line 697 of file buffer_sizing.h.
| #define QUERY_KEY_LEN 24 |
Maximum query-parameter key length.
Definition at line 702 of file buffer_sizing.h.
| #define QUERY_VAL_LEN 48 |
Maximum query-parameter value length.
Definition at line 707 of file buffer_sizing.h.
| #define BODY_BUF_SIZE 256 |
Maximum request body bytes stored in HttpReq::body.
Bodies larger than this trigger a 413 Payload Too Large response - the parser detects the overflow via Content-Length before any body bytes arrive, so no data is read or stored for oversized requests.
Definition at line 718 of file buffer_sizing.h.
| #define MAX_ROUTES 16 |
Maximum simultaneously registered routes.
Definition at line 723 of file buffer_sizing.h.
| #define MAX_MIDDLEWARE 4 |
Maximum globally-registered middleware functions.
The middleware chain is a fixed array of function pointers run in registration order before a request reaches its route handler (see use()). Costs MAX_MIDDLEWARE pointers of BSS; an empty chain adds no per-request work.
Definition at line 735 of file buffer_sizing.h.
| #define CHUNK_BUF_SIZE 1440 |
Per-chunk staging buffer for send_chunked()'s ChunkSource (max bytes a source produces per call, hence the largest single chunk on the wire).
Allocated on the worker stack only while a chunk is being framed - no persistent RAM cost. The pump asks the source for at most this many bytes (or fewer when the send window is smaller), so it bounds the chunk size, not the total body.
Sized to one TCP segment (~MSS): the pump frames + sends each chunk in a single tcpip_thread round-trip (~23 us on-device), so a bigger chunk = fewer round-trips per byte. 1440 keeps the framed chunk within one segment; raise it (up to the send window) to cut the round-trip count further on a fast transport (e.g. Ethernet), at more stack.
Definition at line 752 of file buffer_sizing.h.
| #define JSON_MAX_DEPTH 8 |
Maximum object/array nesting depth for the JsonWriter (see json.h).
Bounds the writer's per-level comma-tracking stack (one bool per level); begin_object()/begin_array() beyond this fail the writer instead of overflowing. No heap; ~JSON_MAX_DEPTH bytes of stack inside the writer object.
Definition at line 763 of file buffer_sizing.h.
| #define RE_MAX_STEPS 2000 |
Step budget for the regex route matcher (see on_regex()).
The matcher is a bounded backtracker: it counts match steps and fails closed (no match) once this budget is exhausted, so a pathological pattern can never backtrack unboundedly. Keeps regex routing deterministic. Routing patterns hit only a handful of steps; the default leaves wide margin.
Definition at line 775 of file buffer_sizing.h.
| #define MAX_WS_CONNS 2 |
Maximum simultaneous WebSocket connections.
Each connection occupies one TCP slot from MAX_CONNS and one entry in ws_pool[]. MAX_WS_CONNS + MAX_SSE_CONNS must not exceed MAX_CONNS.
Definition at line 789 of file buffer_sizing.h.
| #define WS_FRAME_SIZE 512 |
Maximum WebSocket frame payload in bytes.
Frames larger than this are rejected with Close code 1009 (Message Too Big). Fragmented messages are not supported; each message must fit in one frame.
Definition at line 799 of file buffer_sizing.h.
| #define PROTOCORE_WS_DEFLATE_MAX WS_FRAME_SIZE |
Largest outbound payload permessage-deflate will compress, in bytes.
The compressor borrows len + len/8 + 16 from the scratch arena, so an unbounded outbound length would leave the arena with no worst case - Ws.frame.len is a uint16_t, and neither WS_FRAME_SIZE (which bounds the inbound reassembled message) nor PROTOCORE_WS_FRAG_SIZE (off by default, and a runtime setter besides) constrains it. This is that bound, and it is what makes PROTOCORE_PLAINTEXT_WORK_WS_SEND a compile-time constant.
A larger message is still sent, uncompressed, as the per-message RSV1 flag makes legal - the same outcome as before this was declared, except chosen rather than reached by an allocation failure. Raising it costs arena: the term grows by roughly 1.125x the increase.
Definition at line 816 of file buffer_sizing.h.
| #define MAX_SSE_CONNS 2 |
Maximum simultaneous SSE connections.
Each connection occupies one TCP slot from MAX_CONNS and one entry in protocore_sse_pool[]. MAX_WS_CONNS + MAX_SSE_CONNS must not exceed MAX_CONNS.
Definition at line 830 of file buffer_sizing.h.
| #define SSE_BUF_SIZE 256 |
Output buffer size in bytes for a single SSE event.
An event larger than this is silently truncated. The buffer holds the formatted data: ...\n\n line before it is handed to tcp_write().
Definition at line 840 of file buffer_sizing.h.
| #define FILE_CHUNK_SIZE 1024 |
Bytes read from the filesystem and passed to tcp_write() per loop().
Each read+send is one tcpip_thread round-trip (~23 us on-device), so a larger chunk = fewer round-trips per byte (better throughput on a fast transport), at more peak stack. Must be <= RX_BUF_SIZE to avoid stalling the TCP send window; 1024 tracks the default RX_BUF_SIZE. Lower it (e.g. -DFILE_CHUNK_SIZE=512) on a stack-constrained target.
Definition at line 856 of file buffer_sizing.h.
| #define MAX_AUTH_LEN 32 |
Maximum username or password length for HTTP Basic Authentication.
Both username and password must fit in this many bytes including the null terminator. Longer credentials are silently rejected with 401.
Definition at line 870 of file buffer_sizing.h.
| #define MAX_MULTIPART_PARTS 4 |
Maximum simultaneously parsed multipart parts per request.
Parts beyond this limit are silently ignored. A typical upload form has 1-4 fields; increase this for forms with more.
Definition at line 884 of file buffer_sizing.h.
| #define MAX_BOUNDARY_LEN 72 |
Maximum MIME boundary length (RFC 2046 allows up to 70 characters).
Definition at line 891 of file buffer_sizing.h.
| #define EVT_QUEUE_DEPTH (MAX_CONNS * 4) |
Depth of the FreeRTOS event queue shared between lwIP callbacks and the main-loop task.
Each slot holds one TcpEvt (8 bytes). The queue is the only heap allocation the library makes at begin() time:
heap = sizeof(StaticQueue_t) + EVT_QUEUE_DEPTH * sizeof(TcpEvt)
Must be large enough to absorb a burst of MAX_CONNS * 4 events without blocking the lwIP thread, so it tracks MAX_CONNS automatically (a raised MAX_CONNS never trips the EVT_QUEUE_DEPTH >= MAX_CONNS * 4 guard below).
Definition at line 912 of file buffer_sizing.h.
| #define RESP_HDR_BUF_SIZE 768 |
Stack buffer for HTTP response header lines in send() / send_empty() / send_unauth() / serve_file().
Must be large enough to hold the status line, Content-Type, Content-Length, Connection, and any CORS headers. The CORS block alone can reach CORS_HDR_BUF_SIZE bytes, so this value should be at least CORS_HDR_BUF_SIZE + 96.
Definition at line 929 of file buffer_sizing.h.
| #define EXTRA_HDR_BUF_SIZE 256 |
Per-connection buffer for app-supplied custom response headers and cookies.
Filled by proto_add_response_header() / set_cookie() and injected into send() / send_empty() / redirect() the same way the CORS block is. RESP_HDR_BUF_SIZE must be large enough to hold the status line plus the CORS block plus this block (see the assert below).
Definition at line 942 of file buffer_sizing.h.
| #define WS_HDR_BUF_SIZE 256 |
Stack buffer for the HTTP 101 Switching Protocols response sent during the WebSocket handshake.
Must hold: status line + Upgrade + Connection + Sec-WebSocket-Accept (28 base64 chars) + CRLF pairs. Minimum is ~120 bytes; default leaves margin.
Definition at line 953 of file buffer_sizing.h.
| #define CORS_HDR_BUF_SIZE 192 |
Size of the pre-built CORS header block stored in PC.
Built once by set_cors() and injected into every response. Must hold Access-Control-Allow-Origin, Access-Control-Allow-Methods, and Access-Control-Allow-Headers lines for the configured origin.
Definition at line 964 of file buffer_sizing.h.
| #define CACHE_CONTROL_BUF_SIZE 64 |
Size of the optional Cache-Control header line stored in PC.
Built once by set_cache_control() and injected into static-file responses (serve_file / serve_static) beside the ETag. Holds "Cache-Control: <value>\r\n".
Definition at line 974 of file buffer_sizing.h.
| #define PROTOCORE_WS_FRAG_SIZE 0 |
WebSocket outbound fragmentation size (RFC 6455 sec 5.4), in payload bytes. 0 = off.
When >0, an outbound data message (text/binary) longer than this many payload bytes is split into that-sized WebSocket frames - the first carrying the opcode (and the RFC 7692 RSV1 bit if the message is compressed), the rest CONTINUATION, the last with FIN - instead of one large frame. Sizing it near the TCP MSS (e.g. 1400) keeps each frame within whole segments (MTU-aligned) and lets a peer with a bounded per-frame reassembly buffer receive an arbitrarily long message. The runtime override is Ws.set_frag_size. Compression applies to the whole message first, then the compressed bytes are split. Default 0 (one frame per message, unchanged).
Definition at line 989 of file buffer_sizing.h.
| #define PROTOCORE_WEBDAV_BUF_SIZE 2048 |
Buffer (BSS) for a WebDAV 207 Multi-Status response, in bytes (see PROTOCORE_ENABLE_WEBDAV).
Definition at line 994 of file buffer_sizing.h.
| #define PROTOCORE_WEBDAV_MAX_ENTRIES 32 |
Maximum children listed in a WebDAV Depth-1 PROPFIND (bounds the response).
Definition at line 999 of file buffer_sizing.h.
| #define PROTOCORE_DAV_MAX_DEPTH 8 |
Deepest tree a WebDAV DELETE / COPY walks before refusing (see PROTOCORE_ENABLE_WEBDAV).
The recursive walkers carry one path and one child name per level, so this is what turns their working storage into a fixed number instead of one that grows with the tree being walked. It was a bare 8 in the walk's own test, which bounded the recursion but sized nothing, because the paths were stack arrays the footprint could not see.
Definition at line 1011 of file buffer_sizing.h.
| #define PROTOCORE_WEBDAV_MAX_PROPS 16 |
Maximum properties echoed in a WebDAV PROPPATCH 207 response (bounds the response).
Definition at line 1016 of file buffer_sizing.h.
| #define PROTOCORE_METHOD_BUF_SIZE 8 |
HTTP method-token buffer size (bytes, including the NUL).
Sized for the longest method the server must recognize: 8 normally (OPTIONS), grown to fit the WebDAV methods (PROPPATCH is 9 chars) when WebDAV is enabled.
Definition at line 1029 of file buffer_sizing.h.
| #define PROTOCORE_STOMP_MAX_HEADERS 16 |
Max header lines parsed per STOMP frame (extras beyond this are ignored).
Definition at line 1035 of file buffer_sizing.h.
| #define PROTOCORE_SIMATIC_BLOCK_MAX 256 |
3964R block-body buffer size (built/received bytes: DLE-stuffed payload + DLE ETX + BCC).
Definition at line 1040 of file buffer_sizing.h.
| #define PROTOCORE_SIMATIC_QVZ_MS 2000 |
3964R QVZ (Quittungsverzugszeit): handshake acknowledge-delay timeout, ms. Siemens AcknDelayTime, default 16#07D0.
Definition at line 1046 of file buffer_sizing.h.
| #define PROTOCORE_SIMATIC_ZVZ_MS 220 |
3964R ZVZ (Zeichenverzugszeit): inter-character timeout while receiving a block, ms. Siemens CharacterDelayTime, default 16#00DC.
Definition at line 1052 of file buffer_sizing.h.
| #define PROTOCORE_SPB_METRIC_MAX 256 |
Max serialized size of one Sparkplug B metric submessage (stack temp, bytes).
Definition at line 1057 of file buffer_sizing.h.
| #define PROTOCORE_MODBUS_COILS 64 |
Number of Modbus coils (FC 1/5/15), single-bit R/W (BSS, bit-packed).
Definition at line 1062 of file buffer_sizing.h.
| #define PROTOCORE_MODBUS_DISCRETE_INPUTS 64 |
Number of Modbus discrete inputs (FC 2), single-bit read-only (BSS, bit-packed).
Definition at line 1067 of file buffer_sizing.h.
| #define PROTOCORE_MODBUS_HOLDING_REGS 64 |
Number of Modbus holding registers (FC 3/6/16), 16-bit R/W (BSS).
Definition at line 1072 of file buffer_sizing.h.
| #define PROTOCORE_MODBUS_INPUT_REGS 64 |
Number of Modbus input registers (FC 4), 16-bit read-only (BSS).
Definition at line 1077 of file buffer_sizing.h.
| #define MAX_TLS_CONNS 1 |
Maximum simultaneous TLS connections (each holds mbedTLS record buffers).
Definition at line 1082 of file buffer_sizing.h.
| #define PROTOCORE_TLS_TICKET_LIFETIME_S 86400 |
Session-ticket lifetime / key-rotation period in seconds (see PROTOCORE_ENABLE_TLS_RESUMPTION).
Definition at line 1087 of file buffer_sizing.h.
| #define PROTOCORE_MTLS_SUBJECT_MAX 128 |
Maximum length of a verified mTLS peer subject DN string (incl. NUL).
Definition at line 1092 of file buffer_sizing.h.
| #define PROTOCORE_SNMP_TRAP_MAX_VARBINDS 8 |
Maximum extra variable-bindings (beyond sysUpTime/snmpTrapOID) in one notification.
Definition at line 1097 of file buffer_sizing.h.
| #define PROTOCORE_SNMP_TRAP_BUF_SIZE 1024 |
Static datagram buffer for an outbound SNMP notification, bytes.
Definition at line 1102 of file buffer_sizing.h.
| #define SNMP_MAX_OID_LEN 32 |
Maximum sub-identifiers (arcs) in an SNMP object identifier.
Definition at line 1107 of file buffer_sizing.h.
| #define SNMP_MAX_MIB_ENTRIES 16 |
Maximum registered MIB objects (the agent's fixed OID table).
Each entry holds its OID, a value descriptor, and optional get/set callbacks (see src/services/net/snmp/snmp_agent.h). The table lives in BSS; entries are scanned linearly (small table) and need not be registered in OID order.
Definition at line 1118 of file buffer_sizing.h.
| #define SNMP_MAX_VARBINDS 16 |
Maximum variable bindings the agent will emit in one response.
Bounds GetBulk expansion (max-repetitions is clamped so the total response varbind count never exceeds this) and the per-request decode scratch.
Definition at line 1128 of file buffer_sizing.h.
| #define SNMP_MSG_BUF_SIZE 1472 |
Static request/response datagram buffers for the SNMP UDP agent.
Two buffers of this size live in BSS (one in, one out) - no heap. 484 is the RFC 1157 minimum maximum message size; the default holds a one-frame UDP payload so GetBulk walks fit without IP fragmentation.
Definition at line 1139 of file buffer_sizing.h.
| #define SNMP_COMMUNITY_MAX 32 |
Maximum SNMP community-string length (including null terminator).
Definition at line 1144 of file buffer_sizing.h.
| #define PROTOCORE_SNMP_DEFAULT_RO_COMMUNITY "public" |
Default read-only community (overridable at runtime via SnmpAgent.community.ro + SnmpAgent.init). Deployments SHOULD change this from the RFC-1157 well-known "public" for anything but a closed network.
Definition at line 1151 of file buffer_sizing.h.
| #define SNMP_V3_USER_MAX 32 |
Maximum SNMPv3 USM user-name length (including null terminator).
Definition at line 1156 of file buffer_sizing.h.
| #define SNMP_V3_ENGINEID_MAX 32 |
Maximum SNMPv3 authoritative engine-ID length in bytes (RFC 3411 allows 5..32).
Definition at line 1161 of file buffer_sizing.h.
| #define PROTOCORE_COAP_MAX_OBSERVERS 4 |
Maximum simultaneous CoAP observers (one slot per observed resource per client).
Definition at line 1170 of file buffer_sizing.h.
| #define PROTOCORE_COAP_DEDUP_ENTRIES 4 |
CoAP message de-duplication cache size (RFC 7252 sec 4.5). A Confirmable request the server has already answered is recognized by its (source endpoint, Message-ID) and re-answered with the cached response WITHOUT re-running the handler - so a client's CON retransmission cannot execute a non-idempotent request (POST/PUT/DELETE) twice. Set to 0 to compile the dedup cache out.
Definition at line 1180 of file buffer_sizing.h.
| #define PROTOCORE_COAP_DEDUP_RESP_MAX 256 |
Largest cached response the dedup cache retains per entry; a bigger response is not cached (a retransmission re-processes it, fine for the idempotent GET whose block-wise reply exceeds this).
Definition at line 1186 of file buffer_sizing.h.
| #define PROTOCORE_COAP_DEDUP_LIFETIME_MS 247000u |
How long (ms) a dedup entry stays fresh - RFC 7252 EXCHANGE_LIFETIME (~247 s) by default, past which a repeat Message-ID is treated as a new exchange.
Definition at line 1192 of file buffer_sizing.h.
| #define PROTOCORE_COAP_BLOCK_SZX_MAX 6 |
Largest block-size exponent (SZX) the server will use: block size = 2^(SZX+4) bytes, SZX 0..6 (16..1024).
Definition at line 1197 of file buffer_sizing.h.
| #define PROTOCORE_COAP_BLOCK1_MAX 1024 |
Reassembly buffer for a block-wise (Block1) request upload, in bytes.
One buffer of this size lives in BSS only when PROTOCORE_ENABLE_COAP_BLOCK is set. It bounds the largest payload a chunked POST/PUT can deliver to a handler.
Definition at line 1207 of file buffer_sizing.h.
| #define PROTOCORE_COAP_MAX_RESOURCES 8 |
Maximum registered CoAP resources (the server's fixed routing table).
Each entry holds a path pointer, an allowed-methods bitmask, and a handler. The table lives in BSS and is scanned linearly (small table).
Definition at line 1217 of file buffer_sizing.h.
| #define PROTOCORE_COAP_MAX_PATH 64 |
Maximum reconstructed Uri-Path length, including separators and the leading '/'.
Definition at line 1222 of file buffer_sizing.h.
| #define PROTOCORE_COAP_MAX_QUERY 64 |
Maximum reconstructed Uri-Query length (segments joined by '&').
Definition at line 1227 of file buffer_sizing.h.
| #define PROTOCORE_COAP_MAX_PAYLOAD 256 |
Maximum CoAP request/response payload in bytes.
Sizes the static scratch a handler writes its response body into and bounds the request payload handed to it. One buffer of this size lives in BSS.
Definition at line 1237 of file buffer_sizing.h.
| #define PROTOCORE_COAP_MSG_BUF_SIZE 512 |
Static response-datagram buffer for the CoAP UDP server.
One buffer of this size lives in BSS (the request is transport-owned). Must hold a 4-byte header + token (<=8) + the Content-Format option + a 0xFF marker
Definition at line 1253 of file buffer_sizing.h.
| #define PROTOCORE_COAP_OBSERVE_PORT 5683 |
Default UDP port the CoAP observe transport notifies from (IANA well-known 5683).
Definition at line 1259 of file buffer_sizing.h.
| #define PROTOCORE_TLS_ARENA_SIZE (49152 + (MAX_TLS_CONNS - 1) * 32768) |
Bytes of the static BSS arena mbedTLS allocates from (PROTOCORE_ENABLE_TLS).
All mbedTLS allocations (per-connection record buffers, handshake temporaries, cert/key parsing) are served from this fixed arena via a custom allocator installed with mbedtls_platform_set_calloc_free() - never the system heap. Must cover the worst-case handshake peak for MAX_TLS_CONNS; if undersized the handshake fails cleanly (no corruption). Measured peak for ONE ECDSA P-256 connection on Arduino-esp32 (16 KB IN + 16 KB OUT records) is ~41.5 KB, so the default leaves a small margin. An RSA cert/larger chain needs more; query the live peak via protocore_tls_arena_peak(). NOTE: a second concurrent TLS connection roughly doubles the record-buffer cost (~32 KB more), which overflows the static DRAM budget - keep MAX_TLS_CONNS at 1 unless you shrink the IDF record sizes (CONFIG_MBEDTLS_SSL_IN/OUT_CONTENT_LEN, needs an ESP-IDF build).
Definition at line 1283 of file buffer_sizing.h.
| #define PROTOCORE_TLS_ARENA_IN_PSRAM 0 |
Place the TLS arena in external PSRAM instead of internal DRAM (ESP32).
The internal static-DRAM ceiling (dram0_0_seg) is only ~122 KB, so a single ~48 KB arena already uses a large slice and a second concurrent connection (MAX_TLS_CONNS > 1) overflows it. On a board with PSRAM, set this to 1 to move the arena to external RAM via EXT_RAM_BSS_ATTR / EXT_RAM_ATTR, freeing the whole PROTOCORE_TLS_ARENA_SIZE back to internal DRAM so many connections fit. Requires CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY (and PSRAM enabled) in the ESP-IDF/PlatformIO config; without it the attribute is a no-op and the arena stays in DRAM (safe fallback). No effect on the native host build.
Definition at line 1299 of file buffer_sizing.h.
| #define PROTOCORE_TLS_MAX_FRAG_LEN 0 |
Cap TLS records via the Maximum Fragment Length extension (RFC 6066).
0 (default) leaves the 16 KB TLS record ceiling. Set to 512, 1024, 2048, or 4096 to negotiate a smaller maximum record. On a mbedTLS build with variable-length record buffers this shrinks the per-connection arena footprint (so more concurrent connections fit); on a fixed-buffer build it still bounds the on-wire record size (bandwidth / latency on a constrained link) and honors a client's MFL request. Applied to both the server and the outbound client config. Needs an mbedTLS build with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH (else it is a no-op).
Definition at line 1314 of file buffer_sizing.h.
| #define PROTOCORE_TLS_ECDHE_PREFER_P256 PROTOCORE_HW_ECC |
Lead the ECDHE curve/group preference with secp256r1 (P-256) instead of x25519.
PER-VARIANT by default, because the ECC silicon differs wildly between dies. On a chip with a hardware NIST-ECC accelerator (PROTOCORE_HW_ECC = 1: ESP32-P4/C5/C6/C61/H2/H4/... where mbedTLS routes P-256 through the HW via ecc_alt), P-256 is dramatically faster than x25519, which stays software (measured on an ESP32-P4: P-256 ECDHE ~10 ms vs x25519 ~132 ms, and the full TLS handshake ~29 ms vs ~160 ms - a 5.5x win). On a chip WITHOUT ECC HW (PROTOCORE_HW_ECC = 0: ESP32-S3/S2/classic), both curves are software and near-identical in the full handshake, so x25519 (the security-preferred modern default) leads and this stays 0 (the S3 order is unchanged).
So the default tracks PROTOCORE_HW_ECC - the profile's assertion that the die has NIST-ECC HW - and is overridable: force -DPROTOCORE_TLS_ECDHE_PREFER_P256=0 to mandate x25519-first even on an ECC-HW chip (a deployment policy choice), or =1 to prefer P-256 on a chip whose profile has not flagged HW ECC. This only reorders PREFERENCE; every curve stays enabled, so a peer that offers just one still connects. Applied to both the server and outbound-client configs (tls.cpp tls_apply_curve_pref).
Definition at line 1335 of file buffer_sizing.h.
| #define PROTOCORE_TLS_ACK_MULTI_CONN_DRAM 0 |
Acknowledge that a MAX_TLS_CONNS > 1 build has been sized to fit.
The whole TLS arena is static .bss and the internal dram0_0_seg ceiling is only ~122 KB, so a second concurrent connection's arena overflows it on a stock build. A validation guard (bottom of this file) therefore rejects MAX_TLS_CONNS > 1 unless you have taken one of the paths in docs/KNOWN_LIMITATIONS.md - move the arena to PSRAM (PROTOCORE_TLS_ARENA_IN_PSRAM, which satisfies the guard on its own), shrink the mbedTLS records in a custom ESP-IDF build, or reclaim internal DRAM - and then set this to 1 to confirm the build was sized deliberately.
Definition at line 1350 of file buffer_sizing.h.
| #define PROTOCORE_MDNS_MAX_SERVICES 4 |
Services the responder advertises at once, _http._tcp included.
Definition at line 1360 of file buffer_sizing.h.
| #define PROTOCORE_MDNS_TXT_MAX 128 |
Bytes of packed key=value TXT strings, each with its own length byte ahead of it.
Definition at line 1365 of file buffer_sizing.h.
| #define PROTOCORE_MDNS_LABEL_MAX 32 |
Longest host label, service type or proto label the responder holds, NUL included.
Definition at line 1370 of file buffer_sizing.h.
| #define PROTOCORE_MDNS_TX_MAX 512 |
Response datagram the responder composes.
One answer set is an A plus, per service, two PTRs, an SRV and a TXT, so this bounds how many services fit one packet rather than how many may be registered.
Definition at line 1380 of file buffer_sizing.h.
| #define PROTOCORE_NTP_CLIENT_PORT 1123 |
Local UDP port the portable SNTP client asks from.
Not 123: a device running PROTOCORE_ENABLE_NTP_SERVER already holds that port, and the client has to bind one of its own to hear the reply come back.
Definition at line 1390 of file buffer_sizing.h.
| #define PROTOCORE_NTP_SERVER_STRATUM 3 |
Stratum the NTP server advertises (distance from a reference clock; 1-15).
Definition at line 1395 of file buffer_sizing.h.
| #define PROTOCORE_DNS_SERVER_MAX_RECORDS 8 |
Max A records in the DNS server's fixed table.
Definition at line 1400 of file buffer_sizing.h.
| #define PROTOCORE_DNS_SERVER_TTL 60 |
TTL (seconds) the DNS server puts on its answers.
Definition at line 1405 of file buffer_sizing.h.
| #define PROTOCORE_DNS_NAME_MAX 128 |
Max length of a queried/stored DNS name (bytes, incl NUL).
Definition at line 1410 of file buffer_sizing.h.
| #define PROTOCORE_ENABLE_HTTP_CLOCK 0 |
Auto-inject a Date response header (RFC 7231 7.1.1.2) when a wall-clock time is available.
Default off: a clock-less device must not emit a wrong Date, and most embedded responses do not need one, so it stays off the hot path. When set, every dynamic response carries Date: <IMF-fixdate> - but only once a real time exists; before a source has valid time it is silently omitted (still correct for a clock-less boot).
The time is taken from the multi-source registry (any enabled NTP / GPS / RTC / ... by priority) when PROTOCORE_ENABLE_TIME_SOURCE is set - register your sources with protocore_time_source_add() (protocore_rtc_time_source, protocore_ntp_time_source, ...). Otherwise it comes straight from the NTP client. Needs at least one such time source to emit.
Which of the two a build has is ::HttpClock's decision, made once in server/io/http_clock rather than by each caller: this flag is what compiles that module in, and it takes PROTOCORE_HTTP_CLOCK_BORROW from the plaintext arena to hold the rendered value.
Definition at line 1432 of file buffer_sizing.h.
| #define PROTOCORE_TIME_SOURCE_MAX 4 |
Maximum registered time sources (PROTOCORE_ENABLE_TIME_SOURCE).
Definition at line 1437 of file buffer_sizing.h.
| #define PROTOCORE_I2C_SDA_PIN -1 |
Shared I2C bus pins for the sensor / peripheral drivers (RTC, SHT3x, MPR121, ADS1115, INA219, PCA9685). All of them share one bus via protocore_i2c_begin() (server/peripherals/i2c.h), so this is the single place to move it. The default -1 uses the platform's default pins (GPIO 21 SDA / 22 SCL on the classic ESP32). Set both to free GPIOs when those pins are taken - most importantly a wired-Ethernet PHY: the LAN8720 RMII uses GPIO 21 (TX_EN) and GPIO 22 (TXD1) on the classic ESP32 (WROOM/WROVER) and the ESP32-P4 (which have the RMII EMAC), so with that Ethernet on, move the I2C bus off them (e.g. 32 / 33). The ESP32-S3/C3 have no RMII MAC and use an SPI Ethernet (W5500) instead - relocate the bus off whatever SPI pins that uses. UART peripherals (LD2410) take their RX/TX pins at protocore_ld2410_begin(), so remap those too.
Definition at line 1452 of file buffer_sizing.h.
| #define PROTOCORE_I2C_SCL_PIN -1 |
Definition at line 1455 of file buffer_sizing.h.
| #define PROTOCORE_SPI_MOSI_PIN -1 |
Shared SPI bus pins for the peripheral drivers, the same way the I2C pins above are shared. The default -1 uses the platform's default pins for its VSPI/HSPI host. Set them when those pins are taken, most often by a W5500 SPI Ethernet on a part with no RMII MAC (the ESP32-S3 / C3), which drives this same bus.
Definition at line 1465 of file buffer_sizing.h.
| #define PROTOCORE_SPI_MISO_PIN -1 |
Definition at line 1468 of file buffer_sizing.h.
| #define PROTOCORE_SPI_SCLK_PIN -1 |
Definition at line 1471 of file buffer_sizing.h.
| #define PROTOCORE_RTC_I2C_ADDR 0x68 |
I2C address of the RTC (DS1307/DS3231 are fixed at 0x68).
Definition at line 1476 of file buffer_sizing.h.
| #define PROTOCORE_HMMD_BAUD 115200 |
HMMD UART baud rate (the module's factory default is 115200).
Definition at line 1481 of file buffer_sizing.h.
| #define PROTOCORE_HMMD_UART 2 |
UART unit the HMMD is wired to. Unit 2 is the one free of the console on most boards.
Definition at line 1486 of file buffer_sizing.h.
| #define PROTOCORE_LD2410_BAUD 256000 |
LD2410 UART baud rate (the module's fixed factory default is 256000).
Definition at line 1491 of file buffer_sizing.h.
| #define PROTOCORE_LD2410_UART 2 |
UART unit the LD2410 is wired to. Unit 2 is the one free of the console on most boards.
Definition at line 1496 of file buffer_sizing.h.
| #define PROTOCORE_SEN0192_PIN 4 |
GPIO the SEN0192 OUT line is wired to.
Definition at line 1501 of file buffer_sizing.h.
| #define PROTOCORE_SEN0192_HOLD_MS 2000 |
Presence is held this many ms after the last active (motion) sample before it clears.
Definition at line 1506 of file buffer_sizing.h.
| #define PROTOCORE_SEN0192_ACTIVE_HIGH 1 |
SEN0192 OUT polarity: 1 = the OUT line reads HIGH on motion, 0 = active-LOW.
Definition at line 1511 of file buffer_sizing.h.
| #define PROTOCORE_MPR121_I2C_ADDR 0x5A |
I2C address of the MPR121 (0x5A default; 0x5B/0x5C/0x5D via the ADDR pin).
Definition at line 1516 of file buffer_sizing.h.
| #define PROTOCORE_MPR121_TOUCH_THRESHOLD 12 |
MPR121 per-electrode touch threshold (delta counts from baseline; NXP AN3944 suggests ~4..12). Higher = less sensitive. Keep the release threshold below it for hysteresis.
Definition at line 1522 of file buffer_sizing.h.
| #define PROTOCORE_MPR121_RELEASE_THRESHOLD 6 |
MPR121 per-electrode release threshold (delta counts; should be below the touch threshold).
Definition at line 1527 of file buffer_sizing.h.
| #define PROTOCORE_SHT3X_I2C_ADDR 0x44 |
I2C address of the SHT3x (0x44 with ADDR low; 0x45 with ADDR high).
Definition at line 1532 of file buffer_sizing.h.
| #define PROTOCORE_PCA9685_I2C_ADDR 0x40 |
I2C address of the PCA9685 (0x40 default; the six address pins select 0x40..0x7F).
Definition at line 1537 of file buffer_sizing.h.
| #define PROTOCORE_PCA9685_FREQ 50 |
Default PWM output frequency in Hz (50 Hz suits hobby servos).
Definition at line 1542 of file buffer_sizing.h.
| #define PROTOCORE_ADS1115_I2C_ADDR 0x48 |
I2C address of the ADS1115 (0x48 with ADDR to GND; 0x49/0x4A/0x4B for VDD/SDA/SCL).
Definition at line 1547 of file buffer_sizing.h.
| #define PROTOCORE_ADS1115_GAIN 2 |
Default ADS1115 PGA gain code (ADS1115_GAIN_*): 0=+/-6.144V, 1=+/-4.096V, 2=+/-2.048V (default), 3=+/-1.024V, 4=+/-0.512V, 5=+/-0.256V. Also the fallback when a read passes an invalid gain.
Definition at line 1553 of file buffer_sizing.h.
| #define PROTOCORE_ADS1115_DR 4 |
Default ADS1115 data-rate code (ADS1115_DR_*): 0=8, 1=16, 2=32, 3=64, 4=128 (default), 5=250, 6=475, 7=860 SPS. The single-shot read waits the matching conversion time.
Definition at line 1559 of file buffer_sizing.h.
| #define PROTOCORE_ADS1115_DIFFERENTIAL 0 |
ADS1115 input mode: 0 = single-ended (AINx vs GND), 1 = differential. In differential mode the channel selects the pair: 0=AIN0-AIN1, 1=AIN0-AIN3, 2=AIN1-AIN3, 3=AIN2-AIN3.
Definition at line 1565 of file buffer_sizing.h.
| #define PROTOCORE_INA219_I2C_ADDR 0x40 |
I2C address of the INA219 (0x40 default; the A0/A1 pins select 0x40..0x4F).
Definition at line 1570 of file buffer_sizing.h.
| #define PROTOCORE_INA219_CURRENT_LSB_UA 100 |
Default INA219 current LSB in microamps per bit (calibration input). The fallback when Ina219.begin is passed 0. 100 uA/bit with a 100 mohm shunt -> a 2 A full-scale range.
Definition at line 1576 of file buffer_sizing.h.
| #define PROTOCORE_INA219_SHUNT_MOHM 100 |
Default INA219 shunt resistance in milliohms (calibration input). The fallback when Ina219.begin is passed 0. 100 mohm is the common breakout value.
Definition at line 1582 of file buffer_sizing.h.
| #define PROTOCORE_CONFIG_MAX_ENTRIES 16 |
Max key/value entries in the host (test) config backend.
Definition at line 1587 of file buffer_sizing.h.
| #define PROTOCORE_CONFIG_KEY_MAX 16 |
Max key length incl. null (NVS caps keys at 15 chars).
Definition at line 1592 of file buffer_sizing.h.
| #define PROTOCORE_CONFIG_VAL_MAX 2048 |
Max value bytes per entry in the host (test) config backend.
Holds the largest blob the seam carries, which is the SSH host key's PKCS#8 DER (SSH_RSA_KEY_DER_MAX, 1700). A power of two keeps the row stride a shift.
Definition at line 1602 of file buffer_sizing.h.
| #define PROTOCORE_THEMES_INCLUDE_TRADEMARKED 1 |
Include the trademark-named themes in the embedded set (default on / open-source).
A few themes are named after a company or product (Darcula, Windows XP, Discord, Spotify, ...). The palette is just colors, but a commercial product should not ship the branded name, so a commercial build sets this to 0 to drop those blobs from the registry (the list is RESTRICTED in src/web_assets/wizard/gen_themes.py). The open-source (AGPL) build keeps them.
Definition at line 1614 of file buffer_sizing.h.
| #define PROTOCORE_DASHBOARD_MAX_WIDGETS 16 |
Maximum widgets in the dashboard table (BSS value array).
Definition at line 1619 of file buffer_sizing.h.
| #define PROTOCORE_DASHBOARD_JSON_BUF 1024 |
Stack buffer for the dashboard layout / values JSON (bytes).
Definition at line 1624 of file buffer_sizing.h.
| #define PROTOCORE_PARTITION_MAX 16 |
Maximum partitions the monitor reports (BSS table).
Definition at line 1629 of file buffer_sizing.h.
| #define PROTOCORE_PARTITION_JSON_BUF 1024 |
Stack buffer for the partition-map JSON (bytes).
Definition at line 1634 of file buffer_sizing.h.
| #define PROTOCORE_GPIO_MAX 40 |
Maximum GPIO pins the mapper reports (BSS table).
Definition at line 1639 of file buffer_sizing.h.
| #define PROTOCORE_GPIO_JSON_BUF 1024 |
Stack buffer for the GPIO-map JSON (bytes).
Definition at line 1644 of file buffer_sizing.h.
| #define PROTOCORE_UDP_TELEMETRY_BUF 256 |
Stack buffer for one telemetry line (bytes).
Definition at line 1649 of file buffer_sizing.h.
| #define PROTOCORE_STATSD_PORT 8125 |
Default StatsD collector UDP port (StatsD/Graphite standard).
Definition at line 1654 of file buffer_sizing.h.
| #define PROTOCORE_STATSD_LINE_MAX 256 |
Stack buffer for one StatsD line (bytes; caps metric name + value + tags).
Definition at line 1659 of file buffer_sizing.h.
| #define PROTOCORE_GUARDRAIL_HEAP_MIN 8192 |
Free-heap floor (bytes); below this trips the heap guardrail.
Definition at line 1664 of file buffer_sizing.h.
| #define PROTOCORE_GUARDRAIL_FRAG_MIN_BLOCK 4096 |
Largest-free-block floor (bytes); below this trips the fragmentation guardrail.
Definition at line 1669 of file buffer_sizing.h.
| #define PROTOCORE_GUARDRAIL_STACK_MIN 512 |
Task remaining-stack floor (bytes); below this trips the stack guardrail.
Definition at line 1674 of file buffer_sizing.h.
| #define PROTOCORE_FAILSAFE_MAX_LIFELINES 8 |
Max monitored lifelines in the fail-safe registry (static, zero-heap).
Definition at line 1679 of file buffer_sizing.h.
| #define PROTOCORE_POWER_MHZ_MAX 240 |
CPU clock (MHz) when there is work to do.
Definition at line 1684 of file buffer_sizing.h.
| #define PROTOCORE_POWER_MHZ_MIN 80 |
CPU clock (MHz) when idle, thermally throttled, or recovering from a brownout.
Definition at line 1689 of file buffer_sizing.h.
| #define PROTOCORE_POWER_BUSY_PCT 40 |
Load percentage at/above which the ceiling clock is used.
Definition at line 1694 of file buffer_sizing.h.
| #define PROTOCORE_POWER_TEMP_HOT_C 80 |
Die temperature (C) at/above which the clock is throttled.
Definition at line 1699 of file buffer_sizing.h.
| #define PROTOCORE_POWER_TEMP_COOL_C 70 |
Die temperature (C) at/below which the throttle is released.
Deliberately below PROTOCORE_POWER_TEMP_HOT_C: with a single threshold a part sitting exactly at the limit would flap between ceiling and floor every tick, which is worse than either state.
The gap has to be wider than the temperature swing the clock change itself causes, or the governor oscillates no matter how correct the hysteresis is. Measured on an ESP32-S3: dropping 240 -> 80 MHz cools the die about 2 C within one 500 ms tick, and going back up reheats it by the same amount. A band narrower than that swing is self-sustaining - the throttle's own effect carries the die back across the release threshold. The 10 C default clears it with room to spare.
Definition at line 1715 of file buffer_sizing.h.
| #define PROTOCORE_POWER_RECOVER_MS 10000 |
How long (ms) to hold the floor clock after a brownout reset before ramping back up.
Definition at line 1720 of file buffer_sizing.h.
| #define PROTOCORE_HOTSWAP_FAIL_THRESHOLD 3 |
Consecutive I/O failures that declare a removable volume gone.
Not 1: a single failed write is not proof a card left (a transient bus error, a full volume), and tearing down a working mount over one error would be its own bug. Any success resets the run.
Definition at line 1730 of file buffer_sizing.h.
| #define PROTOCORE_HOTSWAP_PROBE_MS 2000 |
Minimum gap between remount attempts while a volume is absent or faulted (ms).
Definition at line 1735 of file buffer_sizing.h.
| #define PROTOCORE_MTC_SAMPLE_BUFFER 32 |
MTConnect rolling sample buffer sizing (PROTOCORE_ENABLE_MTCONNECT).
The agent retains the most recent PROTOCORE_MTC_SAMPLE_BUFFER observations in a fixed ring so a subscriber can replay them with the sample from/count long-poll cursor (MTC1.4 ยง6.7): a request asks for observations starting at a sequence number, and the response header reports firstSequence / lastSequence / nextSequence so the client knows what it received and where to resume. Each retained observation stores its type / dataItemId / timestamp / value in fixed char fields; when the ring is full the oldest is evicted and firstSequence advances. Zero-heap, compile-time sized; the buffer costs ~PROTOCORE_MTC_SAMPLE_BUFFER * (48 + the four string caps) bytes only where a protocore_mtc_sample_buffer is used.
Definition at line 1750 of file buffer_sizing.h.
| #define PROTOCORE_MTC_STR_MAX 24 |
Definition at line 1754 of file buffer_sizing.h.
| #define PROTOCORE_MTC_TS_MAX 32 |
Definition at line 1757 of file buffer_sizing.h.
| #define PROTOCORE_MTC_VAL_MAX 32 |
Definition at line 1760 of file buffer_sizing.h.
| #define PROTOCORE_MTCONNECT_BORROW |
The bytes an MTConnect document runs out of: the running context and the observation ring.
One retained observation is its four strings, its sequence and its category, and the slack covers the padding the compiler puts between them plus the context in front of the ring. The exact layout is mtconnect.c's, and that translation unit includes both and proves this covers it - the same arrangement PROTOCORE_SSH_SLOT_BYTES has with the SSH offsets.
Definition at line 1772 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_MTCONNECT 0 |
Definition at line 1782 of file buffer_sizing.h.
| #define PROTOCORE_DNC_LINE_MAX 128 |
Largest G-code block (one line) the DNC decoder reassembles (PROTOCORE_ENABLE_DNC).
A block longer than this overflows the decoder's fixed line buffer and is dropped whole (::DNC_EV_OVERFLOW) rather than truncated. Sized for a normal G-code line; raise it only for unusually long blocks (many parameters). Zero heap - this is the static per-decoder buffer.
Definition at line 1793 of file buffer_sizing.h.
| #define PROTOCORE_DNC_LEADER_LEN 32 |
Default leader/trailer runout length for the DNC encoder (PROTOCORE_ENABLE_DNC).
The number of NUL runout bytes ::protocore_dnc_encode_leader emits before the program (and can emit after it). The reader skips them until the first %. Traditional tape leaders were a few inches of blank feed; 32 bytes is a serial-link equivalent. Overridable per call via DncCfg::leader_len.
Definition at line 1804 of file buffer_sizing.h.
| #define PROTOCORE_DNC_XOFF_MAX_POLLS 200000 |
Safety cap on how many times the DNC stream engine polls the reverse channel while paused by an XOFF, before giving up with an I/O error (PROTOCORE_ENABLE_DNC).
dnc_stream pauses on XOFF and polls recv for the XON that resumes it; a well-behaved transport paces recv (blocks briefly when idle) so this cap is only a backstop against a recv that spins returning no data forever. Raise it if a slow controller legitimately holds XOFF for a long time.
Definition at line 1816 of file buffer_sizing.h.
| #define PROTOCORE_BRIDGE_MAX_RULES 8 |
Max concurrent address:port -> bus rules (server/net/iface_bridge).
Definition at line 1821 of file buffer_sizing.h.
| #define PROTOCORE_BRIDGE_TXN_MAX 256 |
Max write / read payload (bytes) per TRANSACTION frame (server/net/iface_bridge).
Bounds the per-transaction stack scratch used to clock an SPI/I2C write-then-read, and rejects a frame whose write_len or read_len exceeds it. Device-server transactions are small register accesses, so the default is modest; a frame over the cap closes the connection (protocol error). Keep it comfortably under the transport RX ring so a whole frame can buffer before it is parsed.
Definition at line 1833 of file buffer_sizing.h.
| #define PROTOCORE_BRIDGE_STREAM_CHUNK 256 |
STREAM (UART) pipe chunk size (bytes) for server/net/iface_bridge - one socket<->UART hop.
Definition at line 1838 of file buffer_sizing.h.
| #define PROTOCORE_BRIDGE_MAX_DRAIN 8 |
Chunks a STREAM target moves per poll before yielding, bounding the UART drain loop.
Definition at line 1843 of file buffer_sizing.h.
| #define PROTOCORE_BRIDGE_UART_TXN_MS 50 |
UART TRANSACTION read window (ms): how long a write-then-read waits for the read_len reply.
Definition at line 1848 of file buffer_sizing.h.
| #define PROTOCORE_NTRIP_MAX_ROVERS 4 |
Max concurrent rover connections a caster serves corrections to (services/timing_position/gnss).
Definition at line 1853 of file buffer_sizing.h.
| #define PROTOCORE_ENABLE_NTRIP_CASTER_NEEDS_NMEA0183 PROTOCORE_ENABLE_NMEA0183 |
Definition at line 1857 of file buffer_sizing.h.
| #define PROTOCORE_NTRIP_MOUNT_MAX 32 |
Max length (incl. NUL) of an NTRIP mountpoint name the caster serves.
Definition at line 1864 of file buffer_sizing.h.
| #define PROTOCORE_NTRIP_REQ_MAX 512 |
Max NTRIP client request size (bytes) the caster buffers while reading the request headers.
Definition at line 1869 of file buffer_sizing.h.
| #define PROTOCORE_NTRIP_MAX_MOUNTS 2 |
Max distinct mountpoints a single caster serves (each = one RTCM stream).
Definition at line 1874 of file buffer_sizing.h.
| #define PROTOCORE_RELAY_BUF 2048 |
Per-direction relay buffer size (bytes) for server/net/relay (PROTOCORE_ENABLE_RELAY).
Each active relay holds two buffers of this size (one per direction) for bytes read from one peer but not yet accepted by the other (backpressure carry). Larger buffers raise throughput per step (fewer cross-thread Tcp.conn->send marshals per KB) at the cost of RAM per concurrent relay (2 * PROTOCORE_RELAY_BUF * PROTOCORE_RELAY_MAX_CONNS bytes).
Definition at line 1886 of file buffer_sizing.h.
| #define PROTOCORE_RELAY_DRAIN_MAX 8 |
Max protocore_relay_step passes per poll for the relay listener (PROTOCORE_ENABLE_RELAY).
One poll drains up to this many PROTOCORE_RELAY_BUF chunks per direction, so a single event forwards the whole buffered origin RX ring (PROTOCORE_CLIENT_RX_BUF) instead of one chunk - the difference between a ~0.4 Mbps and a multi-Mbps port-forward. Bounded so one busy bridge cannot starve the others.
Definition at line 1897 of file buffer_sizing.h.
| #define PROTOCORE_RELAY_MAX_PUBLISH 4 |
Max published relay ports (bind table size) for the relay listener (PROTOCORE_ENABLE_RELAY).
Each protocore_relay_publish() call binds one listener port to one origin host:port. This caps how many distinct ports the device can front at once.
Definition at line 1907 of file buffer_sizing.h.
| #define PROTOCORE_RELAY_MAX_CONNS 4 |
Max concurrent relayed connections (bridge table size) for the relay listener (PROTOCORE_ENABLE_RELAY). Each holds a protocore_relay (two PROTOCORE_RELAY_BUF buffers) + an origin slot.
Definition at line 1915 of file buffer_sizing.h.
| #define PROTOCORE_RELAY_HOST_MAX 64 |
Max origin hostname length (bytes, incl. NUL) stored per published relay port.
Definition at line 1920 of file buffer_sizing.h.
| #define PROTOCORE_RELAY_CONNECT_MS 5000 |
Blocking connect timeout (ms) when the relay listener dials the origin on a new inbound.
Definition at line 1925 of file buffer_sizing.h.
| #define PROTOCORE_FTP_CMD_MAX 256 |
Suggested FTP control-command buffer size (PROTOCORE_ENABLE_FTP).
A convenience cap for callers sizing the buffer they hand protocore_ftp_build_command; the builders are all length-checked against the caller's cap, so this is only a sensible default. Large enough for a RETR / STOR with a long path.
Definition at line 1936 of file buffer_sizing.h.
| #define PROTOCORE_FTP_REPLY_BUF 512 |
Control-reply accumulator for the FTP session driver (PROTOCORE_ENABLE_FTP_SESSION).
services/ftp_session buffers a whole control reply here before parsing it. Multiline greetings and FEAT listings are the large cases; a reply that will not fit is treated as malformed rather than waited on forever.
Definition at line 1947 of file buffer_sizing.h.
| #define PROTOCORE_FTP_CHUNK 512 |
Bytes staged per data-channel write when the session driver streams a payload.
Definition at line 1952 of file buffer_sizing.h.
| #define PROTOCORE_FTP_TIMEOUT_MS 8000 |
Per-step timeout for the FTP session driver: connect, and each control reply.
Definition at line 1957 of file buffer_sizing.h.
| #define PROTOCORE_EDGE_SD_VALUE_MAX |
Worst-case serialized L2 entry (edge_sd_serialize).
Definition at line 1961 of file buffer_sizing.h.
| #define PROTOCORE_EDGE_MESH_TRAILER (8 /*date*/ + 8 /*expires*/ + 4 /*lifetime_s*/ + 4 /*age_hdr*/ + 4 /*age*/) |
Fixed timing trailer prepended to a mesh entry frame (age propagation).
Definition at line 1967 of file buffer_sizing.h.
| #define PROTOCORE_EDGE_MESH_ENTRY_MAX (PROTOCORE_EDGE_MESH_TRAILER + PROTOCORE_EDGE_SD_VALUE_MAX) |
Worst-case mesh entry frame (trailer + a full serialized entry).
Definition at line 1970 of file buffer_sizing.h.
| #define PROTOCORE_EDGE_MESH_RESP_MAX (2 + 1 + 1 + 2 + PROTOCORE_EDGE_MESH_ENTRY_MAX) |
Worst-case mesh response frame (header + entry on a HIT).
Definition at line 1973 of file buffer_sizing.h.
| #define PROTOCORE_EDGE_MESH_REQ_MAX (2 + 1 + 1 + 32 + 2 + PROTOCORE_EDGE_KEY_MAX + 2 + PROTOCORE_MESH_HDRS_MAX) |
Worst-case mesh request frame (bounded request-header snapshot for Vary matching).
Definition at line 1976 of file buffer_sizing.h.
| #define PROTOCORE_EDGE_FETCH_BUF_MIN 2560 |
Definition at line 1984 of file buffer_sizing.h.
| #define PROTOCORE_EDGE_KEY_MAX 128 |
Definition at line 1990 of file buffer_sizing.h.
| #define PROTOCORE_EDGE_VARY_MAX 64 |
Definition at line 1993 of file buffer_sizing.h.
| #define PROTOCORE_EDGE_CTYPE_MAX 64 |
Stored Content-Type to replay.
Definition at line 1998 of file buffer_sizing.h.
| #define PROTOCORE_EDGE_ETAG_MAX 64 |
Stored validator (ETag, quotes included).
Definition at line 2003 of file buffer_sizing.h.
| #define PROTOCORE_EDGE_LASTMOD_MAX 40 |
Stored Last-Modified (RFC 1123 date).
Definition at line 2008 of file buffer_sizing.h.
| #define PROTOCORE_EDGE_CENC_MAX 32 |
Stored Content-Encoding to replay (e.g. gzip).
Definition at line 2013 of file buffer_sizing.h.
| #define PROTOCORE_EDGE_MAP_MAX 4 |
Definition at line 2016 of file buffer_sizing.h.
| #define PROTOCORE_EDGE_ORIGIN_URL_MAX 128 |
Definition at line 2019 of file buffer_sizing.h.
| #define PROTOCORE_EDGE_FETCH_BUF PROTOCORE_EDGE_FETCH_BUF_MIN |
Definition at line 2023 of file buffer_sizing.h.
| #define PROTOCORE_EDGE_FETCH_TIMEOUT_MS 8000 |
Definition at line 2026 of file buffer_sizing.h.
| #define PROTOCORE_EDGE_DEFAULT_TTL_S 60 |
Definition at line 2029 of file buffer_sizing.h.
| #define PROTOCORE_SMB_BUF 1024 |
SMB2 client work-buffer size (bytes) for smb_client's request/response framing.
Two buffers of this size live on the stack during a call, plus a few half-size scratch buffers for the NTLM auth tokens, so the engine needs roughly 4x this in stack. 1024 covers the NEGOTIATE -> SESSION_SETUP -> TREE_CONNECT -> CREATE handshake; raise it if a server's SPNEGO/target-info token or your share path is unusually large.
Definition at line 2046 of file buffer_sizing.h.
| #define PROTOCORE_EXC_COREDUMP_CHUNK 512 |
Chunk the core-dump image is streamed out of flash in (PROTOCORE_EXC_COREDUMP_CHUNK).
protocore_exc_coredump_save() copies the partition to a file this many bytes at a time from a stack buffer, so a dump of any size costs no heap and never has to fit RAM.
Definition at line 2056 of file buffer_sizing.h.
| #define PROTOCORE_DELIVERY_PRECACHE_MAX 16 |
Most asset paths a service-worker precache manifest may list (PROTOCORE_DELIVERY_PRECACHE_MAX).
Definition at line 2063 of file buffer_sizing.h.
| #define PROTOCORE_DELIVERY_MANIFEST_BUF 512 |
Buffer the precache manifest JSON is built into (PROTOCORE_DELIVERY_MANIFEST_BUF).
Must hold {"version":"..","precache":[..]} for PROTOCORE_DELIVERY_PRECACHE_MAX paths; the manifest route answers 500 rather than truncating if it does not fit.
Definition at line 2073 of file buffer_sizing.h.
| #define PROTOCORE_WIFI_SNIFFER_MAX_CHANNELS 14 |
Channels tracked by the WiFi sniffer's per-channel survey (PROTOCORE_WIFI_SNIFFER_MAX_CHANNELS).
14 covers the full 2.4 GHz channel plan (1-14); lower it to the channels actually swept to shrink the survey table (each entry is 11 bytes).
Definition at line 2083 of file buffer_sizing.h.
| #define PROTOCORE_FDC2214_I2C_ADDR 0x2A |
I2C address of the FDC2214, set by the ADDR pin: 0x2A when it is low, 0x2B when it is high.
Definition at line 2088 of file buffer_sizing.h.
| #define PROTOCORE_LDC1614_I2C_ADDR 0x2A |
I2C address of the LDC1614, set by the ADDR pin: 0x2A when it is low, 0x2B when it is high.
Definition at line 2093 of file buffer_sizing.h.
| #define PROTOCORE_VL53L0X_I2C_ADDR 0x29 |
I2C address of the VL53L0X. DS11555 gives the device address as 0x52, which is the 8-bit form with the R/W bit in it; on a 7-bit API that is 0x29.
Definition at line 2099 of file buffer_sizing.h.
| #define PROTOCORE_LOG_LINES 32 |
Number of log lines retained in the ring.
Definition at line 2104 of file buffer_sizing.h.
| #define PROTOCORE_LOG_LINE_LEN 96 |
Maximum length of one stored log line (bytes, including null).
Definition at line 2109 of file buffer_sizing.h.
| #define PROTOCORE_LOG_LEVEL_DEBUG 0 |
Compile-time severity floor for the PROTOCORE_LOG* macros (shared/log/log.h).
The values are ordered low -> high and match protocore_log_level's, so a level is usable both in the preprocessor (which cannot see a constexpr) and as the runtime argument. PROTOCORE_NONE sits above ERROR so that the default discards everything.
Definition at line 2119 of file buffer_sizing.h.
| #define PROTOCORE_LOG_LEVEL_INFO 1 |
Definition at line 2120 of file buffer_sizing.h.
| #define PROTOCORE_LOG_LEVEL_WARN 2 |
Definition at line 2121 of file buffer_sizing.h.
| #define PROTOCORE_LOG_LEVEL_ERROR 3 |
Definition at line 2122 of file buffer_sizing.h.
| #define PROTOCORE_LOG_LEVEL_NONE 4 |
Definition at line 2123 of file buffer_sizing.h.
| #define PROTOCORE_LOG_LEVEL PROTOCORE_LOG_LEVEL_NONE |
Lowest severity the PROTOCORE_LOG* macros emit code for.
A call below this floor is discarded by the preprocessor: no call, no formatting, and no format string left in flash, because the discarded form only names its arguments inside sizeof - an unevaluated context that still type-checks them. So instrumentation can be left in the source permanently and costs exactly nothing in a build that does not want it, which is the point.
Defaults to PROTOCORE_NONE: opt in per build (e.g. -DPROTOCORE_LOG_LEVEL=PROTOCORE_LOG_LEVEL_WARN).
Definition at line 2136 of file buffer_sizing.h.
| #define PROTOCORE_OTA_CONFIRM_WINDOW_MS 30000 |
Confirm window (ms): a pending image not confirmed within this rolls back.
Definition at line 2141 of file buffer_sizing.h.
| #define PROTOCORE_RADIO_WIFI_PS 0 |
WiFi modem-sleep mode: 0 = none (max perf), 1 = min modem, 2 = max modem.
Definition at line 2146 of file buffer_sizing.h.
| #define PROTOCORE_RADIO_MAX_TX_DBM 0 |
Max TX power cap in dBm (2..20); 0 = leave the platform default.
Definition at line 2151 of file buffer_sizing.h.
| #define PROTOCORE_DNS_SERVER "9.9.9.9" |
DNS resolve timeout in milliseconds.
Nameserver the portable resolver asks when nothing has told it otherwise.
The vendor backend takes its servers from the stack (DHCP), so this is the portable one's only starting point. A device that learns a server from DHCP or provisioning should hand it over with Resolver.server.ip + Resolver.set_server rather than query this one.
Definition at line 2163 of file buffer_sizing.h.
| #define PROTOCORE_DNS_CLIENT_PORT 1153 |
Local UDP port the portable resolver asks from and hears the answer on.
Definition at line 2168 of file buffer_sizing.h.
| #define PROTOCORE_DNS_TIMEOUT_MS 5000 |
Definition at line 2172 of file buffer_sizing.h.
| #define PROTOCORE_OIDC_MAX_LEN 1600 |
Max accepted OIDC ID-token length (also sizes the Authorization buffer).
Definition at line 2182 of file buffer_sizing.h.
| #define PROTOCORE_UMATI_NS 1 |
NamespaceIndex the umati MachineTool nodes live at (default 1).
Definition at line 2187 of file buffer_sizing.h.
| #define PROTOCORE_ROBOTICS_NS 1 |
NamespaceIndex the robotics MotionDeviceSystem nodes live at (default 1).
Definition at line 2192 of file buffer_sizing.h.
| #define PROTOCORE_ROBOTICS_AXES 6 |
Number of Axes the robotics MotionDevice exposes (default 6; must fit PROTOCORE_OPCUA_REF_MAX).
Definition at line 2197 of file buffer_sizing.h.
| #define PROTOCORE_EM77_NS 1 |
NamespaceIndex the EUROMAP 77 IMM_MES_Interface nodes live at (default 1).
Definition at line 2202 of file buffer_sizing.h.
| #define PROTOCORE_SYSLOG_MSG_MAX 256 |
Maximum formatted syslog datagram length in bytes (RFC 5424 line).
Definition at line 2211 of file buffer_sizing.h.
| #define PROTOCORE_SYSLOG_FIELD_MAX 32 |
Maximum syslog HOSTNAME / APP-NAME field length (including NUL).
Definition at line 2216 of file buffer_sizing.h.
| #define PROTOCORE_SYSLOG_DEFAULT_PORT 514 |
Default syslog collector UDP port (RFC 5426 well-known 514; overridable at runtime via Syslog.collector.port + Syslog.init and here for a non-standard collector).
Definition at line 2222 of file buffer_sizing.h.
| #define PROTOCORE_JWT_MAX_LEN 512 |
Maximum accepted JWT length in bytes (header.payload.signature).
Definition at line 2227 of file buffer_sizing.h.
| #define PROTOCORE_HTTP_CLIENT_BUF_SIZE 2048 |
Receive buffer (and max response size) for the outbound HTTP client, bytes.
Definition at line 2232 of file buffer_sizing.h.
| #define PROTOCORE_HTTP_CLIENT_TIMEOUT_MS 8000 |
Outbound HTTP client connect/response timeout in milliseconds.
Definition at line 2237 of file buffer_sizing.h.
| #define PROTOCORE_SMTP_LINE_MAX 256 |
Max length of one SMTP command / address line (bytes, incl. CRLF).
Definition at line 2242 of file buffer_sizing.h.
| #define PROTOCORE_SMTP_MSG_MAX 2048 |
Max size of the assembled DATA payload (headers + dot-stuffed body), bytes.
Definition at line 2247 of file buffer_sizing.h.
| #define PROTOCORE_SMTP_REPLY_MAX 512 |
Max size of one (possibly multi-line) server reply held while parsing, bytes.
Definition at line 2252 of file buffer_sizing.h.
| #define PROTOCORE_SMTP_TIMEOUT_MS 10000 |
SMTP connect / per-reply timeout in milliseconds.
Definition at line 2257 of file buffer_sizing.h.
| #define PROTOCORE_SMTP_CT_BUF_SIZE 4096 |
Ciphertext receive-ring size for SMTPS, bytes (only used when the message is TLS).
Definition at line 2262 of file buffer_sizing.h.
| #define PROTOCORE_MQTT_BUF_SIZE 1024 |
MQTT packet buffer size in bytes (bounds one outgoing/incoming packet).
The client borrows twice this from the secure pool's persistent end and splits it: one half is the payload the codec assembles into and the receive reassembly, the other is the wire. Must hold the largest CONNECT/PUBLISH the client sends and the largest incoming PUBLISH it accepts (topic + payload + a few header bytes); larger incoming packets are dropped.
Definition at line 2274 of file buffer_sizing.h.
| #define PROTOCORE_MQTT_CONNECT_MS 8000 |
What the whole MQTT connect is given, in milliseconds.
Covers the transport coming up, the TLS handshake for mqtts, and the CONNACK: Mqtt.connect returns immediately and Mqtt.loop gives the Network Connection up once this passes. One budget rather than one per stage, because a Server slow in any of them is slow to the caller either way.
Definition at line 2285 of file buffer_sizing.h.
| #define PROTOCORE_MQTT_KEEPALIVE_S 30 |
Default MQTT keep-alive interval in seconds (PINGREQ cadence / CONNECT field).
Definition at line 2290 of file buffer_sizing.h.
| #define PROTOCORE_MQTT_CT_BUF_SIZE 4096 |
Ciphertext receive-ring size for MQTTS (draining ring; must exceed one TCP_MSS).
Definition at line 2295 of file buffer_sizing.h.
| #define PROTOCORE_MQTT_MAX_TOPIC 128 |
Maximum inbound MQTT topic length (including NUL) delivered to the callback.
Definition at line 2300 of file buffer_sizing.h.
| #define PROTOCORE_MQTT_MAX_INFLIGHT 4 |
Outbound QoS 1/2 in-flight slots (unacknowledged exchanges awaiting their acknowledgement).
A slot records the packet identifier, how far the exchange has got and when it was last sent - not the packet, which stays in the client's wire buffer where a retransmit marks DUP and rewinds the worker to the start of it. A publish is refused when all slots are busy. Each slot costs a handful of bytes.
Definition at line 2312 of file buffer_sizing.h.
| #define PROTOCORE_MQTT_RETRANSMIT_MS 5000 |
Retransmit timeout (ms) for an unacknowledged in-flight QoS 1/2 message.
Definition at line 2317 of file buffer_sizing.h.
| #define PROTOCORE_MQTT_RX_QOS2_SLOTS 8 |
Inbound QoS 2 packet-id de-duplication ring depth (PUBREC-acknowledged, awaiting PUBREL).
Definition at line 2322 of file buffer_sizing.h.
| #define PROTOCORE_WS_CLIENT_BUF_SIZE 1024 |
WebSocket client send/receive buffer size in bytes (bounds one frame).
Definition at line 2327 of file buffer_sizing.h.
| #define PROTOCORE_WS_CLIENT_CT_BUF_SIZE 4096 |
Ciphertext receive-ring size for wss:// (draining ring; must exceed one TCP_MSS).
Definition at line 2332 of file buffer_sizing.h.
| #define PROTOCORE_ENABLE_HTTP_CLIENT_NEEDS_TCP_CLIENT PROTOCORE_ENABLE_TCP_CLIENT |
Definition at line 2340 of file buffer_sizing.h.
| #define PROTOCORE_ENABLE_MQTT_NEEDS_TCP_CLIENT PROTOCORE_ENABLE_TCP_CLIENT |
Definition at line 2345 of file buffer_sizing.h.
| #define PROTOCORE_ENABLE_WS_CLIENT_NEEDS_TCP_CLIENT PROTOCORE_ENABLE_TCP_CLIENT |
Definition at line 2350 of file buffer_sizing.h.
| #define PROTOCORE_ENABLE_RELAY_NEEDS_TCP_CLIENT PROTOCORE_ENABLE_TCP_CLIENT |
Definition at line 2355 of file buffer_sizing.h.
| #define PROTOCORE_ENABLE_SMTP_NEEDS_TCP_CLIENT PROTOCORE_ENABLE_TCP_CLIENT |
Definition at line 2360 of file buffer_sizing.h.
| #define PROTOCORE_ENABLE_SMB_NEEDS_TCP_CLIENT PROTOCORE_ENABLE_TCP_CLIENT |
Definition at line 2365 of file buffer_sizing.h.
| #define PROTOCORE_ENABLE_DNC_NEEDS_TCP_CLIENT PROTOCORE_ENABLE_TCP_CLIENT |
Definition at line 2370 of file buffer_sizing.h.
| #define PROTOCORE_ENABLE_FTP_SESSION_NEEDS_TCP_CLIENT PROTOCORE_ENABLE_TCP_CLIENT |
Definition at line 2375 of file buffer_sizing.h.
| #define PROTOCORE_ENABLE_SSH_CLIENT_NEEDS_TCP_CLIENT PROTOCORE_ENABLE_TCP_CLIENT |
Definition at line 2380 of file buffer_sizing.h.
| #define PROTOCORE_SSH_PORT_FORWARD_NEEDS_TCP_CLIENT PROTOCORE_ENABLE_TCP_CLIENT |
Definition at line 2390 of file buffer_sizing.h.
| #define PROTOCORE_ENABLE_TCP_CLIENT_NEEDS_DNS_RESOLVER PROTOCORE_ENABLE_DNS_RESOLVER |
Definition at line 2395 of file buffer_sizing.h.
| #define PROTOCORE_ENABLE_COAP_NEEDS_UDP PROTOCORE_ENABLE_UDP |
Definition at line 2405 of file buffer_sizing.h.
| #define PROTOCORE_ENABLE_DTLS_NEEDS_UDP PROTOCORE_ENABLE_UDP |
Definition at line 2410 of file buffer_sizing.h.
| #define PROTOCORE_ENABLE_STATSD_NEEDS_UDP PROTOCORE_ENABLE_UDP |
Definition at line 2415 of file buffer_sizing.h.
| #define PROTOCORE_ENABLE_UDP_TELEMETRY_NEEDS_UDP PROTOCORE_ENABLE_UDP |
Definition at line 2420 of file buffer_sizing.h.
| #define PROTOCORE_ENABLE_SNMP_NEEDS_UDP PROTOCORE_ENABLE_UDP |
Definition at line 2425 of file buffer_sizing.h.
| #define PROTOCORE_ENABLE_SNMP_TRAP_NEEDS_UDP PROTOCORE_ENABLE_UDP |
Definition at line 2430 of file buffer_sizing.h.
| #define PROTOCORE_ENABLE_SNMP_V3_NEEDS_UDP PROTOCORE_ENABLE_UDP |
Definition at line 2435 of file buffer_sizing.h.
| #define PROTOCORE_ENABLE_SYSLOG_NEEDS_UDP PROTOCORE_ENABLE_UDP |
Definition at line 2440 of file buffer_sizing.h.
| #define PROTOCORE_ENABLE_FLOW_EXPORT_NEEDS_UDP PROTOCORE_ENABLE_UDP |
Definition at line 2445 of file buffer_sizing.h.
| #define PROTOCORE_ENABLE_PROVISIONING_NEEDS_UDP PROTOCORE_ENABLE_UDP |
Definition at line 2450 of file buffer_sizing.h.
| #define PROTOCORE_ENABLE_NTP_SERVER_NEEDS_UDP PROTOCORE_ENABLE_UDP |
Definition at line 2455 of file buffer_sizing.h.
| #define PROTOCORE_ENABLE_DNS_SERVER_NEEDS_UDP PROTOCORE_ENABLE_UDP |
Definition at line 2460 of file buffer_sizing.h.
| #define PROTOCORE_ENABLE_HTTP3_NEEDS_UDP PROTOCORE_ENABLE_UDP |
Definition at line 2465 of file buffer_sizing.h.
| #define PROTOCORE_CAPTURE_AUTH_HEADER 0 |
True when the parser must capture the full Authorization header value.
Definition at line 2481 of file buffer_sizing.h.
| #define PROTOCORE_AUTH_HDR_CAP_OIDC 0 |
Capacity of HttpReq::authorization (full Authorization header value).
Sized to the largest enabled consumer: a Digest header (DIGEST_AUTH_HDR_MAX), a Bearer <jwt> HS256 token (PROTOCORE_JWT_MAX_LEN), or a Bearer <id_token> OIDC RS256 token (PROTOCORE_OIDC_MAX_LEN), each plus the scheme.
Definition at line 2494 of file buffer_sizing.h.
| #define PROTOCORE_AUTH_HDR_CAP_JWT 0 |
Definition at line 2499 of file buffer_sizing.h.
| #define PROTOCORE_AUTH_HDR_CAP_M1 (PROTOCORE_AUTH_HDR_CAP_JWT > DIGEST_AUTH_HDR_MAX ? PROTOCORE_AUTH_HDR_CAP_JWT : DIGEST_AUTH_HDR_MAX) |
Definition at line 2501 of file buffer_sizing.h.
| #define PROTOCORE_AUTH_HDR_CAP (PROTOCORE_AUTH_HDR_CAP_OIDC > PROTOCORE_AUTH_HDR_CAP_M1 ? PROTOCORE_AUTH_HDR_CAP_OIDC : PROTOCORE_AUTH_HDR_CAP_M1) |
Definition at line 2503 of file buffer_sizing.h.
| #define TERM_TX_BUF_SIZE 256 |
Stack scratch for protocore_web_terminal_println() line building.
One formatted terminal line must fit in this many bytes (longer is truncated). Allocated on the stack only during the call - no persistent RAM cost.
Definition at line 2513 of file buffer_sizing.h.
| #define PROTOCORE_KEEPALIVE_MAX_REQUESTS 100 |
Maximum requests served on one keep-alive connection before it is closed.
A fairness bound so a single client cannot hold a connection slot indefinitely with a steady request stream. After this many responses the server emits Connection: close and drops the link; the client simply reconnects. Only meaningful when PROTOCORE_ENABLE_KEEPALIVE is set.
Definition at line 2525 of file buffer_sizing.h.
| #define PROTOCORE_HPACK_TABLE_BYTES 4096 |
Per-connection HPACK dynamic-table size in bytes (our decoder; advertised to the peer as SETTINGS_HEADER_TABLE_SIZE). RFC 7541's default is 4096; lower it to save per-connection RAM (each active HTTP/2 connection holds one table).
Definition at line 2534 of file buffer_sizing.h.
| #define PROTOCORE_HPACK_MAX_ENTRIES 128 |
Max HPACK dynamic-table entries (>= PROTOCORE_HPACK_TABLE_BYTES / 32, the min entry size).
Definition at line 2539 of file buffer_sizing.h.
| #define PROTOCORE_H2_MAX_FRAME 16384 |
Largest HTTP/2 frame we accept, in bytes (advertised as SETTINGS_MAX_FRAME_SIZE). RFC 9113 requires accepting at least 16384; a whole frame is buffered for reassembly, so this (plus the HPACK table) sets the per-HTTP/2-connection RAM. Range: [16384, 16777215].
Definition at line 2548 of file buffer_sizing.h.
| #define PROTOCORE_H2_MAX_STREAMS 8 |
Max concurrent HTTP/2 streams per connection (advertised as MAX_CONCURRENT_STREAMS).
Definition at line 2553 of file buffer_sizing.h.
| #define PROTOCORE_H2_HDR_BLOCK 4096 |
Header-block reassembly buffer for HTTP/2 requests that span HEADERS + CONTINUATION frames (a single END_HEADERS frame decodes in place and needs no copy). Caps the compressed request-header size; a larger block is rejected (RFC 9113 sec 6.10).
Definition at line 2562 of file buffer_sizing.h.
| #define PROTOCORE_H2_MAX_CONTINUATION 8 |
CONTINUATION frames one header block may span (RFC 9113 sec 6.10).
PROTOCORE_H2_HDR_BLOCK bounds the bytes a block may carry, but an empty CONTINUATION adds no bytes, so a peer can send them without end and never reach that bound. This bounds the frame count as well, which is what makes the block terminate.
Definition at line 2573 of file buffer_sizing.h.
| #define PROTOCORE_DTLS_PMTU_DEFAULT 1232 |
Largest datagram a DTLS handshake flight will put on the wire, before a connection overrides it (RFC 9147 sec 4.3).
A handshake message longer than this is split across fragments that each fit one datagram. The default is the IPv6 minimum MTU less the worst-case IPv6 and UDP headers, which no path is allowed to be smaller than; a connection that knows its own path sets DtlsServerConfig::pmtu.
Definition at line 2585 of file buffer_sizing.h.
| #define PROTOCORE_H2_POOL_IN_PSRAM 0 |
Place the HTTP/2 connection-engine pool in external PSRAM (ESP32).
Each HTTP/2 connection needs a ~28 KB engine, so the pool (MAX_CONNS of them) does not fit the ~122 KB internal DRAM alongside a TLS server - HTTP/2 therefore requires PSRAM. Set this to 1 on a PSRAM board (S3 / P4 / WROVER) to move the pool to external RAM via EXT_RAM_BSS_ATTR. Like PROTOCORE_TLS_ARENA_IN_PSRAM it needs a framework built with CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY=y (the stock arduino-esp32 core ships it off; see tools/psram/README.md). A compile-time guard rejects PROTOCORE_ENABLE_HTTP2 without this on ARDUINO.
Definition at line 2599 of file buffer_sizing.h.
| #define PROTOCORE_INTERNAL_SLOTS 0 |
Definition at line 2613 of file buffer_sizing.h.
| #define CONN_POOL_SLOTS (MAX_CONNS + PROTOCORE_INTERNAL_SLOTS) |
Definition at line 2615 of file buffer_sizing.h.
| #define PROTOCORE_HTTP3_PORT 443 |
UDP port the HTTP/3 (QUIC) server binds by default (used by protocore_h3_cert).
Definition at line 2619 of file buffer_sizing.h.
| #define PROTOCORE_H3_CRYPTO_BUF 2048 |
Maximum bytes of one QUIC/TLS handshake CRYPTO flight (RFC 9001).
The server's second flight - EncryptedExtensions + Certificate + CertificateVerify + Finished - is assembled whole before it is fragmented into CRYPTO frames across Handshake packets. The Certificate (a DER X.509 chain) dominates the size, so this bounds the certificate the server can present. The default fits a single Ed25519 leaf certificate comfortably; raise it for a chain.
Definition at line 2631 of file buffer_sizing.h.
| #define PROTOCORE_H3_MAX_STREAMS 8 |
Maximum concurrent request streams per HTTP/3 connection.
Bounds the per-connection QUIC stream table (client-initiated bidirectional request streams plus the handful of unidirectional control / QPACK streams). Each slot is small; 8 matches the HTTP/2 default (PROTOCORE_H2_MAX_STREAMS).
Definition at line 2642 of file buffer_sizing.h.
| #define PROTOCORE_QUIC_MAX_CONNS 2 |
Simultaneous HTTP/3 connections. Each is a QuicConn plus an H3Conn.
Definition at line 2647 of file buffer_sizing.h.
| #define PROTOCORE_QUIC_INGEST_RING 8 |
Datagrams buffered from the lwIP thread until the server poll drains them.
Definition at line 2652 of file buffer_sizing.h.
| #define PROTOCORE_QUIC_MAX_DATAGRAM 1350 |
Largest UDP payload the QUIC transport sends or accepts (conservative, under a 1500 MTU).
Definition at line 2657 of file buffer_sizing.h.
| #define PROTOCORE_H3_STREAM_BUF 2048 |
per-request-stream reassembly buffer (HEADERS + DATA)
Definition at line 2663 of file buffer_sizing.h.
| #define PROTOCORE_H3_PATH_LEN 256 |
captured :path length cap
Definition at line 2666 of file buffer_sizing.h.
| #define PROTOCORE_H3_AUTHORITY_LEN 128 |
captured :authority length cap
Definition at line 2669 of file buffer_sizing.h.
| #define PROTOCORE_H3_METHOD_LEN 16 |
captured :method length cap
Definition at line 2672 of file buffer_sizing.h.
| #define PROTOCORE_H3_QPACK_SCRATCH 512 |
Definition at line 2677 of file buffer_sizing.h.
| #define PROTOCORE_H3_QPACK_BLOCK 256 |
Definition at line 2680 of file buffer_sizing.h.
| #define PROTOCORE_QUIC_STREAM_TX 2048 |
per-stream outbound buffer (drained into STREAM frames)
Definition at line 2686 of file buffer_sizing.h.
| #define PROTOCORE_QUIC_CRYPTO_RX 2048 |
per-level inbound CRYPTO reassembly window (ClientHello, Finished)
Definition at line 2689 of file buffer_sizing.h.
| #define PROTOCORE_QUIC_MAX_STREAMS PROTOCORE_H3_MAX_STREAMS |
tracked streams (request + control/QPACK)
Definition at line 2692 of file buffer_sizing.h.
| #define PROTOCORE_ENFORCE_HOST_HEADER 1 |
Enforce the RFC 7230 ยง5.4 Host-header requirement (default on).
When 1, an HTTP/1.1 request that lacks a Host header - or carries more than one - is rejected with 400 Bad Request. When 0, the Host header is not required (useful for constrained clients or test harnesses that feed bare request lines). The multiple-Host rule and Content-Length validation are always active regardless of this flag.
Definition at line 2705 of file buffer_sizing.h.
| #define PROTOCORE_SSH_ALLOW_PASSWORD 1 |
Allow SSH password authentication (default on).
Set to 0 to harden the SSH server to publickey-only authentication (RFC 4252 ยง7): the "password" method is then refused outright and is not advertised in the USERAUTH_FAILURE method list. Publickey auth is always available regardless of this flag.
Definition at line 2717 of file buffer_sizing.h.
| #define SSH_MAX_AUTH_ATTEMPTS 6 |
Maximum failed SSH authentication attempts per connection.
RFC 4252 ยง4 permits the server to disconnect after a small bounded number of failed USERAUTH_REQUESTs. After this many SSH_MSG_USERAUTH_FAILURE responses on one connection the server sends SSH_MSG_DISCONNECT and drops the link. (The publickey "would-be-accepted" probe and a SUCCESS do not count.)
Definition at line 2729 of file buffer_sizing.h.
| #define PROTOCORE_SSH_PW_CHANGE_COOLDOWN_MS 60000u |
Definition at line 2735 of file buffer_sizing.h.
| #define PROTOCORE_SSH_HOST_KEY_NS "ssh_host_key" |
Where the SSH RSA host private key is stored: the NVS namespace and the item in it.
The server reads a DER-encoded PKCS#1/PKCS#8 blob from here at startup. Provisioning writes it once per device (docs/SSH.md). Both names are within the 15-character NVS limit.
Definition at line 2745 of file buffer_sizing.h.
| #define PROTOCORE_SSH_HOST_KEY_ITEM "priv_der" |
Definition at line 2748 of file buffer_sizing.h.
| #define MAX_LISTENERS 3 |
Maximum number of simultaneously active listener ports.
Definition at line 2757 of file buffer_sizing.h.
| #define PROTOCORE_MAX_UDP_LISTENERS 2 |
Maximum simultaneously bound UDP ports (transport-layer UDP service).
Sizes the fixed pool in udp.cpp. One slot per bound port, e.g. SNMP (:161) and the captive-portal DNS responder (:53). Costs only a few pointers of BSS each.
Definition at line 2768 of file buffer_sizing.h.
| #define PROTOCORE_UDP_RX_BUF_SIZE 1472 |
Largest UDP datagram a bound port accepts, in bytes.
Bounds one datagram, both directions: a longer inbound datagram is truncated to this at the receive trampoline, and a longer send is refused. Sizes the per-slot staging buffer the drain hands the handler. Must hold the largest datagram any UDP service expects (SNMP messages are the largest user).
Definition at line 2780 of file buffer_sizing.h.
| #define PROTOCORE_UDP_RX_RING 2048 |
Per-slot UDP receive ring, in bytes.
Backs one bound port's receive ring. The stack's trampoline frames each datagram into it and the drain reads them out, so this is how many bytes of datagram, plus a header each, may wait between two poll() calls. A datagram that does not fit the free space is dropped.
Definition at line 2791 of file buffer_sizing.h.
| #define PROTOCORE_ACCEPT_THROTTLE_MAX 20 |
Max accepted connections per throttle window (see PROTOCORE_ENABLE_ACCEPT_THROTTLE).
Definition at line 2796 of file buffer_sizing.h.
| #define PROTOCORE_ACCEPT_THROTTLE_WINDOW_MS 1000 |
Throttle window length in milliseconds (see PROTOCORE_ENABLE_ACCEPT_THROTTLE).
Definition at line 2801 of file buffer_sizing.h.
| #define PROTOCORE_PER_IP_THROTTLE_SLOTS 16 |
Number of source IPv4 addresses tracked by the per-IP throttle (BSS bucket table).
Definition at line 2806 of file buffer_sizing.h.
| #define PROTOCORE_PER_IP_THROTTLE_MAX 10 |
Max accepted connections per window from one source IP (see PROTOCORE_ENABLE_PER_IP_THROTTLE).
Definition at line 2811 of file buffer_sizing.h.
| #define PROTOCORE_PER_IP_THROTTLE_WINDOW_MS 10000 |
Per-IP throttle window length in milliseconds (see PROTOCORE_ENABLE_PER_IP_THROTTLE).
Definition at line 2816 of file buffer_sizing.h.
| #define PROTOCORE_IP_ALLOWLIST_SLOTS 8 |
Number of CIDR rules the source-IP allowlist can hold (BSS table).
Definition at line 2825 of file buffer_sizing.h.
| #define PROTOCORE_TRUSTED_PROXY_MAX 2 |
Number of trusted-upstream CIDR rules the forwarded-client resolver holds (BSS table).
Definition at line 2834 of file buffer_sizing.h.
| #define PROTOCORE_AUTH_LOCKOUT_SLOTS 16 |
Number of source IPs the auth lockout tracks (BSS bucket table).
Definition at line 2843 of file buffer_sizing.h.
| #define PROTOCORE_AUTH_LOCKOUT_THRESHOLD 5 |
Consecutive failed auths from one IP before it is locked out.
Definition at line 2848 of file buffer_sizing.h.
| #define PROTOCORE_AUTH_LOCKOUT_BASE_MS 1000 |
First lockout duration in ms; doubles on each further failure.
Definition at line 2853 of file buffer_sizing.h.
| #define PROTOCORE_AUTH_LOCKOUT_MAX_MS 300000 |
Maximum lockout duration in ms (the exponential backoff cap).
Definition at line 2858 of file buffer_sizing.h.
| #define MAX_TELNET_CONNS 2 |
Maximum simultaneous Telnet connections.
Definition at line 2871 of file buffer_sizing.h.
| #define TELNET_BUF_SIZE 256 |
Stack buffer for one Telnet I/O chunk.
Definition at line 2876 of file buffer_sizing.h.
| #define MAX_SSH_CONNS 1 |
Maximum simultaneous SSH connections.
Definition at line 2885 of file buffer_sizing.h.
| #define PROTOCORE_SSH_SLOT_BYTES 183616u |
One connection's whole span: the wire, the session, the exchange, the packet and the rx regions end to end, which ssh.c hands out one slot at a time.
Stated here as a number because the offsets that sum to it are built in network_drivers/presentation/ssh/common.h, which this file cannot see. common.h is the translation unit that includes both, so it is where this is proved against the real SSH_SLOT_BORROW - the same arrangement PROTOCORE_SSH_CPUB_MAX has with the PQC key sizes.
Definition at line 2898 of file buffer_sizing.h.
| #define PROTOCORE_SSH_BORROW ((size_t)MAX_SSH_CONNS * PROTOCORE_SSH_SLOT_BYTES) |
Every slot's span together: the bytes ssh.c takes from the secure pool.
Definition at line 2903 of file buffer_sizing.h.
| #define PROTOCORE_SSH_PORT_FORWARD 0 |
SSH TCP port forwarding (direct-tcpip, i.e. ssh -L). Default off.
When set, the SSH server can open an outbound TCP connection to a client-named host:port and bridge bytes between that socket and the SSH channel - the ssh_forward owner does the I/O via the outbound client transport (protocore_client), so it needs PROTOCORE_CLIENT_CONNS >= PROTOCORE_SSH_FWD_MAX and a channel pool (PROTOCORE_SSH_MAX_CHANNELS > 1) to be useful. Forwarding is still opt-in at runtime: nothing is forwarded until the application calls protocore_ssh_forward_begin(). Off = the channel codec refuses every direct-tcpip open (no open relay).
Definition at line 2918 of file buffer_sizing.h.
| #define PROTOCORE_SSH_FWD_MAX 2 |
Maximum concurrent forwarded TCP connections (must be <= PROTOCORE_CLIENT_CONNS).
Definition at line 2923 of file buffer_sizing.h.
| #define PROTOCORE_SSH_FWD_HOST_MAX 64 |
Maximum forward target hostname length including null terminator.
Definition at line 2928 of file buffer_sizing.h.
| #define PROTOCORE_SSH_FWD_CONNECT_MS 3000 |
Blocking connect timeout (ms) when opening a forward target.
Definition at line 2933 of file buffer_sizing.h.
| #define PROTOCORE_SSH_FWD_CHUNK 1024 |
Max bytes moved per forward channel per poll, target -> client (<= SSH_PKT_BUF_SIZE).
Definition at line 2938 of file buffer_sizing.h.
| #define PROTOCORE_SSH_RFWD_MAX 1 |
Maximum concurrent remote-forward listeners (ssh -R / tcpip-forward).
Each accepted client that requests remote forwarding can bind up to this many ports on the device; each binding consumes one listener_pool[] slot, so MAX_LISTENERS must have that much headroom above the app's own listeners. Remote forwarding shares PROTOCORE_SSH_PORT_FORWARD (compiled in) and is inert until protocore_ssh_forward_begin().
Definition at line 2951 of file buffer_sizing.h.
| #define PROTOCORE_SSH_RFWD_BRIDGE_MAX 2 |
Maximum concurrent bridged connections across all remote forwards.
Each connection accepted on a forwarded port occupies one transport conn_pool slot plus one SSH channel (so it needs PROTOCORE_SSH_MAX_CHANNELS headroom) and one entry here while it is bridged back to the client.
Definition at line 2962 of file buffer_sizing.h.
| #define SSH_PKT_BUF_SIZE 2048 |
Packet assembly buffer per SSH connection (bytes).
RFC 4253 sec 6.1: every implementation MUST process an uncompressed payload of 32768 bytes and a total packet of 35000. A smaller value rejects a conforming peer's legal packet.
Definition at line 2972 of file buffer_sizing.h.
| #define PROTOCORE_SFTP_MAX_HANDLES 4 |
Max concurrent open SFTP handles (files + dirs) per SSH connection.
Definition at line 2977 of file buffer_sizing.h.
| #define PROTOCORE_SFTP_PKT_BUF 2048 |
SFTP packet-assembly buffer per SFTP channel (bytes); bounds one non-streamed request/response.
Definition at line 2982 of file buffer_sizing.h.
| #define PROTOCORE_SFTP_MAX_READ 1024 |
Largest PROTOCORE_SSH_FXP_DATA payload returned for one READ (a short read - the client re-requests). Kept within one SSH packet (SSH_PKT_BUF_SIZE minus framing), so bump SSH_PKT_BUF_SIZE too for throughput.
Definition at line 2990 of file buffer_sizing.h.
| #define PROTOCORE_FILESYSTEM_PATH_MAX 256 |
Largest absolute path the SFTP/SCP server resolves (mount root + request path).
Definition at line 2995 of file buffer_sizing.h.
| #define PROTOCORE_SFTP_ENTRY_MAX (PROTOCORE_FILESYSTEM_PATH_MAX + 320) |
Largest serialized SSH_FXP_NAME entry one READDIR emits: filename, ls -l longname and attributes. Sizes the per-handle stash an entry that did not fit is held in, which is a field of SftpHandle in session.h, so it is stated here rather than in the server's own .c.
Definition at line 3004 of file buffer_sizing.h.
| #define PROTOCORE_SSH_ZLIB_IN_PSRAM 0 |
Place the per-connection SSH compression state in external PSRAM (ESP32).
Like PROTOCORE_H2_POOL_IN_PSRAM / PROTOCORE_TLS_ARENA_IN_PSRAM: moves the compressor pool (MAX_SSH_CONNS of them) to external RAM via EXT_RAM_BSS_ATTR. Needs a framework built with CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY=y (tools/psram/README.md).
Definition at line 3015 of file buffer_sizing.h.
| #define PROTOCORE_SSH_ZLIB_ACK_DRAM 0 |
Acknowledge placing the SSH compressor in internal DRAM (no PSRAM).
The per-connection compressor is ~48 KB. With MAX_SSH_CONNS=1 and no TLS server it fits internal DRAM on a roomy chip (S3 / P4). Rather than force PSRAM, this mirrors PROTOCORE_TLS_ACK_MULTI_CONN_DRAM: set it to 1 to consciously accept the internal-DRAM cost when PROTOCORE_SSH_ZLIB_IN_PSRAM is off. The build otherwise fails fast on ARDUINO with guidance (below) instead of a raw linker overflow.
Definition at line 3027 of file buffer_sizing.h.
| #define PROTOCORE_SSH_ZLIB_WINDOW 8192 |
SSH s2c DEFLATE sliding-window size in bytes (max back-reference distance). Power of two, 256..32768. Larger = better ratio + more per-connection RAM (the compressor holds a window-sized work buffer + a window-sized hash chain). The client always allocates a 32 KB inflate window, so any value here interoperates; 8 KB is a good ratio/RAM balance for terminal + command output.
Definition at line 3037 of file buffer_sizing.h.
| #define PROTOCORE_SSH_ZLIB_MAX_IN 2048 |
Largest uncompressed payload the s2c compressor accepts in one call (bytes). Outbound SSH payloads are bounded by SSH_PKT_BUF_SIZE; this sizes the compressor's history+input work buffer.
Definition at line 3045 of file buffer_sizing.h.
| #define SSH_MAX_USERNAME_LEN 32 |
Maximum SSH username length including null terminator.
Definition at line 3050 of file buffer_sizing.h.
| #define SSH_MAX_PASSWORD_LEN 64 |
Maximum SSH password length including null terminator.
Definition at line 3055 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_SCRATCH 10240 |
Size in bytes of the shared per-dispatch scratch arena.
Codec / protocol handlers borrow transient working memory from this single BSS arena (see mmgr/plaintext.h) instead of each feature owning a dedicated buffer. The session layer empties it before every event dispatch, so it only needs to hold the peak concurrent scratch of any one dispatch, not the sum across features. Tune from the protocore_plaintext_high_water() reading on a real workload; an over-budget borrow fails closed (protocore_plaintext_alloc returns NULL).
Definition at line 3074 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_H3CONN 0 |
Definition at line 3081 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_EDGEPROXY 0 |
Definition at line 3087 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_EUROMAP77 0 |
Definition at line 3093 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_UMATI 0 |
Definition at line 3099 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_ROBOTICS 0 |
Definition at line 3105 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_SIMATIC 0 |
Definition at line 3111 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_J1939 0 |
Definition at line 3117 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_MODBUS 0 |
Definition at line 3123 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_ESPNOW 0 |
Definition at line 3129 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_PROMISC 0 |
Definition at line 3135 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_WIFISNIFF 0 |
Definition at line 3141 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_RADIOPOWER 0 |
Definition at line 3147 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_DNSSERVER 0 |
Definition at line 3153 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_FORWARD 0 |
Definition at line 3159 of file buffer_sizing.h.
| #define PROTOCORE_SESSION_BORROW ((size_t)PROTO_MAX_HANDLERS * 8u + 32u) |
Definition at line 3167 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_SESSION PROTOCORE_SESSION_BORROW |
Definition at line 3170 of file buffer_sizing.h.
| #define PROTOCORE_SIGNALING_BORROW 64u |
Definition at line 3175 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_SIGNALING PROTOCORE_SIGNALING_BORROW |
Definition at line 3178 of file buffer_sizing.h.
| #define PROTOCORE_TRACE_CAPTURE_BORROW 256u |
Definition at line 3182 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_TRACECAPTURE 0 |
Definition at line 3188 of file buffer_sizing.h.
| #define PROTOCORE_POWER_MGMT_BORROW 8u |
Definition at line 3194 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_POWERMGMT 0 |
Definition at line 3200 of file buffer_sizing.h.
| #define PROTOCORE_GUARDRAILS_BORROW 16u |
Definition at line 3205 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_GUARDRAILS 0 |
Definition at line 3211 of file buffer_sizing.h.
| #define PROTOCORE_FAILSAFE_BORROW 256u |
Definition at line 3216 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_FAILSAFE 0 |
Definition at line 3222 of file buffer_sizing.h.
| #define PROTOCORE_WORKER_BORROW ((size_t)PROTOCORE_WORKER_COUNT * ((size_t)PROTOCORE_DEFER_QUEUE_DEPTH * 16u + 64u) + 64u) |
Definition at line 3229 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_WORKER 0 |
Definition at line 3236 of file buffer_sizing.h.
| #define PROTOCORE_PREEMPT_QUEUE_BORROW 512u |
Definition at line 3241 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_PREEMPTQUEUE 0 |
Definition at line 3247 of file buffer_sizing.h.
| #define PROTOCORE_LOGBUF_BORROW 3584u |
Definition at line 3253 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_LOGBUF 0 |
Definition at line 3259 of file buffer_sizing.h.
| #define PROTOCORE_FLOW_EXPORT_BORROW 64u |
Definition at line 3265 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_FLOWEXPORT 0 |
Definition at line 3271 of file buffer_sizing.h.
| #define PROTOCORE_SYSLOG_BORROW 512u |
Definition at line 3277 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_SYSLOG 0 |
Definition at line 3283 of file buffer_sizing.h.
| #define PROTOCORE_SNMP_NOTIFY_BORROW 1536u |
Definition at line 3289 of file buffer_sizing.h.
| #define PROTOCORE_SECURE_WORK_SNMPNOTIFY 0 |
Definition at line 3295 of file buffer_sizing.h.
| #define PROTOCORE_HTTP_CLIENT_BORROW 3584u |
Definition at line 3301 of file buffer_sizing.h.
| #define PROTOCORE_SECURE_WORK_HTTPCLIENT 0 |
Definition at line 3307 of file buffer_sizing.h.
| #define PROTOCORE_SMTP_BORROW 3584u |
Definition at line 3313 of file buffer_sizing.h.
| #define PROTOCORE_SECURE_WORK_SMTP 0 |
Definition at line 3319 of file buffer_sizing.h.
| #define PROTOCORE_WS_CLIENT_BORROW 4608u |
Definition at line 3325 of file buffer_sizing.h.
| #define PROTOCORE_SECURE_WORK_WSCLIENT 0 |
Definition at line 3331 of file buffer_sizing.h.
| #define PROTOCORE_SNMP_V3_BORROW 9216u |
Definition at line 3337 of file buffer_sizing.h.
| #define PROTOCORE_SECURE_WORK_SNMPV3 0 |
Definition at line 3343 of file buffer_sizing.h.
| #define PROTOCORE_SNMP_AGENT_BORROW 13312u |
Definition at line 3349 of file buffer_sizing.h.
| #define PROTOCORE_SECURE_WORK_SNMPAGENT 0 |
Definition at line 3355 of file buffer_sizing.h.
| #define PROTOCORE_OAUTH2_BORROW 3072u |
Definition at line 3362 of file buffer_sizing.h.
| #define PROTOCORE_SECURE_WORK_OAUTH2 0 |
Definition at line 3368 of file buffer_sizing.h.
| #define PROTOCORE_FILESYSTEM_BORROW 3072u |
Definition at line 3374 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_FILESYSTEM PROTOCORE_FILESYSTEM_BORROW |
Definition at line 3377 of file buffer_sizing.h.
| #define PROTOCORE_SOUTHBOUND_BORROW 128u |
Definition at line 3382 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_SOUTHBOUND 0 |
Definition at line 3388 of file buffer_sizing.h.
| #define PROTOCORE_SSH_SCP_BORROW ((size_t)PROTOCORE_FILESYSTEM_PATH_MAX + 16u) |
Definition at line 3394 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_SSHSCP 0 |
Definition at line 3400 of file buffer_sizing.h.
| #define PROTOCORE_SSH_COMP_SLOT_BYTES 81000u |
One SSH connection's zlib@.nosp@m.open.nosp@m.ssh.c.nosp@m.om compressor: both streams and their windows.
Stated here as a number because it sums a deflate window, its hash chain, the fixed Huffman tables and a 32 KB inflate context-takeover window, none of which this file can see - they are built in ssh/transport/comp/comp.c, which is the translation unit that includes both and is where this is proved against the real SshCompCtx. Same arrangement as PROTOCORE_SSH_SLOT_BYTES.
Definition at line 3412 of file buffer_sizing.h.
| #define PROTOCORE_SSH_COMP_BORROW ((size_t)MAX_SSH_CONNS * PROTOCORE_SSH_COMP_SLOT_BYTES) |
Every connection's compressor together: the bytes comp.c takes from the plaintext pool.
Definition at line 3417 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_SSHCOMP 0 |
Definition at line 3424 of file buffer_sizing.h.
| #define PROTOCORE_SSH_SFTP_BORROW ((size_t)SSH_PKT_BUF_SIZE + PROTOCORE_SFTP_MAX_READ + 5u * PROTOCORE_FILESYSTEM_PATH_MAX + 656u) |
Definition at line 3433 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_SSHSFTP 0 |
Definition at line 3440 of file buffer_sizing.h.
| #define PROTOCORE_FILE_SERVING_BORROW 16u |
Definition at line 3446 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_FILESERVING 0 |
Definition at line 3452 of file buffer_sizing.h.
| #define PROTOCORE_HTTP_PARSER_BORROW 32u |
Definition at line 3459 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_HTTPPARSER 0 |
Definition at line 3467 of file buffer_sizing.h.
| #define PROTOCORE_MDNS_ADAPTIVE_BORROW 96u |
Definition at line 3474 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_MDNSADAPTIVE 0 |
Definition at line 3480 of file buffer_sizing.h.
| #define PROTOCORE_UPLOAD_SERVICE_BORROW 48u |
Definition at line 3487 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_UPLOADSERVICE 0 |
Definition at line 3493 of file buffer_sizing.h.
| #define PROTOCORE_NTP_SERVICE_BORROW 64u |
Definition at line 3501 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_NTPSERVICE 0 |
Definition at line 3507 of file buffer_sizing.h.
| #define PROTOCORE_HTTP_CLOCK_BORROW 32u |
Definition at line 3515 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_HTTPCLOCK 0 |
Definition at line 3521 of file buffer_sizing.h.
| #define PROTOCORE_NTP_SERVER_BORROW 16u |
Definition at line 3527 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_NTPSERVER 0 |
Definition at line 3533 of file buffer_sizing.h.
| #define PROTOCORE_MDNS_SERVICE_BORROW 320u |
Definition at line 3540 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_MDNSSERVICE 0 |
Definition at line 3546 of file buffer_sizing.h.
| #define PROTOCORE_TELNET_BORROW ((size_t)MAX_TELNET_CONNS * (TELNET_BUF_SIZE + 16u) + (size_t)RX_BUF_SIZE + 32u) |
Definition at line 3554 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_TELNET 0 |
Definition at line 3560 of file buffer_sizing.h.
| #define PROTOCORE_HTTP_CONN_BORROW ((size_t)RX_BUF_SIZE + 32u) |
Definition at line 3567 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_HTTPCONN PROTOCORE_HTTP_CONN_BORROW |
Definition at line 3570 of file buffer_sizing.h.
| #define PROTOCORE_HTTP_BORROW 32u |
Definition at line 3576 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_HTTP PROTOCORE_HTTP_BORROW |
Definition at line 3579 of file buffer_sizing.h.
| #define PROTOCORE_SSH_NETWORK_BORROW ((size_t)MAX_SSH_CONNS * (4u + 4u * PROTOCORE_SSH_MAX_CHANNELS) + 16u) |
Definition at line 3586 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_SSHNETWORK 0 |
Definition at line 3592 of file buffer_sizing.h.
| #define PROTOCORE_SSH_SERVER_BORROW ((size_t)MAX_SSH_CONNS + 8u) |
Definition at line 3598 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_SSHSERVER 0 |
Definition at line 3604 of file buffer_sizing.h.
| #define PROTOCORE_RCWL0516_BORROW 32u |
Definition at line 3610 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_RCWL0516 0 |
Definition at line 3616 of file buffer_sizing.h.
| #define PROTOCORE_SEN0192_BORROW 32u |
Definition at line 3622 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_SEN0192 0 |
Definition at line 3628 of file buffer_sizing.h.
| #define PROTOCORE_FTP_SESSION_BORROW 1536u |
Definition at line 3634 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_FTPSESSION 0 |
Definition at line 3640 of file buffer_sizing.h.
| #define PROTOCORE_STATSD_BORROW 512u |
Definition at line 3646 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_STATSD 0 |
Definition at line 3652 of file buffer_sizing.h.
| #define PROTOCORE_GRAPHQL_BORROW 5120u |
Definition at line 3658 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_GRAPHQL 0 |
Definition at line 3664 of file buffer_sizing.h.
| #define PROTOCORE_LWM2M_TLV_BORROW 128u |
Definition at line 3670 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_LWM2MTLV 0 |
Definition at line 3676 of file buffer_sizing.h.
| #define PROTOCORE_COAP_BORROW 3584u |
Definition at line 3682 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_COAP 0 |
Definition at line 3688 of file buffer_sizing.h.
| #define PROTOCORE_COAPS_SERVER_BORROW 34816u |
Definition at line 3696 of file buffer_sizing.h.
| #define PROTOCORE_SECURE_WORK_COAPSSERVER 0 |
Definition at line 3702 of file buffer_sizing.h.
| #define PROTOCORE_MQTT_BORROW 512u |
Definition at line 3709 of file buffer_sizing.h.
| #define PROTOCORE_SECURE_WORK_MQTT 0 |
Definition at line 3715 of file buffer_sizing.h.
| #define PROTOCORE_PROTOBUF_BORROW 512u |
Definition at line 3721 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_PROTOBUF 0 |
Definition at line 3727 of file buffer_sizing.h.
| #define PROTOCORE_SPARKPLUG_BORROW 512u |
Definition at line 3733 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_SPARKPLUG 0 |
Definition at line 3739 of file buffer_sizing.h.
| #define PROTOCORE_UDP_TELEMETRY_BORROW 128u |
Definition at line 3745 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_UDPTELEMETRY 0 |
Definition at line 3751 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_LOG PROTOCORE_LOG_BORROW |
Definition at line 3754 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_DIFFSERV 0 |
Definition at line 3759 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_UDPCLIENT PROTOCORE_UDP_CLIENT_BORROW |
Definition at line 3762 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_UDPLISTENER PROTOCORE_UDP_LISTENER_BORROW |
Definition at line 3764 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_TCPLOWER PROTOCORE_TCP_LOWER_BORROW |
Definition at line 3766 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_CONNPOOL PROTOCORE_CONN_POOL_BORROW |
Definition at line 3768 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_TCPLISTENER PROTOCORE_TCP_LISTENER_BORROW |
Definition at line 3770 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_TCPCLIENT PROTOCORE_TCP_CLIENT_BORROW |
Definition at line 3772 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_HAPPYEYEBALLS 0 |
Definition at line 3777 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_WORK_PHYSICAL PROTOCORE_PHYSICAL_BORROW |
Definition at line 3780 of file buffer_sizing.h.
| #define PROTOCORE_PLAINTEXT_ARENA_SIZE |
Definition at line 3783 of file buffer_sizing.h.
| #define PROTOCORE_DEBUG_CHECKS 0 |
Compile the library's internal debug checks (default 0 = off).
Deliberately NOT keyed on NDEBUG. Whether NDEBUG is defined is a property of whichever toolchain happens to build the library - the Arduino ESP32 core does not define it - so keying on it means nobody actually chose. This is the switch we control.
What it enables today: the pools' owner tripwire, which records the first execution context to touch each slot and asserts every later borrow matches. That catches a borrow crossing tasks - the one way the lock-free single-accessor invariant can break - and turns a silent cross-core race into an immediate failure.
Measured cost on an ESP32-S3 at 240 MHz: ~52 cycles per pool entry point, and a mark + alloc + release touches three of them, so roughly 156 cycles on every borrow. Worth paying while chasing a memory bug; not worth shipping.
Definition at line 3826 of file buffer_sizing.h.
| #define PROTOCORE_RAND_RESEED_BYTES (1u << 20) |
Bytes a worker's generator draws before it redraws its seed from the platform.
The generator's own pace, not a caller's: nothing in crypto/rng/rng.h lets a consumer ask for a reseed, because a consumer that could ask would set the rate, and the module that asked most often would set it for everyone. A draw is answered from the keystream and the seed is redrawn once this budget is spent.
Lower spends more platform entropy for a shorter window per seed; higher does the reverse. The forward ratchet already makes an earlier draw unrecoverable from the current state, so this bounds the other direction - how long one platform draw is relied on - rather than backward secrecy.
Definition at line 3842 of file buffer_sizing.h.
| #define PROTOCORE_IKE_BORROW PROTOCORE_CRYPTO_BORROW_MAX |
Definition at line 3859 of file buffer_sizing.h.
| #define PROTOCORE_CRYPTO_BORROW_MAX PROTOCORE_HMAC_SHA512_BORROW |
Definition at line 3865 of file buffer_sizing.h.
| #define PROTOCORE_QUIC_KEYS_BORROW (PROTOCORE_HKDF_BORROW + 32) |
Definition at line 3871 of file buffer_sizing.h.
| #define PROTOCORE_ECDSA_BORROW (PROTOCORE_SHA256_BORROW + PROTOCORE_HMAC_SHA256_BORROW) |
Definition at line 3877 of file buffer_sizing.h.
| #define PROTOCORE_HKDF_SHA384_BORROW (PROTOCORE_HMAC_SHA384_BORROW + 48 + 514) |
Definition at line 3883 of file buffer_sizing.h.
| #define PROTOCORE_HKDF_BORROW (PROTOCORE_HMAC_SHA256_BORROW + 32 + 514) |
Definition at line 3888 of file buffer_sizing.h.
| #define PROTOCORE_SSH_KDF_BORROW (PROTOCORE_SSH_KEXHASH_BORROW + 128) |
Definition at line 3894 of file buffer_sizing.h.
| #define PROTOCORE_WORK_ROUTE_TABLE (MAX_ROUTES * 104 + 16) |
Definition at line 3902 of file buffer_sizing.h.
| #define PROTOCORE_HTTP_ROUTE_BORROW PROTOCORE_WORK_ROUTE_TABLE |
The route table's borrow: every entry plus the count. Proved in http_route.c.
Definition at line 3907 of file buffer_sizing.h.
| #define PROTOCORE_SECURE_WORK_ROUTETABLE 0 |
Definition at line 3915 of file buffer_sizing.h.
| #define PROTOCORE_HTTP_AUTH_BORROW ((size_t)PROTOCORE_WORK_AUTH_TABLE + PROTOCORE_SHA256_BORROW) |
The HTTP auth borrow: the credential table, then the SHA-256 bytes behind it.
Both regions of one span. The table lasts the life of the program and the hash scratch does not, but the worst case over an entry's whole chain is taken once and never exceeded, so the digest nonce and the Basic check run out of the same borrow the table sits in. Proved in http/auth.c.
Definition at line 3925 of file buffer_sizing.h.
| #define PROTOCORE_WORK_AUTH_TABLE (MAX_ROUTES * (3 * MAX_AUTH_LEN + 8) + 32) |
Definition at line 3929 of file buffer_sizing.h.
| #define PROTOCORE_WORK_SSH_HOST_KEY (256 + 1700 + 16) |
Definition at line 3934 of file buffer_sizing.h.
| #define PROTOCORE_H2_SERVER_BORROW ((size_t)MAX_CONNS * 16 + 64) |
Definition at line 3938 of file buffer_sizing.h.
| #define PROTOCORE_CLIENT_CONNS 2 |
Number of simultaneous outbound client connections (BSS pool size).
Definition at line 4071 of file buffer_sizing.h.
| #define PROTOCORE_CLIENT_RX_BUF 8192 |
Per-connection wire receive ring size (bytes).
Holds plaintext (plain) or ciphertext (TLS). The transport ACKs on consume (TcpClient.read reopens the window), so for a large inbound transfer to never stall the ring must hold a full TCP receive window: keep PROTOCORE_CLIENT_RX_BUF >= TCP_WND (~5.7 KB). The 8192 default clears that and a multi-KB TLS handshake flight; a ring below TCP_WND can deadlock a sustained download (the peer would be allowed to send more than the ring holds). Must exceed one TCP segment (TCP_MSS).
Definition at line 4086 of file buffer_sizing.h.
| #define SSH_CHAN_WINDOW 32768u |
Initial receive window the SSH server advertises (RFC 4254 ยง5.1).
Definition at line 4093 of file buffer_sizing.h.
| #define SSH_CHAN_MAX_PACKET (SSH_PKT_BUF_SIZE - 64u) |
Maximum SSH channel data payload the server advertises it can receive per message.
This is what a peer may put in one SSH_MSG_CHANNEL_DATA, so it MUST fit one inbound SSH packet: the transport rejects any packet larger than SSH_PKT_BUF_SIZE, so advertising more than that (minus the channel-data + packet framing + MAC + padding) makes a peer that sends a bigger message - e.g. an SFTP WRITE - trip the packet-too-large check and drop the connection. Derived from SSH_PKT_BUF_SIZE so it scales when that buffer is raised (e.g. for higher SFTP throughput). Interactive shells never approach it.
Definition at line 4105 of file buffer_sizing.h.
| #define SSH_REKEY_PACKET_THRESHOLD (0x20000000u / SSH_PKT_BUF_SIZE) |
Re-key when either packet sequence number reaches this value.
Two bounds govern one key and the tighter one binds: RFC 4253 sec 9 gives a gigabyte of transmitted data, RFC 4344 sec 3.2 gives 2^32 blocks, which at 16 bytes a block is 64 GiB. So the gigabyte is what to divide by a packet. A wire packet is the payload buffer plus the compressor's worst case (an eighth) plus framing and the largest MAC tag, which is under twice the buffer, so twice the buffer is the packet size to divide by. Both are powers of two and so is the quotient: the sequence-number check is a compare against a shift, never a divide. 2^30 / (2 * BUF) is written as 2^29 / BUF. Far below SSH_SEQ_CLOSE_THRESHOLD, so a re-key always precedes the wrap that would repeat the CTR keystream.
Definition at line 4120 of file buffer_sizing.h.
| #define SSH_REKEY_TIME_MS 3600000u |
Elapsed-time re-key trigger in milliseconds (RFC 4253 ยง9: "after each hour"). Default 1 hour.
A server-initiated re-key fires when either this much time or SSH_REKEY_PACKET_THRESHOLD packets have passed since the last KEX, whichever comes first. Set to 0 to disable the time trigger (packet-count only). Measured with the pluggable clock (protocore_millis()).
Definition at line 4130 of file buffer_sizing.h.
| #define SSH_AUTH_TIMEOUT_MS 600000u |
How long a connection may stay unauthenticated before it is disconnected, milliseconds.
RFC 4252 sec 4: "The server SHOULD have a timeout for authentication and disconnect if the authentication has not been accepted within the timeout period. The RECOMMENDED timeout period is 10 minutes." Set to 0 to disable. Measured with the pluggable clock (protocore_millis()).
Definition at line 4140 of file buffer_sizing.h.
| #define SSH_AUTH_USER_MAX 32 |
Max stored user name (RFC 4252 imposes no limit; we cap for BSS).
Definition at line 4144 of file buffer_sizing.h.
| #define PROTOCORE_SSH_PTY_TERM_MAX 24 |
Max stored TERM value from a pty-req (RFC 4254 sec 6.2).
TERM is an environment variable's value, so the RFC sets no bound; a longer one is truncated rather than refused. "vt100", "xterm", "xterm-256color" and "screen-256color" all fit.
Definition at line 4153 of file buffer_sizing.h.
| #define SSH_AUTH_PASS_MAX 64 |
Max stored password length.
Definition at line 4157 of file buffer_sizing.h.
| #define SSH_AUTH_ALGO_MAX 20 |
Max stored public-key algorithm name ("rsa-sha2-512", "ecdsa-sha2-nistp256", RFC 4253 sec 6.6).
Definition at line 4161 of file buffer_sizing.h.
| #define SSH_KEXINIT_MAX 2048 |
Max stored size of the CLIENT KEXINIT payload (I_C, for the exchange hash).
A modern OpenSSH client's KEXINIT (post-quantum KEX names + cert host-key algs + EtM MACs + ext-info-c) runs well past 1 KB, so this must be large enough to hold it - a smaller bound silently rejects real clients at key exchange. The packet layer already caps any single packet at SSH_PKT_BUF_SIZE.
Definition at line 4172 of file buffer_sizing.h.
| #define PROTOCORE_SCPI_ERR_QUEUE 8 |
SCPI error/event queue depth (entries). The SCPI status model requires a queue; when it overflows the tail entry is replaced with -350 "Queue overflow" per the standard.
Definition at line 4325 of file buffer_sizing.h.
| #define PROTOCORE_WAL_PAGE_SIZE 32768 |
Definition at line 4329 of file buffer_sizing.h.
| #define PROTOCORE_WAL_MAX_RECORD 4096 |
Definition at line 4333 of file buffer_sizing.h.
| #define PROTOCORE_DBM_SLOTS 256 |
Definition at line 4337 of file buffer_sizing.h.
| #define PROTOCORE_DBM_KEY_MAX 32 |
Definition at line 4341 of file buffer_sizing.h.
| #define PROTOCORE_DBM_VAL_MAX 256 |
Definition at line 4345 of file buffer_sizing.h.
| #define PROTOCORE_DOCSTORE_FIELD_MAX 128 |
Definition at line 4349 of file buffer_sizing.h.
| #define PROTOCORE_MESH_QUERY_MS 300 |
Definition at line 4355 of file buffer_sizing.h.
| #define PROTOCORE_MESH_HOST_MAX 64 |
Definition at line 4359 of file buffer_sizing.h.
| #define PROTOCORE_MESH_HDRS_MAX 384 |
Definition at line 4363 of file buffer_sizing.h.
| typedef enum PROTO_ENUM_PACKED ProtoConn |
Application protocol spoken on a listener port or connection slot.
Stored in both Listener::proto and TcpConn::proto. The session layer uses this to route events to the correct protocol handler without branching on port numbers.
All values are always present regardless of feature flags - the enum is part of the listener API. Feature flags gate the implementation, not the identifier.
| typedef enum PROTO_ENUM_PACKED protocore_if_kind |
What an interface is, and the filter that selects one.
One vocabulary for both jobs. A registered interface carries its kind (layer 1 keeps the registry); a route or a connection carries the same value as a filter, where PROTOCORE_IF_ANY means "no filter". The wifi/eth values are what a connection is stamped with at accept time by comparing its local IP to the softAP IP; a bus or radio interface is registered by the application and forwarded to like any other.
| enum PROTO_ENUM_PACKED |
Application protocol spoken on a listener port or connection slot.
Stored in both Listener::proto and TcpConn::proto. The session layer uses this to route events to the correct protocol handler without branching on port numbers.
All values are always present regardless of feature flags - the enum is part of the listener API. Feature flags gate the implementation, not the identifier.
Definition at line 4025 of file buffer_sizing.h.
| enum PROTO_ENUM_PACKED |
What an interface is, and the filter that selects one.
One vocabulary for both jobs. A registered interface carries its kind (layer 1 keeps the registry); a route or a connection carries the same value as a filter, where PROTOCORE_IF_ANY means "no filter". The wifi/eth values are what a connection is stamped with at accept time by comparing its local IP to the softAP IP; a bus or radio interface is registered by the application and forwarded to like any other.
Definition at line 4051 of file buffer_sizing.h.