summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2018-08-20 12:37:38 +0200
committerNeels Hofmeyr <neels@hofmeyr.de>2018-08-20 12:38:29 +0200
commitcad834f865fe8373251b60cbaf777928ff4d39b1 (patch)
tree12fe7a58c020c01c0cb9ce5d447df682305522fe
parentf34d3374e55592f286b1810017a35d0da58cb5dd (diff)
-rw-r--r--src/ipa.c8
-rw-r--r--src/sccp_scoc.c60
2 files changed, 42 insertions, 26 deletions
diff --git a/src/ipa.c b/src/ipa.c
index dc0c603..c3a2260 100644
--- a/src/ipa.c
+++ b/src/ipa.c
@@ -252,19 +252,21 @@ static int ipa_rx_msg_sccp(struct osmo_ss7_asp *asp, struct msgb *msg)
opc = as->cfg.pc_override.dpc;
/* Destination: PC of the routing key */
dpc = as->cfg.routing_key.pc;
-
- LOGPASP(asp, DLSS7, LOGL_INFO, "Rx message: setting opc=%u dpc=%u\n",
- opc, dpc);
}
+ LOGPASP(asp, DLSS7, LOGL_INFO, "Rx message: opc=%u dpc=%u\n",
+ opc, dpc);
/* Second, patch this into the SCCP message, if they lack PCs */
msg = patch_sccp_with_pc(asp, msg, &opc, &dpc);
+ LOGPASP(asp, DLSS7, LOGL_INFO, "Rx message (2): opc=%u dpc=%u\n",
+ opc, dpc);
/* Third, create a MTP3/M3UA label with those point codes */
memset(&data_hdr, 0, sizeof(data_hdr));
data_hdr.si = MTP_SI_SCCP;
data_hdr.opc = osmo_htonl(opc);
data_hdr.dpc = osmo_htonl(dpc);
+ LOGPASP(asp, DLSS7, LOGL_INFO, "XXXXX %s %u %u\n", __func__, opc, dpc);
/* Create M3UA message in XUA structure */
xua = m3ua_xfer_from_data(&data_hdr, msgb_l2(msg), msgb_l2len(msg));
msgb_free(msg);
diff --git a/src/sccp_scoc.c b/src/sccp_scoc.c
index 3de986d..3bf3ede 100644
--- a/src/sccp_scoc.c
+++ b/src/sccp_scoc.c
@@ -56,6 +56,7 @@
#include <osmocom/sigtran/sccp_sap.h>
#include <osmocom/sigtran/protocol/sua.h>
+#include <osmocom/sigtran/sccp_helpers.h>
#include <sccp/sccp_types.h>
#include "xua_internal.h"
@@ -174,31 +175,31 @@ enum sccp_scoc_event {
static const struct value_string scoc_event_names[] = {
/* Primitives from SCCP-User */
- { SCOC_E_SCU_N_CONN_REQ, "N-CONNECT.req" },
- { SCOC_E_SCU_N_CONN_RESP, "N-CONNECT.resp" },
- { SCOC_E_SCU_N_DISC_REQ, "N-DISCONNECT.req" },
- { SCOC_E_SCU_N_DATA_REQ, "N-DATA.req" },
- { SCOC_E_SCU_N_EXP_DATA_REQ, "N-EXPEDITED_DATA.req" },
+ OSMO_VALUE_STRING( SCOC_E_SCU_N_CONN_REQ),
+ OSMO_VALUE_STRING( SCOC_E_SCU_N_CONN_RESP),
+ OSMO_VALUE_STRING( SCOC_E_SCU_N_DISC_REQ),
+ OSMO_VALUE_STRING( SCOC_E_SCU_N_DATA_REQ),
+ OSMO_VALUE_STRING( SCOC_E_SCU_N_EXP_DATA_REQ),
/* Events from RCOC (Routing for Connection Oriented) */
- { SCOC_E_RCOC_CONN_IND, "RCOC-CONNECT.ind" },
- { SCOC_E_RCOC_ROUT_FAIL_IND, "RCOC-ROUT_FAIL.ind" },
- { SCOC_E_RCOC_RLSD_IND, "RCOC-RELEASED.ind" },
- { SCOC_E_RCOC_REL_COMPL_IND, "RCOC-RELEASE_COMPLETE.ind" },
- { SCOC_E_RCOC_CREF_IND, "RCOC-CONNECT_REFUSED.ind" },
- { SCOC_E_RCOC_CC_IND, "RCOC-CONNECT_CONFIRM.ind" },
- { SCOC_E_RCOC_DT1_IND, "RCOC-DT1.ind" },
- { SCOC_E_RCOC_DT2_IND, "RCOC-DT2.ind" },
- { SCOC_E_RCOC_IT_IND, "RCOC-IT.ind" },
- { SCOC_E_RCOC_OTHER_NPDU, "RCOC-OTHER_NPDU.ind" },
- { SCOC_E_RCOC_ERROR_IND, "RCOC-ERROR.ind" },
-
- { SCOC_E_T_IAR_EXP, "T(iar)_expired" },
- { SCOC_E_T_IAS_EXP, "T(ias)_expired" },
- { SCOC_E_CONN_TMR_EXP, "T(conn)_expired" },
- { SCOC_E_T_REL_EXP, "T(rel)_expired" },
- { SCOC_E_T_INT_EXP, "T(int)_expired" },
- { SCOC_E_T_REP_REL_EXP, "T(rep_rel)_expired" },
+ OSMO_VALUE_STRING( SCOC_E_RCOC_CONN_IND),
+ OSMO_VALUE_STRING( SCOC_E_RCOC_ROUT_FAIL_IND),
+ OSMO_VALUE_STRING( SCOC_E_RCOC_RLSD_IND),
+ OSMO_VALUE_STRING( SCOC_E_RCOC_REL_COMPL_IND),
+ OSMO_VALUE_STRING( SCOC_E_RCOC_CREF_IND),
+ OSMO_VALUE_STRING( SCOC_E_RCOC_CC_IND),
+ OSMO_VALUE_STRING( SCOC_E_RCOC_DT1_IND),
+ OSMO_VALUE_STRING( SCOC_E_RCOC_DT2_IND),
+ OSMO_VALUE_STRING( SCOC_E_RCOC_IT_IND),
+ OSMO_VALUE_STRING( SCOC_E_RCOC_OTHER_NPDU),
+ OSMO_VALUE_STRING( SCOC_E_RCOC_ERROR_IND),
+
+ OSMO_VALUE_STRING( SCOC_E_T_IAR_EXP),
+ OSMO_VALUE_STRING( SCOC_E_T_IAS_EXP),
+ OSMO_VALUE_STRING( SCOC_E_CONN_TMR_EXP),
+ OSMO_VALUE_STRING( SCOC_E_T_REL_EXP),
+ OSMO_VALUE_STRING( SCOC_E_T_INT_EXP),
+ OSMO_VALUE_STRING( SCOC_E_T_REP_REL_EXP),
{ 0, NULL }
};
@@ -599,6 +600,8 @@ static int xua_gen_encode_and_send(struct sccp_connection *conn, uint32_t event,
/* amend this with point code information; Many CO msgs
* includes neither called nor calling party address! */
+ LOGP(DLSCCP, LOGL_ERROR, "XXXXX %s conn->remote_pc %u %p %u\n",
+ __func__, conn->remote_pc, conn, conn->conn_id);
xua->mtp.dpc = conn->remote_pc;
sccp_scrc_rx_scoc_conn_msg(conn->inst, xua);
xua_msg_free(xua);
@@ -723,6 +726,12 @@ static void scoc_fsm_idle(struct osmo_fsm_inst *fi, uint32_t event, void *data)
uconp = &prim->u.connect;
/* copy relevant parameters from prim to conn */
conn->called_addr = uconp->called_addr;
+ if (conn->called_addr.presence & OSMO_SCCP_ADDR_T_PC)
+ conn->remote_pc = conn->called_addr.pc;
+ LOGP(DLSCCP, LOGL_NOTICE,
+ "XXXXX SCOC_E_SCU_N_CONN_REQ conn->called_addr=%s conn->remote_pc=%u %p %u\n",
+ osmo_sccp_addr_dump(&conn->called_addr),
+ conn->remote_pc, conn, conn->conn_id);
conn->calling_addr = uconp->calling_addr;
conn->sccp_class = uconp->sccp_class;
/* generate + send CR PDU to SCRC */
@@ -765,6 +774,11 @@ static void scoc_fsm_idle(struct osmo_fsm_inst *fi, uint32_t event, void *data)
* or by default by the OPC in the MTP label, [and the
* MTP-SAP instance]) is associated with the incoming
* connection section. */
+ LOGP(DLSCCP, LOGL_NOTICE,
+ "XXXXX SCOC_E_RCOC_CONN_IND conn->calling_addr=%s conn->remote_pc=%u %p %u xua->mtp.opc=%u\n",
+ osmo_sccp_addr_dump(&conn->calling_addr),
+ conn->remote_pc, conn, conn->conn_id, xua->mtp.opc);
+
if (conn->calling_addr.presence & OSMO_SCCP_ADDR_T_PC)
conn->remote_pc = conn->calling_addr.pc;
else {