aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/ipaccess
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@gnumonks.org>2011-04-07 14:15:20 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2011-04-07 23:28:00 +0200
commitc281b4e85abfe615c9cbebfe1c156eb125f5fe21 (patch)
treedb3a5bde0edc014f8ff9d562c9d374cb3d201abe /openbsc/src/ipaccess
parent625295b14f257ba15767f785a76ace1dceab856f (diff)
libabis: ipaccess: export ipaccess_parse_unitid
Now this is used by ipaccess-proxy, remove redundant implementation in it.
Diffstat (limited to 'openbsc/src/ipaccess')
-rw-r--r--openbsc/src/ipaccess/ipaccess-proxy.c41
1 files changed, 2 insertions, 39 deletions
diff --git a/openbsc/src/ipaccess/ipaccess-proxy.c b/openbsc/src/ipaccess/ipaccess-proxy.c
index d2bf599ed..b6dcad120 100644
--- a/openbsc/src/ipaccess/ipaccess-proxy.c
+++ b/openbsc/src/ipaccess/ipaccess-proxy.c
@@ -131,43 +131,6 @@ static int gprs_ns_cb(struct bsc_fd *bfd, unsigned int what);
#define PROXY_ALLOC_SIZE 1200
-static int parse_unitid(const char *str, u_int16_t *site_id, u_int16_t *bts_id,
- u_int16_t *trx_id)
-{
- unsigned long ul;
- char *endptr;
- const char *nptr;
-
- nptr = str;
- ul = strtoul(nptr, &endptr, 10);
- if (endptr <= nptr)
- return -EINVAL;
- if (site_id)
- *site_id = ul & 0xffff;
-
- if (*endptr++ != '/')
- return -EINVAL;
-
- nptr = endptr;
- ul = strtoul(nptr, &endptr, 10);
- if (endptr <= nptr)
- return -EINVAL;
- if (bts_id)
- *bts_id = ul & 0xffff;
-
- if (*endptr++ != '/')
- return -EINVAL;
-
- nptr = endptr;
- ul = strtoul(nptr, &endptr, 10);
- if (endptr <= nptr)
- return -EINVAL;
- if (trx_id)
- *trx_id = ul & 0xffff;
-
- return 0;
-}
-
static struct ipa_bts_conn *find_bts_by_unitid(struct ipa_proxy *ipp,
u_int16_t site_id,
u_int16_t bts_id)
@@ -495,8 +458,8 @@ static int ipaccess_rcvmsg(struct ipa_proxy_conn *ipc, struct msgb *msg,
/* lookup BTS, create sign_link, ... */
site_id = bts_id = trx_id = 0;
- parse_unitid((char *)TLVP_VAL(&tlvp, IPAC_IDTAG_UNIT),
- &site_id, &bts_id, &trx_id);
+ ipaccess_parse_unitid((char *)TLVP_VAL(&tlvp, IPAC_IDTAG_UNIT),
+ &site_id, &bts_id, &trx_id);
ipbc = find_bts_by_unitid(ipp, site_id, bts_id);
if (!ipbc) {
/* We have not found an ipbc (per-bts proxy instance)