Skip to content

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).


{
"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 }
]
}

Each group represents one protocol. A name is included only if the corresponding *_STATS = 1 in lwipopts.h.

FieldTypeDescription
recvnumberPackets received
xmitnumberPackets transmitted
dropnumberPackets dropped
chkerrnumberChecksum errors
lenerrnumberLength errors
memerrnumberMemory allocation failures
rterrnumberRouting errors
proterrnumberProtocol errors
opterrnumberOption errors
errnumberOther errors
cachehitnumberetharp 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.)

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.

FieldTypeDescription
namestringPool name (for example, TCP_PCB or PBUF_POOL)
availnumberPool capacity (number of items)
usednumberCurrent number of items in use
maxnumberPeak used value during operation
errnumberNumber of failed allocations from the pool

This block is present only when MEMP_STATS = 1.