diff options
author | Daniel Willmann <dwillmann@sysmocom.de> | 2023-11-21 17:10:41 +0100 |
---|---|---|
committer | Daniel Willmann <dwillmann@sysmocom.de> | 2023-11-22 12:36:49 +0100 |
commit | a625bdd136a1143e8b5b7453f319dada6de1d17d (patch) | |
tree | bc14fb609fb78e79309e7d2073abb685268f3c0a /gtp | |
parent | 08bb5182a471463e3eaf503ba030948ec84c790d (diff) |
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
Diffstat (limited to 'gtp')
-rw-r--r-- | gtp/gtp.h | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -103,7 +103,9 @@ static inline const char *gtp_type_name(uint8_t val) #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 @@ static inline const char *gtp_type_name(uint8_t val) #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; |