Brian Waters | 13d9601 | 2017-12-08 16:53:31 -0600 | [diff] [blame] | 1 | /* |
| 2 | * Dictionary definitions of objects specified in DCCA (Nokia, 3GPP). |
| 3 | */ |
| 4 | #include <freeDiameter/extension.h> |
| 5 | |
| 6 | |
| 7 | /* The content of this file follows the same structure as dict_base_proto.c */ |
| 8 | |
| 9 | #define CHECK_dict_new( _type, _data, _parent, _ref ) \ |
| 10 | CHECK_FCT( fd_dict_new( fd_g_config->cnf_dict, (_type), (_data), (_parent), (_ref)) ); |
| 11 | |
| 12 | #define CHECK_dict_search( _type, _criteria, _what, _result ) \ |
| 13 | CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, (_type), (_criteria), (_what), (_result), ENOENT) ); |
| 14 | |
| 15 | struct local_rules_definition { |
| 16 | char *avp_name; |
| 17 | enum rule_position position; |
| 18 | int min; |
| 19 | int max; |
| 20 | }; |
| 21 | |
| 22 | #define RULE_ORDER( _position ) ((((_position) == RULE_FIXED_HEAD) || ((_position) == RULE_FIXED_TAIL)) ? 1 : 0 ) |
| 23 | |
| 24 | #define PARSE_loc_rules( _rulearray, _parent) { \ |
| 25 | int __ar; \ |
| 26 | for (__ar=0; __ar < sizeof(_rulearray) / sizeof((_rulearray)[0]); __ar++) { \ |
| 27 | struct dict_rule_data __data = { NULL, \ |
| 28 | (_rulearray)[__ar].position, \ |
| 29 | 0, \ |
| 30 | (_rulearray)[__ar].min, \ |
| 31 | (_rulearray)[__ar].max}; \ |
| 32 | __data.rule_order = RULE_ORDER(__data.rule_position); \ |
| 33 | CHECK_FCT( fd_dict_search( \ |
| 34 | fd_g_config->cnf_dict, \ |
| 35 | DICT_AVP, \ |
| 36 | AVP_BY_NAME, \ |
| 37 | (_rulearray)[__ar].avp_name, \ |
| 38 | &__data.rule_avp, 0 ) ); \ |
| 39 | if ( !__data.rule_avp ) { \ |
| 40 | TRACE_DEBUG(INFO, "AVP Not found: '%s'", (_rulearray)[__ar].avp_name ); \ |
| 41 | return ENOENT; \ |
| 42 | } \ |
| 43 | CHECK_FCT_DO( fd_dict_new( fd_g_config->cnf_dict, DICT_RULE, &__data, _parent, NULL), \ |
| 44 | { \ |
| 45 | TRACE_DEBUG(INFO, "Error on rule with AVP '%s'", \ |
| 46 | (_rulearray)[__ar].avp_name ); \ |
| 47 | return EINVAL; \ |
| 48 | } ); \ |
| 49 | } \ |
| 50 | } |
| 51 | |
| 52 | #define enumval_def_u32( _val_, _str_ ) \ |
| 53 | { _str_, { .u32 = _val_ }} |
| 54 | |
| 55 | #define enumval_def_os( _len_, _val_, _str_ ) \ |
| 56 | { _str_, { .os = { .data = (unsigned char *)_val_, .len = _len_ }}} |
| 57 | |
| 58 | |
| 59 | static int dict_dcca_3gpp_entry(char * conffile) |
| 60 | { |
| 61 | TRACE_ENTRY("%p", conffile); |
| 62 | |
| 63 | /* Applications section */ |
| 64 | { |
| 65 | /* Create the vendors */ |
| 66 | { |
| 67 | struct dict_vendor_data vendor_data = { 10415, "3GPP" }; |
| 68 | CHECK_FCT(fd_dict_new(fd_g_config->cnf_dict, DICT_VENDOR, &vendor_data, NULL, NULL)); |
| 69 | } |
| 70 | |
| 71 | } |
| 72 | |
| 73 | |
| 74 | /* AVP section */ |
| 75 | { |
| 76 | struct dict_object * Address_type; |
| 77 | struct dict_object * UTF8String_type; |
| 78 | struct dict_object * DiameterIdentity_type; |
| 79 | struct dict_object * DiameterURI_type; |
| 80 | struct dict_object * Time_type; |
| 81 | |
| 82 | CHECK_dict_search( DICT_TYPE, TYPE_BY_NAME, "Address", &Address_type); |
| 83 | CHECK_dict_search( DICT_TYPE, TYPE_BY_NAME, "UTF8String", &UTF8String_type); |
| 84 | CHECK_dict_search( DICT_TYPE, TYPE_BY_NAME, "DiameterIdentity", &DiameterIdentity_type); |
| 85 | CHECK_dict_search( DICT_TYPE, TYPE_BY_NAME, "DiameterURI", &DiameterURI_type); |
| 86 | CHECK_dict_search( DICT_TYPE, TYPE_BY_NAME, "Time", &Time_type); |
| 87 | |
| 88 | /* Reporting-Reason */ |
| 89 | { |
| 90 | /* |
| 91 | Enumerated. Will be present if quota was |
| 92 | exhausted for one or more metering types. Only |
| 93 | one Reporting-Reason AVP can be present in the |
| 94 | Used-Service-Unit AVP. (Note that the Reporting- |
| 95 | Reason AVP may be present also at the MSCC |
| 96 | level; see below.) |
| 97 | The following values are supported: |
| 98 | |
| 99 | QUOTA_EXHAUSTED(3); Quota for the |
| 100 | associated metering type has been |
| 101 | exhausted. With this reporting reason there is |
| 102 | only one metering type in this Used-Service- |
| 103 | Unit AVP. |
| 104 | |
| 105 | OTHER_QUOTA_TYPE(5); Quota for one or |
| 106 | more of the other metering types has been |
| 107 | exhausted. With this reporting reason there |
| 108 | may be multiple metering types in Used- |
| 109 | Service-Unit AVP. |
| 110 | |
| 111 | POOL_EXHAUSTED(8); Quota from the |
| 112 | credit pool has been exhausted. This reporting |
| 113 | reason is used if the quota for the associated |
| 114 | metering type was granted from a credit pool |
| 115 | by using the GSU-Pool-Reference AVP in the |
| 116 | CCA. With this reporting reason there is only |
| 117 | one metering type in the Used-Service-Unit |
| 118 | AVP. |
| 119 | */ |
| 120 | |
| 121 | struct dict_object *type; |
| 122 | struct dict_type_data tdata = { AVP_TYPE_INTEGER32, "Enumerated(Reporting-Reason)" , NULL, NULL, NULL }; |
| 123 | struct dict_enumval_data t_1 = { "QHT", { .i32 = 1 }}; |
| 124 | struct dict_enumval_data t_2 = { "FINAL", { .i32 = 2 }}; |
| 125 | struct dict_enumval_data t_3 = { "QUOTA_EXHAUSTED", { .i32 = 3 }}; |
| 126 | struct dict_enumval_data t_4 = { "VALIDITY_TIME", { .i32 = 4 }}; |
| 127 | struct dict_enumval_data t_5 = { "OTHER_QUOTA_TYPE", { .i32 = 5 }}; |
| 128 | struct dict_enumval_data t_6 = { "RATING_CONDITION_CHANGE", { .i32 = 6 }}; |
| 129 | struct dict_enumval_data t_7 = { "FORCED_REAUTHORIZATION", { .i32 = 7 }}; |
| 130 | struct dict_enumval_data t_8 = { "POOL_EXHAUSTED", { .i32 = 8 }}; |
| 131 | |
| 132 | struct dict_avp_data data = { |
| 133 | 872, /* Code */ |
| 134 | 10415, /* Vendor */ |
| 135 | "Reporting-Reason", /* Name */ |
| 136 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 137 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flag values */ |
| 138 | AVP_TYPE_INTEGER32 /* base type of data */ |
| 139 | }; |
| 140 | /* Create the Enumerated type, and then the AVP */ |
| 141 | CHECK_dict_new( DICT_TYPE, &tdata , NULL, &type); |
| 142 | CHECK_dict_new( DICT_ENUMVAL, &t_3 , type, NULL); |
| 143 | CHECK_dict_new( DICT_ENUMVAL, &t_5 , type, NULL); |
| 144 | CHECK_dict_new( DICT_ENUMVAL, &t_8 , type, NULL); |
| 145 | CHECK_dict_new( DICT_AVP, &data , type, NULL); |
| 146 | } |
| 147 | |
| 148 | /* Trigger */ |
| 149 | { |
| 150 | /* |
| 151 | Grouped. The presence of the Trigger AVP in the |
| 152 | CCR identifies the event(s) triggering the CCR. |
| 153 | */ |
| 154 | |
| 155 | struct dict_avp_data data = { |
| 156 | 1264, /* Code */ |
| 157 | 10415, /* Vendor */ |
| 158 | "Trigger", /* Name */ |
| 159 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 160 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flag values */ |
| 161 | AVP_TYPE_GROUPED /* base type of data */ |
| 162 | }; |
| 163 | CHECK_dict_new( DICT_AVP, &data , NULL, NULL); |
| 164 | } |
| 165 | |
| 166 | /* Trigger-Type */ |
| 167 | { |
| 168 | /* |
| 169 | Enumerated. One or more of these AVPs may be |
| 170 | present. Indicates the event that triggered the |
| 171 | MSCC. Supported values are: |
| 172 | |
| 173 | CHANGE_IN_SGSN_IP_ADDRESS (1), a change in the SGSN address. |
| 174 | |
| 175 | CHANGEINQOS_ANY (2), a change in the QoS profile |
| 176 | |
| 177 | CHANGEINRAT (4), a change in radio access technology |
| 178 | |
| 179 | */ |
| 180 | |
| 181 | struct dict_object *type; |
| 182 | struct dict_type_data tdata = { AVP_TYPE_INTEGER32, "Enumerated(Trigger-Type)" , NULL, NULL, NULL }; |
| 183 | struct dict_enumval_data t_1 = { "CHANGE_IN_SGSN_IP_ADDRESS", { .i32 = 1 }}; |
| 184 | struct dict_enumval_data t_2 = { "CHANGEINQOS_ANY", { .i32 = 2 }}; |
| 185 | struct dict_enumval_data t_4 = { "CHANGEINRAT", { .i32 = 4 }}; |
| 186 | |
| 187 | struct dict_avp_data data = { |
| 188 | 870, /* Code */ |
| 189 | 10415, /* Vendor */ |
| 190 | "Trigger-Type", /* Name */ |
| 191 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 192 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flag values */ |
| 193 | AVP_TYPE_INTEGER32 /* base type of data */ |
| 194 | }; |
| 195 | /* Create the Enumerated type, and then the AVP */ |
| 196 | CHECK_dict_new( DICT_TYPE, &tdata , NULL, &type); |
| 197 | CHECK_dict_new( DICT_ENUMVAL, &t_1 , type, NULL); |
| 198 | CHECK_dict_new( DICT_ENUMVAL, &t_2 , type, NULL); |
| 199 | CHECK_dict_new( DICT_ENUMVAL, &t_4 , type, NULL); |
| 200 | CHECK_dict_new( DICT_AVP, &data , type, NULL); |
| 201 | } |
| 202 | |
| 203 | /* Service-Information */ |
| 204 | { |
| 205 | /* |
| 206 | Grouped. The Service-Information purpose is to |
| 207 | allow the transmission of additional 3GPP service |
| 208 | specific information elements (3GPP 32.299 |
| 209 | Rel7). |
| 210 | */ |
| 211 | |
| 212 | struct dict_avp_data data = { |
| 213 | 873, /* Code */ |
| 214 | 10415, /* Vendor */ |
| 215 | "Service-Information", /* Name */ |
| 216 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 217 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flag values */ |
| 218 | AVP_TYPE_GROUPED /* base type of data */ |
| 219 | }; |
| 220 | CHECK_dict_new( DICT_AVP, &data , NULL, NULL); |
| 221 | } |
| 222 | |
| 223 | /* PS-Information */ |
| 224 | { |
| 225 | /* |
| 226 | Grouped. Its purpose is to allow the transmission |
| 227 | of additional PS service specific information |
| 228 | elements (3GPP 32.299 Rel7). |
| 229 | */ |
| 230 | |
| 231 | struct dict_avp_data data = { |
| 232 | 874, /* Code */ |
| 233 | 10415, /* Vendor */ |
| 234 | "PS-Information", /* Name */ |
| 235 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 236 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flag values */ |
| 237 | AVP_TYPE_GROUPED /* base type of data */ |
| 238 | }; |
| 239 | CHECK_dict_new( DICT_AVP, &data , NULL, NULL); |
| 240 | } |
| 241 | |
| 242 | /* PDP-Address */ |
| 243 | { |
| 244 | /* |
| 245 | Address. Present only in the initial CCR. Contains |
| 246 | the user equipment IP address. This AVP is |
| 247 | defined in 3GPP 32.299 Rel7. |
| 248 | */ |
| 249 | |
| 250 | struct dict_avp_data data = { |
| 251 | 1227, /* Code */ |
| 252 | 10415, /* Vendor */ |
| 253 | "PDP-Address", /* Name */ |
| 254 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 255 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flag values */ |
| 256 | AVP_TYPE_OCTETSTRING /* base type of data */ |
| 257 | }; |
| 258 | CHECK_dict_new( DICT_AVP, &data , Address_type, NULL); |
| 259 | } |
| 260 | |
| 261 | /* 3GPP-IMSI */ |
| 262 | { |
| 263 | /* |
| 264 | IMSI encoded in UTF-8 per 3GPP TS 23.003. No |
| 265 | padding. Maximum length of data: 15. |
| 266 | */ |
| 267 | struct dict_avp_data data = { |
| 268 | 1, /* Code */ |
| 269 | 10415, /* Vendor */ |
| 270 | "3GPP-IMSI", /* Name */ |
| 271 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 272 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flag values */ |
| 273 | AVP_TYPE_OCTETSTRING /* base type of data */ |
| 274 | }; |
| 275 | CHECK_dict_new( DICT_AVP, &data , UTF8String_type, NULL); |
| 276 | } |
| 277 | |
| 278 | /* 3GPP-Charging-Id */ |
| 279 | { |
| 280 | /* |
| 281 | Unsigned32. (3GPP TS 29.061 Rel7) . The |
| 282 | charging identifier for the PDP context. The Flexi |
| 283 | ISN generates the 3GPP charging ID for both |
| 284 | virtual and normal PDP contexts with one excep- |
| 285 | tion. If the Flexi ISN acts as a NAS server and the |
| 286 | charging ID selection is set to NAS Client, the |
| 287 | charging ID will be the NAand not the 3GPP charging ID of Flexi ISN. |
| 288 | Present in the initial CCR only.S client |
| 289 | */ |
| 290 | struct dict_avp_data data = { |
| 291 | 2, /* Code */ |
| 292 | 10415, /* Vendor */ |
| 293 | "3GPP-Charging-Id", /* Name */ |
| 294 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 295 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flag values */ |
| 296 | AVP_TYPE_UNSIGNED32 /* base type of data */ |
| 297 | }; |
| 298 | CHECK_dict_new( DICT_AVP, &data , NULL, NULL); |
| 299 | } |
| 300 | |
| 301 | /* 3GPP-PDP-Type */ |
| 302 | { |
| 303 | /* |
| 304 | Enumerated. (3GPP TS 29.061 Rel7 ). Type of |
| 305 | PDP context, for example, IP or PPP. Present in |
| 306 | the initial CCR only. |
| 307 | 0 = IPv4 |
| 308 | 1 = PPP |
| 309 | 2 = IPv6 |
| 310 | 3 = IPv4v6 |
| 311 | */ |
| 312 | struct dict_avp_data data = { |
| 313 | 3, /* Code */ |
| 314 | 10415, /* Vendor */ |
| 315 | "3GPP-PDP-Type", /* Name */ |
| 316 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 317 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flag values */ |
| 318 | AVP_TYPE_UNSIGNED32 /* base type of data */ |
| 319 | }; |
| 320 | CHECK_dict_new( DICT_AVP, &data , NULL, NULL); |
| 321 | } |
| 322 | |
| 323 | /* 3GPP-CG-Address */ |
| 324 | { |
| 325 | /* |
| 326 | OctetString. (3GPP TS 29.061 Rel4). The address |
| 327 | of the charging gateway that has been marked as |
| 328 | the default charging gateway for the PDP context. |
| 329 | The address is expressed as a four-byte integer. |
| 330 | Present in the initial CCR only. |
| 331 | */ |
| 332 | struct dict_avp_data data = { |
| 333 | 4, /* Code */ |
| 334 | 10415, /* Vendor */ |
| 335 | "3GPP-CG-Address", /* Name */ |
| 336 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 337 | AVP_FLAG_VENDOR, /* Fixed flag values */ |
| 338 | AVP_TYPE_OCTETSTRING /* base type of data */ |
| 339 | }; |
| 340 | CHECK_dict_new( DICT_AVP, &data , Address_type, NULL); |
| 341 | } |
| 342 | |
| 343 | /* 3GPP-GPRS-Negotiated-QoS-Profile */ |
| 344 | { |
| 345 | /* |
| 346 | UTF8String. (3GPP TS 29.061 Rel7 ). The QoS |
| 347 | profile applied by the Flexi ISN. In update and ter- |
| 348 | mination requests, this AVP is present only when |
| 349 | the CCR has been triggered by a PDP context |
| 350 | update affecting the negotiated QoS |
| 351 | Each octet is described by two UTF-8-encoded |
| 352 | characters denoting the hexadecimal |
| 353 | representation. |
| 354 | */ |
| 355 | struct dict_avp_data data = { |
| 356 | 5, /* Code */ |
| 357 | 10415, /* Vendor */ |
| 358 | "3GPP-GPRS-Negotiated-QoS-Profile", /* Name */ |
| 359 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 360 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flag values */ |
| 361 | AVP_TYPE_OCTETSTRING /* base type of data */ |
| 362 | }; |
| 363 | CHECK_dict_new( DICT_AVP, &data , UTF8String_type, NULL); |
| 364 | } |
| 365 | |
| 366 | /* 3GPP-SGSN-Address */ |
| 367 | { |
| 368 | /* |
| 369 | OctetString. (3GPP TS 29.061 Rel4). The address |
| 370 | of the charging gateway that has been marked as |
| 371 | the default charging gateway for the PDP context. |
| 372 | The address is expressed as a four-byte integer. |
| 373 | Present in the initial CCR only. |
| 374 | */ |
| 375 | struct dict_avp_data data = { |
| 376 | 6, /* Code */ |
| 377 | 10415, /* Vendor */ |
| 378 | "3GPP-SGSN-Address", /* Name */ |
| 379 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 380 | AVP_FLAG_VENDOR, /* Fixed flag values */ |
| 381 | AVP_TYPE_OCTETSTRING /* base type of data */ |
| 382 | }; |
| 383 | CHECK_dict_new( DICT_AVP, &data , Address_type, NULL); |
| 384 | } |
| 385 | |
| 386 | /* 3GPP-GGSN-Address */ |
| 387 | { |
| 388 | /* |
| 389 | OctetString. (3GPP TS 29.061 Rel4). Usually the |
| 390 | IP address of Flexi ISN. The only exception is |
| 391 | when the Flexi ISN acts as a NAS server and the |
| 392 | charging ID selection is set to NAS Client; then the |
| 393 | GGSN IP address will be the NAIP address. Present in the initial CCR only.S client |
| 394 | */ |
| 395 | struct dict_avp_data data = { |
| 396 | 7, /* Code */ |
| 397 | 10415, /* Vendor */ |
| 398 | "3GPP-GGSN-Address", /* Name */ |
| 399 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 400 | AVP_FLAG_VENDOR, /* Fixed flag values */ |
| 401 | AVP_TYPE_OCTETSTRING /* base type of data */ |
| 402 | }; |
| 403 | CHECK_dict_new( DICT_AVP, &data , Address_type, NULL); |
| 404 | } |
| 405 | |
| 406 | /* 3GPP-IMSI-MCC-MNC */ |
| 407 | { |
| 408 | /* |
| 409 | UTF8String. MCC and MNC extracted from the |
| 410 | user's IMSI (first 5 or 6 digits, as applicable from |
| 411 | the presented IMSI). The MCC-MNCs are |
| 412 | extracted from the tables configured in FlexiISN |
| 413 | configuration under the General and Roaming |
| 414 | configurations. |
| 415 | */ |
| 416 | struct dict_avp_data data = { |
| 417 | 8, /* Code */ |
| 418 | 10415, /* Vendor */ |
| 419 | "3GPP-IMSI-MCC-MNC", /* Name */ |
| 420 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 421 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flag values */ |
| 422 | AVP_TYPE_OCTETSTRING /* base type of data */ |
| 423 | }; |
| 424 | CHECK_dict_new( DICT_AVP, &data , UTF8String_type, NULL); |
| 425 | } |
| 426 | |
| 427 | /* 3GPP-GGSN-MCC-MNC */ |
| 428 | { |
| 429 | /* |
| 430 | UTF8String. (3GPP TS 29.061 Rel7 ). Contains |
| 431 | the mobile country and network code of the PLMN |
| 432 | that the Flexi ISN belongs to. Present in the initial |
| 433 | CCR only. The first entry in the list of local PLMNs |
| 434 | in the Flexi ISN configuration determines the value |
| 435 | of this AVP. |
| 436 | */ |
| 437 | struct dict_avp_data data = { |
| 438 | 9, /* Code */ |
| 439 | 10415, /* Vendor */ |
| 440 | "3GPP-GGSN-MCC-MNC", /* Name */ |
| 441 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 442 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flag values */ |
| 443 | AVP_TYPE_OCTETSTRING /* base type of data */ |
| 444 | }; |
| 445 | CHECK_dict_new( DICT_AVP, &data , UTF8String_type, NULL); |
| 446 | } |
| 447 | |
| 448 | /* 3GPP-NSAPI */ |
| 449 | { |
| 450 | /* |
| 451 | UTF8String. (3GPP TS 29.061 Rel7 ). Indicates |
| 452 | the NSAPI of the PDP context. Contains one octet |
| 453 | consisting of a single digit. Present in the initial |
| 454 | CCR only. |
| 455 | */ |
| 456 | struct dict_avp_data data = { |
| 457 | 10, /* Code */ |
| 458 | 10415, /* Vendor */ |
| 459 | "3GPP-NSAPI", /* Name */ |
| 460 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 461 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flag values */ |
| 462 | AVP_TYPE_OCTETSTRING /* base type of data */ |
| 463 | }; |
| 464 | CHECK_dict_new( DICT_AVP, &data , UTF8String_type, NULL); |
| 465 | } |
| 466 | |
| 467 | /* 3GPP-Session-Stop-Indicator */ |
| 468 | { |
| 469 | /* |
| 470 | OctetString. (3GPP TS 29.061 Rel4). The |
| 471 | presence of this AVP indicates that the last |
| 472 | context of the PDP session has been deleted. May |
| 473 | be present in the termination CCR only. Contains |
| 474 | one octet that has a value of 0xff. |
| 475 | */ |
| 476 | struct dict_avp_data data = { |
| 477 | 11, /* Code */ |
| 478 | 10415, /* Vendor */ |
| 479 | "3GPP-Session-Stop-Indicator", /* Name */ |
| 480 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 481 | AVP_FLAG_VENDOR, /* Fixed flag values */ |
| 482 | AVP_TYPE_OCTETSTRING /* base type of data */ |
| 483 | }; |
| 484 | CHECK_dict_new( DICT_AVP, &data , NULL, NULL); |
| 485 | } |
| 486 | |
| 487 | /* 3GPP-Selection-Mode */ |
| 488 | { |
| 489 | /* |
| 490 | UTF8String. (3GPP TS 29.061 Rel7 ). Consists of |
| 491 | one octet containing the selection mode as |
| 492 | received from SGSN in the Create PDP Context |
| 493 | Request. Present in the initial CCR only. |
| 494 | */ |
| 495 | struct dict_avp_data data = { |
| 496 | 12, /* Code */ |
| 497 | 10415, /* Vendor */ |
| 498 | "3GPP-Selection-Mode", /* Name */ |
| 499 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 500 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flag values */ |
| 501 | AVP_TYPE_OCTETSTRING /* base type of data */ |
| 502 | }; |
| 503 | CHECK_dict_new( DICT_AVP, &data , UTF8String_type, NULL); |
| 504 | } |
| 505 | |
| 506 | /* 3GPP-Charging-Characteristics */ |
| 507 | { |
| 508 | /* |
| 509 | UTF8String. (3GPP TS 29.061 Rel7 ). The |
| 510 | charging characteristics for the PDP context. |
| 511 | Present in the initial CCR only. Consists of four |
| 512 | octets. Each octet contains a single UTF-8 |
| 513 | encoded digit. The content of the charging charac- |
| 514 | teristics is described in 3GPP TS 32.215. |
| 515 | */ |
| 516 | struct dict_avp_data data = { |
| 517 | 13, /* Code */ |
| 518 | 10415, /* Vendor */ |
| 519 | "3GPP-Charging-Characteristics", /* Name */ |
| 520 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 521 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flag values */ |
| 522 | AVP_TYPE_OCTETSTRING /* base type of data */ |
| 523 | }; |
| 524 | CHECK_dict_new( DICT_AVP, &data , UTF8String_type, NULL); |
| 525 | } |
| 526 | |
| 527 | /* 3GPP-CG-IPv6-Address */ |
| 528 | { |
| 529 | /* |
| 530 | UTF8String.. (3GPP TS 29.061 Rel? (<=10) ). The |
| 531 | IPv6 address of the charging gateway. |
| 532 | */ |
| 533 | struct dict_avp_data data = { |
| 534 | 14, /* Code */ |
| 535 | 10415, /* Vendor */ |
| 536 | "3GPP-CG-IPv6-Address", /* Name */ |
| 537 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 538 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flag values */ |
| 539 | AVP_TYPE_OCTETSTRING /* base type of data */ |
| 540 | }; |
| 541 | CHECK_dict_new( DICT_AVP, &data , UTF8String_type, NULL); |
| 542 | } |
| 543 | |
| 544 | /* 3GPP-SGSN-IPv6-Address */ |
| 545 | { |
| 546 | /* |
| 547 | UTF8String.. (3GPP TS 29.061 Rel? (<=10) ). The |
| 548 | IPv6 address of the SGSN. |
| 549 | */ |
| 550 | struct dict_avp_data data = { |
| 551 | 15, /* Code */ |
| 552 | 10415, /* Vendor */ |
| 553 | "3GPP-SGSN-IPv6-Address", /* Name */ |
| 554 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 555 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flag values */ |
| 556 | AVP_TYPE_OCTETSTRING /* base type of data */ |
| 557 | }; |
| 558 | CHECK_dict_new( DICT_AVP, &data , UTF8String_type, NULL); |
| 559 | } |
| 560 | |
| 561 | /* 3GPP-GGSN-IPv6-Address */ |
| 562 | { |
| 563 | /* |
| 564 | UTF8String.. (3GPP TS 29.061 Rel? (<=10) ). The |
| 565 | IPv6 address of the GGSN. |
| 566 | */ |
| 567 | struct dict_avp_data data = { |
| 568 | 16, /* Code */ |
| 569 | 10415, /* Vendor */ |
| 570 | "3GPP-GGSN-IPv6-Address", /* Name */ |
| 571 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 572 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flag values */ |
| 573 | AVP_TYPE_OCTETSTRING /* base type of data */ |
| 574 | }; |
| 575 | CHECK_dict_new( DICT_AVP, &data , UTF8String_type, NULL); |
| 576 | } |
| 577 | |
| 578 | /* 3GPP-GGSN-IPv6-DNS-Servers */ |
| 579 | { |
| 580 | /* |
| 581 | UTF8String.. (3GPP TS 29.061 Rel? (<=10) ). List |
| 582 | of IPv6 addresses of DNS servers for an APN in |
| 583 | order of preference (max. 15 servers, 16 bytes |
| 584 | each). |
| 585 | */ |
| 586 | struct dict_avp_data data = { |
| 587 | 17, /* Code */ |
| 588 | 10415, /* Vendor */ |
| 589 | "3GPP-GGSN-IPv6-DNS-Servers", /* Name */ |
| 590 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 591 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flag values */ |
| 592 | AVP_TYPE_OCTETSTRING /* base type of data */ |
| 593 | }; |
| 594 | CHECK_dict_new( DICT_AVP, &data , UTF8String_type, NULL); |
| 595 | } |
| 596 | |
| 597 | /* 3GPP-SGSN-MCC-MNC */ |
| 598 | { |
| 599 | /* |
| 600 | UTF8String. (3GPP TS 29.061 Rel7 ). MCC and |
| 601 | MNC extracted from the RAI within Create or |
| 602 | Update PDP Context Request. In update and ter- |
| 603 | mination requests, this AVP is present only when |
| 604 | the CCR has been triggered by a routing area |
| 605 | update. |
| 606 | */ |
| 607 | struct dict_avp_data data = { |
| 608 | 18, /* Code */ |
| 609 | 10415, /* Vendor */ |
| 610 | "3GPP-SGSN-MCC-MNC", /* Name */ |
| 611 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 612 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flag values */ |
| 613 | AVP_TYPE_OCTETSTRING /* base type of data */ |
| 614 | }; |
| 615 | CHECK_dict_new( DICT_AVP, &data , UTF8String_type, NULL); |
| 616 | } |
| 617 | |
| 618 | /* Missing: 3GPP-Teardown-Indicator (19) */ |
| 619 | |
| 620 | /* 3GPP-IMEISV */ |
| 621 | { |
| 622 | /* |
| 623 | IMEI(SV) encoded as sequence of UTF8 characters. |
| 624 | */ |
| 625 | struct dict_avp_data data = { |
| 626 | 20, /* Code */ |
| 627 | 10415, /* Vendor */ |
| 628 | "3GPP-IMEISV", /* Name */ |
| 629 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 630 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flag values */ |
| 631 | AVP_TYPE_OCTETSTRING /* base type of data */ |
| 632 | }; |
| 633 | CHECK_dict_new( DICT_AVP, &data , UTF8String_type, NULL); |
| 634 | } |
| 635 | |
| 636 | /* 3GPP-RAT-Type */ |
| 637 | { |
| 638 | /* |
| 639 | OctetString. (3GPP TS 29.061 Rel7 ) Defines the |
| 640 | method used to access the network. Consists of a |
| 641 | single octet. The following values may be sent: |
| 642 | UTRAN (1), GERAN (2), WLAN (3), NAS (254), |
| 643 | Unspecified (255). |
| 644 | This AVP is included in the initial CCR and in |
| 645 | update or termination CCRs if the value changes. |
| 646 | */ |
| 647 | struct dict_avp_data data = { |
| 648 | 21, /* Code */ |
| 649 | 10415, /* Vendor */ |
| 650 | "3GPP-RAT-Type", /* Name */ |
| 651 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 652 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flag values */ |
| 653 | AVP_TYPE_OCTETSTRING /* base type of data */ |
| 654 | }; |
| 655 | CHECK_dict_new( DICT_AVP, &data , NULL, NULL); |
| 656 | } |
| 657 | |
| 658 | /* 3GPP-User-Location-Info */ |
| 659 | { |
| 660 | /* |
| 661 | OctetString. (3GPP TS 29.061 Rel7 ) Contains |
| 662 | information about the user's current geographical |
| 663 | location as received from the SGSN. Present |
| 664 | always in initial CCR if the value is known and in |
| 665 | update and termination CCRs if the value |
| 666 | changes. |
| 667 | */ |
| 668 | struct dict_avp_data data = { |
| 669 | 22, /* Code */ |
| 670 | 10415, /* Vendor */ |
| 671 | "3GPP-User-Location-Info", /* Name */ |
| 672 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 673 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flag values */ |
| 674 | AVP_TYPE_OCTETSTRING /* base type of data */ |
| 675 | }; |
| 676 | CHECK_dict_new( DICT_AVP, &data , NULL, NULL); |
| 677 | } |
| 678 | |
| 679 | /* 3GPP-MS-TimeZone */ |
| 680 | { |
| 681 | /* |
| 682 | OctetString. (3GPP TS 29.061 Rel7 ) 3GPP-MS- |
| 683 | TimeZone is AVP is present always in the initial CCR if the |
| 684 | value is known and in the update and termination |
| 685 | CCRs if the value changes. This IE is encoded |
| 686 | according to 3GPP TS 29.061 Rel7 |
| 687 | */ |
| 688 | struct dict_avp_data data = { |
| 689 | 23, /* Code */ |
| 690 | 10415, /* Vendor */ |
| 691 | "3GPP-MS-TimeZone", /* Name */ |
| 692 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 693 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flag values */ |
| 694 | AVP_TYPE_OCTETSTRING /* base type of data */ |
| 695 | }; |
| 696 | CHECK_dict_new( DICT_AVP, &data , NULL, NULL); |
| 697 | } |
| 698 | |
| 699 | /* Missing: 3GPP-CAMEL-Charging-Info (24) */ |
| 700 | /* Missing: 3GPP-Packet-Filter (25) */ |
| 701 | /* Missing: 3GPP-Negotiated-DSCP (26) */ |
| 702 | /* Missing: 3GPP-Allocate-IP-Type (27) */ |
| 703 | |
| 704 | /* PDP-Context-Type */ |
| 705 | { |
| 706 | /* |
| 707 | Enumerated. Indicates the type of a PDP context |
| 708 | and is only included in CCR initial. |
| 709 | |
| 710 | values are 0 for primary and 1 for secondary |
| 711 | (3GPP 32.299 Rel7) |
| 712 | */ |
| 713 | struct dict_object *type; |
| 714 | struct dict_type_data tdata = { AVP_TYPE_INTEGER32, "Enumerated(PDP-Context-Type)" , NULL, NULL, NULL }; |
| 715 | struct dict_enumval_data t_0 = { "PRIMARY", { .i32 = 0 }}; |
| 716 | struct dict_enumval_data t_1 = { "SECONDARY", { .i32 = 1 }}; |
| 717 | |
| 718 | struct dict_avp_data data = { |
| 719 | 1247, /* Code */ |
| 720 | 10415, /* Vendor */ |
| 721 | "PDP-Context-Type", /* Name */ |
| 722 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 723 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flag values */ |
| 724 | AVP_TYPE_INTEGER32 /* base type of data */ |
| 725 | }; |
| 726 | /* Create the Enumerated type, and then the AVP */ |
| 727 | CHECK_dict_new( DICT_TYPE, &tdata , NULL, &type); |
| 728 | CHECK_dict_new( DICT_ENUMVAL, &t_0 , type, NULL); |
| 729 | CHECK_dict_new( DICT_ENUMVAL, &t_1 , type, NULL); |
| 730 | CHECK_dict_new( DICT_AVP, &data , type, NULL); |
| 731 | } |
| 732 | |
| 733 | /* IMS-Information */ |
| 734 | { |
| 735 | /* |
| 736 | Grouped. Its purpose is to allow the transmission |
| 737 | of additional IMS service specific information ele- |
| 738 | ments. (3GPP 32.299 Rel7) |
| 739 | */ |
| 740 | struct dict_avp_data data = { |
| 741 | 876, /* Code */ |
| 742 | 10415, /* Vendor */ |
| 743 | "IMS-Information", /* Name */ |
| 744 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 745 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flag values */ |
| 746 | AVP_TYPE_GROUPED /* base type of data */ |
| 747 | }; |
| 748 | CHECK_dict_new( DICT_AVP, &data , NULL, NULL); |
| 749 | } |
| 750 | |
| 751 | /* IMS-Charging-Identifier */ |
| 752 | { |
| 753 | /* |
| 754 | UTF8String. Contains the IMS charging identifier |
| 755 | as given to the Flexi ISN by the IMS. This AVP is |
| 756 | defined in 3GPP TS 32.225. This AVP is present |
| 757 | in IMS sessions only. Present in the initial CCR |
| 758 | only. |
| 759 | */ |
| 760 | struct dict_avp_data data = { |
| 761 | 841, /* Code */ |
| 762 | 10415, /* Vendor */ |
| 763 | "IMS-Charging-Identifier", /* Name */ |
| 764 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 765 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flag values */ |
| 766 | AVP_TYPE_OCTETSTRING /* base type of data */ |
| 767 | }; |
| 768 | CHECK_dict_new( DICT_AVP, &data , UTF8String_type, NULL); |
| 769 | } |
| 770 | |
| 771 | |
| 772 | |
| 773 | |
| 774 | /* Max-Requested-Bandwidth-UL */ |
| 775 | { |
| 776 | /* |
| 777 | Unsigned32. The Max-Requested-Bandwidth- |
| 778 | UL/DL AVP indicates the maximum allowed bit |
| 779 | rate (in bits per second) for the uplink direction. |
| 780 | (Re-used from 3GPP 29.214) |
| 781 | */ |
| 782 | struct dict_avp_data data = { |
| 783 | 515, /* Code */ |
| 784 | 10415, /* Vendor */ |
| 785 | "Max-Requested-Bandwidth-UL", /* Name */ |
| 786 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 787 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flag values */ |
| 788 | AVP_TYPE_UNSIGNED32 /* base type of data */ |
| 789 | }; |
| 790 | CHECK_dict_new( DICT_AVP, &data , NULL, NULL); |
| 791 | } |
| 792 | |
| 793 | /* Max-Requested-Bandwidth-DL */ |
| 794 | { |
| 795 | /* |
| 796 | Unsigned32. The Max-Requested-Bandwidth- |
| 797 | UL/DL AVP indicates the maximum allowed bit |
| 798 | rate (in bits per second) for the uplink direction. |
| 799 | */ |
| 800 | struct dict_avp_data data = { |
| 801 | 516, /* Code */ |
| 802 | 10415, /* Vendor */ |
| 803 | "Max-Requested-Bandwidth-DL", /* Name */ |
| 804 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 805 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flag values */ |
| 806 | AVP_TYPE_UNSIGNED32 /* base type of data */ |
| 807 | }; |
| 808 | CHECK_dict_new( DICT_AVP, &data , NULL, NULL); |
| 809 | } |
| 810 | |
| 811 | /* QoS-Information */ |
| 812 | { |
| 813 | /* |
| 814 | Grouped. This is the QoS that the DCCA |
| 815 | server requests from Flexi ISN to be applied for |
| 816 | this PDP context. This AVP and all AVPs con- |
| 817 | tained within are described in 3GPP TS 29.212 |
| 818 | Release 7. The ARP AVP is introduced with |
| 819 | Release 8. The relevant types are defined on |
| 820 | table 5.3.1 of TS 29.212. |
| 821 | */ |
| 822 | |
| 823 | struct dict_avp_data data = { |
| 824 | 1016, /* Code */ |
| 825 | 10415, /* Vendor */ |
| 826 | "QoS-Information", /* Name */ |
| 827 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 828 | AVP_FLAG_VENDOR, /* Fixed flag values */ |
| 829 | AVP_TYPE_GROUPED /* base type of data */ |
| 830 | }; |
| 831 | CHECK_dict_new( DICT_AVP, &data , NULL, NULL); |
| 832 | } |
| 833 | } |
| 834 | |
| 835 | |
| 836 | |
| 837 | TRACE_DEBUG(INFO, "Extension 'Dictionary definitions for DCCA 3GPP' initialized"); |
| 838 | return 0; |
| 839 | } |
| 840 | |
| 841 | EXTENSION_ENTRY("dict_dcca_3gpp", dict_dcca_3gpp_entry, "dict_dcca"); |