summaryrefslogtreecommitdiffstats
path: root/src/gsm/gsup.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2017-07-07 16:53:30 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2017-07-07 21:54:38 +0200
commiteb55c0d4daff3e62c9282077379e4b596f312fd0 (patch)
tree360f9eb19813260450c1a01cd662ce55c2c4a7e2 /src/gsm/gsup.c
parent639c408ec1325b97a72fba603064265b27687703 (diff)
gsup: Add encoding/decoding for the pdp charging characteristics
These fields can be in the ISD and the PDP Context inofmration. Store pointers to this IE in both cases. It needs to be used by the SGSN when opening a PDP context. Change-Id: Iedc7c02adcf77ca5c9545119e19c968dfbbb3e6b
Diffstat (limited to 'src/gsm/gsup.c')
-rw-r--r--src/gsm/gsup.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/gsm/gsup.c b/src/gsm/gsup.c
index 2629eb75..685c91f4 100644
--- a/src/gsm/gsup.c
+++ b/src/gsm/gsup.c
@@ -103,6 +103,11 @@ static int decode_pdp_info(uint8_t *data, size_t data_len,
pdp_info->qos_enc_len = value_len;
break;
+ case OSMO_GSUP_CHARG_CHAR_IE:
+ pdp_info->pdp_charg_enc = value;
+ pdp_info->pdp_charg_enc_len = value_len;
+ break;
+
default:
LOGP(DLGSUP, LOGL_ERROR,
"GSUP IE type %d not expected in PDP info\n", iei);
@@ -375,6 +380,11 @@ int osmo_gsup_decode(const uint8_t *const_data, size_t data_len,
gsup_msg->cn_domain = *value;
break;
+ case OSMO_GSUP_CHARG_CHAR_IE:
+ gsup_msg->pdp_charg_enc = value;
+ gsup_msg->pdp_charg_enc_len = value_len;
+ break;
+
default:
LOGP(DLGSUP, LOGL_NOTICE,
"GSUP IE type %d unknown\n", iei);
@@ -415,6 +425,11 @@ static void encode_pdp_info(struct msgb *msg, enum osmo_gsup_iei iei,
pdp_info->qos_enc_len, pdp_info->qos_enc);
}
+ if (pdp_info->pdp_charg_enc) {
+ msgb_tlv_put(msg, OSMO_GSUP_CHARG_CHAR_IE,
+ pdp_info->pdp_charg_enc_len, pdp_info->pdp_charg_enc);
+ }
+
/* Update length field */
*len_field = msgb_length(msg) - old_len;
}
@@ -540,6 +555,11 @@ void osmo_gsup_encode(struct msgb *msg, const struct osmo_gsup_message *gsup_msg
uint8_t dn = gsup_msg->cn_domain;
msgb_tlv_put(msg, OSMO_GSUP_CN_DOMAIN_IE, 1, &dn);
}
+
+ if (gsup_msg->pdp_charg_enc) {
+ msgb_tlv_put(msg, OSMO_GSUP_CHARG_CHAR_IE,
+ gsup_msg->pdp_charg_enc_len, gsup_msg->pdp_charg_enc);
+ }
}
/*! @} */