comparison extensions/test_app/test_app.c @ 1230:992437a90bda

Enable mix of short and long messages in test_app
author Sebastien Decugis <sdecugis@freediameter.net>
date Thu, 20 Jun 2013 11:01:19 +0800
parents c2fbaf2985f4
children
comparison
equal deleted inserted replaced
1229:cf9bad611f90 1230:992437a90bda
68 return 0; 68 return 0;
69 } 69 }
70 70
71 static void ta_conf_dump(void) 71 static void ta_conf_dump(void)
72 { 72 {
73 if (!TRACE_BOOL(INFO)) 73 LOG_D( "------- app_test configuration dump: ---------");
74 return; 74 LOG_D( " Vendor Id .......... : %u", ta_conf->vendor_id);
75 fd_log_debug( "------- app_test configuration dump: ---------"); 75 LOG_D( " Application Id ..... : %u", ta_conf->appli_id);
76 fd_log_debug( " Vendor Id .......... : %u", ta_conf->vendor_id); 76 LOG_D( " Command Id ......... : %u", ta_conf->cmd_id);
77 fd_log_debug( " Application Id ..... : %u", ta_conf->appli_id); 77 LOG_D( " AVP Id ............. : %u", ta_conf->avp_id);
78 fd_log_debug( " Command Id ......... : %u", ta_conf->cmd_id); 78 LOG_D( " Long AVP Id ........ : %u", ta_conf->long_avp_id);
79 fd_log_debug( " AVP Id ............. : %u", ta_conf->avp_id); 79 LOG_D( " Long AVP len ....... : %zu", ta_conf->long_avp_len);
80 fd_log_debug( " Long AVP Id ........ : %u", ta_conf->long_avp_id); 80 LOG_D( " Mode ............... : %s%s%s%s",
81 fd_log_debug( " Long AVP len ....... : %zu", ta_conf->long_avp_len); 81 ta_conf->mode & MODE_SERV ? "Serv" : "",
82 fd_log_debug( " Mode ............... : %s%s%s", ta_conf->mode & MODE_SERV ? "Serv" : "", ta_conf->mode & MODE_CLI ? "Cli" : "", ta_conf->mode & MODE_BENCH ? " (Benchmark)" : ""); 82 ta_conf->mode & MODE_CLI ? "Cli" : "",
83 fd_log_debug( " Destination Realm .. : %s", ta_conf->dest_realm ?: "- none -"); 83 ta_conf->mode & MODE_BENCH ? " (Benchmark)" : "",
84 fd_log_debug( " Destination Host ... : %s", ta_conf->dest_host ?: "- none -"); 84 ta_conf->mode & MODE_MIXSIZE ? " (Mix)" : ""
85 fd_log_debug( " Signal ............. : %i", ta_conf->signal); 85 );
86 fd_log_debug( "------- /app_test configuration dump ---------"); 86 LOG_D( " Destination Realm .. : %s", ta_conf->dest_realm ?: "- none -");
87 LOG_D( " Destination Host ... : %s", ta_conf->dest_host ?: "- none -");
88 LOG_D( " Signal ............. : %i", ta_conf->signal);
89 LOG_D( "------- /app_test configuration dump ---------");
87 } 90 }
88 91
89 /* Function to display statistics periodically */ 92 /* Function to display statistics periodically */
90 static void * ta_stats(void * arg) { 93 static void * ta_stats(void * arg) {
91 94
165 /* Parse configuration file */ 168 /* Parse configuration file */
166 if (conffile != NULL) { 169 if (conffile != NULL) {
167 CHECK_FCT( ta_conf_handle(conffile) ); 170 CHECK_FCT( ta_conf_handle(conffile) );
168 } 171 }
169 172
170 TRACE_DEBUG(INFO, "Extension Test_App initialized with configuration: '%s'", conffile); 173 if ((ta_conf->mode & MODE_MIXSIZE) && (!ta_conf->long_avp_id))
174 ta_conf->long_avp_id = 0xfffffe;
175
176 LOG_N("Extension test_app initialized with configuration: '%s'", conffile);
171 ta_conf_dump(); 177 ta_conf_dump();
172 178
173 /* Install objects definitions for this test application */ 179 /* Install objects definitions for this test application */
174 CHECK_FCT( ta_dict_init() ); 180 CHECK_FCT( ta_dict_init() );
175 181
"Welcome to our mercurial repository"