From eb55c0d4daff3e62c9282077379e4b596f312fd0 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Fri, 7 Jul 2017 16:53:30 +0200 Subject: 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 --- src/gsm/gsup.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/gsm') 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); + } } /*! @} */ -- cgit v1.2.3