# HG changeset patch # User Francois Bard # Date 1289836995 -3600 # Node ID aa0dc24d2b9d1fd7528b56cc01a2448ba8e08454 # Parent 0758a357a1517fb48d22c152f3204b0f6ebdc510 New dictionary extensions for mipv6 applications (RFC 5447, 5777, 5778) diff -r 0758a357a151 -r aa0dc24d2b9d extensions/dict_mip6a/CMakeLists.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/extensions/dict_mip6a/CMakeLists.txt Mon Nov 15 17:03:15 2010 +0100 @@ -0,0 +1,13 @@ +# The dict_mip6a extension +PROJECT("Diameter Mobile IPv6 Auth (MIP6A) Dictionary Definitions" C) + +# Compile as a module +FD_ADD_EXTENSION(dict_mip6a dict_mip6a.c) + + +#### +## INSTALL section ## + +INSTALL(TARGETS dict_mip6a + LIBRARY DESTINATION ${INSTALL_EXTENSIONS_SUFFIX} + COMPONENT freeDiameter-dictionary-mip6a) diff -r 0758a357a151 -r aa0dc24d2b9d extensions/dict_mip6a/dict_mip6a.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/extensions/dict_mip6a/dict_mip6a.c Mon Nov 15 17:03:15 2010 +0100 @@ -0,0 +1,821 @@ +/********************************************************************************************************* +* Software License Agreement (BSD License) * +* Author: Francois Bard * +* * +* Copyright (c) 2010, Teraoka Laboratory, Keio University * +* All rights reserved. * +* * +* Redistribution and use of this software in source and binary forms, with or without modification, are * +* permitted provided that the following conditions are met: * +* * +* * Redistributions of source code must retain the above * +* copyright notice, this list of conditions and the * +* following disclaimer. * +* * +* * Redistributions in binary form must reproduce the above * +* copyright notice, this list of conditions and the * +* following disclaimer in the documentation and/or other * +* materials provided with the distribution. * +* * +* * Neither the name of the Teraoka Laboratory nor the * +* names of its contributors may be used to endorse or * +* promote products derived from this software without * +* specific prior written permission of Teraoka Laboratory * +* * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED * +* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * +* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * +* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR * +* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * +* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +*********************************************************************************************************/ + +/********************************************************************************************************* +The following table complete the one in RFC 5778, page 18. The AVPs are implemented below following the order of this table. +We try to keep the structure of the grouped AVP by declaring the contained AVPs just before the grouped AVP they depend on. +The number of '+' indicates the depth of the contained AVP. + +DEPTH NAME AVP RFC TYPE NOTES + + MIP6-Feature-Vector 124 5447 Unsigned64 + User-Name 1 3588 UTF8String implemented in base protocol + Service-Selection 493 5778 UTF8String + MIP-MN-AAA-SPI 341 5778 Unsigned32 ++ MIP-Home-Agent-Address 334 4004 Address +++ Destination-Host 293 3588 DiameterIdentity implemented in base protocol +++ Destination-Realm 283 3588 DiameterIdentity implemented in base protocol ++ MIP-Home-Agent-Host 348 4004 Grouped ++ MIP6-Home-Link-Prefix 125 5447 OctetString + MIP6-Agent-Info 486 5447 Grouped ++ MIP-Replay-Mode 346 4004 Enumerated ++ MIP-Algorithm-Type 345 4004 Enumerated ++ MIP-MN-HA-SPI 491 5778 Unsigned32 ++ MIP-MSA-Lifetime 367 4004 Unsigned32 ++ MIP-Session-Key 343 4004 OctetString + MIP-MN-HA-MSA 492 5778 Grouped different from MIP-MN-to-HA-MSA (331) + MIP-Mobile-Node-Address 333 4004 Address + MIP-Careof-Address 487 5778 Address + MIP-Authenticator 488 5778 OctetString + MIP-MAC-Mobility-Data 489 5778 OctetString + MIP-Timestamp 490 5778 OctetString + Chargeable-User-Identity 89 5778 OctetString + MIP6-Auth-Mode 494 5778 Enumerated + +QoS AVPs (RFC 5777 - implemented in the corresponding dictionary) + + QoS-Capability 578 5777 Grouped + QoS-Resources 508 5777 Grouped + +ACCOUNTING AVPs (section 6.21) + + Accounting-Input-Octets 363 4004, 4005 Unsigned64 + Accounting-Output-Octets 364 4004, 4005 Unsigned64 + Accounting-Input-Packets 365 4004, 4005 Unsigned64 + Accounting-Output-Packets 366 4004, 4005 Unsigned64 + Acct-Multi-Session-Id 50 3588 UTF8String implemented in base protocol + Acct-Session-Time 46 2866, 4004 Unsigned32 + MIP6-Feature-Vector ---------------------------------- + MIP-Mobile-Node-Address ---------------------------------- + MIP-Agent-Info ---------------------------------- + Chargeable-User-Identity ---------------------------------- + Service-Selection ---------------------------------- + QoS-Resources ---------------------------------- + QoS-Capability ---------------------------------- + MIP-Careof-Address ---------------------------------- + +REST OF THE AVPs IN THE MIR & MIA EXCLUDING *[AVP] + +MIP6-Request - Only a few radius AVPs have to be implemented. + + Session-ID 263 3588 (diameter) + Auth-Application-Id 258 3588 + User-Name 1 3588 + Destination-Realm 283 3588 + Origin-Host 264 3588 + Origin-Realm 296 3588 + Auth-Request-Type 274 3588 + Destination-Host 293 3588 + Origin-State-Id 278 3588 + NAS-Identifier 32 2865 (radius) needed + NAS-IP-Address 4 2865 needed + NAS-IPv6-Address 95 3162 needed + NAS-Port-Type 61 2865 needed + Called-Station-Id 30 2865 needed + Calling-Station-Id 31 2865 needed + MIP6-Feature-Vector ------------ + MIP6-Auth-Mode ------------ + MIP-MN-AAA-SPI ------------ + MIP-MN-HA-SPI ------------ + MIP-Mobile-Node-Address ------------ + MIP6-Agent-Info ------------ + MIP-Careof-Address ------------ + MIP-Authenticator ------------ + MIP-MAC-Mobility-Data ------------ + MIP-Timestamp ------------ + QoS-Capability ------------ + QoS-Resources ------------ + Chargeable-User-Identity ------------ + Service-Selection ------------ + Authorization-Lifetime 291 3588 + Auth-Session-State 277 3588 + Proxy-Info 284 3588 + Route-Record 282 3588 + +MIP6-Answer - All of them are already implemented as base protocol AVPs or implemented earlier. + + Session-Id 263 3588 (diameter) + Auth-Application-Id 258 3588 + Result-Code 268 3588 + Origin-Host 264 3588 + Origin-Realm 296 3588 + Auth-Request-Type 274 3588 + User-Name 1 3588 + Authorization-Lifetime 291 3588 + Auth-Session-State 277 3588 + Error-Message 281 3588 + Error-Reporting-Host 294 3588 + Re-Auth-Request-Type 285 3588 + MIP6-Feature-Vector ------------------- + MIP-Agent-Info ------------------- + MIP-Mobile-Node-Address ------------------- + MIP-MN-HA-MSA ------------------- + QoS-Resources ------------------- + Chargeable-User-Identity ------------------- + Service-Selection ------------------- + Origin-State-Id 278 3588 + Proxy-Info 284 3588 + Redirect-Host 292 3588 + Redirect-Host-Usage 261 3588 + Redirect-Max-Cache-Time 262 3588 + Failed-AVP 279 3588 + +Other AVPs? + +************************************************************************************************************/ + +/**************************************************************************************************************************************** +* * +* This table is a copy of the registry named "MIP6 Authentication Mode Registry" and managed by IANA. * +* source : http://www.iana.org/assignments/aaa-parameters/aaa-parameters.txt * +* * +* * +* Value Token Reference * +* 0 Reserved [RFC5778] * +* 1 MIP6_AUTH_MN_AAA [RFC5778] * +* 2-4294967295 Unassigned * +* * +****************************************************************************************************************************************/ + + +/* + NOTES TO SELF + + - Reflechir au rangement des avps + - Verifier si dans les grouped avps il faut aussi implementer les sous avp + - verifier si les avps sont up-to-date, et ecrire la date a laquelle ils sont up-to-date + + - comment on fait pour les namespaces? (typiquement MIP6_AUTH_MN_AAA, RFC5778 page 30) + - (pour linstant jai fait un define) + + -RELIRE ! jai peu quil y ait des fautes. surtout celle la. + +*/ + +#include + +#define CHECK_dict_new( _type, _data, _parent, _ref ) \ + CHECK_FCT( fd_dict_new( fd_g_config->cnf_dict, (_type), (_data), (_parent), (_ref)) ); + +#define CHECK_dict_search( _type, _criteria, _what, _result ) \ + CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, (_type), (_criteria), (_what), (_result), ENOENT) ); + +struct local_rules_definition { + char *avp_name; + enum rule_position position; + int min; + int max; +}; + +#define RULE_ORDER( _position ) ((((_position) == RULE_FIXED_HEAD) || ((_position) == RULE_FIXED_TAIL)) ? 1 : 0 ) + +#define PARSE_loc_rules( _rulearray, _parent) { \ + int __ar; \ + for (__ar=0; __ar < sizeof(_rulearray) / sizeof((_rulearray)[0]); __ar++) { \ + struct dict_rule_data __data = { NULL, \ + (_rulearray)[__ar].position, \ + 0, \ + (_rulearray)[__ar].min, \ + (_rulearray)[__ar].max}; \ + __data.rule_order = RULE_ORDER(__data.rule_position); \ + CHECK_FCT( fd_dict_search( \ + fd_g_config->cnf_dict, \ + DICT_AVP, \ + AVP_BY_NAME, \ + (_rulearray)[__ar].avp_name, \ + &__data.rule_avp, 0 ) ); \ + if ( !__data.rule_avp ) { \ + TRACE_DEBUG(INFO, "AVP Not found: '%s'", (_rulearray)[__ar].avp_name ); \ + return ENOENT; \ + } \ + CHECK_FCT_DO( fd_dict_new( fd_g_config->cnf_dict, DICT_RULE, &__data, _parent, NULL), \ + { \ + TRACE_DEBUG(INFO, "Error on rule with AVP '%s'", \ + (_rulearray)[__ar].avp_name ); \ + return EINVAL; \ + } ); \ + } \ +} + +#define enumval_def_u32( _val_, _str_ ) \ + { _str_, { .u32 = _val_ }} + +#define enumval_def_os( _len_, _val_, _str_ ) \ + { _str_, { .os = { .data = (unsigned char *)_val_, .len = _len_ }}} + + + +/* Defines if there are any */ + +/* New Result-Code for MIP (RFC5778, Section 7.*) */ +#define DIAMETER_SUCCESS_RELOCATE_HA 2009 +#define DIAMETER_ERROR_MIP6_AUTH_MODE 5041 +#define MIP6_AUTH_MN_AAA 1 + +/* Dictionary */ + +int dict_mip6a_init() +{ + struct dict_object * mip6a; + { + struct dict_application_data data = { 8, "Diameter Mobile IPv6 Auth (MIP6A) Application" }; + CHECK_dict_new( DICT_APPLICATION, &data , NULL, &mip6a); + } + + /***************/ + /* AVP section */ + /***************/ + { + /* Loading all the derived data formats */ + + struct dict_object * Address_type; + struct dict_object * UTF8String_type; + struct dict_object * DiameterIdentity_type; + struct dict_object * DiameterURI_type; + struct dict_object * Time_type; + + CHECK_dict_search( DICT_TYPE, TYPE_BY_NAME, "Address", &Address_type); + CHECK_dict_search( DICT_TYPE, TYPE_BY_NAME, "UTF8String", &UTF8String_type); + CHECK_dict_search( DICT_TYPE, TYPE_BY_NAME, "DiameterIdentity", &DiameterIdentity_type); + CHECK_dict_search( DICT_TYPE, TYPE_BY_NAME, "DiameterURI", &DiameterURI_type); + CHECK_dict_search( DICT_TYPE, TYPE_BY_NAME, "Time", &Time_type); + + /////////////////////////////////////////// + /* AVPs for Mobile IPv6 Auth Application */ + /////////////////////////////////////////// + + /* MIP6-Feature-Vector - RFC 5447 */ + { + /* + + */ + + struct dict_avp_data data = { + 124, /* Code */ + 0, /* Vendor */ + "MIP6-Feature-Vector", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_UNSIGNED64 /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /* User-Name - RFC 3588 */ + + /* + Implemented in the base protocol + */ + + /* Service-Selection - RFC 5778 */ + { + /* + + */ + + struct dict_avp_data data = { + 493, /* Code */ + 0, /* Vendor */ + "Service-Selection", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_OCTETSTRING /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , UTF8String_type, NULL); + } + + /* MIP-MN-AAA-SPI - RFC 5778 */ + { + /* + + */ + + struct dict_avp_data data = { + 341, /* Code */ + 0, /* Vendor */ + "MIP-MN-AAA-SPI", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_UNSIGNED32 /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /* Destination-Host - Base Protocol */ + + /* + Implemented in the base protocol + */ + + /* Destination-Realm - Base Protocol */ + + /* + Implemented in the base protocol + */ + + /* MIP-Home-Agent-Address - RFC 4004 */ + { + /* + + */ + + struct dict_avp_data data = { + 334, /* Code */ + 0, /* Vendor */ + "MIP-Home-Agent-Address", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_OCTETSTRING /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , Address_type, NULL); + } + + /* MIP-Home-Agent-Host - RFC 4004 */ + { + /* + + */ + struct dict_object * avp; + struct dict_avp_data data = { + 348, /* Code */ + 0, /* Vendor */ + "MIP-Home-Agent-Host", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_GROUPED /* base type of data */ + }; + + struct local_rules_definition rules[] = + { { "Destination-Realm", RULE_REQUIRED, -1, 1 } + ,{ "Destination-Host", RULE_REQUIRED, -1, 1 } + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, &avp); + PARSE_loc_rules( rules, avp ); + } + + /* MIP6-Home-Link-Prefix - RFC 5447 */ + { + /* + + */ + + struct dict_avp_data data = { + 125, /* Code */ + 0, /* Vendor */ + "MIP6-Home-Link-Prefix", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_OCTETSTRING /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /* MIP6-Agent-Info - RFC 5447*/ + { + /* + + */ + struct dict_object * avp; + struct dict_avp_data data = { + 486, /* Code */ + 0, /* Vendor */ + "MIP6-Agent-Info", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_GROUPED /* base type of data */ + }; + + struct local_rules_definition rules[] = + { { "MIP-Home-Agent-Address", RULE_OPTIONAL, -1, 2 } + ,{ "MIP-Home-Agent-Host", RULE_OPTIONAL, -1, 1 } + ,{ "MIP6-Home-Link-Prefix", RULE_OPTIONAL, -1, 1 } + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, &avp); + PARSE_loc_rules( rules, avp ); + } + + /* MIP-Replay-Mode - RFC 5778 & 4004 */ + { + /* + + */ + struct dict_object * type; + struct dict_type_data tdata = { AVP_TYPE_INTEGER32, "Enumerated(MIP-Replay-Mode)", NULL, NULL, NULL }; + struct dict_enumval_data t_0 = { "None", { .i32 = 1 }}; + struct dict_enumval_data t_1 = { "Timestamp", { .i32 = 2 }}; + struct dict_avp_data data = { + 346, /* Code */ + 0, /* Vendor */ + "MIP-Replay-Mode", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_INTEGER32 /* base type of data */ + }; + + /* Create the Enumerated type, and then the AVP */ + CHECK_dict_new( DICT_TYPE, &tdata , NULL, &type); + CHECK_dict_new( DICT_ENUMVAL, &t_0 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_1 , type, NULL); + CHECK_dict_new( DICT_AVP, &data , type, NULL); + } + + /* MIP-Algorithm-Type - RFC 5778 & 4004 */ + { + /* + + */ + struct dict_object * type; + struct dict_type_data tdata = { AVP_TYPE_INTEGER32, "Enumerated(MIP-Algorithm-Type)", NULL, NULL, NULL }; + struct dict_enumval_data t_2 = { "HMAC-SHA-1", { .i32 = 2 }}; + struct dict_avp_data data = { + 345, /* Code */ + 0, /* Vendor */ + "MIP-Algorithm-Type", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_INTEGER32 /* base type of data */ + }; + + /* Create the Enumerated type, and then the AVP */ + CHECK_dict_new( DICT_TYPE, &tdata , NULL, &type); + CHECK_dict_new( DICT_ENUMVAL, &t_2 , type, NULL); + CHECK_dict_new( DICT_AVP, &data , type, NULL); + } + + /* MIP-MN-HA-SPI - RFC 5778 */ + { + /* + + */ + struct dict_avp_data data = { + 491, /* Code */ + 0, /* Vendor */ + "MIP-MN-HA-SPI", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_UNSIGNED32 /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /* MIP-MSA-Lifetime - RFC 4004 */ + { + /* + + */ + struct dict_avp_data data = { + 367, /* Code */ + 0, /* Vendor */ + "MIP-MSA-Lifetime", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_UNSIGNED32 /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /* MIP-Session-Key - RFC 5778 */ + { + /* + + */ + struct dict_avp_data data = { + 343, /* Code */ + 0, /* Vendor */ + "MIP-Session-Key", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_OCTETSTRING /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /* MIP-MN-HA-MSA - RFC 5778 */ + { + /* + + */ + struct dict_object * avp; + struct dict_avp_data data = { + 492, /* Code */ + 0, /* Vendor */ + "MIP-MN-HA-MSA", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_GROUPED /* base type of data */ + }; + + struct local_rules_definition rules[] = + { { "MIP-Session-Key", RULE_REQUIRED, -1, 1 } + ,{ "MIP-MSA-Lifetime", RULE_REQUIRED, -1, 1 } + ,{ "MIP-MN-HA-SPI", RULE_OPTIONAL, -1, 1 } + ,{ "MIP-Algorithm-Type", RULE_OPTIONAL, -1, 1 } + ,{ "MIP-Replay-Mode", RULE_OPTIONAL, -1, 1 } + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, &avp); + PARSE_loc_rules( rules, avp ); + } + + /* MIP-Mobile-Node-Address - RFC 4004 */ + { + /* + + */ + + struct dict_avp_data data = { + 333, /* Code */ + 0, /* Vendor */ + "MIP-Mobile-Node-Address", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_OCTETSTRING /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , Address_type, NULL); + } + + /* MIP-Careof-Address - RFC 5778 */ + { + /* + + */ + struct dict_avp_data data = { + 487, /* Code */ + 0, /* Vendor */ + "MIP-Careof-Address", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_OCTETSTRING /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , Address_type, NULL); + } + + /* MIP-Authenticator - RFC 5778 */ + { + /* + + */ + struct dict_avp_data data = { + 488, /* Code */ + 0, /* Vendor */ + "MIP-Authenticator", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_OCTETSTRING /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /* MIP-MAC-Mobility-Data - RFC 5778 */ + { + /* + + */ + struct dict_avp_data data = { + 489, /* Code */ + 0, /* Vendor */ + "MIP-MAC-Mobility-Data", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_OCTETSTRING /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /* MIP-Timestamp - RFC 5778 */ + { + /* + + */ + struct dict_avp_data data = { + 490, /* Code */ + 0, /* Vendor */ + "MIP-Timestamp", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_OCTETSTRING /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /* Chargeable-User-Identity - RFC 5778 */ + { + /* + + */ + struct dict_avp_data data = { + 89, /* Code */ + 0, /* Vendor */ + "Chargeable-User-Identity", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_OCTETSTRING /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /* MIP6-Auth-Mode - RFC 5778 */ + { + /* + + */ + struct dict_object * type; + struct dict_type_data tdata = { AVP_TYPE_INTEGER32, "Enumerated(MIP6-Auth-Mode)", NULL, NULL, NULL }; + struct dict_enumval_data t_0 = { "None", { .i32 = MIP6_AUTH_MN_AAA }}; + struct dict_avp_data data = { + 494, /* Code */ + 0, /* Vendor */ + "MIP6-Auth-Mode", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_INTEGER32 /* base type of data */ + }; + + /* Create the Enumerated type, and then the AVP */ + CHECK_dict_new( DICT_TYPE, &tdata , NULL, &type); + CHECK_dict_new( DICT_ENUMVAL, &t_0 , type, NULL); + CHECK_dict_new( DICT_AVP, &data , type, NULL); + } + + ////////////// + /* QoS AVPs */ + ////////////// + + /* QoS-Capability */ + + /* + Implemented in RFC 5777 + */ + + /* QoS-Resources */ + + /* + Implemented in RFC 5777 + */ + + ///////////////////// + /* Accounting AVPs */ + ///////////////////// + + /* Accounting-Input-Octets - RFC 4004 */ + { + /* + + */ + struct dict_avp_data data = { + 363, /* Code */ + 0, /* Vendor */ + "Accounting-Input-Octets", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_UNSIGNED64 /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /* Accounting-Output-Octets - RFC 4004 */ + { + /* + + */ + struct dict_avp_data data = { + 364, /* Code */ + 0, /* Vendor */ + "Accounting-Output-Octets", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_UNSIGNED64 /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /* Accounting-Input-Packets - RFC 4004 */ + { + /* + + */ + struct dict_avp_data data = { + 365, /* Code */ + 0, /* Vendor */ + "Accounting-Input-Packets", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_UNSIGNED64 /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /* Accounting-Output-Packets - RFC 4004 */ + { + /* + + */ + struct dict_avp_data data = { + 366, /* Code */ + 0, /* Vendor */ + "Accounting-Output-Packets", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_UNSIGNED64 /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /* Acct-Multi-Session-Id - RFC 3588 */ + + /* + Implemented in the base protocol + */ + + /* Acct-Session-Time - RFC 4004 */ + { + /* + + */ + struct dict_avp_data data = { + 46, /* Code */ + 0, /* Vendor */ + "Acct-Session-Time", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_UNSIGNED32 /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + } + + ///////////////////////////////////// + /* Radius AVPs - used in MIR & MIA */ + ///////////////////////////////////// + + /* + * + * voir MIP6I + * + NAS-Identifier 32 2865 (radius) + NAS-IP-Address 4 2865 + NAS-IPv6-Address 95 3162 + NAS-Port-Type 61 2865 + Called-Station-Id 30 2865 + Calling-Station-Id 31 2865 + */ + + + TRACE_DEBUG(INFO, "Dictionary Extension 'Diameter Mobile IPv6 Auth (MIP6A)' initialized"); + return 0; +} +EXTENSION_ENTRY("dict_mip6a",dict_mip6a_init); diff -r 0758a357a151 -r aa0dc24d2b9d extensions/dict_mip6i/CMakeLists.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/extensions/dict_mip6i/CMakeLists.txt Mon Nov 15 17:03:15 2010 +0100 @@ -0,0 +1,13 @@ +# The dict_mip6i extension +PROJECT("Diameter Mobile IPv6 IKE (MIP6I) Dictionary Definition" C) + +# Compile as a module +FD_ADD_EXTENSION(dict_mip6i dict_mip6i.c) + + +#### +## INSTALL section ## + +INSTALL(TARGETS dict_mip6i + LIBRARY DESTINATION ${INSTALL_EXTENSIONS_SUFFIX} + COMPONENT freeDiameter-dictionary-mip6i) diff -r 0758a357a151 -r aa0dc24d2b9d extensions/dict_mip6i/dict_mip6i.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/extensions/dict_mip6i/dict_mip6i.c Mon Nov 15 17:03:15 2010 +0100 @@ -0,0 +1,1179 @@ +/********************************************************************************************************* +* Software License Agreement (BSD License) * +* Author: Francois Bard * +* * +* Copyright (c) 2010, Teraoka Laboratory, Keio University * +* All rights reserved. * +* * +* Redistribution and use of this software in source and binary forms, with or without modification, are * +* permitted provided that the following conditions are met: * +* * +* * Redistributions of source code must retain the above * +* copyright notice, this list of conditions and the * +* following disclaimer. * +* * +* * Redistributions in binary form must reproduce the above * +* copyright notice, this list of conditions and the * +* following disclaimer in the documentation and/or other * +* materials provided with the distribution. * +* * +* * Neither the name of the Teraoka Laboratory nor the * +* names of its contributors may be used to endorse or * +* promote products derived from this software without * +* specific prior written permission of Teraoka Laboratory * +* * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED * +* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * +* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * +* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR * +* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * +* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +*********************************************************************************************************/ + +/********************************************************************************************************* +The following table complete the one in RFC 5778, page 18. The AVPs are implemented below following the order of this table. +We try to keep the structure of the grouped AVP by declaring the contained AVPs just before the grouped AVP they depend on. +The number of '+' indicates the depth of the contained AVP. + +DEPTH NAME AVP RFC TYPE NOTES + + MIP6-Feature-Vector 124 5447 Unsigned64 + MIP-Mobile-Node-Address 333 4004 Address ++ MIP-Home-Agent-Address 334 4004 Address +++ Destination-Host 293 3588 DiameterIdentity implemented in base protocol +++ Destination-Realm 283 3588 DiameterIdentity implemented in base protocol ++ MIP-Home-Agent-Host 348 4004 Grouped ++ MIP6-Home-Link-Prefix 125 5447 OctetString + MIP6-Agent-Info 486 5447 Grouped + User-Name 1 3588 UTF8String implemented in base protocol + Service-Selection 493 5778 UTF8String ++ MIP-Replay-Mode 346 4004 Enumerated ++ MIP-Algorithm-Type 345 4004 Enumerated ++ MIP-MN-HA-SPI 491 5778 Unsigned32 ++ MIP-MSA-Lifetime 367 4004 Unsigned32 ++ MIP-Session-Key 343 4004 OctetString + MIP-MN-HA-MSA 492 5778 Grouped different from MIP-MN-to-HA-MSA (331) + Chargeable-User-Identity 89 5778 OctetString + +QoS AVPs (RFC 5777 - implemented in the corresponding dictionary) + + QoS-Capability 578 5777 Grouped + QoS-Resources 508 5777 Grouped + +ACCOUNTING AVPs (section 6.21) + + Accounting-Input-Octets 363 4004, 4005 Unsigned64 + Accounting-Output-Octets 364 4004, 4005 Unsigned64 + Accounting-Input-Packets 365 4004, 4005 Unsigned64 + Accounting-Output-Packets 366 4004, 4005 Unsigned64 + Acct-Multi-Session-Id 50 3588 UTF8String implemented in base protocol + Acct-Session-Time 46 2866, 4004 Unsigned32 + MIP6-Feature-Vector ---------------------------------- + MIP-Mobile-Node-Address ---------------------------------- + MIP-Agent-Info ---------------------------------- + Chargeable-User-Identity ---------------------------------- + Service-Selection ---------------------------------- + QoS-Resources ---------------------------------- + QoS-Capability ---------------------------------- + MIP-Careof-Address 487 5778 Address needed in MIP6I at least for implementation reasons + +REST OF THE AVPs IN THE MIR & MIA EXCLUDING *[AVP] + +MIP6-Request + + Session-ID 263 3588 (diameter) + Auth-Application-Id 258 3588 + User-Name 1 3588 + Destination-Realm 283 3588 + Origin-Host 264 3588 + Origin-Realm 296 3588 + Auth-Request-Type 274 3588 + Destination-Host 293 3588 + Origin-State-Id 278 3588 + NAS-Identifier 32 2865 (radius) string... needed + NAS-IP-Address 4 2865 ?? needed + NAS-IPv6-Address 95 3162 ?? needed + NAS-Port-Type 61 2865 ?? needed + Called-Station-Id 30 2865 ?? needed + Calling-Station-Id 31 2865 ?? needed + MIP6-Feature-Vector ------------ + MIP6-Auth-Mode 494 5778 Enumerated needed in MIP6I at least for implementation reasons + MIP-MN-AAA-SPI 341 5778 Unsigned32 needed in MIP6I at least for implementation reasons + MIP-MN-HA-SPI ------------ + MIP-Mobile-Node-Address ------------ + MIP6-Agent-Info ------------ + MIP-Careof-Address ------------ + MIP-Authenticator 488 5778 OctetString needed in MIP6I at least for implementation reasons + MIP-MAC-Mobility-Data 489 5778 OctetString needed in MIP6I at least for implementation reasons + MIP-Timestamp 490 5778 OctetString needed in MIP6I at least for implementation reasons + QoS-Capability ------------ + QoS-Resources ------------ + Chargeable-User-Identity ------------ + Service-Selection ------------ + Authorization-Lifetime 291 3588 + Auth-Session-State 277 3588 + Proxy-Info 284 3588 + Route-Record 282 3588 + +MIP6-Answer - All of them are already implemented as base protocol AVPs or implemented earlier. + + Session-Id 263 3588 (diameter) + Auth-Application-Id 258 3588 + Result-Code 268 3588 + Origin-Host 264 3588 + Origin-Realm 296 3588 + Auth-Request-Type 274 3588 + User-Name 1 3588 + Authorization-Lifetime 291 3588 + Auth-Session-State 277 3588 + Error-Message 281 3588 + Error-Reporting-Host 294 3588 + Re-Auth-Request-Type 285 3588 + MIP6-Feature-Vector ------------------- + MIP-Agent-Info ------------------- + MIP-Mobile-Node-Address ------------------- + MIP-MN-HA-MSA ------------------- + QoS-Resources ------------------- + Chargeable-User-Identity ------------------- + Service-Selection ------------------- + Origin-State-Id 278 3588 + Proxy-Info 284 3588 + Redirect-Host 292 3588 + Redirect-Host-Usage 261 3588 + Redirect-Max-Cache-Time 262 3588 + Failed-AVP 279 3588 + +Other AVPs? + +************************************************************************************************************/ + +/**************************************************************************************************************************************** +* * +* This table is a copy of the registry named "MIP6 Authentication Mode Registry" and managed by IANA. * +* source : http://www.iana.org/assignments/aaa-parameters/aaa-parameters.txt * +* * +* * +* Value Token Reference * +* 0 Reserved [RFC5778] * +* 1 MIP6_AUTH_MN_AAA [RFC5778] * +* 2-4294967295 Unassigned * +* * +****************************************************************************************************************************************/ + + +/* + NOTES TO SELF + + http://www.iana.org/assignments/aaa-parameters/aaa-parameters.txt + important, a suivre et verifier si il y a des evolutions + + - a quoi sert le int dict---init juste avant le debut du dico? + + -verifier si je ne fais pas des define pour rien + + -dire de pas oublier d'inclure le dictionnaire eap + + inclure la rfc5777? ou le faire dans un autre fichier? + + la valeur MIP6_AUTH_MN_AAA est utilisee par quoi?? verifier. + + ne pas oublier de changer la clause bsd + + + + + +*/ + +#include + +#define CHECK_dict_new( _type, _data, _parent, _ref ) \ + CHECK_FCT( fd_dict_new( fd_g_config->cnf_dict, (_type), (_data), (_parent), (_ref)) ); + +#define CHECK_dict_search( _type, _criteria, _what, _result ) \ + CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, (_type), (_criteria), (_what), (_result), ENOENT) ); + +struct local_rules_definition { + char *avp_name; + enum rule_position position; + int min; + int max; +}; + +#define RULE_ORDER( _position ) ((((_position) == RULE_FIXED_HEAD) || ((_position) == RULE_FIXED_TAIL)) ? 1 : 0 ) + +#define PARSE_loc_rules( _rulearray, _parent) { \ + int __ar; \ + for (__ar=0; __ar < sizeof(_rulearray) / sizeof((_rulearray)[0]); __ar++) { \ + struct dict_rule_data __data = { NULL, \ + (_rulearray)[__ar].position, \ + 0, \ + (_rulearray)[__ar].min, \ + (_rulearray)[__ar].max}; \ + __data.rule_order = RULE_ORDER(__data.rule_position); \ + CHECK_FCT( fd_dict_search( \ + fd_g_config->cnf_dict, \ + DICT_AVP, \ + AVP_BY_NAME, \ + (_rulearray)[__ar].avp_name, \ + &__data.rule_avp, 0 ) ); \ + if ( !__data.rule_avp ) { \ + TRACE_DEBUG(INFO, "AVP Not found: '%s'", (_rulearray)[__ar].avp_name ); \ + return ENOENT; \ + } \ + CHECK_FCT_DO( fd_dict_new( fd_g_config->cnf_dict, DICT_RULE, &__data, _parent, NULL), \ + { \ + TRACE_DEBUG(INFO, "Error on rule with AVP '%s'", \ + (_rulearray)[__ar].avp_name ); \ + return EINVAL; \ + } ); \ + } \ +} + +#define enumval_def_u32( _val_, _str_ ) \ + { _str_, { .u32 = _val_ }} + +#define enumval_def_os( _len_, _val_, _str_ ) \ + { _str_, { .os = { .data = (unsigned char *)_val_, .len = _len_ }}} + + + +/* Defines if there are any */ + +/* New Result-Code for MIP (RFC5778, Section 7.*) */ +#define DIAMETER_SUCCESS_RELOCATE_HA 2009 +#define DIAMETER_ERROR_MIP6_AUTH_MODE 5041 +#define MIP6_AUTH_MN_AAA 1 + +/* Dictionary */ + +int dict_mip6i_init() +{ + struct dict_object * mip6i; + { + struct dict_application_data data = { 7, "Diameter Mobile IPv6 IKE (MIP6I) Application" }; + CHECK_dict_new( DICT_APPLICATION, &data , NULL, &mip6i); + } + + /***************/ + /* AVP section */ + /***************/ + { + /* Loading all the derived data formats */ + + struct dict_object * Address_type; + struct dict_object * UTF8String_type; + struct dict_object * DiameterIdentity_type; + struct dict_object * DiameterURI_type; + struct dict_object * Time_type; + + CHECK_dict_search( DICT_TYPE, TYPE_BY_NAME, "Address", &Address_type); + CHECK_dict_search( DICT_TYPE, TYPE_BY_NAME, "UTF8String", &UTF8String_type); + CHECK_dict_search( DICT_TYPE, TYPE_BY_NAME, "DiameterIdentity", &DiameterIdentity_type); + CHECK_dict_search( DICT_TYPE, TYPE_BY_NAME, "DiameterURI", &DiameterURI_type); + CHECK_dict_search( DICT_TYPE, TYPE_BY_NAME, "Time", &Time_type); + + /* MIP6-Feature-Vector - RFC 5447 */ + { + /* + + */ + + struct dict_avp_data data = { + 124, /* Code */ + 0, /* Vendor */ + "MIP6-Feature-Vector", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_UNSIGNED64 /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /* MIP-Mobile-Node-Address - RFC 4004 */ + { + /* + + */ + + struct dict_avp_data data = { + 333, /* Code */ + 0, /* Vendor */ + "MIP-Mobile-Node-Address", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_OCTETSTRING /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , Address_type, NULL); + } + + /* MIP-Home-Agent-Address - RFC 4004 */ + { + /* + + */ + + struct dict_avp_data data = { + 334, /* Code */ + 0, /* Vendor */ + "MIP-Home-Agent-Address", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_OCTETSTRING /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , Address_type, NULL); + } + + /* Destination-Host - Base Protocol */ + + /* + Implemented in the base protocol + */ + + /* Destination-Realm - Base Protocol */ + + /* + Implemented in the base protocol + */ + + /* MIP-Home-Agent-Host - RFC 4004 */ + { + /* + + */ + struct dict_object * avp; + struct dict_avp_data data = { + 348, /* Code */ + 0, /* Vendor */ + "MIP-Home-Agent-Host", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_GROUPED /* base type of data */ + }; + + struct local_rules_definition rules[] = + { { "Destination-Realm", RULE_REQUIRED, -1, 1 } + ,{ "Destination-Host", RULE_REQUIRED, -1, 1 } + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, &avp); + PARSE_loc_rules( rules, avp ); + } + + /* MIP6-Home-Link-Prefix - RFC 5447 */ + { + /* + + */ + + struct dict_avp_data data = { + 125, /* Code */ + 0, /* Vendor */ + "MIP6-Home-Link-Prefix", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_OCTETSTRING /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /* MIP6-Agent-Info - RFC 5447 */ + { + /* + + */ + struct dict_object * avp; + struct dict_avp_data data = { + 486, /* Code */ + 0, /* Vendor */ + "MIP6-Agent-Info", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_GROUPED /* base type of data */ + }; + + struct local_rules_definition rules[] = + { { "MIP-Home-Agent-Address", RULE_OPTIONAL, -1, 2 } + ,{ "MIP-Home-Agent-Host", RULE_OPTIONAL, -1, 1 } + ,{ "MIP6-Home-Link-Prefix", RULE_OPTIONAL, -1, 1 } + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, &avp); + PARSE_loc_rules( rules, avp ); + } + + /* User-Name - RFC 3588 */ + + /* + Implemented in the base protocol + */ + + /* Service-Selection - RFC 5778 */ + { + /* + + */ + + struct dict_avp_data data = { + 493, /* Code */ + 0, /* Vendor */ + "Service-Selection", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_OCTETSTRING /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , UTF8String_type, NULL); + } + + /* MIP-Replay-Mode - RFC 5778 */ + { + /* + + */ + struct dict_object * type; + struct dict_type_data tdata = { AVP_TYPE_INTEGER32, "Enumerated(MIP-Replay-Mode)" , NULL, NULL, NULL }; + struct dict_enumval_data t_1 = { "None", { .i32 = 1 }}; + struct dict_enumval_data t_2 = { "Timestamp", { .i32 = 2 }}; + + struct dict_avp_data data = { + 346, /* Code */ + 0, /* Vendor */ + "MIP-Replay-Mode", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_INTEGER32 /* base type of data */ + }; + /* Create the Enumerated type, and then the AVP */ + CHECK_dict_new( DICT_TYPE, &tdata , NULL, &type); + CHECK_dict_new( DICT_ENUMVAL, &t_1 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_2 , type, NULL); + CHECK_dict_new( DICT_AVP, &data , type, NULL); + } + + /* MIP-Algorithm-Type - RFC 5778 */ + { + /* + The MIP-Algorithm-Type AVP (AVP Code 345) is of type Enumerated and + contains the Algorithm identifier for the associated Mobile IPv6 + MN-HA Authentication Option. The Diameter server selects the + algorithm type. Existing algorithm types are defined in [RFC4004] + that also fulfill current RFC 4285 requirements. This AVP is reused + from [RFC4004]. + */ + struct dict_object * type; + struct dict_type_data tdata = { AVP_TYPE_INTEGER32, "Enumerated(MIP-Algorithm-Type)" , NULL, NULL, NULL }; + struct dict_enumval_data t_2 = { "HMAC-SHA-1 [HMAC]", { .i32 = 2 }}; + + struct dict_avp_data data = { + 345, /* Code */ + 0, /* Vendor */ + "MIP-Algorithm-Type", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_INTEGER32 /* base type of data */ + }; + /* Create the Enumerated type, and then the AVP */ + CHECK_dict_new( DICT_TYPE, &tdata , NULL, &type); + CHECK_dict_new( DICT_ENUMVAL, &t_2 , type, NULL); + CHECK_dict_new( DICT_AVP, &data , type, NULL); + } + + /* MIP-MN-HA-SPI - RFC 5778 */ + { + /* + + */ + struct dict_avp_data data = { + 491, /* Code */ + 0, /* Vendor */ + "MIP-MN-HA-SPI", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_UNSIGNED32 /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /* MIP-MSA-Lifetime - RFC 5778 */ + { + /* + + */ + struct dict_avp_data data = { + 367, /* Code */ + 0, /* Vendor */ + "MIP-MSA-Lifetime", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_UNSIGNED32 /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /* MIP-Session-Key - RFC 5778 */ + { + /* + + */ + struct dict_avp_data data = { + 343, /* Code */ + 0, /* Vendor */ + "MIP-Session-Key", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_OCTETSTRING /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /* MIP-MN-HA-MSA - RFC 5778 */ + { + /* + + */ + struct dict_object * avp; + struct dict_avp_data data = { + 492, /* Code */ + 0, /* Vendor */ + "MIP-MN-HA-MSA", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_GROUPED /* base type of data */ + }; + + struct local_rules_definition rules[] = + { { "MIP-Session-Key", RULE_REQUIRED, -1, 1 } + ,{ "MIP-MSA-Lifetime", RULE_REQUIRED, -1, 1 } + ,{ "MIP-MN-HA-SPI", RULE_OPTIONAL, -1, 1 } + ,{ "MIP-Algorithm-Type", RULE_OPTIONAL, -1, 1 } + ,{ "MIP-Replay-Mode", RULE_OPTIONAL, -1, 1 } + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, &avp); + PARSE_loc_rules( rules, avp ); + } + + /* Chargeable-User-Identity - RFC 5778 */ + { + /* + + */ + struct dict_avp_data data = { + 89, /* Code */ + 0, /* Vendor */ + "Chargeable-User-Identity", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_OCTETSTRING /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + ////////////// + /* QoS AVPs */ + ////////////// + + /* QoS-Capability */ + + /* + Implemented in RFC 5777 + */ + + /* QoS-Resources */ + + /* + Implemented in RFC 5777 + */ + + ///////////////////// + /* Accounting AVPs */ + ///////////////////// + + /* Accounting-Input-Octets - RFC 4004 */ + { + /* + + */ + struct dict_avp_data data = { + 363, /* Code */ + 0, /* Vendor */ + "Accounting-Input-Octets", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_UNSIGNED64 /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /* Accounting-Output-Octets - RFC 4004 */ + { + /* + + */ + struct dict_avp_data data = { + 364, /* Code */ + 0, /* Vendor */ + "Accounting-Output-Octets", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_UNSIGNED64 /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /* Accounting-Input-Packets - RFC 4004 */ + { + /* + + */ + struct dict_avp_data data = { + 365, /* Code */ + 0, /* Vendor */ + "Accounting-Input-Packets", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_UNSIGNED64 /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /* Accounting-Output-Packets - RFC 4004 */ + { + /* + + */ + struct dict_avp_data data = { + 366, /* Code */ + 0, /* Vendor */ + "Accounting-Output-Packets", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_UNSIGNED64 /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /* Acct-Multi-Session-Id - RFC 3588 */ + + /* + Implemented in the base protocol + */ + + /* Acct-Session-Time - RFC 4004 */ + { + /* + + */ + struct dict_avp_data data = { + 46, /* Code */ + 0, /* Vendor */ + "Acct-Session-Time", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_UNSIGNED32 /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /* MIP-Careof-Address - RFC 5778 */ + { + /* + This AVP is needed in MIP6I at least for implementation reasons + (it appears in a command) + */ + + struct dict_avp_data data = { + 487, /* Code */ + 0, /* Vendor */ + "MIP-Careof-Address", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_OCTETSTRING /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , Address_type, NULL); + } + + ///////////////////////////////////// + /* Radius AVPs used in MIR & MIA */ + ///////////////////////////////////// + + /* + We used the following correspondences for determining the type of the Radius AVPs + + Radius Diameter + + text UTF8Sting + string OctetString + address Address + integer Unsigned32 + time Time + */ + + + /* NAS-Identifier 32 3575 */ + { + /* + string -> OctetString + */ + + struct dict_avp_data data = { + 32, /* Code */ + 0, /* Vendor */ + "NAS-Identifier", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_OCTETSTRING /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /* NAS-IP-Address 4 3575 */ + { + /* + address -> Address + */ + + struct dict_avp_data data = { + 4, /* Code */ + 0, /* Vendor */ + "NAS-IP-Address", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_OCTETSTRING /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , Address_type, NULL); + } + + /* NAS-IPv6-Address 95 3162 */ + { + /* + address -> Address + */ + + struct dict_avp_data data = { + 95, /* Code */ + 0, /* Vendor */ + "NAS-IPv6-Address", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_OCTETSTRING /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , Address_type, NULL); + } + + /* NAS-Port-Type 61 2865 */ + { + /* + integer -> Unsigned32 + + Value + + The Value field is four octets. "Virtual" refers to a connection + to the NAS via some transport protocol, instead of through a + physical port. For example, if a user telnetted into a NAS to + authenticate himself as an Outbound-User, the Access-Request might + include NAS-Port-Type = Virtual as a hint to the RADIUS server + that the user was not on a physical port. + + 0 Async + 1 Sync + 2 ISDN Sync + 3 ISDN Async V.120 + 4 ISDN Async V.110 + 5 Virtual + 6 PIAFS + 7 HDLC Clear Channel + 8 X.25 + 9 X.75 + 10 G.3 Fax + 11 SDSL - Symmetric DSL + 12 ADSL-CAP - Asymmetric DSL, Carrierless Amplitude Phase + Modulation + 13 ADSL-DMT - Asymmetric DSL, Discrete Multi-Tone + 14 IDSL - ISDN Digital Subscriber Line + 15 Ethernet + 16 xDSL - Digital Subscriber Line of unknown type + 17 Cable + 18 Wireless - Other + 19 Wireless - IEEE 802.11 + + PIAFS is a form of wireless ISDN commonly used in Japan, and + stands for PHS (Personal Handyphone System) Internet Access Forum + Standard (PIAFS). + */ + + struct dict_avp_data data = { + 61, /* Code */ + 0, /* Vendor */ + "NAS-Port-Type", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_UNSIGNED32 /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /* Called-Station-Id 30 2865 */ + { + /* + string -> OctetString + */ + + struct dict_avp_data data = { + 30, /* Code */ + 0, /* Vendor */ + "Called-Station-Id", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_OCTETSTRING /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + /* Calling-Station-Id 31 2865 */ + { + /* + string -> OctetString + */ + + struct dict_avp_data data = { + 31, /* Code */ + 0, /* Vendor */ + "Calling-Station-Id", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_OCTETSTRING /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /////////////////////////////////////////////////////////// + /* Other AVPs needed in MIP6I for implementation reasons */ + /////////////////////////////////////////////////////////// + + /* MIP6-Auth-Mode - RFC 5778 */ + { + /* + + */ + struct dict_object * type; + struct dict_type_data tdata = { AVP_TYPE_INTEGER32, "Enumerated(MIP6-Auth-Mode)", NULL, NULL, NULL }; + struct dict_enumval_data t_0 = { "None", { .i32 = MIP6_AUTH_MN_AAA }}; + struct dict_avp_data data = { + 494, /* Code */ + 0, /* Vendor */ + "MIP6-Auth-Mode", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_INTEGER32 /* base type of data */ + }; + + /* Create the Enumerated type, and then the AVP */ + CHECK_dict_new( DICT_TYPE, &tdata , NULL, &type); + CHECK_dict_new( DICT_ENUMVAL, &t_0 , type, NULL); + CHECK_dict_new( DICT_AVP, &data , type, NULL); + } + + /* MIP-MN-AAA-SPI - RFC 5778 */ + { + /* + + */ + + struct dict_avp_data data = { + 341, /* Code */ + 0, /* Vendor */ + "MIP-MN-AAA-SPI", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_UNSIGNED32 /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /* MIP-Authenticator - RFC 5778 */ + { + /* + + */ + struct dict_avp_data data = { + 488, /* Code */ + 0, /* Vendor */ + "MIP-Authenticator", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_OCTETSTRING /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /* MIP-MAC-Mobility-Data - RFC 5778 */ + { + /* + + */ + struct dict_avp_data data = { + 489, /* Code */ + 0, /* Vendor */ + "MIP-MAC-Mobility-Data", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_OCTETSTRING /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /* MIP-Timestamp - RFC 5778 */ + { + /* + + */ + struct dict_avp_data data = { + 490, /* Code */ + 0, /* Vendor */ + "MIP-Timestamp", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_OCTETSTRING /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + } + +/*******************/ +/* Command section */ +/*******************/ + + { + /* Diameter-EAP-Request (DER) */ + + /* + Defined in dict_eap + */ + + /* Diameter-EAP-Answer (DEA) - COPIED FROM dict_eap.c, SEE IT FOR MORE REFERENCE */ + + /* + Defined in dict_eap + */ + + /* MIP6-Request (MIR) */ + { + /* + + The MIP6-Request (MIR), indicated by the Command-Code field set to + 325 and the 'R' bit set in the Command Flags field, is sent by the + HA, acting as a Diameter client, in order to request the + authentication and authorization of an MN. + + Although the HA provides the Diameter server with replay protection- + related information, the HA is responsible for the replay protection. + + The message format is shown below. + + ::= < Diameter Header: 325, REQ, PXY > + < Session-ID > + { Auth-Application-Id } + { User-Name } + { Destination-Realm } + { Origin-Host } + { Origin-Realm } + { Auth-Request-Type } + [ Destination-Host ] + [ Origin-State-Id ] + [ NAS-Identifier ] + [ NAS-IP-Address ] + [ NAS-IPv6-Address ] + [ NAS-Port-Type ] + [ Called-Station-Id ] + [ Calling-Station-Id ] + [ MIP6-Feature-Vector ] + { MIP6-Auth-Mode } + [ MIP-MN-AAA-SPI ] + [ MIP-MN-HA-SPI ] + 1*2{ MIP-Mobile-Node-Address } + { MIP6-Agent-Info } + { MIP-Careof-Address } + [ MIP-Authenticator ] + [ MIP-MAC-Mobility-Data ] + [ MIP-Timestamp ] + [ QoS-Capability ] + * [ QoS-Resources ] + [ Chargeable-User-Identity ] + [ Service-Selection ] + [ Authorization-Lifetime ] + [ Auth-Session-State ] + * [ Proxy-Info ] + * [ Route-Record ] + * [ AVP ] + + If the MN is both authenticated and authorized for the mobility + service, then the Auth-Request-Type AVP is set to the value + AUTHORIZE_AUTHENTICATE. This is the case when the MIP6-Auth-Mode is + set to the value MIP6_AUTH_MN_AAA. + + */ + struct dict_object * cmd; + struct dict_cmd_data data = { + 325, /* Code */ + "MIP6-Request", /* Name */ + CMD_FLAG_REQUEST | CMD_FLAG_PROXIABLE | CMD_FLAG_ERROR, /* Fixed flags */ + CMD_FLAG_PROXIABLE /* Fixed flag values */ + }; + struct local_rules_definition rules[] = + { { "Session-Id", RULE_FIXED_HEAD, -1, 1 } + ,{ "Auth-Application-Id", RULE_REQUIRED, -1, 1 } + ,{ "User-Name", RULE_REQUIRED, -1, 1 } + ,{ "Destination-Realm", RULE_REQUIRED, -1, 1 } + ,{ "Origin-Host", RULE_REQUIRED, -1, 1 } + ,{ "Origin-Realm", RULE_REQUIRED, -1, 1 } + ,{ "Auth-Request-Type", RULE_REQUIRED, -1, 1 } + ,{ "Destination-Host", RULE_OPTIONAL, -1, 1 } + ,{ "Origin-State-Id", RULE_OPTIONAL, -1, 1 } + ,{ "NAS-Identifier", RULE_OPTIONAL, -1, 1 } + ,{ "NAS-IP-Address", RULE_OPTIONAL, -1, 1 } + ,{ "NAS-IPv6-Address", RULE_OPTIONAL, -1, 1 } + ,{ "NAS-Port-Type", RULE_OPTIONAL, -1, 1 } + ,{ "Called-Station-Id", RULE_OPTIONAL, -1, 1 } + ,{ "Calling-Station-Id", RULE_OPTIONAL, -1, 1 } + ,{ "MIP6-Feature-Vector", RULE_OPTIONAL, -1, 1 } + ,{ "MIP6-Auth-Mode", RULE_OPTIONAL, -1, 1 } + ,{ "MIP-MN-AAA-SPI", RULE_OPTIONAL, -1, 1 } + ,{ "MIP-MN-HA-SPI", RULE_OPTIONAL, -1, 1 } + ,{ "MIP-Mobile-Node-Address", RULE_OPTIONAL, 1, 2 } + ,{ "MIP6-Agent-Info", RULE_OPTIONAL, -1, 1 } + ,{ "MIP-Careof-Address", RULE_OPTIONAL, -1, 1 } + ,{ "MIP-Authenticator", RULE_OPTIONAL, -1, 1 } + ,{ "MIP-MAC-Mobility-Data", RULE_OPTIONAL, -1, 1 } + ,{ "MIP-Timestamp", RULE_OPTIONAL, -1, 1 } + ,{ "QoS-Capability", RULE_OPTIONAL, -1, 1 } + ,{ "QoS-Resources", RULE_OPTIONAL, -1, -1 } + ,{ "Chargeable-User-Identity", RULE_OPTIONAL, -1, 1 } + ,{ "Service-Selection", RULE_OPTIONAL, -1, 1 } + ,{ "Authorization-Lifetime", RULE_OPTIONAL, -1, 1 } + ,{ "Auth-Session-State", RULE_OPTIONAL, -1, 1 } + ,{ "Proxy-Info", RULE_OPTIONAL, -1, -1 } + ,{ "Route-Record", RULE_OPTIONAL, -1, -1 } + }; + + CHECK_dict_new( DICT_COMMAND, &data , mip6i, &cmd); + PARSE_loc_rules( rules, cmd ); + } + + /* MIP6-Answer (MIA) */ + { + /* + + The MIP6-Answer (MIA) message, indicated by the Command-Code field + set to 325 and the 'R' bit cleared in the Command Flags field, is + sent by the Diameter server in response to the MIP6-Request message. + + The User-Name AVP MAY be included in the MIA if it is present in the + MIR. The Result-Code AVP MAY contain one of the values defined in + Section 7, in addition to the values defined in [RFC3588]. + + An MIA message with the Result-Code AVP set to DIAMETER_SUCCESS MUST + include the MIP-Mobile-Node-Address AVP. + + The message format is shown below. + + ::= < Diameter Header: 325, PXY > + < Session-Id > + { Auth-Application-Id } + { Result-Code } + { Origin-Host } + { Origin-Realm } + { Auth-Request-Type } + [ User-Name ] + [ Authorization-Lifetime ] + [ Auth-Session-State ] + [ Error-Message ] + [ Error-Reporting-Host ] + [ Re-Auth-Request-Type ] + [ MIP6-Feature-Vector ] + [ MIP-Agent-Info ] + *2[ MIP-Mobile-Node-Address ] + [ MIP-MN-HA-MSA ] + * [ QoS-Resources ] + [ Chargeable-User-Identity ] + [ Service-Selection ] + [ Origin-State-Id ] + * [ Proxy-Info ] + * [ Redirect-Host ] + [ Redirect-Host-Usage ] + [ Redirect-Max-Cache-Time ] + * [ Failed-AVP ] + * [ AVP ] + + */ + struct dict_object * cmd; + struct dict_cmd_data data = { + 325, /* Code */ + "MIP6-Answer", /* Name */ + CMD_FLAG_PROXIABLE | CMD_FLAG_ERROR, /* Fixed flags */ + CMD_FLAG_PROXIABLE /* Fixed flag values */ + }; + struct local_rules_definition rules[] = + { { "Session-Id", RULE_FIXED_HEAD, -1, 1 } + ,{ "Auth-Application-Id", RULE_REQUIRED, -1, 1 } + ,{ "Result-Code", RULE_REQUIRED, -1, 1 } + ,{ "Origin-Host", RULE_REQUIRED, -1, 1 } + ,{ "Origin-Realm", RULE_REQUIRED, -1, 1 } + ,{ "Auth-Request-Type", RULE_REQUIRED, -1, 1 } + ,{ "User-Name", RULE_OPTIONAL, -1, 1 } + ,{ "Authorization-Lifetime", RULE_OPTIONAL, -1, 1 } + ,{ "Auth-Session-State", RULE_OPTIONAL, -1, 1 } + ,{ "Error-Message", RULE_OPTIONAL, -1, 1 } + ,{ "Error-Reporting-Host", RULE_OPTIONAL, -1, 1 } + ,{ "Re-Auth-Request-Type", RULE_OPTIONAL, -1, 1 } + ,{ "MIP6-Feature-Vector", RULE_OPTIONAL, -1, 1 } + ,{ "MIP-Agent-Info", RULE_OPTIONAL, -1, 1 } + ,{ "MIP-Mobile-Node-Address", RULE_OPTIONAL, -1, 2 } + ,{ "MIP-MN-HA-MSA", RULE_OPTIONAL, -1, 1 } + ,{ "QoS-Resources", RULE_OPTIONAL, -1, -1 } + ,{ "Chargeable-User-Identity", RULE_OPTIONAL, -1, 1 } + ,{ "Service-Selection", RULE_OPTIONAL, -1, 1 } + ,{ "Origin-State-Id", RULE_OPTIONAL, -1, 1 } + ,{ "Proxy-Info", RULE_OPTIONAL, -1, -1 } + ,{ "Redirect-Host", RULE_OPTIONAL, -1, -1 } + ,{ "Redirect-Host-Usage", RULE_OPTIONAL, -1, 1 } + ,{ "Redirect-Max-Cache-Time", RULE_OPTIONAL, -1, 1 } + ,{ "Failed-AVP", RULE_OPTIONAL, -1, -1 } + }; + + CHECK_dict_new( DICT_COMMAND, &data , mip6i, &cmd); + PARSE_loc_rules( rules, cmd ); + } + } + + TRACE_DEBUG(INFO, "Dictionary Extension 'Diameter Mobile IPv6 IKE (MIP6I)' initialized"); + return 0; +} +EXTENSION_ENTRY("dict_mip6i",dict_mip6i_init); diff -r 0758a357a151 -r aa0dc24d2b9d extensions/dict_nas_mipv6/CMakeLists.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/extensions/dict_nas_mipv6/CMakeLists.txt Mon Nov 15 17:03:15 2010 +0100 @@ -0,0 +1,13 @@ +# The dict_nas_mipv6 extension +PROJECT("MIPv6 NAS-to-HAAA Interaction Dictionary Definition" C) + +# Compile as a module +FD_ADD_EXTENSION(dict_nas_mipv6 dict_nas_mipv6.c) + + +#### +## INSTALL section ## + +INSTALL(TARGETS dict_nas_mipv6 + LIBRARY DESTINATION ${INSTALL_EXTENSIONS_SUFFIX} + COMPONENT freeDiameter-dictionary-nas_mipv6) diff -r 0758a357a151 -r aa0dc24d2b9d extensions/dict_nas_mipv6/dict_nas_mipv6.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/extensions/dict_nas_mipv6/dict_nas_mipv6.c Mon Nov 15 17:03:15 2010 +0100 @@ -0,0 +1,214 @@ +/********************************************************************************************************* +* Software License Agreement (BSD License) * +* Author: Francois Bard * +* * +* Copyright (c) 2010, Teraoka Laboratory, Keio University * +* All rights reserved. * +* * +* Redistribution and use of this software in source and binary forms, with or without modification, are * +* permitted provided that the following conditions are met: * +* * +* * Redistributions of source code must retain the above * +* copyright notice, this list of conditions and the * +* following disclaimer. * +* * +* * Redistributions in binary form must reproduce the above * +* copyright notice, this list of conditions and the * +* following disclaimer in the documentation and/or other * +* materials provided with the distribution. * +* * +* * Neither the name of the Teraoka Laboratory nor the * +* names of its contributors may be used to endorse or * +* promote products derived from this software without * +* specific prior written permission of Teraoka Laboratory * +* * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED * +* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * +* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * +* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR * +* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * +* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +*********************************************************************************************************/ + +/********************************************************************************************************* +The following table lists the AVPs needed for the NAS to HAAA server interaction. +We try to keep the structure of the grouped AVP by declaring the contained AVPs just before the grouped AVP they depend on. +The number of '+' indicates the depth of the contained AVP. + +DEPTH NAME AVP CODE RFC TYPE IMPLEMENTED NOTES + + MIP6-Feature-Vector 124 5447 Unsigned64 yes ++ MIP-Home-Agent-Address 334 4004 Address not yet +++ Destination-Host 293 3588 DiameterIdentity no (Base) +++ Destination-Realm 283 3588 DiameterIdentity no (Base) ++ MIP-Home-Agent-Host 348 4004 Grouped not yet ++ MIP6-Home-Link-Prefix 125 5447 OctetString yes + MIP6-Agent-Info 486 5447 Grouped yes + +************************************************************************************************************/ + + + +#include + +/* + NOTES TO SELF + + - il faudra verifier les regles particulieres (page 6 de la rfc) 'au moins un des deux avps' + + - IMPLEMENTER LES AVPS QUI MANQUENT + +*/ + +/* The content of this file follows the same structure as dict_base_proto.c */ + +#define CHECK_dict_new( _type, _data, _parent, _ref ) \ + CHECK_FCT( fd_dict_new( fd_g_config->cnf_dict, (_type), (_data), (_parent), (_ref)) ); + +#define CHECK_dict_search( _type, _criteria, _what, _result ) \ + CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, (_type), (_criteria), (_what), (_result), ENOENT) ); + +struct local_rules_definition { + char *avp_name; + enum rule_position position; + int min; + int max; +}; + +#define RULE_ORDER( _position ) ((((_position) == RULE_FIXED_HEAD) || ((_position) == RULE_FIXED_TAIL)) ? 1 : 0 ) + +#define PARSE_loc_rules( _rulearray, _parent) { \ + int __ar; \ + for (__ar=0; __ar < sizeof(_rulearray) / sizeof((_rulearray)[0]); __ar++) { \ + struct dict_rule_data __data = { NULL, \ + (_rulearray)[__ar].position, \ + 0, \ + (_rulearray)[__ar].min, \ + (_rulearray)[__ar].max}; \ + __data.rule_order = RULE_ORDER(__data.rule_position); \ + CHECK_FCT( fd_dict_search( \ + fd_g_config->cnf_dict, \ + DICT_AVP, \ + AVP_BY_NAME, \ + (_rulearray)[__ar].avp_name, \ + &__data.rule_avp, 0 ) ); \ + if ( !__data.rule_avp ) { \ + TRACE_DEBUG(INFO, "AVP Not found: '%s'", (_rulearray)[__ar].avp_name ); \ + return ENOENT; \ + } \ + CHECK_FCT_DO( fd_dict_new( fd_g_config->cnf_dict, DICT_RULE, &__data, _parent, NULL), \ + { \ + TRACE_DEBUG(INFO, "Error on rule with AVP '%s'", \ + (_rulearray)[__ar].avp_name ); \ + return EINVAL; \ + } ); \ + } \ +} + +#define enumval_def_u32( _val_, _str_ ) \ + { _str_, { .u32 = _val_ }} + +#define enumval_def_os( _len_, _val_, _str_ ) \ + { _str_, { .os = { .data = (unsigned char *)_val_, .len = _len_ }}} + + + + + + +/* Defines if there are any */ + +/* Define Flags for MIP6-Feature-Vector*/ + +#define MIP6_INTEGRATED 0x0000000000000001 +#define LOCAL_HOME_AGENT_ASSIGNMENT 0x0000000000000002 + +/* Dictionary */ + +int dict_nas_mipv6_init() +{ + struct dict_object * nas_mipv6; + { + struct dict_application_data data = { 5447, "MIPv6 NAS-to-HAAA Interaction" }; + CHECK_dict_new( DICT_APPLICATION, &data , NULL, &nas_mipv6); + } + + /* AVP section */ + { + /* MIP6-Feature-Vector */ + { + /* + + */ + + struct dict_avp_data data = { + 124, /* Code */ + 0, /* Vendor */ + "MIP6-Feature-Vector", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_UNSIGNED64 /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /* MIP-Home-Agent-Address - RFC 4004 */ + + /* Destination-Host - Base Protocol */ + + /* Destination-Realm - Base Protocol */ + + /* MIP-Home-Agent-Host - RFC 4004 */ + + /* MIP6-Home-Link-Prefix */ + { + /* + + */ + + struct dict_avp_data data = { + 125, /* Code */ + 0, /* Vendor */ + "MIP6-Home-Link-Prefix", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_OCTETSTRING /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /* MIP6-Agent-Info */ + { + /* + + */ + struct dict_object * avp; + struct dict_avp_data data = { + 486, /* Code */ + 0, /* Vendor */ + "MIP6-Agent-Info", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_GROUPED /* base type of data */ + }; + + struct local_rules_definition rules[] = + { { "MIP-Home-Agent-Address", RULE_OPTIONAL, -1, 2 } + ,{ "MIP-Home-Agent-Host", RULE_OPTIONAL, -1, 1 } + ,{ "MIP6-Home-Link-Prefix", RULE_OPTIONAL, -1, 1 } + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, &avp); + PARSE_loc_rules( rules, avp ); + } + } + + TRACE_DEBUG(INFO, "Dictionary Extension 'MIPv6 NAS-to-HAAA Interaction' initialized"); + return 0; +} +EXTENSION_ENTRY("dict_nas_mipv6", dict_nas_mipv6_init); diff -r 0758a357a151 -r aa0dc24d2b9d extensions/dict_rfc5777/CMakeLists.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/extensions/dict_rfc5777/CMakeLists.txt Mon Nov 15 17:03:15 2010 +0100 @@ -0,0 +1,13 @@ +# The dict_rfc5777 extension +PROJECT("Traffic Classification and Quality of Service (QoS) Attributes for Diameter (RFC 5777)" C) + +# Compile as a module +FD_ADD_EXTENSION(dict_rfc5777 dict_rfc5777.c) + + +#### +## INSTALL section ## + +INSTALL(TARGETS dict_rfc5777 + LIBRARY DESTINATION ${INSTALL_EXTENSIONS_SUFFIX} + COMPONENT freeDiameter-dictionary-RFC5777) diff -r 0758a357a151 -r aa0dc24d2b9d extensions/dict_rfc5777/dict_rfc5777.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/extensions/dict_rfc5777/dict_rfc5777.c Mon Nov 15 17:03:15 2010 +0100 @@ -0,0 +1,2143 @@ +/********************************************************************************************************* +* Software License Agreement (BSD License) * +* Author: Francois Bard * +* * +* Copyright (c) 2010, Teraoka Laboratory, Keio University * +* All rights reserved. * +* * +* Redistribution and use of this software in source and binary forms, with or without modification, are * +* permitted provided that the following conditions are met: * +* * +* * Redistributions of source code must retain the above * +* copyright notice, this list of conditions and the * +* following disclaimer. * +* * +* * Redistributions in binary form must reproduce the above * +* copyright notice, this list of conditions and the * +* following disclaimer in the documentation and/or other * +* materials provided with the distribution. * +* * +* * Neither the name of the Teraoka Laboratory nor the * +* names of its contributors may be used to endorse or * +* promote products derived from this software without * +* specific prior written permission of Teraoka Laboratory * +* * +* * +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED * +* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * +* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * +* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR * +* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * +* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +*********************************************************************************************************/ + +/********************************************************************************************************* +The following table complete the one in RFC 5777. The AVPs are implemented in the order of the table. +We try to keep the structure of the grouped AVP by declaring the contained AVPs just before the grouped AVP they depend on. +The number of '+' indicates the depth of the contained AVP. + +DEPTH NAME AVP RFC TYPE NOTES + +++ Vendor-Id 266 3588 Unsigned32 +++ QoS-Profile-Id 573 5777 Unsigned32 ++ QoS-Profile-Template 574 5777 Grouped + QoS-Capability 578 5777 Grouped ++++ QoS-Parameters 576 5777 Grouped no specific AVPs? see RFC 5624 ++++ QoS-Profile-Template -------------------------------- ++++ Treatment-Action 572 5777 Enumerated Unclear, grouped or enum? +++ Excess-Treatment 577 5777 Grouped +++ QoS-Parameters -------------------------------- +++ QoS-Profile-Template -------------------------------- +++ QoS-Semantics 575 5777 Enumerated +++ Treatment-Action -------------------------------- ++++ Timezone-Offset 571 5777 Integer32 ++++ Timezone-Flag 570 5777 Enumerated ++++ Absolute-End-Fractional-Seconds 569 5777 Unsigned32 ++++ Absolute-End-Time 568 5777 Time ++++ Absolute-Start-Fractional-Seconds 567 5777 Unsigned32 ++++ Absolute-Start-Time 566 5777 Time ++++ Month-Of-Year-Mask 565 5777 Unsigned32 ++++ Day-Of-Month-Mask 564 5777 Unsigned32 ++++ Day-Of-Week-Mask 563 5777 Unsigned32 ++++ Time-Of-Day-End 562 5777 Unsigned32 ++++ Time-Of-Day-Start 561 5777 Unsigned32 +++ Time-Of-Day-Condition 560 5777 Grouped ++++++ High-User-Priority 559 5777 Unsigned32 ++++++ Low-User-Priority 558 5777 Unsigned32 +++++ User-Priority-Range 557 5777 Grouped ++++++ S-VID-Start 553 5777 Unsigned32 ++++++ S-VID-End 554 5777 Unsigned32 ++++++ C-VID-Start 555 5777 Unsigned32 ++++++ C-VID-End 556 5777 Unsigned32 +++++ VLAN-ID-Range 552 5777 Grouped ++++++ ETH-SAP 551 5777 OctetString ++++++ ETH-Ether-Type 550 5777 OctetString +++++ ETH-Proto-Type 549 5777 Grouped ++++ ETH-Option 548 5777 Grouped +++++ Negated 517 5777 Enumerated +++++ ICMP-Code 547 5777 Integer32 Changed from Enumerated. See AVP for details. +++++ ICMP-Type-Number 546 5777 Enumerated ++++ ICMP-Type 545 5777 Grouped +++++ Negated -------------------------------- +++++ TCP-Flag-Type 544 5777 Unsigned32 ++++ TCP-Flags 543 5777 Grouped +++++ TCP-Option-Type 541 5777 Enumerated +++++ TCP-Option-Value 542 5777 OctetString +++++ Negated -------------------------------- ++++ TCP-Option 540 5777 Grouped +++++ IP-Option-Type 538 5777 Enumerated +++++ IP-Option-Value 539 5777 OctetString +++++ Negated -------------------------------- ++++ IP-Option 537 5777 Grouped ++++ Fragmentation-Flag 536 5777 Enumerated ++++ Diffserv-Code-Point 535 5777 Enumerated +++++ IP-Address 518 5777 Address ++++++ IP-Address-Start 520 5777 Address ++++++ IP-Address-End 521 5777 Address +++++ IP-Address-Range 519 5777 Grouped ++++++ IP-Address -------------------------------- ++++++ IP-Mask-Bit-Mask-Width 523 5777 Unsigned32 +++++ IP-Address-Mask 522 5777 Grouped +++++ MAC-Address 524 5777 OctetString ++++++ MAC-Address -------------------------------- ++++++ MAC-Address-Mask-Pattern 526 5777 OctetString +++++ MAC-Address-Mask 525 5777 Grouped +++++ EUI64-Address 527 5777 OctetString ++++++ EUI64-Address -------------------------------- ++++++ EUI64-Address-Mask-Pattern 529 5777 OctetString +++++ EUI64-Address-Mask 528 5777 Grouped +++++ Port 530 5777 Integer32 ++++++ Port-Start 532 5777 Integer32 ++++++ Port-End 533 5777 Integer32 +++++ Port-Range 531 5777 Grouped +++++ Negated -------------------------------- +++++ Use-Assigned-Address 534 5777 Enumerated ++++ From-Spec 515 5777 Grouped +++++ ------------------------------------------------------------------------ +++++ -----------------same dependencies as From-Spec------------------------- +++++ ------------------------------------------------------------------------ ++++ To-Spec 516 5777 Grouped ++++ Direction 514 5777 Enumerated ++++ Protocol 513 5777 Enumerated ++++ Classifier-ID 512 5777 OctetString +++ Classifier 511 5777 Grouped +++ Filter-Rule-Precedence 510 5777 Unsigned32 ++ Filter-Rule 509 5777 Grouped careful if we have to change vendor specifics or such. + QoS-Resources 508 5777 Grouped + +****************************/ + + + + + +/**************************************************************************************************************************************** +* * +* This table contains the Enumerated AVPs whose values are managed by the IANA. * +* * +* Note : The ICMP-Code AVP (AVP Code 547) has been changed to type Integer32. See AVP for details * +* * +* AVP NAME LAST UPDATED LAST CHECKED SOURCE * +* 546 ICMP-Type-Number 2010-04-22 2010-07-02 http://www.iana.org/assignments/icmp-parameters * +* 541 TCP-Option-Type 2010-06-22 2010-07-02 http://www.iana.org/assignments/tcp-parameters/tcp-parameters.txt * +* 538 IP-Option-Type 2007-02-15 2010-07-02 http://www.iana.org/assignments/ip-parameters * +* 535 Diffserv-Code-Point 2010-05-11 2010-07-02 http://www.iana.org/assignments/dscp-registry/dscp-registry.txt * +* 513 Protocol 2004-01-26 2010-07-02 http://www.iana.org/assignments/ips-protocols * +* * +****************************************************************************************************************************************/ + + +/* + NOTES TO SELF + + verifier si on a besoin de tout les defines + - Que faut il faire pour la section 10.2 et 10.3? + - La definition de Filter-Rule est chelou + - La definition de QoS-Parameters est chelou + - relire la rfc en entier + +*/ + + +#include + +/* The content of this file follows the same structure as dict_base_proto.c */ + +#define CHECK_dict_new( _type, _data, _parent, _ref ) \ + CHECK_FCT( fd_dict_new( fd_g_config->cnf_dict, (_type), (_data), (_parent), (_ref)) ); + +#define CHECK_dict_search( _type, _criteria, _what, _result ) \ + CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, (_type), (_criteria), (_what), (_result), ENOENT) ); + +struct local_rules_definition { + char *avp_name; + enum rule_position position; + int min; + int max; +}; + +#define RULE_ORDER( _position ) ((((_position) == RULE_FIXED_HEAD) || ((_position) == RULE_FIXED_TAIL)) ? 1 : 0 ) + +#define PARSE_loc_rules( _rulearray, _parent) { \ + int __ar; \ + for (__ar=0; __ar < sizeof(_rulearray) / sizeof((_rulearray)[0]); __ar++) { \ + struct dict_rule_data __data = { NULL, \ + (_rulearray)[__ar].position, \ + 0, \ + (_rulearray)[__ar].min, \ + (_rulearray)[__ar].max}; \ + __data.rule_order = RULE_ORDER(__data.rule_position); \ + CHECK_FCT( fd_dict_search( \ + fd_g_config->cnf_dict, \ + DICT_AVP, \ + AVP_BY_NAME, \ + (_rulearray)[__ar].avp_name, \ + &__data.rule_avp, 0 ) ); \ + if ( !__data.rule_avp ) { \ + TRACE_DEBUG(INFO, "AVP Not found: '%s'", (_rulearray)[__ar].avp_name ); \ + return ENOENT; \ + } \ + CHECK_FCT_DO( fd_dict_new( fd_g_config->cnf_dict, DICT_RULE, &__data, _parent, NULL), \ + { \ + TRACE_DEBUG(INFO, "Error on rule with AVP '%s'", \ + (_rulearray)[__ar].avp_name ); \ + return EINVAL; \ + } ); \ + } \ +} + +#define enumval_def_u32( _val_, _str_ ) \ + { _str_, { .u32 = _val_ }} + +#define enumval_def_os( _len_, _val_, _str_ ) \ + { _str_, { .os = { .data = (unsigned char *)_val_, .len = _len_ }}} + + + + +/* Defines if there are any */ + +// No result-Code or values to define in RFC5777, we proceed + +/* Dictionary */ + +int dict_rfc5777_init() +{ + struct dict_object * rfc5777; + { + struct dict_application_data data = { 5777, "Traffic Classification and Quality of Service (QoS) Attributes for Diameter (RFC 5777)" }; + CHECK_dict_new( DICT_APPLICATION, &data , NULL, &rfc5777); + } + + /* AVP section */ + { + /* Loading the derived data formats */ + + struct dict_object * Address_type; + struct dict_object * Time_type; + + CHECK_dict_search( DICT_TYPE, TYPE_BY_NAME, "Address", &Address_type); + CHECK_dict_search( DICT_TYPE, TYPE_BY_NAME, "Time", &Time_type); + + /* Vendor_Id - RFC 3588 */ + + /* + Implemented in the base protocol + */ + + /* QoS-Profile-Id - RFC 5777 */ + { + /* + + */ + + struct dict_avp_data data = { + 573, /* Code */ + 0, /* Vendor */ + "QoS-Profile-Id", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_UNSIGNED32 /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /* QoS-Profile-Template - RFC 5777 */ + { + /* + + */ + struct dict_object * avp; + struct dict_avp_data data = { + 574, /* Code */ + 0, /* Vendor */ + "QoS-Profile-Template", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_GROUPED /* base type of data */ + }; + + struct local_rules_definition rules[] = + { { "Vendor-Id", RULE_REQUIRED, -1, 1 } + ,{ "QoS-Profile-Id", RULE_REQUIRED, -1, 1 } + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, &avp); + PARSE_loc_rules( rules, avp ); + } + + /* QoS-Capability - RFC 5777 */ + { + /* + + */ + struct dict_object * avp; + struct dict_avp_data data = { + 578, /* Code */ + 0, /* Vendor */ + "QoS-Capability", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_GROUPED /* base type of data */ + }; + + struct local_rules_definition rules[] = + { { "QoS-Profile-Template", RULE_REQUIRED, -1, -1 } + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, &avp); + PARSE_loc_rules( rules, avp ); + } + + /* QoS-Parameters - RFC 5777 */ + { + /* + + */ + struct dict_object * avp; + struct dict_avp_data data = { + 576, /* Code */ + 0, /* Vendor */ + "QoS-parameters", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_GROUPED /* base type of data */ + }; + + struct local_rules_definition rules[] = + { //empty?? + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, &avp); + PARSE_loc_rules( rules, avp ); + } + + /* QoS-Profile-Template - RFC 5777 */ + + /* + Implemented higher + */ + + + /* Treatment-Action - RFC 5777 */ + { + /* + + */ + struct dict_object * type; + struct dict_type_data tdata = { AVP_TYPE_INTEGER32, "Enumerated(Treatment-Action)" , NULL, NULL, NULL }; + struct dict_enumval_data t_0 = { "drop", { .i32 = 0 }}; + struct dict_enumval_data t_1 = { "shape", { .i32 = 1 }}; + struct dict_enumval_data t_2 = { "mark", { .i32 = 2 }}; + struct dict_enumval_data t_3 = { "permit", { .i32 = 3 }}; + + struct dict_avp_data data = { + 572, /* Code */ + 0, /* Vendor */ + "Treatment-Action", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_INTEGER32 /* base type of data */ + }; + /* Create the Enumerated type, and then the AVP */ + CHECK_dict_new( DICT_TYPE, &tdata , NULL, &type); + CHECK_dict_new( DICT_ENUMVAL, &t_0 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_1 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_2 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_3 , type, NULL); + CHECK_dict_new( DICT_AVP, &data , type, NULL); + } + + + /* Excess-Treatment - RFC 5777 */ + { + /* + + */ + struct dict_object * avp; + struct dict_avp_data data = { + 577, /* Code */ + 0, /* Vendor */ + "Excess-Treatment", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_GROUPED /* base type of data */ + }; + + struct local_rules_definition rules[] = + { { "Treatment-Action", RULE_REQUIRED, -1, 1 } + ,{ "QoS-Profile-Template", RULE_OPTIONAL, -1, 1 } + ,{ "QoS-Parameters", RULE_OPTIONAL, -1, 1 } + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, &avp); + PARSE_loc_rules( rules, avp ); + } + + /* QoS-Parameters - RFC 5777 */ + + /* + Implemented higher + */ + + /* QoS-Profile-Template - RFC 5777 */ + + /* + Implemented higher + */ + + /* QoS-Semantics - RFC 5777 */ + { + /* + + */ + struct dict_object * type; + struct dict_type_data tdata = { AVP_TYPE_INTEGER32, "Enumerated(QoS-Semantics)" , NULL, NULL, NULL }; + struct dict_enumval_data t_0 = { "QoS-Desired", { .i32 = 0 }}; + struct dict_enumval_data t_1 = { "QoS-Available", { .i32 = 1 }}; + struct dict_enumval_data t_2 = { "QoS-Delivered", { .i32 = 2 }}; + struct dict_enumval_data t_3 = { "Minimum-QoS", { .i32 = 3 }}; + struct dict_enumval_data t_4 = { "QoS-Authorized", { .i32 = 4 }}; + + struct dict_avp_data data = { + 575, /* Code */ + 0, /* Vendor */ + "QoS-Semantics", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_INTEGER32 /* base type of data */ + }; + /* Create the Enumerated type, and then the AVP */ + CHECK_dict_new( DICT_TYPE, &tdata , NULL, &type); + CHECK_dict_new( DICT_ENUMVAL, &t_0 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_1 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_2 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_3 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_4 , type, NULL); + CHECK_dict_new( DICT_AVP, &data , type, NULL); + } + + + + /* Treatment-Action - RFC 5777 */ + + /* + Implemented higher + */ + + /* Timezone-Offset - RFC 5777 */ + { + /* + + */ + + struct dict_avp_data data = { + 571, /* Code */ + 0, /* Vendor */ + "Timezone-Offset", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_INTEGER32 /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /* Timezone-Flag - RFC 5777 */ + { + /* + + */ + struct dict_object * type; + struct dict_type_data tdata = { AVP_TYPE_INTEGER32, "Enumerated(Timezone-Flag)" , NULL, NULL, NULL }; + struct dict_enumval_data t_0 = { "UTC", { .i32 = 0 }}; + struct dict_enumval_data t_1 = { "LOCAL", { .i32 = 1 }}; + struct dict_enumval_data t_2 = { "OFFSET", { .i32 = 2 }}; + + struct dict_avp_data data = { + 570, /* Code */ + 0, /* Vendor */ + "Timezone-Flag", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_INTEGER32 /* base type of data */ + }; + /* Create the Enumerated type, and then the AVP */ + CHECK_dict_new( DICT_TYPE, &tdata , NULL, &type); + CHECK_dict_new( DICT_ENUMVAL, &t_0 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_1 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_2 , type, NULL); + CHECK_dict_new( DICT_AVP, &data , type, NULL); + } + + + /* Absolute-End-Fractional-Seconds - RFC 5777 */ + { + /* + + */ + + struct dict_avp_data data = { + 569, /* Code */ + 0, /* Vendor */ + "Absolute-End-Fractional-Seconds", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_UNSIGNED32 /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /* Absolute-End-Time - RFC 5777 */ + { + /* + + */ + struct dict_avp_data data = { + 568, /* Code */ + 0, /* Vendor */ + "Absolute-End-Time", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_OCTETSTRING /* base type of data */ + }; + CHECK_dict_new( DICT_AVP, &data , Time_type, NULL); + } + + /* Absolute-Start-Fractional-Seconds - RFC 5777 */ + { + /* + + */ + + struct dict_avp_data data = { + 567, /* Code */ + 0, /* Vendor */ + "Absolute-Start-Fractional-Seconds", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_UNSIGNED32 /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /* Absolute-Start-Time - RFC 5777 */ + { + /* + + */ + struct dict_avp_data data = { + 566, /* Code */ + 0, /* Vendor */ + "Absolute-Start-Time", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_OCTETSTRING /* base type of data */ + }; + CHECK_dict_new( DICT_AVP, &data , Time_type, NULL); + } + + /* Month-Of-Year-Mask - RFC 5777 */ + { + /* + + */ + + struct dict_avp_data data = { + 565, /* Code */ + 0, /* Vendor */ + "Month-Of-Year-Mask", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_UNSIGNED32 /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /* Day-Of-Month-Mask - RFC 5777 */ + { + /* + + */ + + struct dict_avp_data data = { + 564, /* Code */ + 0, /* Vendor */ + "Day-Of-Month-Mask", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_UNSIGNED32 /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /* Day-Of-Week-Mask - RFC 5777 */ + { + /* + + */ + + struct dict_avp_data data = { + 563, /* Code */ + 0, /* Vendor */ + "Day-Of-Week-Mask", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_UNSIGNED32 /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /* Time-Of-Day-End - RFC 5777 */ + { + /* + + */ + + struct dict_avp_data data = { + 562, /* Code */ + 0, /* Vendor */ + "Time-Of-Day-End", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_UNSIGNED32 /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /* Time-Of-Day-Start - RFC 5777 */ + { + /* + + */ + + struct dict_avp_data data = { + 561, /* Code */ + 0, /* Vendor */ + "Time-Of-Day-Start", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_UNSIGNED32 /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /* Time-Of-Day-Condition - RFC 5777 */ + { + /* + + */ + struct dict_object * avp; + struct dict_avp_data data = { + 560, /* Code */ + 0, /* Vendor */ + "Time-Of-Day-Condition", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_GROUPED /* base type of data */ + }; + struct local_rules_definition rules[] = + { { "Time-Of-Day-Start", RULE_OPTIONAL, -1, 1 } + ,{ "Time-Of-Day-End", RULE_OPTIONAL, -1, 1 } + ,{ "Day-Of-Week-Mask", RULE_OPTIONAL, -1, 1 } + ,{ "Day-Of-Month-Mask", RULE_OPTIONAL, -1, 1 } + ,{ "Month-Of-Year-Mask", RULE_OPTIONAL, -1, 1 } + ,{ "Absolute-Start-Time", RULE_OPTIONAL, -1, 1 } + ,{ "Absolute-End-Time", RULE_OPTIONAL, -1, 1 } + ,{ "Timezone-Flag", RULE_OPTIONAL, -1, 1 } + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, &avp); + PARSE_loc_rules( rules, avp ); + } + + /* High-User-Priority - RFC 5777*/ + { + /* + + */ + + struct dict_avp_data data = { + 559, /* Code */ + 0, /* Vendor */ + "High-User-Priority", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_UNSIGNED32 /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /* Low-User-Priority - RFC 5777 */ + { + /* + + */ + + struct dict_avp_data data = { + 558, /* Code */ + 0, /* Vendor */ + "Low-User-Priority", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_UNSIGNED32 /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /* User-Priority-Range - RFC 5777 */ + { + /* + + */ + struct dict_object * avp; + struct dict_avp_data data = { + 557, /* Code */ + 0, /* Vendor */ + "User-Priority-Range", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_GROUPED /* base type of data */ + }; + struct local_rules_definition rules[] = + { { "Low-User-Priority", RULE_OPTIONAL, -1, -1 } + ,{ "High-User-Priority", RULE_OPTIONAL, -1, -1 } + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, &avp); + PARSE_loc_rules( rules, avp ); + } + /* S-VID-Start - RFC 5777 */ + { + /* + + */ + + struct dict_avp_data data = { + 553, /* Code */ + 0, /* Vendor */ + "S-VID-Start", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_UNSIGNED32 /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /* S-VID-End - RFC 5777 */ + { + /* + + */ + + struct dict_avp_data data = { + 554, /* Code */ + 0, /* Vendor */ + "S-VID-End", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_UNSIGNED32 /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /* C-VID-Start - RFC 5777 */ + { + /* + + */ + + struct dict_avp_data data = { + 555, /* Code */ + 0, /* Vendor */ + "C-VID-Start", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_UNSIGNED32 /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /* C-VID-End - RFC 5777 */ + { + /* + + */ + + struct dict_avp_data data = { + 556, /* Code */ + 0, /* Vendor */ + "C-VID-End", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_UNSIGNED32 /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /* VLAN-ID-Range - RFC 5777 */ + { + /* + + */ + struct dict_object * avp; + struct dict_avp_data data = { + 552, /* Code */ + 0, /* Vendor */ + "VLAN-ID-Range", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_GROUPED /* base type of data */ + }; + + struct local_rules_definition rules[] = + { { "S-VID-Start", RULE_OPTIONAL, -1, 1 } + ,{ "S-VID-End", RULE_OPTIONAL, -1, 1 } + ,{ "C-VID-Start", RULE_OPTIONAL, -1, 1 } + ,{ "C-VID-End", RULE_OPTIONAL, -1, 1 } + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, &avp); + PARSE_loc_rules( rules, avp ); + } + + /* ETH-SAP - RFC 5777 */ + { + /* + + */ + + struct dict_avp_data data = { + 551, /* Code */ + 0, /* Vendor */ + "ETH-SAP", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_OCTETSTRING /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /* ETH-Ether-Type - RFC 5777 */ + { + /* + + */ + + struct dict_avp_data data = { + 550, /* Code */ + 0, /* Vendor */ + "ETH-Ether-Type", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_OCTETSTRING /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /* ETH-Proto-Type - RFC 5777 */ + { + /* + + */ + struct dict_object * avp; + struct dict_avp_data data = { + 549, /* Code */ + 0, /* Vendor */ + "ETH-Proto-Type", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_GROUPED /* base type of data */ + }; + + struct local_rules_definition rules[] = + { { "ETH-Ether-Type", RULE_OPTIONAL, -1, -1 } + ,{ "ETH-SAP", RULE_OPTIONAL, -1, -1 } + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, &avp); + PARSE_loc_rules( rules, avp ); + } + + /* ETH-Option - RFC 5777 */ + { + /* + + */ + struct dict_object * avp; + struct dict_avp_data data = { + 548, /* Code */ + 0, /* Vendor */ + "ETH-Option", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_GROUPED /* base type of data */ + }; + + struct local_rules_definition rules[] = + { { "ETH-Proto-Type", RULE_REQUIRED, -1, 1 } + ,{ "VLAN-ID-Range", RULE_OPTIONAL, -1, -1 } + ,{ "User-Priority-Range", RULE_OPTIONAL, -1, 1 } + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, &avp); + PARSE_loc_rules( rules, avp ); + } + + /* Negated - RFC 5777 */ + { + /* + + */ + struct dict_object * type; + struct dict_type_data tdata = { AVP_TYPE_INTEGER32, "Enumerated(Negated)" , NULL, NULL, NULL }; + struct dict_enumval_data t_0 = { "False", { .i32 = 0 }}; + struct dict_enumval_data t_1 = { "True", { .i32 = 1 }}; + + struct dict_avp_data data = { + 517, /* Code */ + 0, /* Vendor */ + "Negated", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_INTEGER32 /* base type of data */ + }; + /* Create the Enumerated type, and then the AVP */ + CHECK_dict_new( DICT_TYPE, &tdata , NULL, &type); + CHECK_dict_new( DICT_ENUMVAL, &t_0 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_1 , type, NULL); + CHECK_dict_new( DICT_AVP, &data , type, NULL); + } + + /* ICMP-Code - RFC 5777 */ + { + /* + + Here is what the RFC 5777 says : + + The ICMP-Code AVP (AVP Code 547) is of type Enumerated and the values + are managed by IANA under the ICMP Type Numbers registry as defined + in [RFC2780]. + + The problem is (please refer to http://www.iana.org/assignments/icmp-parameters ) : + Many of the ICMP types (AVP 456, see next AVP) have a "code" field (defined in this AVP). + + It means that the enum values defined in the current ICMP-Code AVP are not constants. + + We take the liberty of changing the Type of this AVP. + + NEW TYPE : Integer32 + + */ + + struct dict_avp_data data = { + 547, /* Code */ + 0, /* Vendor */ + "ICMP-Code", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_INTEGER32 /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /* ICMP-Type-Number - RFC 5777 */ + { + /* + + The ICMP-Type-Number AVP (AVP Code 546) is of type Enumerated and the + values are managed by IANA under the ICMP Type Numbers registry as + defined in [RFC2780]. + + The RFC2780 then redirect us to the IANA. + + The Values have been copied from the following page : + http://www.iana.org/assignments/icmp-parameters + + Last updated : 2010-04-22 + + */ + struct dict_object * type; + struct dict_type_data tdata = { AVP_TYPE_INTEGER32, "Enumerated(ICMP-Type-Number)" , NULL, NULL, NULL }; + struct dict_enumval_data t_0 = { "Echo Reply", { .i32 = 0 }}; + struct dict_enumval_data t_3 = { "Destination Unreachable", { .i32 = 3 }}; + struct dict_enumval_data t_4 = { "Source Quench", { .i32 = 4 }}; + struct dict_enumval_data t_5 = { "Redirect", { .i32 = 5 }}; + struct dict_enumval_data t_6 = { "Alternate Host Address", { .i32 = 6 }}; + struct dict_enumval_data t_8 = { "Echo", { .i32 = 8 }}; + struct dict_enumval_data t_9 = { "Router Advertisement", { .i32 = 9 }}; + struct dict_enumval_data t_10 = { "Router Solicitation", { .i32 = 10 }}; + struct dict_enumval_data t_11 = { "Time Exceeded", { .i32 = 11 }}; + struct dict_enumval_data t_12 = { "Parameter Problem", { .i32 = 12 }}; + struct dict_enumval_data t_13 = { "Timestamp", { .i32 = 13 }}; + struct dict_enumval_data t_14 = { "Timestamp Reply", { .i32 = 14 }}; + struct dict_enumval_data t_15 = { "Information Request", { .i32 = 15 }}; + struct dict_enumval_data t_16 = { "Information Reply", { .i32 = 16 }}; + struct dict_enumval_data t_17 = { "Address Mask Request", { .i32 = 17 }}; + struct dict_enumval_data t_18 = { "Address Mask Reply", { .i32 = 18 }}; + struct dict_enumval_data t_30 = { "Traceroute", { .i32 = 30 }}; + struct dict_enumval_data t_31 = { "Datagram Conversion Error", { .i32 = 31 }}; + struct dict_enumval_data t_32 = { "Mobile Host Redirect", { .i32 = 32 }}; + struct dict_enumval_data t_33 = { "IPv6 Where-Are-You", { .i32 = 33 }}; + struct dict_enumval_data t_34 = { "IPv6 I-Am-Here", { .i32 = 34 }}; + struct dict_enumval_data t_35 = { "Mobile Registration Request", { .i32 = 35 }}; + struct dict_enumval_data t_36 = { "Mobile Registration Reply ", { .i32 = 36 }}; + struct dict_enumval_data t_37 = { "Domain Name Request", { .i32 = 37 }}; + struct dict_enumval_data t_38 = { "Domain Name Reply", { .i32 = 38 }}; + struct dict_enumval_data t_39 = { "SKIP", { .i32 = 39 }}; + struct dict_enumval_data t_40 = { "Photuris", { .i32 = 40 }}; + struct dict_enumval_data t_41 = { "ICMP messages utilized by experimental mobility protocols such as Seamoby",{ .i32 = 41 }}; + + struct dict_avp_data data = { + 546, /* Code */ + 0, /* Vendor */ + "ICMP-Type-Number", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_INTEGER32 /* base type of data */ + }; + /* Create the Enumerated type, and then the AVP */ + CHECK_dict_new( DICT_TYPE, &tdata , NULL, &type); + CHECK_dict_new( DICT_ENUMVAL, &t_0 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_3 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_4 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_5 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_6 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_8 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_9 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_10 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_11 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_12 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_13 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_14 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_15 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_16 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_17 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_18 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_30 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_31 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_32 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_33 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_34 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_35 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_36 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_37 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_38 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_39 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_40 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_41 , type, NULL); + CHECK_dict_new( DICT_AVP, &data , type, NULL); + } + + /* ICMP-Type - RFC 5777 */ + { + /* + + */ + struct dict_object * avp; + struct dict_avp_data data = { + 545, /* Code */ + 0, /* Vendor */ + "ICMP-Type", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_GROUPED /* base type of data */ + }; + + struct local_rules_definition rules[] = + { { "ICMP-Type-Number", RULE_REQUIRED, -1, 1 } + ,{ "ICMP-Code", RULE_OPTIONAL, -1, -1 } + ,{ "Negated", RULE_OPTIONAL, -1, 1 } + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, &avp); + PARSE_loc_rules( rules, avp ); + } + + /* Negated - RFC 5777 */ + + /* + Implemented higher + */ + + /* TCP-Flag-Type - RFC 5777 */ + { + /* + + */ + + struct dict_avp_data data = { + 539, /* Code */ + 0, /* Vendor */ + "TCP-Flag-Type", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_UNSIGNED32 /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /* TCP-Flags - RFC 5777 */ + { + /* + + */ + struct dict_object * avp; + struct dict_avp_data data = { + 543, /* Code */ + 0, /* Vendor */ + "TCP-Flags", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_GROUPED /* base type of data */ + }; + + struct local_rules_definition rules[] = + { { "TCP-Flag-Type", RULE_REQUIRED, -1, 1 } + ,{ "Negated", RULE_OPTIONAL, -1, 1 } + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, &avp); + PARSE_loc_rules( rules, avp ); + } + + /* TCP-Option-Type - RFC 5777 */ + { + /* + The TCP-Option-Type AVP (AVP Code 541) is of type Enumerated and the + values are managed by IANA under the TCP Option Numbers registry as + defined in [RFC2780]. + + The RFC2780 then redirect us to the IANA. + + The Values have been copied from the following page : + http://www.iana.org/assignments/tcp-parameters/tcp-parameters.txt + + Last updated : 2010-06-22 + + */ + struct dict_object * type; + struct dict_type_data tdata = { AVP_TYPE_INTEGER32, "Enumerated(TCP-Option-Type)" , NULL, NULL, NULL }; + struct dict_enumval_data t_0 = { "End of Option List", { .i32 = 0 }}; + struct dict_enumval_data t_1 = { "No-Operation", { .i32 = 1 }}; + struct dict_enumval_data t_2 = { "Maximum Segment Size", { .i32 = 2 }}; + struct dict_enumval_data t_3 = { "WSOPT - Window Scale", { .i32 = 3 }}; + struct dict_enumval_data t_4 = { "SACK Permitted", { .i32 = 4 }}; + struct dict_enumval_data t_5 = { "SACK", { .i32 = 5 }}; + struct dict_enumval_data t_6 = { "Echo", { .i32 = 6 }}; + struct dict_enumval_data t_7 = { "Echo Reply", { .i32 = 7 }}; + struct dict_enumval_data t_8 = { "TSOPT - Time Stamp Option", { .i32 = 8 }}; + struct dict_enumval_data t_9 = { "Partial Order Connection Permitted", { .i32 = 9 }}; + struct dict_enumval_data t_10 = { "Partial Order Service Profile", { .i32 = 10 }}; + struct dict_enumval_data t_11 = { "CC", { .i32 = 11 }}; + struct dict_enumval_data t_12 = { "CC.NEW", { .i32 = 12 }}; + struct dict_enumval_data t_13 = { "CC.ECHO", { .i32 = 13 }}; + struct dict_enumval_data t_14 = { "TCP Alternate Checksum Request", { .i32 = 14 }}; + struct dict_enumval_data t_15 = { "TCP Alternate Checksum Data", { .i32 = 15 }}; + struct dict_enumval_data t_16 = { "Skeeter", { .i32 = 16 }}; + struct dict_enumval_data t_17 = { "Bubba", { .i32 = 17 }}; + struct dict_enumval_data t_18 = { "Trailer Checksum Option", { .i32 = 18 }}; + struct dict_enumval_data t_19 = { "MD5 Signature Option", { .i32 = 19 }}; + struct dict_enumval_data t_20 = { "SCPS Capabilities", { .i32 = 20 }}; + struct dict_enumval_data t_21 = { "Selective Negative Acknowledgements",{ .i32 = 21 }}; + struct dict_enumval_data t_22 = { "Record Boundaries", { .i32 = 22 }}; + struct dict_enumval_data t_23 = { "Corruption experienced", { .i32 = 23 }}; + struct dict_enumval_data t_24 = { "SNAP", { .i32 = 24 }}; + struct dict_enumval_data t_26 = { "TCP Compression Filter", { .i32 = 26 }}; + struct dict_enumval_data t_27 = { "Quick-Start Response", { .i32 = 27 }}; + struct dict_enumval_data t_28 = { "User Timeout Option", { .i32 = 28 }}; + struct dict_enumval_data t_29 = { "TCP Authentication Option (TCP-AO)", { .i32 = 29 }}; + + struct dict_avp_data data = { + 541, /* Code */ + 0, /* Vendor */ + "TCP-Option-Type", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_INTEGER32 /* base type of data */ + }; + /* Create the Enumerated type, and then the AVP */ + CHECK_dict_new( DICT_TYPE, &tdata , NULL, &type); + CHECK_dict_new( DICT_ENUMVAL, &t_0 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_1 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_2 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_3 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_4 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_5 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_6 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_7 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_8 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_9 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_10 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_11 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_12 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_13 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_14 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_15 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_16 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_17 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_18 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_19 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_20 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_21 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_22 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_23 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_24 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_26 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_27 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_28 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_29 , type, NULL); + CHECK_dict_new( DICT_AVP, &data , type, NULL); + } + + /* TCP-Option-Value - RFC 5777 */ + { + /* + + */ + + struct dict_avp_data data = { + 542, /* Code */ + 0, /* Vendor */ + "TCP-Option-Value", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_OCTETSTRING /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /* Negated - RFC 5777 */ + + /* + Implemented higher + */ + + /* TCP-Option - RFC 5777 */ + { + /* + + */ + struct dict_object * avp; + struct dict_avp_data data = { + 540, /* Code */ + 0, /* Vendor */ + "TCP-Option", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_GROUPED /* base type of data */ + }; + + struct local_rules_definition rules[] = + { { "TCP-Option-Type", RULE_REQUIRED, -1, 1 } + ,{ "TCP-Option-Value", RULE_OPTIONAL, -1, -1 } + ,{ "Negated", RULE_OPTIONAL, -1, 1 } + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, &avp); + PARSE_loc_rules( rules, avp ); + } + + /* IP-Option-Type - RFC 5777 */ + { + /* + + The IP-Option-Type AVP (AVP Code 538) is of type Enumerated and the + values are managed by IANA under the IP Option Numbers registry as + defined in [RFC2780]. + + The RFC2780 then redirect us to the IANA. + + The Values have been copied from the following page : + http://www.iana.org/assignments/ip-parameters + + Last updated : 2007-02-15 + + */ + struct dict_object * type; + struct dict_type_data tdata = { AVP_TYPE_INTEGER32, "Enumerated(IP-Option-Type)" , NULL, NULL, NULL }; + struct dict_enumval_data t_0 = { "End of Options List [RFC791,JBP]", { .i32 = 0 }}; + struct dict_enumval_data t_1 = { "No Operation [RFC791,JBP]", { .i32 = 1 }}; + struct dict_enumval_data t_2 = { "Security [RFC1108]", { .i32 = 2 }}; + struct dict_enumval_data t_3 = { "Loose Source Route [RFC791,JBP]", { .i32 = 3 }}; + struct dict_enumval_data t_4 = { "Time Stamp [RFC791,JBP]", { .i32 = 4 }}; + struct dict_enumval_data t_5 = { "Extended Security [RFC1108]", { .i32 = 5 }}; + struct dict_enumval_data t_6 = { "Commercial Security [???]", { .i32 = 6 }}; + struct dict_enumval_data t_7 = { "Record Route [RFC791,JBP]", { .i32 = 7 }}; + struct dict_enumval_data t_8 = { "Stream ID [RFC791,JBP]", { .i32 = 8 }}; + struct dict_enumval_data t_9 = { "Strict Source Route [RFC791,JBP]", { .i32 = 9 }}; + struct dict_enumval_data t_10 = { "Experimental Measurement [ZSu]", { .i32 = 10 }}; + struct dict_enumval_data t_11 = { "MTU Probe [RFC1191]*", { .i32 = 11 }}; + struct dict_enumval_data t_12 = { "MTU Reply [RFC1191]*", { .i32 = 12 }}; + struct dict_enumval_data t_13 = { "Experimental Flow Control [Finn]", { .i32 = 13 }}; + struct dict_enumval_data t_14 = { "Expermental Access Control [Estrin]", { .i32 = 14 }}; + struct dict_enumval_data t_15 = { "??? [VerSteeg]", { .i32 = 15 }}; + struct dict_enumval_data t_16 = { "IMI Traffic Descriptor [Lee]", { .i32 = 16 }}; + struct dict_enumval_data t_17 = { "Extended Internet Protocol[RFC1385]", { .i32 = 17 }}; + struct dict_enumval_data t_18 = { "Traceroute [RFC1393]", { .i32 = 18 }}; + struct dict_enumval_data t_19 = { "Address Extension [Ullmann IPv7]", { .i32 = 19 }}; + struct dict_enumval_data t_20 = { "Router Alert [RFC2113]", { .i32 = 20 }}; + struct dict_enumval_data t_21 = { "Selective Directed Broadcast[Graff]", { .i32 = 21 }}; + struct dict_enumval_data t_23 = { "Dynamic Packet State [Malis]", { .i32 = 23 }}; + struct dict_enumval_data t_24 = { "Upstream Multicast Pkt. [Farinacci]", { .i32 = 24 }}; + struct dict_enumval_data t_25 = { "Quick-Start [RFC4782]", { .i32 = 25 }}; + + struct dict_avp_data data = { + 538, /* Code */ + 0, /* Vendor */ + "IP-Option-Type", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_INTEGER32 /* base type of data */ + }; + /* Create the Enumerated type, and then the AVP */ + CHECK_dict_new( DICT_TYPE, &tdata , NULL, &type); + CHECK_dict_new( DICT_ENUMVAL, &t_0 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_1 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_2 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_3 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_4 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_5 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_6 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_7 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_8 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_9 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_10 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_11 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_12 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_13 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_14 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_15 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_16 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_17 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_18 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_19 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_20 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_21 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_23 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_24 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_25 , type, NULL); + CHECK_dict_new( DICT_AVP, &data , type, NULL); + } + + /* IP-Option-Value - RFC 5777 */ + { + /* + + */ + + struct dict_avp_data data = { + 539, /* Code */ + 0, /* Vendor */ + "IP-Option-Value", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_OCTETSTRING /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /* Negated - RFC 5777 */ + + /* + Implemented higher + */ + + /* IP-Option - RFC 5777 */ + { + /* + + */ + struct dict_object * avp; + struct dict_avp_data data = { + 537, /* Code */ + 0, /* Vendor */ + "TCP-Option", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_GROUPED /* base type of data */ + }; + + struct local_rules_definition rules[] = + { { "IP-Option-Type", RULE_REQUIRED, -1, 1 } + ,{ "IP-Option-Value", RULE_OPTIONAL, -1, -1 } + ,{ "Negated", RULE_OPTIONAL, -1, 1 } + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, &avp); + PARSE_loc_rules( rules, avp ); + } + + /* Fragmentation-Flag - RFC 5777 */ + { + /* + + */ + struct dict_object * type; + struct dict_type_data tdata = { AVP_TYPE_INTEGER32, "Enumerated(Fragmentation-Flag)" , NULL, NULL, NULL }; + struct dict_enumval_data t_0 = { "DF", { .i32 = 0 }}; + struct dict_enumval_data t_1 = { "MF", { .i32 = 1 }}; + + struct dict_avp_data data = { + 536, /* Code */ + 0, /* Vendor */ + "Fragmentation-Flag", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_INTEGER32 /* base type of data */ + }; + /* Create the Enumerated type, and then the AVP */ + CHECK_dict_new( DICT_TYPE, &tdata , NULL, &type); + CHECK_dict_new( DICT_ENUMVAL, &t_0 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_1 , type, NULL); + CHECK_dict_new( DICT_AVP, &data , type, NULL); + } + + /* Diffserv-Code-Point - RFC 5777 */ + { + /* + The Diffserv-Code-Point AVP (AVP Code 535) is of type Enumerated and + specifies the Differentiated Services Field Codepoints to match in + the IP header. The values are managed by IANA under the + Differentiated Services Field Codepoints registry as defined in + [RFC2474]. + + The RFC2474 then redirect us to the IANA. + + The Values have been copied from the following page : + http://www.iana.org/assignments/dscp-registry/dscp-registry.txt + + Last updated : 2010-05-11 + + */ + struct dict_object * type; + struct dict_type_data tdata = { AVP_TYPE_INTEGER32, "Enumerated(Diffserv-Code-Point)" , NULL, NULL, NULL }; + struct dict_enumval_data t_000000 = { "CS0", { .i32 = 0b000000 }}; + struct dict_enumval_data t_001000 = { "CS1", { .i32 = 0b001000 }}; + struct dict_enumval_data t_010000 = { "CS2", { .i32 = 0b010000 }}; + struct dict_enumval_data t_011000 = { "CS3", { .i32 = 0b011000 }}; + struct dict_enumval_data t_100000 = { "CS4", { .i32 = 0b100000 }}; + struct dict_enumval_data t_101000 = { "CS5", { .i32 = 0b101000 }}; + struct dict_enumval_data t_110000 = { "CS6", { .i32 = 0b110000 }}; + struct dict_enumval_data t_111000 = { "CS7", { .i32 = 0b111000 }}; + struct dict_enumval_data t_001010 = { "AF11", { .i32 = 0b001010 }}; + struct dict_enumval_data t_001100 = { "AF12", { .i32 = 0b001100 }}; + struct dict_enumval_data t_001110 = { "AF13", { .i32 = 0b001110 }}; + struct dict_enumval_data t_010010 = { "AF21", { .i32 = 0b010010 }}; + struct dict_enumval_data t_010100 = { "AF22", { .i32 = 0b010100 }}; + struct dict_enumval_data t_010110 = { "AF23", { .i32 = 0b010110 }}; + struct dict_enumval_data t_011010 = { "AF31", { .i32 = 0b011010 }}; + struct dict_enumval_data t_011100 = { "AF32", { .i32 = 0b011100 }}; + struct dict_enumval_data t_011110 = { "AF33", { .i32 = 0b011110 }}; + struct dict_enumval_data t_100010 = { "AF41", { .i32 = 0b100010 }}; + struct dict_enumval_data t_100100 = { "AF42", { .i32 = 0b100100 }}; + struct dict_enumval_data t_100110 = { "AF43", { .i32 = 0b100110 }}; + struct dict_enumval_data t_101110 = { "EF PHB", { .i32 = 0b101110 }}; + struct dict_enumval_data t_101100 = { "VOICE-ADMIT", { .i32 = 0b101100 }}; + + struct dict_avp_data data = { + 535, /* Code */ + 0, /* Vendor */ + "Diffserv-Code-Point", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_INTEGER32 /* base type of data */ + }; + /* Create the Enumerated type, and then the AVP */ + CHECK_dict_new( DICT_TYPE, &tdata , NULL, &type); + CHECK_dict_new( DICT_ENUMVAL, &t_000000 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_001000 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_010000 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_011000 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_100000 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_101000 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_110000 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_111000 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_001010 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_001100 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_001110 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_010010 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_010100 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_010110 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_011010 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_011100 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_011110 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_100010 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_100100 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_100110 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_101110 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_101100 , type, NULL); + CHECK_dict_new( DICT_AVP, &data , type, NULL); + } + + /* IP-Address - RFC 5777 */ + { + /* + + */ + + struct dict_avp_data data = { + 518, /* Code */ + 0, /* Vendor */ + "IP-Address", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_OCTETSTRING /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , Address_type, NULL); + } + + /* IP-Address-Start - RFC 5777 */ + { + /* + + */ + + struct dict_avp_data data = { + 520, /* Code */ + 0, /* Vendor */ + "IP-Address-Start", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_OCTETSTRING /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , Address_type, NULL); + } + + /* IP-Address-End - RFC 5777 */ + { + /* + + */ + + struct dict_avp_data data = { + 521, /* Code */ + 0, /* Vendor */ + "IP-Address-End", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_OCTETSTRING /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , Address_type, NULL); + } + + /* IP-Address-Range - RFC 5777 */ + { + /* + + */ + struct dict_object * avp; + struct dict_avp_data data = { + 519, /* Code */ + 0, /* Vendor */ + "IP-Address-Range", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_GROUPED /* base type of data */ + }; + + struct local_rules_definition rules[] = + { { "IP-Address-Start", RULE_OPTIONAL, -1, 1 } + ,{ "IP-Address-End", RULE_OPTIONAL, -1, 1 } + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, &avp); + PARSE_loc_rules( rules, avp ); + } + + /* IP-Address - RFC 5777 */ + + /* + Implemented higher + */ + + /* IP-Mask-Bit-Mask-Width - RFC 5777 */ + { + /* + + */ + + struct dict_avp_data data = { + 523, /* Code */ + 0, /* Vendor */ + "IP-Mask-Bit-Mask-Width", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_UNSIGNED32 /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /* IP-Address-Mask - RFC 5777 */ + { + /* + + */ + struct dict_object * avp; + struct dict_avp_data data = { + 522, /* Code */ + 0, /* Vendor */ + "IP-Address-Mask", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_GROUPED /* base type of data */ + }; + + struct local_rules_definition rules[] = + { { "IP-Address", RULE_REQUIRED, -1, 1 } + ,{ "IP-Bit-Mask-Width", RULE_REQUIRED, -1, 1 } + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, &avp); + PARSE_loc_rules( rules, avp ); + } + + /* MAC-Address - RFC 5777 */ + { + /* + + */ + + struct dict_avp_data data = { + 524, /* Code */ + 0, /* Vendor */ + "MAC-Address", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_OCTETSTRING /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /* MAC-Address - RFC 5777 */ + + /* + Implemented higher + */ + + /* MAC-Address-Mask-Pattern - RFC 5777 */ + { + /* + + */ + + struct dict_avp_data data = { + 526, /* Code */ + 0, /* Vendor */ + "MAC-Address-Mask-Pattern", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_OCTETSTRING /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /* MAC-Address-Mask - RFC 5777 */ + { + /* + + */ + struct dict_object * avp; + struct dict_avp_data data = { + 525, /* Code */ + 0, /* Vendor */ + "MAC-Address-Mask", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_GROUPED /* base type of data */ + }; + + struct local_rules_definition rules[] = + { { "MAC-Address", RULE_REQUIRED, -1, 1 } + ,{ "MAC-Address-Mask-Pattern", RULE_REQUIRED, -1, 1 } + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, &avp); + PARSE_loc_rules( rules, avp ); + } + + /* EUI64-Address - RFC 5777 */ + { + /* + + */ + + struct dict_avp_data data = { + 527, /* Code */ + 0, /* Vendor */ + "EUI64-Address", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_OCTETSTRING /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /* EUI64-Address - RFC 5777 */ + + /* + Implemented higher + */ + + /* EUI64-Address-Mask-Pattern - RFC 5777 */ + { + /* + + */ + + struct dict_avp_data data = { + 529, /* Code */ + 0, /* Vendor */ + "EUI64-Address-Mask-Pattern", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_OCTETSTRING /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /* EUI64-Address-Mask - RFC 5777 */ + { + /* + + */ + struct dict_object * avp; + struct dict_avp_data data = { + 528, /* Code */ + 0, /* Vendor */ + "EUI64-Address-Mask", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_GROUPED /* base type of data */ + }; + + struct local_rules_definition rules[] = + { { "EUI64-Address", RULE_REQUIRED, -1, 1 } + ,{ "EUI64-Address-Mask-Pattern", RULE_REQUIRED, -1, 1 } + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, &avp); + PARSE_loc_rules( rules, avp ); + } + + /* Port - RFC 5777 */ + { + /* + + */ + + struct dict_avp_data data = { + 530, /* Code */ + 0, /* Vendor */ + "Port", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_INTEGER32 /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /* Port-Start - RFC 5777 */ + { + /* + + */ + + struct dict_avp_data data = { + 532, /* Code */ + 0, /* Vendor */ + "Port-Start", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_INTEGER32 /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /* Port-End - RFC 5777 */ + { + /* + + */ + + struct dict_avp_data data = { + 533, /* Code */ + 0, /* Vendor */ + "Port-End", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_INTEGER32 /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /* Port-Range - RFC 5777 */ + { + /* + + */ + struct dict_object * avp; + struct dict_avp_data data = { + 531, /* Code */ + 0, /* Vendor */ + "Port-Range", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_GROUPED /* base type of data */ + }; + + struct local_rules_definition rules[] = + { { "Port-Start", RULE_OPTIONAL, -1, 1 } + ,{ "Port-End", RULE_OPTIONAL, -1, 1 } + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, &avp); + PARSE_loc_rules( rules, avp ); + } + + /* Negated - RFC 5777 */ + + /* + Implemented higher + */ + + /* Use-Assigned-Address - RFC 5777 */ + { + /* + + */ + struct dict_object * type; + struct dict_type_data tdata = { AVP_TYPE_INTEGER32, "Enumerated(Use-Assigned-Address)" , NULL, NULL, NULL }; + struct dict_enumval_data t_0 = { "False", { .i32 = 0 }}; + struct dict_enumval_data t_1 = { "True", { .i32 = 1 }}; + + struct dict_avp_data data = { + 534, /* Code */ + 0, /* Vendor */ + "Use-Assigned-Address", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_INTEGER32 /* base type of data */ + }; + /* Create the Enumerated type, and then the AVP */ + CHECK_dict_new( DICT_TYPE, &tdata , NULL, &type); + CHECK_dict_new( DICT_ENUMVAL, &t_0 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_1 , type, NULL); + CHECK_dict_new( DICT_AVP, &data , type, NULL); + } + + /* From-Spec - RFC 5777 */ + { + /* + + */ + struct dict_object * avp; + struct dict_avp_data data = { + 515, /* Code */ + 0, /* Vendor */ + "From-Spec", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_GROUPED /* base type of data */ + }; + + struct local_rules_definition rules[] = + { { "IP-Address", RULE_OPTIONAL, -1, -1 } + ,{ "IP-Address-Range", RULE_OPTIONAL, -1, -1 } + ,{ "IP-Address-Mask", RULE_OPTIONAL, -1, -1 } + ,{ "MAC-Address", RULE_OPTIONAL, -1, -1 } + ,{ "MAC-Address-Mask", RULE_OPTIONAL, -1, -1 } + ,{ "EUI64-Address", RULE_OPTIONAL, -1, -1 } + ,{ "EUI64-Address-Mask", RULE_OPTIONAL, -1, -1 } + ,{ "Port", RULE_OPTIONAL, -1, -1 } + ,{ "Port-Range", RULE_OPTIONAL, -1, -1 } + ,{ "Negated", RULE_OPTIONAL, -1, 1 } + ,{ "Use-Assigned-Address", RULE_OPTIONAL, -1, 1 } + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, &avp); + PARSE_loc_rules( rules, avp ); + } + + /* To-Spec - RFC 5777 */ + { + /* + + */ + struct dict_object * avp; + struct dict_avp_data data = { + 516, /* Code */ + 0, /* Vendor */ + "To-Spec", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_GROUPED /* base type of data */ + }; + + struct local_rules_definition rules[] = + { { "IP-Address", RULE_OPTIONAL, -1, -1 } + ,{ "IP-Address-Range", RULE_OPTIONAL, -1, -1 } + ,{ "IP-Address-Mask", RULE_OPTIONAL, -1, -1 } + ,{ "MAC-Address", RULE_OPTIONAL, -1, -1 } + ,{ "MAC-Address-Mask", RULE_OPTIONAL, -1, -1 } + ,{ "EUI64-Address", RULE_OPTIONAL, -1, -1 } + ,{ "EUI64-Address-Mask", RULE_OPTIONAL, -1, -1 } + ,{ "Port", RULE_OPTIONAL, -1, -1 } + ,{ "Port-Range", RULE_OPTIONAL, -1, -1 } + ,{ "Negated", RULE_OPTIONAL, -1, 1 } + ,{ "Use-Assigned-Address", RULE_OPTIONAL, -1, 1 } + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, &avp); + PARSE_loc_rules( rules, avp ); + } + + /* Direction - RFC 5777 */ + { + /* + + */ + struct dict_object * type; + struct dict_type_data tdata = { AVP_TYPE_INTEGER32, "Enumerated(Direction)" , NULL, NULL, NULL }; + struct dict_enumval_data t_0 = { "IN", { .i32 = 0 }}; + struct dict_enumval_data t_1 = { "OUT", { .i32 = 1 }}; + struct dict_enumval_data t_2 = { "BOTH", { .i32 = 2 }}; + + struct dict_avp_data data = { + 514, /* Code */ + 0, /* Vendor */ + "Direction", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_INTEGER32 /* base type of data */ + }; + /* Create the Enumerated type, and then the AVP */ + CHECK_dict_new( DICT_TYPE, &tdata , NULL, &type); + CHECK_dict_new( DICT_ENUMVAL, &t_0 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_1 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_2 , type, NULL); + CHECK_dict_new( DICT_AVP, &data , type, NULL); + } + + /* Protocol - RFC 5777 */ + { + /* + The Protocol AVP (AVP Code 513) is of type Enumerated and specifies + the protocol being matched. The attributes included in the + Classifier AVP MUST be consistent with the value of the Protocol AVP. + Exactly zero or one Protocol AVP may be contained within a Classifier + AVP. If the Protocol AVP is omitted from the classifier, then + comparison of the protocol of the packet is irrelevant. The values + for this AVP are managed by IANA under the Protocol Numbers registry + as defined in [RFC3643]. + + The RFC3643 then redirects us to the IANA. + + The Values have been copied from the following page : + http://www.iana.org/assignments/ips-protocols + + Last updated : 2004-01-26 + */ + struct dict_object * type; + struct dict_type_data tdata = { AVP_TYPE_INTEGER32, "Enumerated(Protocol)" , NULL, NULL, NULL }; + struct dict_enumval_data t_0 = { "Reserved", { .i32 = 0 }}; + struct dict_enumval_data t_1 = { "FCIP (Fibre Channel Over TCP/IP)", { .i32 = 1 }}; + struct dict_enumval_data t_2 = { "iFCP (A Protocol for Internet Fibre Channel)", { .i32 = 2 }}; + + struct dict_avp_data data = { + 513, /* Code */ + 0, /* Vendor */ + "Protocol", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_INTEGER32 /* base type of data */ + }; + /* Create the Enumerated type, and then the AVP */ + CHECK_dict_new( DICT_TYPE, &tdata , NULL, &type); + CHECK_dict_new( DICT_ENUMVAL, &t_0 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_1 , type, NULL); + CHECK_dict_new( DICT_ENUMVAL, &t_2 , type, NULL); + CHECK_dict_new( DICT_AVP, &data , type, NULL); + } + + /* Classifier-ID - RFC 5777 */ + { + /* + + */ + + struct dict_avp_data data = { + 512, /* Code */ + 0, /* Vendor */ + "Classifier-ID", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_OCTETSTRING /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /* Classifier - RFC 5777 */ + { + /* + + */ + struct dict_object * avp; + struct dict_avp_data data = { + 511, /* Code */ + 0, /* Vendor */ + "Classifier", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_GROUPED /* base type of data */ + }; + + struct local_rules_definition rules[] = + { { "Classifier-ID", RULE_REQUIRED, -1, 1 } + ,{ "Protocol", RULE_OPTIONAL, -1, 1 } + ,{ "Direction", RULE_OPTIONAL, -1, 1 } + ,{ "From-Spec", RULE_OPTIONAL, -1, -1 } + ,{ "To-Spec", RULE_OPTIONAL, -1, -1 } + ,{ "Diffserv-Code-Point", RULE_OPTIONAL, -1, -1 } + ,{ "Fragmentation-Flag", RULE_OPTIONAL, -1, 1 } + ,{ "IP-Option", RULE_OPTIONAL, -1, -1 } + ,{ "TCP-Option", RULE_OPTIONAL, -1, -1 } + ,{ "TCP-Flags", RULE_OPTIONAL, -1, 1 } + ,{ "ICMP-Type", RULE_OPTIONAL, -1, -1 } + ,{ "ETH-Option", RULE_OPTIONAL, -1, -1 } + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, &avp); + PARSE_loc_rules( rules, avp ); + } + + /* Filter-Rule-Precedence - RFC 5777 */ + { + /* + + */ + + struct dict_avp_data data = { + 510, /* Code */ + 0, /* Vendor */ + "Filter-Rule-Precedence", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_UNSIGNED32 /* base type of data */ + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, NULL); + } + + /* Filter-Rule - RFC 5777 */ + { + /* + + */ + struct dict_object * avp; + struct dict_avp_data data = { + 509, /* Code */ + 0, /* Vendor */ + "Filter-Rule", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_GROUPED /* base type of data */ + }; + + struct local_rules_definition rules[] = + { { "Filter-Rule-Precedence", RULE_OPTIONAL, -1, 1 } + ,{ "Classifier", RULE_OPTIONAL, -1, 1 } + ,{ "Time-Of-Day-Condition", RULE_OPTIONAL, -1, -1 } + ,{ "Treatment-Action", RULE_OPTIONAL, -1, 1 } + ,{ "QoS-Semantics", RULE_OPTIONAL, -1, 1 } + ,{ "QoS-Profile-Template", RULE_OPTIONAL, -1, 1 } + ,{ "QoS-Parameters", RULE_OPTIONAL, -1, 1 } + ,{ "Excess-Treatment", RULE_OPTIONAL, -1, 1 } + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, &avp); + PARSE_loc_rules( rules, avp ); + } + + /* QoS-Resources - RFC 5777 */ + { + /* + + */ + struct dict_object * avp; + struct dict_avp_data data = { + 508, /* Code */ + 0, /* Vendor */ + "QoS-Resources", /* Name */ + AVP_FLAG_VENDOR | AVP_FLAG_MANDATORY, /* Fixed flags */ + AVP_FLAG_MANDATORY, /* Fixed flag values */ + AVP_TYPE_GROUPED /* base type of data */ + }; + + struct local_rules_definition rules[] = + { { "Filter-Rule", RULE_REQUIRED, -1, -1 } + }; + + CHECK_dict_new( DICT_AVP, &data , NULL, &avp); + PARSE_loc_rules( rules, avp ); + } + } + + TRACE_DEBUG(INFO, "Dictionary Extension 'Traffic Classification and Quality of Service (QoS) Attributes for Diameter (RFC 5777)' initialized"); + return 0; +} +EXTENSION_ENTRY("dict_rfc5777", dict_rfc5777_init);