aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2023-01-04 16:34:16 +0100
committerPau Espin Pedrol <pespin@sysmocom.de>2023-01-04 19:56:39 +0100
commitfc1a5538d0e155a4bebc6af6c400e7b6a39b4553 (patch)
tree8f2e81f50fbb7ab31175e77b0d03db9b92cb7ae5 /src
parenteb967fccb2f9040459b20fc42ee4c52145a14cb5 (diff)
Replace gprs_str_to_apn() with libosmocore API osmo_apn_from_str()
The exact same function exists in libosmocore with a different naming. Change-Id: Ibef55a648f2d58f4fdd24fa553efde530982af2d
Diffstat (limited to 'src')
-rw-r--r--src/gprs/gprs_utils.c34
1 files changed, 0 insertions, 34 deletions
diff --git a/src/gprs/gprs_utils.c b/src/gprs/gprs_utils.c
index 9fddc73aa..46028c63c 100644
--- a/src/gprs/gprs_utils.c
+++ b/src/gprs/gprs_utils.c
@@ -30,40 +30,6 @@
#include <string.h>
-int gprs_str_to_apn(uint8_t *apn_enc, size_t max_len, const char *str)
-{
- uint8_t *last_len_field;
- int len;
-
- /* Can we even write the length field to the output? */
- if (max_len == 0)
- return -1;
-
- /* Remember where we need to put the length once we know it */
- last_len_field = apn_enc;
- len = 1;
- apn_enc += 1;
-
- while (str[0]) {
- if (len >= max_len)
- return -1;
-
- if (str[0] == '.') {
- *last_len_field = (apn_enc - last_len_field) - 1;
- last_len_field = apn_enc;
- } else {
- *apn_enc = str[0];
- }
- apn_enc += 1;
- str += 1;
- len += 1;
- }
-
- *last_len_field = (apn_enc - last_len_field) - 1;
-
- return len;
-}
-
/* This functions returns a tmr value such that
* - f is monotonic
* - f(s) <= s