aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-04-17 06:30:19 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-04-17 07:31:03 +0200
commitcb8fd6e99e5aa9a4bc6edadf9334de1397c959c0 (patch)
tree8a6b7df92460949aaebe24819cff53d372d40981 /openbsc
parente66bea8ad73e33e5c4ba40009852c49df3beb479 (diff)
Use osmocore tlv definition for GSM0808.
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/include/openbsc/bssap.h2
-rw-r--r--openbsc/src/bssap.c36
-rw-r--r--openbsc/src/nat/bsc_mgcp_utils.c1
-rw-r--r--openbsc/src/nat/bsc_nat_utils.c1
4 files changed, 6 insertions, 34 deletions
diff --git a/openbsc/include/openbsc/bssap.h b/openbsc/include/openbsc/bssap.h
index f32daf006..d3f355a20 100644
--- a/openbsc/include/openbsc/bssap.h
+++ b/openbsc/include/openbsc/bssap.h
@@ -330,6 +330,4 @@ void bts_send_queued(struct bss_sccp_connection_data*);
void bts_free_queued(struct bss_sccp_connection_data*);
void bts_unblock_queue(struct bss_sccp_connection_data*);
-const struct tlv_definition *gsm0808_att_tlvdef();
-
#endif
diff --git a/openbsc/src/bssap.c b/openbsc/src/bssap.c
index 352d34676..004d178d4 100644
--- a/openbsc/src/bssap.c
+++ b/openbsc/src/bssap.c
@@ -29,7 +29,7 @@
#include <openbsc/paging.h>
#include <openbsc/chan_alloc.h>
-#include <osmocore/tlv.h>
+#include <osmocore/gsm0808.h>
#include <sccp/sccp.h>
@@ -44,34 +44,6 @@ static void bts_queue_send(struct msgb *msg, int link_id);
static void bssmap_free_secondary(struct bss_sccp_connection_data *data);
-static const struct tlv_definition bss_att_tlvdef = {
- .def = {
- [GSM0808_IE_IMSI] = { TLV_TYPE_TLV },
- [GSM0808_IE_TMSI] = { TLV_TYPE_TLV },
- [GSM0808_IE_CELL_IDENTIFIER_LIST] = { TLV_TYPE_TLV },
- [GSM0808_IE_CHANNEL_NEEDED] = { TLV_TYPE_TV },
- [GSM0808_IE_EMLPP_PRIORITY] = { TLV_TYPE_TV },
- [GSM0808_IE_CHANNEL_TYPE] = { TLV_TYPE_TLV },
- [GSM0808_IE_PRIORITY] = { TLV_TYPE_TLV },
- [GSM0808_IE_CIRCUIT_IDENTITY_CODE] = { TLV_TYPE_TV },
- [GSM0808_IE_DOWNLINK_DTX_FLAG] = { TLV_TYPE_TV },
- [GSM0808_IE_INTERFERENCE_BAND_TO_USE] = { TLV_TYPE_TV },
- [GSM0808_IE_CLASSMARK_INFORMATION_T2] = { TLV_TYPE_TLV },
- [GSM0808_IE_GROUP_CALL_REFERENCE] = { TLV_TYPE_TLV },
- [GSM0808_IE_TALKER_FLAG] = { TLV_TYPE_T },
- [GSM0808_IE_CONFIG_EVO_INDI] = { TLV_TYPE_TV },
- [GSM0808_IE_LSA_ACCESS_CTRL_SUPPR] = { TLV_TYPE_TV },
- [GSM0808_IE_SERVICE_HANDOVER] = { TLV_TYPE_TV},
- [GSM0808_IE_ENCRYPTION_INFORMATION] = { TLV_TYPE_TLV },
- [GSM0808_IE_CIPHER_RESPONSE_MODE] = { TLV_TYPE_TV },
- },
-};
-
-const struct tlv_definition *gsm0808_att_tlvdef()
-{
- return &bss_att_tlvdef;
-}
-
static u_int16_t get_network_code_for_msc(struct gsm_network *net)
{
if (net->core_network_code > 0)
@@ -112,7 +84,7 @@ static int bssmap_handle_paging(struct gsm_network *net, struct msgb *msg, unsig
u_int8_t chan_needed = RSL_CHANNEED_ANY;
int paged;
- tlv_parse(&tp, &bss_att_tlvdef, msg->l4h + 1, payload_length - 1, 0, 0);
+ tlv_parse(&tp, gsm0808_att_tlvdef(), msg->l4h + 1, payload_length - 1, 0, 0);
if (!TLVP_PRESENT(&tp, GSM0808_IE_IMSI)) {
LOGP(DMSC, LOGL_ERROR, "Mandantory IMSI not present.\n");
@@ -242,7 +214,7 @@ static int bssmap_handle_cipher_mode(struct sccp_connection *conn,
msg->lchan->msc_data->ciphering_handled = 1;
msg->lchan->msc_data->block_gsm = 1;
- tlv_parse(&tp, &bss_att_tlvdef, msg->l4h + 1, payload_length - 1, 0, 0);
+ tlv_parse(&tp, gsm0808_att_tlvdef(), msg->l4h + 1, payload_length - 1, 0, 0);
if (!TLVP_PRESENT(&tp, GSM0808_IE_ENCRYPTION_INFORMATION)) {
LOGP(DMSC, LOGL_ERROR, "IE Encryption Information missing.\n");
goto reject;
@@ -515,7 +487,7 @@ static int bssmap_handle_assignm_req(struct sccp_connection *conn,
msc_data = msg->lchan->msc_data;
network = msg->lchan->ts->trx->bts->network;
- tlv_parse(&tp, &bss_att_tlvdef, msg->l4h + 1, length - 1, 0, 0);
+ tlv_parse(&tp, gsm0808_att_tlvdef(), msg->l4h + 1, length - 1, 0, 0);
if (!TLVP_PRESENT(&tp, GSM0808_IE_CHANNEL_TYPE)) {
LOGP(DMSC, LOGL_ERROR, "Mandantory channel type not present.\n");
diff --git a/openbsc/src/nat/bsc_mgcp_utils.c b/openbsc/src/nat/bsc_mgcp_utils.c
index 6a8693303..30a5a30f7 100644
--- a/openbsc/src/nat/bsc_mgcp_utils.c
+++ b/openbsc/src/nat/bsc_mgcp_utils.c
@@ -27,6 +27,7 @@
#include <openbsc/mgcp_internal.h>
#include <osmocore/talloc.h>
+#include <osmocore/gsm0808.h>
#include <netinet/in.h>
#include <arpa/inet.h>
diff --git a/openbsc/src/nat/bsc_nat_utils.c b/openbsc/src/nat/bsc_nat_utils.c
index 1ec48ee0d..58f933742 100644
--- a/openbsc/src/nat/bsc_nat_utils.c
+++ b/openbsc/src/nat/bsc_nat_utils.c
@@ -30,6 +30,7 @@
#include <osmocore/linuxlist.h>
#include <osmocore/talloc.h>
+#include <osmocore/gsm0808.h>
#include <sccp/sccp.h>