summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2016-05-05 18:46:42 +0200
committerHarald Welte <laforge@gnumonks.org>2016-05-06 11:21:25 +0200
commit48dc1a5a64041e53e7cf7ae39758ed92aecbb6a3 (patch)
treef73e75851f6a023ac89b4881b9edf11cbdf7e63f
parentimport gprs_gsup_message.[ch] from openbsc as gsup.[ch] (diff)
downloadlibosmocore-48dc1a5a64041e53e7cf7ae39758ed92aecbb6a3.tar.xz
libosmocore-48dc1a5a64041e53e7cf7ae39758ed92aecbb6a3.zip
GSUP: Add OSMO_GSUP_CN_DOMAIN_IE to differentiate CS and PS plane
We're starting to use GSUP for circuit-switched (CS) plane, so we need to differentiate the two planes somehow from each other.
-rw-r--r--include/osmocom/gsm/gsup.h7
-rw-r--r--src/gsm/gsup.c9
2 files changed, 16 insertions, 0 deletions
diff --git a/include/osmocom/gsm/gsup.h b/include/osmocom/gsm/gsup.h
index d966b2d2..523c15d4 100644
--- a/include/osmocom/gsm/gsup.h
+++ b/include/osmocom/gsm/gsup.h
@@ -59,6 +59,7 @@ enum osmo_gsup_iei {
OSMO_GSUP_AUTN_IE = 0x25,
OSMO_GSUP_AUTS_IE = 0x26,
OSMO_GSUP_RES_IE = 0x27,
+ OSMO_GSUP_CN_DOMAIN_IE = 0x28,
};
/*! GSUP message type */
@@ -97,6 +98,11 @@ enum osmo_gsup_cancel_type {
OSMO_GSUP_CANCEL_TYPE_WITHDRAW = 2, /* on wire: 1 */
};
+enum osmo_gsup_cn_domain {
+ OSMO_GSUP_CN_DOMAIN_PS = 1,
+ OSMO_GSUP_CN_DOMAIN_CS = 2,
+};
+
/*! parsed/decoded PDP context information */
struct osmo_gsup_pdp_info {
unsigned int context_id;
@@ -132,6 +138,7 @@ struct osmo_gsup_message {
const uint8_t *hlr_enc;
size_t hlr_enc_len;
const uint8_t *auts;
+ enum osmo_gsup_cn_domain cn_domain;
};
int osmo_gsup_decode(const uint8_t *data, size_t data_len,
diff --git a/src/gsm/gsup.c b/src/gsm/gsup.c
index 7a439d48..244c5fa8 100644
--- a/src/gsm/gsup.c
+++ b/src/gsm/gsup.c
@@ -329,6 +329,10 @@ int osmo_gsup_decode(const uint8_t *const_data, size_t data_len,
gsup_msg->hlr_enc_len = value_len;
break;
+ case OSMO_GSUP_CN_DOMAIN_IE:
+ gsup_msg->cn_domain = *value;
+ break;
+
default:
LOGP(DLGSUP, LOGL_NOTICE,
"GSUP IE type %d unknown\n", iei);
@@ -469,4 +473,9 @@ void osmo_gsup_encode(struct msgb *msg, const struct osmo_gsup_message *gsup_msg
if (gsup_msg->auts)
msgb_tlv_put(msg, OSMO_GSUP_AUTS_IE, 16, gsup_msg->auts);
+
+ if (gsup_msg->cn_domain) {
+ uint8_t dn = gsup_msg->cn_domain;
+ msgb_tlv_put(msg, OSMO_GSUP_CN_DOMAIN_IE, 1, &dn);
+ }
}