Harald Welte | d27ab24 | 2019-07-26 13:45:18 +0200 | [diff] [blame] | 1 | module DIAMETER_Templates { |
| 2 | |
| 3 | /* (C) 2019 by Harald Welte <laforge@gnumonks.org> |
| 4 | * All rights reserved. |
| 5 | * |
| 6 | * Released under the terms of GNU General Public License, Version 2 or |
| 7 | * (at your option) any later version. |
| 8 | * |
| 9 | * SPDX-License-Identifier: GPL-2.0-or-later |
| 10 | */ |
| 11 | |
| 12 | import from DIAMETER_Types all; |
| 13 | import from Osmocom_Types all; |
Pau Espin Pedrol | 8fa2284 | 2022-05-20 14:47:55 +0200 | [diff] [blame] | 14 | import from Misc_Helpers all; |
Harald Welte | d27ab24 | 2019-07-26 13:45:18 +0200 | [diff] [blame] | 15 | |
| 16 | /* https://www.iana.org/assignments/aaa-parameters/aaa-parameters.xhtml#aaa-parameters-4 */ |
| 17 | type enumerated DIAMETER_Resultcode { |
| 18 | /* Informational */ |
| 19 | DIAMETER_MULTI_ROUND_AUTH (1001), |
| 20 | |
| 21 | /* Success */ |
| 22 | DIAMETER_SUCCESS (2001), |
| 23 | DIAMETER_LIMITED_SUCCESS (2002), |
| 24 | DIAMETER_FIRST_REGISTRATION (2003), |
| 25 | DIAMETER_SUBSEQUENT_REGISTRATION (2004), |
| 26 | DIAMETER_UNREGISTERED_SERVICE (2005), |
| 27 | DIAMETER_SUCCESS_SERVER_NAME_NOT_STORED (2006), |
| 28 | DIAMETER_SERVER_SELECTION (2007), |
| 29 | DIAMETER_SUCCESS_AUTH_SENT_SERVER_NOT_STORED (2008), |
| 30 | DIAMETER_SUCCESS_RELOCATE_HA (2009), |
| 31 | |
| 32 | /* Protocol Errors */ |
| 33 | DIAMETER_COMMAND_UNSUPPORTED (3001), |
| 34 | DIAMETER_UNABLE_TO_DELIVER (3002), |
| 35 | DIAMETER_REALM_NOT_SERVED (3003), |
| 36 | DIAMETER_TOO_BUSY (3004), |
| 37 | DIAMETER_LOOP_DETECTED (3005), |
| 38 | DIAMETER_REDIRECT_INDICATION (3006), |
| 39 | DIAMETER_APPLICATION_UNSUPPORTED (3007), |
| 40 | DIAMETER_INVALID_HDR_BITS (3008), |
| 41 | DIAMETER_INVALID_AVP_BITS (3009), |
| 42 | DIAMETER_UNKNOWN_PEER (3010), |
| 43 | DIAMETER_REALM_REDIRECT_INDICATION (3011), |
| 44 | |
| 45 | /* Transient Failures */ |
| 46 | DIAMETER_AUTHENTICATION_REJECTED (4001), |
| 47 | DIAMETER_OUT_OF_SPACE (4002), |
| 48 | ELECTION_LOST (4003), |
| 49 | DIAMETER_ERROR_MIP_REPLY_FAILURE (4005), |
| 50 | DIAMETER_ERROR_HA_NOT_AVAILABLE (4006), |
| 51 | DIAMETER_ERROR_BAD_KEY (4007), |
| 52 | DIAMETER_ERROR_MIP_FILTER_NOT_SUPPORTED (4008), |
| 53 | DIAMETER_END_USER_SERVICE_DENIED (4010), |
| 54 | DIAMETER_CREDIT_CONTROL_NOT_APPLICABLE (4011), |
| 55 | DIAMETER_CREDIT_LIMIT_REACHED (4012), |
| 56 | DIAMETER_USER_NAME_REQUIRED (4013), |
| 57 | RESOURCE_FAILURE (4014), |
| 58 | |
| 59 | DIAMETER_AUTHENTICATION_DATA_UNAVAILABLE (4181), |
| 60 | DIAMETER_ERROR_CAMEL_SUBSCRIPTION_PRESENT (4882), |
| 61 | |
| 62 | /* Permanent Failure */ |
| 63 | DIAMETER_AVP_UNSUPPORTED (5001), |
| 64 | DIAMETER_UNKNOWN_SESSION_ID (5002), |
| 65 | DIAMETER_AUTHORIZATION_REJECTED (5003), |
| 66 | DIAMETER_INVALID_AVP_VALUE (5004), |
| 67 | DIAMETER_MISSING_AVP (5005), |
| 68 | DIAMETER_RESOURCES_EXCEEDED (5006), |
| 69 | DIAMETER_CONTRADICTING_AVPS (5007), |
| 70 | DIAMETER_AVP_NOT_ALLOWED (5008), |
| 71 | DIAMETER_AVP_OCCURS_TOO_MANY_TIMES (5009), |
| 72 | DIAMETER_NO_COMMON_APPLICATION (5010), |
| 73 | DIAMETER_UNSUPPORTED_VERSION (5011), |
| 74 | DIAMETER_UNABLE_TO_COMPLY (5012), |
| 75 | DIAMETER_INVALID_BIT_IN_HEADER (5013), |
| 76 | DIAMETER_INVALID_AVP_LENGTH (5014), |
| 77 | DIAMETER_INVALID_MESSAGE_LENGTH (5015), |
| 78 | DIAMETER_INVALID_AVP_BIT_COMBO (5016), |
| 79 | DIAMETER_NO_COMMON_SECURITY (5017), |
| 80 | DIAMETER_RADIUS_AVP_UNTRANSLATABLE (5018), |
| 81 | DIAMETER_ERROR_NO_FOREIGN_HA_SERVICE (5024), |
| 82 | DIAMETER_ERROR_END_TO_END_MIP_KEY_ENCRYPTION (5025), |
| 83 | DIAMETER_USER_UNKNOWN (5030), |
| 84 | DIAMETER_RATING_FAILED (5031), |
| 85 | DIAMETER_ERROR_USER_UNKNOWN (5032), |
| 86 | DIAMETER_ERROR_IDENTITIES_DONT_MATCH (5033), |
| 87 | DIAMETER_ERROR_IDENTITY_NOT_REGISTERED (5034), |
| 88 | DIAMETER_ERROR_ROAMING_NOT_ALLOWED (5035), |
| 89 | DIAMETER_ERROR_IDENTITY_ALREADY_REGISTERED (5036), |
| 90 | DIAMETER_ERROR_AUTH_SCHEME_NOT_SUPPORTED (5037), |
| 91 | DIAMETER_ERROR_IN_ASSIGNMENT_TYPE (5038), |
| 92 | DIAMETER_ERROR_TOO_MUCH_DATA (5039), |
| 93 | DIAMETER_ERROR_NOT_SUPPORTED_USER_DATA (5040), |
| 94 | DIAMETER_ERROR_MIP6_AUTH_MODE (5041), |
| 95 | UNKNOWN_BINDING_TEMPLATE_NAME (5042), |
| 96 | BINDING_FAILURE (5043), |
| 97 | MAX_BINDINGS_SET_FAILURE (5044), |
| 98 | MAXIMUM_BINDINGS_REACHED_FOR_ENDPOINT (5045), |
| 99 | SESSION_EXISTS (5046), |
| 100 | INSUFFICIENT_CLASSIFIERS (5047), |
| 101 | DIAMETER_ERROR_EAP_CODE_UNKNOWN (5048) |
| 102 | }; |
| 103 | |
Pau Espin Pedrol | 77fdd0b | 2022-03-08 14:03:33 +0100 | [diff] [blame] | 104 | /* Gy : 3GPP TS 32.299 7.1.6, RFC4006 3.1 */ |
| 105 | const uint32_t c_DIAMETER_CREDIT_CONTROL_AID := 4; |
Harald Welte | d27ab24 | 2019-07-26 13:45:18 +0200 | [diff] [blame] | 106 | /* 3GPP TS 29.272 Section 7.1.8 */ |
Harald Welte | f9fb63e | 2020-04-26 18:07:19 +0200 | [diff] [blame] | 107 | const uint32_t c_DIAMETER_3GPP_Gx_AID := 16777238; |
Harald Welte | d27ab24 | 2019-07-26 13:45:18 +0200 | [diff] [blame] | 108 | const uint32_t c_DIAMETER_3GPP_S6_AID := 16777251; |
| 109 | const uint32_t c_DIAMETER_3GPP_S13_AID := 16777252; |
| 110 | const uint32_t c_DIAMETER_3GPP_S7_AID := 16777308; |
| 111 | |
Vadim Yanitskiy | 0e8f516 | 2021-12-15 05:00:32 +0300 | [diff] [blame] | 112 | const octetstring c_def_sess_id := char2oct("ttcn3.session"); |
| 113 | |
Harald Welte | d27ab24 | 2019-07-26 13:45:18 +0200 | [diff] [blame] | 114 | template (value) PDU_DIAMETER |
| 115 | ts_DIAMETER(template (value) BIT8 flags, |
| 116 | template (value) Command_Code cmd_code, |
| 117 | template (value) OCTET4 app_id := '00000000'O, |
Vadim Yanitskiy | 00720bd | 2021-12-12 02:05:08 +0300 | [diff] [blame] | 118 | template (value) UINT32 hbh_id := '00000000'O, |
| 119 | template (value) UINT32 ete_id := '00000000'O, |
Harald Welte | d27ab24 | 2019-07-26 13:45:18 +0200 | [diff] [blame] | 120 | template (value) AVP_list avps := {} |
| 121 | ) := { |
| 122 | version := 1, |
| 123 | message_length := 0, /* overwritten */ |
| 124 | RPETxxxx := flags, |
| 125 | command_code := cmd_code, |
| 126 | application_id := app_id, |
| 127 | hop_by_hop_id := hbh_id, |
| 128 | end_to_end_id := ete_id, |
| 129 | avps := avps |
| 130 | } |
| 131 | template (present) PDU_DIAMETER |
| 132 | tr_DIAMETER(template (present) BIT8 flags := ?, |
| 133 | template (present) Command_Code cmd_code := ?, |
| 134 | template (present) OCTET4 app_id := ?, |
| 135 | template (present) UINT32 hbh_id := ?, |
| 136 | template (present) UINT32 ete_id := ?, |
| 137 | template (present) AVP_list avps := ?) := { |
| 138 | version := 1, |
| 139 | message_length := ?, |
| 140 | RPETxxxx := flags, |
| 141 | command_code := cmd_code, |
| 142 | application_id := app_id, |
| 143 | hop_by_hop_id := hbh_id, |
| 144 | end_to_end_id := ete_id, |
| 145 | avps := avps |
| 146 | } |
| 147 | template (present) PDU_DIAMETER |
| 148 | tr_DIAMETER_A( |
| 149 | template (present) Command_Code cmd_code := ?, |
| 150 | template (present) OCTET4 app_id := ?, |
| 151 | template (present) UINT32 hbh_id := ?, |
| 152 | template (present) UINT32 ete_id := ?, |
| 153 | template (present) AVP_list avps := ?) := |
| 154 | tr_DIAMETER('0???????'B, cmd_code, app_id, hbh_id, ete_id, avps); |
| 155 | template (present) PDU_DIAMETER |
| 156 | tr_DIAMETER_R( |
| 157 | template (present) Command_Code cmd_code := ?, |
| 158 | template (present) OCTET4 app_id := ?, |
| 159 | template (present) UINT32 hbh_id := ?, |
| 160 | template (present) UINT32 ete_id := ?, |
| 161 | template (present) AVP_list avps := ?) := |
| 162 | tr_DIAMETER('1???????'B, cmd_code, app_id, hbh_id, ete_id, avps); |
| 163 | |
| 164 | |
| 165 | template (value) AVP_Header |
| 166 | ts_DIA_Hdr(template (value) AVP_Code avp_code, |
| 167 | template (value) BIT8 flags := '01000000'B) := { |
| 168 | avp_code := avp_code, |
| 169 | VMPxxxxx := flags, |
| 170 | avp_length := 0, /* overwritten */ |
| 171 | vendor_id := omit |
| 172 | } |
| 173 | template (present) AVP_Header |
| 174 | tr_DIA_Hdr(template (present) AVP_Code avp_code, |
| 175 | template (present) BIT8 flags := '0???????'B) := { |
| 176 | avp_code := avp_code, |
| 177 | VMPxxxxx := flags, |
| 178 | avp_length := ?, /* overwritten */ |
| 179 | vendor_id := omit |
| 180 | } |
| 181 | |
| 182 | template (value) AVP_Header |
| 183 | ts_DIA_Hdr_3GPP(template (value) AVP_Code avp_code, |
| 184 | template (value) BIT8 flags := '11000000'B) := { |
| 185 | avp_code := avp_code, |
| 186 | VMPxxxxx := flags, |
| 187 | avp_length := 0, /* overwritten */ |
| 188 | vendor_id := vendor_id_3GPP |
| 189 | } |
| 190 | template (present) AVP_Header |
| 191 | tr_DIA_Hdr_3GPP(template (present) AVP_Code avp_code, |
| 192 | template (present) BIT8 flags := '1???????'B) := { |
| 193 | avp_code := avp_code, |
| 194 | VMPxxxxx := flags, |
| 195 | avp_length := ?, /* overwritten */ |
| 196 | vendor_id := vendor_id_3GPP |
| 197 | } |
| 198 | |
Pau Espin Pedrol | a2af578 | 2022-05-18 16:34:29 +0200 | [diff] [blame] | 199 | template (present) AVP_Address tr_AVP_Address(template (present) AddressType addr_type := ?, |
| 200 | template (present) octetstring addr_data := ?) := { |
| 201 | address_type := addr_type, |
| 202 | address_data := addr_data |
| 203 | } |
| 204 | |
| 205 | template (present) GenericAVP tr_AVP_SubcrId(template (present) DCC_NONE_Subscription_Id t) := { |
| 206 | avp := { |
| 207 | avp_header := tr_DIA_Hdr(c_AVP_Code_DCC_NONE_Subscription_Id), |
| 208 | avp_data := { |
| 209 | avp_DCC_NONE_Subscription_Id := t |
| 210 | } |
| 211 | } |
| 212 | } |
| 213 | |
Pau Espin Pedrol | b8cd34a | 2022-05-18 16:34:12 +0200 | [diff] [blame] | 214 | template (present) GenericAVP tr_AVP_SubcrIdType(template (present) DCC_NONE_Subscription_Id_Type t) := { |
Harald Welte | f9fb63e | 2020-04-26 18:07:19 +0200 | [diff] [blame] | 215 | avp := { |
| 216 | avp_header := tr_DIA_Hdr(c_AVP_Code_DCC_NONE_Subscription_Id_Type), |
| 217 | avp_data := { |
| 218 | avp_DCC_NONE_Subscription_Id_Type := t |
| 219 | } |
| 220 | } |
| 221 | } |
Harald Welte | d27ab24 | 2019-07-26 13:45:18 +0200 | [diff] [blame] | 222 | |
Pau Espin Pedrol | a2af578 | 2022-05-18 16:34:29 +0200 | [diff] [blame] | 223 | template (present) GenericAVP tr_AVP_SubcrIdData(template (present) DCC_NONE_Subscription_Id_Data t) := { |
| 224 | avp := { |
| 225 | avp_header := tr_DIA_Hdr(c_AVP_Code_DCC_NONE_Subscription_Id_Data), |
| 226 | avp_data := { |
| 227 | avp_DCC_NONE_Subscription_Id_Data := t |
| 228 | } |
| 229 | } |
| 230 | } |
| 231 | |
| 232 | template (present) GenericAVP tr_AVP_RequestedAction(template (present) DCC_NONE_Requested_Action t := ?) := { |
| 233 | avp := { |
| 234 | avp_header := tr_DIA_Hdr(c_AVP_Code_DCC_NONE_Requested_Action), |
| 235 | avp_data := { |
| 236 | avp_DCC_NONE_Requested_Action := t |
| 237 | } |
| 238 | } |
| 239 | } |
| 240 | |
| 241 | template (present) GenericAVP tr_AVP_MultipleServicesIndicator(template (present) DCC_NONE_Multiple_Services_Indicator t := ?) := { |
| 242 | avp := { |
| 243 | avp_header := tr_DIA_Hdr(c_AVP_Code_DCC_NONE_Multiple_Services_Indicator), |
| 244 | avp_data := { |
| 245 | avp_DCC_NONE_Multiple_Services_Indicator := t |
| 246 | } |
| 247 | } |
| 248 | } |
| 249 | |
| 250 | template (present) GenericAVP tr_AVP_ServiceContextId(template (present) DCC_NONE_Service_Context_Id id := ?) := { |
| 251 | avp := { |
| 252 | avp_header := tr_DIA_Hdr(c_AVP_Code_DCC_NONE_Service_Context_Id), |
| 253 | avp_data := { |
| 254 | avp_DCC_NONE_Service_Context_Id := id |
| 255 | } |
| 256 | } |
| 257 | } |
| 258 | |
Harald Welte | d27ab24 | 2019-07-26 13:45:18 +0200 | [diff] [blame] | 259 | template (value) GenericAVP ts_AVP_OriginHost(template (value) charstring host) := { |
| 260 | avp := { |
| 261 | avp_header := ts_DIA_Hdr(c_AVP_Code_BASE_NONE_Origin_Host), |
| 262 | avp_data := { |
| 263 | avp_BASE_NONE_Origin_Host := host |
| 264 | } |
| 265 | } |
| 266 | } |
| 267 | template (present) GenericAVP tr_AVP_OriginHost(template (present) charstring host := ?) := { |
| 268 | avp := { |
| 269 | avp_header := tr_DIA_Hdr(c_AVP_Code_BASE_NONE_Origin_Host), |
| 270 | avp_data := { |
| 271 | avp_BASE_NONE_Origin_Host := host |
| 272 | } |
| 273 | } |
| 274 | } |
| 275 | |
| 276 | |
| 277 | template (value) GenericAVP ts_AVP_OriginRealm(template (value) charstring realm) := { |
| 278 | avp := { |
| 279 | avp_header := ts_DIA_Hdr(c_AVP_Code_BASE_NONE_Origin_Realm), |
| 280 | avp_data := { |
| 281 | avp_BASE_NONE_Origin_Realm := realm |
| 282 | } |
| 283 | } |
| 284 | } |
| 285 | template (present) GenericAVP tr_AVP_OriginRealm(template (present) charstring realm := ?) := { |
| 286 | avp := { |
| 287 | avp_header := tr_DIA_Hdr(c_AVP_Code_BASE_NONE_Origin_Realm), |
| 288 | avp_data := { |
| 289 | avp_BASE_NONE_Origin_Realm := realm |
| 290 | } |
| 291 | } |
| 292 | } |
| 293 | |
| 294 | |
| 295 | template (value) GenericAVP ts_AVP_OriginStateId(template (value) OCTET4 state_id) := { |
| 296 | avp := { |
| 297 | avp_header := ts_DIA_Hdr(c_AVP_Code_BASE_NONE_Origin_State_Id), |
| 298 | avp_data := { |
| 299 | avp_BASE_NONE_Origin_State_Id := state_id |
| 300 | } |
| 301 | } |
| 302 | } |
Vadim Yanitskiy | f28b255 | 2021-12-11 03:49:14 +0300 | [diff] [blame] | 303 | template (present) GenericAVP tr_AVP_OriginStateId(template (present) OCTET4 state_id := ?) := { |
| 304 | avp := { |
| 305 | avp_header := tr_DIA_Hdr(c_AVP_Code_BASE_NONE_Origin_State_Id), |
| 306 | avp_data := { |
| 307 | avp_BASE_NONE_Origin_State_Id := state_id |
| 308 | } |
| 309 | } |
| 310 | } |
Harald Welte | d27ab24 | 2019-07-26 13:45:18 +0200 | [diff] [blame] | 311 | |
Pau Espin Pedrol | a2af578 | 2022-05-18 16:34:29 +0200 | [diff] [blame] | 312 | template (present) GenericAVP tr_AVP_TerminationCause(template (present) BASE_NONE_Termination_Cause tc) := { |
| 313 | avp := { |
| 314 | avp_header := tr_DIA_Hdr(c_AVP_Code_BASE_NONE_Termination_Cause), |
| 315 | avp_data := { |
| 316 | avp_BASE_NONE_Termination_Cause := tc |
| 317 | } |
| 318 | } |
| 319 | } |
| 320 | |
Harald Welte | d27ab24 | 2019-07-26 13:45:18 +0200 | [diff] [blame] | 321 | template (value) GenericAVP ts_AVP_HostIpAddr(template (value) OCTET4 ipv4_addr) := { |
| 322 | avp := { |
| 323 | avp_header := ts_DIA_Hdr(c_AVP_Code_BASE_NONE_Host_IP_Address), |
| 324 | avp_data := { |
| 325 | avp_BASE_NONE_Host_IP_Address := { |
| 326 | address_type := IP, |
| 327 | address_data := ipv4_addr |
| 328 | } |
| 329 | } |
| 330 | } |
| 331 | } |
| 332 | |
| 333 | template (value) GenericAVP ts_AVP_VendorId(Vendor_Id vendor_id) := { |
| 334 | avp := { |
| 335 | avp_header := ts_DIA_Hdr(c_AVP_Code_BASE_NONE_Vendor_Id, '00000000'B), |
| 336 | avp_data := { |
| 337 | avp_BASE_NONE_Vendor_Id := int2oct(enum2int(vendor_id), 4) |
| 338 | } |
| 339 | } |
| 340 | } |
| 341 | |
| 342 | template (value) GenericAVP ts_AVP_ProductName(charstring name) := { |
| 343 | avp := { |
| 344 | avp_header := ts_DIA_Hdr(c_AVP_Code_BASE_NONE_Product_Name, '00000000'B), |
| 345 | avp_data := { |
| 346 | avp_BASE_NONE_Product_Name := char2oct(name) |
| 347 | } |
| 348 | } |
| 349 | } |
| 350 | |
| 351 | template (value) GenericAVP ts_AVP_FwRevision(octetstring fw_version) := { |
| 352 | avp := { |
| 353 | avp_header := ts_DIA_Hdr(c_AVP_Code_BASE_NONE_Firmware_Revision, '00000000'B), |
| 354 | avp_data := { |
| 355 | avp_BASE_NONE_Firmware_Revision := fw_version |
| 356 | } |
| 357 | } |
| 358 | } |
| 359 | |
| 360 | template (value) GenericAVP ts_AVP_InbSecId(template (value) OCTET4 inb_sec_id) := { |
| 361 | avp := { |
| 362 | avp_header := ts_DIA_Hdr(c_AVP_Code_BASE_NONE_Inband_Security_Id), |
| 363 | avp_data := { |
| 364 | avp_BASE_NONE_Inband_Security_Id := inb_sec_id |
| 365 | } |
| 366 | } |
| 367 | } |
| 368 | |
| 369 | template (value) GenericAVP ts_AVP_VendorSpecAppId(Vendor_Id vendor_id, uint32_t auth_app_id) := { |
| 370 | avp := { |
| 371 | avp_header := ts_DIA_Hdr(c_AVP_Code_BASE_NONE_Vendor_Specific_Application_Id), |
| 372 | avp_data := { |
| 373 | avp_BASE_NONE_Vendor_Specific_Application_Id := { |
| 374 | { |
| 375 | avp := { |
| 376 | avp_header := ts_DIA_Hdr(c_AVP_Code_BASE_NONE_Vendor_Id), |
| 377 | avp_data := { |
| 378 | avp_BASE_NONE_Vendor_Id := int2oct(enum2int(vendor_id), 4) |
| 379 | } |
| 380 | } |
| 381 | }, { |
| 382 | avp := { |
| 383 | avp_header := ts_DIA_Hdr(c_AVP_Code_BASE_NONE_Auth_Application_Id), |
| 384 | avp_data := { |
| 385 | avp_BASE_NONE_Auth_Application_Id := int2oct(auth_app_id, 4) |
| 386 | } |
| 387 | } |
| 388 | } |
| 389 | } |
| 390 | } |
| 391 | } |
| 392 | } |
| 393 | |
| 394 | template (value) GenericAVP ts_AVP_AuthAppId(template (value) OCTET4 auth_app_id) := { |
| 395 | avp := { |
| 396 | avp_header := ts_DIA_Hdr(c_AVP_Code_BASE_NONE_Auth_Application_Id), |
| 397 | avp_data := { |
| 398 | avp_BASE_NONE_Auth_Application_Id := auth_app_id |
| 399 | } |
| 400 | } |
| 401 | } |
Harald Welte | f400151 | 2020-04-26 21:48:34 +0200 | [diff] [blame] | 402 | template (present) GenericAVP tr_AVP_AuthAppId(template (present) OCTET4 auth_app_id := ?) := { |
| 403 | avp := { |
| 404 | avp_header := tr_DIA_Hdr(c_AVP_Code_BASE_NONE_Auth_Application_Id), |
| 405 | avp_data := { |
| 406 | avp_BASE_NONE_Auth_Application_Id := auth_app_id |
| 407 | } |
| 408 | } |
| 409 | } |
| 410 | |
| 411 | template (value) GenericAVP ts_AVP_CcReqType(template (value) DCC_NONE_CC_Request_Type r) := { |
| 412 | avp := { |
| 413 | avp_header := ts_DIA_Hdr(c_AVP_Code_DCC_NONE_CC_Request_Type), |
| 414 | avp_data := { |
| 415 | avp_DCC_NONE_CC_Request_Type := r |
| 416 | } |
| 417 | } |
| 418 | } |
| 419 | template (present) GenericAVP tr_AVP_CcReqType(template (present) DCC_NONE_CC_Request_Type r := ?) := { |
| 420 | avp := { |
| 421 | avp_header := tr_DIA_Hdr(c_AVP_Code_DCC_NONE_CC_Request_Type), |
| 422 | avp_data := { |
| 423 | avp_DCC_NONE_CC_Request_Type := r |
| 424 | } |
| 425 | } |
| 426 | } |
| 427 | |
| 428 | template (value) GenericAVP ts_AVP_CcReqNum(template (value) AVP_Unsigned32 n) := { |
| 429 | avp := { |
| 430 | avp_header := ts_DIA_Hdr(c_AVP_Code_DCC_NONE_CC_Request_Number), |
| 431 | avp_data := { |
| 432 | avp_DCC_NONE_CC_Request_Number := n |
| 433 | } |
| 434 | } |
| 435 | } |
| 436 | template (present) GenericAVP tr_AVP_CcReqNum(template (present) AVP_Unsigned32 n := ?) := { |
| 437 | avp := { |
| 438 | avp_header := tr_DIA_Hdr(c_AVP_Code_DCC_NONE_CC_Request_Number), |
| 439 | avp_data := { |
| 440 | avp_DCC_NONE_CC_Request_Number := n |
| 441 | } |
| 442 | } |
| 443 | } |
| 444 | |
Pau Espin Pedrol | a2af578 | 2022-05-18 16:34:29 +0200 | [diff] [blame] | 445 | template (present) GenericAVP tr_AVP_EventTimestamp(template (present) AVP_Unsigned32 n := ?) := { |
| 446 | avp := { |
| 447 | avp_header := tr_DIA_Hdr(c_AVP_Code_BASE_NONE_Event_Timestamp), |
| 448 | avp_data := { |
| 449 | avp_BASE_NONE_Event_Timestamp := n |
| 450 | } |
| 451 | } |
| 452 | } |
Harald Welte | f400151 | 2020-04-26 21:48:34 +0200 | [diff] [blame] | 453 | |
Harald Welte | d27ab24 | 2019-07-26 13:45:18 +0200 | [diff] [blame] | 454 | |
| 455 | template (value) GenericAVP ts_AVP_SuppVendorIdRaw(uint32_t vendor_id) := { |
| 456 | avp := { |
| 457 | avp_header := ts_DIA_Hdr(c_AVP_Code_BASE_NONE_Supported_Vendor_Id), |
| 458 | avp_data := { |
| 459 | avp_BASE_NONE_Supported_Vendor_Id := int2oct(vendor_id, 4) |
| 460 | } |
| 461 | } |
| 462 | } |
| 463 | template (value) GenericAVP ts_AVP_SuppVendorId(Vendor_Id vendor_id) := |
| 464 | ts_AVP_SuppVendorIdRaw(enum2int(vendor_id)); |
| 465 | |
| 466 | template (value) GenericAVP ts_AVP_ResultCode(DIAMETER_Resultcode res_code) := { |
| 467 | avp := { |
| 468 | avp_header := ts_DIA_Hdr(c_AVP_Code_BASE_NONE_Result_Code), |
| 469 | avp_data := { |
| 470 | avp_BASE_NONE_Result_Code := int2oct(enum2int(res_code), 4) |
| 471 | } |
| 472 | } |
| 473 | } |
Vadim Yanitskiy | f28b255 | 2021-12-11 03:49:14 +0300 | [diff] [blame] | 474 | template (present) GenericAVP tr_AVP_ResultCode(DIAMETER_Resultcode res_code) := { |
| 475 | avp := { |
| 476 | avp_header := tr_DIA_Hdr(c_AVP_Code_BASE_NONE_Result_Code), |
| 477 | avp_data := { |
| 478 | avp_BASE_NONE_Result_Code := int2oct(enum2int(res_code), 4) |
| 479 | } |
| 480 | } |
| 481 | } |
Harald Welte | d27ab24 | 2019-07-26 13:45:18 +0200 | [diff] [blame] | 482 | |
| 483 | template (value) GenericAVP ts_AVP_AuthSessionState(template (value) BASE_NONE_Auth_Session_State ass := NO_STATE_MAINTAINED) := { |
| 484 | avp := { |
| 485 | avp_header := ts_DIA_Hdr(c_AVP_Code_BASE_NONE_Auth_Session_State), |
| 486 | avp_data := { |
| 487 | avp_BASE_NONE_Auth_Session_State := ass |
| 488 | } |
| 489 | } |
| 490 | } |
| 491 | template (present) GenericAVP tr_AVP_AuthSessionState(template (present) BASE_NONE_Auth_Session_State ass := ?) := { |
| 492 | avp := { |
| 493 | avp_header := tr_DIA_Hdr(c_AVP_Code_BASE_NONE_Auth_Session_State), |
| 494 | avp_data := { |
| 495 | avp_BASE_NONE_Auth_Session_State := ass |
| 496 | } |
| 497 | } |
| 498 | } |
| 499 | |
| 500 | template (value) GenericAVP ts_AVP_SessionId(template (value) octetstring session_id) := { |
| 501 | avp := { |
| 502 | avp_header := ts_DIA_Hdr(c_AVP_Code_BASE_NONE_Session_Id), |
| 503 | avp_data := { |
| 504 | avp_BASE_NONE_Session_Id := session_id |
| 505 | } |
| 506 | } |
| 507 | } |
| 508 | template (present) GenericAVP tr_AVP_SessionId(template (present) octetstring session_id := ?) := { |
| 509 | avp := { |
| 510 | avp_header := tr_DIA_Hdr(c_AVP_Code_BASE_NONE_Session_Id), |
| 511 | avp_data := { |
| 512 | avp_BASE_NONE_Session_Id := session_id |
| 513 | } |
| 514 | } |
| 515 | } |
| 516 | |
Pau Espin Pedrol | a2af578 | 2022-05-18 16:34:29 +0200 | [diff] [blame] | 517 | template (present) GenericAVP tr_AVP_DestinationHost(template (present) charstring host := ?) := { |
| 518 | avp := { |
| 519 | avp_header := tr_DIA_Hdr(c_AVP_Code_BASE_NONE_Destination_Host), |
| 520 | avp_data := { |
| 521 | avp_BASE_NONE_Destination_Host := host |
| 522 | } |
| 523 | } |
| 524 | } |
| 525 | |
Harald Welte | d27ab24 | 2019-07-26 13:45:18 +0200 | [diff] [blame] | 526 | /* 3.3 Destination Realm */ |
| 527 | template (value) GenericAVP ts_AVP_DestinationRealm(template (value) charstring dest_realm) := { |
| 528 | avp := { |
| 529 | avp_header := ts_DIA_Hdr(c_AVP_Code_BASE_NONE_Destination_Realm), |
| 530 | avp_data := { |
| 531 | avp_BASE_NONE_Destination_Realm := dest_realm |
| 532 | } |
| 533 | } |
| 534 | } |
| 535 | template (present) GenericAVP tr_AVP_DestinationRealm(template (present) charstring dest_realm := ?) := { |
| 536 | avp := { |
| 537 | avp_header := tr_DIA_Hdr(c_AVP_Code_BASE_NONE_Destination_Realm), |
| 538 | avp_data := { |
| 539 | avp_BASE_NONE_Destination_Realm := dest_realm |
| 540 | } |
| 541 | } |
| 542 | } |
| 543 | |
| 544 | /* 8.14 User-Name */ |
| 545 | template (value) GenericAVP ts_AVP_UserName(template (value) octetstring uid) := { |
| 546 | avp := { |
| 547 | avp_header := ts_DIA_Hdr(c_AVP_Code_BASE_NONE_User_Name), |
| 548 | avp_data := { |
| 549 | avp_BASE_NONE_User_Name := uid |
| 550 | } |
| 551 | } |
| 552 | } |
| 553 | template (present) GenericAVP tr_AVP_UserName(template (present) octetstring uid := ?) := { |
| 554 | avp := { |
| 555 | avp_header := tr_DIA_Hdr(c_AVP_Code_BASE_NONE_User_Name), |
| 556 | avp_data := { |
| 557 | avp_BASE_NONE_User_Name := uid |
| 558 | } |
| 559 | } |
| 560 | } |
| 561 | template (value) GenericAVP ts_AVP_UserNameImsi(hexstring imsi) := ts_AVP_UserName(char2oct(hex2str(imsi))); |
| 562 | template (present) GenericAVP tr_AVP_UserNameImsi(hexstring imsi) := tr_AVP_UserName(char2oct(hex2str(imsi))); |
| 563 | |
| 564 | |
| 565 | |
Harald Welte | 40b1e00 | 2023-01-27 17:26:39 +0100 | [diff] [blame] | 566 | /* TS 29.272 7.3.53 RAND */ |
Harald Welte | d27ab24 | 2019-07-26 13:45:18 +0200 | [diff] [blame] | 567 | template (value) GenericAVP ts_AVP_RAND(template (value) octetstring rand) := { |
| 568 | avp := { |
| 569 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_RAND), |
| 570 | avp_data := { |
| 571 | avp_AAA_3GPP_RAND := rand |
| 572 | } |
| 573 | } |
| 574 | } |
| 575 | |
Harald Welte | 40b1e00 | 2023-01-27 17:26:39 +0100 | [diff] [blame] | 576 | /* TS 29.272 7.3.54 XRES */ |
Harald Welte | d27ab24 | 2019-07-26 13:45:18 +0200 | [diff] [blame] | 577 | template (value) GenericAVP ts_AVP_XRES(template (value) octetstring xres) := { |
| 578 | avp := { |
| 579 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_XRES), |
| 580 | avp_data := { |
| 581 | avp_AAA_3GPP_XRES := xres |
| 582 | } |
| 583 | } |
| 584 | } |
| 585 | |
Harald Welte | 40b1e00 | 2023-01-27 17:26:39 +0100 | [diff] [blame] | 586 | /* TS 29.272 7.3.55 XRES */ |
Harald Welte | d27ab24 | 2019-07-26 13:45:18 +0200 | [diff] [blame] | 587 | template (value) GenericAVP ts_AVP_AUTN(template (value) octetstring autn) := { |
| 588 | avp := { |
| 589 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_AUTN), |
| 590 | avp_data := { |
| 591 | avp_AAA_3GPP_AUTN := autn |
| 592 | } |
| 593 | } |
| 594 | } |
| 595 | |
Harald Welte | 40b1e00 | 2023-01-27 17:26:39 +0100 | [diff] [blame] | 596 | /* TS 29.272 7.3.56 KASME */ |
Harald Welte | d27ab24 | 2019-07-26 13:45:18 +0200 | [diff] [blame] | 597 | template (value) GenericAVP ts_AVP_KASME(template (value) octetstring kasme) := { |
| 598 | avp := { |
| 599 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_KASME), |
| 600 | avp_data := { |
| 601 | avp_AAA_3GPP_KASME := kasme |
| 602 | } |
| 603 | } |
| 604 | } |
| 605 | |
Harald Welte | 40b1e00 | 2023-01-27 17:26:39 +0100 | [diff] [blame] | 606 | /* TS 29.272 7.3.23 Item-Number */ |
Harald Welte | d27ab24 | 2019-07-26 13:45:18 +0200 | [diff] [blame] | 607 | template (value) GenericAVP ts_AVP_ItemNumber(uint32_t num) := { |
| 608 | avp := { |
| 609 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_KASME), |
| 610 | avp_data := { |
| 611 | avp_AAA_3GPP_Item_Number := int2oct(num, 4) |
| 612 | } |
| 613 | } |
| 614 | } |
| 615 | |
Harald Welte | 40b1e00 | 2023-01-27 17:26:39 +0100 | [diff] [blame] | 616 | /* TS 29.272 7.3.18 E-UTRAN Vector */ |
Harald Welte | d27ab24 | 2019-07-26 13:45:18 +0200 | [diff] [blame] | 617 | template (value) GenericAVP ts_AVP_EutranVec(uint32_t item_num, octetstring rand, octetstring xres, |
| 618 | octetstring autn, octetstring kasme) := { |
| 619 | avp := { |
| 620 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_E_UTRAN_Vector), |
| 621 | avp_data := { |
| 622 | avp_AAA_3GPP_E_UTRAN_Vector := { |
| 623 | ts_AVP_ItemNumber(item_num), |
| 624 | ts_AVP_RAND(rand), |
| 625 | ts_AVP_XRES(xres), |
| 626 | ts_AVP_AUTN(autn), |
| 627 | ts_AVP_KASME(kasme) |
| 628 | } |
| 629 | } |
| 630 | } |
| 631 | } |
| 632 | |
Harald Welte | 40b1e00 | 2023-01-27 17:26:39 +0100 | [diff] [blame] | 633 | /* TS 29.272 7.3.2 Subscription-Data */ |
Harald Welte | d27ab24 | 2019-07-26 13:45:18 +0200 | [diff] [blame] | 634 | template (value) GenericAVP ts_AVP_3GPP_SubscriptionData(template (value) AVP_list content) := { |
| 635 | avp := { |
| 636 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Subscription_Data), |
| 637 | avp_data := { |
| 638 | avp_AAA_3GPP_Subscription_Data := content |
| 639 | } |
| 640 | } |
| 641 | } |
Vadim Yanitskiy | 5e1bdc0 | 2021-12-12 02:33:59 +0300 | [diff] [blame] | 642 | template (present) GenericAVP |
| 643 | tr_AVP_3GPP_SubscriptionData(template (present) AVP_list content := ?) := { |
| 644 | avp := { |
| 645 | avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Subscription_Data), |
| 646 | avp_data := { |
| 647 | avp_AAA_3GPP_Subscription_Data := content |
| 648 | } |
| 649 | } |
| 650 | } |
Harald Welte | d27ab24 | 2019-07-26 13:45:18 +0200 | [diff] [blame] | 651 | |
| 652 | |
Harald Welte | 40b1e00 | 2023-01-27 17:26:39 +0100 | [diff] [blame] | 653 | /* TS 29.272 7.3.17 Authentication-Info */ |
Harald Welte | d27ab24 | 2019-07-26 13:45:18 +0200 | [diff] [blame] | 654 | template (value) GenericAVP ts_AVP_3GPP_AuthInfo(template (value) AVP_list content) := { |
| 655 | avp := { |
| 656 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Authentication_Info), |
| 657 | avp_data := { |
| 658 | avp_AAA_3GPP_Authentication_Info := content |
| 659 | } |
| 660 | } |
| 661 | } |
Vadim Yanitskiy | 446edae | 2021-12-12 04:33:08 +0300 | [diff] [blame] | 662 | template (present) GenericAVP |
| 663 | tr_AVP_3GPP_AuthInfo(template (present) AVP_list content := ?) := { |
| 664 | avp := { |
| 665 | avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Authentication_Info), |
| 666 | avp_data := { |
| 667 | avp_AAA_3GPP_Authentication_Info := content |
| 668 | } |
| 669 | } |
| 670 | } |
Harald Welte | d27ab24 | 2019-07-26 13:45:18 +0200 | [diff] [blame] | 671 | |
Harald Welte | 40b1e00 | 2023-01-27 17:26:39 +0100 | [diff] [blame] | 672 | /* TS 29.272 7.3.9 Visited-PLMN-Id */ |
Harald Welte | d27ab24 | 2019-07-26 13:45:18 +0200 | [diff] [blame] | 673 | template (value) GenericAVP ts_AVP_3GPP_VisitedPlmnId(template (value) octetstring id) := { |
| 674 | avp := { |
| 675 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Visited_PLMN_Id), |
| 676 | avp_data := { |
| 677 | avp_AAA_3GPP_Visited_PLMN_Id := id |
| 678 | } |
| 679 | } |
| 680 | } |
| 681 | template (present) GenericAVP tr_AVP_3GPP_VisitedPlmnId(template (present) octetstring id := ?) := { |
| 682 | avp := { |
| 683 | avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Visited_PLMN_Id), |
| 684 | avp_data := { |
| 685 | avp_AAA_3GPP_Visited_PLMN_Id := id |
| 686 | } |
| 687 | } |
| 688 | } |
| 689 | |
Harald Welte | 40b1e00 | 2023-01-27 17:26:39 +0100 | [diff] [blame] | 690 | /* TS 29.272 7.3.13 RAT-Type */ |
Pau Espin Pedrol | a2af578 | 2022-05-18 16:34:29 +0200 | [diff] [blame] | 691 | template (value) GenericAVP ts_AVP_PCC_3GPP_RatType(template (value) PCC_3GPP_RAT_Type rat_type) := { |
Harald Welte | d27ab24 | 2019-07-26 13:45:18 +0200 | [diff] [blame] | 692 | avp := { |
| 693 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_PCC_3GPP_RAT_Type), |
| 694 | avp_data := { |
| 695 | avp_PCC_3GPP_RAT_Type := rat_type |
| 696 | } |
| 697 | } |
| 698 | } |
Pau Espin Pedrol | a2af578 | 2022-05-18 16:34:29 +0200 | [diff] [blame] | 699 | template (present) GenericAVP tr_AVP_PCC_3GPP_RatType(template (present) PCC_3GPP_RAT_Type rat_type := ?) := { |
Harald Welte | d27ab24 | 2019-07-26 13:45:18 +0200 | [diff] [blame] | 700 | avp := { |
| 701 | avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_PCC_3GPP_RAT_Type), |
| 702 | avp_data := { |
| 703 | avp_PCC_3GPP_RAT_Type := rat_type |
| 704 | } |
| 705 | } |
| 706 | } |
| 707 | |
Pau Espin Pedrol | a2af578 | 2022-05-18 16:34:29 +0200 | [diff] [blame] | 708 | template (present) GenericAVP tr_AVP_GI_3GPP_RatType(template (present) GI_3GPP_3GPP_RAT_Type rat_type := ?) := { |
| 709 | avp := { |
| 710 | avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_GI_3GPP_3GPP_RAT_Type), |
| 711 | avp_data := { |
| 712 | avp_GI_3GPP_3GPP_RAT_Type := rat_type |
| 713 | } |
| 714 | } |
| 715 | } |
| 716 | |
Harald Welte | 40b1e00 | 2023-01-27 17:26:39 +0100 | [diff] [blame] | 717 | /* TS 29.272 7.3.7 ULR-Flags */ |
Harald Welte | d27ab24 | 2019-07-26 13:45:18 +0200 | [diff] [blame] | 718 | template (value) GenericAVP ts_AVP_3GPP_UlrFlags(template (value) UINT32 flags) := { |
| 719 | avp := { |
| 720 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_ULR_Flags), |
| 721 | avp_data := { |
| 722 | avp_AAA_3GPP_ULR_Flags := flags |
| 723 | } |
| 724 | } |
| 725 | } |
| 726 | template (present) GenericAVP tr_AVP_3GPP_UlrFlags(template (present) UINT32 flags := ?) := { |
| 727 | avp := { |
| 728 | avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_ULR_Flags), |
| 729 | avp_data := { |
| 730 | avp_AAA_3GPP_ULR_Flags := flags |
| 731 | } |
| 732 | } |
| 733 | } |
| 734 | |
Harald Welte | 40b1e00 | 2023-01-27 17:26:39 +0100 | [diff] [blame] | 735 | /* TS 29.272 7.3.8 ULA-Flags */ |
Harald Welte | d27ab24 | 2019-07-26 13:45:18 +0200 | [diff] [blame] | 736 | template (value) GenericAVP ts_AVP_3GPP_UlaFlags(template (value) UINT32 flags) := { |
| 737 | avp := { |
| 738 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_ULA_Flags), |
| 739 | avp_data := { |
| 740 | avp_AAA_3GPP_ULA_Flags := flags |
| 741 | } |
| 742 | } |
| 743 | } |
| 744 | template (present) GenericAVP tr_AVP_3GPP_UlaFlags(template (present) UINT32 flags := ?) := { |
| 745 | avp := { |
| 746 | avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_ULA_Flags), |
| 747 | avp_data := { |
| 748 | avp_AAA_3GPP_ULA_Flags := flags |
| 749 | } |
| 750 | } |
| 751 | } |
| 752 | |
Harald Welte | 6effabb | 2020-02-18 21:39:59 +0100 | [diff] [blame] | 753 | |
| 754 | |
| 755 | template (value) GenericAVP ts_AVP_NumOfReqVectors(template (value) UINT32 num_req := '00000004'O) := { |
| 756 | avp := { |
| 757 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Number_Of_Requested_Vectors), |
| 758 | avp_data := { |
| 759 | avp_AAA_3GPP_Number_Of_Requested_Vectors := num_req |
| 760 | } |
| 761 | } |
| 762 | } |
| 763 | |
| 764 | template (value) GenericAVP ts_AVP_ImmReqPref(template (value) UINT32 par := '00000000'O) := { |
| 765 | avp := { |
| 766 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Immediate_Response_Preferred), |
| 767 | avp_data := { |
| 768 | avp_AAA_3GPP_Immediate_Response_Preferred := par |
| 769 | } |
| 770 | } |
| 771 | } |
| 772 | |
| 773 | |
| 774 | /* 7.3.11 Requested-EUTRAN-Authentication-Info */ |
| 775 | template (value) GenericAVP ts_AVP_RequestedEutranAuthInfo(template (value) UINT32 num_vec := '00000004'O) := { |
| 776 | avp := { |
| 777 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Requested_EUTRAN_Authentication_Info), |
| 778 | avp_data := { |
| 779 | avp_AAA_3GPP_Requested_EUTRAN_Authentication_Info := { |
| 780 | ts_AVP_NumOfReqVectors(num_vec), |
| 781 | ts_AVP_ImmReqPref('00000000'O) |
| 782 | } |
| 783 | } |
| 784 | } |
| 785 | } |
| 786 | |
| 787 | |
Harald Welte | 40b1e00 | 2023-01-27 17:26:39 +0100 | [diff] [blame] | 788 | /* TS 29.272 7.3.27 Context-Identifier */ |
Harald Welte | d27ab24 | 2019-07-26 13:45:18 +0200 | [diff] [blame] | 789 | template (value) GenericAVP ts_AVP_3GPP_ContextId(uint32_t ctx) := { |
| 790 | avp := { |
| 791 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Context_Identifier), |
| 792 | avp_data := { |
| 793 | avp_AAA_3GPP_Context_Identifier := int2oct(ctx, 4) |
| 794 | } |
| 795 | } |
| 796 | } |
| 797 | |
Harald Welte | 40b1e00 | 2023-01-27 17:26:39 +0100 | [diff] [blame] | 798 | /* Ts 29.272 7.3.29 Subscriber-Status */ |
Harald Welte | d27ab24 | 2019-07-26 13:45:18 +0200 | [diff] [blame] | 799 | template (value) GenericAVP ts_AVP_3GPP_SubscriberStatus(template (value) AAA_3GPP_Subscriber_Status sts) := { |
| 800 | avp := { |
| 801 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Subscriber_Status), |
| 802 | avp_data := { |
| 803 | avp_AAA_3GPP_Subscriber_Status := sts |
| 804 | } |
| 805 | } |
| 806 | } |
| 807 | |
| 808 | template (value) GenericAVP ts_AVP_3GPP_SubscrRauTauTmr(uint32_t tmr) := { |
| 809 | avp := { |
| 810 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Subscribed_Periodic_RAU_TAU_Timer), |
| 811 | avp_data := { |
| 812 | avp_AAA_3GPP_Subscribed_Periodic_RAU_TAU_Timer := int2oct(tmr, 4) |
| 813 | } |
| 814 | } |
| 815 | } |
| 816 | |
Harald Welte | 40b1e00 | 2023-01-27 17:26:39 +0100 | [diff] [blame] | 817 | /* TS 29.272 7.3.33 All-APN-Configurations-Included-Indicator */ |
Harald Welte | d27ab24 | 2019-07-26 13:45:18 +0200 | [diff] [blame] | 818 | template (value) GenericAVP ts_AVP_3GPP_AllApnConfigsIncl(template (value) AAA_3GPP_All_APN_Configurations_Included_Indicator ind := All_APN_CONFIGURATIONS_INCLUDED) := { |
| 819 | avp := { |
| 820 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_All_APN_Configurations_Included_Indicator), |
| 821 | avp_data := { |
| 822 | avp_AAA_3GPP_All_APN_Configurations_Included_Indicator := ind |
| 823 | } |
| 824 | } |
| 825 | } |
| 826 | |
Harald Welte | 40b1e00 | 2023-01-27 17:26:39 +0100 | [diff] [blame] | 827 | /* TS 29.272 7.3.34 APN-Configuration-Profile */ |
Harald Welte | d27ab24 | 2019-07-26 13:45:18 +0200 | [diff] [blame] | 828 | template (value) GenericAVP ts_AVP_3GPP_ApnConfigProfile(template (value) AVP_list content) := { |
| 829 | avp := { |
| 830 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_APN_Configuration_Profile), |
| 831 | avp_data := { |
| 832 | avp_AAA_3GPP_APN_Configuration_Profile := content |
| 833 | } |
| 834 | } |
| 835 | } |
| 836 | |
Harald Welte | 40b1e00 | 2023-01-27 17:26:39 +0100 | [diff] [blame] | 837 | /* TS 29.272 7.3.35 APN-Configuration */ |
Harald Welte | d27ab24 | 2019-07-26 13:45:18 +0200 | [diff] [blame] | 838 | template (value) GenericAVP ts_AVP_3GPP_ApnConfig(uint32_t ctx, AAA_3GPP_PDN_Type pdn_type, |
| 839 | charstring apn) := { |
| 840 | avp := { |
| 841 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_APN_Configuration_Profile), |
| 842 | avp_data := { |
| 843 | avp_AAA_3GPP_APN_Configuration := { |
| 844 | ts_AVP_3GPP_ContextId(ctx), |
| 845 | ts_AVP_3GPP_PdnType(pdn_type), |
| 846 | ts_AVP_3GPP_EpsSubscrQosProfile(1, 1), |
| 847 | ts_AVP_ServiceSelection(apn) |
| 848 | } |
| 849 | } |
| 850 | } |
| 851 | } |
| 852 | |
Harald Welte | 40b1e00 | 2023-01-27 17:26:39 +0100 | [diff] [blame] | 853 | /* TS 29.272 7.3.36 Service-Selection (refers to RFC 5778) */ |
Harald Welte | d27ab24 | 2019-07-26 13:45:18 +0200 | [diff] [blame] | 854 | template (value) GenericAVP ts_AVP_ServiceSelection(charstring apn) := { |
| 855 | avp := { |
| 856 | avp_header := ts_DIA_Hdr(c_AVP_Code_MIPv6_NONE_Service_Selection), |
| 857 | avp_data := { |
| 858 | avp_MIPv6_NONE_Service_Selection := char2oct(apn) |
| 859 | } |
| 860 | } |
| 861 | } |
| 862 | |
Pau Espin Pedrol | 6477d73 | 2022-06-03 12:04:40 +0200 | [diff] [blame] | 863 | template (present) GenericAVP tr_AVP_PCC_3GPP_QoS_Information(template (present) AVP_list list := ?) := { |
Pau Espin Pedrol | a2af578 | 2022-05-18 16:34:29 +0200 | [diff] [blame] | 864 | avp := { |
| 865 | avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_PCC_3GPP_QoS_Information), |
| 866 | avp_data := { |
| 867 | avp_PCC_3GPP_QoS_Information := list |
| 868 | } |
| 869 | } |
| 870 | } |
| 871 | |
Pau Espin Pedrol | 6477d73 | 2022-06-03 12:04:40 +0200 | [diff] [blame] | 872 | template (value) GenericAVP ts_AVP_PCC_3GPP_QoS_Information(template (value) AVP_list list) := { |
| 873 | avp := { |
| 874 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_PCC_3GPP_QoS_Information), |
| 875 | avp_data := { |
| 876 | avp_PCC_3GPP_QoS_Information := list |
| 877 | } |
| 878 | } |
| 879 | } |
| 880 | |
| 881 | template (value) GenericAVP ts_AVP_PCC_3GPP_APN_Aggregate_Max_Bitrate_DL(uint32_t val) := { |
| 882 | avp := { |
| 883 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_PCC_3GPP_APN_Aggregate_Max_Bitrate_DL), |
| 884 | avp_data := { |
| 885 | avp_PCC_3GPP_APN_Aggregate_Max_Bitrate_DL := int2oct(val, 4) |
| 886 | } |
| 887 | } |
| 888 | } |
| 889 | |
| 890 | template (value) GenericAVP ts_AVP_PCC_3GPP_APN_Aggregate_Max_Bitrate_UL(uint32_t val) := { |
| 891 | avp := { |
| 892 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_PCC_3GPP_APN_Aggregate_Max_Bitrate_UL), |
| 893 | avp_data := { |
| 894 | avp_PCC_3GPP_APN_Aggregate_Max_Bitrate_UL := int2oct(val, 4) |
| 895 | } |
| 896 | } |
| 897 | } |
| 898 | |
| 899 | template (value) GenericAVP ts_AVP_PCC_3GPP_Default_EPS_Bearer_QoS(template (value) AVP_list list) := { |
| 900 | avp := { |
| 901 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_PCC_3GPP_Default_EPS_Bearer_QoS), |
| 902 | avp_data := { |
| 903 | avp_PCC_3GPP_Default_EPS_Bearer_QoS := list |
| 904 | } |
| 905 | } |
| 906 | } |
| 907 | |
| 908 | template (value) GenericAVP ts_AVP_PCC_3GPP_QoS_Class_Identifier(uint32_t val) := { |
Harald Welte | d27ab24 | 2019-07-26 13:45:18 +0200 | [diff] [blame] | 909 | avp := { |
| 910 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_PCC_3GPP_QoS_Class_Identifier), |
| 911 | avp_data := { |
Pau Espin Pedrol | 6477d73 | 2022-06-03 12:04:40 +0200 | [diff] [blame] | 912 | avp_PCC_3GPP_QoS_Class_Identifier := int2oct(val, 4) |
Harald Welte | d27ab24 | 2019-07-26 13:45:18 +0200 | [diff] [blame] | 913 | } |
| 914 | } |
| 915 | } |
| 916 | |
| 917 | template (value) GenericAVP ts_AVP_3GPP_PriorityLevel(uint32_t prio) := { |
| 918 | avp := { |
| 919 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_PCC_3GPP_Priority_Level), |
| 920 | avp_data := { |
| 921 | avp_PCC_3GPP_Priority_Level := int2oct(prio, 4) |
| 922 | } |
| 923 | } |
| 924 | } |
| 925 | |
Pau Espin Pedrol | 6477d73 | 2022-06-03 12:04:40 +0200 | [diff] [blame] | 926 | template (value) GenericAVP ts_AVP_PCC_3GPP_AllocRetenPrio(uint32_t prio) := { |
Harald Welte | d27ab24 | 2019-07-26 13:45:18 +0200 | [diff] [blame] | 927 | avp := { |
| 928 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_PCC_3GPP_Allocation_Retention_Priority), |
| 929 | avp_data := { |
| 930 | avp_PCC_3GPP_Allocation_Retention_Priority := { |
| 931 | ts_AVP_3GPP_PriorityLevel(prio) |
| 932 | /* pre-emption capability */ |
| 933 | /* pre-emption vulnerability */ |
| 934 | } |
| 935 | } |
| 936 | } |
| 937 | } |
| 938 | |
| 939 | template (value) GenericAVP ts_AVP_3GPP_EpsSubscrQosProfile(uint32_t qos_class, uint32_t prio) := { |
| 940 | avp := { |
| 941 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_EPS_Subscribed_QoS_Profile), |
| 942 | avp_data := { |
| 943 | avp_AAA_3GPP_EPS_Subscribed_QoS_Profile := { |
Pau Espin Pedrol | 6477d73 | 2022-06-03 12:04:40 +0200 | [diff] [blame] | 944 | ts_AVP_PCC_3GPP_QoS_Class_Identifier(qos_class), |
| 945 | ts_AVP_PCC_3GPP_AllocRetenPrio(prio) |
Harald Welte | d27ab24 | 2019-07-26 13:45:18 +0200 | [diff] [blame] | 946 | } |
| 947 | } |
| 948 | } |
| 949 | } |
| 950 | |
| 951 | |
Harald Welte | 40b1e00 | 2023-01-27 17:26:39 +0100 | [diff] [blame] | 952 | /* TS 29.272 7.3.41 AMBR */ |
Harald Welte | d27ab24 | 2019-07-26 13:45:18 +0200 | [diff] [blame] | 953 | template (value) GenericAVP ts_AVP_3GPP_AMBR(uint32_t ul, uint32_t dl) := { |
| 954 | avp := { |
| 955 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_AMBR), |
| 956 | avp_data := { |
| 957 | avp_AAA_3GPP_AMBR := { |
| 958 | ts_AVP_3GPP_MaxReqBwUL(ul), |
| 959 | ts_AVP_3GPP_MaxReqBwDL(dl) |
| 960 | } |
| 961 | } |
| 962 | } |
| 963 | } |
| 964 | |
| 965 | template (value) GenericAVP ts_AVP_3GPP_MaxReqBwUL(uint32_t bw) := { |
| 966 | avp := { |
| 967 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_RX_3GPP_Max_Requested_Bandwidth_UL), |
| 968 | avp_data := { |
| 969 | avp_RX_3GPP_Max_Requested_Bandwidth_UL := int2oct(bw, 4) |
| 970 | } |
| 971 | } |
| 972 | } |
| 973 | |
| 974 | template (value) GenericAVP ts_AVP_3GPP_MaxReqBwDL(uint32_t bw) := { |
| 975 | avp := { |
| 976 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_RX_3GPP_Max_Requested_Bandwidth_DL), |
| 977 | avp_data := { |
| 978 | avp_RX_3GPP_Max_Requested_Bandwidth_DL := int2oct(bw, 4) |
| 979 | } |
| 980 | } |
| 981 | } |
| 982 | |
Pau Espin Pedrol | a2af578 | 2022-05-18 16:34:29 +0200 | [diff] [blame] | 983 | template (present) GenericAVP tr_AVP_3GPP_Reporting_Reason(template (present) DCA_3GPP_Reporting_Reason r := ?) := { |
| 984 | avp := { |
| 985 | avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_DCA_3GPP_Reporting_Reason), |
| 986 | avp_data := { |
| 987 | avp_DCA_3GPP_Reporting_Reason := r |
| 988 | } |
| 989 | } |
| 990 | } |
Harald Welte | d27ab24 | 2019-07-26 13:45:18 +0200 | [diff] [blame] | 991 | |
Pau Espin Pedrol | a2af578 | 2022-05-18 16:34:29 +0200 | [diff] [blame] | 992 | template (present) GenericAVP tr_AVP_3GPP_AoCRequestType(template (present) DCA_3GPP_AoC_Request_Type t := ?) := { |
| 993 | avp := { |
| 994 | avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_DCA_3GPP_AoC_Request_Type), |
| 995 | avp_data := { |
| 996 | avp_DCA_3GPP_AoC_Request_Type := t |
| 997 | } |
| 998 | } |
| 999 | } |
| 1000 | |
| 1001 | template (present) GenericAVP tr_AVP_3GPP_ServiceInformation(template (present) AVP_list content := ?) := { |
| 1002 | avp := { |
| 1003 | avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_DCA_3GPP_Service_Information), |
| 1004 | avp_data := { |
| 1005 | avp_DCA_3GPP_Service_Information := content |
| 1006 | } |
| 1007 | } |
| 1008 | } |
| 1009 | |
| 1010 | template (present) GenericAVP tr_AVP_3GPP_PSInformation(template (present) AVP_list content := ?) := { |
| 1011 | avp := { |
| 1012 | avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_DCA_3GPP_PS_Information), |
| 1013 | avp_data := { |
| 1014 | avp_DCA_3GPP_PS_Information := content |
| 1015 | } |
| 1016 | } |
| 1017 | } |
| 1018 | |
| 1019 | template (present) GenericAVP tr_AVP_3GPP_ChargingId(template (present) AVP_OctetString id := ?) := { |
| 1020 | avp := { |
| 1021 | avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_GI_3GPP_3GPP_Charging_Id), |
| 1022 | avp_data := { |
| 1023 | avp_GI_3GPP_3GPP_Charging_Id := id |
| 1024 | } |
| 1025 | } |
| 1026 | } |
| 1027 | |
| 1028 | template (present) GenericAVP tr_AVP_3GPP_PDPType(template (present) GI_3GPP_3GPP_PDP_Type t := ?) := { |
| 1029 | avp := { |
| 1030 | avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_GI_3GPP_3GPP_PDP_Type), |
| 1031 | avp_data := { |
| 1032 | avp_GI_3GPP_3GPP_PDP_Type := t |
| 1033 | } |
| 1034 | } |
| 1035 | } |
| 1036 | |
| 1037 | template (present) GenericAVP tr_AVP_3GPP_PDPAddress(template (present) DCA_3GPP_PDP_Address addr := ?) := { |
| 1038 | avp := { |
| 1039 | avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_DCA_3GPP_PDP_Address), |
| 1040 | avp_data := { |
| 1041 | avp_DCA_3GPP_PDP_Address := addr |
| 1042 | } |
| 1043 | } |
| 1044 | } |
| 1045 | |
| 1046 | template (present) GenericAVP tr_AVP_3GPP_SGSNAddress(template (present) DCA_3GPP_SGSN_Address addr := ?) := { |
| 1047 | avp := { |
| 1048 | avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_DCA_3GPP_SGSN_Address), |
| 1049 | avp_data := { |
| 1050 | avp_DCA_3GPP_SGSN_Address := addr |
| 1051 | } |
| 1052 | } |
| 1053 | } |
| 1054 | |
| 1055 | template (present) GenericAVP tr_AVP_3GPP_GGSNAddress(template (present) DCA_3GPP_GGSN_Address addr := ?) := { |
| 1056 | avp := { |
| 1057 | avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_DCA_3GPP_GGSN_Address), |
| 1058 | avp_data := { |
| 1059 | avp_DCA_3GPP_GGSN_Address := addr |
| 1060 | } |
| 1061 | } |
| 1062 | } |
| 1063 | |
| 1064 | template (present) GenericAVP tr_AVP_3GPP_SelectionMode(template (present) GI_3GPP_3GPP_Selection_Mode sm := ?) := { |
| 1065 | avp := { |
| 1066 | avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_GI_3GPP_3GPP_Selection_Mode), |
| 1067 | avp_data := { |
| 1068 | avp_GI_3GPP_3GPP_Selection_Mode := sm |
| 1069 | } |
| 1070 | } |
| 1071 | } |
| 1072 | |
| 1073 | template (present) GenericAVP tr_AVP_3GPP_ChargingCharacteristics(template (present) GI_3GPP_3GPP_Charging_Characteristics cc := ?) := { |
| 1074 | avp := { |
| 1075 | avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_GI_3GPP_3GPP_Charging_Characteristics), |
| 1076 | avp_data := { |
| 1077 | avp_GI_3GPP_3GPP_Charging_Characteristics := cc |
| 1078 | } |
| 1079 | } |
| 1080 | } |
| 1081 | |
| 1082 | template (present) GenericAVP tr_AVP_3GPP_SGSNMCCMNC(template (present) GI_3GPP_3GPP_SGSN_MCC_MNC smn := ?) := { |
| 1083 | avp := { |
| 1084 | avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_GI_3GPP_3GPP_SGSN_MCC_MNC), |
| 1085 | avp_data := { |
| 1086 | avp_GI_3GPP_3GPP_SGSN_MCC_MNC := smn |
| 1087 | } |
| 1088 | } |
| 1089 | } |
| 1090 | |
| 1091 | template (present) GenericAVP tr_AVP_3GPP_NSAPI(template (present) GI_3GPP_3GPP_NSAPI nsapi := ?) := { |
| 1092 | avp := { |
| 1093 | avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_GI_3GPP_3GPP_NSAPI), |
| 1094 | avp_data := { |
| 1095 | avp_GI_3GPP_3GPP_NSAPI := nsapi |
| 1096 | } |
| 1097 | } |
| 1098 | } |
| 1099 | |
| 1100 | template (present) GenericAVP tr_AVP_3GPP_MS_TimeZone(template (present) GI_3GPP_3GPP_MS_TimeZone ms_tz := ?) := { |
| 1101 | avp := { |
| 1102 | avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_GI_3GPP_3GPP_MS_TimeZone), |
| 1103 | avp_data := { |
| 1104 | avp_GI_3GPP_3GPP_MS_TimeZone := ms_tz |
| 1105 | } |
| 1106 | } |
| 1107 | } |
| 1108 | |
| 1109 | template (present) GenericAVP tr_AVP_3GPP_ULI(template (present) GI_3GPP_3GPP_User_Location_Info uli := ?) := { |
| 1110 | avp := { |
| 1111 | avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_GI_3GPP_3GPP_User_Location_Info), |
| 1112 | avp_data := { |
| 1113 | avp_GI_3GPP_3GPP_User_Location_Info := uli |
| 1114 | } |
| 1115 | } |
| 1116 | } |
| 1117 | |
| 1118 | template (present) GenericAVP tr_AVP_UserEquipmentInfo(template (present) DCC_NONE_User_Equipment_Info uei := ?) := { |
| 1119 | avp := { |
| 1120 | avp_header := tr_DIA_Hdr(c_AVP_Code_DCC_NONE_User_Equipment_Info), |
| 1121 | avp_data := { |
| 1122 | avp_DCC_NONE_User_Equipment_Info := uei |
| 1123 | } |
| 1124 | } |
| 1125 | } |
| 1126 | |
| 1127 | template (present) GenericAVP tr_AVP_UserEquipmentInfoType(template (present) DCC_NONE_User_Equipment_Info_Type ueit := ?) := { |
| 1128 | avp := { |
| 1129 | avp_header := tr_DIA_Hdr(c_AVP_Code_DCC_NONE_User_Equipment_Info_Type), |
| 1130 | avp_data := { |
| 1131 | avp_DCC_NONE_User_Equipment_Info_Type := ueit |
| 1132 | } |
| 1133 | } |
| 1134 | } |
| 1135 | |
| 1136 | template (present) GenericAVP tr_AVP_UserEquipmentInfoValue(template (present) DCC_NONE_User_Equipment_Info_Value ueiv := ?) := { |
| 1137 | avp := { |
| 1138 | avp_header := tr_DIA_Hdr(c_AVP_Code_DCC_NONE_User_Equipment_Info_Value), |
| 1139 | avp_data := { |
| 1140 | avp_DCC_NONE_User_Equipment_Info_Value := ueiv |
| 1141 | } |
| 1142 | } |
| 1143 | } |
Harald Welte | d27ab24 | 2019-07-26 13:45:18 +0200 | [diff] [blame] | 1144 | |
Harald Welte | 40b1e00 | 2023-01-27 17:26:39 +0100 | [diff] [blame] | 1145 | /* TS 29.272 7.3.62 PDN-Type */ |
Harald Welte | d27ab24 | 2019-07-26 13:45:18 +0200 | [diff] [blame] | 1146 | template (value) GenericAVP ts_AVP_3GPP_PdnType(template (value) AAA_3GPP_PDN_Type pdn_type) := { |
| 1147 | avp := { |
| 1148 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_PDN_Type), |
| 1149 | avp_data := { |
| 1150 | avp_AAA_3GPP_PDN_Type := pdn_type |
| 1151 | } |
| 1152 | } |
| 1153 | } |
| 1154 | |
Pau Espin Pedrol | 77fdd0b | 2022-03-08 14:03:33 +0100 | [diff] [blame] | 1155 | /* RFC4006 8.16 Multiple-Services-Credit-Control AVP */ |
| 1156 | template (value) GenericAVP ts_AVP_Multiple_Services_Credit_Control(template (value) AVP_list content) := { |
| 1157 | avp := { |
| 1158 | avp_header := ts_DIA_Hdr(c_AVP_Code_DCC_NONE_Multiple_Services_Credit_Control), |
| 1159 | avp_data := { |
| 1160 | avp_DCC_NONE_Multiple_Services_Credit_Control := content |
| 1161 | } |
| 1162 | } |
| 1163 | } |
Pau Espin Pedrol | a2af578 | 2022-05-18 16:34:29 +0200 | [diff] [blame] | 1164 | template (present) GenericAVP tr_AVP_Multiple_Services_Credit_Control(template (present) AVP_list content := ?) := { |
| 1165 | avp := { |
| 1166 | avp_header := tr_DIA_Hdr(c_AVP_Code_DCC_NONE_Multiple_Services_Credit_Control), |
| 1167 | avp_data := { |
| 1168 | avp_DCC_NONE_Multiple_Services_Credit_Control := content |
| 1169 | } |
| 1170 | } |
| 1171 | } |
| 1172 | |
| 1173 | /* Requested-Service-Unit AVP */ |
| 1174 | template (present) GenericAVP tr_AVP_Requested_Service_Unit(template (present) AVP_list content := ?) := { |
| 1175 | avp := { |
| 1176 | avp_header := tr_DIA_Hdr(c_AVP_Code_DCC_NONE_Requested_Service_Unit), |
| 1177 | avp_data := { |
| 1178 | avp_DCC_NONE_Requested_Service_Unit := content |
| 1179 | } |
| 1180 | } |
| 1181 | } |
| 1182 | |
| 1183 | /* Used-Service-Unit AVP */ |
| 1184 | template (present) GenericAVP tr_AVP_Used_Service_Unit(template (present) AVP_list content := ?) := { |
| 1185 | avp := { |
| 1186 | avp_header := tr_DIA_Hdr(c_AVP_Code_DCC_NONE_Used_Service_Unit), |
| 1187 | avp_data := { |
| 1188 | avp_DCC_NONE_Used_Service_Unit := content |
| 1189 | } |
| 1190 | } |
| 1191 | } |
Pau Espin Pedrol | 77fdd0b | 2022-03-08 14:03:33 +0100 | [diff] [blame] | 1192 | |
| 1193 | /* RFC4006 8.17 Granted-Service-Unit AVP */ |
| 1194 | template (value) GenericAVP ts_AVP_Granted_Service_Unit(template (value) AVP_list content) := { |
| 1195 | avp := { |
| 1196 | avp_header := ts_DIA_Hdr(c_AVP_Code_DCC_NONE_Granted_Service_Unit), |
| 1197 | avp_data := { |
| 1198 | avp_DCC_NONE_Granted_Service_Unit := content |
| 1199 | } |
| 1200 | } |
| 1201 | } |
| 1202 | |
| 1203 | /* RFC4006 8.21 CC-Time AVP */ |
| 1204 | template (value) GenericAVP ts_AVP_CC_Time(uint32_t cc_time_val) := { |
| 1205 | avp := { |
| 1206 | avp_header := ts_DIA_Hdr(c_AVP_Code_DCC_NONE_CC_Time), |
| 1207 | avp_data := { |
| 1208 | avp_DCC_NONE_CC_Time := int2oct(cc_time_val, 4) |
| 1209 | } |
| 1210 | } |
| 1211 | } |
| 1212 | |
| 1213 | /* RFC4006 8.23 CC-Total-Octets AVP */ |
| 1214 | template (value) GenericAVP ts_AVP_CC_Total_Octets(uint64_t cc_total_octets_val) := { |
| 1215 | avp := { |
| 1216 | avp_header := ts_DIA_Hdr(c_AVP_Code_DCC_NONE_CC_Total_Octets), |
| 1217 | avp_data := { |
| 1218 | avp_DCC_NONE_CC_Total_Octets := int2oct(cc_total_octets_val, 8) |
| 1219 | } |
| 1220 | } |
| 1221 | } |
| 1222 | |
| 1223 | /* RFC4006 8.33 Validity-Time AVP */ |
| 1224 | template (value) GenericAVP ts_AVP_Validity_Time(uint32_t validity_time_val) := { |
| 1225 | avp := { |
| 1226 | avp_header := ts_DIA_Hdr(c_AVP_Code_DCC_NONE_Validity_Time), |
| 1227 | avp_data := { |
| 1228 | avp_DCC_NONE_Validity_Time := int2oct(validity_time_val, 4) |
| 1229 | } |
| 1230 | } |
| 1231 | } |
| 1232 | |
Pau Espin Pedrol | 52562c9 | 2022-05-23 15:45:46 +0200 | [diff] [blame] | 1233 | template (value) GenericAVP ts_AVP_3GPP_VolumeQuotaThreshold(uint32_t volume_quota_thresh_val) := { |
| 1234 | avp := { |
| 1235 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_DCA_3GPP_Volume_Quota_Threshold), |
| 1236 | avp_data := { |
| 1237 | avp_DCA_3GPP_Volume_Quota_Threshold := int2oct(volume_quota_thresh_val, 4) |
| 1238 | } |
| 1239 | } |
| 1240 | } |
| 1241 | |
Pau Espin Pedrol | a2af578 | 2022-05-18 16:34:29 +0200 | [diff] [blame] | 1242 | template (present) GenericAVP tr_AVP_3GPP_CalledStationId(template (present) DNAS_NONE_Called_Station_Id id := ?) := { |
| 1243 | avp := { |
| 1244 | avp_header := tr_DIA_Hdr(c_AVP_Code_DNAS_NONE_Called_Station_Id), |
| 1245 | avp_data := { |
| 1246 | avp_DNAS_NONE_Called_Station_Id := id |
| 1247 | } |
| 1248 | } |
| 1249 | } |
Harald Welte | d27ab24 | 2019-07-26 13:45:18 +0200 | [diff] [blame] | 1250 | |
| 1251 | |
Vadim Yanitskiy | 0d6cbd3 | 2023-02-11 08:07:27 +0700 | [diff] [blame] | 1252 | /* 5.3.1 Capabilities Exchange Request */ |
| 1253 | template (value) PDU_DIAMETER |
| 1254 | ts_DIA_CER(octetstring host_ip, uint32_t vendor_app_id, |
| 1255 | template (value) charstring orig_host := "ttcn3.localdomain", |
| 1256 | template (value) charstring orig_realm := "localdomain", |
| 1257 | template (value) UINT32 hbh_id := '00000000'O, |
| 1258 | template (value) UINT32 ete_id := '00000000'O) := |
| 1259 | ts_DIAMETER(flags := '10000000'B, |
| 1260 | cmd_code := Capabilities_Exchange, |
| 1261 | hbh_id := hbh_id, |
| 1262 | ete_id := ete_id, |
| 1263 | avps := { |
| 1264 | ts_AVP_OriginHost(orig_host), |
| 1265 | ts_AVP_OriginRealm(orig_realm), |
| 1266 | ts_AVP_HostIpAddr(host_ip), |
| 1267 | ts_AVP_VendorId(vendor_id_3GPP), |
| 1268 | ts_AVP_ProductName("TTCN-3 Testsuite"), |
| 1269 | ts_AVP_FwRevision('00000000'O), |
| 1270 | ts_AVP_InbSecId('00000000'O), |
| 1271 | ts_AVP_AuthAppId('FFFFFFFF'O), |
| 1272 | ts_AVP_VendorSpecAppId(vendor_id_3GPP, vendor_app_id) |
| 1273 | }); |
| 1274 | |
| 1275 | |
Harald Welte | d27ab24 | 2019-07-26 13:45:18 +0200 | [diff] [blame] | 1276 | /* 5.3.2 Capabilities Exchange Answer */ |
| 1277 | template (value) PDU_DIAMETER |
Pau Espin Pedrol | 33b4749 | 2022-03-08 17:43:01 +0100 | [diff] [blame] | 1278 | ts_DIA_CEA_AUTH_APP_ID(template (value) UINT32 hbh_id, template (value) UINT32 ete_id, |
| 1279 | template (value) charstring origin_host, |
| 1280 | template (value) charstring origin_realm, |
| 1281 | template (value) octetstring host_ip, uint32_t auth_app_id) |
| 1282 | := ts_DIAMETER(flags:='00000000'B, cmd_code:=Capabilities_Exchange, hbh_id:=hbh_id, ete_id:=ete_id, |
| 1283 | avps := { |
| 1284 | ts_AVP_ResultCode(DIAMETER_SUCCESS), |
| 1285 | ts_AVP_OriginHost(origin_host), |
| 1286 | ts_AVP_OriginRealm(origin_realm), |
| 1287 | ts_AVP_HostIpAddr(host_ip), |
| 1288 | ts_AVP_VendorId(vendor_id_3GPP), |
| 1289 | ts_AVP_ProductName("TTCN-3 Testsuite"), |
| 1290 | ts_AVP_OriginStateId('00000001'O), |
| 1291 | ts_AVP_SuppVendorIdRaw(5535), /* 3GPP2 */ |
| 1292 | ts_AVP_SuppVendorId(vendor_id_3GPP), |
| 1293 | ts_AVP_SuppVendorIdRaw(13019), /* ETSI */ |
Pau Espin Pedrol | 33b4749 | 2022-03-08 17:43:01 +0100 | [diff] [blame] | 1294 | ts_AVP_AuthAppId(int2oct(auth_app_id, 4)), |
| 1295 | ts_AVP_InbSecId('00000000'O) |
| 1296 | }); |
| 1297 | template (value) PDU_DIAMETER |
| 1298 | ts_DIA_CEA_VENDOR_APP_ID(template (value) UINT32 hbh_id, template (value) UINT32 ete_id, |
| 1299 | template (value) charstring origin_host, |
| 1300 | template (value) charstring origin_realm, |
| 1301 | template (value) octetstring host_ip, uint32_t vendor_app_id) |
Harald Welte | d27ab24 | 2019-07-26 13:45:18 +0200 | [diff] [blame] | 1302 | := ts_DIAMETER(flags:='00000000'B, cmd_code:=Capabilities_Exchange, hbh_id:=hbh_id, ete_id:=ete_id, |
| 1303 | avps := { |
| 1304 | ts_AVP_ResultCode(DIAMETER_SUCCESS), |
Harald Welte | 61f73d5 | 2020-04-26 21:41:12 +0200 | [diff] [blame] | 1305 | ts_AVP_OriginHost(origin_host), |
| 1306 | ts_AVP_OriginRealm(origin_realm), |
| 1307 | ts_AVP_HostIpAddr(host_ip), |
Harald Welte | d27ab24 | 2019-07-26 13:45:18 +0200 | [diff] [blame] | 1308 | ts_AVP_VendorId(vendor_id_3GPP), |
| 1309 | ts_AVP_ProductName("TTCN-3 Testsuite"), |
| 1310 | ts_AVP_OriginStateId('00000001'O), |
| 1311 | ts_AVP_SuppVendorIdRaw(5535), /* 3GPP2 */ |
| 1312 | ts_AVP_SuppVendorId(vendor_id_3GPP), |
| 1313 | ts_AVP_SuppVendorIdRaw(13019), /* ETSI */ |
Harald Welte | d27ab24 | 2019-07-26 13:45:18 +0200 | [diff] [blame] | 1314 | ts_AVP_InbSecId('00000000'O), |
Harald Welte | 61f73d5 | 2020-04-26 21:41:12 +0200 | [diff] [blame] | 1315 | ts_AVP_VendorSpecAppId(vendor_id_3GPP, vendor_app_id) |
Harald Welte | d27ab24 | 2019-07-26 13:45:18 +0200 | [diff] [blame] | 1316 | }); |
Pau Espin Pedrol | 33b4749 | 2022-03-08 17:43:01 +0100 | [diff] [blame] | 1317 | function f_ts_DIA_CEA(template (value) UINT32 hbh_id, template (value) UINT32 ete_id, |
| 1318 | template (value) charstring origin_host, |
| 1319 | template (value) charstring origin_realm, |
| 1320 | template (value) octetstring host_ip, template (omit) uint32_t auth_app_id, |
| 1321 | template (omit) uint32_t vendor_app_id) |
| 1322 | return template (value) PDU_DIAMETER |
| 1323 | { |
| 1324 | var template (value) PDU_DIAMETER diam_pdu; |
| 1325 | if (istemplatekind(vendor_app_id, "omit")) { |
| 1326 | diam_pdu := ts_DIA_CEA_AUTH_APP_ID(hbh_id, ete_id, origin_host, origin_realm, host_ip, valueof(auth_app_id)); |
| 1327 | } else { |
| 1328 | diam_pdu := ts_DIA_CEA_VENDOR_APP_ID(hbh_id, ete_id, origin_host, origin_realm, host_ip, valueof(vendor_app_id)); |
| 1329 | } |
| 1330 | return diam_pdu; |
| 1331 | } |
Harald Welte | d27ab24 | 2019-07-26 13:45:18 +0200 | [diff] [blame] | 1332 | |
Harald Welte | 6effabb | 2020-02-18 21:39:59 +0100 | [diff] [blame] | 1333 | |
| 1334 | template (value) PDU_DIAMETER |
Vadim Yanitskiy | 2dba494 | 2021-12-11 15:46:30 +0300 | [diff] [blame] | 1335 | ts_DIA_AIR(/* template (value) */ hexstring imsi, |
Vadim Yanitskiy | 59ef8e5 | 2023-02-07 23:38:29 +0700 | [diff] [blame] | 1336 | template (value) octetstring mcc_mnc := '111F11'O, |
Vadim Yanitskiy | 2dba494 | 2021-12-11 15:46:30 +0300 | [diff] [blame] | 1337 | template (value) octetstring sess_id := c_def_sess_id, |
Vadim Yanitskiy | b57ef87 | 2021-12-12 04:14:18 +0300 | [diff] [blame] | 1338 | template (value) charstring orig_host := "ttcn3.localdomain", |
| 1339 | template (value) charstring orig_realm := "localdomain", |
Vadim Yanitskiy | 2dba494 | 2021-12-11 15:46:30 +0300 | [diff] [blame] | 1340 | template (value) charstring dest_realm := "localdomain", |
| 1341 | template (value) UINT32 hbh_id := '00000000'O, |
| 1342 | template (value) UINT32 ete_id := '00000000'O) := |
Vadim Yanitskiy | 21fd7db | 2021-12-15 05:29:35 +0300 | [diff] [blame] | 1343 | ts_DIAMETER(flags := '11000000'B, |
Vadim Yanitskiy | 2dba494 | 2021-12-11 15:46:30 +0300 | [diff] [blame] | 1344 | cmd_code := Authentication_Information, |
Vadim Yanitskiy | 463d826 | 2021-12-11 16:50:46 +0300 | [diff] [blame] | 1345 | app_id := int2oct(c_DIAMETER_3GPP_S6_AID, 4), |
Vadim Yanitskiy | 2dba494 | 2021-12-11 15:46:30 +0300 | [diff] [blame] | 1346 | hbh_id := hbh_id, |
| 1347 | ete_id := ete_id, |
| 1348 | avps := { |
| 1349 | ts_AVP_SessionId(sess_id), |
| 1350 | ts_AVP_DestinationRealm(dest_realm), |
Vadim Yanitskiy | b57ef87 | 2021-12-12 04:14:18 +0300 | [diff] [blame] | 1351 | ts_AVP_OriginHost(orig_host), |
| 1352 | ts_AVP_OriginRealm(orig_realm), |
Vadim Yanitskiy | 2dba494 | 2021-12-11 15:46:30 +0300 | [diff] [blame] | 1353 | ts_AVP_UserNameImsi(imsi), |
| 1354 | /* Requested EUTRAN Auth Info */ |
| 1355 | ts_AVP_RequestedEutranAuthInfo, |
Vadim Yanitskiy | b57ef87 | 2021-12-12 04:14:18 +0300 | [diff] [blame] | 1356 | ts_AVP_AuthSessionState(NO_STATE_MAINTAINED), |
Vadim Yanitskiy | 59ef8e5 | 2023-02-07 23:38:29 +0700 | [diff] [blame] | 1357 | ts_AVP_3GPP_VisitedPlmnId(mcc_mnc) |
Harald Welte | 6effabb | 2020-02-18 21:39:59 +0100 | [diff] [blame] | 1358 | }); |
Harald Welte | d27ab24 | 2019-07-26 13:45:18 +0200 | [diff] [blame] | 1359 | template (present) PDU_DIAMETER |
Vadim Yanitskiy | 2dba494 | 2021-12-11 15:46:30 +0300 | [diff] [blame] | 1360 | tr_DIA_AIR(/* template (present) */ hexstring imsi, |
| 1361 | template (present) octetstring sess_id := ?, |
| 1362 | template (present) charstring dest_realm := ?, |
| 1363 | template (present) UINT32 hbh_id := ?, |
| 1364 | template (present) UINT32 ete_id := ?) := |
Vadim Yanitskiy | 21fd7db | 2021-12-15 05:29:35 +0300 | [diff] [blame] | 1365 | tr_DIAMETER(flags := '1???????'B, |
Vadim Yanitskiy | 2dba494 | 2021-12-11 15:46:30 +0300 | [diff] [blame] | 1366 | cmd_code := Authentication_Information, |
| 1367 | app_id := int2oct(c_DIAMETER_3GPP_S6_AID, 4), |
| 1368 | hbh_id := hbh_id, ete_id := ete_id, |
| 1369 | avps := superset( |
| 1370 | tr_AVP_SessionId(sess_id), |
| 1371 | tr_AVP_DestinationRealm(dest_realm), |
| 1372 | tr_AVP_UserNameImsi(imsi), |
| 1373 | tr_AVP_3GPP_VisitedPlmnId |
Harald Welte | d27ab24 | 2019-07-26 13:45:18 +0200 | [diff] [blame] | 1374 | )); |
| 1375 | |
Harald Welte | 40b1e00 | 2023-01-27 17:26:39 +0100 | [diff] [blame] | 1376 | /* TS 29.272 5.2.3.1 + 7.2.6 Authentication Information Answer */ |
Harald Welte | d27ab24 | 2019-07-26 13:45:18 +0200 | [diff] [blame] | 1377 | template (value) PDU_DIAMETER |
Vadim Yanitskiy | 2dba494 | 2021-12-11 15:46:30 +0300 | [diff] [blame] | 1378 | ts_DIA_AIA(template (value) AVP_list auth_info_contents, |
| 1379 | template (value) octetstring sess_id := c_def_sess_id, |
| 1380 | template (value) charstring orig_host := "hss.localdomain", |
| 1381 | template (value) charstring orig_realm := "localdomain", |
| 1382 | template (value) UINT32 hbh_id := '00000000'O, |
| 1383 | template (value) UINT32 ete_id := '00000000'O) := |
| 1384 | ts_DIAMETER(flags := '01000000'B, |
| 1385 | cmd_code := Authentication_Information, |
| 1386 | app_id := int2oct(c_DIAMETER_3GPP_S6_AID, 4), |
| 1387 | hbh_id := hbh_id, |
| 1388 | ete_id := ete_id, |
| 1389 | avps := { |
| 1390 | ts_AVP_SessionId(sess_id), |
| 1391 | ts_AVP_ResultCode(DIAMETER_SUCCESS), |
| 1392 | ts_AVP_AuthSessionState(NO_STATE_MAINTAINED), |
| 1393 | ts_AVP_OriginHost(orig_host), |
| 1394 | ts_AVP_OriginRealm(orig_realm), |
| 1395 | ts_AVP_3GPP_AuthInfo(auth_info_contents) |
Harald Welte | d27ab24 | 2019-07-26 13:45:18 +0200 | [diff] [blame] | 1396 | }); |
Vadim Yanitskiy | 446edae | 2021-12-12 04:33:08 +0300 | [diff] [blame] | 1397 | template (present) PDU_DIAMETER |
| 1398 | tr_DIA_AIA(template (present) AVP_list auth_info_contents := ?, |
| 1399 | template (present) octetstring sess_id := ?, |
| 1400 | template (present) charstring orig_host := ?, |
| 1401 | template (present) charstring orig_realm := ?, |
| 1402 | template (present) UINT32 hbh_id := ?, |
| 1403 | template (present) UINT32 ete_id := ?) := |
| 1404 | tr_DIAMETER(flags := '0???????'B, |
| 1405 | cmd_code := Authentication_Information, |
| 1406 | app_id := int2oct(c_DIAMETER_3GPP_S6_AID, 4), |
| 1407 | hbh_id := hbh_id, |
| 1408 | ete_id := ete_id, |
| 1409 | avps := superset( |
| 1410 | tr_AVP_SessionId(sess_id), |
Vadim Yanitskiy | 446edae | 2021-12-12 04:33:08 +0300 | [diff] [blame] | 1411 | tr_AVP_AuthSessionState(NO_STATE_MAINTAINED), |
Vadim Yanitskiy | 446edae | 2021-12-12 04:33:08 +0300 | [diff] [blame] | 1412 | tr_AVP_OriginHost(orig_host), |
Pau Espin Pedrol | 7bedcf8 | 2023-08-24 19:33:49 +0200 | [diff] [blame^] | 1413 | tr_AVP_OriginRealm(orig_realm), |
| 1414 | tr_AVP_ResultCode(DIAMETER_SUCCESS), |
| 1415 | tr_AVP_3GPP_AuthInfo(auth_info_contents) |
Vadim Yanitskiy | 446edae | 2021-12-12 04:33:08 +0300 | [diff] [blame] | 1416 | )); |
Harald Welte | d27ab24 | 2019-07-26 13:45:18 +0200 | [diff] [blame] | 1417 | |
| 1418 | |
Harald Welte | 40b1e00 | 2023-01-27 17:26:39 +0100 | [diff] [blame] | 1419 | /* TS 29.272 7.2.3 Update Location Request */ |
Vadim Yanitskiy | 5e1bdc0 | 2021-12-12 02:33:59 +0300 | [diff] [blame] | 1420 | template (value) PDU_DIAMETER |
| 1421 | ts_DIA_ULR(/* template (value) */ hexstring imsi, |
Vadim Yanitskiy | 59ef8e5 | 2023-02-07 23:38:29 +0700 | [diff] [blame] | 1422 | template (value) octetstring mcc_mnc := '111F11'O, |
Vadim Yanitskiy | 5e1bdc0 | 2021-12-12 02:33:59 +0300 | [diff] [blame] | 1423 | template (value) octetstring sess_id := c_def_sess_id, |
| 1424 | template (value) charstring orig_host := "ttcn3.localdomain", |
| 1425 | template (value) charstring orig_realm := "localdomain", |
| 1426 | template (value) charstring dest_realm := "localdomain", |
| 1427 | template (value) UINT32 hbh_id := '00000000'O, |
| 1428 | template (value) UINT32 ete_id := '00000000'O) := |
| 1429 | ts_DIAMETER(flags := '11000000'B, |
| 1430 | cmd_code := Update_Location, |
| 1431 | app_id := int2oct(c_DIAMETER_3GPP_S6_AID, 4), |
| 1432 | hbh_id := hbh_id, |
| 1433 | ete_id := ete_id, |
| 1434 | avps := { |
| 1435 | ts_AVP_SessionId(sess_id), |
| 1436 | ts_AVP_AuthSessionState(NO_STATE_MAINTAINED), |
| 1437 | ts_AVP_UserNameImsi(imsi), |
| 1438 | ts_AVP_3GPP_UlrFlags('00000000'O), |
Vadim Yanitskiy | 59ef8e5 | 2023-02-07 23:38:29 +0700 | [diff] [blame] | 1439 | ts_AVP_3GPP_VisitedPlmnId(mcc_mnc), |
Pau Espin Pedrol | a2af578 | 2022-05-18 16:34:29 +0200 | [diff] [blame] | 1440 | ts_AVP_PCC_3GPP_RatType(EUTRAN), |
Vadim Yanitskiy | 5e1bdc0 | 2021-12-12 02:33:59 +0300 | [diff] [blame] | 1441 | ts_AVP_OriginHost(orig_host), |
| 1442 | ts_AVP_OriginRealm(orig_realm), |
| 1443 | ts_AVP_DestinationRealm(dest_realm) |
| 1444 | }); |
Harald Welte | d27ab24 | 2019-07-26 13:45:18 +0200 | [diff] [blame] | 1445 | template (present) PDU_DIAMETER |
Vadim Yanitskiy | 0e8f516 | 2021-12-15 05:00:32 +0300 | [diff] [blame] | 1446 | tr_DIA_ULR(/* template (present) */ hexstring imsi, |
| 1447 | template (present) octetstring sess_id := ?, |
| 1448 | template (present) charstring orig_host := ?, |
| 1449 | template (present) charstring orig_realm := ?, |
| 1450 | template (present) charstring dest_realm := ?, |
| 1451 | template (present) UINT32 hbh_id := ?, |
| 1452 | template (present) UINT32 ete_id := ?) := |
| 1453 | tr_DIAMETER(flags := '11000000'B, |
| 1454 | cmd_code := Update_Location, |
| 1455 | app_id := int2oct(c_DIAMETER_3GPP_S6_AID, 4), |
| 1456 | hbh_id := hbh_id, |
| 1457 | ete_id := ete_id, |
| 1458 | avps := superset( |
| 1459 | tr_AVP_SessionId(sess_id), |
| 1460 | tr_AVP_AuthSessionState, |
| 1461 | tr_AVP_OriginHost(orig_host), |
| 1462 | tr_AVP_OriginRealm(orig_realm), |
| 1463 | tr_AVP_DestinationRealm(dest_realm), |
| 1464 | tr_AVP_UserNameImsi(imsi), |
Pau Espin Pedrol | a2af578 | 2022-05-18 16:34:29 +0200 | [diff] [blame] | 1465 | tr_AVP_PCC_3GPP_RatType, |
Vadim Yanitskiy | 0e8f516 | 2021-12-15 05:00:32 +0300 | [diff] [blame] | 1466 | tr_AVP_3GPP_UlrFlags, |
| 1467 | tr_AVP_3GPP_VisitedPlmnId |
Harald Welte | d27ab24 | 2019-07-26 13:45:18 +0200 | [diff] [blame] | 1468 | )); |
| 1469 | |
| 1470 | template (value) PDU_DIAMETER |
Vadim Yanitskiy | 0e8f516 | 2021-12-15 05:00:32 +0300 | [diff] [blame] | 1471 | ts_DIA_ULA(template (value) AVP_list sub_data, |
| 1472 | template (value) octetstring sess_id := c_def_sess_id, |
| 1473 | template (value) charstring orig_host := "hss.localdomain", |
| 1474 | template (value) charstring orig_realm := "localdomain", |
| 1475 | template (value) UINT32 hbh_id := '00000000'O, |
| 1476 | template (value) UINT32 ete_id := '00000000'O) := |
| 1477 | ts_DIAMETER(flags:='01000000'B, |
| 1478 | cmd_code := Update_Location, |
| 1479 | app_id := int2oct(c_DIAMETER_3GPP_S6_AID, 4), |
| 1480 | hbh_id := hbh_id, |
| 1481 | ete_id := ete_id, |
| 1482 | avps := { |
| 1483 | ts_AVP_SessionId(sess_id), |
| 1484 | ts_AVP_ResultCode(DIAMETER_SUCCESS), /* optional */ |
| 1485 | ts_AVP_AuthSessionState(NO_STATE_MAINTAINED), |
| 1486 | ts_AVP_OriginHost(orig_host), |
| 1487 | ts_AVP_OriginRealm(orig_realm), |
| 1488 | ts_AVP_3GPP_UlaFlags('00000002'O), |
| 1489 | ts_AVP_3GPP_SubscriptionData(sub_data) |
Harald Welte | d27ab24 | 2019-07-26 13:45:18 +0200 | [diff] [blame] | 1490 | }); |
Vadim Yanitskiy | 5e1bdc0 | 2021-12-12 02:33:59 +0300 | [diff] [blame] | 1491 | template (present) PDU_DIAMETER |
| 1492 | tr_DIA_ULA(template (present) AVP_list sub_data := ?, |
| 1493 | template (present) octetstring sess_id := ?, |
| 1494 | template (present) charstring orig_host := ?, |
| 1495 | template (present) charstring orig_realm := ?, |
| 1496 | template (present) UINT32 hbh_id := ?, |
| 1497 | template (present) UINT32 ete_id := ?) := |
| 1498 | tr_DIAMETER(flags := '0???????'B, |
| 1499 | cmd_code := Update_Location, |
| 1500 | app_id := int2oct(c_DIAMETER_3GPP_S6_AID, 4), |
| 1501 | hbh_id := hbh_id, |
| 1502 | ete_id := ete_id, |
| 1503 | avps := superset( |
| 1504 | tr_AVP_SessionId(sess_id), |
| 1505 | tr_AVP_ResultCode(DIAMETER_SUCCESS), |
| 1506 | tr_AVP_AuthSessionState, |
| 1507 | tr_AVP_OriginHost(orig_host), |
| 1508 | tr_AVP_OriginRealm(orig_realm), |
| 1509 | tr_AVP_3GPP_UlaFlags, |
| 1510 | tr_AVP_3GPP_SubscriptionData(sub_data) |
| 1511 | )); |
Harald Welte | d27ab24 | 2019-07-26 13:45:18 +0200 | [diff] [blame] | 1512 | |
| 1513 | |
| 1514 | |
Harald Welte | f400151 | 2020-04-26 21:48:34 +0200 | [diff] [blame] | 1515 | /* RFC 4006 3.1. Credit-Control-Request (CCR) Command */ |
| 1516 | template (present) PDU_DIAMETER |
Pau Espin Pedrol | 77fdd0b | 2022-03-08 14:03:33 +0100 | [diff] [blame] | 1517 | tr_DIA_Gx_CCR(template (present) DCC_NONE_CC_Request_Type req_type := INITIAL_REQUEST) |
Harald Welte | f400151 | 2020-04-26 21:48:34 +0200 | [diff] [blame] | 1518 | := tr_DIAMETER(flags:='11000000'B, cmd_code:=Credit_Control, |
Harald Welte | f400151 | 2020-04-26 21:48:34 +0200 | [diff] [blame] | 1519 | avps := superset( |
| 1520 | tr_AVP_SessionId, |
| 1521 | tr_AVP_OriginHost, |
| 1522 | tr_AVP_OriginRealm, |
| 1523 | tr_AVP_DestinationRealm, |
| 1524 | tr_AVP_AuthAppId(int2oct(c_DIAMETER_3GPP_Gx_AID, 4)), |
| 1525 | tr_AVP_CcReqType(req_type), |
| 1526 | tr_AVP_CcReqNum(?) |
| 1527 | )); |
Pau Espin Pedrol | 77fdd0b | 2022-03-08 14:03:33 +0100 | [diff] [blame] | 1528 | template (present) PDU_DIAMETER |
| 1529 | tr_DIA_Gy_CCR(template (present) DCC_NONE_CC_Request_Type req_type := INITIAL_REQUEST) |
| 1530 | := tr_DIAMETER(flags:='11000000'B, cmd_code:=Credit_Control, |
Pau Espin Pedrol | 77fdd0b | 2022-03-08 14:03:33 +0100 | [diff] [blame] | 1531 | avps := superset( |
| 1532 | tr_AVP_SessionId, |
| 1533 | tr_AVP_OriginHost, |
| 1534 | tr_AVP_OriginRealm, |
| 1535 | tr_AVP_DestinationRealm, |
| 1536 | tr_AVP_AuthAppId(int2oct(c_DIAMETER_CREDIT_CONTROL_AID, 4)), |
| 1537 | tr_AVP_CcReqType(req_type), |
| 1538 | tr_AVP_CcReqNum(?) |
| 1539 | )); |
| 1540 | |
Harald Welte | f400151 | 2020-04-26 21:48:34 +0200 | [diff] [blame] | 1541 | |
| 1542 | |
| 1543 | /* RFC 4006 3.2. Credit-Control-Answer (CCA) Command */ |
| 1544 | template (value) PDU_DIAMETER |
Pau Espin Pedrol | 77fdd0b | 2022-03-08 14:03:33 +0100 | [diff] [blame] | 1545 | ts_DIA_Gx_CCA(template (value) UINT32 hbh_id, template (value) UINT32 ete_id, |
Harald Welte | f400151 | 2020-04-26 21:48:34 +0200 | [diff] [blame] | 1546 | template (value) octetstring sess_id, |
| 1547 | template (value) DCC_NONE_CC_Request_Type req_type, |
| 1548 | template (value) AVP_Unsigned32 req_num) |
Harald Welte | f400151 | 2020-04-26 21:48:34 +0200 | [diff] [blame] | 1549 | := ts_DIAMETER(flags:='01000000'B, cmd_code:=Credit_Control, |
| 1550 | app_id:=int2oct(c_DIAMETER_3GPP_Gx_AID, 4), hbh_id:=hbh_id, ete_id:=ete_id, |
| 1551 | avps := { |
| 1552 | ts_AVP_SessionId(sess_id), |
| 1553 | ts_AVP_ResultCode(DIAMETER_SUCCESS), |
| 1554 | ts_AVP_OriginHost("pcrf.localdomain"), |
| 1555 | ts_AVP_OriginRealm("localdomain"), |
| 1556 | ts_AVP_AuthAppId(int2oct(c_DIAMETER_3GPP_Gx_AID, 4)), |
| 1557 | ts_AVP_CcReqType(req_type), |
Pau Espin Pedrol | ee961c7 | 2022-06-03 12:06:07 +0200 | [diff] [blame] | 1558 | ts_AVP_CcReqNum(req_num), |
| 1559 | ts_AVP_PCC_3GPP_QoS_Information({ |
| 1560 | ts_AVP_PCC_3GPP_APN_Aggregate_Max_Bitrate_UL(33554432), |
| 1561 | ts_AVP_PCC_3GPP_APN_Aggregate_Max_Bitrate_DL(52428800) |
| 1562 | }), |
| 1563 | ts_AVP_PCC_3GPP_Default_EPS_Bearer_QoS({ |
| 1564 | ts_AVP_PCC_3GPP_QoS_Class_Identifier(9), |
| 1565 | ts_AVP_PCC_3GPP_AllocRetenPrio(2) |
| 1566 | }) |
Harald Welte | f400151 | 2020-04-26 21:48:34 +0200 | [diff] [blame] | 1567 | // supported features |
| 1568 | // origin |
| 1569 | }); |
Pau Espin Pedrol | 77fdd0b | 2022-03-08 14:03:33 +0100 | [diff] [blame] | 1570 | template (value) PDU_DIAMETER |
| 1571 | ts_DIA_Gy_CCA(template (value) UINT32 hbh_id, template (value) UINT32 ete_id, |
| 1572 | template (value) octetstring sess_id, |
| 1573 | template (value) DCC_NONE_CC_Request_Type req_type, |
| 1574 | template (value) AVP_Unsigned32 req_num) |
| 1575 | := ts_DIAMETER(flags:='01000000'B, cmd_code:=Credit_Control, |
| 1576 | app_id:=int2oct(c_DIAMETER_CREDIT_CONTROL_AID, 4), hbh_id:=hbh_id, ete_id:=ete_id, |
| 1577 | avps := { |
| 1578 | ts_AVP_SessionId(sess_id), |
| 1579 | ts_AVP_ResultCode(DIAMETER_SUCCESS), |
| 1580 | ts_AVP_OriginHost("ocs.localdomain"), |
| 1581 | ts_AVP_OriginRealm("localdomain"), |
| 1582 | ts_AVP_AuthAppId(int2oct(c_DIAMETER_CREDIT_CONTROL_AID, 4)), |
| 1583 | ts_AVP_CcReqType(req_type), |
| 1584 | ts_AVP_CcReqNum(req_num)//, |
| 1585 | // qos |
| 1586 | // default eps bearer qos |
| 1587 | // supported features |
| 1588 | // origin |
| 1589 | }); |
| 1590 | /* Same as ts_DIA_Gy_CCA, but with extra AVP to grant access for limited amount of seconds */ |
| 1591 | template (value) PDU_DIAMETER |
| 1592 | ts_DIA_Gy_CCA_ValidityTime(template (value) UINT32 hbh_id, template (value) UINT32 ete_id, |
| 1593 | template (value) octetstring sess_id, |
| 1594 | template (value) DCC_NONE_CC_Request_Type req_type, |
| 1595 | template (value) AVP_Unsigned32 req_num, |
| 1596 | uint32_t validity_time) |
| 1597 | := ts_DIAMETER(flags:='01000000'B, cmd_code:=Credit_Control, |
| 1598 | app_id:=int2oct(c_DIAMETER_CREDIT_CONTROL_AID, 4), hbh_id:=hbh_id, ete_id:=ete_id, |
| 1599 | avps := { |
| 1600 | ts_AVP_SessionId(sess_id), |
| 1601 | ts_AVP_ResultCode(DIAMETER_SUCCESS), |
| 1602 | ts_AVP_OriginHost("ocs.localdomain"), |
| 1603 | ts_AVP_OriginRealm("localdomain"), |
| 1604 | ts_AVP_AuthAppId(int2oct(c_DIAMETER_CREDIT_CONTROL_AID, 4)), |
| 1605 | ts_AVP_CcReqType(req_type), |
| 1606 | ts_AVP_CcReqNum(req_num), |
| 1607 | ts_AVP_Multiple_Services_Credit_Control({ |
| 1608 | ts_AVP_Validity_Time(validity_time), |
| 1609 | ts_AVP_Granted_Service_Unit({ |
| 1610 | //ts_AVP_CC_Time(validity_time*2), |
| 1611 | ts_AVP_CC_Total_Octets(1000) |
| 1612 | }) |
| 1613 | }) |
| 1614 | //, |
| 1615 | // qos |
| 1616 | // default eps bearer qos |
| 1617 | // supported features |
| 1618 | // origin |
| 1619 | }); |
Pau Espin Pedrol | 52562c9 | 2022-05-23 15:45:46 +0200 | [diff] [blame] | 1620 | /* Same as ts_DIA_Gy_CCA_ValidityTime, but with extra AVP to grant access for limited amount of octets */ |
| 1621 | template (value) PDU_DIAMETER |
| 1622 | ts_DIA_Gy_CCA_ValidityTimeVolumeThreshold(template (value) UINT32 hbh_id, template (value) UINT32 ete_id, |
| 1623 | template (value) octetstring sess_id, |
| 1624 | template (value) DCC_NONE_CC_Request_Type req_type, |
| 1625 | template (value) AVP_Unsigned32 req_num, |
| 1626 | uint32_t validity_time, uint32_t volume_threhsold) |
| 1627 | := ts_DIAMETER(flags:='01000000'B, cmd_code:=Credit_Control, |
| 1628 | app_id:=int2oct(c_DIAMETER_CREDIT_CONTROL_AID, 4), hbh_id:=hbh_id, ete_id:=ete_id, |
| 1629 | avps := { |
| 1630 | ts_AVP_SessionId(sess_id), |
| 1631 | ts_AVP_ResultCode(DIAMETER_SUCCESS), |
| 1632 | ts_AVP_OriginHost("ocs.localdomain"), |
| 1633 | ts_AVP_OriginRealm("localdomain"), |
| 1634 | ts_AVP_AuthAppId(int2oct(c_DIAMETER_CREDIT_CONTROL_AID, 4)), |
| 1635 | ts_AVP_CcReqType(req_type), |
| 1636 | ts_AVP_CcReqNum(req_num), |
| 1637 | ts_AVP_Multiple_Services_Credit_Control({ |
| 1638 | ts_AVP_Validity_Time(validity_time), |
| 1639 | ts_AVP_Granted_Service_Unit({ |
| 1640 | ts_AVP_CC_Total_Octets(volume_threhsold*100) |
| 1641 | }), |
| 1642 | ts_AVP_3GPP_VolumeQuotaThreshold(volume_threhsold) |
| 1643 | }) |
| 1644 | //, |
| 1645 | // qos |
| 1646 | // default eps bearer qos |
| 1647 | // supported features |
| 1648 | // origin |
| 1649 | }); |
Harald Welte | f400151 | 2020-04-26 21:48:34 +0200 | [diff] [blame] | 1650 | |
Vadim Yanitskiy | f28b255 | 2021-12-11 03:49:14 +0300 | [diff] [blame] | 1651 | /* RFC 6733, section 5.5.1 "Device-Watchdog-Request" */ |
| 1652 | template (value) PDU_DIAMETER |
| 1653 | ts_DIA_DWR(template (value) OCTET4 state_id := '00000000'O, |
| 1654 | template (value) charstring orig_host := "ttcn3.localdomain", |
| 1655 | template (value) charstring orig_realm := "localdomain", |
| 1656 | template (value) UINT32 hbh_id := '00000000'O, |
| 1657 | template (value) UINT32 ete_id := '00000000'O) := |
| 1658 | ts_DIAMETER(flags := '10000000'B, |
| 1659 | cmd_code := Device_Watchdog, |
| 1660 | app_id := '00000000'O, |
| 1661 | hbh_id := hbh_id, |
| 1662 | ete_id := ete_id, |
| 1663 | avps := { |
| 1664 | ts_AVP_OriginHost(orig_host), |
| 1665 | ts_AVP_OriginRealm(orig_realm), |
| 1666 | ts_AVP_OriginStateId(state_id) |
| 1667 | }); |
| 1668 | template (present) PDU_DIAMETER |
| 1669 | tr_DIA_DWR(template (present) OCTET4 state_id := ?, |
| 1670 | template (present) charstring orig_host := ?, |
| 1671 | template (present) charstring orig_realm := ?, |
| 1672 | template (present) UINT32 hbh_id := ?, |
| 1673 | template (present) UINT32 ete_id := ?) := |
| 1674 | tr_DIAMETER(flags := '1???????'B, |
| 1675 | cmd_code := Device_Watchdog, |
| 1676 | app_id := '00000000'O, |
| 1677 | hbh_id := hbh_id, |
| 1678 | ete_id := ete_id, |
| 1679 | avps := superset( |
| 1680 | tr_AVP_OriginHost(orig_host), |
| 1681 | tr_AVP_OriginRealm(orig_realm), |
| 1682 | tr_AVP_OriginStateId(state_id) |
| 1683 | )); |
| 1684 | |
| 1685 | /* RFC 6733, section 5.5.2 "Device-Watchdog-Answer" */ |
| 1686 | template (value) PDU_DIAMETER |
| 1687 | ts_DIA_DWA(template (value) OCTET4 state_id := '00000000'O, |
| 1688 | template (value) charstring orig_host := "ttcn3.localdomain", |
| 1689 | template (value) charstring orig_realm := "localdomain", |
| 1690 | template (value) UINT32 hbh_id := '00000000'O, |
| 1691 | template (value) UINT32 ete_id := '00000000'O) := |
| 1692 | ts_DIAMETER(flags := '00000000'B, |
| 1693 | cmd_code := Device_Watchdog, |
| 1694 | app_id := '00000000'O, |
| 1695 | hbh_id := hbh_id, |
| 1696 | ete_id := ete_id, |
| 1697 | avps := { |
| 1698 | ts_AVP_ResultCode(DIAMETER_SUCCESS), |
| 1699 | ts_AVP_OriginHost(orig_host), |
| 1700 | ts_AVP_OriginRealm(orig_realm), |
| 1701 | ts_AVP_OriginStateId(state_id) |
| 1702 | }); |
| 1703 | template (present) PDU_DIAMETER |
| 1704 | tr_DIA_DWA(template (present) OCTET4 state_id := ?, |
| 1705 | template (present) charstring orig_host := ?, |
| 1706 | template (present) charstring orig_realm := ?, |
| 1707 | template (present) UINT32 hbh_id := ?, |
| 1708 | template (present) UINT32 ete_id := ?) := |
| 1709 | tr_DIAMETER(flags := '0???????'B, |
| 1710 | cmd_code := Device_Watchdog, |
| 1711 | app_id := '00000000'O, |
| 1712 | hbh_id := hbh_id, |
| 1713 | ete_id := ete_id, |
| 1714 | avps := superset( |
| 1715 | tr_AVP_ResultCode(DIAMETER_SUCCESS), |
| 1716 | tr_AVP_OriginHost(orig_host), |
| 1717 | tr_AVP_OriginRealm(orig_realm), |
| 1718 | tr_AVP_OriginStateId(state_id) |
| 1719 | )); |
| 1720 | |
Pau Espin Pedrol | 8fa2284 | 2022-05-20 14:47:55 +0200 | [diff] [blame] | 1721 | function f_DIAMETER_get_avp(PDU_DIAMETER pdu, template (present) AVP_Code avp_code) |
| 1722 | return template (omit) AVP |
| 1723 | { |
| 1724 | var integer i; |
| 1725 | |
| 1726 | for (i := 0; i < lengthof(pdu.avps); i := i+1) { |
| 1727 | if (not ispresent(pdu.avps[i].avp)) { |
| 1728 | continue; |
| 1729 | } |
| 1730 | var AVP_Header hdr := pdu.avps[i].avp.avp_header; |
| 1731 | if (match(hdr.avp_code, avp_code)) { |
| 1732 | return pdu.avps[i].avp; |
| 1733 | } |
| 1734 | } |
| 1735 | return omit; |
| 1736 | } |
| 1737 | function f_DIAMETER_get_avp_or_fail(PDU_DIAMETER pdu, template (present) AVP_Code avp_code) |
| 1738 | return AVP |
| 1739 | { |
| 1740 | var template (omit) AVP avp; |
| 1741 | avp := f_DIAMETER_get_avp(pdu, avp_code); |
| 1742 | if (istemplatekind(avp, "omit")) { |
| 1743 | Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, |
| 1744 | log2str("AVP ", avp_code, " not found in ", pdu)); |
| 1745 | } |
| 1746 | return valueof(avp); |
| 1747 | } |
| 1748 | |
| 1749 | function f_AVP_Grouped_get_avp(AVP_Grouped avp_grp, template (present) AVP_Code avp_code) |
| 1750 | return template (omit) AVP |
| 1751 | { |
| 1752 | var integer i; |
| 1753 | |
| 1754 | for (i := 0; i < lengthof(avp_grp); i := i+1) { |
| 1755 | if (not ispresent(avp_grp[i].avp)) { |
| 1756 | continue; |
| 1757 | } |
| 1758 | var AVP_Header hdr := avp_grp[i].avp.avp_header; |
| 1759 | if (match(hdr.avp_code, avp_code)) { |
| 1760 | return avp_grp[i].avp; |
| 1761 | } |
| 1762 | } |
| 1763 | return omit; |
| 1764 | } |
| 1765 | function f_AVP_Grouped_get_avp_or_fail(AVP_Grouped avp_grp, template (present) AVP_Code avp_code) |
| 1766 | return AVP |
| 1767 | { |
| 1768 | var template (omit) AVP avp; |
| 1769 | avp := f_AVP_Grouped_get_avp(avp_grp, avp_code); |
| 1770 | if (istemplatekind(avp, "omit")) { |
| 1771 | Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, |
| 1772 | log2str("AVP ", avp_code, " not found in ", avp_grp)); |
| 1773 | } |
| 1774 | return valueof(avp); |
| 1775 | } |
| 1776 | |
| 1777 | function f_validate_gy_cc_report(PDU_DIAMETER rx_dia, template (present) DCA_3GPP_Reporting_Reason repreason_exp := ?, |
| 1778 | template (present) integer cc_time_exp := ?, |
| 1779 | template (present) integer cc_in_oct_exp := ?, |
| 1780 | template (present) integer cc_out_oct_exp := ?) |
| 1781 | { |
| 1782 | var AVP multi_services_cc, used_service_unit; |
| 1783 | var AVP_Grouped multi_services_cc_data, used_service_unit_data; |
Pau Espin Pedrol | cba0f6d | 2022-05-24 13:49:46 +0200 | [diff] [blame] | 1784 | var template (omit) AVP repreason_tpl; |
Pau Espin Pedrol | 8fa2284 | 2022-05-20 14:47:55 +0200 | [diff] [blame] | 1785 | var AVP repreason, cc_time, cc_in_oct, cc_out_oct; |
| 1786 | |
| 1787 | multi_services_cc := f_DIAMETER_get_avp_or_fail(rx_dia, c_AVP_Code_DCC_NONE_Multiple_Services_Credit_Control); |
| 1788 | multi_services_cc_data := valueof(multi_services_cc.avp_data.avp_DCC_NONE_Multiple_Services_Credit_Control); |
| 1789 | |
Pau Espin Pedrol | cba0f6d | 2022-05-24 13:49:46 +0200 | [diff] [blame] | 1790 | used_service_unit := f_AVP_Grouped_get_avp_or_fail(multi_services_cc_data, c_AVP_Code_DCC_NONE_Used_Service_Unit); |
| 1791 | used_service_unit_data := valueof(used_service_unit.avp_data.avp_DCC_NONE_Used_Service_Unit); |
| 1792 | |
| 1793 | /* Reporting-Reason can be either inside Multiple-Services-Credit-Control or inside Used-Service-Unit */ |
| 1794 | repreason_tpl := f_AVP_Grouped_get_avp(multi_services_cc_data, c_AVP_Code_DCA_3GPP_Reporting_Reason); |
| 1795 | if (istemplatekind(repreason_tpl, "omit")) { |
| 1796 | repreason := f_AVP_Grouped_get_avp_or_fail(used_service_unit_data, c_AVP_Code_DCA_3GPP_Reporting_Reason); |
| 1797 | } else { |
| 1798 | repreason := valueof(repreason_tpl); |
| 1799 | } |
Pau Espin Pedrol | 8fa2284 | 2022-05-20 14:47:55 +0200 | [diff] [blame] | 1800 | if (not match(repreason.avp_data.avp_DCA_3GPP_Reporting_Reason, repreason_exp)) { |
| 1801 | Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, |
| 1802 | log2str("3GPP-Reporting-Reason mismatch ", repreason, " vs exp ", repreason_exp)); |
| 1803 | } |
| 1804 | |
Pau Espin Pedrol | 8fa2284 | 2022-05-20 14:47:55 +0200 | [diff] [blame] | 1805 | cc_time := f_AVP_Grouped_get_avp_or_fail(used_service_unit_data, c_AVP_Code_DCC_NONE_CC_Time); |
| 1806 | if (not match(oct2int(cc_time.avp_data.avp_DCC_NONE_CC_Time), cc_time_exp)) { |
| 1807 | Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, |
| 1808 | log2str("3GPP-CC-Time mismatch ", cc_time, " vs exp ", cc_time_exp)); |
| 1809 | } |
| 1810 | |
| 1811 | cc_in_oct := f_AVP_Grouped_get_avp_or_fail(used_service_unit_data, c_AVP_Code_DCC_NONE_CC_Input_Octets); |
| 1812 | if (not match(oct2int(cc_in_oct.avp_data.avp_DCC_NONE_CC_Input_Octets), cc_in_oct_exp)) { |
| 1813 | Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, |
| 1814 | log2str("3GPP-CC-Input-Octets mismatch ", cc_in_oct, " vs exp ", cc_in_oct_exp)); |
| 1815 | } |
| 1816 | |
| 1817 | cc_out_oct := f_AVP_Grouped_get_avp_or_fail(used_service_unit_data, c_AVP_Code_DCC_NONE_CC_Output_Octets); |
| 1818 | if (not match(oct2int(cc_out_oct.avp_data.avp_DCC_NONE_CC_Output_Octets), cc_out_oct_exp)) { |
| 1819 | Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, |
| 1820 | log2str("3GPP-CC-Output-Octets mismatch ", cc_out_oct, " vs exp ", cc_out_oct_exp)); |
| 1821 | } |
| 1822 | } |
| 1823 | |
Harald Welte | d27ab24 | 2019-07-26 13:45:18 +0200 | [diff] [blame] | 1824 | } |