From (spam-protected) Tue May 1 22:13:53 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Tue, 01 May 2007 20:13:53 +0000 Subject: [Olsr-cvs] olsrd-current/src/bsd net.c,1.34,1.35 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src/bsd In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11267/src/bsd Modified Files: net.c Log Message: * fixes for OpenBSD according to the mail from Patrick McCarty on Mon, 30 Apr 2007 09:26:37 -0700 Index: net.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/bsd/net.c,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** net.c 28 Apr 2007 19:51:16 -0000 1.34 --- net.c 1 May 2007 20:13:50 -0000 1.35 *************** *** 59,62 **** --- 59,64 ---- #include #include + #include /* For struct in6_ifreq */ + #include #include #endif *************** *** 99,103 **** { int old; ! #if __MacOSX__ size_t len = sizeof (old); #else --- 101,105 ---- { int old; ! #if __MacOSX__ || __OpenBSD__ size_t len = sizeof (old); #else From (spam-protected) Tue May 1 23:36:52 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Tue, 01 May 2007 21:36:52 +0000 Subject: [Olsr-cvs] olsrd-current gcc-warnings, NONE, 1.1 Makefile, 1.83, 1.84 Makefile.inc, 1.12, 1.13 Message-ID: Update of /cvsroot/olsrd/olsrd-current In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv13773 Modified Files: Makefile Makefile.inc Added Files: gcc-warnings Log Message: Makefile tweaking: - gcc accepts different warnings on different versions. In an ideal world gcc could compare numbers to check for versions. Since make doesn't do this, we have now a shell scripts which kills not understand warnings. - gather the -W options for CFLAGS in the WARNINGS variable so that we can pass them to the above script and on sub-makes. - and pass said WARNINGS variable actually down - if we have a default CC variable is is not empty, so the "?=" operator doesn't work that well. --- NEW FILE: gcc-warnings --- #!/bin/bash --norc # # We expect warning options for gcc as argumenst and return the ones which are accepted # by the given gcc. # # $Id: gcc-warnings,v 1.1 2007/05/01 21:36:50 bernd67 Exp $ set -ue #set -vx OPTS="" for param; do case "$param" in -W?*) OPTS="$OPTS $param";; *) echo "Ignoring $param" >&2 esac done while read error; do case "$error" in *error:\ unrecognized\ option*) opt="${error#*\`}" opt="${opt%\'*}" OPTS="${OPTS//$opt/}" ;; esac done < <(cat <&1 >/dev/null int main(void) { return 0; } EOF) echo $OPTS exit 0 Index: Makefile =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/Makefile,v retrieving revision 1.83 retrieving revision 1.84 diff -C2 -d -r1.83 -r1.84 *** Makefile 22 Apr 2007 21:33:33 -0000 1.83 --- Makefile 1 May 2007 21:36:50 -0000 1.84 *************** *** 45,49 **** CFLAGS += -DVERSION=\"$(VERS)\" ! MAKECMD = $(MAKE) OS=$(OS) LIBS += $(OS_LIB_DYNLOAD) --- 45,49 ---- CFLAGS += -DVERSION=\"$(VERS)\" ! MAKECMD = $(MAKE) OS="$(OS)" WARNINGS="$(WARNINGS)" LIBS += $(OS_LIB_DYNLOAD) Index: Makefile.inc =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/Makefile.inc,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Makefile.inc 27 Apr 2007 11:45:31 -0000 1.12 --- Makefile.inc 1 May 2007 21:36:50 -0000 1.13 *************** *** 1,5 **** --- 1,9 ---- # programs CCACHE ?= $(shell sh -c "type -path ccache") + ifeq ($(origin CC),default) + CC = $(CCACHE) gcc + else CC ?= $(CCACHE) gcc + endif STRIP ?= strip BISON ?= bison *************** *** 19,50 **** INCLUDES = -Isrc -I$(TOPDIR)/src - GCC_VERSION := $(shell v=$$($(CC) -dumpversion); echo $${v//./ }) - # add gcc warnings and optimizations if CFLAGS not set ifndef CFLAGS ! CFLAGS += -Wall # gcc-3.3.5 on Debian sarge doesn't know the following warnings ! ifneq ("$(GCC_VERSION)","3 3 5") ! CFLAGS += -Wextra ! CFLAGS += -Wold-style-definition ! CFLAGS += -Wdeclaration-after-statement endif ! CFLAGS += -Wmissing-prototypes ! CFLAGS += -Wstrict-prototypes ! CFLAGS += -Wmissing-declarations ! CFLAGS += -Wsign-compare ! CFLAGS += -Waggregate-return ! CFLAGS += -Wmissing-noreturn ! CFLAGS += -Wmissing-format-attribute ! CFLAGS += -Wno-multichar ! CFLAGS += -Wno-deprecated-declarations ! #CFLAGS += -Wredundant-decls ! CFLAGS += -Wnested-externs ! #CFLAGS += -Wunreachable-code ! CFLAGS += -Winline ! CFLAGS += -Wdisabled-optimization CFLAGS += -O2 CFLAGS += -g - #CFLAGS += -Werror endif --- 23,54 ---- INCLUDES = -Isrc -I$(TOPDIR)/src # add gcc warnings and optimizations if CFLAGS not set ifndef CFLAGS ! ifndef WARNINGS ! WARNINGS += -Wall # gcc-3.3.5 on Debian sarge doesn't know the following warnings ! WARNINGS += -Wextra ! WARNINGS += -Wold-style-definition ! WARNINGS += -Wdeclaration-after-statement ! WARNINGS += -Wmissing-prototypes ! WARNINGS += -Wstrict-prototypes ! WARNINGS += -Wmissing-declarations ! WARNINGS += -Wsign-compare ! WARNINGS += -Waggregate-return ! WARNINGS += -Wmissing-noreturn ! WARNINGS += -Wmissing-format-attribute ! WARNINGS += -Wno-multichar ! WARNINGS += -Wno-deprecated-declarations ! #WARNINGS += -Wredundant-decls ! WARNINGS += -Wnested-externs ! #WARNINGS += -Wunreachable-code ! WARNINGS += -Winline ! WARNINGS += -Wdisabled-optimization ! WARNINGS += -Werror ! WARNINGS := $(shell CC="$(CC)" $(TOPDIR)/gcc-warnings $(WARNINGS)) endif ! CFLAGS += $(WARNINGS) CFLAGS += -O2 CFLAGS += -g endif From (spam-protected) Tue May 1 23:37:32 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Tue, 01 May 2007 21:37:32 +0000 Subject: [Olsr-cvs] olsrd-current Makefile.inc,1.13,1.14 Message-ID: Update of /cvsroot/olsrd/olsrd-current In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16162 Modified Files: Makefile.inc Log Message: * ooops, killed an outdated comment Index: Makefile.inc =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/Makefile.inc,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Makefile.inc 1 May 2007 21:36:50 -0000 1.13 --- Makefile.inc 1 May 2007 21:37:29 -0000 1.14 *************** *** 27,31 **** ifndef WARNINGS WARNINGS += -Wall - # gcc-3.3.5 on Debian sarge doesn't know the following warnings WARNINGS += -Wextra WARNINGS += -Wold-style-definition --- 27,30 ---- From (spam-protected) Tue May 1 23:50:43 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Tue, 01 May 2007 21:50:43 +0000 Subject: [Olsr-cvs] olsrd-current/src/win32 ifnet.c,1.36,1.37 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src/win32 In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23274/src/win32 Modified Files: ifnet.c Log Message: fixed a warning Index: ifnet.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/win32/ifnet.c,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** ifnet.c 25 Apr 2007 22:21:17 -0000 1.36 --- ifnet.c 1 May 2007 21:50:41 -0000 1.37 *************** *** 247,250 **** --- 247,251 ---- HMODULE Lib; struct MibIpInterfaceRow Row; + GETIPINTERFACEENTRY InterfaceEntry; if (olsr_cnf->ip_version == AF_INET6) *************** *** 313,318 **** } ! GETIPINTERFACEENTRY InterfaceEntry = ! (GETIPINTERFACEENTRY)GetProcAddress(Lib, "GetIpInterfaceEntry"); if (InterfaceEntry == NULL) --- 314,318 ---- } ! InterfaceEntry = (GETIPINTERFACEENTRY)GetProcAddress(Lib, "GetIpInterfaceEntry"); if (InterfaceEntry == NULL) From (spam-protected) Tue May 1 23:52:54 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Tue, 01 May 2007 21:52:54 +0000 Subject: [Olsr-cvs] olsrd-current Makefile.inc,1.14,1.15 Message-ID: Update of /cvsroot/olsrd/olsrd-current In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24138 Modified Files: Makefile.inc Log Message: commented out -Werror again Index: Makefile.inc =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/Makefile.inc,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Makefile.inc 1 May 2007 21:37:29 -0000 1.14 --- Makefile.inc 1 May 2007 21:52:52 -0000 1.15 *************** *** 44,48 **** WARNINGS += -Winline WARNINGS += -Wdisabled-optimization ! WARNINGS += -Werror WARNINGS := $(shell CC="$(CC)" $(TOPDIR)/gcc-warnings $(WARNINGS)) endif --- 44,48 ---- WARNINGS += -Winline WARNINGS += -Wdisabled-optimization ! #WARNINGS += -Werror WARNINGS := $(shell CC="$(CC)" $(TOPDIR)/gcc-warnings $(WARNINGS)) endif From (spam-protected) Wed May 2 09:41:23 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Wed, 02 May 2007 07:41:23 +0000 Subject: [Olsr-cvs] olsrd-current/src/bsd net.c, 1.35, 1.36 kernel_routes.c, 1.10, 1.11 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src/bsd In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv13893/bsd Modified Files: net.c kernel_routes.c Log Message: * patch from Patrick McCarty : OLSR_PRINTF() needs a ";" also in the BSD part Index: net.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/bsd/net.c,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** net.c 1 May 2007 20:13:50 -0000 1.35 --- net.c 2 May 2007 07:41:20 -0000 1.36 *************** *** 490,494 **** mcastreq.ipv6mr_interface = ifs->if_index; ! OLSR_PRINTF(3, "Interface %s joining multicast %s...", ifs->int_name, olsr_ip_to_string((union olsr_ip_addr *)&ifs->int6_multaddr.sin6_addr)) /* rfc 3493 */ --- 490,494 ---- mcastreq.ipv6mr_interface = ifs->if_index; ! OLSR_PRINTF(3, "Interface %s joining multicast %s...", ifs->int_name, olsr_ip_to_string((union olsr_ip_addr *)&ifs->int6_multaddr.sin6_addr)); /* rfc 3493 */ *************** *** 546,550 **** if (getifaddrs(&ifap) != 0) { ! OLSR_PRINTF(3, "get_ipv6_address: getifaddrs() failed.\n") return 0; } --- 546,550 ---- if (getifaddrs(&ifap) != 0) { ! OLSR_PRINTF(3, "get_ipv6_address: getifaddrs() failed.\n"); return 0; } Index: kernel_routes.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/bsd/kernel_routes.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** kernel_routes.c 25 Apr 2007 22:08:17 -0000 1.10 --- kernel_routes.c 2 May 2007 07:41:20 -0000 1.11 *************** *** 185,190 **** inet_ntop(AF_INET6, &dest->rt_router.v6, Str2, 40); ! OLSR_PRINTF(1, "%s IPv6 route to %s/%d via %s.\n", ! (add != 0) ? "Adding" : "Removing", Str1, dest->rt_mask.v6, Str2) memset(buff, 0, sizeof (buff)); --- 185,190 ---- inet_ntop(AF_INET6, &dest->rt_router.v6, Str2, 40); ! OLSR_PRINTF(1, "%s IPv6 route to %s/%d via %s.\n", ! (add != 0) ? "Adding" : "Removing", Str1, dest->rt_mask.v6, Str2); memset(buff, 0, sizeof (buff)); From (spam-protected) Wed May 2 10:06:33 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Wed, 02 May 2007 08:06:33 +0000 Subject: [Olsr-cvs] olsrd-current/src defs.h,1.59,1.60 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25178/src Modified Files: defs.h Log Message: * cosmetic Index: defs.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/defs.h,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** defs.h 28 Apr 2007 20:45:06 -0000 1.59 --- defs.h 2 May 2007 08:06:28 -0000 1.60 *************** *** 130,135 **** /* Timer data */ extern clock_t now_times; /* current idea of times(2) reported uptime */ ! extern struct timeval now; /* current idea of time */ ! extern struct tm *nowtm; /* current idea of time (in tm) */ /* --- 130,135 ---- /* Timer data */ extern clock_t now_times; /* current idea of times(2) reported uptime */ ! extern struct timeval now; /* current idea of time */ ! extern struct tm *nowtm; /* current idea of time (in tm) */ /* From (spam-protected) Wed May 2 10:07:13 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Wed, 02 May 2007 08:07:13 +0000 Subject: [Olsr-cvs] olsrd-current/src socket_parser.c,1.25,1.26 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25573/src Modified Files: socket_parser.c Log Message: * provide an argument to the tiems(2) call - OpenBSD seems to barf on a NULL there Index: socket_parser.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/socket_parser.c,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** socket_parser.c 25 Apr 2007 22:08:17 -0000 1.25 --- socket_parser.c 2 May 2007 08:07:11 -0000 1.26 *************** *** 162,165 **** --- 162,167 ---- int n; struct olsr_socket_entry *olsr_sockets; + /* Global buffer for times(2) calls. Do not remopve since at least OpenBSD needs it. */ + struct tms tms_buf; /* If there are no registered sockets we *************** *** 195,200 **** /* Update time since this is much used by the parsing functions */ ! gettimeofday(&now, NULL); ! now_times = times(NULL); for(olsr_sockets = olsr_socket_entries;olsr_sockets;olsr_sockets = olsr_sockets->next) --- 197,202 ---- /* Update time since this is much used by the parsing functions */ ! gettimeofday(&now, NULL); ! now_times = times(&tms_buf); for(olsr_sockets = olsr_socket_entries;olsr_sockets;olsr_sockets = olsr_sockets->next) From (spam-protected) Wed May 9 01:06:01 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Tue, 08 May 2007 23:06:01 +0000 Subject: [Olsr-cvs] olsrd-current/src/win32 compat.c,1.12,1.13 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src/win32 In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17941/src/win32 Modified Files: compat.c Log Message: *killed a few warnings Index: compat.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/win32/compat.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** compat.c 21 Mar 2005 02:17:36 -0000 1.12 --- compat.c 8 May 2007 23:05:58 -0000 1.13 *************** *** 101,105 **** } ! void gettimeofday(struct timeval *TVal, void *TZone) { SYSTEMTIME SysTime; --- 101,105 ---- } ! void gettimeofday(struct timeval *TVal, void *TZone __attribute__((unused))) { SYSTEMTIME SysTime; *************** *** 119,123 **** } ! long times(struct tms *Dummy) { return (long)GetTickCount(); --- 119,123 ---- } ! long times(struct tms *Dummy __attribute__((unused))) { return (long)GetTickCount(); *************** *** 166,170 **** // XXX - not thread-safe, which is okay for our purposes ! void *dlopen(char *Name, int Flags) { #if !defined WINCE --- 166,170 ---- // XXX - not thread-safe, which is okay for our purposes ! void *dlopen(char *Name, int Flags __attribute__((unused))) { #if !defined WINCE From (spam-protected) Wed May 9 01:10:39 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Tue, 08 May 2007 23:10:39 +0000 Subject: [Olsr-cvs] olsrd-current/src main.c,1.95,1.96 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19883/src Modified Files: main.c Log Message: *killed a few warnings Index: main.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/main.c,v retrieving revision 1.95 retrieving revision 1.96 diff -C2 -d -r1.95 -r1.96 *** main.c 25 Apr 2007 22:08:09 -0000 1.95 --- main.c 8 May 2007 23:10:37 -0000 1.96 *************** *** 63,67 **** #ifdef WIN32 #define close(x) closesocket(x) ! int __stdcall SignalHandler(unsigned long signal); void ListInterfaces(void); void DisableIcmpRedirects(void); --- 63,67 ---- #ifdef WIN32 #define close(x) closesocket(x) ! int __stdcall SignalHandler(unsigned long signal) __attribute__((noreturn)); void ListInterfaces(void); void DisableIcmpRedirects(void); *************** *** 106,109 **** --- 106,114 ---- struct tms tms_buf; + #ifdef WIN32 + WSADATA WsaData; + int len; + #endif + /* Stop the compiler from complaining */ (void)copyright_string; *************** *** 112,120 **** olsr_argv = argv; - #ifdef WIN32 - WSADATA WsaData; - int len; - #endif - setbuf(stdout, NULL); setbuf(stderr, NULL); --- 117,120 ---- From (spam-protected) Wed May 9 01:18:58 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Tue, 08 May 2007 23:18:58 +0000 Subject: [Olsr-cvs] olsrd-current/src/win32 compat.c,1.13,1.14 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src/win32 In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22936/src/win32 Modified Files: compat.c Log Message: *killed a few warnings Index: compat.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/win32/compat.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** compat.c 8 May 2007 23:05:58 -0000 1.13 --- compat.c 8 May 2007 23:18:55 -0000 1.14 *************** *** 364,368 **** } ! int inet_pton(int af, char *src, void *dst) { switch (af) --- 364,368 ---- } ! int inet_pton(int af, const char *src, void *dst) { switch (af) *************** *** 478,482 **** } ! char *inet_ntop(int af, void *src, char *dst, int size) { switch (af) --- 478,482 ---- } ! char *inet_ntop(int af, const void *src, char *dst, int size) { switch (af) From (spam-protected) Wed May 9 01:18:58 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Tue, 08 May 2007 23:18:58 +0000 Subject: [Olsr-cvs] olsrd-current/src/win32/arpa inet.h,1.6,1.7 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src/win32/arpa In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22936/src/win32/arpa Modified Files: inet.h Log Message: *killed a few warnings Index: inet.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/win32/arpa/inet.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** inet.h 21 Nov 2004 01:21:10 -0000 1.6 --- inet.h 8 May 2007 23:18:56 -0000 1.7 *************** *** 50,55 **** int inet_aton(char *cp, struct in_addr *addr); ! int inet_pton(int af, char *src, void *dst); ! char *inet_ntop(int af, void *src, char *dst, int size); #endif --- 50,55 ---- int inet_aton(char *cp, struct in_addr *addr); ! int inet_pton(int af, const char *src, void *dst); ! char *inet_ntop(int af, const void *src, char *dst, int size); #endif From (spam-protected) Wed May 9 01:34:54 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Tue, 08 May 2007 23:34:54 +0000 Subject: [Olsr-cvs] olsrd-current/src parser.c,1.34,1.35 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv29102/src Modified Files: parser.c Log Message: *killed a few warnings - Win32 needs to enter the 21st century with it's function prototypes Index: parser.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/parser.c,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** parser.c 25 Apr 2007 22:08:10 -0000 1.34 --- parser.c 8 May 2007 23:34:52 -0000 1.35 *************** *** 475,479 **** /* Extract size */ ! if((cc = recv(fd, &pcklen, 2, MSG_PEEK)) != 2) { if(cc <= 0) --- 475,479 ---- /* Extract size */ ! if((cc = recv(fd, (void *)&pcklen, 2, MSG_PEEK)) != 2) /* Win needs a cast */ { if(cc <= 0) From (spam-protected) Wed May 9 01:43:19 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Tue, 08 May 2007 23:43:19 +0000 Subject: [Olsr-cvs] olsrd-current/src socket_parser.c,1.26,1.27 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32546/src Modified Files: socket_parser.c Log Message: *killed a few warnings Index: socket_parser.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/socket_parser.c,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** socket_parser.c 2 May 2007 08:07:11 -0000 1.26 --- socket_parser.c 8 May 2007 23:43:17 -0000 1.27 *************** *** 61,67 **** static int hfd = 0; - static struct timeval tvp = {0, 0}; - static fd_set ibits; - /** * Add a socket and handler to the socketset --- 61,64 ---- *************** *** 164,167 **** --- 161,167 ---- /* Global buffer for times(2) calls. Do not remopve since at least OpenBSD needs it. */ struct tms tms_buf; + fd_set ibits; + struct timeval tvp = {0, 0}; + /* If there are no registered sockets we *************** *** 177,181 **** for(olsr_sockets = olsr_socket_entries; olsr_sockets; olsr_sockets = olsr_sockets->next) { ! FD_SET(olsr_sockets->fd, &ibits); } --- 177,181 ---- for(olsr_sockets = olsr_socket_entries; olsr_sockets; olsr_sockets = olsr_sockets->next) { ! FD_SET((unsigned int)olsr_sockets->fd, &ibits); /* And we cast here since we get a warning on Win32 */ } From (spam-protected) Wed May 9 01:49:02 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Tue, 08 May 2007 23:49:02 +0000 Subject: [Olsr-cvs] olsrd-current/lib/dyn_gw/src olsrd_dyn_gw.c,1.20,1.21 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/dyn_gw/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2062/lib/dyn_gw/src Modified Files: olsrd_dyn_gw.c Log Message: *killed a few warnings Index: olsrd_dyn_gw.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/dyn_gw/src/olsrd_dyn_gw.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** olsrd_dyn_gw.c 20 Apr 2007 14:06:18 -0000 1.20 --- olsrd_dyn_gw.c 8 May 2007 23:49:00 -0000 1.21 *************** *** 433,437 **** } ! int pthread_create(HANDLE *Hand, void *Attr, void *(*Func)(void *), void *Arg) { struct ThreadPara *Para; --- 433,437 ---- } ! int pthread_create(HANDLE *Hand, void *Attr __attribute__((unused)), void *(*Func)(void *), void *Arg) { struct ThreadPara *Para; *************** *** 454,458 **** } ! int pthread_kill(HANDLE Hand, int Sig) { if (!TerminateThread(Hand, 0)) --- 454,458 ---- } ! int pthread_kill(HANDLE Hand, int Sig __attribute__((unused))) { if (!TerminateThread(Hand, 0)) *************** *** 462,466 **** } ! int pthread_mutex_init(HANDLE *Hand, void *Attr) { *Hand = CreateMutex(NULL, FALSE, NULL); --- 462,466 ---- } ! int pthread_mutex_init(HANDLE *Hand, void *Attr __attribute__((unused))) { *Hand = CreateMutex(NULL, FALSE, NULL); From (spam-protected) Wed May 9 02:22:49 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Wed, 09 May 2007 00:22:49 +0000 Subject: [Olsr-cvs] olsrd-current/lib/httpinfo/src olsrd_httpinfo.c, 1.64, 1.65 olsrd_plugin.c, 1.15, 1.16 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/httpinfo/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15382/lib/httpinfo/src Modified Files: olsrd_httpinfo.c olsrd_plugin.c Log Message: * compiles now on win32 Index: olsrd_httpinfo.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/httpinfo/src/olsrd_httpinfo.c,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** olsrd_httpinfo.c 28 Apr 2007 20:51:05 -0000 1.64 --- olsrd_httpinfo.c 9 May 2007 00:22:47 -0000 1.65 *************** *** 50,54 **** --- 50,56 ---- #include #include + #ifndef WIN32 #include + #endif #include "olsr.h" *************** *** 727,731 **** char maskbuf[32]; char *maskstr; ! const struct hostent * const hp = resolve_ip_addresses ? gethostbyaddr(ipaddr, olsr_cnf->ipsize, olsr_cnf->ip_version) : NULL; if (mask != NULL) { if (olsr_cnf->ip_version == AF_INET) { --- 729,738 ---- char maskbuf[32]; char *maskstr; ! const struct hostent * const hp = ! #ifndef WIN32 ! resolve_ip_addresses ? gethostbyaddr(ipaddr, olsr_cnf->ipsize, olsr_cnf->ip_version) : ! #else ! NULL; ! #endif if (mask != NULL) { if (olsr_cnf->ip_version == AF_INET) { Index: olsrd_plugin.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/httpinfo/src/olsrd_plugin.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** olsrd_plugin.c 20 Apr 2007 14:06:18 -0000 1.15 --- olsrd_plugin.c 9 May 2007 00:22:47 -0000 1.16 *************** *** 51,55 **** --- 51,57 ---- #include #include + #ifndef WIN32 #include + #endif #include "olsrd_httpinfo.h" From (spam-protected) Wed May 9 02:30:06 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Wed, 09 May 2007 00:30:06 +0000 Subject: [Olsr-cvs] olsrd-current/src/win32 compat.c, 1.14, 1.15 unistd.h, 1.5, 1.6 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src/win32 In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18093/src/win32 Modified Files: compat.c unistd.h Log Message: * added a simulate write() syscall which uses send() to work on sockets Index: unistd.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/win32/unistd.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** unistd.h 21 Nov 2004 01:21:10 -0000 1.5 --- unistd.h 9 May 2007 00:30:04 -0000 1.6 *************** *** 42,45 **** --- 42,47 ---- #if !defined TL_UNISTD_H_INCLUDED + #include + #define TL_UNISTD_H_INCLUDED *************** *** 53,60 **** int getpid(void); ! #define IPTOS_TOS(x) (x & 0x1e) ! #define IPTOS_PREC(x) (x & 0xe0) int isatty(int fd); #endif --- 55,65 ---- int getpid(void); ! #define IPTOS_TOS(x) ((x) & 0x1e) ! #define IPTOS_PREC(x) ((x) & 0xe0) int isatty(int fd); + typedef long ssize_t; + ssize_t write(int fd, const void *buf, size_t count); + #endif Index: compat.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/win32/compat.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** compat.c 8 May 2007 23:18:55 -0000 1.14 --- compat.c 9 May 2007 00:30:04 -0000 1.15 *************** *** 523,524 **** --- 523,540 ---- #endif } + + #define CHUNK_SIZE 512 + + /* and we emulate a real write(2) syscall using send() */ + ssize_t write(int fd, const void *buf, size_t count) + { + size_t written = 0; + while (written < count) { + ssize_t rc = send(fd, buf+written, min(count-written, CHUNK_SIZE), 0); + if (rc <= 0) { + break; + } + written += rc; + } + return written; + } From (spam-protected) Wed May 9 19:29:55 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Wed, 09 May 2007 17:29:55 +0000 Subject: [Olsr-cvs] olsrd-current/lib/secure/src olsrd_secure.c,1.23,1.24 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/secure/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6175/lib/secure/src Modified Files: olsrd_secure.c Log Message: made it compile without warnings on Win32 Index: olsrd_secure.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/secure/src/olsrd_secure.c,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** olsrd_secure.c 25 Apr 2007 22:08:07 -0000 1.23 --- olsrd_secure.c 9 May 2007 17:29:53 -0000 1.24 *************** *** 753,757 **** } ! olsr_printf(3, "[ENC]Challenge: 0x%x\n", ntohl(msg->challenge)); /* Check signature */ --- 753,757 ---- } ! olsr_printf(3, "[ENC]Challenge: 0x%lx\n", ntohl(msg->challenge)); /* Check signature */ *************** *** 980,984 **** } ! olsr_printf(3, "[ENC]Challenge: 0x%x\n", ntohl(msg->challenge)); /* Check signature */ --- 980,984 ---- } ! olsr_printf(3, "[ENC]Challenge: 0x%lx\n", ntohl(msg->challenge)); /* Check signature */ From (spam-protected) Wed May 9 19:29:55 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Wed, 09 May 2007 17:29:55 +0000 Subject: [Olsr-cvs] olsrd-current/lib/txtinfo/src olsrd_txtinfo.c,1.5,1.6 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/txtinfo/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6175/lib/txtinfo/src Modified Files: olsrd_txtinfo.c Log Message: made it compile without warnings on Win32 Index: olsrd_txtinfo.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/txtinfo/src/olsrd_txtinfo.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** olsrd_txtinfo.c 28 Apr 2007 19:58:49 -0000 1.5 --- olsrd_txtinfo.c 9 May 2007 17:29:53 -0000 1.6 *************** *** 263,270 **** /* purge read buffer to prevent blocking on linux*/ FD_ZERO(&rfds); ! FD_SET(ipc_connection, &rfds); if(select(ipc_connection+1, &rfds, NULL, NULL, &tv)) { char requ[128]; ! ssize_t s = recv(ipc_connection, &requ, sizeof(requ), 0); if (0 < s) { requ[s] = 0; --- 263,270 ---- /* purge read buffer to prevent blocking on linux*/ FD_ZERO(&rfds); ! FD_SET((unsigned int)ipc_connection, &rfds); /* Win32 needs the cast here */ if(select(ipc_connection+1, &rfds, NULL, NULL, &tv)) { char requ[128]; ! ssize_t s = recv(ipc_connection, (void*)&requ, sizeof(requ), 0); /* Win32 needs the cast here */ if (0 < s) { requ[s] = 0; From (spam-protected) Wed May 9 19:30:44 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Wed, 09 May 2007 17:30:44 +0000 Subject: [Olsr-cvs] olsrd-current/lib/nameservice Makefile,1.10,1.11 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/nameservice In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6630/lib/nameservice Modified Files: Makefile Log Message: this plugin uses regexps. Does Win32 hassomething similar? Index: Makefile =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/nameservice/Makefile,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Makefile 25 May 2005 13:50:22 -0000 1.10 --- Makefile 9 May 2007 17:30:42 -0000 1.11 *************** *** 45,48 **** --- 45,52 ---- include $(TOPDIR)/Makefile.inc + ifeq ($(OS),win32) + default_target install clean: + @echo "**** We use the regex library here. Does Win32 has something like this?" + else default_target: $(PLUGIN_FULLNAME) *************** *** 56,57 **** --- 60,62 ---- clean: rm -f $(OBJS) $(SRCS:%.c=%.d) $(PLUGIN_FULLNAME) + endif \ No newline at end of file From (spam-protected) Wed May 9 19:37:11 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Wed, 09 May 2007 17:37:11 +0000 Subject: [Olsr-cvs] olsrd-current/lib/httpinfo/src olsrd_httpinfo.c, 1.65, 1.66 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/httpinfo/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9377/lib/httpinfo/src Modified Files: olsrd_httpinfo.c Log Message: * oops, fixed compile breakage Index: olsrd_httpinfo.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/httpinfo/src/olsrd_httpinfo.c,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** olsrd_httpinfo.c 9 May 2007 00:22:47 -0000 1.65 --- olsrd_httpinfo.c 9 May 2007 17:37:09 -0000 1.66 *************** *** 732,738 **** #ifndef WIN32 resolve_ip_addresses ? gethostbyaddr(ipaddr, olsr_cnf->ipsize, olsr_cnf->ip_version) : - #else - NULL; #endif if (mask != NULL) { if (olsr_cnf->ip_version == AF_INET) { --- 732,737 ---- #ifndef WIN32 resolve_ip_addresses ? gethostbyaddr(ipaddr, olsr_cnf->ipsize, olsr_cnf->ip_version) : #endif + NULL; if (mask != NULL) { if (olsr_cnf->ip_version == AF_INET) { From (spam-protected) Wed May 9 19:41:20 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Wed, 09 May 2007 17:41:20 +0000 Subject: [Olsr-cvs] olsrd-current/lib/secure/src olsrd_secure.c,1.24,1.25 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/secure/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11221/lib/secure/src Modified Files: olsrd_secure.c Log Message: ntohl() returns "unsigned long" on win32 Index: olsrd_secure.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/secure/src/olsrd_secure.c,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** olsrd_secure.c 9 May 2007 17:29:53 -0000 1.24 --- olsrd_secure.c 9 May 2007 17:41:17 -0000 1.25 *************** *** 753,757 **** } ! olsr_printf(3, "[ENC]Challenge: 0x%lx\n", ntohl(msg->challenge)); /* Check signature */ --- 753,757 ---- } ! olsr_printf(3, "[ENC]Challenge: 0x%lx\n", (unsigned long)ntohl(msg->challenge)); /* ntohl() returns a unsignedlong onwin32 */ /* Check signature */ *************** *** 980,984 **** } ! olsr_printf(3, "[ENC]Challenge: 0x%lx\n", ntohl(msg->challenge)); /* Check signature */ --- 980,984 ---- } ! olsr_printf(3, "[ENC]Challenge: 0x%lx\n", (unsigned long)ntohl(msg->challenge)); /* ntohl() returns a unsignedlong onwin32 */ /* Check signature */ From (spam-protected) Sun May 13 23:50:02 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 13 May 2007 21:50:02 +0000 Subject: [Olsr-cvs] olsrd-current/src/cfgparser oparse.y, 1.32, 1.33 oscan.lex, 1.22, 1.23 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src/cfgparser In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26663/src/cfgparser Modified Files: oparse.y oscan.lex Log Message: * made a local function static * removed unused TOK_SEMI and TOK_PLNAME. Thanks to Patrick McCarty for spotting this. Index: oscan.lex =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/cfgparser/oscan.lex,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** oscan.lex 20 Apr 2007 13:46:05 -0000 1.22 --- oscan.lex 13 May 2007 21:49:59 -0000 1.23 *************** *** 71,78 **** int yylex(void); ! struct conf_token * get_conf_token(void); ! struct conf_token * get_conf_token(void) { --- 71,78 ---- int yylex(void); ! static struct conf_token * get_conf_token(void); ! static struct conf_token * get_conf_token(void) { *************** *** 135,143 **** } - \; { - yylval = NULL; - return TOK_SEMI; - } - \"[^\"]*\" { yylval = get_conf_token(); --- 135,138 ---- *************** *** 297,305 **** } - "PlName" { - yylval = NULL; - return TOK_PLNAME; - } - "PlParam" { yylval = NULL; --- 292,295 ---- Index: oparse.y =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/cfgparser/oparse.y,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** oparse.y 20 Apr 2007 13:46:05 -0000 1.32 --- oparse.y 13 May 2007 21:49:59 -0000 1.33 *************** *** 128,132 **** %token TOK_OPEN %token TOK_CLOSE - %token TOK_SEMI %token TOK_STRING --- 128,131 ---- *************** *** 161,165 **** %token TOK_LQ_MULT %token TOK_CLEAR_SCREEN - %token TOK_PLNAME %token TOK_PLPARAM --- 160,163 ---- From (spam-protected) Mon May 14 00:03:01 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 13 May 2007 22:03:01 +0000 Subject: [Olsr-cvs] olsrd-current/src/cfgparser Makefile,1.25,1.26 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src/cfgparser In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32197/src/cfgparser Modified Files: Makefile Log Message: * more fixups for the generated .c file Index: Makefile =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/cfgparser/Makefile,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** Makefile 27 Apr 2007 11:32:27 -0000 1.25 --- Makefile 13 May 2007 22:02:57 -0000 1.26 *************** *** 94,97 **** --- 94,98 ---- sed -e '/^static/s/yy_get_next_buffer[\(][\)]/yy_get_next_buffer(void)/' \ -e '/^static/s/yy_get_previous_state[\(][\)]/yy_get_previous_state(void)/' \ + -e '/^static/s/yygrowstack[\(][\)]/yygrowstack(void)/' \ -e '/^static/s/input[\(][\)]/input(void)/' \ -e '/^static *void *yy_fatal_error/s/^\(.*)\);$$/\1 __attribute__((noreturn));/' \ From (spam-protected) Mon May 14 00:23:57 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 13 May 2007 22:23:57 +0000 Subject: [Olsr-cvs] olsrd-current/src/cfgparser olsrd_conf.c,1.53,1.54 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src/cfgparser In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv7539/src/cfgparser Modified Files: olsrd_conf.c Log Message: * killed if_nr in struct interface and index in struct olsr_if. Kudos to J�rg Pommnitz for spotting this leftovers and a patch for the Unix part. Index: olsrd_conf.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/cfgparser/olsrd_conf.c,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** olsrd_conf.c 28 Apr 2007 20:46:32 -0000 1.53 --- olsrd_conf.c 13 May 2007 22:23:55 -0000 1.54 *************** *** 158,162 **** { /* set various stuff */ - in->index = cnf->ifcnt++; in->configured = OLSR_FALSE; in->interf = NULL; --- 158,161 ---- From (spam-protected) Mon May 14 00:23:57 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 13 May 2007 22:23:57 +0000 Subject: [Olsr-cvs] olsrd-current/src/win32 ifnet.c,1.37,1.38 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src/win32 In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv7539/src/win32 Modified Files: ifnet.c Log Message: * killed if_nr in struct interface and index in struct olsr_if. Kudos to J�rg Pommnitz for spotting this leftovers and a patch for the Unix part. Index: ifnet.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/win32/ifnet.c,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** ifnet.c 1 May 2007 21:50:41 -0000 1.37 --- ifnet.c 13 May 2007 22:23:55 -0000 1.38 *************** *** 114,118 **** void WinSockPError(char *); char *StrError(unsigned int ErrNo); - int inet_pton(int af, const char *src, void *dst); void ListInterfaces(void); --- 114,117 ---- *************** *** 626,631 **** OLSR_PRINTF(1, " Address:%s\n", olsr_ip_to_string(&iface->hemu_ip)); - OLSR_PRINTF(1, " Index:%d\n", iface->index); - OLSR_PRINTF(1, " NB! This is a emulated interface\n that does not exist in the kernel!\n"); --- 625,628 ---- *************** *** 640,646 **** } - /* setting the interfaces number*/ - ifp->if_nr = iface->index; - ifp->int_mtu = OLSR_DEFAULT_MTU; --- 637,640 ---- *************** *** 984,989 **** strcpy(New->int_name, IntConf->name); - New->if_nr = IntConf->index; - IsWlan = IsWireless(IntConf->name); --- 978,981 ---- *************** *** 1004,1008 **** OLSR_PRINTF(1, "\tInterface %s set up for use with index %d\n\n", ! IntConf->name, New->if_nr); OLSR_PRINTF(1, "\tMTU: %d\n", New->int_mtu); --- 996,1000 ---- OLSR_PRINTF(1, "\tInterface %s set up for use with index %d\n\n", ! IntConf->name, New->if_index); OLSR_PRINTF(1, "\tMTU: %d\n", New->int_mtu); From (spam-protected) Mon May 14 00:23:57 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 13 May 2007 22:23:57 +0000 Subject: [Olsr-cvs] olsrd-current/src/unix ifnet.c,1.48,1.49 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src/unix In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv7539/src/unix Modified Files: ifnet.c Log Message: * killed if_nr in struct interface and index in struct olsr_if. Kudos to J�rg Pommnitz for spotting this leftovers and a patch for the Unix part. Index: ifnet.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/unix/ifnet.c,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** ifnet.c 25 Apr 2007 22:08:18 -0000 1.48 --- ifnet.c 13 May 2007 22:23:55 -0000 1.49 *************** *** 551,556 **** OLSR_PRINTF(1, " Address:%s\n", olsr_ip_to_string(&iface->hemu_ip)); - OLSR_PRINTF(1, " Index:%d\n", iface->index); - OLSR_PRINTF(1, " NB! This is a emulated interface\n that does not exist in the kernel!\n"); --- 551,554 ---- *************** *** 566,572 **** } - /* setting the interfaces number*/ - ifp->if_nr = iface->index; - ifp->int_mtu = OLSR_DEFAULT_MTU; --- 564,567 ---- *************** *** 888,895 **** OLSR_PRINTF(1, "\tMetric: %d\n", ifs.int_metric); - /* setting the interfaces number*/ - ifs.if_nr = iface->index; - - /* Get MTU */ if (ioctl(olsr_cnf->ioctl_s, SIOCGIFMTU, &ifr) < 0) --- 883,886 ---- *************** *** 908,912 **** olsr_syslog(OLSR_LOG_INFO, "Adding interface %s\n", iface->name); ! OLSR_PRINTF(1, "\tIndex %d\n", ifs.if_nr); if(olsr_cnf->ip_version == AF_INET) --- 899,903 ---- olsr_syslog(OLSR_LOG_INFO, "Adding interface %s\n", iface->name); ! OLSR_PRINTF(1, "\tIndex %d\n", ifs.if_index); if(olsr_cnf->ip_version == AF_INET) From (spam-protected) Mon May 14 00:23:57 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 13 May 2007 22:23:57 +0000 Subject: [Olsr-cvs] olsrd-current/src interfaces.c, 1.31, 1.32 interfaces.h, 1.39, 1.40 net_olsr.c, 1.22, 1.23 olsr_cfg.h, 1.30, 1.31 process_routes.c, 1.32, 1.33 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv7539/src Modified Files: interfaces.c interfaces.h net_olsr.c olsr_cfg.h process_routes.c Log Message: * killed if_nr in struct interface and index in struct olsr_if. Kudos to J�rg Pommnitz for spotting this leftovers and a patch for the Unix part. Index: olsr_cfg.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/olsr_cfg.h,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** olsr_cfg.h 17 Apr 2006 18:31:09 -0000 1.30 --- olsr_cfg.h 13 May 2007 22:23:55 -0000 1.31 *************** *** 133,137 **** char *name; char *config; - int index; olsr_bool configured; olsr_bool host_emul; --- 133,136 ---- *************** *** 224,228 **** struct ipc_net *ipc_nets; struct olsr_if *interfaces; - olsr_u16_t ifcnt; /* Stuff set by olsrd */ --- 223,226 ---- Index: interfaces.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/interfaces.c,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** interfaces.c 25 Apr 2007 22:08:08 -0000 1.31 --- interfaces.c 13 May 2007 22:23:55 -0000 1.32 *************** *** 343,347 **** interf_n->interf = NULL; interf_n->configured = 0; - interf_n->index = olsr_cnf->ifcnt++; interf_n->host_emul = hemu ? OLSR_TRUE : OLSR_FALSE; --- 343,346 ---- Index: process_routes.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/process_routes.c,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** process_routes.c 25 Apr 2007 22:08:13 -0000 1.32 --- process_routes.c 13 May 2007 22:23:55 -0000 1.33 *************** *** 248,252 **** if (COMP_IP(&destination->rt_dst, &dst->rt_dst) && COMP_IP(&destination->rt_router, &dst->rt_router) && ! (destination->rt_if->if_nr == dst->rt_if->if_nr)) { if(destination->rt_metric == dst->rt_metric) --- 248,252 ---- if (COMP_IP(&destination->rt_dst, &dst->rt_dst) && COMP_IP(&destination->rt_router, &dst->rt_router) && ! (destination->rt_if->if_index == dst->rt_if->if_index)) { if(destination->rt_metric == dst->rt_metric) Index: interfaces.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/interfaces.h,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** interfaces.h 20 Apr 2007 13:46:04 -0000 1.39 --- interfaces.h 13 May 2007 22:23:55 -0000 1.40 *************** *** 142,146 **** char *int_name; /* from kernel if structure */ int if_index; /* Kernels index of this interface */ - int if_nr; /* This interfaces index internally*/ int is_wireless; /* wireless interface or not*/ olsr_u16_t olsr_seqnum; /* Olsr message seqno */ --- 142,145 ---- Index: net_olsr.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/net_olsr.c,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** net_olsr.c 25 Apr 2007 22:08:09 -0000 1.22 --- net_olsr.c 13 May 2007 22:23:55 -0000 1.23 *************** *** 459,463 **** perror("sendto(v6)"); olsr_syslog(OLSR_LOG_ERR, "OLSR: sendto IPv6 %m"); ! fprintf(stderr, "Socket: %d interface: %d\n", ifp->olsr_socket, ifp->if_nr); fprintf(stderr, "To: %s (size: %d)\n", ip6_to_string(&sin6->sin6_addr), (int)sizeof(*sin6)); fprintf(stderr, "Outputsize: %d\n", ifp->netbuf.pending); --- 459,463 ---- perror("sendto(v6)"); olsr_syslog(OLSR_LOG_ERR, "OLSR: sendto IPv6 %m"); ! fprintf(stderr, "Socket: %d interface: %d\n", ifp->olsr_socket, ifp->if_index); fprintf(stderr, "To: %s (size: %d)\n", ip6_to_string(&sin6->sin6_addr), (int)sizeof(*sin6)); fprintf(stderr, "Outputsize: %d\n", ifp->netbuf.pending); From (spam-protected) Mon May 14 01:44:26 2007 From: (spam-protected) (Thomas Lopatic) Date: Sun, 13 May 2007 23:44:26 +0000 Subject: [Olsr-cvs] olsrd-current Makefile.inc,1.15,1.16 Message-ID: Update of /cvsroot/olsrd/olsrd-current In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4885 Modified Files: Makefile.inc Log Message: (1) On Windows $(OS) is not undefined but contains "Windows_NT". Now handled in Makefile.inc instead of guess_os.sh. (2) Fixed re-definition of write() in Windows version of unistd.h. Index: Makefile.inc =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/Makefile.inc,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Makefile.inc 1 May 2007 21:52:52 -0000 1.15 --- Makefile.inc 13 May 2007 23:44:23 -0000 1.16 *************** *** 71,74 **** --- 71,77 ---- # OS detection + ifeq ($(OS),Windows_NT) + OS = win32 + endif ifeq ($(OS),) OS := $(shell sh $(TOPDIR)/make/guess_os.sh) From (spam-protected) Mon May 14 01:44:26 2007 From: (spam-protected) (Thomas Lopatic) Date: Sun, 13 May 2007 23:44:26 +0000 Subject: [Olsr-cvs] olsrd-current/src/win32 unistd.h,1.6,1.7 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src/win32 In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4885/src/win32 Modified Files: unistd.h Log Message: (1) On Windows $(OS) is not undefined but contains "Windows_NT". Now handled in Makefile.inc instead of guess_os.sh. (2) Fixed re-definition of write() in Windows version of unistd.h. Index: unistd.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/win32/unistd.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** unistd.h 9 May 2007 00:30:04 -0000 1.6 --- unistd.h 13 May 2007 23:44:24 -0000 1.7 *************** *** 60,65 **** int isatty(int fd); - typedef long ssize_t; - ssize_t write(int fd, const void *buf, size_t count); - #endif --- 60,62 ---- From (spam-protected) Mon May 14 01:44:26 2007 From: (spam-protected) (Thomas Lopatic) Date: Sun, 13 May 2007 23:44:26 +0000 Subject: [Olsr-cvs] olsrd-current/make guess_os.sh,1.3,1.4 Message-ID: Update of /cvsroot/olsrd/olsrd-current/make In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4885/make Modified Files: guess_os.sh Log Message: (1) On Windows $(OS) is not undefined but contains "Windows_NT". Now handled in Makefile.inc instead of guess_os.sh. (2) Fixed re-definition of write() in Windows version of unistd.h. Index: guess_os.sh =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/make/guess_os.sh,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** guess_os.sh 3 Apr 2007 10:09:31 -0000 1.3 --- guess_os.sh 13 May 2007 23:44:24 -0000 1.4 *************** *** 2,10 **** if test -n "$OS"; then - # cygwin exports the OS environment vaiable - fix it. - # otherwiese accept the user supplied OS - case "$OS" in - Windows*) OS=win32 ;; - esac echo $OS; exit; --- 2,5 ---- From (spam-protected) Thu May 17 13:25:29 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Thu, 17 May 2007 11:25:29 +0000 Subject: [Olsr-cvs] olsrd-current/lib/httpinfo/src olsrd_httpinfo.c, 1.66, 1.67 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/httpinfo/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24791/lib/httpinfo/src Modified Files: olsrd_httpinfo.c Log Message: * made the html buffer larger - this is only a short term work around * cleanup: use parentheres in macros * cleanup: use sizeof() Index: olsrd_httpinfo.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/httpinfo/src/olsrd_httpinfo.c,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -d -r1.66 -r1.67 *** olsrd_httpinfo.c 9 May 2007 17:37:09 -0000 1.66 --- olsrd_httpinfo.c 17 May 2007 11:25:27 -0000 1.67 *************** *** 90,98 **** #define MAX_CLIENTS 3 ! #define MAX_HTTPREQ_SIZE 1024 * 10 #define DEFAULT_TCP_PORT 1978 ! #define HTML_BUFSIZE 1024*75 #define FRAMEWIDTH 800 --- 90,98 ---- #define MAX_CLIENTS 3 ! #define MAX_HTTPREQ_SIZE (1024 * 10) #define DEFAULT_TCP_PORT 1978 ! #define HTML_BUFSIZE (1024 * 200) #define FRAMEWIDTH 800 *************** *** 413,417 **** //memcpy(body, dynamic_files[i].data, static_bin_files[i].data_size); ! size += dynamic_files[i].process_data_cb(req, param_size, &body[size], HTML_BUFSIZE-size); c = build_http_header(HTTP_OK, OLSR_TRUE, size, req, MAX_HTTPREQ_SIZE); goto send_http_data; --- 413,417 ---- //memcpy(body, dynamic_files[i].data, static_bin_files[i].data_size); ! size += dynamic_files[i].process_data_cb(req, param_size, &body[size], sizeof(body)-size); c = build_http_header(HTTP_OK, OLSR_TRUE, size, req, MAX_HTTPREQ_SIZE); goto send_http_data; From (spam-protected) Thu May 17 22:30:12 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Thu, 17 May 2007 20:30:12 +0000 Subject: [Olsr-cvs] olsrd-current/src/linux kernel_routes.c,1.22,1.23 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src/linux In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21065/src/linux Modified Files: kernel_routes.c Log Message: * avoid lots of superflous malloc() and free() Index: kernel_routes.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/linux/kernel_routes.c,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** kernel_routes.c 25 Apr 2007 22:08:17 -0000 1.22 --- kernel_routes.c 17 May 2007 20:30:09 -0000 1.23 *************** *** 66,77 **** struct rtentry kernel_route; int tmp; ! char dst_str[16], mask_str[16], router_str[16]; ! ! inet_ntop(AF_INET, &destination->rt_dst.v4, dst_str, 16); ! inet_ntop(AF_INET, &destination->rt_mask.v4, mask_str, 16); ! inet_ntop(AF_INET, &destination->rt_router.v4, router_str, 16); OLSR_PRINTF(1, "(ioctl)Adding route with metric %d to %s/%s via %s/%s.\n", ! destination->rt_metric, dst_str, mask_str, router_str, destination->rt_if->int_name); --- 66,76 ---- struct rtentry kernel_route; int tmp; ! char dst_str[INET_ADDRSTRLEN], mask_str[INET_ADDRSTRLEN], router_str[INET_ADDRSTRLEN]; OLSR_PRINTF(1, "(ioctl)Adding route with metric %d to %s/%s via %s/%s.\n", ! destination->rt_metric, ! inet_ntop(AF_INET, &destination->rt_dst.v4, dst_str, sizeof(dst_str)), ! inet_ntop(AF_INET, &destination->rt_mask.v4, mask_str, sizeof(mask_str)), ! inet_ntop(AF_INET, &destination->rt_router.v4, router_str, sizeof(router_str)), destination->rt_if->int_name); *************** *** 105,116 **** * Set interface */ ! if((kernel_route.rt_dev = malloc(strlen(destination->rt_if->int_name) + 1)) == 0) ! { ! fprintf(stderr, "Out of memory!\n%s\n", strerror(errno)); ! olsr_exit(__func__, EXIT_FAILURE); ! } ! ! strcpy(kernel_route.rt_dev, destination->rt_if->int_name); ! //printf("Inserting route entry on device %s\n\n", kernel_route.rt_dev); --- 104,108 ---- * Set interface */ ! kernel_route.rt_dev = destination->rt_if->int_name; //printf("Inserting route entry on device %s\n\n", kernel_route.rt_dev); *************** *** 141,151 **** } - - if (ifnet && kernel_route.rt_dev) - { - free(kernel_route.rt_dev); - } - - return tmp; } --- 133,136 ---- *************** *** 235,246 **** struct rtentry kernel_route; int tmp; ! char dst_str[16], mask_str[16], router_str[16]; ! ! inet_ntop(AF_INET, &destination->rt_dst.v4, dst_str, 16); ! inet_ntop(AF_INET, &destination->rt_mask.v4, mask_str, 16); ! inet_ntop(AF_INET, &destination->rt_router.v4, router_str, 16); OLSR_PRINTF(1, "(ioctl)Deleting route with metric %d to %s/%s via %s.\n", ! destination->rt_metric, dst_str, mask_str, router_str); memset(&kernel_route,0,sizeof(struct rtentry)); --- 220,230 ---- struct rtentry kernel_route; int tmp; ! char dst_str[INET_ADDRSTRLEN], mask_str[INET_ADDRSTRLEN], router_str[INET_ADDRSTRLEN]; OLSR_PRINTF(1, "(ioctl)Deleting route with metric %d to %s/%s via %s.\n", ! destination->rt_metric, ! inet_ntop(AF_INET, &destination->rt_dst.v4, dst_str, sizeof(dst_str)), ! inet_ntop(AF_INET, &destination->rt_mask.v4, mask_str, sizeof(mask_str)), ! inet_ntop(AF_INET, &destination->rt_router.v4, router_str, sizeof(router_str))); memset(&kernel_route,0,sizeof(struct rtentry)); *************** *** 375,379 **** ifr = ifc.ifc_req; cplim = buf + ifc.ifc_len; /*skip over if's with big ifr_addr's */ ! for (cp = buf; cp < cplim;cp += sizeof (ifr->ifr_name) + sizeof(ifr->ifr_addr)) { struct rtentry kernel_route; --- 359,363 ---- ifr = ifc.ifc_req; cplim = buf + ifc.ifc_len; /*skip over if's with big ifr_addr's */ ! for (cp = buf; cp < cplim; cp += sizeof (ifr->ifr_name) + sizeof(ifr->ifr_addr)) { struct rtentry kernel_route; *************** *** 407,417 **** ! if((kernel_route.rt_dev = malloc(6)) == 0) ! { ! fprintf(stderr, "Out of memory!\n%s\n", strerror(errno)); ! olsr_exit(__func__, EXIT_FAILURE); ! } ! ! strncpy(kernel_route.rt_dev, ifr->ifr_ifrn.ifrn_name, 6); --- 391,395 ---- ! kernel_route.rt_dev = ifr->ifr_ifrn.ifrn_name; *************** *** 422,433 **** else OLSR_PRINTF(1, "YES\n"); ! ! ! free(kernel_route.rt_dev); ! ! } ! close(s); - return 0; --- 400,405 ---- else OLSR_PRINTF(1, "YES\n"); ! } close(s); return 0; From (spam-protected) Thu May 17 22:35:18 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Thu, 17 May 2007 20:35:18 +0000 Subject: [Olsr-cvs] olsrd-current/src/cfgparser oscan.lex,1.23,1.24 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src/cfgparser In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23457/src/cfgparser Modified Files: oscan.lex Log Message: * cleaned it up and reduced the code size a little bit Index: oscan.lex =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/cfgparser/oscan.lex,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** oscan.lex 13 May 2007 21:49:59 -0000 1.23 --- oscan.lex 17 May 2007 20:35:16 -0000 1.24 *************** *** 56,60 **** #include "oparse.h" ! /* Prototypes */ int yyget_lineno(void); --- 56,60 ---- #include "oparse.h" ! /* Prototypes */ int yyget_lineno(void); *************** *** 71,95 **** int yylex(void); ! static struct conf_token * ! get_conf_token(void); ! static struct conf_token * ! get_conf_token(void) { ! struct conf_token *t = malloc(sizeof(struct conf_token)); ! ! if (t == NULL) ! { ! fprintf(stderr, "Cannot allocate %d bytes for an configuration token.\n", ! (int) sizeof (struct conf_token)); ! exit(EXIT_FAILURE); } ! memset(t, 0, sizeof(struct conf_token)); ! return t; } %} --- 71,131 ---- int yylex(void); ! static struct conf_token *get_conf_token(void); ! static struct conf_token *get_string_token(const char * const s, int const n); ! static struct conf_token *get_integer_token(const char * const s); ! static struct conf_token *get_floating_token(const char * const s); ! static struct conf_token *get_boolean_token(const olsr_bool b); ! static struct conf_token *get_conf_token(void) { ! struct conf_token *t = calloc(1, sizeof(struct conf_token)); ! if (t == NULL) { ! fprintf(stderr, "Cannot allocate %d bytes for an configuration token.\n", (int)sizeof(struct conf_token)); } + return t; + } ! static struct conf_token *get_string_token(const char * const s, int const n) ! { ! struct conf_token *rv = get_conf_token(); ! if (rv != NULL) { ! rv->string = malloc(n+1); ! if (rv->string == NULL) { ! fprintf(stderr, "Cannot allocate %d bytes for string token data.\n", n+1); ! free(rv); ! return NULL; ! } ! strncpy(rv->string, s, n); ! rv->string[n] = '\0'; ! } ! return rv; ! } ! static struct conf_token *get_integer_token(const char * const s) ! { ! struct conf_token *rv = get_conf_token(); ! if (rv != NULL) { ! rv->integer = strtol(s, NULL, 0); ! } ! return rv; } + static struct conf_token *get_floating_token(const char * const s) + { + struct conf_token *rv = get_conf_token(); + if (rv != NULL) { + rv->floating = strtod(s, NULL); + } + return rv; + } + static struct conf_token *get_boolean_token(const olsr_bool b) + { + struct conf_token *rv = get_conf_token(); + if (rv != NULL) { + rv->boolean = b; + } + return rv; + } %} *************** *** 120,452 **** \s*"#".*\n { ! ! current_line++; ! return TOK_COMMENT; } \{ { ! yylval = NULL; ! return TOK_OPEN; } \} { ! yylval = NULL; ! return TOK_CLOSE; } \"[^\"]*\" { ! yylval = get_conf_token(); ! ! yylval->string = malloc(yyleng - 1); ! ! if (yylval->string == NULL) ! { ! fprintf(stderr, ! "Cannot allocate %d bytes for string token data.\n", yyleng - 1); ! yyterminate(); ! } ! ! strncpy(yylval->string, yytext + 1, yyleng - 2); ! yylval->string[yyleng - 2] = 0; ! ! return TOK_STRING; } 0x{HEXDIGIT}+ { ! yylval = get_conf_token(); ! ! yylval->integer = strtol(yytext, NULL, 0); ! ! return TOK_INTEGER; } {FLOAT} { ! yylval = get_conf_token(); ! ! sscanf(yytext, "%f", &yylval->floating); ! return TOK_FLOAT; } {IPV4ADDR} { ! yylval = get_conf_token(); ! ! yylval->string = malloc(yyleng + 1); ! ! if (yylval->string == NULL) ! { ! fprintf(stderr, ! "Cannot allocate %d bytes for string token data.\n", yyleng + 1); ! yyterminate(); } ! ! strncpy(yylval->string, yytext, yyleng+1); ! ! return TOK_IP4_ADDR; } - - {IPV6ADDR} { ! ! yylval = get_conf_token(); ! ! yylval->string = malloc(yyleng+1); ! ! if (yylval->string == NULL) ! { ! fprintf(stderr, ! "Cannot allocate %d bytes for string token data.\n", yyleng + 1); ! yyterminate(); } ! ! strncpy(yylval->string, yytext, yyleng+1); ! ! return TOK_IP6_ADDR; } "default" { ! yylval = NULL; ! return TOK_DEFAULT; } {DECDIGIT}+ { ! ! yylval = get_conf_token(); ! ! yylval->integer = atoi(yytext); ! ! return TOK_INTEGER; ! } ! "yes"|"no" { ! yylval = get_conf_token(); ! ! if (strncmp(yytext, "yes", 3) == 0) ! yylval->boolean = OLSR_TRUE; ! ! else ! yylval->boolean = OLSR_FALSE; ! ! return TOK_BOOLEAN; } ! "site-local"|"global" { ! yylval = get_conf_token(); ! ! if (strncmp(yytext, "site-local", 10) == 0) ! yylval->boolean = OLSR_TRUE; ! ! else ! yylval->boolean = OLSR_FALSE; ! ! return TOK_IP6TYPE; } "Host" { ! yylval = NULL; ! return TOK_HOSTLABEL; } "Net" { ! yylval = NULL; ! return TOK_NETLABEL; } "MaxConnections" { ! yylval = NULL; ! return TOK_MAXIPC; } "DebugLevel" { ! yylval = NULL; ! return TOK_DEBUGLEVEL; } "IpVersion" { ! yylval = NULL; ! return TOK_IPVERSION; } "NicChgsPollInt" { ! yylval = NULL; ! return TOK_NICCHGSPOLLRT; } "Hna4" { ! yylval = NULL; ! return TOK_HNA4; } "Hna6" { ! yylval = NULL; ! return TOK_HNA6; } "LoadPlugin" { ! yylval = NULL; ! return TOK_PLUGIN; } "PlParam" { ! yylval = NULL; ! return TOK_PLPARAM; } "Interface" { ! yylval = NULL; ! return TOK_INTERFACE; } "AllowNoInt" { ! yylval = NULL; ! return TOK_NOINT; } "TosValue" { ! yylval = NULL; ! return TOK_TOS; } "Willingness" { ! yylval = NULL; ! return TOK_WILLINGNESS; } "IpcConnect" { ! yylval = NULL; ! return TOK_IPCCON; } "UseHysteresis" { ! yylval = NULL; ! return TOK_USEHYST; } "HystScaling" { ! yylval = NULL; ! return TOK_HYSTSCALE; } "HystThrHigh" { ! yylval = NULL; ! return TOK_HYSTUPPER; } "HystThrLow" { ! yylval = NULL; ! return TOK_HYSTLOWER; } "Pollrate" { ! yylval = NULL; ! return TOK_POLLRATE; } "TcRedundancy" { ! yylval = NULL; ! return TOK_TCREDUNDANCY; } "MprCoverage" { ! yylval = NULL; ! return TOK_MPRCOVERAGE; } "LinkQualityLevel" { ! yylval = NULL; ! return TOK_LQ_LEVEL; } "LinkQualityFishEye" { ! yylval = NULL; ! return TOK_LQ_FISH; } "LinkQualityDijkstraLimit" { ! yylval = NULL; ! return TOK_LQ_DLIMIT; } "LinkQualityWinSize" { ! yylval = NULL; ! return TOK_LQ_WSIZE; } "LinkQualityMult" { ! yylval = NULL; ! return TOK_LQ_MULT; } "ClearScreen" { ! yylval = NULL; ! return TOK_CLEAR_SCREEN; } "Weight" { ! yylval = NULL; ! return TOK_IFWEIGHT; } "Ip4Broadcast" { ! yylval = NULL; ! return TOK_IP4BROADCAST; } "Ip6AddrType" { ! yylval = NULL; ! return TOK_IP6ADDRTYPE; } "Ip6MulticastSite" { ! yylval = NULL; ! return TOK_IP6MULTISITE; } "Ip6MulticastGlobal" { ! yylval = NULL; ! return TOK_IP6MULTIGLOBAL; } "HelloInterval" { ! yylval = NULL; ! return TOK_HELLOINT; } "HelloValidityTime" { ! yylval = NULL; ! return TOK_HELLOVAL; } "TcInterval" { ! yylval = NULL; ! return TOK_TCINT; } "TcValidityTime" { ! yylval = NULL; ! return TOK_TCVAL; } "MidInterval" { ! yylval = NULL; ! return TOK_MIDINT; } "MidValidityTime" { ! yylval = NULL; ! return TOK_MIDVAL; } "HnaInterval" { ! yylval = NULL; ! return TOK_HNAINT; } "HnaValidityTime" { ! yylval = NULL; ! return TOK_HNAVAL; } "AutoDetectChanges" { ! yylval = NULL; ! return TOK_AUTODETCHG; } \n|\r\n { ! current_line++; } --- 156,440 ---- \s*"#".*\n { ! current_line++; ! return TOK_COMMENT; } \{ { ! yylval = NULL; ! return TOK_OPEN; } \} { ! yylval = NULL; ! return TOK_CLOSE; } \"[^\"]*\" { ! yylval = get_string_token(yytext + 1, yyleng - 2); ! if (yylval == NULL) { ! yyterminate(); ! } ! return TOK_STRING; } 0x{HEXDIGIT}+ { ! yylval = get_integer_token(yytext); ! return TOK_INTEGER; } {FLOAT} { ! yylval = get_floating_token(yytext); ! return TOK_FLOAT; } {IPV4ADDR} { ! yylval = get_string_token(yytext, yyleng + 1); ! if (yylval == NULL) { ! yyterminate(); } ! return TOK_IP4_ADDR; } {IPV6ADDR} { ! yylval = get_string_token(yytext, yyleng + 1); ! if (yylval == NULL) { ! yyterminate(); } ! return TOK_IP6_ADDR; } "default" { ! yylval = NULL; ! return TOK_DEFAULT; } {DECDIGIT}+ { ! yylval = get_integer_token(yytext); ! return TOK_INTEGER; } ! "yes" { ! yylval = get_boolean_token(OLSR_TRUE); ! return TOK_BOOLEAN; } + "no" { + yylval = get_boolean_token(OLSR_FALSE); + return TOK_BOOLEAN; + } + "site-local" { + yylval = get_boolean_token(OLSR_TRUE); + return TOK_IP6TYPE; + } ! "global" { ! yylval = get_boolean_token(OLSR_FALSE); ! return TOK_IP6TYPE; } "Host" { ! yylval = NULL; ! return TOK_HOSTLABEL; } "Net" { ! yylval = NULL; ! return TOK_NETLABEL; } "MaxConnections" { ! yylval = NULL; ! return TOK_MAXIPC; } "DebugLevel" { ! yylval = NULL; ! return TOK_DEBUGLEVEL; } "IpVersion" { ! yylval = NULL; ! return TOK_IPVERSION; } "NicChgsPollInt" { ! yylval = NULL; ! return TOK_NICCHGSPOLLRT; } "Hna4" { ! yylval = NULL; ! return TOK_HNA4; } "Hna6" { ! yylval = NULL; ! return TOK_HNA6; } "LoadPlugin" { ! yylval = NULL; ! return TOK_PLUGIN; } "PlParam" { ! yylval = NULL; ! return TOK_PLPARAM; } "Interface" { ! yylval = NULL; ! return TOK_INTERFACE; } "AllowNoInt" { ! yylval = NULL; ! return TOK_NOINT; } "TosValue" { ! yylval = NULL; ! return TOK_TOS; } "Willingness" { ! yylval = NULL; ! return TOK_WILLINGNESS; } "IpcConnect" { ! yylval = NULL; ! return TOK_IPCCON; } "UseHysteresis" { ! yylval = NULL; ! return TOK_USEHYST; } "HystScaling" { ! yylval = NULL; ! return TOK_HYSTSCALE; } "HystThrHigh" { ! yylval = NULL; ! return TOK_HYSTUPPER; } "HystThrLow" { ! yylval = NULL; ! return TOK_HYSTLOWER; } "Pollrate" { ! yylval = NULL; ! return TOK_POLLRATE; } "TcRedundancy" { ! yylval = NULL; ! return TOK_TCREDUNDANCY; } "MprCoverage" { ! yylval = NULL; ! return TOK_MPRCOVERAGE; } "LinkQualityLevel" { ! yylval = NULL; ! return TOK_LQ_LEVEL; } "LinkQualityFishEye" { ! yylval = NULL; ! return TOK_LQ_FISH; } "LinkQualityDijkstraLimit" { ! yylval = NULL; ! return TOK_LQ_DLIMIT; } "LinkQualityWinSize" { ! yylval = NULL; ! return TOK_LQ_WSIZE; } "LinkQualityMult" { ! yylval = NULL; ! return TOK_LQ_MULT; } "ClearScreen" { ! yylval = NULL; ! return TOK_CLEAR_SCREEN; } "Weight" { ! yylval = NULL; ! return TOK_IFWEIGHT; } "Ip4Broadcast" { ! yylval = NULL; ! return TOK_IP4BROADCAST; } "Ip6AddrType" { ! yylval = NULL; ! return TOK_IP6ADDRTYPE; } "Ip6MulticastSite" { ! yylval = NULL; ! return TOK_IP6MULTISITE; } "Ip6MulticastGlobal" { ! yylval = NULL; ! return TOK_IP6MULTIGLOBAL; } "HelloInterval" { ! yylval = NULL; ! return TOK_HELLOINT; } "HelloValidityTime" { ! yylval = NULL; ! return TOK_HELLOVAL; } "TcInterval" { ! yylval = NULL; ! return TOK_TCINT; } "TcValidityTime" { ! yylval = NULL; ! return TOK_TCVAL; } "MidInterval" { ! yylval = NULL; ! return TOK_MIDINT; } "MidValidityTime" { ! yylval = NULL; ! return TOK_MIDVAL; } "HnaInterval" { ! yylval = NULL; ! return TOK_HNAINT; } "HnaValidityTime" { ! yylval = NULL; ! return TOK_HNAVAL; } "AutoDetectChanges" { ! yylval = NULL; ! return TOK_AUTODETCHG; } \n|\r\n { ! current_line++; }