From 545909d54a0ab0e5f65dad3d536605453e6c62f6 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Wed, 30 Mar 2016 12:44:21 +0200 Subject: sccp_helpers: add convenience function for RANAP unitdata Change-Id: Ie96d78512b8e3907753272d75471b882365968c4 --- include/osmocom/sigtran/sccp_helpers.h | 5 +++++ src/sccp_helpers.c | 15 +++++++++++++++ 2 files changed, 20 insertions(+) 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, -- cgit v1.2.3