aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/hnbgw_cn.c8
-rw-r--r--src/sccp_helpers.c22
2 files changed, 13 insertions, 17 deletions
diff --git a/src/hnbgw_cn.c b/src/hnbgw_cn.c
index 8333d78..f94a198 100644
--- a/src/hnbgw_cn.c
+++ b/src/hnbgw_cn.c
@@ -33,8 +33,6 @@
#include "context_map.h"
#include "sccp_helpers.h"
-#define SCCP_SSN_RANAP 143
-
/***********************************************************************
* Outbound RANAP RESET to CN
***********************************************************************/
@@ -243,7 +241,7 @@ static int handle_cn_unitdata(struct hnbgw_cnlink *cnlink,
const struct osmo_scu_unitdata_param *param,
struct osmo_prim_hdr *oph)
{
- if (param->called_addr.ssn != SCCP_SSN_RANAP) {
+ if (param->called_addr.ssn != OSMO_SCCP_SSN_RANAP) {
LOGP(DMAIN, LOGL_NOTICE, "N-UNITDATA.ind for unknown SSN %u\n",
param->called_addr.ssn);
return -1;
@@ -349,8 +347,8 @@ struct hnbgw_cnlink *hnbgw_cnlink_init(struct hnb_gw *gw, const char *host, uint
INIT_LLIST_HEAD(&cnlink->map_list);
cnlink->T_RafC.cb = cnlink_trafc_cb;
cnlink->T_RafC.data = cnlink;
- sccp_make_addr_pc_ssn(&cnlink->local_addr, 2, SCCP_SSN_RANAP);
- sccp_make_addr_pc_ssn(&cnlink->remote_addr, 1, SCCP_SSN_RANAP);
+ sccp_make_addr_pc_ssn(&cnlink->local_addr, 2, OSMO_SCCP_SSN_RANAP);
+ sccp_make_addr_pc_ssn(&cnlink->remote_addr, 1, OSMO_SCCP_SSN_RANAP);
cnlink->sua_user = osmo_sua_user_create(cnlink, sccp_sap_up);
if (!cnlink->sua_user) {
diff --git a/src/sccp_helpers.c b/src/sccp_helpers.c
index ca580ea..cdb26e7 100644
--- a/src/sccp_helpers.c
+++ b/src/sccp_helpers.c
@@ -25,6 +25,13 @@
#include "sccp_helpers.h"
+void sccp_make_addr_pc_ssn(struct osmo_sccp_addr *addr, uint32_t pc, uint32_t ssn)
+{
+ addr->presence = OSMO_SCCP_ADDR_T_SSN | OSMO_SCCP_ADDR_T_PC;
+ addr->ssn = ssn;
+ addr->pc = pc;
+}
+
int sccp_tx_unitdata(struct osmo_sua_link *link,
const struct osmo_sccp_addr *calling_addr,
const struct osmo_sccp_addr *called_addr,
@@ -36,8 +43,8 @@ int sccp_tx_unitdata(struct osmo_sua_link *link,
prim = (struct osmo_scu_prim *) msgb_put(msg, sizeof(*prim));
param = &prim->u.unitdata;
- param->calling_addr.presence = OSMO_SCCP_ADDR_T_SSN;
- param->called_addr.presence = OSMO_SCCP_ADDR_T_SSN;
+ sccp_make_addr_pc_ssn(&param->calling_addr, 1, OSMO_SCCP_SSN_RANAP);
+ sccp_make_addr_pc_ssn(&param->called_addr, 2, OSMO_SCCP_SSN_RANAP);
osmo_prim_init(&prim->oph, SCCP_SAP_USER, OSMO_SCU_PRIM_N_UNITDATA, PRIM_OP_REQUEST, msg);
msg->l2h = msgb_put(msg, len);
@@ -60,15 +67,6 @@ int sccp_tx_unitdata_msg(struct osmo_sua_link *link,
return rc;
}
-
-#define SSN_RANAP 142
-void sccp_make_addr_pc_ssn(struct osmo_sccp_addr *addr, uint32_t pc, uint32_t ssn)
-{
- addr->presence = OSMO_SCCP_ADDR_T_SSN | OSMO_SCCP_ADDR_T_PC;
- addr->ssn = ssn;
- addr->pc = pc;
-}
-
int sccp_tx_conn_req(struct osmo_sua_link *link, uint32_t conn_id,
const struct osmo_sccp_addr *calling_addr,
const struct osmo_sccp_addr *called_addr,
@@ -81,7 +79,7 @@ int sccp_tx_conn_req(struct osmo_sua_link *link, uint32_t conn_id,
osmo_prim_init(&prim->oph, SCCP_SAP_USER,
OSMO_SCU_PRIM_N_CONNECT,
PRIM_OP_REQUEST, msg);
- sccp_make_addr_pc_ssn(&prim->u.connect.calling_addr, 1, SSN_RANAP);
+ sccp_make_addr_pc_ssn(&prim->u.connect.calling_addr, 1, OSMO_SCCP_SSN_RANAP);
prim->u.connect.sccp_class = 2;
prim->u.connect.conn_id = conn_id;