Pau Espin Pedrol | 117a94f | 2023-12-21 16:10:12 +0100 | [diff] [blame] | 1 | module DIAMETER_ts29_272_Templates { |
| 2 | |
| 3 | /* (C) 2023 by sysmocom s.f.m.c. GmbH <info@sysmocom.de |
| 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 | * Templates for AVPs and messages for TS 29.272 |
| 12 | */ |
| 13 | |
| 14 | import from General_Types all; |
| 15 | import from DIAMETER_Types all; |
| 16 | import from DIAMETER_Templates all; |
| 17 | import from Osmocom_Types all; |
| 18 | import from Misc_Helpers all; |
| 19 | |
| 20 | /******************************* |
| 21 | * S6a 3GPP TS 29.272 section 7 |
| 22 | *******************************/ |
| 23 | |
| 24 | /* 3GPP TS 29.272 Section 7.1.8 */ |
| 25 | const uint32_t c_DIAMETER_3GPP_S6_AID := 16777251; /* S6a/S6d */ |
| 26 | const uint32_t c_DIAMETER_3GPP_S13_AID := 16777252; |
| 27 | |
| 28 | /* 3GPP TS 29.272 section 7.4. Errors in Experimental-Result-Code */ |
| 29 | type enumerated DIAMETER_ExperimentalResultcode { |
| 30 | /* transient */ |
| 31 | DIAMETER_AUTHENTICATION_DATA_UNAVAILABLE (4181), |
| 32 | DIAMETER_ERROR_CAMEL_SUBSCRIPTION_PRESENT (4182), |
| 33 | /* permanent */ |
| 34 | DIAMETER_ERROR_USER_UNKNOWN (5001), |
| 35 | DIAMETER_AUTHORIZATION_REJECTED (5003), |
| 36 | DIAMETER_ERROR_ROAMING_NOT_ALLOWED (5004), |
| 37 | DIAMETER_MISSING_AVP (5005), |
| 38 | DIAMETER_ERROR_UNKNOWN_EPS_SUBSCRIPTION (5420), |
| 39 | DIAMETER_ERROR_RAT_NOT_ALLOWED (5421), |
| 40 | DIAMETER_ERROR_EQUIPMENT_UNKNOWN (5422), |
| 41 | DIAMETER_ERROR_UNKOWN_SERVING_NODE (5423) |
| 42 | } |
| 43 | |
| 44 | /* TS 29.272 7.3.53 RAND */ |
| 45 | template (value) GenericAVP ts_AVP_RAND(template (value) octetstring rand) := { |
| 46 | avp := { |
| 47 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_RAND), |
| 48 | avp_data := { |
| 49 | avp_AAA_3GPP_RAND := rand |
| 50 | } |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | /* TS 29.272 7.3.54 XRES */ |
| 55 | template (value) GenericAVP ts_AVP_XRES(template (value) octetstring xres) := { |
| 56 | avp := { |
| 57 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_XRES), |
| 58 | avp_data := { |
| 59 | avp_AAA_3GPP_XRES := xres |
| 60 | } |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | /* TS 29.272 7.3.55 XRES */ |
| 65 | template (value) GenericAVP ts_AVP_AUTN(template (value) octetstring autn) := { |
| 66 | avp := { |
| 67 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_AUTN), |
| 68 | avp_data := { |
| 69 | avp_AAA_3GPP_AUTN := autn |
| 70 | } |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | /* TS 29.272 7.3.56 KASME */ |
| 75 | template (value) GenericAVP ts_AVP_KASME(template (value) octetstring kasme) := { |
| 76 | avp := { |
| 77 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_KASME), |
| 78 | avp_data := { |
| 79 | avp_AAA_3GPP_KASME := kasme |
| 80 | } |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | /* TS 29.272 7.3.23 Item-Number */ |
| 85 | template (value) GenericAVP ts_AVP_ItemNumber(uint32_t num) := { |
| 86 | avp := { |
| 87 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_KASME), |
| 88 | avp_data := { |
| 89 | avp_AAA_3GPP_Item_Number := int2oct(num, 4) |
| 90 | } |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | /* TS 29.272 7.3.18 E-UTRAN Vector */ |
| 95 | template (value) GenericAVP ts_AVP_EutranVec(uint32_t item_num, octetstring rand, octetstring xres, |
| 96 | octetstring autn, octetstring kasme) := { |
| 97 | avp := { |
| 98 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_E_UTRAN_Vector), |
| 99 | avp_data := { |
| 100 | avp_AAA_3GPP_E_UTRAN_Vector := { |
| 101 | ts_AVP_ItemNumber(item_num), |
| 102 | ts_AVP_RAND(rand), |
| 103 | ts_AVP_XRES(xres), |
| 104 | ts_AVP_AUTN(autn), |
| 105 | ts_AVP_KASME(kasme) |
| 106 | } |
| 107 | } |
| 108 | } |
| 109 | } |
| 110 | |
| 111 | /* TS 29.272 7.3.2 Subscription-Data */ |
| 112 | template (value) GenericAVP ts_AVP_3GPP_SubscriptionData(template (value) AVP_list content) := { |
| 113 | avp := { |
| 114 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Subscription_Data), |
| 115 | avp_data := { |
| 116 | avp_AAA_3GPP_Subscription_Data := content |
| 117 | } |
| 118 | } |
| 119 | } |
| 120 | template (present) GenericAVP |
| 121 | tr_AVP_3GPP_SubscriptionData(template (present) AVP_list content := ?) := { |
| 122 | avp := { |
| 123 | avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Subscription_Data), |
| 124 | avp_data := { |
| 125 | avp_AAA_3GPP_Subscription_Data := content |
| 126 | } |
| 127 | } |
| 128 | } |
| 129 | |
| 130 | |
| 131 | /* TS 29.272 7.3.17 Authentication-Info */ |
| 132 | template (value) GenericAVP ts_AVP_3GPP_AuthInfo(template (value) AVP_list content) := { |
| 133 | avp := { |
| 134 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Authentication_Info), |
| 135 | avp_data := { |
| 136 | avp_AAA_3GPP_Authentication_Info := content |
| 137 | } |
| 138 | } |
| 139 | } |
| 140 | template (present) GenericAVP |
| 141 | tr_AVP_3GPP_AuthInfo(template (present) AVP_list content := ?) := { |
| 142 | avp := { |
| 143 | avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Authentication_Info), |
| 144 | avp_data := { |
| 145 | avp_AAA_3GPP_Authentication_Info := content |
| 146 | } |
| 147 | } |
| 148 | } |
| 149 | |
| 150 | /* TS 29.272 7.3.9 Visited-PLMN-Id */ |
| 151 | template (value) GenericAVP ts_AVP_3GPP_VisitedPlmnId(template (value) octetstring id) := { |
| 152 | avp := { |
| 153 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Visited_PLMN_Id), |
| 154 | avp_data := { |
| 155 | avp_AAA_3GPP_Visited_PLMN_Id := id |
| 156 | } |
| 157 | } |
| 158 | } |
| 159 | template (present) GenericAVP tr_AVP_3GPP_VisitedPlmnId(template (present) octetstring id := ?) := { |
| 160 | avp := { |
| 161 | avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Visited_PLMN_Id), |
| 162 | avp_data := { |
| 163 | avp_AAA_3GPP_Visited_PLMN_Id := id |
| 164 | } |
| 165 | } |
| 166 | } |
| 167 | |
| 168 | /* TS 29.272 7.3.13 RAT-Type */ |
| 169 | template (value) GenericAVP ts_AVP_PCC_3GPP_RatType(template (value) PCC_3GPP_RAT_Type rat_type) := { |
| 170 | avp := { |
| 171 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_PCC_3GPP_RAT_Type), |
| 172 | avp_data := { |
| 173 | avp_PCC_3GPP_RAT_Type := rat_type |
| 174 | } |
| 175 | } |
| 176 | } |
| 177 | template (present) GenericAVP tr_AVP_PCC_3GPP_RatType(template (present) PCC_3GPP_RAT_Type rat_type := ?) := { |
| 178 | avp := { |
| 179 | avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_PCC_3GPP_RAT_Type), |
| 180 | avp_data := { |
| 181 | avp_PCC_3GPP_RAT_Type := rat_type |
| 182 | } |
| 183 | } |
| 184 | } |
| 185 | |
| 186 | template (present) GenericAVP tr_AVP_GI_3GPP_RatType(template (present) GI_3GPP_3GPP_RAT_Type rat_type := ?) := { |
| 187 | avp := { |
| 188 | avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_GI_3GPP_3GPP_RAT_Type), |
| 189 | avp_data := { |
| 190 | avp_GI_3GPP_3GPP_RAT_Type := rat_type |
| 191 | } |
| 192 | } |
| 193 | } |
| 194 | |
| 195 | /* TS 29.272 7.3.7 ULR-Flags */ |
| 196 | template (value) GenericAVP ts_AVP_3GPP_UlrFlags(template (value) UINT32 flags) := { |
| 197 | avp := { |
| 198 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_ULR_Flags), |
| 199 | avp_data := { |
| 200 | avp_AAA_3GPP_ULR_Flags := flags |
| 201 | } |
| 202 | } |
| 203 | } |
| 204 | template (present) GenericAVP tr_AVP_3GPP_UlrFlags(template (present) UINT32 flags := ?) := { |
| 205 | avp := { |
| 206 | avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_ULR_Flags), |
| 207 | avp_data := { |
| 208 | avp_AAA_3GPP_ULR_Flags := flags |
| 209 | } |
| 210 | } |
| 211 | } |
| 212 | |
| 213 | /* TS 29.272 7.3.8 ULA-Flags */ |
| 214 | template (value) GenericAVP ts_AVP_3GPP_UlaFlags(template (value) UINT32 flags) := { |
| 215 | avp := { |
| 216 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_ULA_Flags), |
| 217 | avp_data := { |
| 218 | avp_AAA_3GPP_ULA_Flags := flags |
| 219 | } |
| 220 | } |
| 221 | } |
| 222 | template (present) GenericAVP tr_AVP_3GPP_UlaFlags(template (present) UINT32 flags := ?) := { |
| 223 | avp := { |
| 224 | avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_ULA_Flags), |
| 225 | avp_data := { |
| 226 | avp_AAA_3GPP_ULA_Flags := flags |
| 227 | } |
| 228 | } |
| 229 | } |
| 230 | |
| 231 | |
| 232 | /* TS 29.272 7.3.27 Context-Identifier */ |
| 233 | template (present) GenericAVP tr_AVP_3GPP_ContextId(template (present) uint32_t ctx := ?) := { |
| 234 | avp := { |
| 235 | avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Context_Identifier), |
| 236 | avp_data := { |
| 237 | avp_AAA_3GPP_Context_Identifier := int2oct_tmpl(ctx, 4) |
| 238 | } |
| 239 | } |
| 240 | } |
| 241 | template (value) GenericAVP ts_AVP_3GPP_ContextId(uint32_t ctx) := { |
| 242 | avp := { |
| 243 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Context_Identifier), |
| 244 | avp_data := { |
| 245 | avp_AAA_3GPP_Context_Identifier := int2oct(ctx, 4) |
| 246 | } |
| 247 | } |
| 248 | } |
| 249 | |
| 250 | /* Ts 29.272 7.3.29 Subscriber-Status */ |
| 251 | template (present) GenericAVP tr_AVP_3GPP_SubscriberStatus(template (present) AAA_3GPP_Subscriber_Status sts) := { |
| 252 | avp := { |
| 253 | avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Subscriber_Status), |
| 254 | avp_data := { |
| 255 | avp_AAA_3GPP_Subscriber_Status := sts |
| 256 | } |
| 257 | } |
| 258 | } |
| 259 | template (value) GenericAVP ts_AVP_3GPP_SubscriberStatus(template (value) AAA_3GPP_Subscriber_Status sts) := { |
| 260 | avp := { |
| 261 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Subscriber_Status), |
| 262 | avp_data := { |
| 263 | avp_AAA_3GPP_Subscriber_Status := sts |
| 264 | } |
| 265 | } |
| 266 | } |
| 267 | |
| 268 | /* Ts 29.272 7.3.30 Operator-Determined-Barring */ |
| 269 | template (present) GenericAVP tr_AVP_3GPP_OperatorDeterminedBarring(template (present) uint32_t val := ?) := { |
| 270 | avp := { |
| 271 | avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Operator_Determined_Barring), |
| 272 | avp_data := { |
| 273 | avp_AAA_3GPP_Operator_Determined_Barring := int2oct_tmpl(val, 4) |
| 274 | } |
| 275 | } |
| 276 | } |
| 277 | template (value) GenericAVP ts_AVP_3GPP_OperatorDeterminedBarring(uint32_t val) := { |
| 278 | avp := { |
| 279 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Operator_Determined_Barring), |
| 280 | avp_data := { |
| 281 | avp_AAA_3GPP_Operator_Determined_Barring := int2oct(val, 4) |
| 282 | } |
| 283 | } |
| 284 | } |
| 285 | |
| 286 | /* TS 29.272 7.3.33 All-APN-Configurations-Included-Indicator */ |
| 287 | template (present) GenericAVP tr_AVP_3GPP_AllApnConfigsIncl(template (present) AAA_3GPP_All_APN_Configurations_Included_Indicator ind := ?) := { |
| 288 | avp := { |
| 289 | avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_All_APN_Configurations_Included_Indicator), |
| 290 | avp_data := { |
| 291 | avp_AAA_3GPP_All_APN_Configurations_Included_Indicator := ind |
| 292 | } |
| 293 | } |
| 294 | } |
| 295 | template (value) GenericAVP ts_AVP_3GPP_AllApnConfigsIncl(template (value) AAA_3GPP_All_APN_Configurations_Included_Indicator ind := All_APN_CONFIGURATIONS_INCLUDED) := { |
| 296 | avp := { |
| 297 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_All_APN_Configurations_Included_Indicator), |
| 298 | avp_data := { |
| 299 | avp_AAA_3GPP_All_APN_Configurations_Included_Indicator := ind |
| 300 | } |
| 301 | } |
| 302 | } |
| 303 | |
Pau Espin Pedrol | e6e2460 | 2023-12-21 19:09:52 +0100 | [diff] [blame] | 304 | /* TS 29.272 7.3.24 Cancellation-Type */ |
| 305 | template (value) GenericAVP ts_AVP_3GPP_CancellationType(template (value) AAA_3GPP_Cancellation_Type t) := { |
| 306 | avp := { |
| 307 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Cancellation_Type), |
| 308 | avp_data := { |
| 309 | avp_AAA_3GPP_Cancellation_Type := t |
| 310 | } |
| 311 | } |
| 312 | } |
| 313 | |
Pau Espin Pedrol | 117a94f | 2023-12-21 16:10:12 +0100 | [diff] [blame] | 314 | /* TS 29.272 7.3.34 APN-Configuration-Profile */ |
| 315 | template (present) GenericAVP tr_AVP_3GPP_ApnConfigProfile(template (present) AVP_list content := ?) := { |
| 316 | avp := { |
| 317 | avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_APN_Configuration_Profile), |
| 318 | avp_data := { |
| 319 | avp_AAA_3GPP_APN_Configuration_Profile := content |
| 320 | } |
| 321 | } |
| 322 | } |
| 323 | template (value) GenericAVP ts_AVP_3GPP_ApnConfigProfile(template (value) AVP_list content) := { |
| 324 | avp := { |
| 325 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_APN_Configuration_Profile), |
| 326 | avp_data := { |
| 327 | avp_AAA_3GPP_APN_Configuration_Profile := content |
| 328 | } |
| 329 | } |
| 330 | } |
| 331 | |
| 332 | /* TS 29.272 7.3.35 APN-Configuration */ |
| 333 | template (present) GenericAVP tr_AVP_3GPP_ApnConfig(template (present) uint32_t ctx := ?, |
| 334 | template (present) AAA_3GPP_PDN_Type pdn_type := ?, |
| 335 | template (present) charstring apn := ?) := { |
| 336 | avp := { |
| 337 | avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_APN_Configuration), |
| 338 | avp_data := { |
| 339 | avp_AAA_3GPP_APN_Configuration := superset( |
| 340 | tr_AVP_3GPP_ContextId(ctx), |
| 341 | tr_AVP_3GPP_PdnType(pdn_type), |
| 342 | tr_AVP_ServiceSelection(apn), |
| 343 | tr_AVP_3GPP_EpsSubscrQosProfile(?, ?) |
| 344 | ) |
| 345 | } |
| 346 | } |
| 347 | } |
| 348 | template (value) GenericAVP ts_AVP_3GPP_ApnConfig(uint32_t ctx, AAA_3GPP_PDN_Type pdn_type, |
| 349 | charstring apn) := { |
| 350 | avp := { |
| 351 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_APN_Configuration), |
| 352 | avp_data := { |
| 353 | avp_AAA_3GPP_APN_Configuration := { |
| 354 | ts_AVP_3GPP_ContextId(ctx), |
| 355 | ts_AVP_3GPP_PdnType(pdn_type), |
| 356 | ts_AVP_ServiceSelection(apn), |
| 357 | ts_AVP_3GPP_EpsSubscrQosProfile(1, 1) |
| 358 | } |
| 359 | } |
| 360 | } |
| 361 | } |
| 362 | |
| 363 | |
| 364 | /* TS 29.272 7.3.41 AMBR */ |
| 365 | template (present) GenericAVP tr_AVP_3GPP_AMBR(template (present) uint32_t ul := ?, template (present) uint32_t dl := ?) := { |
| 366 | avp := { |
| 367 | avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_AMBR), |
| 368 | avp_data := { |
| 369 | avp_AAA_3GPP_AMBR := { |
| 370 | tr_AVP_3GPP_MaxReqBwUL(ul), |
| 371 | tr_AVP_3GPP_MaxReqBwDL(dl) |
| 372 | } |
| 373 | } |
| 374 | } |
| 375 | } |
| 376 | template (value) GenericAVP ts_AVP_3GPP_AMBR(uint32_t ul, uint32_t dl) := { |
| 377 | avp := { |
| 378 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_AMBR), |
| 379 | avp_data := { |
| 380 | avp_AAA_3GPP_AMBR := { |
| 381 | ts_AVP_3GPP_MaxReqBwUL(ul), |
| 382 | ts_AVP_3GPP_MaxReqBwDL(dl) |
| 383 | } |
| 384 | } |
| 385 | } |
| 386 | } |
| 387 | |
| 388 | template (present) GenericAVP tr_AVP_3GPP_MaxReqBwUL(template (present) uint32_t bw := ?) := { |
| 389 | avp := { |
| 390 | avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_RX_3GPP_Max_Requested_Bandwidth_UL), |
| 391 | avp_data := { |
| 392 | avp_RX_3GPP_Max_Requested_Bandwidth_UL := int2oct_tmpl(bw, 4) |
| 393 | } |
| 394 | } |
| 395 | } |
| 396 | |
| 397 | template (value) GenericAVP ts_AVP_3GPP_MaxReqBwUL(uint32_t bw) := { |
| 398 | avp := { |
| 399 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_RX_3GPP_Max_Requested_Bandwidth_UL), |
| 400 | avp_data := { |
| 401 | avp_RX_3GPP_Max_Requested_Bandwidth_UL := int2oct(bw, 4) |
| 402 | } |
| 403 | } |
| 404 | } |
| 405 | |
| 406 | template (present) GenericAVP tr_AVP_3GPP_MaxReqBwDL(template (present) uint32_t bw := ?) := { |
| 407 | avp := { |
| 408 | avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_RX_3GPP_Max_Requested_Bandwidth_DL), |
| 409 | avp_data := { |
| 410 | avp_RX_3GPP_Max_Requested_Bandwidth_DL := int2oct_tmpl(bw, 4) |
| 411 | } |
| 412 | } |
| 413 | } |
| 414 | |
| 415 | template (value) GenericAVP ts_AVP_3GPP_MaxReqBwDL(uint32_t bw) := { |
| 416 | avp := { |
| 417 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_RX_3GPP_Max_Requested_Bandwidth_DL), |
| 418 | avp_data := { |
| 419 | avp_RX_3GPP_Max_Requested_Bandwidth_DL := int2oct(bw, 4) |
| 420 | } |
| 421 | } |
| 422 | } |
| 423 | |
| 424 | /* TS 29.272 7.3.62 PDN-Type */ |
| 425 | template (present) GenericAVP tr_AVP_3GPP_PdnType(template (present) AAA_3GPP_PDN_Type pdn_type := ?) := { |
| 426 | avp := { |
| 427 | avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_PDN_Type), |
| 428 | avp_data := { |
| 429 | avp_AAA_3GPP_PDN_Type := pdn_type |
| 430 | } |
| 431 | } |
| 432 | } |
| 433 | template (value) GenericAVP ts_AVP_3GPP_PdnType(template (value) AAA_3GPP_PDN_Type pdn_type) := { |
| 434 | avp := { |
| 435 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_PDN_Type), |
| 436 | avp_data := { |
| 437 | avp_AAA_3GPP_PDN_Type := pdn_type |
| 438 | } |
| 439 | } |
| 440 | } |
| 441 | |
| 442 | |
| 443 | /* TS 29.272 5.2.3.1 + 7.2.6 Authentication Information Answer */ |
| 444 | template (value) PDU_DIAMETER |
| 445 | ts_DIA_AIA(template (value) AVP_list auth_info_contents, |
| 446 | template (value) octetstring sess_id := c_def_sess_id, |
| 447 | template (value) charstring orig_host := "hss.localdomain", |
| 448 | template (value) charstring orig_realm := "localdomain", |
| 449 | template (value) UINT32 hbh_id := '00000000'O, |
| 450 | template (value) UINT32 ete_id := '00000000'O) := |
| 451 | ts_DIAMETER(flags := '01000000'B, |
| 452 | cmd_code := Authentication_Information, |
| 453 | app_id := int2oct(c_DIAMETER_3GPP_S6_AID, 4), |
| 454 | hbh_id := hbh_id, |
| 455 | ete_id := ete_id, |
| 456 | avps := { |
| 457 | ts_AVP_SessionId(sess_id), |
| 458 | ts_AVP_ResultCode(DIAMETER_SUCCESS), |
| 459 | ts_AVP_AuthSessionState(NO_STATE_MAINTAINED), |
| 460 | ts_AVP_OriginHost(orig_host), |
| 461 | ts_AVP_OriginRealm(orig_realm), |
| 462 | ts_AVP_3GPP_AuthInfo(auth_info_contents) |
| 463 | }); |
| 464 | template (present) PDU_DIAMETER |
| 465 | tr_DIA_AIA(template (present) AVP_list auth_info_contents := ?, |
| 466 | template (present) octetstring sess_id := ?, |
| 467 | template (present) charstring orig_host := ?, |
| 468 | template (present) charstring orig_realm := ?, |
| 469 | template (present) UINT32 hbh_id := ?, |
| 470 | template (present) UINT32 ete_id := ?) := |
| 471 | tr_DIAMETER(flags := '0???????'B, |
| 472 | cmd_code := Authentication_Information, |
| 473 | app_id := int2oct(c_DIAMETER_3GPP_S6_AID, 4), |
| 474 | hbh_id := hbh_id, |
| 475 | ete_id := ete_id, |
| 476 | avps := superset( |
| 477 | tr_AVP_SessionId(sess_id), |
| 478 | tr_AVP_AuthSessionState(NO_STATE_MAINTAINED), |
| 479 | tr_AVP_OriginHost(orig_host), |
| 480 | tr_AVP_OriginRealm(orig_realm), |
| 481 | tr_AVP_ResultCode(DIAMETER_SUCCESS), |
| 482 | tr_AVP_3GPP_AuthInfo(auth_info_contents) |
| 483 | )); |
| 484 | template (present) PDU_DIAMETER |
| 485 | tr_DIA_AIA_ERR(template (present) GenericAVP err_avp := ?, |
| 486 | template (present) octetstring sess_id := ?, |
| 487 | template (present) charstring orig_host := ?, |
| 488 | template (present) charstring orig_realm := ?, |
| 489 | template (present) UINT32 hbh_id := ?, |
| 490 | template (present) UINT32 ete_id := ?) := |
| 491 | tr_DIAMETER(flags := '0???????'B, |
| 492 | cmd_code := Authentication_Information, |
| 493 | app_id := int2oct(c_DIAMETER_3GPP_S6_AID, 4), |
| 494 | hbh_id := hbh_id, |
| 495 | ete_id := ete_id, |
| 496 | avps := superset( |
| 497 | tr_AVP_SessionId(sess_id), |
| 498 | tr_AVP_AuthSessionState(NO_STATE_MAINTAINED), |
| 499 | tr_AVP_OriginHost(orig_host), |
| 500 | tr_AVP_OriginRealm(orig_realm), |
| 501 | err_avp |
| 502 | )); |
| 503 | |
| 504 | |
| 505 | /* TS 29.272 7.2.3 Update Location Request */ |
| 506 | template (value) PDU_DIAMETER |
| 507 | ts_DIA_ULR(/* template (value) */ hexstring imsi, |
| 508 | template (value) octetstring mcc_mnc := '111F11'O, |
| 509 | template (value) octetstring sess_id := c_def_sess_id, |
| 510 | template (value) charstring orig_host := "ttcn3.localdomain", |
| 511 | template (value) charstring orig_realm := "localdomain", |
| 512 | template (value) charstring dest_realm := "localdomain", |
| 513 | template (value) UINT32 hbh_id := '00000000'O, |
| 514 | template (value) UINT32 ete_id := '00000000'O) := |
| 515 | ts_DIAMETER(flags := '11000000'B, |
| 516 | cmd_code := Update_Location, |
| 517 | app_id := int2oct(c_DIAMETER_3GPP_S6_AID, 4), |
| 518 | hbh_id := hbh_id, |
| 519 | ete_id := ete_id, |
| 520 | avps := { |
| 521 | ts_AVP_SessionId(sess_id), |
| 522 | ts_AVP_AuthSessionState(NO_STATE_MAINTAINED), |
| 523 | ts_AVP_UserNameImsi(imsi), |
| 524 | ts_AVP_3GPP_UlrFlags('00000000'O), |
| 525 | ts_AVP_3GPP_VisitedPlmnId(mcc_mnc), |
| 526 | ts_AVP_PCC_3GPP_RatType(EUTRAN), |
| 527 | ts_AVP_OriginHost(orig_host), |
| 528 | ts_AVP_OriginRealm(orig_realm), |
| 529 | ts_AVP_DestinationRealm(dest_realm) |
| 530 | }); |
| 531 | template (present) PDU_DIAMETER |
| 532 | tr_DIA_ULR(/* template (present) */ hexstring imsi, |
| 533 | template (present) octetstring sess_id := ?, |
| 534 | template (present) charstring orig_host := ?, |
| 535 | template (present) charstring orig_realm := ?, |
| 536 | template (present) charstring dest_realm := ?, |
| 537 | template (present) UINT32 hbh_id := ?, |
| 538 | template (present) UINT32 ete_id := ?) := |
| 539 | tr_DIAMETER(flags := '11000000'B, |
| 540 | cmd_code := Update_Location, |
| 541 | app_id := int2oct(c_DIAMETER_3GPP_S6_AID, 4), |
| 542 | hbh_id := hbh_id, |
| 543 | ete_id := ete_id, |
| 544 | avps := superset( |
| 545 | tr_AVP_SessionId(sess_id), |
| 546 | tr_AVP_AuthSessionState, |
| 547 | tr_AVP_OriginHost(orig_host), |
| 548 | tr_AVP_OriginRealm(orig_realm), |
| 549 | tr_AVP_DestinationRealm(dest_realm), |
| 550 | tr_AVP_UserNameImsi(imsi), |
| 551 | tr_AVP_PCC_3GPP_RatType, |
| 552 | tr_AVP_3GPP_UlrFlags, |
| 553 | tr_AVP_3GPP_VisitedPlmnId |
| 554 | )); |
| 555 | |
| 556 | template (value) PDU_DIAMETER |
| 557 | ts_DIA_ULA(template (value) AVP_list sub_data, |
| 558 | template (value) octetstring sess_id := c_def_sess_id, |
| 559 | template (value) charstring orig_host := "hss.localdomain", |
| 560 | template (value) charstring orig_realm := "localdomain", |
| 561 | template (value) UINT32 hbh_id := '00000000'O, |
| 562 | template (value) UINT32 ete_id := '00000000'O) := |
| 563 | ts_DIAMETER(flags:='01000000'B, |
| 564 | cmd_code := Update_Location, |
| 565 | app_id := int2oct(c_DIAMETER_3GPP_S6_AID, 4), |
| 566 | hbh_id := hbh_id, |
| 567 | ete_id := ete_id, |
| 568 | avps := { |
| 569 | ts_AVP_SessionId(sess_id), |
| 570 | ts_AVP_ResultCode(DIAMETER_SUCCESS), /* optional */ |
| 571 | ts_AVP_AuthSessionState(NO_STATE_MAINTAINED), |
| 572 | ts_AVP_OriginHost(orig_host), |
| 573 | ts_AVP_OriginRealm(orig_realm), |
| 574 | ts_AVP_3GPP_UlaFlags('00000002'O), |
| 575 | ts_AVP_3GPP_SubscriptionData(sub_data) |
| 576 | }); |
| 577 | template (present) PDU_DIAMETER |
| 578 | tr_DIA_ULA(template (present) AVP_list sub_data := ?, |
| 579 | template (present) octetstring sess_id := ?, |
| 580 | template (present) charstring orig_host := ?, |
| 581 | template (present) charstring orig_realm := ?, |
| 582 | template (present) UINT32 hbh_id := ?, |
| 583 | template (present) UINT32 ete_id := ?) := |
| 584 | tr_DIAMETER(flags := '0???????'B, |
| 585 | cmd_code := Update_Location, |
| 586 | app_id := int2oct(c_DIAMETER_3GPP_S6_AID, 4), |
| 587 | hbh_id := hbh_id, |
| 588 | ete_id := ete_id, |
| 589 | avps := superset( |
| 590 | tr_AVP_SessionId(sess_id), |
| 591 | tr_AVP_ResultCode(DIAMETER_SUCCESS), |
| 592 | tr_AVP_AuthSessionState, |
| 593 | tr_AVP_OriginHost(orig_host), |
| 594 | tr_AVP_OriginRealm(orig_realm), |
| 595 | tr_AVP_3GPP_UlaFlags, |
| 596 | tr_AVP_3GPP_SubscriptionData(sub_data) |
| 597 | )); |
| 598 | |
| 599 | /* TS 29.272 7.2.5 Authentication-Information-Request */ |
| 600 | template (value) PDU_DIAMETER |
| 601 | ts_DIA_AIR(/* template (value) */ hexstring imsi, |
| 602 | template (value) octetstring mcc_mnc := '111F11'O, |
| 603 | template (value) octetstring sess_id := c_def_sess_id, |
| 604 | template (value) charstring orig_host := "ttcn3.localdomain", |
| 605 | template (value) charstring orig_realm := "localdomain", |
| 606 | template (value) charstring dest_realm := "localdomain", |
| 607 | template (value) UINT32 hbh_id := '00000000'O, |
| 608 | template (value) UINT32 ete_id := '00000000'O) := |
| 609 | ts_DIAMETER(flags := '11000000'B, |
| 610 | cmd_code := Authentication_Information, |
| 611 | app_id := int2oct(c_DIAMETER_3GPP_S6_AID, 4), |
| 612 | hbh_id := hbh_id, |
| 613 | ete_id := ete_id, |
| 614 | avps := { |
| 615 | ts_AVP_SessionId(sess_id), |
| 616 | ts_AVP_DestinationRealm(dest_realm), |
| 617 | ts_AVP_OriginHost(orig_host), |
| 618 | ts_AVP_OriginRealm(orig_realm), |
| 619 | ts_AVP_UserNameImsi(imsi), |
| 620 | /* Requested EUTRAN Auth Info */ |
| 621 | ts_AVP_RequestedEutranAuthInfo, |
| 622 | ts_AVP_AuthSessionState(NO_STATE_MAINTAINED), |
| 623 | ts_AVP_3GPP_VisitedPlmnId(mcc_mnc) |
| 624 | }); |
| 625 | template (present) PDU_DIAMETER |
| 626 | tr_DIA_AIR(/* template (present) */ hexstring imsi, |
| 627 | template (present) octetstring sess_id := ?, |
| 628 | template (present) charstring dest_realm := ?, |
| 629 | template (present) UINT32 hbh_id := ?, |
| 630 | template (present) UINT32 ete_id := ?) := |
| 631 | tr_DIAMETER(flags := '1???????'B, |
| 632 | cmd_code := Authentication_Information, |
| 633 | app_id := int2oct(c_DIAMETER_3GPP_S6_AID, 4), |
| 634 | hbh_id := hbh_id, ete_id := ete_id, |
| 635 | avps := superset( |
| 636 | tr_AVP_SessionId(sess_id), |
| 637 | tr_AVP_DestinationRealm(dest_realm), |
| 638 | tr_AVP_UserNameImsi(imsi), |
| 639 | tr_AVP_3GPP_VisitedPlmnId |
| 640 | )); |
| 641 | |
Pau Espin Pedrol | e6e2460 | 2023-12-21 19:09:52 +0100 | [diff] [blame] | 642 | /* TS 29.272 7.2.7 Cancel-Location-Request */ |
| 643 | template (value) PDU_DIAMETER |
| 644 | ts_DIA_CLR(/* template (value) */ hexstring imsi, |
| 645 | template (value) AAA_3GPP_Cancellation_Type cancel_type, |
| 646 | template (value) octetstring sess_id := c_def_sess_id, |
| 647 | template (value) charstring orig_host := "ttcn3.localdomain", |
| 648 | template (value) charstring orig_realm := "localdomain", |
| 649 | template (value) charstring dest_host := "iut.localdomain", |
| 650 | template (value) charstring dest_realm := "localdomain", |
| 651 | template (value) UINT32 hbh_id := '00000000'O, |
| 652 | template (value) UINT32 ete_id := '00000000'O) := |
| 653 | ts_DIAMETER(flags := '11000000'B, |
| 654 | cmd_code := Cancel_Location, |
| 655 | app_id := int2oct(c_DIAMETER_3GPP_S6_AID, 4), |
| 656 | hbh_id := hbh_id, |
| 657 | ete_id := ete_id, |
| 658 | avps := { |
| 659 | ts_AVP_SessionId(sess_id), |
| 660 | ts_AVP_AuthSessionState(NO_STATE_MAINTAINED), |
| 661 | ts_AVP_OriginHost(orig_host), |
| 662 | ts_AVP_OriginRealm(orig_realm), |
| 663 | ts_AVP_DestinationHost(dest_host), |
| 664 | ts_AVP_DestinationRealm(dest_realm), |
| 665 | ts_AVP_UserNameImsi(imsi), |
| 666 | /* [Supported-Features ] */ |
| 667 | ts_AVP_3GPP_CancellationType(cancel_type) |
| 668 | }); |
| 669 | |
| 670 | /* TS 29.272 7.2.8 Cancel-Location-Answer */ |
| 671 | template (present) PDU_DIAMETER |
| 672 | tr_DIA_CLA(template (present) AVP_list sub_data := ?, |
| 673 | template (present) octetstring sess_id := ?, |
| 674 | template (present) charstring orig_host := ?, |
| 675 | template (present) charstring orig_realm := ?, |
| 676 | template (present) UINT32 hbh_id := ?, |
| 677 | template (present) UINT32 ete_id := ?) := |
| 678 | tr_DIAMETER(flags := '0???????'B, |
| 679 | cmd_code := Cancel_Location, |
| 680 | app_id := int2oct(c_DIAMETER_3GPP_S6_AID, 4), |
| 681 | hbh_id := hbh_id, |
| 682 | ete_id := ete_id, |
| 683 | avps := superset( |
| 684 | tr_AVP_SessionId(sess_id), |
| 685 | tr_AVP_ResultCode(DIAMETER_SUCCESS), |
| 686 | tr_AVP_AuthSessionState, |
| 687 | tr_AVP_OriginHost(orig_host), |
| 688 | tr_AVP_OriginRealm(orig_realm) |
| 689 | )); |
| 690 | |
| 691 | } /* module */ |