pespin has uploaded this change for review.

View Change

sccp: Introduce DL-related cnlink rate counters

Change-Id: Ib4a87aec3d7bb01be833dd33c597a33d9bbad859
---
M include/osmocom/hnbgw/hnbgw_cn.h
M src/osmo-hnbgw/hnbgw_cn.c
M src/osmo-hnbgw/hnbgw_sccp.c
3 files changed, 37 insertions(+), 0 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/47/40247/1
diff --git a/include/osmocom/hnbgw/hnbgw_cn.h b/include/osmocom/hnbgw/hnbgw_cn.h
index 8f7919f..6299cde 100644
--- a/include/osmocom/hnbgw/hnbgw_cn.h
+++ b/include/osmocom/hnbgw/hnbgw_cn.h
@@ -56,6 +56,13 @@
CNLINK_CTR_RANAP_TX_UDT_RESET,
CNLINK_CTR_RANAP_TX_UDT_RESET_ACK,

+ /* SCCP Counters: */
+ CNLINK_CTR_SCCP_N_UNITDATA_IND,
+ CNLINK_CTR_SCCP_N_CONNECT_CNF,
+ CNLINK_CTR_SCCP_N_DATA_IND,
+ CNLINK_CTR_SCCP_N_DISCONNECT_IND,
+ CNLINK_CTR_SCCP_N_PCSTATE_IND,
+
/* Counters related to link selection from a CN pool. */
CNLINK_CTR_CNPOOL_SUBSCR_NEW,
CNLINK_CTR_CNPOOL_SUBSCR_REATTACH,
diff --git a/src/osmo-hnbgw/hnbgw_cn.c b/src/osmo-hnbgw/hnbgw_cn.c
index d0a11fd..372116b 100644
--- a/src/osmo-hnbgw/hnbgw_cn.c
+++ b/src/osmo-hnbgw/hnbgw_cn.c
@@ -461,6 +461,28 @@
"RANAP Unitdata RESET ACK messages transmitted",
},

+ /* SCCP Counters: */
+ [CNLINK_CTR_SCCP_N_UNITDATA_IND] = {
+ "sccp:n_unit_data:ind",
+ "Received SCCP N-UNITDATA.ind (DL)"
+ },
+ [CNLINK_CTR_SCCP_N_CONNECT_CNF] = {
+ "sccp:n_connect:cnf",
+ "Received SCCP N-CONNECT.cnf (DL SCCP CC)"
+ },
+ [CNLINK_CTR_SCCP_N_DATA_IND] = {
+ "sccp:n_data:ind",
+ "Received SCCP N-DATA.ind (DL)"
+ },
+ [CNLINK_CTR_SCCP_N_DISCONNECT_IND] = {
+ "sccp:n_disconnect:ind",
+ "Received SCCP N-DATA.ind (DL SCCP RLSD)"
+ },
+ [CNLINK_CTR_SCCP_N_PCSTATE_IND] = {
+ "sccp:n_pcstate:ind",
+ "Received SCCP N-PCSTATE.ind"
+ },
+
/* Indicators for CN pool usage */
[CNLINK_CTR_CNPOOL_SUBSCR_NEW] = {
"cnpool:subscr:new",
diff --git a/src/osmo-hnbgw/hnbgw_sccp.c b/src/osmo-hnbgw/hnbgw_sccp.c
index ba02a5e..999ebde 100644
--- a/src/osmo-hnbgw/hnbgw_sccp.c
+++ b/src/osmo-hnbgw/hnbgw_sccp.c
@@ -100,6 +100,8 @@
if (!cnlink)
return -ENOENT;

+ CNLINK_CTR_INC(cnlink, CNLINK_CTR_SCCP_N_UNITDATA_IND);
+
if (param->called_addr.ssn != OSMO_SCCP_SSN_RANAP) {
LOGP(DCN, LOGL_NOTICE, "N-UNITDATA.ind for unknown SSN %u\n",
param->called_addr.ssn);
@@ -125,6 +127,8 @@
cnlink_sccp_addr_to_str(map->cnlink, &param->calling_addr),
cnlink_sccp_addr_to_str(map->cnlink, &param->responding_addr));

+ CNLINK_CTR_INC(map->cnlink, CNLINK_CTR_SCCP_N_CONNECT_CNF);
+
map_sccp_dispatch(map, MAP_SCCP_EV_RX_CONNECTION_CONFIRM, oph->msg);
return 0;
}
@@ -158,6 +162,8 @@
cnlink_sccp_addr_to_str(map->cnlink, &param->responding_addr),
osmo_sua_sccp_cause_name(param->cause, cause_buf, sizeof(cause_buf)));

+ CNLINK_CTR_INC(map->cnlink, CNLINK_CTR_SCCP_N_DISCONNECT_IND);
+
return map_sccp_dispatch(map, MAP_SCCP_EV_RX_RELEASED, oph->msg);
}

@@ -204,6 +210,8 @@
if (!cnlink)
return;

+ CNLINK_CTR_INC(cnlink, CNLINK_CTR_SCCP_N_PCSTATE_IND);
+
/* See if this marks the point code to have become available, or to have been lost.
*
* I want to detect two events:

To view, visit change 40247. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: Ib4a87aec3d7bb01be833dd33c597a33d9bbad859
Gerrit-Change-Number: 40247
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin@sysmocom.de>