35#ifndef PROTOCORE_CONFIG_H
36#define PROTOCORE_CONFIG_H
74#define PC_TCP_NODELAY 1
90#ifndef PC_ENABLE_DIFFSERV
91#define PC_ENABLE_DIFFSERV 0
108#ifndef PC_BASE64_SWAR
109#define PC_BASE64_SWAR 1
115#define RX_BUF_SIZE 1024
124#ifndef CONN_TIMEOUT_MS
125#define CONN_TIMEOUT_MS 5000
141#ifndef PC_REQUEST_TIMEOUT_MS
142#define PC_REQUEST_TIMEOUT_MS 10000
154#ifndef PC_CLOSING_TIMEOUT_MS
155#define PC_CLOSING_TIMEOUT_MS 2000
174#ifndef PC_WORKER_COUNT
175#define PC_WORKER_COUNT 1
182#if PC_ENABLE_SSH_CLIENT
183#define PC_SCRATCH_SLOTS (PC_WORKER_COUNT + 1)
184#define PC_SSH_CLIENT_SCRATCH_SLOT (PC_WORKER_COUNT)
186#define PC_SCRATCH_SLOTS (PC_WORKER_COUNT)
209#if (defined(PC_ENABLE_SSH) && PC_ENABLE_SSH) || (defined(PC_ENABLE_SSH_CLIENT) && PC_ENABLE_SSH_CLIENT) || \
210 (defined(PC_ENABLE_HTTP3) && PC_ENABLE_HTTP3)
216#ifndef PC_WORKER_TASK_STACK
229#if (PC_ENABLE_PQC_KEX || (defined(PC_ENABLE_SSH_SNTRUP761) && PC_ENABLE_SSH_SNTRUP761)) && PC_SSH_ANY
230#if defined(PC_ENABLE_SSH_SNTRUP761) && !PC_ENABLE_SSH_SNTRUP761
231#define PC_WORKER_TASK_STACK 16384
232#elif defined(PC_ENABLE_SSH_CLIENT) && PC_ENABLE_SSH_CLIENT
233#define PC_WORKER_TASK_STACK 40960
235#define PC_WORKER_TASK_STACK 32768
238#define PC_WORKER_TASK_STACK 12288
240#define PC_WORKER_TASK_STACK 8192
253#ifndef PC_WORKER_STACK_RSA_MIN
254#define PC_WORKER_STACK_RSA_MIN 8192
268#ifndef PC_WORKER_STACK_CURVE_MIN
269#define PC_WORKER_STACK_CURVE_MIN 12288
273#ifndef PC_WORKER_TASK_PRIORITY
274#define PC_WORKER_TASK_PRIORITY 5
282#ifndef PC_WORKER_CORE
283#define PC_WORKER_CORE 1
294#ifndef PC_DEFER_QUEUE_DEPTH
295#define PC_DEFER_QUEUE_DEPTH 8
315#ifndef PC_WORKER_POLL_TICKS
316#define PC_WORKER_POLL_TICKS 1
319#if PC_WORKER_COUNT < 1
320#error "ProtoCore: PC_WORKER_COUNT must be >= 1"
322#if PC_WORKER_COUNT > MAX_CONNS
323#error "ProtoCore: PC_WORKER_COUNT must be <= MAX_CONNS"
339#ifndef PC_ENABLE_PREEMPT_QUEUE
340#define PC_ENABLE_PREEMPT_QUEUE 0
345#define PC_PQ_DEPTH 16
349#ifndef PC_PQ_ITEM_SIZE
350#define PC_PQ_ITEM_SIZE 32
355#define PC_PQ_STACK 4096
364#ifndef PC_PQ_INTERNAL_PRIORITY
365#define PC_PQ_INTERNAL_PRIORITY 8
368#if PC_ENABLE_PREEMPT_QUEUE && (PC_PQ_DEPTH < 1 || PC_PQ_ITEM_SIZE < 1)
369#error "ProtoCore: PC_PQ_DEPTH and PC_PQ_ITEM_SIZE must be >= 1"
392#define PC_ENABLE_DMA 0
396#ifndef PC_DMA_CHANNELS
397#define PC_DMA_CHANNELS 2
401#ifndef PC_DMA_BUF_SIZE
402#define PC_DMA_BUF_SIZE 256
409#ifndef PC_DMA_SIMULATE
410#define PC_DMA_SIMULATE 1
413#if PC_ENABLE_DMA && (PC_DMA_CHANNELS < 1 || PC_DMA_BUF_SIZE < 1)
414#error "ProtoCore: PC_DMA_CHANNELS and PC_DMA_BUF_SIZE must be >= 1"
432#ifndef PC_ENABLE_TRACE_CAPTURE
433#define PC_ENABLE_TRACE_CAPTURE 0
437#ifndef PC_TC_MAX_WINDOW_SAMPLES
438#define PC_TC_MAX_WINDOW_SAMPLES 4096
441#if PC_ENABLE_TRACE_CAPTURE && PC_TC_MAX_WINDOW_SAMPLES < 1
442#error "ProtoCore: PC_TC_MAX_WINDOW_SAMPLES must be >= 1"
456#ifndef PC_ENABLE_AD9238
457#define PC_ENABLE_AD9238 0
474#ifndef PC_ENABLE_FORWARD
475#define PC_ENABLE_FORWARD 0
479#ifndef PC_FWD_MAX_IFACES
480#define PC_FWD_MAX_IFACES 4
484#ifndef PC_FWD_MAX_RULES
485#define PC_FWD_MAX_RULES 8
489#ifndef PC_FWD_MAX_ACL
490#define PC_FWD_MAX_ACL 8
494#ifndef PC_FWD_ACL_PATLEN
495#define PC_FWD_ACL_PATLEN 4
500#ifndef PC_FWD_MAX_ROUTES
501#define PC_FWD_MAX_ROUTES 8
508#ifndef PC_FWD_INSPECT
509#define PC_FWD_INSPECT 0
512#if PC_ENABLE_FORWARD && (PC_FWD_MAX_IFACES < 1 || PC_FWD_MAX_RULES < 1 || PC_FWD_ACL_PATLEN < 1)
513#error "ProtoCore: PC_FWD_MAX_IFACES / PC_FWD_MAX_RULES / PC_FWD_ACL_PATLEN must be >= 1"
531#ifndef PC_ENABLE_GATEWAY
532#define PC_ENABLE_GATEWAY 0
536#ifndef PC_GW_MAX_PORTS
537#define PC_GW_MAX_PORTS 4
541#ifndef PC_GW_DEFAULT_PREFIX
542#define PC_GW_DEFAULT_PREFIX "gw"
545#if PC_ENABLE_GATEWAY && (PC_GW_MAX_PORTS < 1)
546#error "ProtoCore: PC_GW_MAX_PORTS must be >= 1"
561#ifndef PC_ENABLE_LORA
562#define PC_ENABLE_LORA 0
566#ifndef PC_LORA_MAX_PAYLOAD
567#define PC_LORA_MAX_PAYLOAD 251
570#if PC_ENABLE_LORA && (PC_LORA_MAX_PAYLOAD < 1 || PC_LORA_MAX_PAYLOAD > 251)
571#error "ProtoCore: PC_LORA_MAX_PAYLOAD must be 1..251"
587#ifndef PC_ENABLE_NRF24
588#define PC_ENABLE_NRF24 0
592#ifndef PC_NRF24_PAYLOAD
593#define PC_NRF24_PAYLOAD 32
596#if PC_ENABLE_NRF24 && (PC_NRF24_PAYLOAD < 1 || PC_NRF24_PAYLOAD > 32)
597#error "ProtoCore: PC_NRF24_PAYLOAD must be 1..32"
612#ifndef PC_ENABLE_ENOCEAN
613#define PC_ENABLE_ENOCEAN 0
617#ifndef PC_ENOCEAN_MAX_DATA
618#define PC_ENOCEAN_MAX_DATA 512
621#if PC_ENABLE_ENOCEAN && (PC_ENOCEAN_MAX_DATA < 1)
622#error "ProtoCore: PC_ENOCEAN_MAX_DATA must be >= 1"
638#ifndef PC_ENABLE_PN532
639#define PC_ENABLE_PN532 0
643#ifndef PC_PN532_MAX_DATA
644#define PC_PN532_MAX_DATA 254
647#if PC_ENABLE_PN532 && (PC_PN532_MAX_DATA < 1 || PC_PN532_MAX_DATA > 254)
648#error "ProtoCore: PC_PN532_MAX_DATA must be 1..254"
662#ifndef PC_ENABLE_SIGFOX
663#define PC_ENABLE_SIGFOX 0
667#ifndef PC_SIGFOX_MAX_PAYLOAD
668#define PC_SIGFOX_MAX_PAYLOAD 12
671#if PC_ENABLE_SIGFOX && (PC_SIGFOX_MAX_PAYLOAD < 1 || PC_SIGFOX_MAX_PAYLOAD > 12)
672#error "ProtoCore: PC_SIGFOX_MAX_PAYLOAD must be 1..12"
688#ifndef PC_ENABLE_ZWAVE
689#define PC_ENABLE_ZWAVE 0
693#ifndef PC_ZWAVE_MAX_DATA
694#define PC_ZWAVE_MAX_DATA 64
697#if PC_ENABLE_ZWAVE && (PC_ZWAVE_MAX_DATA < 1)
698#error "ProtoCore: PC_ZWAVE_MAX_DATA must be >= 1"
715#ifndef PC_ENABLE_ZIGBEE
716#define PC_ENABLE_ZIGBEE 0
720#ifndef PC_ZIGBEE_MAX_DATA
721#define PC_ZIGBEE_MAX_DATA 128
724#if PC_ENABLE_ZIGBEE && (PC_ZIGBEE_MAX_DATA < 1)
725#error "ProtoCore: PC_ZIGBEE_MAX_DATA must be >= 1"
741#ifndef PC_ENABLE_THREAD
742#define PC_ENABLE_THREAD 0
746#ifndef PC_THREAD_MAX_DATA
747#define PC_THREAD_MAX_DATA 256
750#if PC_ENABLE_THREAD && (PC_THREAD_MAX_DATA < 1)
751#error "ProtoCore: PC_THREAD_MAX_DATA must be >= 1"
767#ifndef PC_ENABLE_ETHERNET
768#define PC_ENABLE_ETHERNET 0
775#define PC_ETH_W5500 0
777#ifndef PC_ETH_W5500_CS
778#define PC_ETH_W5500_CS 7
780#ifndef PC_ETH_W5500_RST
781#define PC_ETH_W5500_RST 6
783#ifndef PC_ETH_W5500_INT
784#define PC_ETH_W5500_INT 5
786#ifndef PC_ETH_W5500_SCK
787#define PC_ETH_W5500_SCK 12
789#ifndef PC_ETH_W5500_MISO
790#define PC_ETH_W5500_MISO 13
792#ifndef PC_ETH_W5500_MOSI
793#define PC_ETH_W5500_MOSI 11
798#ifndef PC_ETH_W5500_SPI_MHZ
799#define PC_ETH_W5500_SPI_MHZ 20
811#ifndef PC_ENABLE_IPV6
812#define PC_ENABLE_IPV6 0
824#ifndef PC_ENABLE_PROMISC
825#define PC_ENABLE_PROMISC 0
838#ifndef PC_ENABLE_BUS_CAPTURE
839#define PC_ENABLE_BUS_CAPTURE 0
853#define MAX_PATH_LEN 64
865#define MAX_KEY_LEN 32
870#define MAX_VAL_LEN 48
875#define MAX_QUERY_LEN 128
879#ifndef MAX_QUERY_PARAMS
880#define MAX_QUERY_PARAMS 8
884#ifndef MAX_PATH_PARAMS
885#define MAX_PATH_PARAMS 4
895#ifndef DIGEST_AUTH_HDR_MAX
896#define DIGEST_AUTH_HDR_MAX 384
911#ifndef PC_DIGEST_NONCE_LIFETIME_MS
912#define PC_DIGEST_NONCE_LIFETIME_MS (5u * 60u * 1000u)
917#define QUERY_KEY_LEN 24
922#define QUERY_VAL_LEN 48
933#define BODY_BUF_SIZE 256
949#ifndef MAX_MIDDLEWARE
950#define MAX_MIDDLEWARE 4
966#ifndef CHUNK_BUF_SIZE
967#define CHUNK_BUF_SIZE 1440
977#ifndef JSON_MAX_DEPTH
978#define JSON_MAX_DEPTH 8
990#define RE_MAX_STEPS 2000
1004#define MAX_WS_CONNS 2
1013#ifndef WS_FRAME_SIZE
1014#define WS_FRAME_SIZE 512
1027#ifndef MAX_SSE_CONNS
1028#define MAX_SSE_CONNS 2
1038#define SSE_BUF_SIZE 256
1053#ifndef FILE_CHUNK_SIZE
1054#define FILE_CHUNK_SIZE 1024
1068#define MAX_AUTH_LEN 32
1081#ifndef MAX_MULTIPART_PARTS
1082#define MAX_MULTIPART_PARTS 4
1088#ifndef MAX_BOUNDARY_LEN
1089#define MAX_BOUNDARY_LEN 72
1109#ifndef EVT_QUEUE_DEPTH
1110#define EVT_QUEUE_DEPTH (MAX_CONNS * 4)
1126#ifndef RESP_HDR_BUF_SIZE
1127#define RESP_HDR_BUF_SIZE 768
1139#ifndef EXTRA_HDR_BUF_SIZE
1140#define EXTRA_HDR_BUF_SIZE 256
1150#ifndef WS_HDR_BUF_SIZE
1151#define WS_HDR_BUF_SIZE 256
1161#ifndef CORS_HDR_BUF_SIZE
1162#define CORS_HDR_BUF_SIZE 192
1171#ifndef CACHE_CONTROL_BUF_SIZE
1172#define CACHE_CONTROL_BUF_SIZE 64
1241#ifndef PC_ENABLE_WEBSOCKET
1242#define PC_ENABLE_WEBSOCKET 1
1259#ifndef PC_ENABLE_WS_DEFLATE
1260#define PC_ENABLE_WS_DEFLATE 0
1274#ifndef PC_WS_FRAG_SIZE
1275#define PC_WS_FRAG_SIZE 0
1279#ifndef PC_ENABLE_SSE
1280#define PC_ENABLE_SSE 1
1284#ifndef PC_ENABLE_MULTIPART
1285#define PC_ENABLE_MULTIPART 1
1296#ifndef PC_ENABLE_CBOR
1297#define PC_ENABLE_CBOR 0
1310#ifndef PC_ENABLE_MSGPACK
1311#define PC_ENABLE_MSGPACK 0
1315#ifndef PC_ENABLE_FILE_SERVING
1316#define PC_ENABLE_FILE_SERVING 1
1336#ifndef PC_ENABLE_WEBDAV
1337#define PC_ENABLE_WEBDAV 0
1341#ifndef PC_WEBDAV_BUF_SIZE
1342#define PC_WEBDAV_BUF_SIZE 2048
1346#ifndef PC_WEBDAV_MAX_ENTRIES
1347#define PC_WEBDAV_MAX_ENTRIES 32
1351#ifndef PC_WEBDAV_MAX_PROPS
1352#define PC_WEBDAV_MAX_PROPS 16
1361#ifndef PC_METHOD_BUF_SIZE
1363#define PC_METHOD_BUF_SIZE 12
1365#define PC_METHOD_BUF_SIZE 8
1370#ifndef PC_ENABLE_AUTH
1371#define PC_ENABLE_AUTH 1
1375#ifndef PC_ENABLE_TELNET
1376#define PC_ENABLE_TELNET 0
1380#ifndef PC_ENABLE_SSH
1381#define PC_ENABLE_SSH 0
1392#ifndef PC_ENABLE_SSH_CLIENT
1393#define PC_ENABLE_SSH_CLIENT 0
1407#ifndef PC_ENABLE_PQC_KEX
1408#define PC_ENABLE_PQC_KEX 0
1423#ifndef PC_ENABLE_SSH_SNTRUP761
1424#define PC_ENABLE_SSH_SNTRUP761 PC_ENABLE_PQC_KEX
1439#ifndef PC_ENABLE_MODBUS
1440#define PC_ENABLE_MODBUS 0
1454#ifndef PC_ENABLE_MODBUS_RTU
1455#define PC_ENABLE_MODBUS_RTU 0
1460#define PC_NEED_MODBUS (PC_ENABLE_MODBUS || PC_ENABLE_MODBUS_RTU)
1471#ifndef PC_ENABLE_CLOUDEVENTS
1472#define PC_ENABLE_CLOUDEVENTS 0
1485#ifndef PC_ENABLE_REDIS
1486#define PC_ENABLE_REDIS 0
1498#ifndef PC_ENABLE_STOMP
1499#define PC_ENABLE_STOMP 0
1503#ifndef PC_STOMP_MAX_HEADERS
1504#define PC_STOMP_MAX_HEADERS 16
1517#ifndef PC_ENABLE_MQTT_SN
1518#define PC_ENABLE_MQTT_SN 0
1531#ifndef PC_ENABLE_FLOW_EXPORT
1532#define PC_ENABLE_FLOW_EXPORT 0
1544#ifndef PC_ENABLE_PROTOBUF
1545#define PC_ENABLE_PROTOBUF 0
1558#ifndef PC_ENABLE_WAMP
1559#define PC_ENABLE_WAMP 0
1571#ifndef PC_ENABLE_SUNSPEC
1572#define PC_ENABLE_SUNSPEC 0
1585#ifndef PC_ENABLE_C37118
1586#define PC_ENABLE_C37118 0
1599#ifndef PC_ENABLE_DNP3
1600#define PC_ENABLE_DNP3 0
1614#ifndef PC_ENABLE_CANOPEN
1615#define PC_ENABLE_CANOPEN 0
1630#ifndef PC_ENABLE_CIA402
1631#define PC_ENABLE_CIA402 0
1645#ifndef PC_ENABLE_CONTROL
1646#define PC_ENABLE_CONTROL 0
1661#ifndef PC_ENABLE_J1939
1662#define PC_ENABLE_J1939 0
1676#ifndef PC_ENABLE_DEVICENET
1677#define PC_ENABLE_DEVICENET 0
1691#ifndef PC_ENABLE_NMEA2000
1692#define PC_ENABLE_NMEA2000 0
1695#define PC_NEED_J1939 (PC_ENABLE_J1939 || PC_ENABLE_NMEA2000)
1708#ifndef PC_ENABLE_MBUS
1709#define PC_ENABLE_MBUS 0
1724#ifndef PC_ENABLE_IEC60870
1725#define PC_ENABLE_IEC60870 0
1740#ifndef PC_ENABLE_SDI12
1741#define PC_ENABLE_SDI12 0
1755#ifndef PC_ENABLE_DMX
1756#define PC_ENABLE_DMX 0
1770#ifndef PC_ENABLE_NMEA0183
1771#define PC_ENABLE_NMEA0183 0
1785#ifndef PC_ENABLE_ROAMING
1786#define PC_ENABLE_ROAMING 0
1799#ifndef PC_ENABLE_UBX
1800#define PC_ENABLE_UBX 0
1814#ifndef PC_ENABLE_PTP
1815#define PC_ENABLE_PTP 0
1830#ifndef PC_ENABLE_IOLINK
1831#define PC_ENABLE_IOLINK 0
1844#ifndef PC_ENABLE_GRPC_WEB
1845#define PC_ENABLE_GRPC_WEB 0
1856#ifndef PC_ENABLE_LWM2M
1857#define PC_ENABLE_LWM2M 0
1869#ifndef PC_ENABLE_FINS
1870#define PC_ENABLE_FINS 0
1882#ifndef PC_ENABLE_HOSTLINK
1883#define PC_ENABLE_HOSTLINK 0
1900#ifndef PC_ENABLE_SCPI
1901#define PC_ENABLE_SCPI 0
1905#ifndef PC_SCPI_ERR_QUEUE
1906#define PC_SCPI_ERR_QUEUE 8
1920#ifndef PC_ENABLE_HISLIP
1921#define PC_ENABLE_HISLIP 0
1936#ifndef PC_ENABLE_VXI11
1937#define PC_ENABLE_VXI11 0
1952#ifndef PC_ENABLE_GPIB
1953#define PC_ENABLE_GPIB 0
1968#ifndef PC_ENABLE_HAAS_MDC
1969#define PC_ENABLE_HAAS_MDC 0
1980#ifndef PC_ENABLE_PACKML
1981#define PC_ENABLE_PACKML 0
1998#ifndef PC_ENABLE_LSV2
1999#define PC_ENABLE_LSV2 0
2015#ifndef PC_ENABLE_IKEV2
2016#define PC_ENABLE_IKEV2 0
2029#ifndef PC_ENABLE_SENML
2030#define PC_ENABLE_SENML 0
2033#define PC_NEED_CBOR (PC_ENABLE_CBOR || PC_ENABLE_SENML)
2044#ifndef PC_ENABLE_DF1
2045#define PC_ENABLE_DF1 0
2058#ifndef PC_ENABLE_SIMATIC
2059#define PC_ENABLE_SIMATIC 0
2063#ifndef PC_SIMATIC_BLOCK_MAX
2064#define PC_SIMATIC_BLOCK_MAX 256
2068#ifndef PC_SIMATIC_QVZ_MS
2069#define PC_SIMATIC_QVZ_MS 2000
2073#ifndef PC_SIMATIC_ZVZ_MS
2074#define PC_SIMATIC_ZVZ_MS 200
2086#ifndef PC_ENABLE_COTP
2087#define PC_ENABLE_COTP 0
2100#ifndef PC_ENABLE_S7COMM
2101#define PC_ENABLE_S7COMM 0
2114#ifndef PC_ENABLE_MELSEC
2115#define PC_ENABLE_MELSEC 0
2130#ifndef PC_ENABLE_ADS
2131#define PC_ENABLE_ADS 0
2146#ifndef PC_ENABLE_FOCAS
2147#define PC_ENABLE_FOCAS 0
2167#ifndef PC_ENABLE_FANUC_J519
2168#define PC_ENABLE_FANUC_J519 0
2180#ifndef PC_ENABLE_BACNET
2181#define PC_ENABLE_BACNET 0
2195#ifndef PC_ENABLE_ENIP
2196#define PC_ENABLE_ENIP 0
2209#ifndef PC_ENABLE_AMQP
2210#define PC_ENABLE_AMQP 0
2223#ifndef PC_ENABLE_CIP
2224#define PC_ENABLE_CIP 0
2237#ifndef PC_ENABLE_NATS
2238#define PC_ENABLE_NATS 0
2251#ifndef PC_ENABLE_PROXY_PROTOCOL
2252#define PC_ENABLE_PROXY_PROTOCOL 0
2264#ifndef PC_ENABLE_SPARKPLUG
2265#define PC_ENABLE_SPARKPLUG 0
2268#define PC_NEED_PROTOBUF (PC_ENABLE_PROTOBUF || PC_ENABLE_SPARKPLUG)
2271#ifndef PC_SPB_METRIC_MAX
2272#define PC_SPB_METRIC_MAX 256
2283#ifndef PC_ENABLE_MODBUS_MASTER
2284#define PC_ENABLE_MODBUS_MASTER 0
2288#ifndef PC_MODBUS_COILS
2289#define PC_MODBUS_COILS 64
2293#ifndef PC_MODBUS_DISCRETE_INPUTS
2294#define PC_MODBUS_DISCRETE_INPUTS 64
2298#ifndef PC_MODBUS_HOLDING_REGS
2299#define PC_MODBUS_HOLDING_REGS 64
2303#ifndef PC_MODBUS_INPUT_REGS
2304#define PC_MODBUS_INPUT_REGS 64
2316#ifndef PC_ENABLE_TLS
2317#define PC_ENABLE_TLS 0
2321#ifndef MAX_TLS_CONNS
2322#define MAX_TLS_CONNS 1
2338#ifndef PC_ENABLE_TLS_RESUMPTION
2339#define PC_ENABLE_TLS_RESUMPTION 0
2343#ifndef PC_TLS_TICKET_LIFETIME_S
2344#define PC_TLS_TICKET_LIFETIME_S 86400
2358#ifndef PC_ENABLE_MTLS
2359#define PC_ENABLE_MTLS 0
2363#ifndef PC_MTLS_SUBJECT_MAX
2364#define PC_MTLS_SUBJECT_MAX 128
2374#ifndef PC_ENABLE_SNMP
2375#define PC_ENABLE_SNMP 0
2379#ifndef PC_ENABLE_SNMP_V3
2380#define PC_ENABLE_SNMP_V3 0
2391#ifndef PC_ENABLE_SNMP_TRAP
2392#define PC_ENABLE_SNMP_TRAP 0
2396#ifndef PC_SNMP_TRAP_MAX_VARBINDS
2397#define PC_SNMP_TRAP_MAX_VARBINDS 8
2401#ifndef PC_SNMP_TRAP_BUF_SIZE
2402#define PC_SNMP_TRAP_BUF_SIZE 1024
2406#ifndef SNMP_MAX_OID_LEN
2407#define SNMP_MAX_OID_LEN 32
2417#ifndef SNMP_MAX_MIB_ENTRIES
2418#define SNMP_MAX_MIB_ENTRIES 16
2427#ifndef SNMP_MAX_VARBINDS
2428#define SNMP_MAX_VARBINDS 16
2438#ifndef SNMP_MSG_BUF_SIZE
2439#define SNMP_MSG_BUF_SIZE 1472
2443#ifndef SNMP_COMMUNITY_MAX
2444#define SNMP_COMMUNITY_MAX 32
2449#ifndef PC_SNMP_DEFAULT_RO_COMMUNITY
2450#define PC_SNMP_DEFAULT_RO_COMMUNITY "public"
2454#ifndef SNMP_V3_USER_MAX
2455#define SNMP_V3_USER_MAX 32
2459#ifndef SNMP_V3_ENGINEID_MAX
2460#define SNMP_V3_ENGINEID_MAX 32
2476#ifndef PC_ENABLE_COAP
2477#define PC_ENABLE_COAP 0
2489#ifndef PC_ENABLE_COAP_OBSERVE
2490#define PC_ENABLE_COAP_OBSERVE 0
2494#ifndef PC_COAP_MAX_OBSERVERS
2495#define PC_COAP_MAX_OBSERVERS 4
2504#ifndef PC_COAP_DEDUP_ENTRIES
2505#define PC_COAP_DEDUP_ENTRIES 4
2510#ifndef PC_COAP_DEDUP_RESP_MAX
2511#define PC_COAP_DEDUP_RESP_MAX 256
2516#ifndef PC_COAP_DEDUP_LIFETIME_MS
2517#define PC_COAP_DEDUP_LIFETIME_MS 247000u
2538#ifndef PC_ENABLE_COAP_BLOCK
2539#define PC_ENABLE_COAP_BLOCK 0
2543#ifndef PC_COAP_BLOCK_SZX_MAX
2544#define PC_COAP_BLOCK_SZX_MAX 6
2553#ifndef PC_COAP_BLOCK1_MAX
2554#define PC_COAP_BLOCK1_MAX 1024
2563#ifndef PC_COAP_MAX_RESOURCES
2564#define PC_COAP_MAX_RESOURCES 8
2568#ifndef PC_COAP_MAX_PATH
2569#define PC_COAP_MAX_PATH 64
2573#ifndef PC_COAP_MAX_QUERY
2574#define PC_COAP_MAX_QUERY 64
2583#ifndef PC_COAP_MAX_PAYLOAD
2584#define PC_COAP_MAX_PAYLOAD 256
2596#ifndef PC_COAP_MSG_BUF_SIZE
2597#if PC_ENABLE_COAP_BLOCK
2598#define PC_COAP_MSG_BUF_SIZE 1152
2600#define PC_COAP_MSG_BUF_SIZE 512
2605#ifndef PC_COAP_OBSERVE_PORT
2606#define PC_COAP_OBSERVE_PORT 5683
2624#ifndef PC_TLS_ARENA_SIZE
2630#define PC_TLS_ARENA_SIZE (49152 + (MAX_TLS_CONNS - 1) * 32768)
2645#ifndef PC_TLS_ARENA_IN_PSRAM
2646#define PC_TLS_ARENA_IN_PSRAM 0
2660#ifndef PC_TLS_MAX_FRAG_LEN
2661#define PC_TLS_MAX_FRAG_LEN 0
2681#ifndef PC_TLS_ECDHE_PREFER_P256
2682#define PC_TLS_ECDHE_PREFER_P256 PC_HW_ECC
2696#ifndef PC_TLS_ACK_MULTI_CONN_DRAM
2697#define PC_TLS_ACK_MULTI_CONN_DRAM 0
2706#ifndef PC_ENABLE_MDNS
2707#define PC_ENABLE_MDNS 0
2711#ifndef PC_ENABLE_NTP
2712#define PC_ENABLE_NTP 0
2725#ifndef PC_ENABLE_NTP_SERVER
2726#define PC_ENABLE_NTP_SERVER 0
2730#ifndef PC_NTP_SERVER_STRATUM
2731#define PC_NTP_SERVER_STRATUM 3
2745#ifndef PC_ENABLE_DNS_SERVER
2746#define PC_ENABLE_DNS_SERVER 0
2750#ifndef PC_DNS_SERVER_MAX_RECORDS
2751#define PC_DNS_SERVER_MAX_RECORDS 8
2755#ifndef PC_DNS_SERVER_TTL
2756#define PC_DNS_SERVER_TTL 60
2760#ifndef PC_DNS_NAME_MAX
2761#define PC_DNS_NAME_MAX 128
2778#ifndef PC_HTTP_EMIT_DATE
2779#define PC_HTTP_EMIT_DATE 0
2792#ifndef PC_ENABLE_TIME_SOURCE
2793#define PC_ENABLE_TIME_SOURCE 0
2797#ifndef PC_TIME_SOURCE_MAX
2798#define PC_TIME_SOURCE_MAX 4
2812#ifndef PC_I2C_SDA_PIN
2813#define PC_I2C_SDA_PIN -1
2815#ifndef PC_I2C_SCL_PIN
2816#define PC_I2C_SCL_PIN -1
2828#ifndef PC_ENABLE_RTC
2829#define PC_ENABLE_RTC 0
2833#ifndef PC_RTC_I2C_ADDR
2834#define PC_RTC_I2C_ADDR 0x68
2847#ifndef PC_ENABLE_LD2410
2848#define PC_ENABLE_LD2410 0
2867#ifndef PC_ENABLE_RCWL0516
2868#define PC_ENABLE_RCWL0516 0
2889#ifndef PC_ENABLE_HMMD
2890#define PC_ENABLE_HMMD 0
2895#define PC_HMMD_BAUD 115200
2916#ifndef PC_ENABLE_SAFETY_SCL
2917#define PC_ENABLE_SAFETY_SCL 0
2921#ifndef PC_LD2410_BAUD
2922#define PC_LD2410_BAUD 256000
2934#ifndef PC_ENABLE_SEN0192
2935#define PC_ENABLE_SEN0192 0
2939#ifndef PC_SEN0192_PIN
2940#define PC_SEN0192_PIN 4
2944#ifndef PC_SEN0192_HOLD_MS
2945#define PC_SEN0192_HOLD_MS 2000
2949#ifndef PC_SEN0192_ACTIVE_HIGH
2950#define PC_SEN0192_ACTIVE_HIGH 1
2963#ifndef PC_ENABLE_MPR121
2964#define PC_ENABLE_MPR121 0
2968#ifndef PC_MPR121_I2C_ADDR
2969#define PC_MPR121_I2C_ADDR 0x5A
2974#ifndef PC_MPR121_TOUCH_THRESHOLD
2975#define PC_MPR121_TOUCH_THRESHOLD 12
2979#ifndef PC_MPR121_RELEASE_THRESHOLD
2980#define PC_MPR121_RELEASE_THRESHOLD 6
2993#ifndef PC_ENABLE_SHT3X
2994#define PC_ENABLE_SHT3X 0
2998#ifndef PC_SHT3X_I2C_ADDR
2999#define PC_SHT3X_I2C_ADDR 0x44
3011#ifndef PC_ENABLE_PCA9685
3012#define PC_ENABLE_PCA9685 0
3016#ifndef PC_PCA9685_I2C_ADDR
3017#define PC_PCA9685_I2C_ADDR 0x40
3021#ifndef PC_PCA9685_FREQ
3022#define PC_PCA9685_FREQ 50
3035#ifndef PC_ENABLE_ADS1115
3036#define PC_ENABLE_ADS1115 0
3040#ifndef PC_ADS1115_I2C_ADDR
3041#define PC_ADS1115_I2C_ADDR 0x48
3046#ifndef PC_ADS1115_GAIN
3047#define PC_ADS1115_GAIN 2
3052#ifndef PC_ADS1115_DR
3053#define PC_ADS1115_DR 4
3058#ifndef PC_ADS1115_DIFFERENTIAL
3059#define PC_ADS1115_DIFFERENTIAL 0
3072#ifndef PC_ENABLE_INA219
3073#define PC_ENABLE_INA219 0
3077#ifndef PC_INA219_I2C_ADDR
3078#define PC_INA219_I2C_ADDR 0x40
3083#ifndef PC_INA219_CURRENT_LSB_UA
3084#define PC_INA219_CURRENT_LSB_UA 100
3089#ifndef PC_INA219_SHUNT_MOHM
3090#define PC_INA219_SHUNT_MOHM 100
3103#ifndef PC_ENABLE_CONFIG_STORE
3104#define PC_ENABLE_CONFIG_STORE 0
3108#ifndef PC_CONFIG_MAX_ENTRIES
3109#define PC_CONFIG_MAX_ENTRIES 16
3113#ifndef PC_CONFIG_KEY_MAX
3114#define PC_CONFIG_KEY_MAX 16
3118#ifndef PC_CONFIG_VAL_MAX
3119#define PC_CONFIG_VAL_MAX 64
3130#ifndef PC_ENABLE_DEVICE_ID
3131#define PC_ENABLE_DEVICE_ID 0
3144#ifndef PC_ENABLE_TELEMETRY
3145#define PC_ENABLE_TELEMETRY 0
3158#ifndef PC_ENABLE_DASHBOARD
3159#define PC_ENABLE_DASHBOARD 0
3171#ifndef PC_ENABLE_THEMES
3172#define PC_ENABLE_THEMES 0
3183#ifndef PC_THEMES_INCLUDE_TRADEMARKED
3184#define PC_THEMES_INCLUDE_TRADEMARKED 1
3188#ifndef PC_DASHBOARD_MAX_WIDGETS
3189#define PC_DASHBOARD_MAX_WIDGETS 16
3193#ifndef PC_DASHBOARD_JSON_BUF
3194#define PC_DASHBOARD_JSON_BUF 1024
3206#ifndef PC_ENABLE_PARTITION_MONITOR
3207#define PC_ENABLE_PARTITION_MONITOR 0
3211#ifndef PC_PARTITION_MAX
3212#define PC_PARTITION_MAX 16
3216#ifndef PC_PARTITION_JSON_BUF
3217#define PC_PARTITION_JSON_BUF 1024
3229#ifndef PC_ENABLE_GPIO_MAP
3230#define PC_ENABLE_GPIO_MAP 0
3235#define PC_GPIO_MAX 40
3239#ifndef PC_GPIO_JSON_BUF
3240#define PC_GPIO_JSON_BUF 1024
3252#ifndef PC_ENABLE_UDP_TELEMETRY
3253#define PC_ENABLE_UDP_TELEMETRY 0
3257#ifndef PC_UDP_TELEMETRY_BUF
3258#define PC_UDP_TELEMETRY_BUF 256
3271#ifndef PC_ENABLE_STATSD
3272#define PC_ENABLE_STATSD 0
3276#ifndef PC_STATSD_PORT
3277#define PC_STATSD_PORT 8125
3281#ifndef PC_STATSD_LINE_MAX
3282#define PC_STATSD_LINE_MAX 256
3295#ifndef PC_ENABLE_GUARDRAILS
3296#define PC_ENABLE_GUARDRAILS 0
3300#ifndef PC_GUARDRAIL_HEAP_MIN
3301#define PC_GUARDRAIL_HEAP_MIN 8192
3305#ifndef PC_GUARDRAIL_FRAG_MIN_BLOCK
3306#define PC_GUARDRAIL_FRAG_MIN_BLOCK 4096
3310#ifndef PC_GUARDRAIL_STACK_MIN
3311#define PC_GUARDRAIL_STACK_MIN 512
3323#ifndef PC_ENABLE_FAILSAFE
3324#define PC_ENABLE_FAILSAFE 0
3328#ifndef PC_FAILSAFE_MAX_LIFELINES
3329#define PC_FAILSAFE_MAX_LIFELINES 8
3340#ifndef PC_ENABLE_SLEEP_SCHED
3341#define PC_ENABLE_SLEEP_SCHED 0
3352#ifndef PC_ENABLE_WEARLEVEL
3353#define PC_ENABLE_WEARLEVEL 0
3368#ifndef PC_ENABLE_POWER_MGMT
3369#define PC_ENABLE_POWER_MGMT 0
3373#ifndef PC_POWER_MHZ_MAX
3374#define PC_POWER_MHZ_MAX 240
3378#ifndef PC_POWER_MHZ_MIN
3379#define PC_POWER_MHZ_MIN 80
3383#ifndef PC_POWER_BUSY_PCT
3384#define PC_POWER_BUSY_PCT 40
3388#ifndef PC_POWER_TEMP_HOT_C
3389#define PC_POWER_TEMP_HOT_C 80
3404#ifndef PC_POWER_TEMP_COOL_C
3405#define PC_POWER_TEMP_COOL_C 70
3409#ifndef PC_POWER_RECOVER_MS
3410#define PC_POWER_RECOVER_MS 10000
3413#if PC_ENABLE_POWER_MGMT && (PC_POWER_TEMP_COOL_C >= PC_POWER_TEMP_HOT_C)
3414#error "ProtoCore: PC_POWER_TEMP_COOL_C must be below PC_POWER_TEMP_HOT_C (hysteresis)"
3417#if PC_ENABLE_POWER_MGMT && (PC_POWER_MHZ_MIN > PC_POWER_MHZ_MAX)
3418#error "ProtoCore: PC_POWER_MHZ_MIN must not exceed PC_POWER_MHZ_MAX"
3421#if PC_ENABLE_POWER_MGMT && (PC_POWER_BUSY_PCT > 100)
3422#error "ProtoCore: PC_POWER_BUSY_PCT must be 0..100"
3437#ifndef PC_ENABLE_HOTSWAP
3438#define PC_ENABLE_HOTSWAP 0
3447#ifndef PC_HOTSWAP_FAIL_THRESHOLD
3448#define PC_HOTSWAP_FAIL_THRESHOLD 3
3452#ifndef PC_HOTSWAP_PROBE_MS
3453#define PC_HOTSWAP_PROBE_MS 2000
3456#if PC_ENABLE_HOTSWAP && (PC_HOTSWAP_FAIL_THRESHOLD < 1 || PC_HOTSWAP_FAIL_THRESHOLD > 255)
3457#error "ProtoCore: PC_HOTSWAP_FAIL_THRESHOLD must be in [1, 255]"
3468#ifndef PC_ENABLE_NETADAPT
3469#define PC_ENABLE_NETADAPT 0
3480#ifndef PC_ENABLE_DSHOT
3481#define PC_ENABLE_DSHOT 0
3492#ifndef PC_ENABLE_HART
3493#define PC_ENABLE_HART 0
3504#ifndef PC_ENABLE_NTS
3505#define PC_ENABLE_NTS 0
3516#ifndef PC_ENABLE_DDS
3517#define PC_ENABLE_DDS 0
3528#ifndef PC_ENABLE_XMPP
3529#define PC_ENABLE_XMPP 0
3540#ifndef PC_ENABLE_RAWL2
3541#define PC_ENABLE_RAWL2 0
3552#ifndef PC_ENABLE_SPA_ROUTER
3553#define PC_ENABLE_SPA_ROUTER 0
3565#ifndef PC_ENABLE_GOOSE
3566#define PC_ENABLE_GOOSE 0
3577#ifndef PC_ENABLE_MTCONNECT
3578#define PC_ENABLE_MTCONNECT 0
3592#ifndef PC_MTC_SAMPLE_BUFFER
3593#define PC_MTC_SAMPLE_BUFFER 32
3595#ifndef PC_MTC_STR_MAX
3596#define PC_MTC_STR_MAX 24
3598#ifndef PC_MTC_TS_MAX
3599#define PC_MTC_TS_MAX 32
3601#ifndef PC_MTC_VAL_MAX
3602#define PC_MTC_VAL_MAX 32
3615#ifndef PC_ENABLE_WAL
3616#define PC_ENABLE_WAL 0
3618#ifndef PC_WAL_PAGE_SIZE
3619#define PC_WAL_PAGE_SIZE 32768
3621#ifndef PC_WAL_MAX_RECORD
3622#define PC_WAL_MAX_RECORD 4096
3634#ifndef PC_ENABLE_DBM
3635#define PC_ENABLE_DBM 0
3638#define PC_DBM_SLOTS 256
3640#ifndef PC_DBM_KEY_MAX
3641#define PC_DBM_KEY_MAX 32
3643#ifndef PC_DBM_VAL_MAX
3644#define PC_DBM_VAL_MAX 256
3655#ifndef PC_ENABLE_DOCSTORE
3656#define PC_ENABLE_DOCSTORE 0
3658#ifndef PC_DOCSTORE_FIELD_MAX
3659#define PC_DOCSTORE_FIELD_MAX 128
3671#ifndef PC_ENABLE_SQLITE
3672#define PC_ENABLE_SQLITE 0
3684#ifndef PC_ENABLE_DNC
3685#define PC_ENABLE_DNC 0
3695#ifndef PC_DNC_LINE_MAX
3696#define PC_DNC_LINE_MAX 128
3706#ifndef PC_DNC_LEADER_LEN
3707#define PC_DNC_LEADER_LEN 32
3718#ifndef PC_DNC_XOFF_MAX_POLLS
3719#define PC_DNC_XOFF_MAX_POLLS 200000
3731#ifndef PC_ENABLE_RELAY
3732#define PC_ENABLE_RELAY 0
3745#ifndef PC_ENABLE_IFACE_BRIDGE
3746#define PC_ENABLE_IFACE_BRIDGE 0
3750#ifndef PC_BRIDGE_MAX_RULES
3751#define PC_BRIDGE_MAX_RULES 8
3762#ifndef PC_BRIDGE_TXN_MAX
3763#define PC_BRIDGE_TXN_MAX 256
3767#ifndef PC_BRIDGE_STREAM_CHUNK
3768#define PC_BRIDGE_STREAM_CHUNK 256
3772#ifndef PC_BRIDGE_UART_TXN_MS
3773#define PC_BRIDGE_UART_TXN_MS 50
3788#ifndef PC_ENABLE_NTRIP_CASTER
3789#define PC_ENABLE_NTRIP_CASTER 0
3793#ifndef PC_NTRIP_MAX_ROVERS
3794#define PC_NTRIP_MAX_ROVERS 4
3798#define PC_NEED_NMEA0183 (PC_ENABLE_NMEA0183 || PC_ENABLE_NTRIP_CASTER)
3801#ifndef PC_NTRIP_MOUNT_MAX
3802#define PC_NTRIP_MOUNT_MAX 32
3806#ifndef PC_NTRIP_REQ_MAX
3807#define PC_NTRIP_REQ_MAX 512
3811#ifndef PC_NTRIP_MAX_MOUNTS
3812#define PC_NTRIP_MAX_MOUNTS 2
3824#define PC_RELAY_BUF 2048
3834#ifndef PC_RELAY_DRAIN_MAX
3835#define PC_RELAY_DRAIN_MAX 8
3844#ifndef PC_RELAY_MAX_PUBLISH
3845#define PC_RELAY_MAX_PUBLISH 4
3852#ifndef PC_RELAY_MAX_CONNS
3853#define PC_RELAY_MAX_CONNS 4
3857#ifndef PC_RELAY_HOST_MAX
3858#define PC_RELAY_HOST_MAX 64
3862#ifndef PC_RELAY_CONNECT_MS
3863#define PC_RELAY_CONNECT_MS 5000
3876#ifndef PC_ENABLE_FTP
3877#define PC_ENABLE_FTP 0
3887#ifndef PC_FTP_CMD_MAX
3888#define PC_FTP_CMD_MAX 256
3901#ifndef PC_ENABLE_FTP_SESSION
3902#define PC_ENABLE_FTP_SESSION 0
3912#ifndef PC_FTP_REPLY_BUF
3913#define PC_FTP_REPLY_BUF 512
3918#define PC_FTP_CHUNK 512
3922#ifndef PC_FTP_TIMEOUT_MS
3923#define PC_FTP_TIMEOUT_MS 8000
3926#if PC_ENABLE_FTP_SESSION && !PC_ENABLE_FTP
3927#error "ProtoCore: PC_ENABLE_FTP_SESSION requires PC_ENABLE_FTP (it drives that codec)"
3930#if PC_ENABLE_FTP_SESSION && (PC_FTP_REPLY_BUF < 128)
3931#error "ProtoCore: PC_FTP_REPLY_BUF must be >= 128 (a multiline greeting needs room)"
3934#if PC_ENABLE_FTP_SESSION && (PC_FTP_CHUNK < 64)
3935#error "ProtoCore: PC_FTP_CHUNK must be >= 64"
3948#ifndef PC_ENABLE_HTTP_CACHE
3949#define PC_ENABLE_HTTP_CACHE 0
3964#ifndef PC_ENABLE_EDGE_CACHE
3965#define PC_ENABLE_EDGE_CACHE 0
3967#if PC_ENABLE_EDGE_CACHE && !PC_ENABLE_HTTP_CACHE
3968#error "PC_ENABLE_EDGE_CACHE requires PC_ENABLE_HTTP_CACHE"
3970#if PC_ENABLE_EDGE_CACHE && !PC_ENABLE_HTTP_CLIENT
3971#error "PC_ENABLE_EDGE_CACHE requires PC_ENABLE_HTTP_CLIENT (it fetches the upstream origin)"
3977#ifndef PC_ENABLE_EDGE_ORIGIN_TLS
3978#define PC_ENABLE_EDGE_ORIGIN_TLS 0
3980#if PC_ENABLE_EDGE_ORIGIN_TLS && !PC_ENABLE_EDGE_CACHE
3981#error "PC_ENABLE_EDGE_ORIGIN_TLS requires PC_ENABLE_EDGE_CACHE"
3983#if PC_ENABLE_EDGE_ORIGIN_TLS && !PC_ENABLE_TLS
3984#error "PC_ENABLE_EDGE_ORIGIN_TLS requires PC_ENABLE_TLS (the client-TLS engine)"
3991#define PC_EDGE_SD_VALUE_MAX \
3992 (1 + 2 + 2 + 7u * 2u + PC_EDGE_KEY_MAX + PC_EDGE_CTYPE_MAX + \
3993 PC_EDGE_ETAG_MAX + PC_EDGE_LASTMOD_MAX + PC_EDGE_CENC_MAX + PC_EDGE_VARY_MAX + PC_EDGE_VARY_MAX + \
3997#define PC_EDGE_MESH_TRAILER (8 + 8 + 4 + 4 + 4 )
4000#define PC_EDGE_MESH_ENTRY_MAX (PC_EDGE_MESH_TRAILER + PC_EDGE_SD_VALUE_MAX)
4003#define PC_EDGE_MESH_RESP_MAX (2 + 1 + 1 + 2 + PC_EDGE_MESH_ENTRY_MAX)
4006#define PC_EDGE_MESH_REQ_MAX (2 + 1 + 1 + 32 + 2 + PC_EDGE_KEY_MAX + 2 + PC_MESH_HDRS_MAX)
4011#if PC_ENABLE_EDGE_MESH
4012#define PC_EDGE_FETCH_BUF_MIN ((PC_EDGE_MESH_RESP_MAX) > 2560 ? (PC_EDGE_MESH_RESP_MAX) : 2560)
4014#define PC_EDGE_FETCH_BUF_MIN 2560
4019#ifndef PC_EDGE_KEY_MAX
4020#define PC_EDGE_KEY_MAX 128
4022#ifndef PC_EDGE_VARY_MAX
4023#define PC_EDGE_VARY_MAX 64
4027#ifndef PC_EDGE_CTYPE_MAX
4028#define PC_EDGE_CTYPE_MAX 64
4032#ifndef PC_EDGE_ETAG_MAX
4033#define PC_EDGE_ETAG_MAX 64
4037#ifndef PC_EDGE_LASTMOD_MAX
4038#define PC_EDGE_LASTMOD_MAX 40
4042#ifndef PC_EDGE_CENC_MAX
4043#define PC_EDGE_CENC_MAX 32
4045#ifndef PC_EDGE_MAP_MAX
4046#define PC_EDGE_MAP_MAX 4
4048#ifndef PC_EDGE_ORIGIN_URL_MAX
4049#define PC_EDGE_ORIGIN_URL_MAX 128
4052#ifndef PC_EDGE_FETCH_BUF
4053#define PC_EDGE_FETCH_BUF PC_EDGE_FETCH_BUF_MIN
4055#ifndef PC_EDGE_FETCH_TIMEOUT_MS
4056#define PC_EDGE_FETCH_TIMEOUT_MS 8000
4058#ifndef PC_EDGE_DEFAULT_TTL_S
4059#define PC_EDGE_DEFAULT_TTL_S 60
4080#ifndef PC_ENABLE_EDGE_MESH
4081#define PC_ENABLE_EDGE_MESH 0
4083#if PC_ENABLE_EDGE_MESH && !PC_ENABLE_EDGE_CACHE
4084#error "PC_ENABLE_EDGE_MESH requires PC_ENABLE_EDGE_CACHE"
4088#ifndef PC_MESH_QUERY_MS
4089#define PC_MESH_QUERY_MS 300
4091#ifndef PC_MESH_HOST_MAX
4092#define PC_MESH_HOST_MAX 64
4094#ifndef PC_MESH_HDRS_MAX
4095#define PC_MESH_HDRS_MAX \
4110#ifndef PC_ENABLE_SMB
4111#define PC_ENABLE_SMB 0
4123#define PC_SMB_BUF 1024
4134#ifndef PC_ENABLE_J2735
4135#define PC_ENABLE_J2735 0
4145#ifndef PC_ENABLE_NEMA_TS2
4146#define PC_ENABLE_NEMA_TS2 0
4156#ifndef PC_ENABLE_SNP
4157#define PC_ENABLE_SNP 0
4168#ifndef PC_ENABLE_DIRECTNET
4169#define PC_ENABLE_DIRECTNET 0
4179#ifndef PC_ENABLE_SEP2
4180#define PC_ENABLE_SEP2 0
4191#ifndef PC_ENABLE_PROFINET
4192#define PC_ENABLE_PROFINET 0
4203#ifndef PC_ENABLE_NTCIP
4204#define PC_ENABLE_NTCIP 0
4214#ifndef PC_ENABLE_OPENADR
4215#define PC_ENABLE_OPENADR 0
4226#ifndef PC_ENABLE_MMS
4227#define PC_ENABLE_MMS 0
4238#ifndef PC_ENABLE_CCLINK
4239#define PC_ENABLE_CCLINK 0
4250#ifndef PC_ENABLE_POWERLINK
4251#define PC_ENABLE_POWERLINK 0
4262#ifndef PC_ENABLE_SERCOS
4263#define PC_ENABLE_SERCOS 0
4274#ifndef PC_ENABLE_PROFIBUS
4275#define PC_ENABLE_PROFIBUS 0
4286#ifndef PC_ENABLE_LONWORKS
4287#define PC_ENABLE_LONWORKS 0
4298#ifndef PC_ENABLE_MBPLUS
4299#define PC_ENABLE_MBPLUS 0
4310#ifndef PC_ENABLE_INTERBUS
4311#define PC_ENABLE_INTERBUS 0
4322#ifndef PC_ENABLE_ICCP
4323#define PC_ENABLE_ICCP 0
4334#ifndef PC_ENABLE_WAVE
4335#define PC_ENABLE_WAVE 0
4346#ifndef PC_ENABLE_UTMC
4347#define PC_ENABLE_UTMC 0
4358#ifndef PC_ENABLE_OCIT
4359#define PC_ENABLE_OCIT 0
4371#ifndef PC_ENABLE_ATC
4372#define PC_ENABLE_ATC 0
4385#ifndef PC_ENABLE_SOUTHBOUND
4386#define PC_ENABLE_SOUTHBOUND 0
4397#ifndef PC_ENABLE_EXC_DECODER
4398#define PC_ENABLE_EXC_DECODER 0
4407#ifndef PC_EXC_COREDUMP_CHUNK
4408#define PC_EXC_COREDUMP_CHUNK 512
4411#if PC_ENABLE_EXC_DECODER && (PC_EXC_COREDUMP_CHUNK < 64)
4412#error "ProtoCore: PC_EXC_COREDUMP_CHUNK must be >= 64"
4423#ifndef PC_ENABLE_HTTP_DELIVERY
4424#define PC_ENABLE_HTTP_DELIVERY 0
4430#ifndef PC_DELIVERY_PRECACHE_MAX
4431#define PC_DELIVERY_PRECACHE_MAX 16
4440#ifndef PC_DELIVERY_MANIFEST_BUF
4441#define PC_DELIVERY_MANIFEST_BUF 512
4444#if PC_ENABLE_HTTP_DELIVERY && (PC_DELIVERY_PRECACHE_MAX < 1)
4445#error "ProtoCore: PC_DELIVERY_PRECACHE_MAX must be >= 1"
4447#if PC_ENABLE_HTTP_DELIVERY && (PC_DELIVERY_MANIFEST_BUF < 64)
4448#error "ProtoCore: PC_DELIVERY_MANIFEST_BUF must be >= 64"
4460#ifndef PC_ENABLE_HW_HEALTH
4461#define PC_ENABLE_HW_HEALTH 0
4473#ifndef PC_ENABLE_MDNS_ADAPTIVE
4474#define PC_ENABLE_MDNS_ADAPTIVE 0
4486#ifndef PC_ENABLE_SOCKPOOL
4487#define PC_ENABLE_SOCKPOOL 0
4499#ifndef PC_ENABLE_PSRAM_POOL
4500#define PC_ENABLE_PSRAM_POOL 0
4512#ifndef PC_ENABLE_HAPPY_EYEBALLS
4513#define PC_ENABLE_HAPPY_EYEBALLS 0
4528#ifndef PC_ENABLE_WIFI_SNIFFER
4529#define PC_ENABLE_WIFI_SNIFFER 0
4538#ifndef PC_WIFI_SNIFFER_MAX_CHANNELS
4539#define PC_WIFI_SNIFFER_MAX_CHANNELS 14
4542#if PC_ENABLE_WIFI_SNIFFER && ((PC_WIFI_SNIFFER_MAX_CHANNELS < 1) || (PC_WIFI_SNIFFER_MAX_CHANNELS > 14))
4543#error "ProtoCore: PC_WIFI_SNIFFER_MAX_CHANNELS must be 1..14"
4556#ifndef PC_ENABLE_LINK_MANAGER
4557#define PC_ENABLE_LINK_MANAGER 0
4570#ifndef PC_ENABLE_CC1101
4571#define PC_ENABLE_CC1101 0
4583#ifndef PC_ENABLE_FDC2214
4584#define PC_ENABLE_FDC2214 0
4597#ifndef PC_ENABLE_LDC1614
4598#define PC_ENABLE_LDC1614 0
4610#ifndef PC_ENABLE_VL53L0X
4611#define PC_ENABLE_VL53L0X 0
4623#ifndef PC_ENABLE_RADIO_SNIFF
4624#define PC_ENABLE_RADIO_SNIFF 0
4636#ifndef PC_ENABLE_BLE_GATT
4637#define PC_ENABLE_BLE_GATT 0
4650#ifndef PC_ENABLE_TLS_POLICY
4651#define PC_ENABLE_TLS_POLICY 0
4664#ifndef PC_ENABLE_WISUN
4665#define PC_ENABLE_WISUN 0
4677#ifndef PC_ENABLE_LOGBUF
4678#define PC_ENABLE_LOGBUF 0
4683#define PC_LOG_LINES 32
4687#ifndef PC_LOG_LINE_LEN
4688#define PC_LOG_LINE_LEN 96
4698#define PC_LOG_LEVEL_DEBUG 0
4699#define PC_LOG_LEVEL_INFO 1
4700#define PC_LOG_LEVEL_WARN 2
4701#define PC_LOG_LEVEL_ERROR 3
4702#define PC_LOG_LEVEL_NONE 4
4715#define PC_LOG_LEVEL PC_LOG_LEVEL_NONE
4718#if (PC_LOG_LEVEL < PC_LOG_LEVEL_DEBUG) || (PC_LOG_LEVEL > PC_LOG_LEVEL_NONE)
4719#error "ProtoCore: PC_LOG_LEVEL must be one of the PC_LOG_LEVEL_* constants"
4731#ifndef PC_ENABLE_CONFIG_IO
4732#define PC_ENABLE_CONFIG_IO 0
4736#ifndef PC_ENABLE_OTA
4737#define PC_ENABLE_OTA 0
4750#ifndef PC_ENABLE_OTA_ROLLBACK
4751#define PC_ENABLE_OTA_ROLLBACK 0
4755#ifndef PC_OTA_CONFIRM_WINDOW_MS
4756#define PC_OTA_CONFIRM_WINDOW_MS 30000
4768#ifndef PC_ENABLE_TOTP
4769#define PC_ENABLE_TOTP 0
4782#ifndef PC_ENABLE_WEBHOOK
4783#define PC_ENABLE_WEBHOOK 0
4794#ifndef PC_ENABLE_RADIO_POWER
4795#define PC_ENABLE_RADIO_POWER 0
4799#ifndef PC_RADIO_WIFI_PS
4800#define PC_RADIO_WIFI_PS 0
4804#ifndef PC_RADIO_MAX_TX_DBM
4805#define PC_RADIO_MAX_TX_DBM 0
4818#ifndef PC_ENABLE_DNS_RESOLVER
4819#define PC_ENABLE_DNS_RESOLVER 0
4823#ifndef PC_DNS_TIMEOUT_MS
4824#define PC_DNS_TIMEOUT_MS 5000
4839#ifndef PC_ENABLE_AUDIT_LOG
4840#define PC_ENABLE_AUDIT_LOG 0
4859#ifndef PC_ENABLE_OIDC
4860#define PC_ENABLE_OIDC 0
4864#ifndef PC_OIDC_MAX_LEN
4865#define PC_OIDC_MAX_LEN 1600
4880#ifndef PC_ENABLE_VFS
4881#define PC_ENABLE_VFS 0
4896#ifndef PC_ENABLE_GRAPHQL
4897#define PC_ENABLE_GRAPHQL 0
4911#ifndef PC_ENABLE_ESPNOW
4912#define PC_ENABLE_ESPNOW 0
4927#ifndef PC_ENABLE_OAUTH2
4928#define PC_ENABLE_OAUTH2 0
4946#ifndef PC_ENABLE_OPCUA
4947#define PC_ENABLE_OPCUA 0
4960#ifndef PC_ENABLE_OPCUA_CLIENT
4961#define PC_ENABLE_OPCUA_CLIENT 0
4975#ifndef PC_ENABLE_UMATI
4976#define PC_ENABLE_UMATI 0
4981#define PC_UMATI_NS 1
4996#ifndef PC_ENABLE_ROBOTICS
4997#define PC_ENABLE_ROBOTICS 0
5001#ifndef PC_ROBOTICS_NS
5002#define PC_ROBOTICS_NS 1
5006#ifndef PC_ROBOTICS_AXES
5007#define PC_ROBOTICS_AXES 6
5021#ifndef PC_ENABLE_EUROMAP77
5022#define PC_ENABLE_EUROMAP77 0
5047#ifndef PC_ENABLE_UPLOAD
5048#define PC_ENABLE_UPLOAD 0
5060#if PC_ENABLE_OTA || PC_ENABLE_UPLOAD || PC_ENABLE_WEBDAV
5061#define PC_ENABLE_STREAM_BODY 1
5063#define PC_ENABLE_STREAM_BODY 0
5071#ifndef PC_ENABLE_PROVISIONING
5072#define PC_ENABLE_PROVISIONING 0
5083#ifndef PC_ENABLE_SYSLOG
5084#define PC_ENABLE_SYSLOG 0
5088#ifndef PC_SYSLOG_MSG_MAX
5089#define PC_SYSLOG_MSG_MAX 256
5093#ifndef PC_SYSLOG_FIELD_MAX
5094#define PC_SYSLOG_FIELD_MAX 32
5099#ifndef PC_SYSLOG_DEFAULT_PORT
5100#define PC_SYSLOG_DEFAULT_PORT 514
5111#ifndef PC_ENABLE_JWT
5112#define PC_ENABLE_JWT 0
5116#ifndef PC_JWT_MAX_LEN
5117#define PC_JWT_MAX_LEN 512
5131#ifndef PC_ENABLE_HTTP_CLIENT
5132#define PC_ENABLE_HTTP_CLIENT 0
5136#ifndef PC_ENABLE_HTTP_CLIENT_TLS
5137#define PC_ENABLE_HTTP_CLIENT_TLS 0
5141#ifndef PC_HTTP_CLIENT_BUF_SIZE
5142#define PC_HTTP_CLIENT_BUF_SIZE 2048
5155#ifndef PC_HTTP_CLIENT_CT_BUF_SIZE
5156#define PC_HTTP_CLIENT_CT_BUF_SIZE 4096
5160#ifndef PC_HTTP_CLIENT_TIMEOUT_MS
5161#define PC_HTTP_CLIENT_TIMEOUT_MS 8000
5173#ifndef PC_ENABLE_SMTP
5174#define PC_ENABLE_SMTP 0
5184#ifndef PC_ENABLE_SMTP_TLS
5185#define PC_ENABLE_SMTP_TLS 0
5188#if PC_ENABLE_SMTP_TLS && !PC_ENABLE_SMTP
5189#error "ProtoCore: PC_ENABLE_SMTP_TLS requires PC_ENABLE_SMTP"
5193#ifndef PC_SMTP_LINE_MAX
5194#define PC_SMTP_LINE_MAX 256
5198#ifndef PC_SMTP_MSG_MAX
5199#define PC_SMTP_MSG_MAX 2048
5203#ifndef PC_SMTP_REPLY_MAX
5204#define PC_SMTP_REPLY_MAX 512
5208#ifndef PC_SMTP_TIMEOUT_MS
5209#define PC_SMTP_TIMEOUT_MS 10000
5213#ifndef PC_SMTP_CT_BUF_SIZE
5214#define PC_SMTP_CT_BUF_SIZE 4096
5228#ifndef PC_ENABLE_MQTT
5229#define PC_ENABLE_MQTT 0
5233#ifndef PC_ENABLE_MQTT_TLS
5234#define PC_ENABLE_MQTT_TLS 0
5244#ifndef PC_MQTT_BUF_SIZE
5245#define PC_MQTT_BUF_SIZE 1024
5249#ifndef PC_MQTT_KEEPALIVE_S
5250#define PC_MQTT_KEEPALIVE_S 30
5254#ifndef PC_MQTT_CT_BUF_SIZE
5255#define PC_MQTT_CT_BUF_SIZE 4096
5259#ifndef PC_MQTT_MAX_TOPIC
5260#define PC_MQTT_MAX_TOPIC 128
5270#ifndef PC_MQTT_MAX_INFLIGHT
5271#define PC_MQTT_MAX_INFLIGHT 4
5275#ifndef PC_MQTT_INFLIGHT_BUF
5276#define PC_MQTT_INFLIGHT_BUF 256
5280#ifndef PC_MQTT_RETRANSMIT_MS
5281#define PC_MQTT_RETRANSMIT_MS 5000
5285#ifndef PC_MQTT_RX_QOS2_SLOTS
5286#define PC_MQTT_RX_QOS2_SLOTS 8
5298#ifndef PC_ENABLE_WS_CLIENT
5299#define PC_ENABLE_WS_CLIENT 0
5303#ifndef PC_ENABLE_WS_CLIENT_TLS
5304#define PC_ENABLE_WS_CLIENT_TLS 0
5308#ifndef PC_WS_CLIENT_BUF_SIZE
5309#define PC_WS_CLIENT_BUF_SIZE 1024
5313#ifndef PC_WS_CLIENT_CT_BUF_SIZE
5314#define PC_WS_CLIENT_CT_BUF_SIZE 4096
5326#if PC_ENABLE_HTTP_CLIENT_TLS || PC_ENABLE_MQTT_TLS || PC_ENABLE_WS_CLIENT_TLS || PC_ENABLE_EDGE_ORIGIN_TLS || \
5328#define PC_ENABLE_CLIENT_TLS 1
5330#define PC_ENABLE_CLIENT_TLS 0
5343#if PC_ENABLE_HTTP_CLIENT || PC_ENABLE_MQTT || PC_ENABLE_WS_CLIENT || PC_ENABLE_RELAY || PC_ENABLE_SMTP || \
5344 PC_SSH_PORT_FORWARD || PC_ENABLE_SMB || PC_ENABLE_DNC || PC_ENABLE_FTP_SESSION || PC_ENABLE_SSH_CLIENT
5345#define PC_NEED_CLIENT 1
5347#ifndef PC_NEED_CLIENT
5348#define PC_NEED_CLIENT 0
5352#define PC_NEED_DNS_RESOLVER (PC_ENABLE_DNS_RESOLVER || PC_NEED_CLIENT)
5362#if PC_ENABLE_AUTH || PC_ENABLE_JWT || PC_ENABLE_OIDC
5363#define PC_CAPTURE_AUTH_HEADER 1
5365#define PC_CAPTURE_AUTH_HEADER 0
5376#define PC_AUTH_HDR_CAP_OIDC (PC_OIDC_MAX_LEN + 16)
5378#define PC_AUTH_HDR_CAP_OIDC 0
5381#define PC_AUTH_HDR_CAP_JWT (PC_JWT_MAX_LEN + 16)
5383#define PC_AUTH_HDR_CAP_JWT 0
5385#define PC_AUTH_HDR_CAP_M1 (PC_AUTH_HDR_CAP_JWT > DIGEST_AUTH_HDR_MAX ? PC_AUTH_HDR_CAP_JWT : DIGEST_AUTH_HDR_MAX)
5386#define PC_AUTH_HDR_CAP (PC_AUTH_HDR_CAP_OIDC > PC_AUTH_HDR_CAP_M1 ? PC_AUTH_HDR_CAP_OIDC : PC_AUTH_HDR_CAP_M1)
5389#ifndef PC_ENABLE_STATS
5390#define PC_ENABLE_STATS 0
5404#ifndef PC_ENABLE_OBSERVABILITY
5405#define PC_ENABLE_OBSERVABILITY 0
5417#ifndef PC_ENABLE_METRICS
5418#define PC_ENABLE_METRICS 0
5428#ifndef PC_ENABLE_WEB_TERMINAL
5429#define PC_ENABLE_WEB_TERMINAL 0
5438#ifndef TERM_TX_BUF_SIZE
5439#define TERM_TX_BUF_SIZE 256
5453#ifndef PC_ENABLE_ETAG
5454#define PC_ENABLE_ETAG 0
5474#ifndef PC_ENABLE_DIAG
5475#define PC_ENABLE_DIAG 0
5492#ifndef PC_ENABLE_KEEPALIVE
5493#define PC_ENABLE_KEEPALIVE 1
5504#ifndef PC_KEEPALIVE_MAX_REQUESTS
5505#define PC_KEEPALIVE_MAX_REQUESTS 100
5516#ifndef PC_ENABLE_HTTP2
5517#define PC_ENABLE_HTTP2 0
5525#ifndef PC_HPACK_TABLE_BYTES
5526#define PC_HPACK_TABLE_BYTES 4096
5530#ifndef PC_HPACK_MAX_ENTRIES
5531#define PC_HPACK_MAX_ENTRIES 128
5539#ifndef PC_H2_MAX_FRAME
5540#define PC_H2_MAX_FRAME 16384
5544#ifndef PC_H2_MAX_STREAMS
5545#define PC_H2_MAX_STREAMS 8
5553#ifndef PC_H2_HDR_BLOCK
5554#define PC_H2_HDR_BLOCK 4096
5567#ifndef PC_H2_POOL_IN_PSRAM
5568#define PC_H2_POOL_IN_PSRAM 0
5581#ifndef PC_ENABLE_HTTP3
5582#define PC_ENABLE_HTTP3 0
5602#ifndef PC_ENABLE_DTLS
5603#define PC_ENABLE_DTLS 0
5619#ifndef PC_ENABLE_TLS_RPK
5620#define PC_ENABLE_TLS_RPK 0
5631#define PC_INTERNAL_SLOTS 1
5632#define PC_H3_DISPATCH_SLOT MAX_CONNS
5634#define PC_INTERNAL_SLOTS 0
5636#define CONN_POOL_SLOTS (MAX_CONNS + PC_INTERNAL_SLOTS)
5639#ifndef PC_HTTP3_PORT
5640#define PC_HTTP3_PORT 443
5651#ifndef PC_H3_CRYPTO_BUF
5652#define PC_H3_CRYPTO_BUF 2048
5662#ifndef PC_H3_MAX_STREAMS
5663#define PC_H3_MAX_STREAMS 8
5678#ifndef PC_ENABLE_RANGE
5679#define PC_ENABLE_RANGE 0
5691#ifndef PC_ENFORCE_HOST_HEADER
5692#define PC_ENFORCE_HOST_HEADER 1
5703#ifndef PC_SSH_ALLOW_PASSWORD
5704#define PC_SSH_ALLOW_PASSWORD 1
5717#ifndef PC_ENABLE_SSH_KEYBOARD_INTERACTIVE
5718#define PC_ENABLE_SSH_KEYBOARD_INTERACTIVE 0
5729#ifndef SSH_MAX_AUTH_ATTEMPTS
5730#define SSH_MAX_AUTH_ATTEMPTS 6
5738#ifndef MAX_LISTENERS
5739#define MAX_LISTENERS 3
5749#ifndef PC_MAX_UDP_LISTENERS
5750#define PC_MAX_UDP_LISTENERS 2
5760#ifndef PC_UDP_RX_BUF_SIZE
5761#define PC_UDP_RX_BUF_SIZE 1472
5775#ifndef PC_ENABLE_ACCEPT_THROTTLE
5776#define PC_ENABLE_ACCEPT_THROTTLE 0
5780#ifndef PC_ACCEPT_THROTTLE_MAX
5781#define PC_ACCEPT_THROTTLE_MAX 20
5785#ifndef PC_ACCEPT_THROTTLE_WINDOW_MS
5786#define PC_ACCEPT_THROTTLE_WINDOW_MS 1000
5806#ifndef PC_ENABLE_PER_IP_THROTTLE
5807#define PC_ENABLE_PER_IP_THROTTLE 0
5811#ifndef PC_PER_IP_THROTTLE_SLOTS
5812#define PC_PER_IP_THROTTLE_SLOTS 16
5816#ifndef PC_PER_IP_THROTTLE_MAX
5817#define PC_PER_IP_THROTTLE_MAX 10
5821#ifndef PC_PER_IP_THROTTLE_WINDOW_MS
5822#define PC_PER_IP_THROTTLE_WINDOW_MS 10000
5843#ifndef PC_ENABLE_IP_ALLOWLIST
5844#define PC_ENABLE_IP_ALLOWLIST 0
5848#ifndef PC_IP_ALLOWLIST_SLOTS
5849#define PC_IP_ALLOWLIST_SLOTS 8
5867#ifndef PC_ENABLE_FORWARDED_TRUST
5868#define PC_ENABLE_FORWARDED_TRUST 0
5872#ifndef PC_TRUSTED_PROXY_MAX
5873#define PC_TRUSTED_PROXY_MAX 2
5892#ifndef PC_ENABLE_AUTH_LOCKOUT
5893#define PC_ENABLE_AUTH_LOCKOUT 0
5897#ifndef PC_AUTH_LOCKOUT_SLOTS
5898#define PC_AUTH_LOCKOUT_SLOTS 16
5902#ifndef PC_AUTH_LOCKOUT_THRESHOLD
5903#define PC_AUTH_LOCKOUT_THRESHOLD 5
5907#ifndef PC_AUTH_LOCKOUT_BASE_MS
5908#define PC_AUTH_LOCKOUT_BASE_MS 1000
5912#ifndef PC_AUTH_LOCKOUT_MAX_MS
5913#define PC_AUTH_LOCKOUT_MAX_MS 300000
5932#ifndef PC_ENABLE_CSRF
5933#define PC_ENABLE_CSRF 0
5941#ifndef MAX_TELNET_CONNS
5942#define MAX_TELNET_CONNS 2
5946#ifndef TELNET_BUF_SIZE
5947#define TELNET_BUF_SIZE 256
5955#ifndef MAX_SSH_CONNS
5956#define MAX_SSH_CONNS 1
5968#ifndef PC_SSH_MAX_CHANNELS
5969#define PC_SSH_MAX_CHANNELS 1
5971#if PC_SSH_MAX_CHANNELS < 1
5972#error "ProtoCore: PC_SSH_MAX_CHANNELS must be >= 1"
5986#ifndef PC_SSH_PORT_FORWARD
5987#define PC_SSH_PORT_FORWARD 0
5991#ifndef PC_SSH_FWD_MAX
5992#define PC_SSH_FWD_MAX 2
5996#ifndef PC_SSH_FWD_HOST_MAX
5997#define PC_SSH_FWD_HOST_MAX 64
6001#ifndef PC_SSH_FWD_CONNECT_MS
6002#define PC_SSH_FWD_CONNECT_MS 3000
6006#ifndef PC_SSH_FWD_CHUNK
6007#define PC_SSH_FWD_CHUNK 1024
6019#ifndef PC_SSH_RFWD_MAX
6020#define PC_SSH_RFWD_MAX 1
6030#ifndef PC_SSH_RFWD_BRIDGE_MAX
6031#define PC_SSH_RFWD_BRIDGE_MAX 2
6035#ifndef SSH_PKT_BUF_SIZE
6036#define SSH_PKT_BUF_SIZE 2048
6048#ifndef PC_ENABLE_SSH_SFTP
6049#define PC_ENABLE_SSH_SFTP 0
6059#ifndef PC_ENABLE_SSH_SCP
6060#define PC_ENABLE_SSH_SCP 0
6064#ifndef PC_SFTP_MAX_HANDLES
6065#define PC_SFTP_MAX_HANDLES 4
6069#ifndef PC_SFTP_PKT_BUF
6070#define PC_SFTP_PKT_BUF 2048
6077#ifndef PC_SFTP_MAX_READ
6078#define PC_SFTP_MAX_READ 1024
6082#ifndef PC_SFTP_PATH_MAX
6083#define PC_SFTP_PATH_MAX 256
6100#ifndef PC_ENABLE_SSH_ZLIB
6101#define PC_ENABLE_SSH_ZLIB 0
6111#ifndef PC_SSH_ZLIB_IN_PSRAM
6112#define PC_SSH_ZLIB_IN_PSRAM 0
6123#ifndef PC_SSH_ZLIB_ACK_DRAM
6124#define PC_SSH_ZLIB_ACK_DRAM 0
6133#ifndef PC_SSH_ZLIB_WINDOW
6134#define PC_SSH_ZLIB_WINDOW 8192
6141#ifndef PC_SSH_ZLIB_MAX_IN
6142#define PC_SSH_ZLIB_MAX_IN 2048
6146#ifndef SSH_MAX_USERNAME_LEN
6147#define SSH_MAX_USERNAME_LEN 32
6151#ifndef SSH_MAX_PASSWORD_LEN
6152#define SSH_MAX_PASSWORD_LEN 64
6165#ifndef PC_SCRATCH_ARENA_SIZE
6166#define PC_SCRATCH_ARENA_SIZE 8192
6185#ifndef PC_DEBUG_CHECKS
6186#define PC_DEBUG_CHECKS 0
6204#ifndef PC_WORK_BIGNUM_HW
6205#define PC_WORK_BIGNUM_HW 1024
6207#ifndef PC_WORK_BIGNUM_SW
6208#define PC_WORK_BIGNUM_SW 1408
6215#ifndef PC_WORK_AESGCM_HW
6216#define PC_WORK_AESGCM_HW 416
6218#ifndef PC_WORK_AESGCM_SW
6219#define PC_WORK_AESGCM_SW 640
6221#ifndef PC_WORK_AESGCM
6223#define PC_WORK_AESGCM PC_WORK_AESGCM_HW
6225#define PC_WORK_AESGCM PC_WORK_AESGCM_SW
6228#ifndef PC_WORK_AESCCM
6229#define PC_WORK_AESCCM 448
6235#ifndef PC_WORK_AES128_HW
6236#define PC_WORK_AES128_HW 288
6238#ifndef PC_WORK_AES128_SW
6239#define PC_WORK_AES128_SW 176
6241#ifndef PC_WORK_AES128
6243#define PC_WORK_AES128 PC_WORK_AES128_HW
6245#define PC_WORK_AES128 PC_WORK_AES128_SW
6252#ifndef PC_WORK_AES128GCM_HW
6253#define PC_WORK_AES128GCM_HW 416
6255#ifndef PC_WORK_AES128GCM_SW
6256#define PC_WORK_AES128GCM_SW 576
6258#ifndef PC_WORK_AES128GCM
6260#define PC_WORK_AES128GCM PC_WORK_AES128GCM_HW
6262#define PC_WORK_AES128GCM PC_WORK_AES128GCM_SW
6265#ifndef PC_WORK_CHACHAPOLY
6266#define PC_WORK_CHACHAPOLY 64
6268#ifndef PC_WORK_CHACHA20
6269#define PC_WORK_CHACHA20 192
6271#ifndef PC_WORK_AES256CTR
6272#define PC_WORK_AES256CTR 384
6274#ifndef PC_WORK_HMAC_SHA256
6275#define PC_WORK_HMAC_SHA256 288
6277#ifndef PC_WORK_POLY1305
6278#define PC_WORK_POLY1305 80
6281#define PC_WORK_MD 96
6298#ifndef PC_SECURE_ARENA_SIZE
6302#define PC_SECURE_WORK_BIGNUM PC_WORK_BIGNUM_HW
6304#define PC_SECURE_WORK_BIGNUM PC_WORK_BIGNUM_SW
6308#if PC_ENABLE_SSH || PC_ENABLE_SSH_CLIENT || PC_ENABLE_TLS || PC_ENABLE_HTTP3 || PC_ENABLE_DTLS
6309#define PC_SECURE_WORK_AEAD (PC_WORK_AESGCM + PC_WORK_CHACHAPOLY + PC_WORK_CHACHA20 + PC_WORK_POLY1305)
6310#define PC_SECURE_WORK_MAC PC_WORK_HMAC_SHA256
6312#define PC_SECURE_WORK_AEAD 0
6313#define PC_SECURE_WORK_MAC 0
6317#define PC_SECURE_WORK_SMB (PC_WORK_AESCCM + PC_WORK_AES128GCM + PC_WORK_MD)
6319#define PC_SECURE_WORK_SMB 0
6322#if PC_ENABLE_SSH || PC_ENABLE_SSH_CLIENT
6323#define PC_SECURE_WORK_SSHCIPHER PC_WORK_AES256CTR
6325#define PC_SECURE_WORK_SSHCIPHER 0
6328#define PC_SECURE_ARENA_SIZE \
6329 (PC_SECURE_WORK_BIGNUM + PC_SECURE_WORK_AEAD + PC_SECURE_WORK_MAC + PC_SECURE_WORK_SMB + \
6330 PC_SECURE_WORK_SSHCIPHER + 256)
6472#define _PC_STR_(x) #x
6473#define _PC_STR(x) _PC_STR_(x)
6475#if PC_ENABLE_WEBSOCKET
6476#define _PC_F_WS "true"
6478#define _PC_F_WS "false"
6482#define _PC_F_SSE "true"
6484#define _PC_F_SSE "false"
6487#if PC_ENABLE_MULTIPART
6488#define _PC_F_MP "true"
6490#define _PC_F_MP "false"
6493#if PC_ENABLE_FILE_SERVING
6494#define _PC_F_FS "true"
6496#define _PC_F_FS "false"
6500#define _PC_F_AUTH "true"
6502#define _PC_F_AUTH "false"
6508#define _PC_BOOL_0 "false"
6509#define _PC_BOOL_1 "true"
6510#define _PC_FB2(v) _PC_BOOL_##v
6511#define _PC_FB(v) _PC_FB2(v)
6513#define PC_DIAG_JSON \
6515 "\"lib\":\"ProtoCore\"," \
6517 "\"websocket\":" _PC_F_WS "," \
6518 "\"sse\":" _PC_F_SSE "," \
6519 "\"multipart\":" _PC_F_MP "," \
6520 "\"file_serving\":" _PC_F_FS "," \
6521 "\"auth\":" _PC_F_AUTH "," \
6522 "\"webdav\":" _PC_FB( \
6523 PC_ENABLE_WEBDAV) "," \
6524 "\"coap\":" _PC_FB(PC_ENABLE_COAP) "," \
6525 "\"snmp\":" _PC_FB( \
6526 PC_ENABLE_SNMP) "," \
6527 "\"opcua\":" _PC_FB(PC_ENABLE_OPCUA) "," \
6528 "\"umati\":" _PC_FB( \
6529 PC_ENABLE_UMATI) "," \
6530 "\"modbus\":" _PC_FB( \
6531 PC_ENABLE_MODBUS) "," \
6532 "\"mqtt\":" _PC_FB(PC_ENABLE_MQTT) "," \
6533 "\"mtconnect\":" _PC_FB(PC_ENABLE_MTCONNECT) "," \
6534 "\"redis\":" _PC_FB(PC_ENABLE_REDIS) "," \
6535 "\"ftp\":" _PC_FB(PC_ENABLE_FTP) "," \
6536 "\"smtp\":" _PC_FB(PC_ENABLE_SMTP) "," \
6537 "\"smb\":" _PC_FB(PC_ENABLE_SMB) "," \
6538 "\"syslog\":" _PC_FB(PC_ENABLE_SYSLOG) "," \
6539 "\"pc_ntp_server\":" _PC_FB( \
6540 PC_ENABLE_NTP_SERVER) "," \
6541 "\"dns_server\":" _PC_FB(PC_ENABLE_DNS_SERVER) "," \
6542 "\"nats\":" _PC_FB( \
6543 PC_ENABLE_NATS) "," \
6544 "\"stomp\":" _PC_FB( \
6545 PC_ENABLE_STOMP) "," \
6546 "\"statsd\":" _PC_FB(PC_ENABLE_STATSD) "," \
6547 "\"jwt\":" _PC_FB(PC_ENABLE_JWT) "," \
6548 "\"tls\":" _PC_FB( \
6549 PC_ENABLE_TLS) "," \
6550 "\"http2\":" _PC_FB(PC_ENABLE_HTTP2) "," \
6551 "\"http3\":" _PC_FB(PC_ENABLE_HTTP3) "," \
6552 "\"ssh\":" _PC_FB( \
6553 PC_ENABLE_SSH) "," \
6554 "\"ws_deflate\":" _PC_FB( \
6555 PC_ENABLE_WS_DEFLATE) "," \
6556 "\"range\":" _PC_FB( \
6557 PC_ENABLE_RANGE) "," \
6558 "\"csrf\":" _PC_FB(PC_ENABLE_CSRF) "," \
6559 "\"accept_throttle\":" _PC_FB(PC_ENABLE_ACCEPT_THROTTLE) "," \
6560 "\"per_ip_throttle\":" _PC_FB(PC_ENABLE_PER_IP_THROTTLE) "," \
6561 "\"auth_lockout\":" _PC_FB( \
6562 PC_ENABLE_AUTH_LOCKOUT) "}," \
6564 "\"MAX_CONNS\":" _PC_STR( \
6566 "\"RX_BUF_SIZE\":" _PC_STR( \
6568 "\"BODY_BUF_SIZE\":" _PC_STR(BODY_BUF_SIZE) "," \
6569 "\"MAX_ROUTES\":" _PC_STR(MAX_ROUTES) "," \
6576 ":" _PC_STR(MAX_PATH_LEN) "," \
6577 "\"MAX_KEY_LEN\":" _PC_STR(MAX_KEY_LEN) "," \
6578 "\"MAX_VAL_LEN\":" _PC_STR(MAX_VAL_LEN) "," \
6579 "\"MAX_QUERY_LEN\":" _PC_STR(MAX_QUERY_LEN) "," \
6580 "\"MAX_QUERY_PARAMS\":" _PC_STR(MAX_QUERY_PARAMS) "," \
6581 "\"CONN_TIMEOUT_MS\":" _PC_STR(CONN_TIMEOUT_MS) "," \
6582 "\"RESP_HDR_BUF_SIZE\":" _PC_STR(RESP_HDR_BUF_SIZE) "," \
6583 "\"WS_HDR_BUF_SIZE\":" _PC_STR( \
6584 WS_HDR_BUF_SIZE) "," \
6585 "\"CORS_HDR_BUF_SIZE\":" _PC_STR( \
6586 CORS_HDR_BUF_SIZE) "," \
6587 "\"EVT_QUEUE_DEPTH\":" _PC_STR( \
6588 EVT_QUEUE_DEPTH) "}" \
6599#if EVT_QUEUE_DEPTH < MAX_CONNS * 4
6600#error "ProtoCore: EVT_QUEUE_DEPTH must be >= MAX_CONNS * 4 to absorb event bursts without blocking lwIP"
6604#error "ProtoCore: MAX_CONNS must be >= 1"
6608#error "ProtoCore: MAX_CONNS must be <= 255 (slot IDs are uint8_t)"
6611#if PC_ENABLE_WEBSOCKET && PC_ENABLE_SSE
6612#if MAX_WS_CONNS + MAX_SSE_CONNS > MAX_CONNS
6613#error "ProtoCore: MAX_WS_CONNS + MAX_SSE_CONNS must not exceed MAX_CONNS"
6615#elif PC_ENABLE_WEBSOCKET
6616#if MAX_WS_CONNS > MAX_CONNS
6617#error "ProtoCore: MAX_WS_CONNS must not exceed MAX_CONNS"
6620#if MAX_SSE_CONNS > MAX_CONNS
6621#error "ProtoCore: MAX_SSE_CONNS must not exceed MAX_CONNS"
6625#if BODY_BUF_SIZE < 1
6626#error "ProtoCore: BODY_BUF_SIZE must be >= 1"
6629#if BODY_BUF_SIZE > RX_BUF_SIZE
6630#error "ProtoCore: BODY_BUF_SIZE must not exceed RX_BUF_SIZE (parser reads from the ring buffer)"
6633#if PC_ENABLE_FILE_SERVING && FILE_CHUNK_SIZE > RX_BUF_SIZE
6634#error "ProtoCore: FILE_CHUNK_SIZE must not exceed RX_BUF_SIZE"
6638#error "ProtoCore: MAX_KEY_LEN must be >= 4 (minimum valid HTTP header name length)"
6642#error "ProtoCore: MAX_VAL_LEN must be >= 1"
6646#error "ProtoCore: MAX_PATH_LEN must be >= 2 (minimum: \"/\")"
6650#error "ProtoCore: MAX_ROUTES must be >= 1"
6653#if MAX_MIDDLEWARE < 1
6654#error "ProtoCore: MAX_MIDDLEWARE must be >= 1"
6657#if CHUNK_BUF_SIZE < 16
6658#error "ProtoCore: CHUNK_BUF_SIZE must be >= 16"
6661#if JSON_MAX_DEPTH < 1
6662#error "ProtoCore: JSON_MAX_DEPTH must be >= 1"
6665#if RE_MAX_STEPS < 64
6666#error "ProtoCore: RE_MAX_STEPS must be >= 64"
6672#if PC_ENABLE_OIDC && !PC_ENABLE_SSH && (PC_WORKER_TASK_STACK < PC_WORKER_STACK_RSA_MIN)
6674 "ProtoCore: PC_WORKER_TASK_STACK is below PC_WORKER_STACK_RSA_MIN; RSA-2048 verification (OIDC) needs ~7 KB of worker stack - raise PC_WORKER_TASK_STACK (>= 8192) or marshal RSA verifies onto a dedicated larger-stack task"
6681#if (PC_ENABLE_SSH || PC_ENABLE_SSH_CLIENT || PC_ENABLE_HTTP3) && (PC_WORKER_TASK_STACK < PC_WORKER_STACK_CURVE_MIN)
6683 "ProtoCore: PC_WORKER_TASK_STACK is below PC_WORKER_STACK_CURVE_MIN; SSH (server or reverse-SSH client) and HTTP/3 (QUIC TLS-1.3) curve25519/ed25519 need ~10.5 KB of worker stack - raise PC_WORKER_TASK_STACK (>= 12288) or marshal the handshake onto a dedicated larger-stack task"
6689#ifndef PC_WORKER_STACK_PQC_MIN
6690#define PC_WORKER_STACK_PQC_MIN 16384
6692#if PC_ENABLE_PQC_KEX && !PC_ENABLE_SSH_SNTRUP761 && (PC_ENABLE_SSH || PC_ENABLE_SSH_CLIENT || PC_ENABLE_HTTP3) && \
6693 (PC_WORKER_TASK_STACK < PC_WORKER_STACK_PQC_MIN)
6695 "ProtoCore: PC_WORKER_TASK_STACK is below PC_WORKER_STACK_PQC_MIN; the ML-KEM-768 hybrid KEX (PC_ENABLE_PQC_KEX) needs ~7 KB more worker stack - raise PC_WORKER_TASK_STACK (>= 16384) or marshal the handshake onto a dedicated larger-stack task"
6701#ifndef PC_WORKER_STACK_SNTRUP_MIN
6702#if defined(PC_ENABLE_SSH_CLIENT) && PC_ENABLE_SSH_CLIENT
6703#define PC_WORKER_STACK_SNTRUP_MIN 40960
6705#define PC_WORKER_STACK_SNTRUP_MIN 32768
6711#if PC_ENABLE_SSH_SNTRUP761 && (PC_ENABLE_SSH || PC_ENABLE_SSH_CLIENT) && \
6712 (PC_WORKER_TASK_STACK < PC_WORKER_STACK_SNTRUP_MIN)
6714 "ProtoCore: PC_WORKER_TASK_STACK is below PC_WORKER_STACK_SNTRUP_MIN; sntrup761x25519-sha512 needs ~32 KB worker stack for the server Encaps and ~40 KB for the reverse-SSH client KeyGen+Decaps - raise PC_WORKER_TASK_STACK (>= 32768 server / 40960 client), set PC_ENABLE_SSH_SNTRUP761 0 to keep ML-KEM only, or marshal the handshake onto a dedicated larger-stack task"
6718#if MAX_TLS_CONNS < 1 || MAX_TLS_CONNS > MAX_CONNS
6719#error "ProtoCore: MAX_TLS_CONNS must be between 1 and MAX_CONNS"
6721#if PC_TLS_ARENA_SIZE < 8192
6722#error "ProtoCore: PC_TLS_ARENA_SIZE is far too small for a TLS handshake"
6729#if defined(ARDUINO) && (MAX_TLS_CONNS > 1) && !PC_TLS_ARENA_IN_PSRAM && !PC_TLS_ACK_MULTI_CONN_DRAM
6731 "ProtoCore: MAX_TLS_CONNS > 1 - the static TLS arena will not fit the ~122 KB internal dram0_0_seg. Pick a path (docs/KNOWN_LIMITATIONS.md): set PC_TLS_ARENA_IN_PSRAM=1 on a PSRAM board, OR shrink records via a custom ESP-IDF build (CONFIG_MBEDTLS_SSL_IN/OUT_CONTENT_LEN + PC_TLS_MAX_FRAG_LEN), OR reclaim internal DRAM; then set PC_TLS_ACK_MULTI_CONN_DRAM=1 to confirm."
6737#if PC_ENABLE_HTTP2 && defined(ARDUINO) && !PC_H2_POOL_IN_PSRAM
6739 "ProtoCore: PC_ENABLE_HTTP2 needs PSRAM - the HTTP/2 engine pool (~MAX_CONNS x 28 KB) overflows the ~122 KB internal dram0_0_seg alongside TLS. Set PC_H2_POOL_IN_PSRAM=1 on a PSRAM board (S3 / P4 / WROVER) built with CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY=y (tools/psram/README.md)."
6743#if SNMP_MAX_OID_LEN < 4
6744#error "ProtoCore: SNMP_MAX_OID_LEN must be >= 4"
6746#if SNMP_MAX_MIB_ENTRIES < 1
6747#error "ProtoCore: SNMP_MAX_MIB_ENTRIES must be >= 1"
6749#if SNMP_MAX_VARBINDS < 1
6750#error "ProtoCore: SNMP_MAX_VARBINDS must be >= 1"
6752#if SNMP_MSG_BUF_SIZE < 484
6753#error "ProtoCore: SNMP_MSG_BUF_SIZE must be >= 484 (RFC 1157 minimum)"
6758#if PC_COAP_MAX_RESOURCES < 1
6759#error "ProtoCore: PC_COAP_MAX_RESOURCES must be >= 1"
6761#if PC_COAP_MAX_PATH < 2
6762#error "ProtoCore: PC_COAP_MAX_PATH must be >= 2 (minimum: \"/\")"
6764#if PC_COAP_MAX_PAYLOAD < 1
6765#error "ProtoCore: PC_COAP_MAX_PAYLOAD must be >= 1"
6767#if PC_COAP_MSG_BUF_SIZE < (PC_COAP_MAX_PAYLOAD + 16)
6769 "ProtoCore: PC_COAP_MSG_BUF_SIZE must be >= PC_COAP_MAX_PAYLOAD + 16 (header + token + Content-Format option + payload marker)"
6773#if PC_ENABLE_AUTH && MAX_AUTH_LEN < 2
6774#error "ProtoCore: MAX_AUTH_LEN must be >= 2 when PC_ENABLE_AUTH is set"
6777#if PC_ENABLE_PER_IP_THROTTLE
6778#if PC_PER_IP_THROTTLE_SLOTS < 1
6779#error "ProtoCore: PC_PER_IP_THROTTLE_SLOTS must be >= 1 when PC_ENABLE_PER_IP_THROTTLE is set"
6781#if PC_PER_IP_THROTTLE_MAX < 1
6782#error "ProtoCore: PC_PER_IP_THROTTLE_MAX must be >= 1 when PC_ENABLE_PER_IP_THROTTLE is set"
6786#if PC_ENABLE_IP_ALLOWLIST && PC_IP_ALLOWLIST_SLOTS < 1
6787#error "ProtoCore: PC_IP_ALLOWLIST_SLOTS must be >= 1 when PC_ENABLE_IP_ALLOWLIST is set"
6790#if PC_ENABLE_AUTH_LOCKOUT
6792#error "ProtoCore: PC_ENABLE_AUTH_LOCKOUT requires PC_ENABLE_AUTH"
6794#if PC_AUTH_LOCKOUT_SLOTS < 1
6795#error "ProtoCore: PC_AUTH_LOCKOUT_SLOTS must be >= 1 when PC_ENABLE_AUTH_LOCKOUT is set"
6797#if PC_AUTH_LOCKOUT_THRESHOLD < 1
6798#error "ProtoCore: PC_AUTH_LOCKOUT_THRESHOLD must be >= 1 when PC_ENABLE_AUTH_LOCKOUT is set"
6800#if PC_AUTH_LOCKOUT_BASE_MS < 1 || PC_AUTH_LOCKOUT_MAX_MS < PC_AUTH_LOCKOUT_BASE_MS
6801#error "ProtoCore: need 1 <= PC_AUTH_LOCKOUT_BASE_MS <= PC_AUTH_LOCKOUT_MAX_MS"
6805#if PC_AUTH_LOCKOUT_MAX_MS > 0x80000000
6806#error "ProtoCore: PC_AUTH_LOCKOUT_MAX_MS must be <= 0x80000000 (2147483648)"
6810#if PC_ENABLE_FORWARDED_TRUST
6811#if !PC_ENABLE_AUTH_LOCKOUT
6812#error "ProtoCore: PC_ENABLE_FORWARDED_TRUST requires PC_ENABLE_AUTH_LOCKOUT"
6814#if PC_TRUSTED_PROXY_MAX < 1
6815#error "ProtoCore: PC_TRUSTED_PROXY_MAX must be >= 1 when PC_ENABLE_FORWARDED_TRUST is set"
6820#if !PC_ENABLE_FILE_SERVING
6821#error "ProtoCore: PC_ENABLE_WEBDAV requires PC_ENABLE_FILE_SERVING"
6823#if PC_WEBDAV_BUF_SIZE < 256
6824#error "ProtoCore: PC_WEBDAV_BUF_SIZE must be >= 256"
6826#if PC_METHOD_BUF_SIZE < 10
6827#error "ProtoCore: PC_METHOD_BUF_SIZE must be >= 10 when PC_ENABLE_WEBDAV is set (PROPPATCH)"
6832#if PC_MODBUS_COILS < 1 || PC_MODBUS_DISCRETE_INPUTS < 1 || PC_MODBUS_HOLDING_REGS < 1 || PC_MODBUS_INPUT_REGS < 1
6833#error "ProtoCore: each PC_MODBUS_* table size must be >= 1 when PC_ENABLE_MODBUS is set"
6837#if PC_ENABLE_KEEPALIVE && PC_KEEPALIVE_MAX_REQUESTS < 1
6838#error "ProtoCore: PC_KEEPALIVE_MAX_REQUESTS must be >= 1 when PC_ENABLE_KEEPALIVE is set"
6841#if PC_ENABLE_RANGE && !PC_ENABLE_FILE_SERVING && !PC_ENABLE_EDGE_CACHE
6842#error "ProtoCore: PC_ENABLE_RANGE requires PC_ENABLE_FILE_SERVING or PC_ENABLE_EDGE_CACHE"
6845#if PC_ENABLE_MTLS && !PC_ENABLE_TLS
6846#error "ProtoCore: PC_ENABLE_MTLS requires PC_ENABLE_TLS"
6849#if PC_ENABLE_TLS_RESUMPTION && !PC_ENABLE_TLS
6850#error "ProtoCore: PC_ENABLE_TLS_RESUMPTION requires PC_ENABLE_TLS"
6853#if PC_ENABLE_METRICS && !PC_ENABLE_STATS
6854#error "ProtoCore: PC_ENABLE_METRICS requires PC_ENABLE_STATS"
6857#if PC_ENABLE_HTTP_CLIENT_TLS && !PC_ENABLE_TLS
6858#error "ProtoCore: PC_ENABLE_HTTP_CLIENT_TLS requires PC_ENABLE_TLS"
6861#if PC_ENABLE_MQTT_TLS && !PC_ENABLE_TLS
6862#error "ProtoCore: PC_ENABLE_MQTT_TLS requires PC_ENABLE_TLS"
6865#if PC_ENABLE_WS_CLIENT_TLS && !PC_ENABLE_TLS
6866#error "ProtoCore: PC_ENABLE_WS_CLIENT_TLS requires PC_ENABLE_TLS"
6869#if PC_ENABLE_SNMP_TRAP && !PC_ENABLE_SNMP
6870#error "ProtoCore: PC_ENABLE_SNMP_TRAP requires PC_ENABLE_SNMP"
6873#if PC_ENABLE_COAP_OBSERVE && !PC_ENABLE_COAP
6874#error "ProtoCore: PC_ENABLE_COAP_OBSERVE requires PC_ENABLE_COAP"
6877#if PC_ENABLE_TLS_RPK && !(PC_ENABLE_DTLS || PC_ENABLE_HTTP3)
6878#error "ProtoCore: PC_ENABLE_TLS_RPK requires PC_ENABLE_DTLS or PC_ENABLE_HTTP3"
6881#if PC_ENABLE_COAP_BLOCK
6883#error "ProtoCore: PC_ENABLE_COAP_BLOCK requires PC_ENABLE_COAP"
6885#if PC_COAP_BLOCK_SZX_MAX > 6
6886#error "ProtoCore: PC_COAP_BLOCK_SZX_MAX must be <= 6 (block size 2^(SZX+4); SZX 7 is reserved)"
6888#if PC_COAP_MSG_BUF_SIZE < ((1 << (PC_COAP_BLOCK_SZX_MAX + 4)) + 16)
6889#error "ProtoCore: PC_COAP_MSG_BUF_SIZE must hold one full block (2^(PC_COAP_BLOCK_SZX_MAX+4)) + 16 header/option bytes"
6891#if PC_COAP_BLOCK1_MAX < (1 << (PC_COAP_BLOCK_SZX_MAX + 4))
6892#error "ProtoCore: PC_COAP_BLOCK1_MAX must be >= one block (2^(PC_COAP_BLOCK_SZX_MAX+4))"
6899#if PC_ENABLE_WS_DEFLATE && !PC_ENABLE_WEBSOCKET
6900#error "ProtoCore: PC_ENABLE_WS_DEFLATE requires PC_ENABLE_WEBSOCKET"
6903#if PC_ENABLE_CIA402 && !PC_ENABLE_CANOPEN
6904#error "ProtoCore: PC_ENABLE_CIA402 requires PC_ENABLE_CANOPEN"
6907#if PC_ENABLE_SSH_ZLIB && !PC_ENABLE_SSH
6908#error "ProtoCore: PC_ENABLE_SSH_ZLIB requires PC_ENABLE_SSH"
6911#if PC_ENABLE_SSH_KEYBOARD_INTERACTIVE && !PC_ENABLE_SSH
6912#error "ProtoCore: PC_ENABLE_SSH_KEYBOARD_INTERACTIVE requires PC_ENABLE_SSH"
6914#if PC_ENABLE_SSH_KEYBOARD_INTERACTIVE && !PC_SSH_ALLOW_PASSWORD
6916 "ProtoCore: PC_ENABLE_SSH_KEYBOARD_INTERACTIVE is password-backed - it verifies the response through the password callback, so PC_SSH_ALLOW_PASSWORD must stay 1 (or drop keyboard-interactive for publickey-only)"
6919#if PC_ENABLE_SSH_SFTP && !PC_ENABLE_SSH
6920#error "ProtoCore: PC_ENABLE_SSH_SFTP requires PC_ENABLE_SSH"
6922#if PC_ENABLE_SSH_SFTP && !PC_ENABLE_FILE_SERVING
6923#error "ProtoCore: PC_ENABLE_SSH_SFTP requires PC_ENABLE_FILE_SERVING (the fs::FS seam)"
6925#if PC_ENABLE_SSH_SCP && !PC_ENABLE_SSH
6926#error "ProtoCore: PC_ENABLE_SSH_SCP requires PC_ENABLE_SSH"
6928#if PC_ENABLE_SSH_SCP && !PC_ENABLE_FILE_SERVING
6929#error "ProtoCore: PC_ENABLE_SSH_SCP requires PC_ENABLE_FILE_SERVING (the fs::FS seam)"
6932#if PC_ENABLE_SSH_ZLIB
6934#if (PC_SSH_ZLIB_WINDOW & (PC_SSH_ZLIB_WINDOW - 1)) != 0 || PC_SSH_ZLIB_WINDOW < 256 || PC_SSH_ZLIB_WINDOW > 32768
6935#error "ProtoCore: PC_SSH_ZLIB_WINDOW must be a power of two in [256, 32768]"
6938#if (PC_SSH_ZLIB_WINDOW + PC_SSH_ZLIB_MAX_IN) > 65534
6939#error "ProtoCore: PC_SSH_ZLIB_WINDOW + PC_SSH_ZLIB_MAX_IN must be <= 65534"
6943#if PC_SSH_ZLIB_MAX_IN < SSH_PKT_BUF_SIZE
6944#error "ProtoCore: PC_SSH_ZLIB_MAX_IN must be >= SSH_PKT_BUF_SIZE"
6951#if defined(ARDUINO) && !PC_SSH_ZLIB_IN_PSRAM && !PC_SSH_ZLIB_ACK_DRAM
6953 "ProtoCore: PC_ENABLE_SSH_ZLIB - the per-connection compression pool is ~80 KB (s2c deflate ~48 KB + the c2s 32 KB inflate window). Set PC_SSH_ZLIB_IN_PSRAM=1 on a PSRAM board (S3 / P4 / WROVER, core built with CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY=y, tools/psram/README.md), OR set PC_SSH_ZLIB_ACK_DRAM=1 to accept the internal-DRAM cost (fits MAX_SSH_CONNS=1 without TLS on a roomy chip)."
6957#if PC_ENABLE_WEB_TERMINAL && !PC_ENABLE_WEBSOCKET
6958#error "ProtoCore: PC_ENABLE_WEB_TERMINAL requires PC_ENABLE_WEBSOCKET"
6961#if PC_ENABLE_DASHBOARD && !PC_ENABLE_SSE
6962#error "ProtoCore: PC_ENABLE_DASHBOARD requires PC_ENABLE_SSE"
6965#if PC_ENABLE_SNMP_V3 && !PC_ENABLE_SNMP
6966#error "ProtoCore: PC_ENABLE_SNMP_V3 requires PC_ENABLE_SNMP"
6969#if PC_ENABLE_OPCUA_CLIENT && !PC_ENABLE_OPCUA
6970#error "ProtoCore: PC_ENABLE_OPCUA_CLIENT requires PC_ENABLE_OPCUA (the shared OPC UA codec)"
6973#if PC_ENABLE_UMATI && !PC_ENABLE_OPCUA
6974#error "ProtoCore: PC_ENABLE_UMATI requires PC_ENABLE_OPCUA (it builds on the OPC UA server)"
6977#if PC_ENABLE_ROBOTICS && !PC_ENABLE_OPCUA
6978#error "ProtoCore: PC_ENABLE_ROBOTICS requires PC_ENABLE_OPCUA (it builds on the OPC UA server)"
6981#if PC_ENABLE_EUROMAP77 && !PC_ENABLE_OPCUA
6982#error "ProtoCore: PC_ENABLE_EUROMAP77 requires PC_ENABLE_OPCUA (it builds on the OPC UA server)"
6985#if PC_ENABLE_CONFIG_IO && !PC_ENABLE_CONFIG_STORE
6986#error "ProtoCore: PC_ENABLE_CONFIG_IO requires PC_ENABLE_CONFIG_STORE"
6989#if PC_ENABLE_HTTP_CLIENT_TLS && !PC_ENABLE_HTTP_CLIENT
6990#error "ProtoCore: PC_ENABLE_HTTP_CLIENT_TLS requires PC_ENABLE_HTTP_CLIENT"
6993#if PC_ENABLE_MQTT_TLS && !PC_ENABLE_MQTT
6994#error "ProtoCore: PC_ENABLE_MQTT_TLS requires PC_ENABLE_MQTT"
6997#if PC_ENABLE_WS_CLIENT_TLS && !PC_ENABLE_WS_CLIENT
6998#error "ProtoCore: PC_ENABLE_WS_CLIENT_TLS requires PC_ENABLE_WS_CLIENT"
7001#if PC_ENABLE_WEBSOCKET && WS_FRAME_SIZE < 2
7002#error "ProtoCore: WS_FRAME_SIZE must be >= 2 when PC_ENABLE_WEBSOCKET is set"
7005#if PC_ENABLE_SSE && SSE_BUF_SIZE < 8
7006#error "ProtoCore: SSE_BUF_SIZE must be >= 8 when PC_ENABLE_SSE is set"
7009#if PC_ENABLE_MULTIPART && MAX_MULTIPART_PARTS < 1
7010#error "ProtoCore: MAX_MULTIPART_PARTS must be >= 1 when PC_ENABLE_MULTIPART is set"
7013#if RESP_HDR_BUF_SIZE < 128
7014#error "ProtoCore: RESP_HDR_BUF_SIZE must be >= 128 (status line + headers + CORS block)"
7017#if PC_ENABLE_WEBSOCKET && WS_HDR_BUF_SIZE < 128
7018#error "ProtoCore: WS_HDR_BUF_SIZE must be >= 128 when PC_ENABLE_WEBSOCKET is set"
7021#if CORS_HDR_BUF_SIZE < 64
7022#error "ProtoCore: CORS_HDR_BUF_SIZE must be >= 64"
7025#if RESP_HDR_BUF_SIZE < (CORS_HDR_BUF_SIZE + EXTRA_HDR_BUF_SIZE + 96)
7027 "ProtoCore: RESP_HDR_BUF_SIZE must be >= CORS_HDR_BUF_SIZE + EXTRA_HDR_BUF_SIZE + 96 (status line + CORS block + custom-header block are injected into response headers)"
7048#define PC_PROTO_MAX 11
7054#if PC_ENABLE_SSH_CLIENT
7055#ifndef PC_SSH_CLIENT_MAX_CHANNELS
7056#define PC_SSH_CLIENT_MAX_CHANNELS 4
7058#if PC_SSH_CLIENT_MAX_CHANNELS < 1
7059#error "ProtoCore: PC_SSH_CLIENT_MAX_CHANNELS must be >= 1"
7064#ifndef PC_CLIENT_CONNS
7065#if PC_ENABLE_SSH_CLIENT
7068#define PC_CLIENT_CONNS (1 + PC_SSH_CLIENT_MAX_CHANNELS)
7070#define PC_CLIENT_CONNS 2
7076#if PC_ENABLE_FTP_SESSION && (PC_CLIENT_CONNS < 2)
7077#error "ProtoCore: PC_ENABLE_FTP_SESSION needs PC_CLIENT_CONNS >= 2 (control + data)"
7081#if PC_ENABLE_SSH_CLIENT && (PC_CLIENT_CONNS < 1 + PC_SSH_CLIENT_MAX_CHANNELS)
7083 "ProtoCore: PC_ENABLE_SSH_CLIENT needs PC_CLIENT_CONNS >= 1 + PC_SSH_CLIENT_MAX_CHANNELS (relay + one local bridge per channel)"
7096#ifndef PC_CLIENT_RX_BUF
7097#define PC_CLIENT_RX_BUF 8192
7103#ifndef SSH_CHAN_WINDOW
7104#define SSH_CHAN_WINDOW 32768u
7115#ifndef SSH_CHAN_MAX_PACKET
7116#define SSH_CHAN_MAX_PACKET (SSH_PKT_BUF_SIZE - 64u)
7125#ifndef SSH_REKEY_PACKET_THRESHOLD
7126#define SSH_REKEY_PACKET_THRESHOLD 0x40000000u
7135#ifndef SSH_REKEY_TIME_MS
7136#define SSH_REKEY_TIME_MS 3600000u
7139#ifndef SSH_AUTH_USER_MAX
7140#define SSH_AUTH_USER_MAX 32
7143#ifndef SSH_AUTH_PASS_MAX
7144#define SSH_AUTH_PASS_MAX 64
7154#ifndef SSH_KEXINIT_MAX
7155#define SSH_KEXINIT_MAX 2048
7158#if PC_ENABLE_AUDIT_LOG
7160#ifndef PC_AUDIT_LOG_ENTRIES
7161#define PC_AUDIT_LOG_ENTRIES 32
7163#ifndef PC_AUDIT_MSG_LEN
7164#define PC_AUDIT_MSG_LEN 48
7168#if PC_ENABLE_DEVICENET
7170#ifndef PC_DEVICENET_MSG_MAX
7171#define PC_DEVICENET_MSG_MAX 256
7177#ifndef PC_ESPNOW_MAX_PEERS
7178#define PC_ESPNOW_MAX_PEERS 8
7182#if PC_ENABLE_GRAPHQL
7184#ifndef PC_GQL_MAX_NODES
7185#define PC_GQL_MAX_NODES 48
7187#ifndef PC_GQL_MAX_ARGS
7188#define PC_GQL_MAX_ARGS 24
7190#ifndef PC_GQL_MAX_DEPTH
7191#define PC_GQL_MAX_DEPTH 6
7193#ifndef PC_GQL_NAME_MAX
7194#define PC_GQL_NAME_MAX 32
7196#ifndef PC_GQL_PATH_MAX
7197#define PC_GQL_PATH_MAX 96
7199#ifndef PC_GQL_STRBUF
7200#define PC_GQL_STRBUF 256
7206#ifndef PC_J1939_TP_MAX
7207#define PC_J1939_TP_MAX 256
7213#ifndef PC_NMEA0183_MAX_FIELDS
7214#define PC_NMEA0183_MAX_FIELDS 26
7220#ifndef PC_UBX_MAX_PAYLOAD
7221#define PC_UBX_MAX_PAYLOAD 256
7225#if PC_ENABLE_NMEA2000
7227#ifndef PC_N2K_FP_MAX
7228#define PC_N2K_FP_MAX 223
7234#ifndef PC_OAUTH2_TOKEN_LEN
7235#define PC_OAUTH2_TOKEN_LEN 768
7237#ifndef PC_OAUTH2_RT_LEN
7238#define PC_OAUTH2_RT_LEN 256
7240#ifndef PC_OAUTH2_BODY_BUF
7241#define PC_OAUTH2_BODY_BUF 1024
7243#ifndef PC_OAUTH2_RESP_BUF
7244#define PC_OAUTH2_RESP_BUF 2048
7252#ifndef PC_OIDC_SUB_LEN
7253#define PC_OIDC_SUB_LEN 64
7255#ifndef PC_OIDC_EMAIL_LEN
7256#define PC_OIDC_EMAIL_LEN 96
7258#ifndef PC_OIDC_KID_LEN
7259#define PC_OIDC_KID_LEN 80
7261#ifndef PC_OIDC_JWKS_MAX
7262#define PC_OIDC_JWKS_MAX 16384
7269#define PC_OPCUA_BUF 8192
7271#ifndef PC_OPCUA_READ_MAX
7272#define PC_OPCUA_READ_MAX 8
7274#ifndef PC_OPCUA_BROWSE_MAX
7275#define PC_OPCUA_BROWSE_MAX 4
7277#ifndef PC_OPCUA_REF_MAX
7278#define PC_OPCUA_REF_MAX 8
7280#ifndef PC_OPCUA_WRITE_MAX
7281#define PC_OPCUA_WRITE_MAX 8
7285#if PC_ENABLE_ROBOTICS && (PC_ROBOTICS_AXES > PC_OPCUA_REF_MAX)
7286#error "ProtoCore: PC_ROBOTICS_AXES must be <= PC_OPCUA_REF_MAX (an Axes Browse returns one reference per axis)"
7290#ifndef PC_OPCUA_DEFAULT_ENDPOINT
7291#define PC_OPCUA_DEFAULT_ENDPOINT "opc.tcp://localhost:4840"
7293#ifndef PC_OPCUA_DEFAULT_APP_URI
7294#define PC_OPCUA_DEFAULT_APP_URI "urn:det:opcua:server"
7296#ifndef PC_OPCUA_DEFAULT_APP_NAME
7297#define PC_OPCUA_DEFAULT_APP_NAME "pc_opcua_server"
7301#if PC_ENABLE_PROVISIONING
7305#ifndef PC_PROV_NVS_NAMESPACE
7306#define PC_PROV_NVS_NAMESPACE "wifi_prov"
7308#ifndef PC_PROV_KEY_SSID
7309#define PC_PROV_KEY_SSID "ssid"
7311#ifndef PC_PROV_KEY_PSK
7312#define PC_PROV_KEY_PSK "psk"
7318#ifndef PC_VFS_RAM_FILES
7319#define PC_VFS_RAM_FILES 4
7321#ifndef PC_VFS_RAM_FILE_SIZE
7322#define PC_VFS_RAM_FILE_SIZE 1024
7324#ifndef PC_VFS_MAX_OPEN
7325#define PC_VFS_MAX_OPEN 4
7327#ifndef PC_VFS_NAME_MAX
7328#define PC_VFS_NAME_MAX 48
Per-variant default sizing: pick sane PC_* defaults for the target board.
Feature-driven sizing resolution - the per-variant sizing layer's final pass.
ConnProto
Application protocol spoken on a listener port or connection slot.
@ PROTO_NONE
Unassigned slot.
@ PROTO_HTTP
HTTP/1.1 with optional WS and SSE upgrades.
@ PROTO_OPCUA
OPC UA Binary (UA-TCP) server.
@ PROTO_TELNET
Telnet (RFC 854).
@ PROTO_MESH
Edge-cache sibling link (PC_ENABLE_EDGE_MESH): answers a peer's content-addressed query.
@ PROTO_MODBUS
Modbus TCP slave (Modbus Application Protocol).
@ PROTO_BRIDGE
address:port -> hardware bus (PC_ENABLE_IFACE_BRIDGE): UART/SPI/I2C device server.
@ PROTO_SSH_RFWD
SSH remote-forward listener (ssh -R): accepts bridge to a forwarded-tcpip channel.
@ PROTO_RELAY
TCP relay / DNAT (PC_ENABLE_RELAY): bridge to an origin pc_client connection.
@ PROTO_SSH
SSH (RFC 4253/4252/4254).
@ PROTO_NTRIP_CASTER
NTRIP caster (PC_ENABLE_NTRIP_CASTER): serves RTCM3 corrections to rovers.
#define PC_PROTO_MAX
Size of the protocol-handler dispatch table; must exceed the largest ConnProto id.
pc_iface
Network interface a connection arrived on (for per-route filtering).
@ PC_IFACE_AP
softAP interface (clients joined to the device).
@ PC_IFACE_ETH
Ethernet interface (wired PHY).
@ PC_IFACE_STA
Station interface (joined to an AP / your LAN).
@ PC_IFACE_ANY
Unknown / no filter (matches any interface).
Runtime-tunable server parameters.