Brian Waters | 13d9601 | 2017-12-08 16:53:31 -0600 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2017 Sprint |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | /**************** |
| 18 | Generated By: fdtool enhancements to diafuzzer |
| 19 | License: same as freeDiameter |
| 20 | ****************/ |
| 21 | |
| 22 | |
| 23 | /* |
| 24 | * Dictionary definitions of objects specified in rfc4004_avps. |
| 25 | */ |
| 26 | #include <freeDiameter/extension.h> |
| 27 | |
| 28 | #define PROTO_VER "unspecified" |
| 29 | #define GEN_DATE 1506697143.43 |
| 30 | |
| 31 | const char *rfc4004_avps_proto_ver = PROTO_VER; |
| 32 | const double rfc4004_avps_gen_date = GEN_DATE; |
| 33 | |
| 34 | /* The content of this file follows the same structure as dict_base_proto.c */ |
| 35 | |
| 36 | #define CHECK_dict_new( _type, _data, _parent, _ref ) \ |
| 37 | { \ |
| 38 | int _ret = fd_dict_new( fd_g_config->cnf_dict, (_type), (_data), (_parent), (_ref) ); \ |
| 39 | if ( _ret != 0 && _ret != EEXIST ) \ |
| 40 | return _ret; \ |
| 41 | } |
| 42 | |
| 43 | #define CHECK_dict_search( _type, _criteria, _what, _result ) \ |
| 44 | CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, (_type), (_criteria), (_what), (_result), ENOENT) ); |
| 45 | |
| 46 | struct local_rules_definition { |
| 47 | struct dict_avp_request avp_vendor_plus_name; |
| 48 | enum rule_position position; |
| 49 | int min; |
| 50 | int max; |
| 51 | }; |
| 52 | |
| 53 | #define RULE_ORDER( _position ) ((((_position) == RULE_FIXED_HEAD) || ((_position) == RULE_FIXED_TAIL)) ? 1 : 0 ) |
| 54 | |
| 55 | /* Attention! This version of the macro uses AVP_BY_NAME_AND_VENDOR, in contrast to most other copies! */ |
| 56 | #define PARSE_loc_rules( _rulearray, _parent) { \ |
| 57 | int __ar; \ |
| 58 | for (__ar=0; __ar < sizeof(_rulearray) / sizeof((_rulearray)[0]); __ar++) { \ |
| 59 | struct dict_rule_data __data = { NULL, \ |
| 60 | (_rulearray)[__ar].position, \ |
| 61 | 0, \ |
| 62 | (_rulearray)[__ar].min, \ |
| 63 | (_rulearray)[__ar].max}; \ |
| 64 | __data.rule_order = RULE_ORDER(__data.rule_position); \ |
| 65 | CHECK_FCT( fd_dict_search( \ |
| 66 | fd_g_config->cnf_dict, \ |
| 67 | DICT_AVP, \ |
| 68 | AVP_BY_NAME_AND_VENDOR, \ |
| 69 | &(_rulearray)[__ar].avp_vendor_plus_name, \ |
| 70 | &__data.rule_avp, 0 ) ); \ |
| 71 | if ( !__data.rule_avp ) { \ |
| 72 | TRACE_DEBUG(INFO, "AVP Not found: '%s'", (_rulearray)[__ar].avp_vendor_plus_name.avp_name); \ |
| 73 | return ENOENT; \ |
| 74 | } \ |
| 75 | { \ |
| 76 | int _ret = fd_dict_new( fd_g_config->cnf_dict, DICT_RULE, &(__data), (_parent), NULL ); \ |
| 77 | if ( _ret != 0 && _ret != EEXIST ) { \ |
| 78 | TRACE_DEBUG(INFO, "Error on rule with AVP '%s'", \ |
| 79 | (_rulearray)[__ar].avp_vendor_plus_name.avp_name); \ |
| 80 | return EINVAL; \ |
| 81 | } \ |
| 82 | } \ |
| 83 | } \ |
| 84 | } |
| 85 | |
| 86 | #define CHECK_vendor_new( _data ) { \ |
| 87 | struct dict_object * vendor_found; \ |
| 88 | if (fd_dict_search(fd_g_config->cnf_dict,DICT_VENDOR,VENDOR_BY_ID,&_data.vendor_id,&vendor_found,ENOENT) == ENOENT) { \ |
| 89 | CHECK_FCT(fd_dict_new(fd_g_config->cnf_dict, DICT_VENDOR, &_data, NULL, NULL)); \ |
| 90 | } \ |
| 91 | } |
| 92 | |
| 93 | #define enumval_def_u32( _val_, _str_ ) \ |
| 94 | { _str_, { .u32 = _val_ }} |
| 95 | |
| 96 | #define enumval_def_os( _len_, _val_, _str_ ) \ |
| 97 | { _str_, { .os = { .data = (unsigned char *)_val_, .len = _len_ }}} |
| 98 | |
| 99 | |
| 100 | static int dict_rfc4004_avps_load_defs(char * conffile) |
| 101 | { |
| 102 | TRACE_ENTRY("%p", conffile); |
| 103 | |
| 104 | /* AVP section */ |
| 105 | { |
| 106 | struct dict_object * Address_type; |
| 107 | struct dict_object * UTF8String_type; |
| 108 | struct dict_object * DiameterIdentity_type; |
| 109 | struct dict_object * DiameterURI_type; |
| 110 | struct dict_object * Time_type; |
| 111 | struct dict_object * IPFilterRule_type; |
| 112 | |
| 113 | CHECK_dict_search( DICT_TYPE, TYPE_BY_NAME, "Address", &Address_type); |
| 114 | CHECK_dict_search( DICT_TYPE, TYPE_BY_NAME, "UTF8String", &UTF8String_type); |
| 115 | CHECK_dict_search( DICT_TYPE, TYPE_BY_NAME, "DiameterIdentity", &DiameterIdentity_type); |
| 116 | CHECK_dict_search( DICT_TYPE, TYPE_BY_NAME, "DiameterURI", &DiameterURI_type); |
| 117 | CHECK_dict_search( DICT_TYPE, TYPE_BY_NAME, "Time", &Time_type); |
| 118 | CHECK_dict_search( DICT_TYPE, TYPE_BY_NAME, "IPFilterRule", &IPFilterRule_type); |
| 119 | /* MIP-Reg-Request */ |
| 120 | { |
| 121 | struct dict_avp_data data = { |
| 122 | 320, /* Code */ |
| 123 | 0, /* Vendor */ |
| 124 | "MIP-Reg-Request", /* Name */ |
| 125 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 126 | AVP_FLAG_MANDATORY, /* Fixed flag values */ |
| 127 | AVP_TYPE_OCTETSTRING /* base type of data */ |
| 128 | }; |
| 129 | CHECK_dict_new( DICT_AVP, &data, NULL, NULL); |
| 130 | }; |
| 131 | /* MIP-Reg-Reply */ |
| 132 | { |
| 133 | struct dict_avp_data data = { |
| 134 | 321, /* Code */ |
| 135 | 0, /* Vendor */ |
| 136 | "MIP-Reg-Reply", /* Name */ |
| 137 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 138 | AVP_FLAG_MANDATORY, /* Fixed flag values */ |
| 139 | AVP_TYPE_OCTETSTRING /* base type of data */ |
| 140 | }; |
| 141 | CHECK_dict_new( DICT_AVP, &data, NULL, NULL); |
| 142 | }; |
| 143 | /* MIP-Mobile-Node-Address */ |
| 144 | { |
| 145 | struct dict_avp_data data = { |
| 146 | 333, /* Code */ |
| 147 | 0, /* Vendor */ |
| 148 | "MIP-Mobile-Node-Address", /* Name */ |
| 149 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 150 | AVP_FLAG_MANDATORY, /* Fixed flag values */ |
| 151 | AVP_TYPE_OCTETSTRING /* base type of data */ |
| 152 | }; |
| 153 | CHECK_dict_new( DICT_AVP, &data, Address_type, NULL); |
| 154 | }; |
| 155 | /* MIP-Home-Agent-Address */ |
| 156 | { |
| 157 | struct dict_avp_data data = { |
| 158 | 334, /* Code */ |
| 159 | 0, /* Vendor */ |
| 160 | "MIP-Home-Agent-Address", /* Name */ |
| 161 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 162 | AVP_FLAG_MANDATORY, /* Fixed flag values */ |
| 163 | AVP_TYPE_OCTETSTRING /* base type of data */ |
| 164 | }; |
| 165 | CHECK_dict_new( DICT_AVP, &data, Address_type, NULL); |
| 166 | }; |
| 167 | /* MIP-Candidate-Home-Agent-Host */ |
| 168 | { |
| 169 | struct dict_avp_data data = { |
| 170 | 336, /* Code */ |
| 171 | 0, /* Vendor */ |
| 172 | "MIP-Candidate-Home-Agent-Host", /* Name */ |
| 173 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 174 | AVP_FLAG_MANDATORY, /* Fixed flag values */ |
| 175 | AVP_TYPE_OCTETSTRING /* base type of data */ |
| 176 | }; |
| 177 | CHECK_dict_new( DICT_AVP, &data, DiameterIdentity_type, NULL); |
| 178 | }; |
| 179 | /* MIP-Feature-Vector */ |
| 180 | { |
| 181 | struct dict_avp_data data = { |
| 182 | 337, /* Code */ |
| 183 | 0, /* Vendor */ |
| 184 | "MIP-Feature-Vector", /* Name */ |
| 185 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 186 | AVP_FLAG_MANDATORY, /* Fixed flag values */ |
| 187 | AVP_TYPE_UNSIGNED32 /* base type of data */ |
| 188 | }; |
| 189 | CHECK_dict_new( DICT_AVP, &data, NULL, NULL); |
| 190 | }; |
| 191 | /* MIP-Auth-Input-Data-Length */ |
| 192 | { |
| 193 | struct dict_avp_data data = { |
| 194 | 338, /* Code */ |
| 195 | 0, /* Vendor */ |
| 196 | "MIP-Auth-Input-Data-Length", /* Name */ |
| 197 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 198 | AVP_FLAG_MANDATORY, /* Fixed flag values */ |
| 199 | AVP_TYPE_UNSIGNED32 /* base type of data */ |
| 200 | }; |
| 201 | CHECK_dict_new( DICT_AVP, &data, NULL, NULL); |
| 202 | }; |
| 203 | /* MIP-Authenticator-Length */ |
| 204 | { |
| 205 | struct dict_avp_data data = { |
| 206 | 339, /* Code */ |
| 207 | 0, /* Vendor */ |
| 208 | "MIP-Authenticator-Length", /* Name */ |
| 209 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 210 | AVP_FLAG_MANDATORY, /* Fixed flag values */ |
| 211 | AVP_TYPE_UNSIGNED32 /* base type of data */ |
| 212 | }; |
| 213 | CHECK_dict_new( DICT_AVP, &data, NULL, NULL); |
| 214 | }; |
| 215 | /* MIP-Authenticator-Offset */ |
| 216 | { |
| 217 | struct dict_avp_data data = { |
| 218 | 340, /* Code */ |
| 219 | 0, /* Vendor */ |
| 220 | "MIP-Authenticator-Offset", /* Name */ |
| 221 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 222 | AVP_FLAG_MANDATORY, /* Fixed flag values */ |
| 223 | AVP_TYPE_UNSIGNED32 /* base type of data */ |
| 224 | }; |
| 225 | CHECK_dict_new( DICT_AVP, &data, NULL, NULL); |
| 226 | }; |
| 227 | /* MIP-MN-AAA-SPI */ |
| 228 | { |
| 229 | struct dict_avp_data data = { |
| 230 | 341, /* Code */ |
| 231 | 0, /* Vendor */ |
| 232 | "MIP-MN-AAA-SPI", /* Name */ |
| 233 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 234 | AVP_FLAG_MANDATORY, /* Fixed flag values */ |
| 235 | AVP_TYPE_UNSIGNED32 /* base type of data */ |
| 236 | }; |
| 237 | CHECK_dict_new( DICT_AVP, &data, NULL, NULL); |
| 238 | }; |
| 239 | /* MIP-Filter-Rule */ |
| 240 | { |
| 241 | struct dict_avp_data data = { |
| 242 | 342, /* Code */ |
| 243 | 0, /* Vendor */ |
| 244 | "MIP-Filter-Rule", /* Name */ |
| 245 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 246 | AVP_FLAG_MANDATORY, /* Fixed flag values */ |
| 247 | AVP_TYPE_OCTETSTRING /* base type of data */ |
| 248 | }; |
| 249 | CHECK_dict_new( DICT_AVP, &data, IPFilterRule_type, NULL); |
| 250 | }; |
| 251 | /* MIP-FA-Challenge */ |
| 252 | { |
| 253 | struct dict_avp_data data = { |
| 254 | 344, /* Code */ |
| 255 | 0, /* Vendor */ |
| 256 | "MIP-FA-Challenge", /* Name */ |
| 257 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 258 | AVP_FLAG_MANDATORY, /* Fixed flag values */ |
| 259 | AVP_TYPE_OCTETSTRING /* base type of data */ |
| 260 | }; |
| 261 | CHECK_dict_new( DICT_AVP, &data, NULL, NULL); |
| 262 | }; |
| 263 | /* MIP-Home-Agent-Host */ |
| 264 | { |
| 265 | struct dict_avp_data data = { |
| 266 | 348, /* Code */ |
| 267 | 0, /* Vendor */ |
| 268 | "MIP-Home-Agent-Host", /* Name */ |
| 269 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 270 | AVP_FLAG_MANDATORY, /* Fixed flag values */ |
| 271 | AVP_TYPE_OCTETSTRING /* base type of data */ |
| 272 | }; |
| 273 | CHECK_dict_new( DICT_AVP, &data, DiameterIdentity_type, NULL); |
| 274 | }; |
| 275 | /* MIP-FA-to-HA-SPI */ |
| 276 | { |
| 277 | struct dict_avp_data data = { |
| 278 | 318, /* Code */ |
| 279 | 0, /* Vendor */ |
| 280 | "MIP-FA-to-HA-SPI", /* Name */ |
| 281 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 282 | AVP_FLAG_MANDATORY, /* Fixed flag values */ |
| 283 | AVP_TYPE_UNSIGNED32 /* base type of data */ |
| 284 | }; |
| 285 | CHECK_dict_new( DICT_AVP, &data, NULL, NULL); |
| 286 | }; |
| 287 | /* MIP-FA-to-MN-SPI */ |
| 288 | { |
| 289 | struct dict_avp_data data = { |
| 290 | 319, /* Code */ |
| 291 | 0, /* Vendor */ |
| 292 | "MIP-FA-to-MN-SPI", /* Name */ |
| 293 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 294 | AVP_FLAG_MANDATORY, /* Fixed flag values */ |
| 295 | AVP_TYPE_UNSIGNED32 /* base type of data */ |
| 296 | }; |
| 297 | CHECK_dict_new( DICT_AVP, &data, NULL, NULL); |
| 298 | }; |
| 299 | /* MIP-HA-to-FA-SPI */ |
| 300 | { |
| 301 | struct dict_avp_data data = { |
| 302 | 323, /* Code */ |
| 303 | 0, /* Vendor */ |
| 304 | "MIP-HA-to-FA-SPI", /* Name */ |
| 305 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 306 | AVP_FLAG_MANDATORY, /* Fixed flag values */ |
| 307 | AVP_TYPE_UNSIGNED32 /* base type of data */ |
| 308 | }; |
| 309 | CHECK_dict_new( DICT_AVP, &data, NULL, NULL); |
| 310 | }; |
| 311 | /* MIP-Nonce */ |
| 312 | { |
| 313 | struct dict_avp_data data = { |
| 314 | 335, /* Code */ |
| 315 | 0, /* Vendor */ |
| 316 | "MIP-Nonce", /* Name */ |
| 317 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 318 | AVP_FLAG_MANDATORY, /* Fixed flag values */ |
| 319 | AVP_TYPE_OCTETSTRING /* base type of data */ |
| 320 | }; |
| 321 | CHECK_dict_new( DICT_AVP, &data, NULL, NULL); |
| 322 | }; |
| 323 | /* MIP-Session-Key */ |
| 324 | { |
| 325 | struct dict_avp_data data = { |
| 326 | 343, /* Code */ |
| 327 | 0, /* Vendor */ |
| 328 | "MIP-Session-Key", /* Name */ |
| 329 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 330 | AVP_FLAG_MANDATORY, /* Fixed flag values */ |
| 331 | AVP_TYPE_OCTETSTRING /* base type of data */ |
| 332 | }; |
| 333 | CHECK_dict_new( DICT_AVP, &data, NULL, NULL); |
| 334 | }; |
| 335 | /* MIP-Algorithm-Type */ |
| 336 | { |
| 337 | struct dict_avp_data data = { |
| 338 | 345, /* Code */ |
| 339 | 0, /* Vendor */ |
| 340 | "MIP-Algorithm-Type", /* Name */ |
| 341 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 342 | AVP_FLAG_MANDATORY, /* Fixed flag values */ |
| 343 | AVP_TYPE_INTEGER32 /* base type of data */ |
| 344 | }; |
| 345 | struct dict_object *type; |
| 346 | struct dict_type_data tdata = { AVP_TYPE_INTEGER32, "Enumerated(MIP-Algorithm-Type)", NULL, NULL, NULL }; |
| 347 | struct dict_enumval_data t_1 = { "HMAC-SHA-1", { .i32=2 }}; |
| 348 | /* Create the Enumerated type, and then the AVP */ |
| 349 | CHECK_dict_new( DICT_TYPE, &tdata, NULL, &type); |
| 350 | CHECK_dict_new( DICT_ENUMVAL, &t_1, type, NULL); |
| 351 | CHECK_dict_new( DICT_AVP, &data, type, NULL); |
| 352 | }; |
| 353 | /* MIP-Replay-Mode */ |
| 354 | { |
| 355 | struct dict_avp_data data = { |
| 356 | 346, /* Code */ |
| 357 | 0, /* Vendor */ |
| 358 | "MIP-Replay-Mode", /* Name */ |
| 359 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 360 | AVP_FLAG_MANDATORY, /* Fixed flag values */ |
| 361 | AVP_TYPE_INTEGER32 /* base type of data */ |
| 362 | }; |
| 363 | struct dict_object *type; |
| 364 | struct dict_type_data tdata = { AVP_TYPE_INTEGER32, "Enumerated(MIP-Replay-Mode)", NULL, NULL, NULL }; |
| 365 | struct dict_enumval_data t_1 = { "None", { .i32=1 }}; |
| 366 | struct dict_enumval_data t_2 = { "Timestamps", { .i32=2 }}; |
| 367 | struct dict_enumval_data t_3 = { "Nonces", { .i32=3 }}; |
| 368 | /* Create the Enumerated type, and then the AVP */ |
| 369 | CHECK_dict_new( DICT_TYPE, &tdata, NULL, &type); |
| 370 | CHECK_dict_new( DICT_ENUMVAL, &t_1, type, NULL); |
| 371 | CHECK_dict_new( DICT_ENUMVAL, &t_2, type, NULL); |
| 372 | CHECK_dict_new( DICT_ENUMVAL, &t_3, type, NULL); |
| 373 | CHECK_dict_new( DICT_AVP, &data, type, NULL); |
| 374 | }; |
| 375 | /* MIP-MSA-Lifetime */ |
| 376 | { |
| 377 | struct dict_avp_data data = { |
| 378 | 367, /* Code */ |
| 379 | 0, /* Vendor */ |
| 380 | "MIP-MSA-Lifetime", /* Name */ |
| 381 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 382 | AVP_FLAG_MANDATORY, /* Fixed flag values */ |
| 383 | AVP_TYPE_UNSIGNED32 /* base type of data */ |
| 384 | }; |
| 385 | CHECK_dict_new( DICT_AVP, &data, NULL, NULL); |
| 386 | }; |
| 387 | /* MIP-FA-to-HA-MSA */ |
| 388 | { |
| 389 | /* Grouped */ |
| 390 | struct dict_object * avp; |
| 391 | struct dict_avp_data data = { |
| 392 | 328, /* Code */ |
| 393 | 0, /* Vendor */ |
| 394 | "MIP-FA-to-HA-MSA", /* Name */ |
| 395 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 396 | AVP_FLAG_MANDATORY, /* Fixed flag values */ |
| 397 | AVP_TYPE_GROUPED /* base type of data */ |
| 398 | }; |
| 399 | CHECK_dict_new( DICT_AVP, &data , NULL, &avp); |
| 400 | } |
| 401 | /* MIP-MN-to-FA-MSA */ |
| 402 | { |
| 403 | /* Grouped */ |
| 404 | struct dict_object * avp; |
| 405 | struct dict_avp_data data = { |
| 406 | 325, /* Code */ |
| 407 | 0, /* Vendor */ |
| 408 | "MIP-MN-to-FA-MSA", /* Name */ |
| 409 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 410 | AVP_FLAG_MANDATORY, /* Fixed flag values */ |
| 411 | AVP_TYPE_GROUPED /* base type of data */ |
| 412 | }; |
| 413 | CHECK_dict_new( DICT_AVP, &data , NULL, &avp); |
| 414 | } |
| 415 | /* MIP-Originating-Foreign-AAA */ |
| 416 | { |
| 417 | /* Grouped */ |
| 418 | struct dict_object * avp; |
| 419 | struct dict_avp_data data = { |
| 420 | 347, /* Code */ |
| 421 | 0, /* Vendor */ |
| 422 | "MIP-Originating-Foreign-AAA", /* Name */ |
| 423 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 424 | AVP_FLAG_MANDATORY, /* Fixed flag values */ |
| 425 | AVP_TYPE_GROUPED /* base type of data */ |
| 426 | }; |
| 427 | CHECK_dict_new( DICT_AVP, &data , NULL, &avp); |
| 428 | } |
| 429 | /* MIP-HA-to-MN-MSA */ |
| 430 | { |
| 431 | /* Grouped */ |
| 432 | struct dict_object * avp; |
| 433 | struct dict_avp_data data = { |
| 434 | 332, /* Code */ |
| 435 | 0, /* Vendor */ |
| 436 | "MIP-HA-to-MN-MSA", /* Name */ |
| 437 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 438 | AVP_FLAG_MANDATORY, /* Fixed flag values */ |
| 439 | AVP_TYPE_GROUPED /* base type of data */ |
| 440 | }; |
| 441 | CHECK_dict_new( DICT_AVP, &data , NULL, &avp); |
| 442 | } |
| 443 | /* MIP-MN-AAA-Auth */ |
| 444 | { |
| 445 | /* Grouped */ |
| 446 | struct dict_object * avp; |
| 447 | struct dict_avp_data data = { |
| 448 | 322, /* Code */ |
| 449 | 0, /* Vendor */ |
| 450 | "MIP-MN-AAA-Auth", /* Name */ |
| 451 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 452 | AVP_FLAG_MANDATORY, /* Fixed flag values */ |
| 453 | AVP_TYPE_GROUPED /* base type of data */ |
| 454 | }; |
| 455 | CHECK_dict_new( DICT_AVP, &data , NULL, &avp); |
| 456 | } |
| 457 | /* MIP-FA-to-MN-MSA */ |
| 458 | { |
| 459 | /* Grouped */ |
| 460 | struct dict_object * avp; |
| 461 | struct dict_avp_data data = { |
| 462 | 326, /* Code */ |
| 463 | 0, /* Vendor */ |
| 464 | "MIP-FA-to-MN-MSA", /* Name */ |
| 465 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 466 | AVP_FLAG_MANDATORY, /* Fixed flag values */ |
| 467 | AVP_TYPE_GROUPED /* base type of data */ |
| 468 | }; |
| 469 | CHECK_dict_new( DICT_AVP, &data , NULL, &avp); |
| 470 | } |
| 471 | /* MIP-HA-to-FA-MSA */ |
| 472 | { |
| 473 | /* Grouped */ |
| 474 | struct dict_object * avp; |
| 475 | struct dict_avp_data data = { |
| 476 | 329, /* Code */ |
| 477 | 0, /* Vendor */ |
| 478 | "MIP-HA-to-FA-MSA", /* Name */ |
| 479 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 480 | AVP_FLAG_MANDATORY, /* Fixed flag values */ |
| 481 | AVP_TYPE_GROUPED /* base type of data */ |
| 482 | }; |
| 483 | CHECK_dict_new( DICT_AVP, &data , NULL, &avp); |
| 484 | } |
| 485 | /* MIP-MN-to-HA-MSA */ |
| 486 | { |
| 487 | /* Grouped */ |
| 488 | struct dict_object * avp; |
| 489 | struct dict_avp_data data = { |
| 490 | 331, /* Code */ |
| 491 | 0, /* Vendor */ |
| 492 | "MIP-MN-to-HA-MSA", /* Name */ |
| 493 | AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ |
| 494 | AVP_FLAG_MANDATORY, /* Fixed flag values */ |
| 495 | AVP_TYPE_GROUPED /* base type of data */ |
| 496 | }; |
| 497 | CHECK_dict_new( DICT_AVP, &data , NULL, &avp); |
| 498 | } |
| 499 | |
| 500 | |
| 501 | } |
| 502 | |
| 503 | /* Commands section */ |
| 504 | { |
| 505 | |
| 506 | } |
| 507 | |
| 508 | return 0; |
| 509 | } |
| 510 | |
| 511 | static int dict_rfc4004_avps_load_rules(char * conffile) |
| 512 | { |
| 513 | /* Grouped AVP section */ |
| 514 | { |
| 515 | /* MIP-FA-to-HA-MSA */ |
| 516 | { |
| 517 | /* Grouped */ |
| 518 | struct dict_object * avp; |
| 519 | struct dict_avp_request avp_vendor_plus_name = { .avp_vendor = 0, .avp_name = "MIP-FA-to-HA-MSA"}; |
| 520 | CHECK_dict_search(DICT_AVP, AVP_BY_NAME_AND_VENDOR, &avp_vendor_plus_name, &avp) |
| 521 | struct local_rules_definition rules[] = |
| 522 | { |
| 523 | { { .avp_vendor = 0, .avp_name = "MIP-FA-to-HA-SPI"}, RULE_REQUIRED, -1, -1 }, |
| 524 | { { .avp_vendor = 0, .avp_name = "MIP-Algorithm-Type"}, RULE_REQUIRED, -1, -1 }, |
| 525 | { { .avp_vendor = 0, .avp_name = "MIP-Session-Key"}, RULE_REQUIRED, -1, -1 } |
| 526 | }; |
| 527 | PARSE_loc_rules( rules, avp ); |
| 528 | } |
| 529 | /* MIP-MN-to-FA-MSA */ |
| 530 | { |
| 531 | /* Grouped */ |
| 532 | struct dict_object * avp; |
| 533 | struct dict_avp_request avp_vendor_plus_name = { .avp_vendor = 0, .avp_name = "MIP-MN-to-FA-MSA"}; |
| 534 | CHECK_dict_search(DICT_AVP, AVP_BY_NAME_AND_VENDOR, &avp_vendor_plus_name, &avp) |
| 535 | struct local_rules_definition rules[] = |
| 536 | { |
| 537 | { { .avp_vendor = 0, .avp_name = "MIP-Algorithm-Type"}, RULE_REQUIRED, -1, -1 }, |
| 538 | { { .avp_vendor = 0, .avp_name = "MIP-Nonce"}, RULE_REQUIRED, -1, -1 } |
| 539 | }; |
| 540 | PARSE_loc_rules( rules, avp ); |
| 541 | } |
| 542 | /* MIP-Originating-Foreign-AAA */ |
| 543 | { |
| 544 | /* Grouped */ |
| 545 | struct dict_object * avp; |
| 546 | struct dict_avp_request avp_vendor_plus_name = { .avp_vendor = 0, .avp_name = "MIP-Originating-Foreign-AAA"}; |
| 547 | CHECK_dict_search(DICT_AVP, AVP_BY_NAME_AND_VENDOR, &avp_vendor_plus_name, &avp) |
| 548 | struct local_rules_definition rules[] = |
| 549 | { |
| 550 | { { .avp_vendor = 0, .avp_name = "Origin-Realm"}, RULE_REQUIRED, -1, -1 }, |
| 551 | { { .avp_vendor = 0, .avp_name = "Origin-Host"}, RULE_REQUIRED, -1, -1 } |
| 552 | }; |
| 553 | PARSE_loc_rules( rules, avp ); |
| 554 | } |
| 555 | /* MIP-HA-to-MN-MSA */ |
| 556 | { |
| 557 | /* Grouped */ |
| 558 | struct dict_object * avp; |
| 559 | struct dict_avp_request avp_vendor_plus_name = { .avp_vendor = 0, .avp_name = "MIP-HA-to-MN-MSA"}; |
| 560 | CHECK_dict_search(DICT_AVP, AVP_BY_NAME_AND_VENDOR, &avp_vendor_plus_name, &avp) |
| 561 | struct local_rules_definition rules[] = |
| 562 | { |
| 563 | { { .avp_vendor = 0, .avp_name = "MIP-Algorithm-Type"}, RULE_REQUIRED, -1, -1 }, |
| 564 | { { .avp_vendor = 0, .avp_name = "MIP-Replay-Mode"}, RULE_REQUIRED, -1, -1 }, |
| 565 | { { .avp_vendor = 0, .avp_name = "MIP-Session-Key"}, RULE_REQUIRED, -1, -1 } |
| 566 | }; |
| 567 | PARSE_loc_rules( rules, avp ); |
| 568 | } |
| 569 | /* MIP-MN-AAA-Auth */ |
| 570 | { |
| 571 | /* Grouped */ |
| 572 | struct dict_object * avp; |
| 573 | struct dict_avp_request avp_vendor_plus_name = { .avp_vendor = 0, .avp_name = "MIP-MN-AAA-Auth"}; |
| 574 | CHECK_dict_search(DICT_AVP, AVP_BY_NAME_AND_VENDOR, &avp_vendor_plus_name, &avp) |
| 575 | struct local_rules_definition rules[] = |
| 576 | { |
| 577 | { { .avp_vendor = 0, .avp_name = "MIP-MN-AAA-SPI"}, RULE_REQUIRED, -1, -1 }, |
| 578 | { { .avp_vendor = 0, .avp_name = "MIP-Auth-Input-Data-Length"}, RULE_REQUIRED, -1, -1 }, |
| 579 | { { .avp_vendor = 0, .avp_name = "MIP-Authenticator-Length"}, RULE_REQUIRED, -1, -1 }, |
| 580 | { { .avp_vendor = 0, .avp_name = "MIP-Authenticator-Offset"}, RULE_REQUIRED, -1, -1 } |
| 581 | }; |
| 582 | PARSE_loc_rules( rules, avp ); |
| 583 | } |
| 584 | /* MIP-FA-to-MN-MSA */ |
| 585 | { |
| 586 | /* Grouped */ |
| 587 | struct dict_object * avp; |
| 588 | struct dict_avp_request avp_vendor_plus_name = { .avp_vendor = 0, .avp_name = "MIP-FA-to-MN-MSA"}; |
| 589 | CHECK_dict_search(DICT_AVP, AVP_BY_NAME_AND_VENDOR, &avp_vendor_plus_name, &avp) |
| 590 | struct local_rules_definition rules[] = |
| 591 | { |
| 592 | { { .avp_vendor = 0, .avp_name = "MIP-FA-to-MN-SPI"}, RULE_REQUIRED, -1, -1 }, |
| 593 | { { .avp_vendor = 0, .avp_name = "MIP-Algorithm-Type"}, RULE_REQUIRED, -1, -1 }, |
| 594 | { { .avp_vendor = 0, .avp_name = "MIP-Session-Key"}, RULE_REQUIRED, -1, -1 } |
| 595 | }; |
| 596 | PARSE_loc_rules( rules, avp ); |
| 597 | } |
| 598 | /* MIP-HA-to-FA-MSA */ |
| 599 | { |
| 600 | /* Grouped */ |
| 601 | struct dict_object * avp; |
| 602 | struct dict_avp_request avp_vendor_plus_name = { .avp_vendor = 0, .avp_name = "MIP-HA-to-FA-MSA"}; |
| 603 | CHECK_dict_search(DICT_AVP, AVP_BY_NAME_AND_VENDOR, &avp_vendor_plus_name, &avp) |
| 604 | struct local_rules_definition rules[] = |
| 605 | { |
| 606 | { { .avp_vendor = 0, .avp_name = "MIP-HA-to-FA-SPI"}, RULE_REQUIRED, -1, -1 }, |
| 607 | { { .avp_vendor = 0, .avp_name = "MIP-Algorithm-Type"}, RULE_REQUIRED, -1, -1 }, |
| 608 | { { .avp_vendor = 0, .avp_name = "MIP-Session-Key"}, RULE_REQUIRED, -1, -1 } |
| 609 | }; |
| 610 | PARSE_loc_rules( rules, avp ); |
| 611 | } |
| 612 | /* MIP-MN-to-HA-MSA */ |
| 613 | { |
| 614 | /* Grouped */ |
| 615 | struct dict_object * avp; |
| 616 | struct dict_avp_request avp_vendor_plus_name = { .avp_vendor = 0, .avp_name = "MIP-MN-to-HA-MSA"}; |
| 617 | CHECK_dict_search(DICT_AVP, AVP_BY_NAME_AND_VENDOR, &avp_vendor_plus_name, &avp) |
| 618 | struct local_rules_definition rules[] = |
| 619 | { |
| 620 | { { .avp_vendor = 0, .avp_name = "MIP-Algorithm-Type"}, RULE_REQUIRED, -1, -1 }, |
| 621 | { { .avp_vendor = 0, .avp_name = "MIP-Replay-Mode"}, RULE_REQUIRED, -1, -1 }, |
| 622 | { { .avp_vendor = 0, .avp_name = "MIP-Nonce"}, RULE_REQUIRED, -1, -1 } |
| 623 | }; |
| 624 | PARSE_loc_rules( rules, avp ); |
| 625 | } |
| 626 | |
| 627 | } |
| 628 | |
| 629 | /* Commands section */ |
| 630 | { |
| 631 | |
| 632 | } |
| 633 | |
| 634 | LOG_D( "Extension 'Dictionary definitions for rfc4004_avps (None)' initialized"); |
| 635 | return 0; |
| 636 | } |
| 637 | |
| 638 | int dict_entry(char * conffile) |
| 639 | { |
| 640 | dict_rfc4004_avps_load_defs(conffile); |
| 641 | return dict_rfc4004_avps_load_rules(conffile); |
| 642 | } |
| 643 | |
| 644 | const char* dict_rfc4004_avps_proto_ver(char * conffile) { |
| 645 | return rfc4004_avps_proto_ver; |
| 646 | } |
| 647 | |
| 648 | const double dict_rfc4004_avps_gen_ts(char * conffile) { |
| 649 | return rfc4004_avps_gen_date; |
| 650 | } |
| 651 | |
| 652 | EXTENSION_ENTRY2("dict_rfc4004_avps", dict_rfc4004_avps_load_defs, dict_rfc4004_avps_load_rules); |
| 653 | |
| 654 | |
| 655 | |