Keep accounting of RX/TX bytes, frames
This commit is contained in:
parent
7fd05f607a
commit
17b2313edc
2 changed files with 8 additions and 0 deletions
6
src/if.c
6
src/if.c
|
@ -287,6 +287,9 @@ ssize_t patty_ax25_if_recv(patty_ax25_if *iface,
|
||||||
|
|
||||||
*buf = iface->rx_buf;
|
*buf = iface->rx_buf;
|
||||||
|
|
||||||
|
iface->stats.rx_frames++;
|
||||||
|
iface->stats.rx_bytes += readlen;
|
||||||
|
|
||||||
return readlen;
|
return readlen;
|
||||||
|
|
||||||
error_kiss_tnc_recv:
|
error_kiss_tnc_recv:
|
||||||
|
@ -302,6 +305,9 @@ ssize_t patty_ax25_if_send(patty_ax25_if *iface,
|
||||||
goto error_kiss_tnc_send;
|
goto error_kiss_tnc_send;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
iface->stats.tx_frames++;
|
||||||
|
iface->stats.tx_bytes += wrlen;
|
||||||
|
|
||||||
return wrlen;
|
return wrlen;
|
||||||
|
|
||||||
error_kiss_tnc_send:
|
error_kiss_tnc_send:
|
||||||
|
|
|
@ -1125,6 +1125,8 @@ static int handle_frame(patty_ax25_server *server,
|
||||||
PATTY_AX25_FRAME_NORMAL,
|
PATTY_AX25_FRAME_NORMAL,
|
||||||
buf,
|
buf,
|
||||||
len) < 0) {
|
len) < 0) {
|
||||||
|
iface->stats.dropped++;
|
||||||
|
|
||||||
goto error_io;
|
goto error_io;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue