GET /api/debug/lwip-stats/
Snapshot of the lwIP stack’s internal counters: per-protocol statistics and memp pool state.
The data source is the global lwip_stats structure (lwip/stats.h). The available fields are determined by the *_STATS flags in lwipopts.h. If a flag is disabled, the corresponding key is omitted from the response.
Auth: Bearer (powerUser).
Response 200
Section titled “Response 200”{ "proto": { "link": { "recv": 1234, "xmit": 1100, "drop": 0, "chkerr": 0, "lenerr": 0, "memerr": 0, "rterr": 0, "proterr": 0, "opterr": 0, "err": 0 }, "etharp": { "recv": 200, "xmit": 180, "drop": 0, "chkerr": 0, "lenerr": 0, "memerr": 0, "rterr": 0, "proterr": 0, "opterr": 0, "err": 0, "cachehit": 950 }, "ip": { "recv": 1000, "xmit": 950, "drop": 0, "chkerr": 0, "lenerr": 0, "memerr": 0, "rterr": 0, "proterr": 0, "opterr": 0, "err": 0 }, "icmp": { "recv": 4, "xmit": 4, "drop": 0, "chkerr": 0, "lenerr": 0, "memerr": 0, "rterr": 0, "proterr": 0, "opterr": 0, "err": 0 }, "udp": { "recv": 50, "xmit": 50, "drop": 0, "chkerr": 0, "lenerr": 0, "memerr": 0, "rterr": 0, "proterr": 0, "opterr": 0, "err": 0 }, "tcp": { "recv": 800, "xmit": 760, "drop": 0, "chkerr": 0, "lenerr": 0, "memerr": 0, "rterr": 0, "proterr": 0, "opterr": 0, "err": 0 } }, "memp": [ { "name": "RAW_PCB", "avail": 0, "used": 0, "max": 0, "err": 0 }, { "name": "UDP_PCB", "avail": 8, "used": 1, "max": 1, "err": 0 }, { "name": "TCP_PCB", "avail": 16, "used": 2, "max": 5, "err": 0 }, { "name": "TCP_PCB_LISTEN", "avail": 4, "used": 2, "max": 2, "err": 0 }, { "name": "TCP_SEG", "avail": 20, "used": 0, "max": 8, "err": 0 }, { "name": "PBUF", "avail": 4, "used": 0, "max": 2, "err": 0 }, { "name": "PBUF_POOL", "avail": 40, "used": 0, "max": 12, "err": 0 } ]}proto.<name> (struct stats_proto)
Section titled “proto.<name> (struct stats_proto)”Each group represents one protocol. A name is included only if the corresponding *_STATS = 1 in lwipopts.h.
| Field | Type | Description |
|---|---|---|
recv | number | Packets received |
xmit | number | Packets transmitted |
drop | number | Packets dropped |
chkerr | number | Checksum errors |
lenerr | number | Length errors |
memerr | number | Memory allocation failures |
rterr | number | Routing errors |
proterr | number | Protocol errors |
opterr | number | Option errors |
err | number | Other errors |
cachehit | number | etharp only: ARP cache hits |
Possible proto keys: link, etharp, ip, icmp, udp, and tcp. (These correspond to the LINK_STATS, ETHARP_STATS, IP_STATS, ICMP_STATS, UDP_STATS, and TCP_STATS flags.)
memp[] (struct stats_mem)
Section titled “memp[] (struct stats_mem)”An array containing one item per memp pool. The name field is the short pool identifier from the memp_t enum, without the MEMP_ prefix.
| Field | Type | Description |
|---|---|---|
name | string | Pool name (for example, TCP_PCB or PBUF_POOL) |
avail | number | Pool capacity (number of items) |
used | number | Current number of items in use |
max | number | Peak used value during operation |
err | number | Number of failed allocations from the pool |
This block is present only when MEMP_STATS = 1.