aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/osmo-bsc_nat/bsc_ussd.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2013-04-29 20:40:44 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2013-04-29 20:40:44 +0200
commit7a0010bdd4d8741c591ad40e70798136fee6e18f (patch)
tree8058a73fe6534c7a00b36ab4472c5a1a2d63408b /openbsc/src/osmo-bsc_nat/bsc_ussd.c
parentd7b22c624bb04e585de4f06a3a32b98f45f7e4b8 (diff)
nat: Include LAC/CI as TV values at the end of the 'status' message
Extend the status message and send LAC/CI as part of the status message. It is using TV to allow sending more fields in the feature. We only need to encode the data and this is why there is no tlv description yet.
Diffstat (limited to 'openbsc/src/osmo-bsc_nat/bsc_ussd.c')
-rw-r--r--openbsc/src/osmo-bsc_nat/bsc_ussd.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/openbsc/src/osmo-bsc_nat/bsc_ussd.c b/openbsc/src/osmo-bsc_nat/bsc_ussd.c
index f972ba5ef..59f76e458 100644
--- a/openbsc/src/osmo-bsc_nat/bsc_ussd.c
+++ b/openbsc/src/osmo-bsc_nat/bsc_ussd.c
@@ -38,6 +38,9 @@
#include <string.h>
#include <unistd.h>
+#define USSD_LAC_IE 0
+#define USSD_CI_IE 1
+
static void ussd_auth_con(struct tlv_parsed *, struct bsc_nat_ussd_con *);
static struct bsc_nat_ussd_con *bsc_nat_ussd_alloc(struct bsc_nat *nat)
@@ -292,6 +295,7 @@ static int forward_ussd(struct nat_sccp_connection *con, const struct ussd_reque
struct msgb *msg, *copy;
struct ipac_msgt_sccp_state *state;
struct bsc_nat_ussd_con *ussd;
+ uint16_t lac, ci;
if (!con->bsc->nat->ussd_con)
return -1;
@@ -323,6 +327,12 @@ static int forward_ussd(struct nat_sccp_connection *con, const struct ussd_reque
memcpy(&state->dst_ref, &con->real_ref, sizeof(con->real_ref));
memcpy(state->imsi, con->imsi, strlen(con->imsi));
+ /* add additional tag/values */
+ lac = htons(con->lac);
+ ci = htons(con->ci);
+ msgb_tv_fixed_put(msg, USSD_LAC_IE, sizeof(lac), &lac);
+ msgb_tv_fixed_put(msg, USSD_CI_IE, sizeof(ci), &ci);
+
ussd = con->bsc->nat->ussd_con;
bsc_do_write(&ussd->queue, msg, IPAC_PROTO_IPACCESS);
bsc_do_write(&ussd->queue, copy, IPAC_PROTO_SCCP);