summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-03-30 12:44:21 +0200
committerHarald Welte <laforge@gnumonks.org>2017-02-13 04:09:01 +0100
commit545909d54a0ab0e5f65dad3d536605453e6c62f6 (patch)
treefe04d72d6a97b828ad0aa90332950392e74f5fef
parentbf71df1001fedc90431a17942127e9bca31f4a3c (diff)
sccp_helpers: add convenience function for RANAP unitdatasysmocom/iu
-rw-r--r--include/osmocom/sigtran/sccp_helpers.h5
-rw-r--r--src/sccp_helpers.c15
2 files changed, 20 insertions, 0 deletions
diff --git a/include/osmocom/sigtran/sccp_helpers.h b/include/osmocom/sigtran/sccp_helpers.h
index d5916a9..3384630 100644
--- a/include/osmocom/sigtran/sccp_helpers.h
+++ b/include/osmocom/sigtran/sccp_helpers.h
@@ -17,6 +17,11 @@ int osmo_sccp_tx_unitdata_msg(struct osmo_sccp_link *link,
void osmo_sccp_make_addr_pc_ssn(struct osmo_sccp_addr *addr,
uint32_t pc, uint32_t ssn);
+int osmo_sccp_tx_unitdata_ranap(struct osmo_sccp_link *link,
+ uint32_t src_point_code,
+ uint32_t dst_point_code,
+ uint8_t *data, unsigned int len);
+
int osmo_sccp_tx_conn_req(struct osmo_sccp_link *link, uint32_t conn_id,
const struct osmo_sccp_addr *calling_addr,
const struct osmo_sccp_addr *called_addr,
diff --git a/src/sccp_helpers.c b/src/sccp_helpers.c
index ce9cd06..c6248de 100644
--- a/src/sccp_helpers.c
+++ b/src/sccp_helpers.c
@@ -53,6 +53,21 @@ int osmo_sccp_tx_unitdata(struct osmo_sccp_link *link,
return osmo_sua_user_link_down(link, &prim->oph);
}
+int osmo_sccp_tx_unitdata_ranap(struct osmo_sccp_link *link,
+ uint32_t src_point_code,
+ uint32_t dst_point_code,
+ uint8_t *data, unsigned int len)
+{
+ struct osmo_sccp_addr calling_addr;
+ struct osmo_sccp_addr called_addr;
+ osmo_sccp_make_addr_pc_ssn(&calling_addr, src_point_code,
+ OSMO_SCCP_SSN_RANAP);
+ osmo_sccp_make_addr_pc_ssn(&called_addr, dst_point_code,
+ OSMO_SCCP_SSN_RANAP);
+ return osmo_sccp_tx_unitdata(link, &calling_addr, &called_addr,
+ data, len);
+}
+
int osmo_sccp_tx_unitdata_msg(struct osmo_sccp_link *link,
const struct osmo_sccp_addr *calling_addr,
const struct osmo_sccp_addr *called_addr,