#include "rand/fastrand.h" /* seed */
#include "stats.h"
+#include "cfg/cfg_struct.h"
#ifdef DEBUG_DMALLOC
#include <dmalloc.h>
#ifdef USE_DST_BLACKLIST
destroy_dst_blacklist();
#endif
+ cfg_destroy();
#ifdef USE_TCP
destroy_tcp();
#endif
if (real_time&4)
set_rt_prio(rt_prio, rt_policy);
+
+ if (cfg_init() < 0) {
+ LOG(L_CRIT, "could not initialize configuration framework\n");
+ goto error;
+ }
+
if (init_modules() != 0) {
fprintf(stderr, "ERROR: error while initializing modules\n");
goto error;
}
+
+ if (cfg_shmize() < 0) {
+ LOG(L_CRIT, "could not initialize shared configuration\n");
+ goto error;
+ }
+
/* initialize process_table, add core process no. (calc_proc_no()) to the
* processes registered from the modules*/
if (init_pt(calc_proc_no())==-1)
#include "tcp_info.h"
#include "tcp_options.h"
#include "ut.h"
+#include "cfg/cfg_struct.h"
#define local_malloc pkg_malloc
#define local_free pkg_free
inline static int handle_io(struct fd_map* fm, short ev, int idx)
{
int ret;
+
+ /* update the local config */
+ cfg_update();
switch(fm->type){
case F_SOCKINFO:
goto error;
}
}
-
+
+
+ /* initialize the cfg framework */
+ if (cfg_child_init()) goto error;
+
/* main loop */
switch(io_h.poll_method){
case POLL_POLL:
#include "local_timer.h"
#include "ut.h"
#include "pt.h"
+#include "cfg/cfg_struct.h"
#ifdef CORE_TLS
#include "tls/tls_server.h"
#else
long resp;
ticks_t t;
+ /* update the local config */
+ cfg_update();
+
switch(fm->type){
case F_TCPMAIN:
again:
" to the fd list\n");
goto error;
}
+
+ /* initialize the config framework */
+ if (cfg_child_init()) goto error;
+
/* main loop */
switch(io_w.poll_method){
case POLL_POLL:
#endif
#include "locking.h"
#include "sched_yield.h"
+#include "cfg/cfg_struct.h"
/* how often will the timer handler be called (in ticks) */
sigaddset(&slow_timer_sset, SIGCHLD);
sigaddset(&slow_timer_sset, SIGALRM);
#endif
+ /* initialize the config framework */
+ if (cfg_child_init()) goto error;
+
return 0;
error:
return -1;
strerror(errno), errno);
return -1;
}
+ /* initialize the config framework */
+ if (cfg_child_init()) return -1;
+
return 0;
}
in_timer=1; /* mark this process as the fast timer */
while(1){
if (run_timer){
+ /* update the local cfg if needed */
+ cfg_update();
+
timer_handler();
}
pause();
continue;
}
#endif
+ /* update the local cfg if needed */
+ cfg_update();
+
LOCK_SLOW_TIMER_LIST();
while(*s_idx!=*t_idx){
i= *s_idx%SLOW_LISTS_NO;
#include "receive.h"
#include "mem/mem.h"
#include "ip_addr.h"
+#include "cfg/cfg_struct.h"
#ifdef USE_STUN
#include "ser_stun.h"
ri.dst_ip=bind_address->address;
ri.proto=PROTO_UDP;
ri.proto_reserved1=ri.proto_reserved2=0;
+
+ /* initialize the config framework */
+ if (cfg_child_init()) goto error;
+
for(;;){
#ifdef DYN_BUF
buf=pkg_malloc(BUF_SIZE+1);
}
} else
#endif
+ /* update the local config */
+ cfg_update();
/* receive_msg must free buf too!*/
receive_msg(buf, len, &ri);