|
ProtoCore v0.0.1
Deterministic, zero-heap network stack for embedded targets
|
A single TCP connection context. More...
#include <tcp.h>
Public Attributes | |
| uint8_t | id |
| Fixed slot index (0 … MAX_CONNS-1). | |
| pc_atomic< ConnState > | state |
| Lifecycle state; acquire/release for inter-task visibility. | |
| struct tcp_pcb * | pcb |
| lwIP PCB; null when slot is free. | |
| uint32_t | last_activity_ms |
millis() timestamp of last TX/RX event. | |
| uint32_t | req_start_ms |
| uint8_t | rx_buffer [RX_BUF_SIZE] |
| Ring buffer storage. | |
| pc_atomic< size_t > | rx_head |
| Producer write index (lwIP/tcpip context). | |
| pc_atomic< size_t > | rx_tail |
| Consumer read index (worker context). | |
| size_t | rx_acked |
| uint8_t | listener_id |
| Index into listener_pool[]; set at accept time. | |
| uint8_t | owner |
| Worker that owns this slot (round-robin at accept). Always 0 at N=1. | |
| ConnProto | proto |
| Application protocol for this connection. | |
| uint8_t | proto_slot |
| Per-protocol session/pool index (0xFF = none): the SSH session, an MQTT/Modbus session, etc. | |
| pc_iface | iface |
| Interface this connection arrived on; set at accept time. | |
| uint8_t | tls |
| Non-zero when this connection is TLS (set at accept time). | |
A single TCP connection context.
Sized so that MAX_CONNS instances fit in a static array without fragmentation. All fields except the volatile ring-buffer indices may only be accessed from the Arduino main-loop task.
| uint8_t TcpConn::id |
Fixed slot index (0 … MAX_CONNS-1).
Definition at line 73 of file tcp.h.
Referenced by DeterministicAsyncTCP::check_timeouts(), lowlevel_err_cb(), lowlevel_recv_cb(), lowlevel_sent_cb(), pc_conn_abort_slot(), pc_conn_begin_close(), pc_conn_close(), pc_ssh_conn_accept(), pc_ssh_conn_close_channel(), pc_ssh_conn_open_forwarded(), pc_ssh_conn_send(), and DeterministicAsyncTCP::pool_init().
Lifecycle state; acquire/release for inter-task visibility.
Definition at line 74 of file tcp.h.
Referenced by DeterministicAsyncTCP::check_timeouts(), lowlevel_err_cb(), lowlevel_recv_cb(), lowlevel_sent_cb(), pc_conn_ack_consumed(), pc_conn_begin_close(), pc_conn_remote_addr(), pc_conn_remote_ip(), pc_conn_set_state(), pc_conn_touch_active(), PC::redirect(), PC::send(), PC::send_empty(), and DeterministicAsyncTCP::stop().
| struct tcp_pcb* TcpConn::pcb |
lwIP PCB; null when slot is free.
Definition at line 75 of file tcp.h.
Referenced by DeterministicAsyncTCP::check_timeouts(), listener_accept_cb(), lowlevel_err_cb(), lowlevel_recv_cb(), pc_conn_abort_slot(), pc_conn_ack_consumed(), pc_conn_begin_close(), pc_conn_close(), pc_conn_remote_addr(), pc_conn_remote_ip(), pc_conn_sndbuf(), PC::redirect(), PC::send(), PC::send_empty(), and DeterministicAsyncTCP::stop().
| uint32_t TcpConn::last_activity_ms |
millis() timestamp of last TX/RX event.
Definition at line 76 of file tcp.h.
Referenced by DeterministicAsyncTCP::check_timeouts(), listener_accept_cb(), lowlevel_recv_cb(), lowlevel_sent_cb(), pc_conn_begin_close(), and pc_conn_touch_active().
| uint32_t TcpConn::req_start_ms |
millis() at the first byte of the in-progress request (0 = none). The request-header deadline (PC_REQUEST_TIMEOUT_MS, slow-loris defense) measures against this; unlike last_activity_ms a trickle byte cannot reset it.
Definition at line 77 of file tcp.h.
Referenced by PC::http_poll_slot(), listener_accept_cb(), and lowlevel_recv_cb().
| uint8_t TcpConn::rx_buffer[RX_BUF_SIZE] |
| pc_atomic<size_t> TcpConn::rx_head |
Producer write index (lwIP/tcpip context).
Definition at line 82 of file tcp.h.
Referenced by listener_accept_cb(), and lowlevel_recv_cb().
| pc_atomic<size_t> TcpConn::rx_tail |
Consumer read index (worker context).
Definition at line 83 of file tcp.h.
Referenced by listener_accept_cb(), lowlevel_recv_cb(), and pc_conn_ack_consumed().
| size_t TcpConn::rx_acked |
rx_tail position last ACKed to lwIP (tcp_recved). Worker-only: the window is reopened by exactly the bytes drained since, so it tracks ring occupancy (ack-on-consume) rather than copy.
Definition at line 84 of file tcp.h.
Referenced by listener_accept_cb(), and pc_conn_ack_consumed().
| uint8_t TcpConn::listener_id |
Index into listener_pool[]; set at accept time.
Definition at line 88 of file tcp.h.
Referenced by listener_accept_cb().
| uint8_t TcpConn::owner |
Worker that owns this slot (round-robin at accept). Always 0 at N=1.
Definition at line 89 of file tcp.h.
Referenced by DeterministicAsyncTCP::check_timeouts(), listener_accept_cb(), listener_enqueue(), and lowlevel_sent_cb().
| ConnProto TcpConn::proto |
Application protocol for this connection.
Definition at line 90 of file tcp.h.
Referenced by listener_accept_cb().
| uint8_t TcpConn::proto_slot |
Per-protocol session/pool index (0xFF = none): the SSH session, an MQTT/Modbus session, etc.
Definition at line 92 of file tcp.h.
Referenced by pc_ssh_conn_accept(), pc_ssh_conn_close(), pc_ssh_conn_poll(), and pc_ssh_conn_rx().
| pc_iface TcpConn::iface |
Interface this connection arrived on; set at accept time.
Definition at line 93 of file tcp.h.
Referenced by listener_accept_cb().
| uint8_t TcpConn::tls |
Non-zero when this connection is TLS (set at accept time).
Definition at line 94 of file tcp.h.
Referenced by listener_accept_cb(), pc_conn_abort_slot(), and pc_conn_close().