aboutsummaryrefslogtreecommitdiffstats
path: root/sigtran/sua_test_common.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2015-12-22 23:05:10 +0100
committerHarald Welte <laforge@gnumonks.org>2015-12-23 00:04:05 +0100
commit38a4f32d580cda9194d7c0cc9e92cbabd4af568d (patch)
tree258e1a2f0c79ec897035cd94d5ca1749cecdb5ae /sigtran/sua_test_common.c
parent269b8ac7ee49b84bda9ab3d57a37689c08e2fab9 (diff)
remove sigtran code, now part of libosmo-sccp
Diffstat (limited to 'sigtran/sua_test_common.c')
-rw-r--r--sigtran/sua_test_common.c95
1 files changed, 0 insertions, 95 deletions
diff --git a/sigtran/sua_test_common.c b/sigtran/sua_test_common.c
deleted file mode 100644
index a0da4c1..0000000
--- a/sigtran/sua_test_common.c
+++ /dev/null
@@ -1,95 +0,0 @@
-#include "sua_test_common.h"
-
-static const struct log_info_cat log_cat[] = {
- [DMAIN] = {
- .name = "DMAIN", .loglevel = LOGL_DEBUG, .enabled = 1,
- .color = "",
- .description = "Main program",
- },
- [DSUA] = {
- .name = "DSUA", .loglevel = LOGL_DEBUG, .enabled = 1,
- .color = "",
- .description = "SCCP User Adaption",
- },
- [DXUA] = {
- .name = "DXUA", .loglevel = LOGL_DEBUG, .enabled = 1,
- .color = "",
- .description = "X User Adaption encoding/decoding",
- },
-
-};
-
-const struct log_info test_log_info = {
- .cat = log_cat,
- .num_cat = ARRAY_SIZE(log_cat),
-};
-
-int tx_unitdata(struct osmo_sua_link *link)
-{
- struct msgb *msg = msgb_alloc(1024, "tx_unitdata");
- struct osmo_scu_prim *prim;
- struct osmo_scu_unitdata_param *param;
- uint8_t *cur;
-
- 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;
- osmo_prim_init(&prim->oph, SCCP_SAP_USER, OSMO_SCU_PRIM_N_UNITDATA, PRIM_OP_REQUEST, msg);
-
- cur = msg->l2h = msgb_put(msg, 3);
- cur[0] = 1; cur[1] = 2; cur[2] = 3;
-
- return osmo_sua_user_link_down(link, &prim->oph);
-}
-
-static 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;
-}
-
-#define SSN_RANAP 142
-
-struct osmo_prim_hdr *make_conn_req(uint32_t conn_id)
-{
- struct msgb *msg = msgb_alloc(1024, "conn_req");
- struct osmo_scu_prim *prim;
-
- prim = (struct osmo_scu_prim *) msgb_put(msg, sizeof(*prim));
- osmo_prim_init(&prim->oph, SCCP_SAP_USER,
- OSMO_SCU_PRIM_N_CONNECT,
- PRIM_OP_REQUEST, msg);
- /* Set SSN for calling and called addr */
- sccp_make_addr_pc_ssn(&prim->u.connect.called_addr, 2, SSN_RANAP);
- sccp_make_addr_pc_ssn(&prim->u.connect.calling_addr, 1, SSN_RANAP);
- prim->u.connect.sccp_class = 2;
- prim->u.connect.conn_id = conn_id;
-
- return &prim->oph;
-}
-
-int tx_conn_req(struct osmo_sua_link *link, uint32_t conn_id)
-{
- struct osmo_prim_hdr *prim = make_conn_req(conn_id);
- return osmo_sua_user_link_down(link, prim);
-}
-
-struct osmo_prim_hdr *
-make_dt1_req(uint32_t conn_id, const uint8_t *data, unsigned int len)
-{
- struct msgb *msg = msgb_alloc(1024, "dt1");
- struct osmo_scu_prim *prim;
-
- prim = (struct osmo_scu_prim *) msgb_put(msg, sizeof(*prim));
- osmo_prim_init(&prim->oph, SCCP_SAP_USER,
- OSMO_SCU_PRIM_N_DATA,
- PRIM_OP_REQUEST, msg);
- prim->u.data.conn_id = conn_id;
-
- msg->l2h = msgb_put(msg, len);
- memcpy(msg->l2h, data, len);
-
- return &prim->oph;
-}