Mercurial > hg > freeDiameter
comparison contrib/test_Gx/main_gx.c @ 1271:fd398055521c
Remove some unused code. Fix loading message. Add dict_dcca_3gpp dependency.
author | Thomas Klausner <tk@giga.or.at> |
---|---|
date | Wed, 21 May 2014 12:37:14 +0200 |
parents | 55d0867dd8b8 |
children | c8057892e56b |
comparison
equal
deleted
inserted
replaced
1270:f6ad5596aac7 | 1271:fd398055521c |
---|---|
11 #include <time.h> | 11 #include <time.h> |
12 #define AUTH_APP_ID 16777238 | 12 #define AUTH_APP_ID 16777238 |
13 #define VENDOR_ID_3GPP 10415 | 13 #define VENDOR_ID_3GPP 10415 |
14 /* The content of this file follows the same structure as dict_base_proto.c */ | 14 /* The content of this file follows the same structure as dict_base_proto.c */ |
15 | 15 |
16 #if 0 | |
16 #define CHECK_dict_new( _type, _data, _parent, _ref ) \ | 17 #define CHECK_dict_new( _type, _data, _parent, _ref ) \ |
17 CHECK_FCT( fd_dict_new( fd_g_config->cnf_dict, (_type), (_data), (_parent), (_ref)) ); | 18 CHECK_FCT( fd_dict_new( fd_g_config->cnf_dict, (_type), (_data), (_parent), (_ref)) ); |
18 | 19 #endif |
19 #define CHECK_dict_search( _type, _criteria, _what, _result ) \ | |
20 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, (_type), (_criteria), (_what), (_result), ENOENT) ); | |
21 | 20 |
22 void dump_sess_eyec(struct session *sess, const char *); | 21 void dump_sess_eyec(struct session *sess, const char *); |
23 struct local_rules_definition { | 22 |
24 char *avp_name; | |
25 enum rule_position position; | |
26 int min; | |
27 int max; | |
28 }; | |
29 | |
30 #define RULE_ORDER( _position ) ((((_position) == RULE_FIXED_HEAD) || ((_position) == RULE_FIXED_TAIL)) ? 1 : 0 ) | |
31 | |
32 #define PARSE_loc_rules( _rulearray, _parent) { \ | |
33 int __ar; \ | |
34 for (__ar=0; __ar < sizeof(_rulearray) / sizeof((_rulearray)[0]); __ar++) { \ | |
35 struct dict_rule_data __data = { NULL, \ | |
36 (_rulearray)[__ar].position, \ | |
37 0, \ | |
38 (_rulearray)[__ar].min, \ | |
39 (_rulearray)[__ar].max}; \ | |
40 __data.rule_order = RULE_ORDER(__data.rule_position); \ | |
41 CHECK_FCT( fd_dict_search( \ | |
42 fd_g_config->cnf_dict, \ | |
43 DICT_AVP, \ | |
44 AVP_BY_NAME, \ | |
45 (_rulearray)[__ar].avp_name, \ | |
46 &__data.rule_avp, 0 ) ); \ | |
47 if ( !__data.rule_avp ) { \ | |
48 TRACE_DEBUG(INFO, "AVP Not found: '%s'", (_rulearray)[__ar].avp_name ); \ | |
49 return ENOENT; \ | |
50 } \ | |
51 CHECK_FCT_DO( fd_dict_new( fd_g_config->cnf_dict, DICT_RULE, &__data, _parent, NULL), \ | |
52 { \ | |
53 TRACE_DEBUG(INFO, "Error on rule with AVP '%s'", \ | |
54 (_rulearray)[__ar].avp_name ); \ | |
55 return EINVAL; \ | |
56 } ); \ | |
57 } \ | |
58 } | |
59 | |
60 #define enumval_def_u32( _val_, _str_ ) \ | |
61 { _str_, { .u32 = _val_ }} | |
62 | |
63 #define enumval_def_os( _len_, _val_, _str_ ) \ | |
64 { _str_, { .os = { .data = (unsigned char *)_val_, .len = _len_ }}} | |
65 | |
66 | |
67 | |
68 static int ccr_cb( struct msg ** msg, struct avp * avp, struct session * sess, void * opaque, enum disp_action * act); | 23 static int ccr_cb( struct msg ** msg, struct avp * avp, struct session * sess, void * opaque, enum disp_action * act); |
69 static int reauth_cb( struct msg ** msg, struct avp * avp, struct session * sess, void * opaque, enum disp_action * act); | 24 static int reauth_cb( struct msg ** msg, struct avp * avp, struct session * sess, void * opaque, enum disp_action * act); |
70 static int cca_cb( struct msg ** msg, struct avp * avp, struct session * sess, void * opaque, enum disp_action * act); | 25 static int cca_cb( struct msg ** msg, struct avp * avp, struct session * sess, void * opaque, enum disp_action * act); |
71 static struct disp_hdl * ccr_cb_hdl = NULL; /* handler for ccr req cb */ | 26 static struct disp_hdl * ccr_cb_hdl = NULL; /* handler for ccr req cb */ |
72 static struct disp_hdl * cca_cb_hdl = NULL; /* handler for cca req cb */ | 27 static struct disp_hdl * cca_cb_hdl = NULL; /* handler for cca req cb */ |
285 CHECK_FCT( fd_disp_app_support( gx_inf, NULL, 1 , 0)); | 240 CHECK_FCT( fd_disp_app_support( gx_inf, NULL, 1 , 0)); |
286 | 241 |
287 CHECK_FCT( fd_event_trig_regcb(SIGUSR1, "app_gx", sig_hdlr ) ); | 242 CHECK_FCT( fd_event_trig_regcb(SIGUSR1, "app_gx", sig_hdlr ) ); |
288 | 243 |
289 | 244 |
290 TRACE_DEBUG(INFO, "Extension 'Dictionary definitions for DCCA (rfc4006)' initialized"); | 245 TRACE_DEBUG(INFO, "Extension 'Gx' initialized"); |
291 return 0; | 246 return 0; |
292 } | 247 } |
293 | 248 |
294 void * gx_sm_th(void *sm) | 249 void * gx_sm_th(void *sm) |
295 { | 250 { |
858 | 813 |
859 static int gx_entry(char * conffile) | 814 static int gx_entry(char * conffile) |
860 { | 815 { |
861 return 0; | 816 return 0; |
862 } | 817 } |
863 EXTENSION_ENTRY( "app_gx", app_gx_entry, "dict_dcca"); | 818 EXTENSION_ENTRY( "app_gx", app_gx_entry, "dict_dcca_3gpp"); |
864 //EXTENSION_ENTRY( "app_gx", gx_entry); | 819 //EXTENSION_ENTRY( "app_gx", gx_entry); |