1 // ANNA - Anna is Not Nothingness Anymore
3 // (c) Copyright 2005-2014 Eduardo Ramos Testillano & Francisco Ruiz Rayo
5 // http://redmine.teslayout.com/projects/anna-suite
7 // Redistribution and use in source and binary forms, with or without
8 // modification, are permitted provided that the following conditions
11 // * Redistributions of source code must retain the above copyright
12 // notice, this list of conditions and the following disclaimer.
13 // * Redistributions in binary form must reproduce the above
14 // copyright notice, this list of conditions and the following disclaimer
15 // in the documentation and/or other materials provided with the
17 // * Neither the name of the copyright holder nor the names of its
18 // contributors may be used to endorse or promote products derived from
19 // this software without specific prior written permission.
21 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 // Authors: eduardo.ramos.testillano@gmail.com
34 // cisco.tierra@gmail.com
37 #ifndef anna_diameter_helpers_defines_hpp
38 #define anna_diameter_helpers_defines_hpp
42 #include <anna/diameter/defines.hpp>
43 #include <anna/config/defines.hpp>
47 * Define VENDORID__<context> with S32 value
49 #define anna_diameter_helpers_define_vendor(vendorname,code)\
50 /** vendor #vendorname */\
51 static const S32 VENDORID__##vendorname = code
54 * Define APPID__<context> with S32 value (top = 4294967295)
56 #define anna_diameter_helpers_define_appid(appname,code)\
57 static const S32 APPID__##appname = code
60 * Define AVPID__<avpname> for any <context> with AvpId value
62 #define anna_diameter_helpers_define_avp_in_context(avpname,code,context)\
63 static const AvpId AVPID__##avpname(code,VENDORID__##context)
66 * Define AVPID__<avpname> and AVPVALUES__<avpname> for any <context> with AvpId value and static struct
68 #define anna_diameter_helpers_define_avp_with_values_in_context(avpname,code,context)\
69 anna_diameter_helpers_define_avp_in_context(avpname,code,context);\
70 struct AVPVALUES__##avpname\
73 * Define COMMANDID__<commandname> for requests with CommandId value
75 #define anna_diameter_helpers_define_command_request(commandname,code)\
76 static const CommandId COMMANDID__##commandname(code,true)
79 * Define COMMANDID__<commandname> for answers with CommandId value
81 #define anna_diameter_helpers_define_command_answer(commandname,code)\
82 static const CommandId COMMANDID__##commandname(code,false)
92 static const AvpId AVPID__AVP(0, 0);
96 * http://www.iana.org/assignments/enterprise-numbers
98 anna_diameter_helpers_define_vendor(radius, 0); // VENDORID__radius
99 anna_diameter_helpers_define_vendor(base, 0); // VENDORID__base
100 anna_diameter_helpers_define_vendor(dcca, 0); // VENDORID__dcca
101 anna_diameter_helpers_define_vendor(ietf, 0); // VENDORID__ietf
102 anna_diameter_helpers_define_vendor(etsi, 13019); // VENDORID__etsi
103 anna_diameter_helpers_define_vendor(tgpp, 10415); // VENDORID__tgpp
104 anna_diameter_helpers_define_vendor(nokia, 94); // VENDORID__nokia
105 anna_diameter_helpers_define_vendor(ericsson, 193); // VENDORID__ericsson
106 anna_diameter_helpers_define_vendor(huawei, 2011); // VENDORID__huawei
107 anna_diameter_helpers_define_vendor(tid, 5189); // VENDORID__tid
108 anna_diameter_helpers_define_vendor(tme, 27640); // VENDORID__tme
111 * Application identifiers
112 * http://www.iana.org/assignments/aaa-parameters/aaa-parameters.xhtml
114 anna_diameter_helpers_define_appid(Diameter_Common_Message, 0); // APPID__Diameter_Common_Message
115 anna_diameter_helpers_define_appid(NASREQ, 1); // APPID__NASREQ
116 anna_diameter_helpers_define_appid(Mobile_IPv4, 2); // APPID__Mobile_IPv4
117 anna_diameter_helpers_define_appid(Diameter_Base_Accounting, 3); // APPID__Diameter_Base_Accounting
118 anna_diameter_helpers_define_appid(Diameter_Credit_Control, 4); // APPID__Diameter_Credit_Control
119 anna_diameter_helpers_define_appid(Diameter_EAP, 5); // APPID__Diameter_EAP
120 anna_diameter_helpers_define_appid(Diameter_Session_Initiation_Protocol_Application, 6); // APPID__Diameter_Session_Initiation_Protocol_Application
121 anna_diameter_helpers_define_appid(Diameter_Mobile_IPv6_IKE, 7); // APPID__Diameter_Mobile_IPv6_IKE
122 anna_diameter_helpers_define_appid(Diameter_Mobile_IPv6_Auth, 8); // APPID__Diameter_Mobile_IPv6_Auth
123 anna_diameter_helpers_define_appid(Diameter_QoS_Application, 9); // APPID__Diameter_QoS_Application
125 anna_diameter_helpers_define_appid(3GPP_Rx, 16777236); // APPID__3GPP_Rx
126 anna_diameter_helpers_define_appid(3GPP_Gx, 16777238); // APPID__3GPP_Gx
127 anna_diameter_helpers_define_appid(3GPP_Sy, 16777302); // APPID__3GPP_Sy