[PATCH] libosmocore[master]: gsup: Add encoding/decoding for the pdp charging characteris...

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Holger Freyther gerrit-no-reply at lists.osmocom.org
Fri Jul 7 19:13:10 UTC 2017


Hello Jenkins Builder,

I'd like you to reexamine a change.  Please visit

    https://gerrit.osmocom.org/3158

to look at the new patch set (#3).

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
---
M include/osmocom/gsm/gsup.h
M src/gsm/gsup.c
M tests/gsup/gsup_test.c
3 files changed, 32 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/58/3158/3

diff --git a/include/osmocom/gsm/gsup.h b/include/osmocom/gsm/gsup.h
index 886ea5d..890bff3 100644
--- a/include/osmocom/gsm/gsup.h
+++ b/include/osmocom/gsm/gsup.h
@@ -51,6 +51,7 @@
 	OSMO_GSUP_PDP_TYPE_IE			= 0x11,
 	OSMO_GSUP_ACCESS_POINT_NAME_IE		= 0x12,
 	OSMO_GSUP_PDP_QOS_IE			= 0x13,
+	OSMO_GSUP_CHARG_CHAR_IE			= 0x14,
 	OSMO_GSUP_RAND_IE			= 0x20,
 	OSMO_GSUP_SRES_IE			= 0x21,
 	OSMO_GSUP_KC_IE				= 0x22,
@@ -127,6 +128,11 @@
 	const uint8_t			*qos_enc;
 	/*! length (in octets) of qos_enc */
 	size_t				qos_enc_len;
+	/*! PDP Charging Characteristics, still in encoded form. Can be NULL if no
+	 * PDP Charging Characteristics */
+	const uint8_t			*pdp_charg_enc;
+	/*! length (in octets) of pdp_charg_enc */
+	size_t				pdp_charg_enc_len;
 };
 
 /*! parsed/decoded GSUP protocol message */
@@ -148,6 +154,8 @@
 	const uint8_t			*auts;
 	const uint8_t			*rand;
 	enum osmo_gsup_cn_domain	cn_domain;
+	const uint8_t			*pdp_charg_enc;
+	size_t				pdp_charg_enc_len;
 };
 
 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 2629eb7..f06e5c8 100644
--- a/src/gsm/gsup.c
+++ b/src/gsm/gsup.c
@@ -103,6 +103,11 @@
 			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 @@
 			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);
@@ -413,6 +423,11 @@
 	if (pdp_info->qos_enc) {
 		msgb_tlv_put(msg, OSMO_GSUP_PDP_QOS_IE,
 				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, pdp_info->pdp_charg_enc_len);
 	}
 
 	/* Update length field */
@@ -540,6 +555,11 @@
 		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, gsup_msg->pdp_charg_enc_len);
+	}
 }
 
 /*! @} */
diff --git a/tests/gsup/gsup_test.c b/tests/gsup/gsup_test.c
index a950ca3..3b360ac 100644
--- a/tests/gsup/gsup_test.c
+++ b/tests/gsup/gsup_test.c
@@ -69,15 +69,18 @@
 		0x09, 0x07, /* HLR-Number of the subscriber */
 			0x91, 0x83, 0x52, 0x38, 0x48, 0x83, 0x93,
 		0x04, 0x00, /* PDP info complete */
-		0x05, 0x15,
+		0x05, 0x19,
 			0x10, 0x01, 0x01,
 			0x11, 0x02, 0xf1, 0x21, /* IPv4 */
 			0x12, 0x09, 0x04, 't', 'e', 's', 't', 0x03, 'a', 'p', 'n',
 			0x13, 0x01, 0x02,
+			0x14, 0x02, 0xFF, 0x23,
 		0x05, 0x11,
 			0x10, 0x01, 0x02,
 			0x11, 0x02, 0xf1, 0x21, /* IPv4 */
 			0x12, 0x08, 0x03, 'f', 'o', 'o', 0x03, 'a', 'p', 'n',
+		0x14, 0x02,
+			0xAE, 0xFF
 	};
 
 	static const uint8_t location_cancellation_req[] = {

-- 
To view, visit https://gerrit.osmocom.org/3158
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Iedc7c02adcf77ca5c9545119e19c968dfbbb3e6b
Gerrit-PatchSet: 3
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Holger Freyther <holger at freyther.de>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list