laforge has submitted this change. (
https://gerrit.osmocom.org/c/osmo-iuh/+/28264 )
Change subject: move new_transp_layer_addr to public API
......................................................................
move new_transp_layer_addr to public API
osmo-hnbgw will use this function in
Ic9bc30f322c4c6c6e82462d1da50cb15b336c63a.
Related: SYS#5859
Change-Id: Icc61620b4d11c4ba6823b40abc7c300f0533c058
---
M include/osmocom/ranap/iu_helpers.h
M src/iu_helpers.c
2 files changed, 5 insertions(+), 4 deletions(-)
Approvals:
Jenkins Builder: Verified
laforge: Looks good to me, approved
diff --git a/include/osmocom/ranap/iu_helpers.h b/include/osmocom/ranap/iu_helpers.h
index bf2a580..3a06c4b 100644
--- a/include/osmocom/ranap/iu_helpers.h
+++ b/include/osmocom/ranap/iu_helpers.h
@@ -20,3 +20,4 @@
RANAP_TransportLayerInformation_t *ranap_new_transp_info_rtp(struct osmo_sockaddr *addr,
bool use_x213_nsap);
RANAP_TransportLayerInformation_t *ranap_new_transp_info_gtp(struct osmo_sockaddr *addr,
uint32_t tei,
bool use_x213_nsap);
+int ranap_new_transp_layer_addr(BIT_STRING_t *out, struct osmo_sockaddr *addr, bool
use_x213_nsap);
diff --git a/src/iu_helpers.c b/src/iu_helpers.c
index 1591f7d..6e2c203 100644
--- a/src/iu_helpers.c
+++ b/src/iu_helpers.c
@@ -143,7 +143,7 @@
if (len == 20 && buf[0] == 0x35) {
/* For an X.213 NSAP encoded address we expect a buffer of exactly 20 bytes (3 bytes
IDP + 17 bytes
* DSP). we also expect AFI = 0x35, which means that two byte IDI and an IP address
follows. (see also
- * comments in function new_transp_layer_addr below) */
+ * comments in function ranap_new_transp_layer_addr below) */
x213_nsap = true;
icp = osmo_load16be(&buf[1]);
switch (icp) {
@@ -176,7 +176,7 @@
return 0;
}
-static int new_transp_layer_addr(BIT_STRING_t *out, struct osmo_sockaddr *addr, bool
use_x213_nsap)
+int ranap_new_transp_layer_addr(BIT_STRING_t *out, struct osmo_sockaddr *addr, bool
use_x213_nsap)
{
uint8_t *buf;
unsigned int len;
@@ -242,7 +242,7 @@
}
tli = CALLOC(1, sizeof(*tli));
- rc = new_transp_layer_addr(&tli->transportLayerAddress, addr, use_x213_nsap);
+ rc = ranap_new_transp_layer_addr(&tli->transportLayerAddress, addr,
use_x213_nsap);
if (rc < 0) {
ASN_STRUCT_FREE(asn_DEF_RANAP_TransportLayerInformation, tli);
return NULL;
@@ -262,7 +262,7 @@
uint32_t binding_buf = htonl(tei);
int rc;
- rc = new_transp_layer_addr(&tli->transportLayerAddress, addr, use_x213_nsap);
+ rc = ranap_new_transp_layer_addr(&tli->transportLayerAddress, addr,
use_x213_nsap);
if (rc < 0) {
ASN_STRUCT_FREE(asn_DEF_RANAP_TransportLayerInformation, tli);
return NULL;
--
To view, visit
https://gerrit.osmocom.org/c/osmo-iuh/+/28264
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Change-Id: Icc61620b4d11c4ba6823b40abc7c300f0533c058
Gerrit-Change-Number: 28264
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged