gbproxy_peer: Add rate counters when forwarding packets fail

Change-Id: I7fa972ba843993dac84241c04d66d5b7e2a0b40f
changes/96/27396/2
Daniel Willmann 9 months ago committed by laforge
parent f87255ab80
commit d71aa6bf20
  1. 2
      include/osmocom/gbproxy/gb_proxy.h
  2. 9
      src/gb_proxy.c
  3. 12
      src/gb_proxy_peer.c

@ -50,6 +50,8 @@ enum gbproxy_bvc_ctr {
GBPROX_PEER_CTR_DROPPED,
GBPROX_PEER_CTR_INV_NSEI,
GBPROX_PEER_CTR_TX_ERR,
GBPROX_PEER_CTR_FWD_FROM_SGSN_ERR,
GBPROX_PEER_CTR_FWD_FROM_BSS_ERR,
GBPROX_PEER_CTR_LAST,
};

@ -532,6 +532,9 @@ static int gbprox_rx_ptp_from_bss(struct gbproxy_nse *nse, struct msgb *msg, uin
}
}
if (rc < 0)
rate_ctr_inc(rate_ctr_group_get_ctr(bss_bvc->ctrg, GBPROX_PEER_CTR_FWD_FROM_BSS_ERR));
return 0;
}
@ -606,8 +609,12 @@ static int gbprox_rx_ptp_from_sgsn(struct gbproxy_nse *nse, struct msgb *msg, ui
default:
break;
}
return gbprox_relay2peer(msg, bss_bvc, bss_bvc->bvci);
rc = gbprox_relay2peer(msg, bss_bvc, bss_bvc->bvci);
if (rc < 0)
rate_ctr_inc(rate_ctr_group_get_ctr(bss_bvc->ctrg, GBPROX_PEER_CTR_FWD_FROM_SGSN_ERR));
return rc;
}
/***********************************************************************

@ -39,11 +39,13 @@
extern void *tall_sgsn_ctx;
static const struct rate_ctr_desc bvc_ctr_description[] = {
[GBPROX_PEER_CTR_BLOCKED] = { "blocked", "BVC Block " },
[GBPROX_PEER_CTR_UNBLOCKED] = { "unblocked", "BVC Unblock " },
[GBPROX_PEER_CTR_DROPPED] = { "dropped", "BVC blocked, dropped packet " },
[GBPROX_PEER_CTR_INV_NSEI] = { "inv-nsei", "NSEI mismatch " },
[GBPROX_PEER_CTR_TX_ERR] = { "tx-err", "NS Transmission error " },
[GBPROX_PEER_CTR_BLOCKED] = { "blocked", "BVC Block " },
[GBPROX_PEER_CTR_UNBLOCKED] = { "unblocked", "BVC Unblock " },
[GBPROX_PEER_CTR_DROPPED] = { "dropped", "BVC blocked, dropped packet " },
[GBPROX_PEER_CTR_INV_NSEI] = { "inv-nsei", "NSEI mismatch " },
[GBPROX_PEER_CTR_TX_ERR] = { "tx-err", "NS Transmission error " },
[GBPROX_PEER_CTR_FWD_FROM_SGSN_ERR] = { "fwd-sgsn-err", "Forwarding data from SGSN failed" },
[GBPROX_PEER_CTR_FWD_FROM_BSS_ERR] = { "fwd-bss-err", "Forwarding data from BSS failed " },
};
osmo_static_assert(ARRAY_SIZE(bvc_ctr_description) == GBPROX_PEER_CTR_LAST, everything_described);

Loading…
Cancel
Save