Dynamic lib selection and deployment
[anna.git] / include / anna / diameter / helpers / defines.hpp
1 // ANNA - Anna is Not Nothingness Anymore                                                         //
2 //                                                                                                //
3 // (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo                         //
4 //                                                                                                //
5 // See project site at http://redmine.teslayout.com/projects/anna-suite                           //
6 // See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE //
7
8
9 #ifndef anna_diameter_helpers_defines_hpp
10 #define anna_diameter_helpers_defines_hpp
11
12
13 // Local
14 #include <anna/diameter/defines.hpp>
15 #include <anna/config/defines.hpp>
16
17
18 /**
19 * Define VENDORID__<context> with S32 value
20 */
21 #define anna_diameter_helpers_define_vendor(vendorname,code)\
22    /** vendor #vendorname */\
23    static const S32 VENDORID__##vendorname = code
24
25 /**
26 * Define APPID__<context> with S32 value (top = 4294967295)
27 */
28 #define anna_diameter_helpers_define_appid(appname,code)\
29    static const S32 APPID__##appname = code
30
31 /**
32 * Define AVPID__<avpname> for any <context> with AvpId value
33 */
34 #define anna_diameter_helpers_define_avp_in_context(avpname,code,context)\
35    static const AvpId AVPID__##avpname(code,VENDORID__##context)
36
37 /**
38 * Define AVPID__<avpname> and AVPVALUES__<avpname> for any <context> with AvpId value and static struct
39 */
40 #define anna_diameter_helpers_define_avp_with_values_in_context(avpname,code,context)\
41    anna_diameter_helpers_define_avp_in_context(avpname,code,context);\
42    struct AVPVALUES__##avpname\
43  
44 /**
45 * Define COMMANDID__<commandname> for requests with CommandId value
46 */
47 #define anna_diameter_helpers_define_command_request(commandname,code)\
48    static const CommandId COMMANDID__##commandname(code,true)
49
50 /**
51 * Define COMMANDID__<commandname> for answers with CommandId value
52 */
53 #define anna_diameter_helpers_define_command_answer(commandname,code)\
54    static const CommandId COMMANDID__##commandname(code,false)
55
56
57 namespace anna {
58
59 namespace diameter {
60
61 namespace helpers {
62
63 /** Generic AVP */
64 static const AvpId AVPID__AVP(0, 0);
65
66 /** Reserved Generic COMMAND */
67 //static const AvpId COMMANDID__COMMAND(0, 0);
68
69 /**
70 * Vendors
71 * http://www.iana.org/assignments/enterprise-numbers
72 */
73 anna_diameter_helpers_define_vendor(radius, 0);      // VENDORID__radius
74 anna_diameter_helpers_define_vendor(base, 0);        // VENDORID__base
75 anna_diameter_helpers_define_vendor(dcca, 0);        // VENDORID__dcca
76 anna_diameter_helpers_define_vendor(ietf, 0);        // VENDORID__ietf
77 anna_diameter_helpers_define_vendor(etsi, 13019);    // VENDORID__etsi
78 anna_diameter_helpers_define_vendor(tgpp, 10415);    // VENDORID__tgpp
79 anna_diameter_helpers_define_vendor(nokia, 94);      // VENDORID__nokia
80 anna_diameter_helpers_define_vendor(ericsson, 193);  // VENDORID__ericsson
81 anna_diameter_helpers_define_vendor(huawei, 2011);   // VENDORID__huawei
82 anna_diameter_helpers_define_vendor(tid, 5189);      // VENDORID__tid
83 anna_diameter_helpers_define_vendor(tme, 27640);     // VENDORID__tme
84
85 /**
86 * Application identifiers
87 * http://www.iana.org/assignments/aaa-parameters/aaa-parameters.xhtml
88 */
89 anna_diameter_helpers_define_appid(Diameter_Common_Message, 0);                          // APPID__Diameter_Common_Message
90 anna_diameter_helpers_define_appid(NASREQ, 1);                                           // APPID__NASREQ
91 anna_diameter_helpers_define_appid(Mobile_IPv4, 2);                                      // APPID__Mobile_IPv4
92 anna_diameter_helpers_define_appid(Diameter_Base_Accounting, 3);                         // APPID__Diameter_Base_Accounting
93 anna_diameter_helpers_define_appid(Diameter_Credit_Control, 4);                          // APPID__Diameter_Credit_Control
94 anna_diameter_helpers_define_appid(Diameter_EAP, 5);                                     // APPID__Diameter_EAP
95 anna_diameter_helpers_define_appid(Diameter_Session_Initiation_Protocol_Application, 6); // APPID__Diameter_Session_Initiation_Protocol_Application
96 anna_diameter_helpers_define_appid(Diameter_Mobile_IPv6_IKE, 7);                         // APPID__Diameter_Mobile_IPv6_IKE
97 anna_diameter_helpers_define_appid(Diameter_Mobile_IPv6_Auth, 8);                        // APPID__Diameter_Mobile_IPv6_Auth
98 anna_diameter_helpers_define_appid(Diameter_QoS_Application, 9);                         // APPID__Diameter_QoS_Application
99 // etc.
100 anna_diameter_helpers_define_appid(3GPP_Rx, 16777236);                                   // APPID__3GPP_Rx
101 anna_diameter_helpers_define_appid(3GPP_Gx, 16777238);                                   // APPID__3GPP_Gx
102 anna_diameter_helpers_define_appid(3GPP_Sy, 16777302);                                   // APPID__3GPP_Sy
103
104 // much more...
105
106 }
107 }
108 }
109
110
111 #endif
112