mirror of https://gerrit.osmocom.org/libosmocore
ns2: Increment Rx and Tx byte / packet counters
Change-Id: If5e93f69cddbc8962cbbae38c07b504dd9b1ecd1
This commit is contained in:
parent
5a5bf720a8
commit
e5f55f73bd
|
@ -1053,6 +1053,9 @@ int ns2_recv_vc(struct gprs_ns2_vc *nsvc,
|
|||
log_set_context(LOG_CTX_GB_NSE, nsvc->nse);
|
||||
log_set_context(LOG_CTX_GB_NSVC, nsvc);
|
||||
|
||||
rate_ctr_inc(&nsvc->ctrg->ctr[NS_CTR_PKTS_IN]);
|
||||
rate_ctr_add(&nsvc->ctrg->ctr[NS_CTR_BYTES_IN], msg->len);
|
||||
|
||||
if (msg->len < sizeof(struct gprs_ns_hdr))
|
||||
return -EINVAL;
|
||||
|
||||
|
|
|
@ -168,6 +168,9 @@ int ns2_validate(struct gprs_ns2_vc *nsvc,
|
|||
|
||||
static int ns_vc_tx(struct gprs_ns2_vc *nsvc, struct msgb *msg)
|
||||
{
|
||||
rate_ctr_inc(&nsvc->ctrg->ctr[NS_CTR_PKTS_OUT]);
|
||||
rate_ctr_add(&nsvc->ctrg->ctr[NS_CTR_BYTES_OUT], msgb_length(msg));
|
||||
|
||||
return nsvc->bind->send_vc(nsvc, msg);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue