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 | } |
Pau Espin Pedrol | 5154e35 | 2024-03-05 13:23:40 +0100 | [diff] [blame] | 241 | template (value) GenericAVP ts_AVP_3GPP_ContextId(template (value) uint32_t ctx) := { |
Pau Espin Pedrol | 117a94f | 2023-12-21 16:10:12 +0100 | [diff] [blame] | 242 | avp := { |
| 243 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_Context_Identifier), |
| 244 | avp_data := { |
Pau Espin Pedrol | 5154e35 | 2024-03-05 13:23:40 +0100 | [diff] [blame] | 245 | avp_AAA_3GPP_Context_Identifier := int2oct(valueof(ctx), 4) |
Pau Espin Pedrol | 117a94f | 2023-12-21 16:10:12 +0100 | [diff] [blame] | 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 | } |
Pau Espin Pedrol | 5154e35 | 2024-03-05 13:23:40 +0100 | [diff] [blame] | 348 | template (value) GenericAVP ts_AVP_3GPP_ApnConfig(template (value) uint32_t ctx, |
| 349 | template (value) AAA_3GPP_PDN_Type pdn_type, |
| 350 | template (value) charstring apn) := { |
Pau Espin Pedrol | 117a94f | 2023-12-21 16:10:12 +0100 | [diff] [blame] | 351 | avp := { |
| 352 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_APN_Configuration), |
| 353 | avp_data := { |
| 354 | avp_AAA_3GPP_APN_Configuration := { |
| 355 | ts_AVP_3GPP_ContextId(ctx), |
| 356 | ts_AVP_3GPP_PdnType(pdn_type), |
| 357 | ts_AVP_ServiceSelection(apn), |
| 358 | ts_AVP_3GPP_EpsSubscrQosProfile(1, 1) |
| 359 | } |
| 360 | } |
| 361 | } |
| 362 | } |
| 363 | |
Pau Espin Pedrol | 5154e35 | 2024-03-05 13:23:40 +0100 | [diff] [blame] | 364 | /* Service-Selection, TS 29.272 7.3.36, TS 29.273 5.2.3.5, (RFC 5778) */ |
| 365 | template (present) GenericAVP tr_AVP_ServiceSelection(template (present) charstring apn := ?) := { |
| 366 | avp := { |
| 367 | avp_header := tr_DIA_Hdr(c_AVP_Code_MIPv6_NONE_Service_Selection), |
| 368 | avp_data := { |
| 369 | avp_MIPv6_NONE_Service_Selection := char2oct_tmpl(apn) |
| 370 | } |
| 371 | } |
| 372 | } |
| 373 | template (value) GenericAVP ts_AVP_ServiceSelection(template (value) charstring apn) := { |
| 374 | avp := { |
| 375 | avp_header := ts_DIA_Hdr(c_AVP_Code_MIPv6_NONE_Service_Selection), |
| 376 | avp_data := { |
| 377 | avp_MIPv6_NONE_Service_Selection := char2oct(valueof(apn)) |
| 378 | } |
| 379 | } |
| 380 | } |
Pau Espin Pedrol | 117a94f | 2023-12-21 16:10:12 +0100 | [diff] [blame] | 381 | |
| 382 | /* TS 29.272 7.3.41 AMBR */ |
| 383 | template (present) GenericAVP tr_AVP_3GPP_AMBR(template (present) uint32_t ul := ?, template (present) uint32_t dl := ?) := { |
| 384 | avp := { |
| 385 | avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_AMBR), |
| 386 | avp_data := { |
| 387 | avp_AAA_3GPP_AMBR := { |
| 388 | tr_AVP_3GPP_MaxReqBwUL(ul), |
| 389 | tr_AVP_3GPP_MaxReqBwDL(dl) |
| 390 | } |
| 391 | } |
| 392 | } |
| 393 | } |
Pau Espin Pedrol | 5154e35 | 2024-03-05 13:23:40 +0100 | [diff] [blame] | 394 | template (value) GenericAVP ts_AVP_3GPP_AMBR(template (value) uint32_t ul, |
| 395 | template (value) uint32_t dl) := { |
Pau Espin Pedrol | 117a94f | 2023-12-21 16:10:12 +0100 | [diff] [blame] | 396 | avp := { |
| 397 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_AMBR), |
| 398 | avp_data := { |
| 399 | avp_AAA_3GPP_AMBR := { |
| 400 | ts_AVP_3GPP_MaxReqBwUL(ul), |
| 401 | ts_AVP_3GPP_MaxReqBwDL(dl) |
| 402 | } |
| 403 | } |
| 404 | } |
| 405 | } |
| 406 | |
| 407 | template (present) GenericAVP tr_AVP_3GPP_MaxReqBwUL(template (present) uint32_t bw := ?) := { |
| 408 | avp := { |
| 409 | avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_RX_3GPP_Max_Requested_Bandwidth_UL), |
| 410 | avp_data := { |
| 411 | avp_RX_3GPP_Max_Requested_Bandwidth_UL := int2oct_tmpl(bw, 4) |
| 412 | } |
| 413 | } |
| 414 | } |
| 415 | |
Pau Espin Pedrol | 5154e35 | 2024-03-05 13:23:40 +0100 | [diff] [blame] | 416 | template (value) GenericAVP ts_AVP_3GPP_MaxReqBwUL(template (value) uint32_t bw) := { |
Pau Espin Pedrol | 117a94f | 2023-12-21 16:10:12 +0100 | [diff] [blame] | 417 | avp := { |
| 418 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_RX_3GPP_Max_Requested_Bandwidth_UL), |
| 419 | avp_data := { |
Pau Espin Pedrol | 5154e35 | 2024-03-05 13:23:40 +0100 | [diff] [blame] | 420 | avp_RX_3GPP_Max_Requested_Bandwidth_UL := int2oct(valueof(bw), 4) |
Pau Espin Pedrol | 117a94f | 2023-12-21 16:10:12 +0100 | [diff] [blame] | 421 | } |
| 422 | } |
| 423 | } |
| 424 | |
| 425 | template (present) GenericAVP tr_AVP_3GPP_MaxReqBwDL(template (present) uint32_t bw := ?) := { |
| 426 | avp := { |
| 427 | avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_RX_3GPP_Max_Requested_Bandwidth_DL), |
| 428 | avp_data := { |
| 429 | avp_RX_3GPP_Max_Requested_Bandwidth_DL := int2oct_tmpl(bw, 4) |
| 430 | } |
| 431 | } |
| 432 | } |
| 433 | |
Pau Espin Pedrol | 5154e35 | 2024-03-05 13:23:40 +0100 | [diff] [blame] | 434 | template (value) GenericAVP ts_AVP_3GPP_MaxReqBwDL(template (value) uint32_t bw) := { |
Pau Espin Pedrol | 117a94f | 2023-12-21 16:10:12 +0100 | [diff] [blame] | 435 | avp := { |
| 436 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_RX_3GPP_Max_Requested_Bandwidth_DL), |
| 437 | avp_data := { |
Pau Espin Pedrol | 5154e35 | 2024-03-05 13:23:40 +0100 | [diff] [blame] | 438 | avp_RX_3GPP_Max_Requested_Bandwidth_DL := int2oct(valueof(bw), 4) |
Pau Espin Pedrol | 117a94f | 2023-12-21 16:10:12 +0100 | [diff] [blame] | 439 | } |
| 440 | } |
| 441 | } |
| 442 | |
| 443 | /* TS 29.272 7.3.62 PDN-Type */ |
| 444 | template (present) GenericAVP tr_AVP_3GPP_PdnType(template (present) AAA_3GPP_PDN_Type pdn_type := ?) := { |
| 445 | avp := { |
| 446 | avp_header := tr_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_PDN_Type), |
| 447 | avp_data := { |
| 448 | avp_AAA_3GPP_PDN_Type := pdn_type |
| 449 | } |
| 450 | } |
| 451 | } |
| 452 | template (value) GenericAVP ts_AVP_3GPP_PdnType(template (value) AAA_3GPP_PDN_Type pdn_type) := { |
| 453 | avp := { |
| 454 | avp_header := ts_DIA_Hdr_3GPP(c_AVP_Code_AAA_3GPP_PDN_Type), |
| 455 | avp_data := { |
| 456 | avp_AAA_3GPP_PDN_Type := pdn_type |
| 457 | } |
| 458 | } |
| 459 | } |
| 460 | |
| 461 | |
| 462 | /* TS 29.272 5.2.3.1 + 7.2.6 Authentication Information Answer */ |
| 463 | template (value) PDU_DIAMETER |
| 464 | ts_DIA_AIA(template (value) AVP_list auth_info_contents, |
| 465 | template (value) octetstring sess_id := c_def_sess_id, |
| 466 | template (value) charstring orig_host := "hss.localdomain", |
| 467 | template (value) charstring orig_realm := "localdomain", |
| 468 | template (value) UINT32 hbh_id := '00000000'O, |
| 469 | template (value) UINT32 ete_id := '00000000'O) := |
| 470 | ts_DIAMETER(flags := '01000000'B, |
| 471 | cmd_code := Authentication_Information, |
| 472 | app_id := int2oct(c_DIAMETER_3GPP_S6_AID, 4), |
| 473 | hbh_id := hbh_id, |
| 474 | ete_id := ete_id, |
| 475 | avps := { |
| 476 | ts_AVP_SessionId(sess_id), |
| 477 | ts_AVP_ResultCode(DIAMETER_SUCCESS), |
| 478 | ts_AVP_AuthSessionState(NO_STATE_MAINTAINED), |
| 479 | ts_AVP_OriginHost(orig_host), |
| 480 | ts_AVP_OriginRealm(orig_realm), |
| 481 | ts_AVP_3GPP_AuthInfo(auth_info_contents) |
| 482 | }); |
| 483 | template (present) PDU_DIAMETER |
| 484 | tr_DIA_AIA(template (present) AVP_list auth_info_contents := ?, |
| 485 | template (present) octetstring sess_id := ?, |
| 486 | template (present) charstring orig_host := ?, |
| 487 | template (present) charstring orig_realm := ?, |
| 488 | template (present) UINT32 hbh_id := ?, |
| 489 | template (present) UINT32 ete_id := ?) := |
| 490 | tr_DIAMETER(flags := '0???????'B, |
| 491 | cmd_code := Authentication_Information, |
| 492 | app_id := int2oct(c_DIAMETER_3GPP_S6_AID, 4), |
| 493 | hbh_id := hbh_id, |
| 494 | ete_id := ete_id, |
| 495 | avps := superset( |
| 496 | tr_AVP_SessionId(sess_id), |
| 497 | tr_AVP_AuthSessionState(NO_STATE_MAINTAINED), |
| 498 | tr_AVP_OriginHost(orig_host), |
| 499 | tr_AVP_OriginRealm(orig_realm), |
| 500 | tr_AVP_ResultCode(DIAMETER_SUCCESS), |
| 501 | tr_AVP_3GPP_AuthInfo(auth_info_contents) |
| 502 | )); |
| 503 | template (present) PDU_DIAMETER |
| 504 | tr_DIA_AIA_ERR(template (present) GenericAVP err_avp := ?, |
| 505 | template (present) octetstring sess_id := ?, |
| 506 | template (present) charstring orig_host := ?, |
| 507 | template (present) charstring orig_realm := ?, |
| 508 | template (present) UINT32 hbh_id := ?, |
| 509 | template (present) UINT32 ete_id := ?) := |
| 510 | tr_DIAMETER(flags := '0???????'B, |
| 511 | cmd_code := Authentication_Information, |
| 512 | app_id := int2oct(c_DIAMETER_3GPP_S6_AID, 4), |
| 513 | hbh_id := hbh_id, |
| 514 | ete_id := ete_id, |
| 515 | avps := superset( |
| 516 | tr_AVP_SessionId(sess_id), |
| 517 | tr_AVP_AuthSessionState(NO_STATE_MAINTAINED), |
| 518 | tr_AVP_OriginHost(orig_host), |
| 519 | tr_AVP_OriginRealm(orig_realm), |
| 520 | err_avp |
| 521 | )); |
| 522 | |
| 523 | |
| 524 | /* TS 29.272 7.2.3 Update Location Request */ |
| 525 | template (value) PDU_DIAMETER |
| 526 | ts_DIA_ULR(/* template (value) */ hexstring imsi, |
| 527 | template (value) octetstring mcc_mnc := '111F11'O, |
| 528 | template (value) octetstring sess_id := c_def_sess_id, |
| 529 | template (value) charstring orig_host := "ttcn3.localdomain", |
| 530 | template (value) charstring orig_realm := "localdomain", |
| 531 | template (value) charstring dest_realm := "localdomain", |
| 532 | template (value) UINT32 hbh_id := '00000000'O, |
| 533 | template (value) UINT32 ete_id := '00000000'O) := |
| 534 | ts_DIAMETER(flags := '11000000'B, |
| 535 | cmd_code := Update_Location, |
| 536 | app_id := int2oct(c_DIAMETER_3GPP_S6_AID, 4), |
| 537 | hbh_id := hbh_id, |
| 538 | ete_id := ete_id, |
| 539 | avps := { |
| 540 | ts_AVP_SessionId(sess_id), |
| 541 | ts_AVP_AuthSessionState(NO_STATE_MAINTAINED), |
| 542 | ts_AVP_UserNameImsi(imsi), |
| 543 | ts_AVP_3GPP_UlrFlags('00000000'O), |
| 544 | ts_AVP_3GPP_VisitedPlmnId(mcc_mnc), |
| 545 | ts_AVP_PCC_3GPP_RatType(EUTRAN), |
| 546 | ts_AVP_OriginHost(orig_host), |
| 547 | ts_AVP_OriginRealm(orig_realm), |
| 548 | ts_AVP_DestinationRealm(dest_realm) |
| 549 | }); |
| 550 | template (present) PDU_DIAMETER |
| 551 | tr_DIA_ULR(/* template (present) */ hexstring imsi, |
| 552 | template (present) octetstring sess_id := ?, |
| 553 | template (present) charstring orig_host := ?, |
| 554 | template (present) charstring orig_realm := ?, |
| 555 | template (present) charstring dest_realm := ?, |
| 556 | template (present) UINT32 hbh_id := ?, |
| 557 | template (present) UINT32 ete_id := ?) := |
| 558 | tr_DIAMETER(flags := '11000000'B, |
| 559 | cmd_code := Update_Location, |
| 560 | app_id := int2oct(c_DIAMETER_3GPP_S6_AID, 4), |
| 561 | hbh_id := hbh_id, |
| 562 | ete_id := ete_id, |
| 563 | avps := superset( |
| 564 | tr_AVP_SessionId(sess_id), |
| 565 | tr_AVP_AuthSessionState, |
| 566 | tr_AVP_OriginHost(orig_host), |
| 567 | tr_AVP_OriginRealm(orig_realm), |
| 568 | tr_AVP_DestinationRealm(dest_realm), |
| 569 | tr_AVP_UserNameImsi(imsi), |
| 570 | tr_AVP_PCC_3GPP_RatType, |
| 571 | tr_AVP_3GPP_UlrFlags, |
| 572 | tr_AVP_3GPP_VisitedPlmnId |
| 573 | )); |
| 574 | |
| 575 | template (value) PDU_DIAMETER |
| 576 | ts_DIA_ULA(template (value) AVP_list sub_data, |
| 577 | template (value) octetstring sess_id := c_def_sess_id, |
| 578 | template (value) charstring orig_host := "hss.localdomain", |
| 579 | template (value) charstring orig_realm := "localdomain", |
| 580 | template (value) UINT32 hbh_id := '00000000'O, |
| 581 | template (value) UINT32 ete_id := '00000000'O) := |
| 582 | ts_DIAMETER(flags:='01000000'B, |
| 583 | cmd_code := Update_Location, |
| 584 | app_id := int2oct(c_DIAMETER_3GPP_S6_AID, 4), |
| 585 | hbh_id := hbh_id, |
| 586 | ete_id := ete_id, |
| 587 | avps := { |
| 588 | ts_AVP_SessionId(sess_id), |
| 589 | ts_AVP_ResultCode(DIAMETER_SUCCESS), /* optional */ |
| 590 | ts_AVP_AuthSessionState(NO_STATE_MAINTAINED), |
| 591 | ts_AVP_OriginHost(orig_host), |
| 592 | ts_AVP_OriginRealm(orig_realm), |
| 593 | ts_AVP_3GPP_UlaFlags('00000002'O), |
| 594 | ts_AVP_3GPP_SubscriptionData(sub_data) |
| 595 | }); |
| 596 | template (present) PDU_DIAMETER |
| 597 | tr_DIA_ULA(template (present) AVP_list sub_data := ?, |
| 598 | template (present) octetstring sess_id := ?, |
| 599 | template (present) charstring orig_host := ?, |
| 600 | template (present) charstring orig_realm := ?, |
| 601 | template (present) UINT32 hbh_id := ?, |
| 602 | template (present) UINT32 ete_id := ?) := |
| 603 | tr_DIAMETER(flags := '0???????'B, |
| 604 | cmd_code := Update_Location, |
| 605 | app_id := int2oct(c_DIAMETER_3GPP_S6_AID, 4), |
| 606 | hbh_id := hbh_id, |
| 607 | ete_id := ete_id, |
| 608 | avps := superset( |
| 609 | tr_AVP_SessionId(sess_id), |
| 610 | tr_AVP_ResultCode(DIAMETER_SUCCESS), |
| 611 | tr_AVP_AuthSessionState, |
| 612 | tr_AVP_OriginHost(orig_host), |
| 613 | tr_AVP_OriginRealm(orig_realm), |
| 614 | tr_AVP_3GPP_UlaFlags, |
| 615 | tr_AVP_3GPP_SubscriptionData(sub_data) |
| 616 | )); |
| 617 | |
| 618 | /* TS 29.272 7.2.5 Authentication-Information-Request */ |
| 619 | template (value) PDU_DIAMETER |
| 620 | ts_DIA_AIR(/* template (value) */ hexstring imsi, |
| 621 | template (value) octetstring mcc_mnc := '111F11'O, |
| 622 | template (value) octetstring sess_id := c_def_sess_id, |
| 623 | template (value) charstring orig_host := "ttcn3.localdomain", |
| 624 | template (value) charstring orig_realm := "localdomain", |
| 625 | template (value) charstring dest_realm := "localdomain", |
| 626 | template (value) UINT32 hbh_id := '00000000'O, |
| 627 | template (value) UINT32 ete_id := '00000000'O) := |
| 628 | ts_DIAMETER(flags := '11000000'B, |
| 629 | cmd_code := Authentication_Information, |
| 630 | app_id := int2oct(c_DIAMETER_3GPP_S6_AID, 4), |
| 631 | hbh_id := hbh_id, |
| 632 | ete_id := ete_id, |
| 633 | avps := { |
| 634 | ts_AVP_SessionId(sess_id), |
| 635 | ts_AVP_DestinationRealm(dest_realm), |
| 636 | ts_AVP_OriginHost(orig_host), |
| 637 | ts_AVP_OriginRealm(orig_realm), |
| 638 | ts_AVP_UserNameImsi(imsi), |
| 639 | /* Requested EUTRAN Auth Info */ |
| 640 | ts_AVP_RequestedEutranAuthInfo, |
| 641 | ts_AVP_AuthSessionState(NO_STATE_MAINTAINED), |
| 642 | ts_AVP_3GPP_VisitedPlmnId(mcc_mnc) |
| 643 | }); |
| 644 | template (present) PDU_DIAMETER |
| 645 | tr_DIA_AIR(/* template (present) */ hexstring imsi, |
| 646 | template (present) octetstring sess_id := ?, |
| 647 | template (present) charstring dest_realm := ?, |
| 648 | template (present) UINT32 hbh_id := ?, |
| 649 | template (present) UINT32 ete_id := ?) := |
| 650 | tr_DIAMETER(flags := '1???????'B, |
| 651 | cmd_code := Authentication_Information, |
| 652 | app_id := int2oct(c_DIAMETER_3GPP_S6_AID, 4), |
| 653 | hbh_id := hbh_id, ete_id := ete_id, |
| 654 | avps := superset( |
| 655 | tr_AVP_SessionId(sess_id), |
| 656 | tr_AVP_DestinationRealm(dest_realm), |
| 657 | tr_AVP_UserNameImsi(imsi), |
| 658 | tr_AVP_3GPP_VisitedPlmnId |
| 659 | )); |
| 660 | |
Pau Espin Pedrol | e6e2460 | 2023-12-21 19:09:52 +0100 | [diff] [blame] | 661 | /* TS 29.272 7.2.7 Cancel-Location-Request */ |
| 662 | template (value) PDU_DIAMETER |
| 663 | ts_DIA_CLR(/* template (value) */ hexstring imsi, |
| 664 | template (value) AAA_3GPP_Cancellation_Type cancel_type, |
| 665 | template (value) octetstring sess_id := c_def_sess_id, |
| 666 | template (value) charstring orig_host := "ttcn3.localdomain", |
| 667 | template (value) charstring orig_realm := "localdomain", |
| 668 | template (value) charstring dest_host := "iut.localdomain", |
| 669 | template (value) charstring dest_realm := "localdomain", |
| 670 | template (value) UINT32 hbh_id := '00000000'O, |
| 671 | template (value) UINT32 ete_id := '00000000'O) := |
| 672 | ts_DIAMETER(flags := '11000000'B, |
| 673 | cmd_code := Cancel_Location, |
| 674 | app_id := int2oct(c_DIAMETER_3GPP_S6_AID, 4), |
| 675 | hbh_id := hbh_id, |
| 676 | ete_id := ete_id, |
| 677 | avps := { |
| 678 | ts_AVP_SessionId(sess_id), |
| 679 | ts_AVP_AuthSessionState(NO_STATE_MAINTAINED), |
| 680 | ts_AVP_OriginHost(orig_host), |
| 681 | ts_AVP_OriginRealm(orig_realm), |
| 682 | ts_AVP_DestinationHost(dest_host), |
| 683 | ts_AVP_DestinationRealm(dest_realm), |
| 684 | ts_AVP_UserNameImsi(imsi), |
| 685 | /* [Supported-Features ] */ |
| 686 | ts_AVP_3GPP_CancellationType(cancel_type) |
| 687 | }); |
| 688 | |
| 689 | /* TS 29.272 7.2.8 Cancel-Location-Answer */ |
| 690 | template (present) PDU_DIAMETER |
| 691 | tr_DIA_CLA(template (present) AVP_list sub_data := ?, |
| 692 | template (present) octetstring sess_id := ?, |
| 693 | template (present) charstring orig_host := ?, |
| 694 | template (present) charstring orig_realm := ?, |
| 695 | template (present) UINT32 hbh_id := ?, |
| 696 | template (present) UINT32 ete_id := ?) := |
| 697 | tr_DIAMETER(flags := '0???????'B, |
| 698 | cmd_code := Cancel_Location, |
| 699 | app_id := int2oct(c_DIAMETER_3GPP_S6_AID, 4), |
| 700 | hbh_id := hbh_id, |
| 701 | ete_id := ete_id, |
| 702 | avps := superset( |
| 703 | tr_AVP_SessionId(sess_id), |
| 704 | tr_AVP_ResultCode(DIAMETER_SUCCESS), |
| 705 | tr_AVP_AuthSessionState, |
| 706 | tr_AVP_OriginHost(orig_host), |
| 707 | tr_AVP_OriginRealm(orig_realm) |
| 708 | )); |
| 709 | |
| 710 | } /* module */ |