daniel has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ggsn/+/35084?usp=email )
Change subject: gtp: Add net GTP cause values and a function to check for success ......................................................................
gtp: Add net GTP cause values and a function to check for success
According to the spec the upf/pgw can accept a modified pdp context from the request e.g. if an ipv4/6 context was requested, but only ipv4 is availiable. Introduce a function that checks all cause values that are considered successful.
See also: 3GPP TS 29.060 Ch 7.3.2
Related: OS#6268 Change-Id: I9c3bf64537ef2223e29f8082861fa32fde26bf68 --- M gtp/gtp.h 1 file changed, 27 insertions(+), 1 deletion(-)
Approvals: Jenkins Builder: Verified daniel: Looks good to me, approved osmith: Looks good to me, but someone else must approve
diff --git a/gtp/gtp.h b/gtp/gtp.h index ede6f73..c066fa6 100644 --- a/gtp/gtp.h +++ b/gtp/gtp.h @@ -103,7 +103,9 @@ #define GTPCAUSE_049 49 /* Cause values reserved for GPRS charging protocol use (See GTP' in GSM 12.15) 49-63 */ #define GTPCAUSE_064 64 /* For future use 64-127 */ #define GTPCAUSE_ACC_REQ 128 /* Request accepted */ -#define GTPCAUSE_129 129 /* For future use 129-176 */ +#define GTPCAUSE_NEW_PDP_NET_PREF 129 /* New PDP type due to network preference */ +#define GTPCAUSE_NEW_PDP_ADDR_BEAR 130 /* New PDP type due to single address bearer only */ +#define GTPCAUSE_131 131 /* For future use 131-176 */ #define GTPCAUSE_177 177 /* Cause values reserved for GPRS charging protocol use (See GTP' In GSM 12.15) 177-191 */ #define GTPCAUSE_NON_EXIST 192 /* Non-existent */ #define GTPCAUSE_INVALID_MESSAGE 193 /* Invalid message format */ @@ -137,6 +139,13 @@ #define GTPCAUSE_221 221 /* For Future Use 221-240 */ #define GTPCAUSE_241 241 /* Cause Values Reserved For Gprs Charging Protocol Use (See Gtp' In Gsm 12.15) 241-255 */
+static inline bool gtp_cause_successful(uint8_t cause) +{ + return cause == GTPCAUSE_ACC_REQ || + cause == GTPCAUSE_NEW_PDP_NET_PREF || + cause == GTPCAUSE_NEW_PDP_ADDR_BEAR; +} + struct ul66_t; struct ul16_t; struct pdp_t;