static char logbuffer[LOGBUFFER_SIZE];
va_list ap;
int p1 = 0,p2 = 0, i;
- struct tm now;
+ struct tm now, *tm_ptr;
struct timeval timeval;
/* test if event is consumed by any log handler */
/* calculate local time */
gettimeofday(&timeval, NULL);
- localtime_r ( (time_t *) &timeval.tv_sec, &now );
+
+ /* there is no localtime_r in win32 */
+ tm_ptr = localtime ( (time_t *) &timeval.tv_sec);
+ now = *tm_ptr;
/* generate log string (insert file/line in DEBUG mode) */
if (!no_header) {
return 0;
}
-void gettimeofday(struct timeval *TVal, void *TZone __attribute__((unused)))
+int gettimeofday(struct timeval *TVal, void *TZone __attribute__((unused)))
{
SYSTEMTIME SysTime;
FILETIME FileTime;
TVal->tv_sec = (unsigned int)(Ticks / 10000000);
TVal->tv_usec = (unsigned int)(Ticks % 10000000) / 10;
+ return 0;
}
long times(struct tms *Dummy __attribute__((unused)))
ifp->hello_gen_timer =
olsr_start_timer(iface->cnf->hello_params.emission_interval * MSEC_PER_SEC,
HELLO_JITTER, OLSR_TIMER_PERIODIC,
- olsr_cnf->lq_level == 0 ? &generate_hello : &olsr_output_lq_hello,
+ &olsr_output_lq_hello,
ifp, hello_gen_timer_cookie->ci_id);
ifp->tc_gen_timer =
olsr_start_timer(iface->cnf->tc_params.emission_interval * MSEC_PER_SEC,
TC_JITTER, OLSR_TIMER_PERIODIC,
- olsr_cnf->lq_level == 0 ? &generate_tc : &olsr_output_lq_tc,
+ &olsr_output_lq_tc,
ifp, tc_gen_timer_cookie->ci_id);
ifp->mid_gen_timer =
olsr_start_timer(iface->cnf->mid_params.emission_interval * MSEC_PER_SEC,
New->hello_gen_timer =
olsr_start_timer(IntConf->cnf->hello_params.emission_interval * MSEC_PER_SEC,
HELLO_JITTER, OLSR_TIMER_PERIODIC,
- olsr_cnf->lq_level == 0 ? &generate_hello : &olsr_output_lq_hello,
+ &olsr_output_lq_hello,
New, hello_gen_timer_cookie->ci_id);
New->tc_gen_timer =
olsr_start_timer(IntConf->cnf->tc_params.emission_interval * MSEC_PER_SEC,
TC_JITTER, OLSR_TIMER_PERIODIC,
- olsr_cnf->lq_level == 0 ? &generate_tc : &olsr_output_lq_tc,
+ &olsr_output_lq_tc,
New, tc_gen_timer_cookie->ci_id);
New->mid_gen_timer =
olsr_start_timer(IntConf->cnf->mid_params.emission_interval * MSEC_PER_SEC,
#include "net_os.h"
#include "net_olsr.h"
#include "ipcalc.h"
+#include "olsr_logging.h"
#if defined WINCE
#define WIDE_STRING(s) L##s
(char *)&On, sizeof (On)) < 0)
{
OLSR_ERROR(LOG_NETWORKING, "Cannot set socket for OLSR PDUs to broadcast mode (%s)\n", strerror(errno));
- CLOSESOCKET(sock);
+ CLOSESOCKET(Sock);
olsr_exit(EXIT_FAILURE);
}