From (spam-protected) Wed Jan 4 10:08:11 2006 From: (spam-protected) (Andreas Tønnesen) Date: Wed, 04 Jan 2006 09:08:11 +0000 Subject: [Olsr-cvs] olsrd-current CHANGELOG,1.54,1.55 Message-ID: Update of /cvsroot/olsrd/olsrd-current In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15928 Modified Files: CHANGELOG Log Message: Uuups.. merge warnings has snuck into the changelog Index: CHANGELOG =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/CHANGELOG,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** CHANGELOG 21 Dec 2005 14:58:06 -0000 1.54 --- CHANGELOG 4 Jan 2006 09:08:08 -0000 1.55 *************** *** 60,76 **** - Fixed crash when changing IPv6 address at run-time - Fixed a bug that prevented setting willingness 0 in the configfile - <<<<<<< CHANGELOG - Fixed bad handling of missing command line arguments - ======= - Did various updates to prevent assertion when a neighbor has changed IP and sends HELLO before its olsrd precess has detected the change. - <<<<<<< CHANGELOG - >>>>>>> 1.47 - ======= - Fixed return value check on times(2) calls in the scheduler - Fixed bug(s) that could cause crash when an interface was brought down while olsrd was running. - >>>>>>> 1.53 0.4.9 --------------------------------------------------------------------- --- 60,70 ---- From (spam-protected) Wed Jan 4 16:51:21 2006 From: (spam-protected) (Andreas Tønnesen) Date: Wed, 04 Jan 2006 15:51:21 +0000 Subject: [Olsr-cvs] olsrd-current/src defs.h,1.50,1.51 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9427/src Modified Files: defs.h Log Message: Update version constants Index: defs.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/defs.h,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** defs.h 19 Nov 2005 08:49:44 -0000 1.50 --- defs.h 4 Jan 2006 15:51:19 -0000 1.51 *************** *** 60,64 **** #include "olsr_cfg.h" ! #define VERSION "0.4.10-pre" #define SOFTWARE_VERSION "olsr.org - " VERSION #define OLSRD_VERSION_DATE " *** " SOFTWARE_VERSION " (" __DATE__ ") ***\n" --- 60,64 ---- #include "olsr_cfg.h" ! #define VERSION "0.5.0-pre" #define SOFTWARE_VERSION "olsr.org - " VERSION #define OLSRD_VERSION_DATE " *** " SOFTWARE_VERSION " (" __DATE__ ") ***\n" From (spam-protected) Wed Jan 4 16:51:21 2006 From: (spam-protected) (Andreas Tønnesen) Date: Wed, 04 Jan 2006 15:51:21 +0000 Subject: [Olsr-cvs] olsrd-current Makefile,1.67,1.68 Message-ID: Update of /cvsroot/olsrd/olsrd-current In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9427 Modified Files: Makefile Log Message: Update version constants Index: Makefile =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/Makefile,v retrieving revision 1.67 retrieving revision 1.68 diff -C2 -d -r1.67 -r1.68 *** Makefile 29 Dec 2005 21:26:31 -0000 1.67 --- Makefile 4 Jan 2006 15:51:19 -0000 1.68 *************** *** 38,42 **** # $Id$ ! VERS = 0.4.10pre TOPDIR = . --- 38,42 ---- # $Id$ ! VERS = 0.5.0pre TOPDIR = . From (spam-protected) Wed Jan 4 16:51:53 2006 From: (spam-protected) (Andreas Tønnesen) Date: Wed, 04 Jan 2006 15:51:53 +0000 Subject: [Olsr-cvs] olsrd-current/src defs.h,1.50,1.50.2.1 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9637/src Modified Files: Tag: olsrd_04 defs.h Log Message: Update version constants Index: defs.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/defs.h,v retrieving revision 1.50 retrieving revision 1.50.2.1 diff -C2 -d -r1.50 -r1.50.2.1 *** defs.h 19 Nov 2005 08:49:44 -0000 1.50 --- defs.h 4 Jan 2006 15:51:51 -0000 1.50.2.1 *************** *** 60,64 **** #include "olsr_cfg.h" ! #define VERSION "0.4.10-pre" #define SOFTWARE_VERSION "olsr.org - " VERSION #define OLSRD_VERSION_DATE " *** " SOFTWARE_VERSION " (" __DATE__ ") ***\n" --- 60,64 ---- #include "olsr_cfg.h" ! #define VERSION "0.4.11-pre" #define SOFTWARE_VERSION "olsr.org - " VERSION #define OLSRD_VERSION_DATE " *** " SOFTWARE_VERSION " (" __DATE__ ") ***\n" From (spam-protected) Wed Jan 4 16:51:53 2006 From: (spam-protected) (Andreas Tønnesen) Date: Wed, 04 Jan 2006 15:51:53 +0000 Subject: [Olsr-cvs] olsrd-current Makefile,1.67,1.67.2.1 Message-ID: Update of /cvsroot/olsrd/olsrd-current In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9637 Modified Files: Tag: olsrd_04 Makefile Log Message: Update version constants Index: Makefile =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/Makefile,v retrieving revision 1.67 retrieving revision 1.67.2.1 diff -C2 -d -r1.67 -r1.67.2.1 *** Makefile 29 Dec 2005 21:26:31 -0000 1.67 --- Makefile 4 Jan 2006 15:51:51 -0000 1.67.2.1 *************** *** 38,42 **** # $Id$ ! VERS = 0.4.10pre TOPDIR = . --- 38,42 ---- # $Id$ ! VERS = 0.4.11pre TOPDIR = . From (spam-protected) Wed Jan 4 20:05:05 2006 From: (spam-protected) (Andreas Tønnesen) Date: Wed, 04 Jan 2006 19:05:05 +0000 Subject: [Olsr-cvs] olsrd-current/src olsr_cfg.h,1.27,1.28 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3859 Modified Files: olsr_cfg.h Log Message: LQ level 2 is default on 0.5 Index: olsr_cfg.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/olsr_cfg.h,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** olsr_cfg.h 17 Nov 2005 04:25:44 -0000 1.27 --- olsr_cfg.h 4 Jan 2006 19:05:03 -0000 1.28 *************** *** 53,58 **** #define DEF_DEBUGLVL 1 #define DEF_IPC_CONNECTIONS 0 ! #define DEF_USE_HYST OLSR_TRUE ! #define DEF_LQ_LEVEL 0 #define DEF_LQ_FISH 0 #define DEF_LQ_DIJK_LIMIT 255 --- 53,58 ---- #define DEF_DEBUGLVL 1 #define DEF_IPC_CONNECTIONS 0 ! #define DEF_USE_HYST OLSR_FALSE ! #define DEF_LQ_LEVEL 2 #define DEF_LQ_FISH 0 #define DEF_LQ_DIJK_LIMIT 255 From (spam-protected) Thu Jan 5 07:04:50 2006 From: (spam-protected) (Andreas Tønnesen) Date: Thu, 05 Jan 2006 06:04:50 +0000 Subject: [Olsr-cvs] olsrd-current/make Makefile.osx,1.4,1.5 Message-ID: Update of /cvsroot/olsrd/olsrd-current/make In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22565/make Modified Files: Makefile.osx Log Message: Added patch by Lorenz Schori Index: Makefile.osx =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/make/Makefile.osx,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Makefile.osx 29 Dec 2005 19:48:43 -0000 1.4 --- Makefile.osx 5 Jan 2006 06:04:47 -0000 1.5 *************** *** 3,6 **** --- 3,10 ---- # + # don't strip executables and bundles for now until we figure out the proper way + # to do it (flags). + STRIP = \# + INSTALL_PREFIX ?= LIBDIR = $(INSTALL_PREFIX)/usr/lib *************** *** 13,22 **** PLUGIN_FULLNAME ?= $(PLUGIN_NAME).so.$(PLUGIN_VER) ! INSTALL_LIB = install -m 755 $(PLUGIN_FULLNAME) $(LIBDIR)/$(PLUGIN_FULLNAME); \ ! /sbin/ldconfig ifdef OLSRD_PLUGIN ! CFLAGS += -fPIC ! LDFLAGS = -fPIC -dynamiclib -single_module -flat_namespace -undefined suppress else LDFLAGS = -dynamic --- 17,24 ---- PLUGIN_FULLNAME ?= $(PLUGIN_NAME).so.$(PLUGIN_VER) ! INSTALL_LIB = install -m 755 $(PLUGIN_FULLNAME) $(LIBDIR)/$(PLUGIN_FULLNAME) ifdef OLSRD_PLUGIN ! LDFLAGS = -bundle -flat_namespace -undefined suppress else LDFLAGS = -dynamic From (spam-protected) Thu Jan 5 07:05:09 2006 From: (spam-protected) (Andreas Tønnesen) Date: Thu, 05 Jan 2006 06:05:09 +0000 Subject: [Olsr-cvs] olsrd-current/make Makefile.osx,1.4,1.4.2.1 Message-ID: Update of /cvsroot/olsrd/olsrd-current/make In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22634/make Modified Files: Tag: olsrd_04 Makefile.osx Log Message: Added patch by Lorenz Schori Index: Makefile.osx =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/make/Makefile.osx,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -C2 -d -r1.4 -r1.4.2.1 *** Makefile.osx 29 Dec 2005 19:48:43 -0000 1.4 --- Makefile.osx 5 Jan 2006 06:05:07 -0000 1.4.2.1 *************** *** 3,6 **** --- 3,10 ---- # + # don't strip executables and bundles for now until we figure out the proper way + # to do it (flags). + STRIP = \# + INSTALL_PREFIX ?= LIBDIR = $(INSTALL_PREFIX)/usr/lib *************** *** 13,22 **** PLUGIN_FULLNAME ?= $(PLUGIN_NAME).so.$(PLUGIN_VER) ! INSTALL_LIB = install -m 755 $(PLUGIN_FULLNAME) $(LIBDIR)/$(PLUGIN_FULLNAME); \ ! /sbin/ldconfig ifdef OLSRD_PLUGIN ! CFLAGS += -fPIC ! LDFLAGS = -fPIC -dynamiclib -single_module -flat_namespace -undefined suppress else LDFLAGS = -dynamic --- 17,24 ---- PLUGIN_FULLNAME ?= $(PLUGIN_NAME).so.$(PLUGIN_VER) ! INSTALL_LIB = install -m 755 $(PLUGIN_FULLNAME) $(LIBDIR)/$(PLUGIN_FULLNAME) ifdef OLSRD_PLUGIN ! LDFLAGS = -bundle -flat_namespace -undefined suppress else LDFLAGS = -dynamic From (spam-protected) Fri Jan 6 07:52:19 2006 From: (spam-protected) (Andreas Tønnesen) Date: Fri, 06 Jan 2006 06:52:19 +0000 Subject: [Olsr-cvs] olsrd-current Makefile,1.68,1.69 Message-ID: Update of /cvsroot/olsrd/olsrd-current In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18730 Modified Files: Makefile Log Message: Not deleting tags when doing clean only when doing uberclean Index: Makefile =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/Makefile,v retrieving revision 1.68 retrieving revision 1.69 diff -C2 -d -r1.68 -r1.69 *** Makefile 4 Jan 2006 15:51:19 -0000 1.68 --- Makefile 6 Jan 2006 06:52:17 -0000 1.69 *************** *** 72,80 **** clean: ! -rm -f $(OBJS) $(SRCS:%.c=%.d) olsrd olsrd.exe $(TAGFILE) $(MAKE) -C $(CFGDIR) clean $(MAKE) -C $(SWITCHDIR) clean uberclean: clean clean_libs -rm -f src/*.[od~] -rm -f src/linux/*.[od~] src/unix/*.[od~] src/win32/*.[od~] src/bsd/*.[od~] --- 72,81 ---- clean: ! -rm -f $(OBJS) $(SRCS:%.c=%.d) olsrd olsrd.exe $(MAKE) -C $(CFGDIR) clean $(MAKE) -C $(SWITCHDIR) clean uberclean: clean clean_libs + -rm -f $(TAGFILE) -rm -f src/*.[od~] -rm -f src/linux/*.[od~] src/unix/*.[od~] src/win32/*.[od~] src/bsd/*.[od~] From (spam-protected) Fri Jan 6 07:54:06 2006 From: (spam-protected) (Andreas Tønnesen) Date: Fri, 06 Jan 2006 06:54:06 +0000 Subject: [Olsr-cvs] olsrd-current/make Makefile.linux,1.4,1.5 Message-ID: Update of /cvsroot/olsrd/olsrd-current/make In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18909/make Modified Files: Makefile.linux Log Message: Initial libnet code for testing. Works on Linux now, do make USE_LIBNET=1 to use Index: Makefile.linux =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/make/Makefile.linux,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Makefile.linux 19 Nov 2005 08:43:51 -0000 1.4 --- Makefile.linux 6 Jan 2006 06:54:03 -0000 1.5 *************** *** 27,31 **** LDFLAGS += -fPIC endif ! OS_LIB_PTHREAD = -lpthread OS_LIB_DYNLOAD = -ldl --- 27,36 ---- LDFLAGS += -fPIC endif ! ! ifdef USE_LIBNET ! LIBS += -lnet ! CFLAGS += -DUSE_LIBNET ! endif ! OS_LIB_PTHREAD = -lpthread OS_LIB_DYNLOAD = -ldl From (spam-protected) Fri Jan 6 07:54:06 2006 From: (spam-protected) (Andreas Tønnesen) Date: Fri, 06 Jan 2006 06:54:06 +0000 Subject: [Olsr-cvs] olsrd-current/src/unix ifnet.c,1.31,1.32 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src/unix In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18909/src/unix Modified Files: ifnet.c Log Message: Initial libnet code for testing. Works on Linux now, do make USE_LIBNET=1 to use Index: ifnet.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/unix/ifnet.c,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** ifnet.c 29 Dec 2005 18:37:16 -0000 1.31 --- ifnet.c 6 Jan 2006 06:54:04 -0000 1.32 *************** *** 50,53 **** --- 50,54 ---- #include "olsr.h" #include "net_os.h" + #include "net_olsr.h" #include "socket_parser.h" #include "parser.h" *************** *** 67,70 **** --- 68,75 ---- #include + #ifdef USE_LIBNET + #include + #endif + int bufspace = 127*1024; /* max. input buffer size to request */ *************** *** 485,488 **** --- 490,497 ---- close(ifp->olsr_socket); remove_olsr_socket(ifp->olsr_socket, &olsr_input); + #ifdef USE_LIBNET + libnet_destroy(ifp->libnet_ctx); + #endif + /* Free memory */ free(ifp->int_name); *************** *** 919,922 **** --- 928,945 ---- kill(getpid(), SIGINT); } + + #ifdef USE_LIBNET + ifp->libnet_ctx = libnet_init(LIBNET_RAW4, ifp->int_name, get_libnet_errbuf()); + + if(ifp->libnet_ctx == NULL) + { + fprintf(stderr, "Could not initialize libnet... exiting!\n\n"); + olsr_syslog(OLSR_LOG_ERR, "Could not initialize libnet... exiting!\n\n"); + exit_value = EXIT_FAILURE; + kill(getpid(), SIGINT); + } + #else + ifp->libnet_ctx = NULL; + #endif } else From (spam-protected) Fri Jan 6 07:54:06 2006 From: (spam-protected) (Andreas Tønnesen) Date: Fri, 06 Jan 2006 06:54:06 +0000 Subject: [Olsr-cvs] olsrd-current/src net_olsr.c, 1.7, 1.8 interfaces.h, 1.30, 1.31 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18909/src Modified Files: net_olsr.c interfaces.h Log Message: Initial libnet code for testing. Works on Linux now, do make USE_LIBNET=1 to use Index: net_olsr.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/net_olsr.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** net_olsr.c 29 Dec 2005 18:37:16 -0000 1.7 --- net_olsr.c 6 Jan 2006 06:54:04 -0000 1.8 *************** *** 47,50 **** --- 47,55 ---- #include "link_set.h" #include + #include + + #ifdef USE_LIBNET + #include + #endif extern olsr_bool lq_tc_pending; *************** *** 88,91 **** --- 93,105 ---- }; + #ifdef USE_LIBNET + static char errbuf[LIBNET_ERRBUF_SIZE]; + + char * + get_libnet_errbuf() + { + return errbuf; + } + #endif void *************** *** 455,458 **** --- 469,527 ---- if(olsr_cnf->ip_version == AF_INET) { + #ifdef USE_LIBNET + libnet_ptag_t udp_ptag = 0, ip_ptag = 0; + int bytes_written; + + printf("LIBNET TX %d bytes on %s\n", + netbufs[ifp->if_nr]->pending, ifp->int_name); + + assert(ifp->libnet_ctx != NULL); + + udp_ptag = libnet_build_udp(OLSRPORT, + OLSRPORT, + LIBNET_UDP_H + netbufs[ifp->if_nr]->pending, + 0, + (u_int8_t *)netbufs[ifp->if_nr]->buff, + netbufs[ifp->if_nr]->pending, + ifp->libnet_ctx, + udp_ptag); + if(udp_ptag == -1) + { + OLSR_PRINTF (1, "libnet UDP header: %s\n", libnet_geterror (ifp->libnet_ctx)) + return (0); + } + + ip_ptag = libnet_build_ipv4(LIBNET_IPV4_H + LIBNET_UDP_H + netbufs[ifp->if_nr]->pending, + olsr_cnf->tos, + ifp->olsr_seqnum, + 0, + 255, + IPPROTO_UDP, + 0, + ifp->ip_addr.v4, + sin->sin_addr.s_addr, + NULL, + 0, + ifp->libnet_ctx, + ip_ptag); + if(ip_ptag == -1) + { + OLSR_PRINTF (1, "libnet IP header: %s\n", libnet_geterror (ifp->libnet_ctx)) + return (0); + } + + if((bytes_written = libnet_write(ifp->libnet_ctx)) == -1) + { + OLSR_PRINTF (1, "libnet packet write: %s\n", libnet_geterror (ifp->libnet_ctx)) + return (0); + } + if(bytes_written != (int)(LIBNET_IPV4_H + LIBNET_UDP_H + netbufs[ifp->if_nr]->pending)) + { + printf("libnet_write returned %d, expected %d\n", + bytes_written, LIBNET_IPV4_H + LIBNET_UDP_H + netbufs[ifp->if_nr]->pending); + } + + libnet_clear_packet(ifp->libnet_ctx); + #else /* IP version 4 */ if(olsr_sendto(ifp->olsr_socket, *************** *** 469,472 **** --- 538,542 ---- return -1; } + #endif } else Index: interfaces.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/interfaces.h,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** interfaces.h 3 Jun 2005 08:00:55 -0000 1.30 --- interfaces.h 6 Jan 2006 06:54:04 -0000 1.31 *************** *** 136,139 **** --- 136,141 ---- struct vtimes valtimes; + void *libnet_ctx; /* libnet context(void to avoid dependency */ + struct if_gen_property *gen_properties;/* Generic interface properties */ From (spam-protected) Fri Jan 6 07:54:39 2006 From: (spam-protected) (Andreas Tønnesen) Date: Fri, 06 Jan 2006 06:54:39 +0000 Subject: [Olsr-cvs] olsrd-current/src net_olsr.h,1.1,1.2 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19022 Modified Files: net_olsr.h Log Message: Initial libnet code for testing. Works on Linux now, do make USE_LIBNET=1 to use Index: net_olsr.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/net_olsr.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** net_olsr.h 25 May 2005 20:59:46 -0000 1.1 --- net_olsr.h 6 Jan 2006 06:54:37 -0000 1.2 *************** *** 69,72 **** --- 69,77 ---- }; + #ifdef USE_LIBNET + char * + get_libnet_errbuf(void); + #endif + void init_net(void); From (spam-protected) Fri Jan 6 08:21:07 2006 From: (spam-protected) (Andreas Tønnesen) Date: Fri, 06 Jan 2006 07:21:07 +0000 Subject: [Olsr-cvs] olsrd-current/src net_olsr.c,1.8,1.9 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23197 Modified Files: net_olsr.c Log Message: Added dont fragment bit in libnet udp header and better failure handling Index: net_olsr.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/net_olsr.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** net_olsr.c 6 Jan 2006 06:54:04 -0000 1.8 --- net_olsr.c 6 Jan 2006 07:21:04 -0000 1.9 *************** *** 410,413 **** --- 410,414 ---- struct ptf *tmp_ptf_list; union olsr_packet *outmsg; + int retval; sin = NULL; *************** *** 422,425 **** --- 423,428 ---- netbufs[ifp->if_nr]->pending += OLSR_HEADERSIZE; + retval = netbufs[ifp->if_nr]->pending; + outmsg = (union olsr_packet *)netbufs[ifp->if_nr]->buff; /* Add the Packet seqno */ *************** *** 471,475 **** #ifdef USE_LIBNET libnet_ptag_t udp_ptag = 0, ip_ptag = 0; - int bytes_written; printf("LIBNET TX %d bytes on %s\n", --- 474,477 ---- *************** *** 489,493 **** { OLSR_PRINTF (1, "libnet UDP header: %s\n", libnet_geterror (ifp->libnet_ctx)) ! return (0); } --- 491,497 ---- { OLSR_PRINTF (1, "libnet UDP header: %s\n", libnet_geterror (ifp->libnet_ctx)) ! netbufs[ifp->if_nr]->pending = 0; ! libnet_clear_packet(ifp->libnet_ctx); ! return -1; } *************** *** 495,499 **** olsr_cnf->tos, ifp->olsr_seqnum, ! 0, 255, IPPROTO_UDP, --- 499,503 ---- olsr_cnf->tos, ifp->olsr_seqnum, ! 0x4000, /* Don't fragment */ 255, IPPROTO_UDP, *************** *** 508,523 **** { OLSR_PRINTF (1, "libnet IP header: %s\n", libnet_geterror (ifp->libnet_ctx)) ! return (0); } ! if((bytes_written = libnet_write(ifp->libnet_ctx)) == -1) { OLSR_PRINTF (1, "libnet packet write: %s\n", libnet_geterror (ifp->libnet_ctx)) - return (0); } ! if(bytes_written != (int)(LIBNET_IPV4_H + LIBNET_UDP_H + netbufs[ifp->if_nr]->pending)) { printf("libnet_write returned %d, expected %d\n", ! bytes_written, LIBNET_IPV4_H + LIBNET_UDP_H + netbufs[ifp->if_nr]->pending); } --- 512,528 ---- { OLSR_PRINTF (1, "libnet IP header: %s\n", libnet_geterror (ifp->libnet_ctx)) ! netbufs[ifp->if_nr]->pending = 0; ! libnet_clear_packet(ifp->libnet_ctx); ! return -1; } ! if((retval = libnet_write(ifp->libnet_ctx)) == -1) { OLSR_PRINTF (1, "libnet packet write: %s\n", libnet_geterror (ifp->libnet_ctx)) } ! if(retval != (int)(LIBNET_IPV4_H + LIBNET_UDP_H + netbufs[ifp->if_nr]->pending)) { printf("libnet_write returned %d, expected %d\n", ! retval, LIBNET_IPV4_H + LIBNET_UDP_H + netbufs[ifp->if_nr]->pending); } *************** *** 535,540 **** perror("sendto(v4)"); olsr_syslog(OLSR_LOG_ERR, "OLSR: sendto IPv4 %m"); ! netbufs[ifp->if_nr]->pending = 0; ! return -1; } #endif --- 540,544 ---- perror("sendto(v4)"); olsr_syslog(OLSR_LOG_ERR, "OLSR: sendto IPv4 %m"); ! retval = -1; } #endif *************** *** 556,561 **** fprintf(stderr, "To: %s (size: %d)\n", ip6_to_string(&sin6->sin6_addr), (int)sizeof(*sin6)); fprintf(stderr, "Outputsize: %d\n", netbufs[ifp->if_nr]->pending); ! netbufs[ifp->if_nr]->pending = 0; ! return -1; } } --- 560,564 ---- fprintf(stderr, "To: %s (size: %d)\n", ip6_to_string(&sin6->sin6_addr), (int)sizeof(*sin6)); fprintf(stderr, "Outputsize: %d\n", netbufs[ifp->if_nr]->pending); ! retval = -1; } } *************** *** 569,573 **** lq_tc_pending = OLSR_FALSE; ! return 1; } --- 572,576 ---- lq_tc_pending = OLSR_FALSE; ! return retval; } From (spam-protected) Sat Jan 7 09:16:26 2006 From: (spam-protected) (Andreas Tønnesen) Date: Sat, 07 Jan 2006 08:16:26 +0000 Subject: [Olsr-cvs] olsrd-current/src/cfgparser olsrd_conf.c,1.46,1.47 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src/cfgparser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15798/cfgparser Modified Files: olsrd_conf.c Log Message: Cleanup in use of extern variables. Rather trivial changes, but a lot of them Index: olsrd_conf.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/cfgparser/olsrd_conf.c,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** olsrd_conf.c 17 Nov 2005 04:25:44 -0000 1.46 --- olsrd_conf.c 7 Jan 2006 08:16:24 -0000 1.47 *************** *** 458,461 **** --- 458,469 ---- cnf->lq_wsize = DEF_LQ_WSIZE; cnf->clear_screen = DEF_CLEAR_SCREEN; + + cnf->del_gws = OLSR_FALSE; + cnf->will_int = 10 * HELLO_INTERVAL; + cnf->max_jitter = 0.0; + cnf->exit_value = EXIT_SUCCESS; + cnf->max_tc_vtime = 0.0; + cnf->ioctl_s = 0; + cnf->rts = 0; } From (spam-protected) Sat Jan 7 09:16:26 2006 From: (spam-protected) (Andreas Tønnesen) Date: Sat, 07 Jan 2006 08:16:26 +0000 Subject: [Olsr-cvs] olsrd-current/src/bsd kernel_routes.c, 1.6, 1.7 net.c, 1.26, 1.27 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src/bsd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15798/bsd Modified Files: kernel_routes.c net.c Log Message: Cleanup in use of extern variables. Rather trivial changes, but a lot of them Index: net.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/bsd/net.c,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** net.c 28 Aug 2005 19:30:29 -0000 1.26 --- net.c 7 Jan 2006 08:16:22 -0000 1.27 *************** *** 720,724 **** ifr.ifr_data = (caddr_t)&wreq; ! return (ioctl(ioctl_s, SIOCGWAVELAN, &ifr) >= 0) ? 1 : 0; #else return 0; --- 720,724 ---- ifr.ifr_data = (caddr_t)&wreq; ! return (ioctl(olsr_cnf->ioctl_s, SIOCGWAVELAN, &ifr) >= 0) ? 1 : 0; #else return 0; *************** *** 746,750 **** strlcpy(ifm.ifm_name, ifname, sizeof(ifm.ifm_name)); ! if(ioctl(ioctl_s, SIOCGIFMEDIA, &ifm) < 0) { OLSR_PRINTF(1, "Error SIOCGIFMEDIA(%s)\n", ifm.ifm_name) --- 746,750 ---- strlcpy(ifm.ifm_name, ifname, sizeof(ifm.ifm_name)); ! if(ioctl(olsr_cnf->ioctl_s, SIOCGIFMEDIA, &ifm) < 0) { OLSR_PRINTF(1, "Error SIOCGIFMEDIA(%s)\n", ifm.ifm_name) Index: kernel_routes.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/bsd/kernel_routes.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** kernel_routes.c 27 Feb 2005 10:43:38 -0000 1.6 --- kernel_routes.c 7 Jan 2006 08:16:22 -0000 1.7 *************** *** 153,157 **** rtm->rtm_msglen = (unsigned short)(walker - buff); ! len = write(rts, buff, rtm->rtm_msglen); if (len < rtm->rtm_msglen) --- 153,157 ---- rtm->rtm_msglen = (unsigned short)(walker - buff); ! len = write(olsr_cnf->rts, buff, rtm->rtm_msglen); if (len < rtm->rtm_msglen) From (spam-protected) Sat Jan 7 09:16:26 2006 From: (spam-protected) (Andreas Tønnesen) Date: Sat, 07 Jan 2006 08:16:26 +0000 Subject: [Olsr-cvs] olsrd-current/src/linux kernel_routes.c, 1.18, 1.19 net.c, 1.29, 1.30 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15798/linux Modified Files: kernel_routes.c net.c Log Message: Cleanup in use of extern variables. Rather trivial changes, but a lot of them Index: net.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/linux/net.c,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** net.c 17 Sep 2005 20:48:50 -0000 1.29 --- net.c 7 Jan 2006 08:16:24 -0000 1.30 *************** *** 822,826 **** strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)); ! return (ioctl(ioctl_s, SIOCGIWNAME, &ifr) >= 0) ? 1 : 0; } --- 822,826 ---- strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)); ! return (ioctl(olsr_cnf->ioctl_s, SIOCGIWNAME, &ifr) >= 0) ? 1 : 0; } *************** *** 875,879 **** /* Get bit rate */ ! if(ioctl(ioctl_s, SIOCGIWRATE, &ifr) < 0) { OLSR_PRINTF(1, "Not able to find rate for WLAN interface %s\n", ifname) --- 875,879 ---- /* Get bit rate */ ! if(ioctl(olsr_cnf->ioctl_s, SIOCGIWRATE, &ifr) < 0) { OLSR_PRINTF(1, "Not able to find rate for WLAN interface %s\n", ifname) *************** *** 898,902 **** strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)); ! if (ioctl(ioctl_s, SIOCGMIIPHY, &ifr) < 0) { if (errno != ENODEV) OLSR_PRINTF(1, "SIOCGMIIPHY on '%s' failed: %s\n", --- 898,902 ---- strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)); ! if (ioctl(olsr_cnf->ioctl_s, SIOCGMIIPHY, &ifr) < 0) { if (errno != ENODEV) OLSR_PRINTF(1, "SIOCGMIIPHY on '%s' failed: %s\n", *************** *** 906,910 **** mii->reg_num = MII_BMCR; ! if (ioctl(ioctl_s, SIOCGMIIREG, &ifr) < 0) { OLSR_PRINTF(1, "SIOCGMIIREG on %s failed: %s\n", ifr.ifr_name, strerror(errno)) --- 906,910 ---- mii->reg_num = MII_BMCR; ! if (ioctl(olsr_cnf->ioctl_s, SIOCGMIIREG, &ifr) < 0) { OLSR_PRINTF(1, "SIOCGMIIREG on %s failed: %s\n", ifr.ifr_name, strerror(errno)) *************** *** 948,952 **** strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)); ! if (ioctl(ioctl_s, SIOCGMIIPHY, &ifr) < 0) { if (errno != ENODEV) OLSR_PRINTF(1, "SIOCGMIIPHY on '%s' failed: %s\n", --- 948,952 ---- strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)); ! if (ioctl(olsr_cnf->ioctl_s, SIOCGMIIPHY, &ifr) < 0) { if (errno != ENODEV) OLSR_PRINTF(1, "SIOCGMIIPHY on '%s' failed: %s\n", *************** *** 955,959 **** } mii->reg_num = MII_BMSR; ! if (ioctl(ioctl_s, SIOCGMIIREG, &ifr) < 0) { OLSR_PRINTF(1, "SIOCGMIIREG on %s failed: %s\n", ifr.ifr_name, strerror(errno)) --- 955,959 ---- } mii->reg_num = MII_BMSR; ! if (ioctl(olsr_cnf->ioctl_s, SIOCGMIIREG, &ifr) < 0) { OLSR_PRINTF(1, "SIOCGMIIREG on %s failed: %s\n", ifr.ifr_name, strerror(errno)) Index: kernel_routes.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/linux/kernel_routes.c,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** kernel_routes.c 27 Feb 2005 18:39:43 -0000 1.18 --- kernel_routes.c 7 Jan 2006 08:16:24 -0000 1.19 *************** *** 94,107 **** kernel_route.rt_metric = destination->rt_metric + 1; ! /* ! * Thales Internet GW fix ! */ ! ! if((del_gws) && (destination->rt_dst.v4 == INADDR_ANY) && (destination->rt_dst.v4 == INADDR_ANY)) { delete_all_inet_gws(); ! del_gws = 0; } --- 94,103 ---- kernel_route.rt_metric = destination->rt_metric + 1; ! if((olsr_cnf->del_gws) && (destination->rt_dst.v4 == INADDR_ANY) && (destination->rt_dst.v4 == INADDR_ANY)) { delete_all_inet_gws(); ! olsr_cnf->del_gws = OLSR_FALSE; } *************** *** 129,133 **** //printf("\tiface: %s\n", kernel_route.rt_dev); ! tmp = ioctl(ioctl_s,SIOCADDRT,&kernel_route); /* kernel_route.rt_dev=*/ --- 125,129 ---- //printf("\tiface: %s\n", kernel_route.rt_dev); ! tmp = ioctl(olsr_cnf->ioctl_s,SIOCADDRT,&kernel_route); /* kernel_route.rt_dev=*/ *************** *** 178,182 **** ! memset(&zeroaddr, 0, ipsize); /* Use for comparision */ --- 174,178 ---- ! memset(&zeroaddr, 0, olsr_cnf->ipsize); /* Use for comparision */ *************** *** 190,194 **** kernel_route.rtmsg_dst_len = destination->rt_mask.v6; ! if(memcmp(&destination->rt_dst, &destination->rt_router, ipsize) != 0) { COPY_IP(&kernel_route.rtmsg_gateway, &destination->rt_router); --- 186,190 ---- kernel_route.rtmsg_dst_len = destination->rt_mask.v6; ! if(memcmp(&destination->rt_dst, &destination->rt_router, olsr_cnf->ipsize) != 0) { COPY_IP(&kernel_route.rtmsg_gateway, &destination->rt_router); *************** *** 209,217 **** //OLSR_PRINTF(3, "%s\n", olsr_ip_to_string((union olsr_ip_addr *)&kernel_route.rtmsg_gateway)) ! if((tmp = ioctl(ioctl_s, SIOCADDRT, &kernel_route)) >= 0) { if(olsr_cnf->open_ipc) { ! if(memcmp(&destination->rt_router, &null_addr6, ipsize) != 0) ipc_route_send_rtentry(&destination->rt_dst, &destination->rt_router, --- 205,213 ---- //OLSR_PRINTF(3, "%s\n", olsr_ip_to_string((union olsr_ip_addr *)&kernel_route.rtmsg_gateway)) ! if((tmp = ioctl(olsr_cnf->ioctl_s, SIOCADDRT, &kernel_route)) >= 0) { if(olsr_cnf->open_ipc) { ! if(memcmp(&destination->rt_router, &null_addr6, olsr_cnf->ipsize) != 0) ipc_route_send_rtentry(&destination->rt_dst, &destination->rt_router, *************** *** 275,279 **** */ ! tmp = ioctl(ioctl_s, SIOCDELRT, &kernel_route); --- 271,275 ---- */ ! tmp = ioctl(olsr_cnf->ioctl_s, SIOCDELRT, &kernel_route); *************** *** 324,330 **** kernel_route.rtmsg_dst_len = destination->rt_mask.v6; ! memcpy(&kernel_route.rtmsg_dst, &destination->rt_dst, ipsize); ! memcpy(&kernel_route.rtmsg_gateway, &destination->rt_router, ipsize); kernel_route.rtmsg_flags = destination->rt_flags; --- 320,326 ---- kernel_route.rtmsg_dst_len = destination->rt_mask.v6; ! memcpy(&kernel_route.rtmsg_dst, &destination->rt_dst, olsr_cnf->ipsize); ! memcpy(&kernel_route.rtmsg_gateway, &destination->rt_router, olsr_cnf->ipsize); kernel_route.rtmsg_flags = destination->rt_flags; *************** *** 332,336 **** ! tmp = ioctl(ioctl_s, SIOCDELRT,&kernel_route); --- 328,332 ---- ! tmp = ioctl(olsr_cnf->ioctl_s, SIOCDELRT,&kernel_route); *************** *** 407,411 **** ((struct sockaddr_in *)&kernel_route.rt_gateway)->sin_family=AF_INET; ! //memcpy(&kernel_route.rt_gateway, gw, ipsize); --- 403,407 ---- ((struct sockaddr_in *)&kernel_route.rt_gateway)->sin_family=AF_INET; ! //memcpy(&kernel_route.rt_gateway, gw, olsr_cnf->ipsize); From (spam-protected) Sat Jan 7 09:16:28 2006 From: (spam-protected) (Andreas Tønnesen) Date: Sat, 07 Jan 2006 08:16:28 +0000 Subject: [Olsr-cvs] olsrd-current/src/win32 ifnet.c,1.29,1.30 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15798/win32 Modified Files: ifnet.c Log Message: Cleanup in use of extern variables. Rather trivial changes, but a lot of them Index: ifnet.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/win32/ifnet.c,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** ifnet.c 23 Oct 2005 19:01:04 -0000 1.29 --- ifnet.c 7 Jan 2006 08:16:26 -0000 1.30 *************** *** 377,385 **** } ! if(COMP_IP(&main_addr, &Int->ip_addr)) { if(ifnet == NULL) { ! memset(&main_addr, 0, ipsize); OLSR_PRINTF(1, "Removed last interface. Cleared main address.\n") } --- 377,385 ---- } ! if(COMP_IP(&olsr_cnf->main_addr, &Int->ip_addr)) { if(ifnet == NULL) { ! memset(&olsr_cnf->main_addr, 0, olsr_cnf->ipsize); OLSR_PRINTF(1, "Removed last interface. Cleared main address.\n") } *************** *** 387,392 **** else { ! COPY_IP(&main_addr, &ifnet->ip_addr); ! OLSR_PRINTF(1, "New main address: %s.\n", olsr_ip_to_string(&main_addr)) } } --- 387,392 ---- else { ! COPY_IP(&olsr_cnf->main_addr, &ifnet->ip_addr); ! OLSR_PRINTF(1, "New main address: %s.\n", olsr_ip_to_string(&olsr_cnf->main_addr)) } } *************** *** 436,440 **** { OLSR_PRINTF(1, "No more active interfaces - exiting.\n") ! exit_value = EXIT_FAILURE; CallSignalHandler(); } --- 436,440 ---- { OLSR_PRINTF(1, "No more active interfaces - exiting.\n") ! olsr_cnf->exit_value = EXIT_FAILURE; CallSignalHandler(); } *************** *** 474,482 **** ifnet = ifp; ! memset(&null_addr, 0, ipsize); ! if(COMP_IP(&null_addr, &main_addr)) { ! COPY_IP(&main_addr, &iface->hemu_ip); ! OLSR_PRINTF(1, "New main address: %s\n", olsr_ip_to_string(&main_addr)) } --- 474,482 ---- ifnet = ifp; ! memset(&null_addr, 0, olsr_cnf->ipsize); ! if(COMP_IP(&null_addr, &olsr_cnf->main_addr)) { ! COPY_IP(&olsr_cnf->main_addr, &iface->hemu_ip); ! OLSR_PRINTF(1, "New main address: %s\n", olsr_ip_to_string(&olsr_cnf->main_addr)) } *************** *** 506,510 **** ifp->ip_addr.v4 = iface->hemu_ip.v4; ! memcpy(&((struct sockaddr_in *)&ifp->int_addr)->sin_addr, &iface->hemu_ip, ipsize); /* --- 506,510 ---- ifp->ip_addr.v4 = iface->hemu_ip.v4; ! memcpy(&((struct sockaddr_in *)&ifp->int_addr)->sin_addr, &iface->hemu_ip, olsr_cnf->ipsize); /* *************** *** 526,530 **** { /* IP version 6 */ ! memcpy(&ifp->ip_addr, &iface->hemu_ip, ipsize); #if 0 --- 526,530 ---- { /* IP version 6 */ ! memcpy(&ifp->ip_addr, &iface->hemu_ip, olsr_cnf->ipsize); #if 0 *************** *** 549,553 **** /* Send IP as first 4/16 bytes on socket */ ! memcpy(addr, iface->hemu_ip.v6.s6_addr, ipsize); addr[0] = htonl(addr[0]); addr[1] = htonl(addr[1]); --- 549,553 ---- /* Send IP as first 4/16 bytes on socket */ ! memcpy(addr, iface->hemu_ip.v6.s6_addr, olsr_cnf->ipsize); addr[0] = htonl(addr[0]); addr[1] = htonl(addr[1]); *************** *** 555,559 **** addr[3] = htonl(addr[3]); ! if(send(ifp->olsr_socket, (char *)addr, ipsize, 0) != (int)ipsize) { fprintf(stderr, "Error sending IP!"); --- 555,559 ---- addr[3] = htonl(addr[3]); ! if(send(ifp->olsr_socket, (char *)addr, olsr_cnf->ipsize, 0) != (int)olsr_cnf->ipsize) { fprintf(stderr, "Error sending IP!"); *************** *** 605,614 **** /* Recalculate max jitter */ ! if((max_jitter == 0) || ((iface->cnf->hello_params.emission_interval / 4) < max_jitter)) ! max_jitter = iface->cnf->hello_params.emission_interval / 4; /* Recalculate max topology hold time */ ! if(max_tc_vtime < iface->cnf->tc_params.emission_interval) ! max_tc_vtime = iface->cnf->tc_params.emission_interval; ifp->hello_etime = iface->cnf->hello_params.emission_interval; --- 605,615 ---- /* Recalculate max jitter */ ! if((olsr_cnf->max_jitter == 0) || ! ((iface->cnf->hello_params.emission_interval / 4) < olsr_cnf->max_jitter)) ! olsr_cnf->max_jitter = iface->cnf->hello_params.emission_interval / 4; /* Recalculate max topology hold time */ ! if(olsr_cnf->max_tc_vtime < iface->cnf->tc_params.emission_interval) ! olsr_cnf->max_tc_vtime = iface->cnf->tc_params.emission_interval; ifp->hello_etime = iface->cnf->hello_params.emission_interval; *************** *** 704,712 **** AddrIn->sin_addr.s_addr = NewVal.v4; ! if (main_addr.v4 == OldVal.v4) { OLSR_PRINTF(1, "\tMain address change.\n") ! main_addr.v4 = NewVal.v4; } --- 705,713 ---- AddrIn->sin_addr.s_addr = NewVal.v4; ! if (olsr_cnf->main_addr.v4 == OldVal.v4) { OLSR_PRINTF(1, "\tMain address change.\n") ! olsr_cnf->main_addr.v4 = NewVal.v4; } *************** *** 879,888 **** IntConf->configured = 1; ! memset(&NullAddr, 0, ipsize); ! if(COMP_IP(&NullAddr, &main_addr)) { ! COPY_IP(&main_addr, &New->ip_addr); ! OLSR_PRINTF(1, "New main address: %s\n", olsr_ip_to_string(&main_addr)) } --- 880,889 ---- IntConf->configured = 1; ! memset(&NullAddr, 0, olsr_cnf->ipsize); ! if(COMP_IP(&NullAddr, &olsr_cnf->main_addr)) { ! COPY_IP(&olsr_cnf->main_addr, &New->ip_addr); ! OLSR_PRINTF(1, "New main address: %s\n", olsr_ip_to_string(&olsr_cnf->main_addr)) } *************** *** 919,928 **** 0, NULL); ! if(max_jitter == 0 || ! IntConf->cnf->hello_params.emission_interval / 4 < max_jitter) ! max_jitter = IntConf->cnf->hello_params.emission_interval / 4; ! if(max_tc_vtime < IntConf->cnf->tc_params.emission_interval) ! max_tc_vtime = IntConf->cnf->tc_params.emission_interval; New->hello_etime = IntConf->cnf->hello_params.emission_interval; --- 920,929 ---- 0, NULL); ! if(olsr_cnf->max_jitter == 0 || ! IntConf->cnf->hello_params.emission_interval / 4 < olsr_cnf->max_jitter) ! olsr_cnf->max_jitter = IntConf->cnf->hello_params.emission_interval / 4; ! if(olsr_cnf->max_tc_vtime < IntConf->cnf->tc_params.emission_interval) ! olsr_cnf->max_tc_vtime = IntConf->cnf->tc_params.emission_interval; New->hello_etime = IntConf->cnf->hello_params.emission_interval; From (spam-protected) Sat Jan 7 09:16:28 2006 From: (spam-protected) (Andreas Tønnesen) Date: Sat, 07 Jan 2006 08:16:28 +0000 Subject: [Olsr-cvs] olsrd-current/src/unix ifnet.c,1.32,1.33 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src/unix In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15798/unix Modified Files: ifnet.c Log Message: Cleanup in use of extern variables. Rather trivial changes, but a lot of them Index: ifnet.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/unix/ifnet.c,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** ifnet.c 6 Jan 2006 06:54:04 -0000 1.32 --- ifnet.c 7 Jan 2006 08:16:24 -0000 1.33 *************** *** 83,87 **** /* Get flags */ ! if (ioctl(ioctl_s, SIOCGIFFLAGS, &ifr) < 0) { fprintf(stderr,"ioctl (get interface flags)"); --- 83,87 ---- /* Get flags */ ! if (ioctl(olsr_cnf->ioctl_s, SIOCGIFFLAGS, &ifr) < 0) { fprintf(stderr,"ioctl (get interface flags)"); *************** *** 98,102 **** ifr.ifr_flags |= (IFF_UP | IFF_RUNNING); /* Set flags + UP */ ! if(ioctl(ioctl_s, SIOCSIFFLAGS, &ifr) < 0) { fprintf(stderr, "ERROR(%s): %s\n", ifr.ifr_name, strerror(errno)); --- 98,102 ---- ifr.ifr_flags |= (IFF_UP | IFF_RUNNING); /* Set flags + UP */ ! if(ioctl(olsr_cnf->ioctl_s, SIOCSIFFLAGS, &ifr) < 0) { fprintf(stderr, "ERROR(%s): %s\n", ifr.ifr_name, strerror(errno)); *************** *** 174,178 **** /* Get flags (and check if interface exists) */ ! if (ioctl(ioctl_s, SIOCGIFFLAGS, &ifr) < 0) { OLSR_PRINTF(3, "No such interface: %s\n", iface->name) --- 174,178 ---- /* Get flags (and check if interface exists) */ ! if (ioctl(olsr_cnf->ioctl_s, SIOCGIFFLAGS, &ifr) < 0) { OLSR_PRINTF(3, "No such interface: %s\n", iface->name) *************** *** 225,229 **** /* Get MTU */ ! if (ioctl(ioctl_s, SIOCGIFMTU, &ifr) < 0) ifp->int_mtu = 0; else --- 225,229 ---- /* Get MTU */ ! if (ioctl(olsr_cnf->ioctl_s, SIOCGIFMTU, &ifr) < 0) ifp->int_mtu = 0; else *************** *** 268,272 **** #endif ! if(memcmp(&tmp_saddr6.sin6_addr, &ifp->int6_addr.sin6_addr, ipsize) != 0) { OLSR_PRINTF(1, "New IP address for %s:\n", ifr.ifr_name) --- 268,272 ---- #endif ! if(memcmp(&tmp_saddr6.sin6_addr, &ifp->int6_addr.sin6_addr, olsr_cnf->ipsize) != 0) { OLSR_PRINTF(1, "New IP address for %s:\n", ifr.ifr_name) *************** *** 275,287 **** /* Check main addr */ ! if(memcmp(&main_addr, &tmp_saddr6.sin6_addr, ipsize) == 0) { /* Update main addr */ ! memcpy(&main_addr, &tmp_saddr6.sin6_addr, ipsize); } /* Update address */ ! memcpy(&ifp->int6_addr.sin6_addr, &tmp_saddr6.sin6_addr, ipsize); ! memcpy(&ifp->ip_addr, &tmp_saddr6.sin6_addr, ipsize); run_ifchg_cbs(ifp, IFCHG_IF_UPDATE); --- 275,287 ---- /* Check main addr */ ! if(memcmp(&olsr_cnf->main_addr, &tmp_saddr6.sin6_addr, olsr_cnf->ipsize) == 0) { /* Update main addr */ ! memcpy(&olsr_cnf->main_addr, &tmp_saddr6.sin6_addr, olsr_cnf->ipsize); } /* Update address */ ! memcpy(&ifp->int6_addr.sin6_addr, &tmp_saddr6.sin6_addr, olsr_cnf->ipsize); ! memcpy(&ifp->ip_addr, &tmp_saddr6.sin6_addr, olsr_cnf->ipsize); run_ifchg_cbs(ifp, IFCHG_IF_UPDATE); *************** *** 296,300 **** { /* Check interface address (IPv4)*/ ! if(ioctl(ioctl_s, SIOCGIFADDR, &ifr) < 0) { OLSR_PRINTF(1, "\tCould not get address of interface - removing it\n") --- 296,300 ---- { /* Check interface address (IPv4)*/ ! if(ioctl(olsr_cnf->ioctl_s, SIOCGIFADDR, &ifr) < 0) { OLSR_PRINTF(1, "\tCould not get address of interface - removing it\n") *************** *** 308,312 **** if(memcmp(&((struct sockaddr_in *)&ifp->int_addr)->sin_addr.s_addr, &((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr.s_addr, ! ipsize) != 0) { /* New address */ --- 308,312 ---- if(memcmp(&((struct sockaddr_in *)&ifp->int_addr)->sin_addr.s_addr, &((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr.s_addr, ! olsr_cnf->ipsize) != 0) { /* New address */ *************** *** 315,327 **** OLSR_PRINTF(1, "\tNew:%s\n", sockaddr_to_string(&ifr.ifr_addr)) ! if(memcmp(&main_addr, &((struct sockaddr_in *)&ifp->int_addr)->sin_addr.s_addr, ! ipsize) == 0) { OLSR_PRINTF(1, "New main address: %s\n", sockaddr_to_string(&ifr.ifr_addr)) olsr_syslog(OLSR_LOG_INFO, "New main address: %s\n", sockaddr_to_string(&ifr.ifr_addr)); ! memcpy(&main_addr, &((struct sockaddr_in *)&ifp->int_addr)->sin_addr.s_addr, ! ipsize); } --- 315,327 ---- OLSR_PRINTF(1, "\tNew:%s\n", sockaddr_to_string(&ifr.ifr_addr)) ! if(memcmp(&olsr_cnf->main_addr, &((struct sockaddr_in *)&ifp->int_addr)->sin_addr.s_addr, ! olsr_cnf->ipsize) == 0) { OLSR_PRINTF(1, "New main address: %s\n", sockaddr_to_string(&ifr.ifr_addr)) olsr_syslog(OLSR_LOG_INFO, "New main address: %s\n", sockaddr_to_string(&ifr.ifr_addr)); ! memcpy(&olsr_cnf->main_addr, &((struct sockaddr_in *)&ifp->int_addr)->sin_addr.s_addr, ! olsr_cnf->ipsize); } *************** *** 329,333 **** memcpy(&ifp->ip_addr, &((struct sockaddr_in *)&ifp->int_addr)->sin_addr.s_addr, ! ipsize); if_changes = 1; --- 329,333 ---- memcpy(&ifp->ip_addr, &((struct sockaddr_in *)&ifp->int_addr)->sin_addr.s_addr, ! olsr_cnf->ipsize); if_changes = 1; *************** *** 335,339 **** /* Check netmask */ ! if (ioctl(ioctl_s, SIOCGIFNETMASK, &ifr) < 0) { olsr_syslog(OLSR_LOG_ERR, "%s: ioctl (get broadaddr)", ifr.ifr_name); --- 335,339 ---- /* Check netmask */ ! if (ioctl(olsr_cnf->ioctl_s, SIOCGIFNETMASK, &ifr) < 0) { olsr_syslog(OLSR_LOG_ERR, "%s: ioctl (get broadaddr)", ifr.ifr_name); *************** *** 347,351 **** if(memcmp(&((struct sockaddr_in *)&ifp->int_netmask)->sin_addr.s_addr, &((struct sockaddr_in *)&ifr.ifr_netmask)->sin_addr.s_addr, ! ipsize) != 0) { /* New address */ --- 347,351 ---- if(memcmp(&((struct sockaddr_in *)&ifp->int_netmask)->sin_addr.s_addr, &((struct sockaddr_in *)&ifr.ifr_netmask)->sin_addr.s_addr, ! olsr_cnf->ipsize) != 0) { /* New address */ *************** *** 362,366 **** { /* Check broadcast address */ ! if (ioctl(ioctl_s, SIOCGIFBRDADDR, &ifr) < 0) { olsr_syslog(OLSR_LOG_ERR, "%s: ioctl (get broadaddr)", ifr.ifr_name); --- 362,366 ---- { /* Check broadcast address */ ! if (ioctl(olsr_cnf->ioctl_s, SIOCGIFBRDADDR, &ifr) < 0) { olsr_syslog(OLSR_LOG_ERR, "%s: ioctl (get broadaddr)", ifr.ifr_name); *************** *** 374,378 **** if(memcmp(&((struct sockaddr_in *)&ifp->int_broadaddr)->sin_addr.s_addr, &((struct sockaddr_in *)&ifr.ifr_broadaddr)->sin_addr.s_addr, ! ipsize) != 0) { --- 374,378 ---- if(memcmp(&((struct sockaddr_in *)&ifp->int_broadaddr)->sin_addr.s_addr, &((struct sockaddr_in *)&ifr.ifr_broadaddr)->sin_addr.s_addr, ! olsr_cnf->ipsize) != 0) { *************** *** 423,439 **** /* Check main addr */ ! if(COMP_IP(&main_addr, &ifp->ip_addr)) { if(ifnet == NULL) { /* No more interfaces */ ! memset(&main_addr, 0, ipsize); OLSR_PRINTF(1, "No more interfaces...\n") } else { ! COPY_IP(&main_addr, &ifnet->ip_addr); ! OLSR_PRINTF(1, "New main address: %s\n", olsr_ip_to_string(&main_addr)) ! olsr_syslog(OLSR_LOG_INFO, "New main address: %s\n", olsr_ip_to_string(&main_addr)); } } --- 423,439 ---- /* Check main addr */ ! if(COMP_IP(&olsr_cnf->main_addr, &ifp->ip_addr)) { if(ifnet == NULL) { /* No more interfaces */ ! memset(&olsr_cnf->main_addr, 0, olsr_cnf->ipsize); OLSR_PRINTF(1, "No more interfaces...\n") } else { ! COPY_IP(&olsr_cnf->main_addr, &ifnet->ip_addr); ! OLSR_PRINTF(1, "New main address: %s\n", olsr_ip_to_string(&olsr_cnf->main_addr)) ! olsr_syslog(OLSR_LOG_INFO, "New main address: %s\n", olsr_ip_to_string(&olsr_cnf->main_addr)); } } *************** *** 502,506 **** OLSR_PRINTF(1, "No more active interfaces - exiting.\n") olsr_syslog(OLSR_LOG_INFO, "No more active interfaces - exiting.\n"); ! exit_value = EXIT_FAILURE; kill(getpid(), SIGINT); } --- 502,506 ---- OLSR_PRINTF(1, "No more active interfaces - exiting.\n") olsr_syslog(OLSR_LOG_INFO, "No more active interfaces - exiting.\n"); ! olsr_cnf->exit_value = EXIT_FAILURE; kill(getpid(), SIGINT); } *************** *** 548,557 **** ifnet = ifp; ! memset(&null_addr, 0, ipsize); ! if(COMP_IP(&null_addr, &main_addr)) { ! COPY_IP(&main_addr, &iface->hemu_ip); ! OLSR_PRINTF(1, "New main address: %s\n", olsr_ip_to_string(&main_addr)) ! olsr_syslog(OLSR_LOG_INFO, "New main address: %s\n", olsr_ip_to_string(&main_addr)); } --- 548,557 ---- ifnet = ifp; ! memset(&null_addr, 0, olsr_cnf->ipsize); ! if(COMP_IP(&null_addr, &olsr_cnf->main_addr)) { ! COPY_IP(&olsr_cnf->main_addr, &iface->hemu_ip); ! OLSR_PRINTF(1, "New main address: %s\n", olsr_ip_to_string(&olsr_cnf->main_addr)) ! olsr_syslog(OLSR_LOG_INFO, "New main address: %s\n", olsr_ip_to_string(&olsr_cnf->main_addr)); } *************** *** 580,584 **** ifp->ip_addr.v4 = iface->hemu_ip.v4; ! memcpy(&((struct sockaddr_in *)&ifp->int_addr)->sin_addr, &iface->hemu_ip, ipsize); /* --- 580,584 ---- ifp->ip_addr.v4 = iface->hemu_ip.v4; ! memcpy(&((struct sockaddr_in *)&ifp->int_addr)->sin_addr, &iface->hemu_ip, olsr_cnf->ipsize); /* *************** *** 594,598 **** fprintf(stderr, "Could not initialize socket... exiting!\n\n"); olsr_syslog(OLSR_LOG_ERR, "Could not initialize socket... exiting!\n\n"); ! exit_value = EXIT_FAILURE; kill(getpid(), SIGINT); } --- 594,598 ---- fprintf(stderr, "Could not initialize socket... exiting!\n\n"); olsr_syslog(OLSR_LOG_ERR, "Could not initialize socket... exiting!\n\n"); ! olsr_cnf->exit_value = EXIT_FAILURE; kill(getpid(), SIGINT); } *************** *** 602,606 **** { /* IP version 6 */ ! memcpy(&ifp->ip_addr, &iface->hemu_ip, ipsize); #if 0 --- 602,606 ---- { /* IP version 6 */ ! memcpy(&ifp->ip_addr, &iface->hemu_ip, olsr_cnf->ipsize); #if 0 *************** *** 619,623 **** fprintf(stderr, "Could not initialize socket... exiting!\n\n"); olsr_syslog(OLSR_LOG_ERR, "Could not initialize socket... exiting!\n\n"); ! exit_value = EXIT_FAILURE; kill(getpid(), SIGINT); } --- 619,623 ---- fprintf(stderr, "Could not initialize socket... exiting!\n\n"); olsr_syslog(OLSR_LOG_ERR, "Could not initialize socket... exiting!\n\n"); ! olsr_cnf->exit_value = EXIT_FAILURE; kill(getpid(), SIGINT); } *************** *** 627,631 **** /* Send IP as first 4/16 bytes on socket */ ! memcpy(addr, iface->hemu_ip.v6.s6_addr, ipsize); addr[0] = htonl(addr[0]); addr[1] = htonl(addr[1]); --- 627,631 ---- /* Send IP as first 4/16 bytes on socket */ ! memcpy(addr, iface->hemu_ip.v6.s6_addr, olsr_cnf->ipsize); addr[0] = htonl(addr[0]); addr[1] = htonl(addr[1]); *************** *** 633,637 **** addr[3] = htonl(addr[3]); ! if(send(ifp->olsr_socket, addr , ipsize, 0) != (int)ipsize) { fprintf(stderr, "Error sending IP!"); --- 633,637 ---- addr[3] = htonl(addr[3]); ! if(send(ifp->olsr_socket, addr , olsr_cnf->ipsize, 0) != (int)olsr_cnf->ipsize) { fprintf(stderr, "Error sending IP!"); *************** *** 683,692 **** /* Recalculate max jitter */ ! if((max_jitter == 0) || ((iface->cnf->hello_params.emission_interval / 4) < max_jitter)) ! max_jitter = iface->cnf->hello_params.emission_interval / 4; /* Recalculate max topology hold time */ ! if(max_tc_vtime < iface->cnf->tc_params.emission_interval) ! max_tc_vtime = iface->cnf->tc_params.emission_interval; ifp->hello_etime = iface->cnf->hello_params.emission_interval; --- 683,693 ---- /* Recalculate max jitter */ ! if((olsr_cnf->max_jitter == 0) || ! ((iface->cnf->hello_params.emission_interval / 4) < olsr_cnf->max_jitter)) ! olsr_cnf->max_jitter = iface->cnf->hello_params.emission_interval / 4; /* Recalculate max topology hold time */ ! if(olsr_cnf->max_tc_vtime < iface->cnf->tc_params.emission_interval) ! olsr_cnf->max_tc_vtime = iface->cnf->tc_params.emission_interval; ifp->hello_etime = iface->cnf->hello_params.emission_interval; *************** *** 727,731 **** /* Get flags (and check if interface exists) */ ! if (ioctl(ioctl_s, SIOCGIFFLAGS, &ifr) < 0) { OLSR_PRINTF(debuglvl, "\tNo such interface!\n") --- 728,732 ---- /* Get flags (and check if interface exists) */ ! if (ioctl(olsr_cnf->ioctl_s, SIOCGIFFLAGS, &ifr) < 0) { OLSR_PRINTF(debuglvl, "\tNo such interface!\n") *************** *** 793,797 **** ifs.int6_multaddr.sin6_family = AF_INET6; /* Set port */ ! ifs.int6_multaddr.sin6_port = olsr_udp_port; OLSR_PRINTF(debuglvl, "\tMulticast: %s\n", ip6_to_string(&ifs.int6_multaddr.sin6_addr)) --- 794,798 ---- ifs.int6_multaddr.sin6_family = AF_INET6; /* Set port */ ! ifs.int6_multaddr.sin6_port = htons(OLSRPORT); OLSR_PRINTF(debuglvl, "\tMulticast: %s\n", ip6_to_string(&ifs.int6_multaddr.sin6_addr)) *************** *** 802,806 **** { /* Get interface address (IPv4)*/ ! if(ioctl(ioctl_s, SIOCGIFADDR, &ifr) < 0) { OLSR_PRINTF(debuglvl, "\tCould not get address of interface - skipping it\n") --- 803,807 ---- { /* Get interface address (IPv4)*/ ! if(ioctl(olsr_cnf->ioctl_s, SIOCGIFADDR, &ifr) < 0) { OLSR_PRINTF(debuglvl, "\tCould not get address of interface - skipping it\n") *************** *** 812,816 **** /* Find netmask */ ! if (ioctl(ioctl_s, SIOCGIFNETMASK, &ifr) < 0) { olsr_syslog(OLSR_LOG_ERR, "%s: ioctl (get netmask)", ifr.ifr_name); --- 813,817 ---- /* Find netmask */ ! if (ioctl(olsr_cnf->ioctl_s, SIOCGIFNETMASK, &ifr) < 0) { olsr_syslog(OLSR_LOG_ERR, "%s: ioctl (get netmask)", ifr.ifr_name); *************** *** 832,836 **** { /* Autodetect */ ! if (ioctl(ioctl_s, SIOCGIFBRDADDR, &ifr) < 0) { olsr_syslog(OLSR_LOG_ERR, "%s: ioctl (get broadaddr)", ifr.ifr_name); --- 833,837 ---- { /* Autodetect */ ! if (ioctl(olsr_cnf->ioctl_s, SIOCGIFBRDADDR, &ifr) < 0) { olsr_syslog(OLSR_LOG_ERR, "%s: ioctl (get broadaddr)", ifr.ifr_name); *************** *** 867,871 **** /* Get MTU */ ! if (ioctl(ioctl_s, SIOCGIFMTU, &ifr) < 0) ifs.int_mtu = OLSR_DEFAULT_MTU; else --- 868,872 ---- /* Get MTU */ ! if (ioctl(olsr_cnf->ioctl_s, SIOCGIFMTU, &ifr) < 0) ifs.int_mtu = OLSR_DEFAULT_MTU; else *************** *** 925,929 **** fprintf(stderr, "Could not initialize socket... exiting!\n\n"); olsr_syslog(OLSR_LOG_ERR, "Could not initialize socket... exiting!\n\n"); ! exit_value = EXIT_FAILURE; kill(getpid(), SIGINT); } --- 926,930 ---- fprintf(stderr, "Could not initialize socket... exiting!\n\n"); olsr_syslog(OLSR_LOG_ERR, "Could not initialize socket... exiting!\n\n"); ! olsr_cnf->exit_value = EXIT_FAILURE; kill(getpid(), SIGINT); } *************** *** 936,940 **** fprintf(stderr, "Could not initialize libnet... exiting!\n\n"); olsr_syslog(OLSR_LOG_ERR, "Could not initialize libnet... exiting!\n\n"); ! exit_value = EXIT_FAILURE; kill(getpid(), SIGINT); } --- 937,941 ---- fprintf(stderr, "Could not initialize libnet... exiting!\n\n"); olsr_syslog(OLSR_LOG_ERR, "Could not initialize libnet... exiting!\n\n"); ! olsr_cnf->exit_value = EXIT_FAILURE; kill(getpid(), SIGINT); } *************** *** 946,950 **** { /* IP version 6 */ ! memcpy(&ifp->ip_addr, &ifp->int6_addr.sin6_addr, ipsize); --- 947,951 ---- { /* IP version 6 */ ! memcpy(&ifp->ip_addr, &ifp->int6_addr.sin6_addr, olsr_cnf->ipsize); *************** *** 963,967 **** fprintf(stderr, "Could not initialize socket... exiting!\n\n"); olsr_syslog(OLSR_LOG_ERR, "Could not initialize socket... exiting!\n\n"); ! exit_value = EXIT_FAILURE; kill(getpid(), SIGINT); } --- 964,968 ---- fprintf(stderr, "Could not initialize socket... exiting!\n\n"); olsr_syslog(OLSR_LOG_ERR, "Could not initialize socket... exiting!\n\n"); ! olsr_cnf->exit_value = EXIT_FAILURE; kill(getpid(), SIGINT); } *************** *** 995,1004 **** * Set main address if this is the only interface */ ! memset(&null_addr, 0, ipsize); ! if(COMP_IP(&null_addr, &main_addr)) { ! COPY_IP(&main_addr, &ifp->ip_addr); ! OLSR_PRINTF(1, "New main address: %s\n", olsr_ip_to_string(&main_addr)) ! olsr_syslog(OLSR_LOG_INFO, "New main address: %s\n", olsr_ip_to_string(&main_addr)); } --- 996,1005 ---- * Set main address if this is the only interface */ ! memset(&null_addr, 0, olsr_cnf->ipsize); ! if(COMP_IP(&null_addr, &olsr_cnf->main_addr)) { ! COPY_IP(&olsr_cnf->main_addr, &ifp->ip_addr); ! OLSR_PRINTF(1, "New main address: %s\n", olsr_ip_to_string(&olsr_cnf->main_addr)) ! olsr_syslog(OLSR_LOG_INFO, "New main address: %s\n", olsr_ip_to_string(&olsr_cnf->main_addr)); } *************** *** 1048,1057 **** /* Recalculate max jitter */ ! if((max_jitter == 0) || ((iface->cnf->hello_params.emission_interval / 4) < max_jitter)) ! max_jitter = iface->cnf->hello_params.emission_interval / 4; /* Recalculate max topology hold time */ ! if(max_tc_vtime < iface->cnf->tc_params.emission_interval) ! max_tc_vtime = iface->cnf->tc_params.emission_interval; ifp->hello_etime = iface->cnf->hello_params.emission_interval; --- 1049,1059 ---- /* Recalculate max jitter */ ! if((olsr_cnf->max_jitter == 0) || ! ((iface->cnf->hello_params.emission_interval / 4) < olsr_cnf->max_jitter)) ! olsr_cnf->max_jitter = iface->cnf->hello_params.emission_interval / 4; /* Recalculate max topology hold time */ ! if(olsr_cnf->max_tc_vtime < iface->cnf->tc_params.emission_interval) ! olsr_cnf->max_tc_vtime = iface->cnf->tc_params.emission_interval; ifp->hello_etime = iface->cnf->hello_params.emission_interval; From (spam-protected) Sat Jan 7 09:17:45 2006 From: (spam-protected) (Andreas Tønnesen) Date: Sat, 07 Jan 2006 08:17:45 +0000 Subject: [Olsr-cvs] olsrd-current/lib/nameservice/src nameservice.c, 1.14, 1.15 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/nameservice/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16043/nameservice/src Modified Files: nameservice.c Log Message: Adapted plugins to the cleanup of external variables in olsrd Index: nameservice.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/nameservice/src/nameservice.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** nameservice.c 29 May 2005 12:47:42 -0000 1.14 --- nameservice.c 7 Jan 2006 08:17:43 -0000 1.15 *************** *** 217,221 **** if (name->ip.v4 == 0) { // insert main_addr ! memcpy(&name->ip, &main_addr, ipsize); prev = name; } else { --- 217,221 ---- if (name->ip.v4 == 0) { // insert main_addr ! memcpy(&name->ip, &olsr_cnf->main_addr, olsr_cnf->ipsize); prev = name; } else { *************** *** 240,244 **** if (have_dns_server) { if (my_dns_server.v4 == 0) { ! memcpy(&my_dns_server, &main_addr, ipsize); printf("\nNAME PLUGIN: announcing upstream DNS server: %s\n", olsr_ip_to_string(&my_dns_server)); --- 240,244 ---- if (have_dns_server) { if (my_dns_server.v4 == 0) { ! memcpy(&my_dns_server, &olsr_cnf->main_addr, olsr_cnf->ipsize); printf("\nNAME PLUGIN: announcing upstream DNS server: %s\n", olsr_ip_to_string(&my_dns_server)); *************** *** 355,359 **** message->v4.olsr_msgtype = MESSAGE_TYPE; message->v4.olsr_vtime = double_to_me(my_timeout); ! memcpy(&message->v4.originator, &main_addr, ipsize); message->v4.ttl = MAX_TTL; message->v4.hopcnt = 0; --- 355,359 ---- message->v4.olsr_msgtype = MESSAGE_TYPE; message->v4.olsr_vtime = double_to_me(my_timeout); ! memcpy(&message->v4.originator, &olsr_cnf->main_addr, olsr_cnf->ipsize); message->v4.ttl = MAX_TTL; message->v4.hopcnt = 0; *************** *** 370,374 **** message->v6.olsr_msgtype = MESSAGE_TYPE; message->v6.olsr_vtime = double_to_me(my_timeout); ! memcpy(&message->v6.originator, &main_addr, ipsize); message->v6.ttl = MAX_TTL; message->v6.hopcnt = 0; --- 370,374 ---- message->v6.olsr_msgtype = MESSAGE_TYPE; message->v6.olsr_vtime = double_to_me(my_timeout); ! memcpy(&message->v6.originator, &olsr_cnf->main_addr, olsr_cnf->ipsize); message->v6.ttl = MAX_TTL; message->v6.hopcnt = 0; *************** *** 404,408 **** /* Fetch the originator of the messsage */ ! memcpy(&originator, &m->v4.originator, ipsize); /* Fetch the message based on IP version */ --- 404,408 ---- /* Fetch the originator of the messsage */ ! memcpy(&originator, &m->v4.originator, olsr_cnf->ipsize); /* Fetch the message based on IP version */ *************** *** 420,424 **** /* Check if message originated from this node. If so - back off */ ! if(memcmp(&originator, &main_addr, ipsize) == 0) return; --- 420,424 ---- /* Check if message originated from this node. If so - back off */ ! if(memcmp(&originator, &olsr_cnf->main_addr, olsr_cnf->ipsize) == 0) return; *************** *** 471,475 **** to_packet->type = htons(NAME_FORWARDER); to_packet->len = htons(0); ! memcpy(&to_packet->ip, &my_dns_server, ipsize); pos += sizeof(struct name); i++; --- 471,475 ---- to_packet->type = htons(NAME_FORWARDER); to_packet->len = htons(0); ! memcpy(&to_packet->ip, &my_dns_server, olsr_cnf->ipsize); pos += sizeof(struct name); i++; *************** *** 485,489 **** to_packet->type = htons(my_name->type); to_packet->len = htons(my_name->len); ! memcpy(&to_packet->ip, &my_name->ip, ipsize); pos += sizeof(struct name); strncpy(pos, my_name->name, my_name->len); --- 485,489 ---- to_packet->type = htons(my_name->type); to_packet->len = htons(my_name->len); ! memcpy(&to_packet->ip, &my_name->ip, olsr_cnf->ipsize); pos += sizeof(struct name); strncpy(pos, my_name->name, my_name->len); *************** *** 535,539 **** tmp->len = ntohs(from_packet->len) > MAX_NAME ? MAX_NAME : ntohs(from_packet->len); tmp->name = olsr_malloc(tmp->len+1, "new name_entry name"); ! memcpy(&tmp->ip, &from_packet->ip, ipsize); pos += sizeof(struct name); strncpy(tmp->name, pos, tmp->len); --- 535,539 ---- tmp->len = ntohs(from_packet->len) > MAX_NAME ? MAX_NAME : ntohs(from_packet->len); tmp->name = olsr_malloc(tmp->len+1, "new name_entry name"); ! memcpy(&tmp->ip, &from_packet->ip, olsr_cnf->ipsize); pos += sizeof(struct name); strncpy(tmp->name, pos, tmp->len); *************** *** 572,576 **** for (entry = list[hash]; entry != NULL; entry = entry->next) { ! if (memcmp(originator, &entry->originator, ipsize) == 0) { // found olsr_printf(4, "NAME PLUGIN: %s found\n", --- 572,576 ---- for (entry = list[hash]; entry != NULL; entry = entry->next) { ! if (memcmp(originator, &entry->originator, olsr_cnf->ipsize) == 0) { // found olsr_printf(4, "NAME PLUGIN: %s found\n", *************** *** 591,595 **** entry = olsr_malloc(sizeof(struct db_entry), "new db_entry"); ! memcpy(&entry->originator, originator, ipsize); olsr_get_timestamp(vtime * 1000, &entry->timer); entry->names = NULL; --- 591,595 ---- entry = olsr_malloc(sizeof(struct db_entry), "new db_entry"); ! memcpy(&entry->originator, originator, olsr_cnf->ipsize); olsr_get_timestamp(vtime * 1000, &entry->timer); entry->names = NULL; *************** *** 727,731 **** tmp = olsr_malloc(sizeof(struct rt_entry), "new rt_entry"); ! memcpy(&tmp->rt_dst, &route->rt_dst, ipsize); tmp->rt_etx = route->rt_etx; tmp->next = best_routes; --- 727,731 ---- tmp = olsr_malloc(sizeof(struct rt_entry), "new rt_entry"); ! memcpy(&tmp->rt_dst, &route->rt_dst, olsr_cnf->ipsize); tmp->rt_etx = route->rt_etx; tmp->next = best_routes; *************** *** 748,752 **** tmp = olsr_malloc(sizeof(struct rt_entry), "new rt_entry"); ! memcpy(&tmp->rt_dst, &route->rt_dst, ipsize); tmp->rt_etx = route->rt_etx; tmp->next = last->next; --- 748,752 ---- tmp = olsr_malloc(sizeof(struct rt_entry), "new rt_entry"); ! memcpy(&tmp->rt_dst, &route->rt_dst, olsr_cnf->ipsize); tmp->rt_etx = route->rt_etx; tmp->next = last->next; From (spam-protected) Sat Jan 7 09:17:45 2006 From: (spam-protected) (Andreas Tønnesen) Date: Sat, 07 Jan 2006 08:17:45 +0000 Subject: [Olsr-cvs] olsrd-current/lib/httpinfo/src olsrd_httpinfo.c, 1.57, 1.58 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/httpinfo/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16043/httpinfo/src Modified Files: olsrd_httpinfo.c Log Message: Adapted plugins to the cleanup of external variables in olsrd Index: olsrd_httpinfo.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/httpinfo/src/olsrd_httpinfo.c,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** olsrd_httpinfo.c 22 Dec 2005 15:06:52 -0000 1.57 --- olsrd_httpinfo.c 7 Jan 2006 08:17:43 -0000 1.58 *************** *** 794,798 **** size += sprintf(&buf[size], "\n"); ! size += sprintf(&buf[size], "\n", olsr_ip_to_string(&main_addr)); size += sprintf(&buf[size], "\n", olsr_cnf->ip_version == AF_INET ? 4 : 6); --- 794,798 ---- size += sprintf(&buf[size], "
Main address: %sIP version: %d
\n"); ! size += sprintf(&buf[size], "\n", olsr_ip_to_string(&olsr_cnf->main_addr)); size += sprintf(&buf[size], "\n", olsr_cnf->ip_version == AF_INET ? 4 : 6); From (spam-protected) Sat Jan 7 09:17:45 2006 From: (spam-protected) (Andreas Tønnesen) Date: Sat, 07 Jan 2006 08:17:45 +0000 Subject: [Olsr-cvs] olsrd-current/lib/dot_draw/src olsrd_dot_draw.c, 1.20, 1.21 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/dot_draw/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16043/dot_draw/src Modified Files: olsrd_dot_draw.c Log Message: Adapted plugins to the cleanup of external variables in olsrd Index: olsrd_dot_draw.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/dot_draw/src/olsrd_dot_draw.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** olsrd_dot_draw.c 30 Dec 2005 02:23:59 -0000 1.20 --- olsrd_dot_draw.c 7 Jan 2006 08:17:43 -0000 1.21 *************** *** 160,164 **** char* style = "solid"; struct link_entry* link; ! adr = olsr_ip_to_string(&main_addr); sprintf( buf, "\"%s\" -> ", adr ); ipc_send_str(buf); --- 160,164 ---- char* style = "solid"; struct link_entry* link; ! adr = olsr_ip_to_string(&olsr_cnf->main_addr); sprintf( buf, "\"%s\" -> ", adr ); ipc_send_str(buf); From (spam-protected) Sat Jan 7 09:17:46 2006 From: (spam-protected) (Andreas Tønnesen) Date: Sat, 07 Jan 2006 08:17:46 +0000 Subject: [Olsr-cvs] olsrd-current/lib/pgraph/src olsrd_pgraph.c,1.2,1.3 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/pgraph/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16043/pgraph/src Modified Files: olsrd_pgraph.c Log Message: Adapted plugins to the cleanup of external variables in olsrd Index: olsrd_pgraph.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/pgraph/src/olsrd_pgraph.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** olsrd_pgraph.c 29 Dec 2005 19:48:43 -0000 1.2 --- olsrd_pgraph.c 7 Jan 2006 08:17:43 -0000 1.3 *************** *** 83,87 **** // struct link_entry* link; ! main_adr = olsr_ip_to_string(&main_addr); adr = olsr_ip_to_string(&neighbor->neighbor_main_addr); len = sprintf( buf, "add link %s %s\n", main_adr, adr ); --- 83,87 ---- // struct link_entry* link; ! main_adr = olsr_ip_to_string(&olsr_cnf->main_addr); adr = olsr_ip_to_string(&neighbor->neighbor_main_addr); len = sprintf( buf, "add link %s %s\n", main_adr, adr ); *************** *** 224,228 **** ipc_open = 1; olsr_printf(1, "(DOT DRAW)IPC: Connection from %s\n",addr); ! len = sprintf(buf, "add node %s\n", olsr_ip_to_string(&main_addr)); ipc_send(buf, len); pcf_event(1, 1, 1); --- 224,228 ---- ipc_open = 1; olsr_printf(1, "(DOT DRAW)IPC: Connection from %s\n",addr); ! len = sprintf(buf, "add node %s\n", olsr_ip_to_string(&olsr_cnf->main_addr)); ipc_send(buf, len); pcf_event(1, 1, 1); *************** *** 409,413 **** - #define COMP_IP(ip1, ip2) (!memcmp(ip1, ip2, ipsize)) struct link_entry *olsr_neighbor_best_link(union olsr_ip_addr *main) { --- 409,412 ---- From (spam-protected) Sat Jan 7 09:17:47 2006 From: (spam-protected) (Andreas Tønnesen) Date: Sat, 07 Jan 2006 08:17:47 +0000 Subject: [Olsr-cvs] olsrd-current/lib/tas/src plugin.c,1.6,1.7 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/tas/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16043/tas/src Modified Files: plugin.c Log Message: Adapted plugins to the cleanup of external variables in olsrd Index: plugin.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/tas/src/plugin.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** plugin.c 10 Nov 2005 19:50:42 -0000 1.6 --- plugin.c 7 Jan 2006 08:17:45 -0000 1.7 *************** *** 468,473 **** int olsrd_plugin_init() { ! ipAddrLen = ipsize; ! mainAddr = &main_addr; intTab = ifnet; --- 468,473 ---- int olsrd_plugin_init() { ! ipAddrLen = olsr_cnf->ipsize; ! mainAddr = &olsr_cnf->main_addr; intTab = ifnet; From (spam-protected) Sat Jan 7 09:17:47 2006 From: (spam-protected) (Andreas Tønnesen) Date: Sat, 07 Jan 2006 08:17:47 +0000 Subject: [Olsr-cvs] olsrd-current/lib/powerinfo/src olsrd_power.c,1.15,1.16 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/powerinfo/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16043/powerinfo/src Modified Files: olsrd_power.c Log Message: Adapted plugins to the cleanup of external variables in olsrd Index: olsrd_power.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/powerinfo/src/olsrd_power.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** olsrd_power.c 30 Dec 2005 02:24:00 -0000 1.15 --- olsrd_power.c 7 Jan 2006 08:17:44 -0000 1.16 *************** *** 309,313 **** message->v4.olsr_vtime = double_to_me(7.5); message->v4.olsr_msgsize = htons(sizeof(struct olsrmsg)); ! memcpy(&message->v4.originator, &main_addr, ipsize); message->v4.ttl = MAX_TTL; message->v4.hopcnt = 0; --- 309,313 ---- message->v4.olsr_vtime = double_to_me(7.5); message->v4.olsr_msgsize = htons(sizeof(struct olsrmsg)); ! memcpy(&message->v4.originator, &olsr_cnf->main_addr, olsr_cnf->ipsize); message->v4.ttl = MAX_TTL; message->v4.hopcnt = 0; *************** *** 332,336 **** message->v6.olsr_vtime = double_to_me(7.5); message->v6.olsr_msgsize = htons(sizeof(struct olsrmsg)); ! memcpy(&message->v6.originator, &main_addr, ipsize); message->v6.ttl = MAX_TTL; message->v6.hopcnt = 0; --- 332,336 ---- message->v6.olsr_vtime = double_to_me(7.5); message->v6.olsr_msgsize = htons(sizeof(struct olsrmsg)); ! memcpy(&message->v6.originator, &olsr_cnf->main_addr, olsr_cnf->ipsize); message->v6.ttl = MAX_TTL; message->v6.hopcnt = 0; *************** *** 374,378 **** /* Fetch the originator of the messsage */ ! memcpy(&originator, &m->v4.originator, ipsize); /* Fetch the message based on IP version */ --- 374,378 ---- /* Fetch the originator of the messsage */ ! memcpy(&originator, &m->v4.originator, olsr_cnf->ipsize); /* Fetch the message based on IP version */ *************** *** 389,393 **** /* Check if message originated from this node */ ! if(memcmp(&originator, &main_addr, ipsize) == 0) /* If so - back off */ return; --- 389,393 ---- /* Check if message originated from this node */ ! if(memcmp(&originator, &olsr_cnf->main_addr, olsr_cnf->ipsize) == 0) /* If so - back off */ return; *************** *** 453,457 **** entry = entry->next) { ! if(memcmp(originator, &entry->originator, ipsize) == 0) { entry->source_type = message->source_type; --- 453,457 ---- entry = entry->next) { ! if(memcmp(originator, &entry->originator, olsr_cnf->ipsize) == 0) { entry->source_type = message->source_type; *************** *** 478,482 **** /* Fill struct */ ! memcpy(&entry->originator, originator, ipsize); entry->source_type = message->source_type; --- 478,482 ---- /* Fill struct */ ! memcpy(&entry->originator, originator, olsr_cnf->ipsize); entry->source_type = message->source_type; From (spam-protected) Sat Jan 7 09:17:47 2006 From: (spam-protected) (Andreas Tønnesen) Date: Sat, 07 Jan 2006 08:17:47 +0000 Subject: [Olsr-cvs] olsrd-current/lib/secure/src olsrd_secure.c,1.17,1.18 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/secure/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16043/secure/src Modified Files: olsrd_secure.c Log Message: Adapted plugins to the cleanup of external variables in olsrd Index: olsrd_secure.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/secure/src/olsrd_secure.c,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** olsrd_secure.c 19 Nov 2005 08:37:23 -0000 1.17 --- olsrd_secure.c 7 Jan 2006 08:17:44 -0000 1.18 *************** *** 274,283 **** { /* IPv4 sender address */ ! memcpy(&from_addr, &((struct sockaddr_in *)&from)->sin_addr.s_addr, ipsize); } else { /* IPv6 sender address */ ! memcpy(&from_addr, &((struct sockaddr_in6 *)&from)->sin6_addr, ipsize); } --- 274,283 ---- { /* IPv4 sender address */ ! memcpy(&from_addr, &((struct sockaddr_in *)&from)->sin_addr.s_addr, olsr_cnf->ipsize); } else { /* IPv6 sender address */ ! memcpy(&from_addr, &((struct sockaddr_in6 *)&from)->sin6_addr, olsr_cnf->ipsize); } *************** *** 415,419 **** msg->olsr_vtime = 0; msg->olsr_msgsize = htons(sizeof(struct s_olsrmsg)); ! memcpy(&msg->originator, &main_addr, ipsize); msg->ttl = 1; msg->hopcnt = 0; --- 415,419 ---- msg->olsr_vtime = 0; msg->olsr_msgsize = htons(sizeof(struct s_olsrmsg)); ! memcpy(&msg->originator, &olsr_cnf->main_addr, olsr_cnf->ipsize); msg->ttl = 1; msg->hopcnt = 0; *************** *** 673,677 **** cmsg.olsr_vtime = 0; cmsg.olsr_msgsize = htons(sizeof(struct challengemsg)); ! memcpy(&cmsg.originator, &main_addr, ipsize); cmsg.ttl = 1; cmsg.hopcnt = 0; --- 673,677 ---- cmsg.olsr_vtime = 0; cmsg.olsr_msgsize = htons(sizeof(struct challengemsg)); ! memcpy(&cmsg.originator, &olsr_cnf->main_addr, olsr_cnf->ipsize); cmsg.ttl = 1; cmsg.hopcnt = 0; *************** *** 679,683 **** /* Fill subheader */ ! memcpy(&cmsg.destination, new_host, ipsize); cmsg.challenge = htonl(challenge); --- 679,683 ---- /* Fill subheader */ ! memcpy(&cmsg.destination, new_host, olsr_cnf->ipsize); cmsg.challenge = htonl(challenge); *************** *** 712,716 **** entry->challenge = challenge; ! memcpy(&entry->addr, new_host, ipsize); /* update validtime - not validated */ --- 712,716 ---- entry->challenge = challenge; ! memcpy(&entry->addr, new_host, olsr_cnf->ipsize); /* update validtime - not validated */ *************** *** 786,794 **** memcpy(checksum_cache, &entry->challenge, 4); /* Then the local IP */ ! memcpy(&checksum_cache[sizeof(olsr_u32_t)], &msg->originator, ipsize); /* Create the hash */ CHECKSUM(checksum_cache, ! sizeof(olsr_u32_t) + ipsize, sha1_hash); --- 786,794 ---- memcpy(checksum_cache, &entry->challenge, 4); /* Then the local IP */ ! memcpy(&checksum_cache[sizeof(olsr_u32_t)], &msg->originator, olsr_cnf->ipsize); /* Create the hash */ CHECKSUM(checksum_cache, ! sizeof(olsr_u32_t) + olsr_cnf->ipsize, sha1_hash); *************** *** 881,889 **** memcpy(checksum_cache, &entry->challenge, 4); /* Then the local IP */ ! memcpy(&checksum_cache[sizeof(olsr_u32_t)], &msg->originator, ipsize); /* Create the hash */ CHECKSUM(checksum_cache, ! sizeof(olsr_u32_t) + ipsize, sha1_hash); --- 881,889 ---- memcpy(checksum_cache, &entry->challenge, 4); /* Then the local IP */ ! memcpy(&checksum_cache[sizeof(olsr_u32_t)], &msg->originator, olsr_cnf->ipsize); /* Create the hash */ CHECKSUM(checksum_cache, ! sizeof(olsr_u32_t) + olsr_cnf->ipsize, sha1_hash); *************** *** 940,944 **** { entry = malloc(sizeof(struct stamp)); ! memcpy(&entry->addr, &msg->originator, ipsize); hash = olsr_hashing((union olsr_ip_addr *)&msg->originator); --- 940,944 ---- { entry = malloc(sizeof(struct stamp)); ! memcpy(&entry->addr, &msg->originator, olsr_cnf->ipsize); hash = olsr_hashing((union olsr_ip_addr *)&msg->originator); *************** *** 1033,1037 **** crmsg.olsr_vtime = 0; crmsg.olsr_msgsize = htons(sizeof(struct c_respmsg)); ! memcpy(&crmsg.originator, &main_addr, ipsize); crmsg.ttl = 1; crmsg.hopcnt = 0; --- 1033,1037 ---- crmsg.olsr_vtime = 0; crmsg.olsr_msgsize = htons(sizeof(struct c_respmsg)); ! memcpy(&crmsg.originator, &olsr_cnf->main_addr, olsr_cnf->ipsize); crmsg.ttl = 1; crmsg.hopcnt = 0; *************** *** 1043,1047 **** /* Fill subheader */ ! memcpy(&crmsg.destination, to, ipsize); crmsg.challenge = htonl(challenge); --- 1043,1047 ---- /* Fill subheader */ ! memcpy(&crmsg.destination, to, olsr_cnf->ipsize); crmsg.challenge = htonl(challenge); *************** *** 1052,1060 **** memcpy(checksum_cache, &chal_in, 4); /* Then the local IP */ ! memcpy(&checksum_cache[sizeof(olsr_u32_t)], from, ipsize); /* Create the hash */ CHECKSUM(checksum_cache, ! sizeof(olsr_u32_t) + ipsize, crmsg.res_sig); --- 1052,1060 ---- memcpy(checksum_cache, &chal_in, 4); /* Then the local IP */ ! memcpy(&checksum_cache[sizeof(olsr_u32_t)], from, olsr_cnf->ipsize); /* Create the hash */ CHECKSUM(checksum_cache, ! sizeof(olsr_u32_t) + olsr_cnf->ipsize, crmsg.res_sig); *************** *** 1107,1111 **** rrmsg.olsr_vtime = 0; rrmsg.olsr_msgsize = htons(sizeof(struct r_respmsg)); ! memcpy(&rrmsg.originator, &main_addr, ipsize); rrmsg.ttl = 1; rrmsg.hopcnt = 0; --- 1107,1111 ---- rrmsg.olsr_vtime = 0; rrmsg.olsr_msgsize = htons(sizeof(struct r_respmsg)); ! memcpy(&rrmsg.originator, &olsr_cnf->main_addr, olsr_cnf->ipsize); rrmsg.ttl = 1; rrmsg.hopcnt = 0; *************** *** 1117,1121 **** /* Fill subheader */ ! memcpy(&rrmsg.destination, to, ipsize); /* Create digest of received challenge + IP */ --- 1117,1121 ---- /* Fill subheader */ ! memcpy(&rrmsg.destination, to, olsr_cnf->ipsize); /* Create digest of received challenge + IP */ *************** *** 1125,1133 **** memcpy(checksum_cache, &chal_in, 4); /* Then the local IP */ ! memcpy(&checksum_cache[sizeof(olsr_u32_t)], from, ipsize); /* Create the hash */ CHECKSUM(checksum_cache, ! sizeof(olsr_u32_t) + ipsize, rrmsg.res_sig); --- 1125,1133 ---- memcpy(checksum_cache, &chal_in, 4); /* Then the local IP */ ! memcpy(&checksum_cache[sizeof(olsr_u32_t)], from, olsr_cnf->ipsize); /* Create the hash */ CHECKSUM(checksum_cache, ! sizeof(olsr_u32_t) + olsr_cnf->ipsize, rrmsg.res_sig); *************** *** 1172,1176 **** entry = entry->next) { ! if(memcmp(&entry->addr, adr, ipsize) == 0) { olsr_printf(3, "[ENC]Match for %s\n", olsr_ip_to_string(adr)); --- 1172,1176 ---- entry = entry->next) { ! if(memcmp(&entry->addr, adr, olsr_cnf->ipsize) == 0) { olsr_printf(3, "[ENC]Match for %s\n", olsr_ip_to_string(adr)); From (spam-protected) Sat Jan 7 09:16:24 2006 From: (spam-protected) (Andreas Tønnesen) Date: Sat, 07 Jan 2006 08:16:24 +0000 Subject: [Olsr-cvs] olsrd-current/src build_msg.c, 1.31, 1.32 build_msg.h, 1.12, 1.13 defs.c, 1.1, 1.2 defs.h, 1.51, 1.52 generate_msg.c, 1.23, 1.24 interfaces.c, 1.27, 1.28 interfaces.h, 1.31, 1.32 ipc_frontend.c, 1.27, 1.28 link_set.c, 1.62, 1.63 local_hna_set.c, 1.10, 1.11 lq_mpr.c, 1.10, 1.11 lq_packet.c, 1.19, 1.20 lq_route.c, 1.40, 1.41 main.c, 1.83, 1.84 mpr.c, 1.14, 1.15 mpr_selector_set.c, 1.14, 1.15 neighbor_table.c, 1.29, 1.30 net_olsr.c, 1.9, 1.10 net_olsr.h, 1.2, 1.3 olsr.c, 1.47, 1.48 olsr_cfg.h, 1.28, 1.29 olsr_protocol.h, 1.19, 1.20 packet.c, 1.20, 1.21 parser.c, 1.29, 1.30 parser.h, 1.10, 1.11 print_packet.c, 1.8, 1.9 process_package.c, 1.36, 1.37 scheduler.c, 1.33, 1.34 scheduler.h, 1.11, 1.12 tc_set.c, 1.23, 1.24 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15798 Modified Files: build_msg.c build_msg.h defs.c defs.h generate_msg.c interfaces.c interfaces.h ipc_frontend.c link_set.c local_hna_set.c lq_mpr.c lq_packet.c lq_route.c main.c mpr.c mpr_selector_set.c neighbor_table.c net_olsr.c net_olsr.h olsr.c olsr_cfg.h olsr_protocol.h packet.c parser.c parser.h print_packet.c process_package.c scheduler.c scheduler.h tc_set.c Log Message: Cleanup in use of extern variables. Rather trivial changes, but a lot of them Index: generate_msg.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/generate_msg.c,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** generate_msg.c 27 Feb 2005 18:39:43 -0000 1.23 --- generate_msg.c 7 Jan 2006 08:16:20 -0000 1.24 *************** *** 87,91 **** olsr_build_tc_packet(&tcpacket); ! if(queue_tc(&tcpacket, ifn) && TIMED_OUT(fwdtimer[ifn->if_nr])) { set_buffer_timer(ifn); --- 87,91 ---- olsr_build_tc_packet(&tcpacket); ! if(queue_tc(&tcpacket, ifn) && TIMED_OUT(ifn->fwdtimer)) { set_buffer_timer(ifn); *************** *** 100,104 **** struct interface *ifn = (struct interface *)p; ! if(queue_mid(ifn) && TIMED_OUT(fwdtimer[ifn->if_nr])) { set_buffer_timer(ifn); --- 100,104 ---- struct interface *ifn = (struct interface *)p; ! if(queue_mid(ifn) && TIMED_OUT(ifn->fwdtimer)) { set_buffer_timer(ifn); *************** *** 114,118 **** struct interface *ifn = (struct interface *)p; ! if(queue_hna(ifn) && TIMED_OUT(fwdtimer[ifn->if_nr])) { set_buffer_timer(ifn); --- 114,118 ---- struct interface *ifn = (struct interface *)p; ! if(queue_hna(ifn) && TIMED_OUT(ifn->fwdtimer)) { set_buffer_timer(ifn); Index: olsr_protocol.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/olsr_protocol.h,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** olsr_protocol.h 11 Oct 2005 14:55:55 -0000 1.19 --- olsr_protocol.h 7 Jan 2006 08:16:20 -0000 1.20 *************** *** 190,196 **** */ ! #define COMP_IP(ip1, ip2) (!memcmp(ip1, ip2, ipsize)) ! #define COPY_IP(to, from) memcpy(to, from, ipsize) --- 190,196 ---- */ ! #define COMP_IP(ip1, ip2) (!memcmp(ip1, ip2, olsr_cnf->ipsize)) ! #define COPY_IP(to, from) memcpy(to, from, olsr_cnf->ipsize) Index: link_set.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/link_set.c,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** link_set.c 17 Nov 2005 04:25:44 -0000 1.62 --- link_set.c 7 Jan 2006 08:16:20 -0000 1.63 *************** *** 96,100 **** /* Timers */ ! hold_time_neighbor = (NEIGHB_HOLD_TIME*1000) / system_tick_divider; olsr_register_timeout_function(&olsr_time_out_link_set); --- 96,100 ---- /* Timers */ ! hold_time_neighbor = (NEIGHB_HOLD_TIME*1000) / olsr_cnf->system_tick_divider; olsr_register_timeout_function(&olsr_time_out_link_set); *************** *** 982,986 **** // announce this neighbour ! changes = OLSR_TRUE; } } --- 982,986 ---- // announce this neighbour ! signal_link_changes(OLSR_TRUE); } } Index: neighbor_table.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/neighbor_table.c,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** neighbor_table.c 29 Nov 2005 18:37:58 -0000 1.29 --- neighbor_table.c 7 Jan 2006 08:16:20 -0000 1.30 *************** *** 365,369 **** changes_topology = OLSR_TRUE; if(olsr_cnf->tc_redundancy > 1) ! changes = OLSR_TRUE; } entry->status = SYM; --- 365,369 ---- changes_topology = OLSR_TRUE; if(olsr_cnf->tc_redundancy > 1) ! signal_link_changes(OLSR_TRUE); } entry->status = SYM; *************** *** 376,380 **** changes_topology = OLSR_TRUE; if(olsr_cnf->tc_redundancy > 1) ! changes = OLSR_TRUE; } /* else N_status is set to NOT_SYM */ --- 376,380 ---- changes_topology = OLSR_TRUE; if(olsr_cnf->tc_redundancy > 1) ! signal_link_changes(OLSR_TRUE); } /* else N_status is set to NOT_SYM */ Index: interfaces.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/interfaces.c,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** interfaces.c 3 Jun 2005 08:00:55 -0000 1.27 --- interfaces.c 7 Jan 2006 08:16:20 -0000 1.28 *************** *** 90,94 **** memset(&addrsock, 0, sizeof (addrsock)); addrsock.sin_family = AF_INET; ! addrsock.sin_port = olsr_udp_port; (addrsock.sin_addr).s_addr = INADDR_ANY; } --- 90,94 ---- memset(&addrsock, 0, sizeof (addrsock)); addrsock.sin_family = AF_INET; ! addrsock.sin_port = htons(OLSRPORT); (addrsock.sin_addr).s_addr = INADDR_ANY; } *************** *** 98,102 **** memset(&addrsock6, 0, sizeof (addrsock6)); addrsock6.sin6_family = AF_INET6; ! addrsock6.sin6_port = olsr_udp_port; //(addrsock6.sin6_addr).s_addr = IN6ADDR_ANY_INIT; } --- 98,102 ---- memset(&addrsock6, 0, sizeof (addrsock6)); addrsock6.sin6_family = AF_INET6; ! addrsock6.sin6_port = htons(OLSRPORT); //(addrsock6.sin6_addr).s_addr = IN6ADDR_ANY_INIT; } Index: print_packet.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/print_packet.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** print_packet.c 19 Nov 2005 08:49:44 -0000 1.8 --- print_packet.c 7 Jan 2006 08:16:20 -0000 1.9 *************** *** 286,290 **** haddr = (union olsr_ip_addr *)&haddr->v6.s6_addr[8]) { ! olsr_u8_t *quality = (olsr_u8_t *)haddr + ipsize; fprintf(handle, " ++ %s\n", olsr_ip_to_string(haddr)); fprintf(handle, " ++ LQ = %d, RLQ = %d\n", quality[0], quality[1]); --- 286,290 ---- haddr = (union olsr_ip_addr *)&haddr->v6.s6_addr[8]) { ! olsr_u8_t *quality = (olsr_u8_t *)haddr + olsr_cnf->ipsize; fprintf(handle, " ++ %s\n", olsr_ip_to_string(haddr)); fprintf(handle, " ++ LQ = %d, RLQ = %d\n", quality[0], quality[1]); *************** *** 314,318 **** haddr++) { ! olsr_u8_t *quality = (olsr_u8_t *)haddr + ipsize; fprintf(handle, " ++ %s\n", olsr_ip_to_string(haddr)); fprintf(handle, " ++ LQ = %d, RLQ = %d\n", quality[0], quality[1]); --- 314,318 ---- haddr++) { ! olsr_u8_t *quality = (olsr_u8_t *)haddr + olsr_cnf->ipsize; fprintf(handle, " ++ %s\n", olsr_ip_to_string(haddr)); fprintf(handle, " ++ LQ = %d, RLQ = %d\n", quality[0], quality[1]); *************** *** 336,345 **** { fprintf(handle, " +Neighbor: %s\n", olsr_ip_to_string((union olsr_ip_addr *) data)); ! data += ipsize; fprintf(handle, " +LQ: %d, ", *data); data += 1; fprintf(handle, "RLQ: %d\n", *data); data += 2; ! remsize -= (ipsize + 4); } --- 336,345 ---- { fprintf(handle, " +Neighbor: %s\n", olsr_ip_to_string((union olsr_ip_addr *) data)); ! data += olsr_cnf->ipsize; fprintf(handle, " +LQ: %d, ", *data); data += 1; fprintf(handle, "RLQ: %d\n", *data); data += 2; ! remsize -= (olsr_cnf->ipsize + 4); } *************** *** 360,366 **** { fprintf(handle, " +Neighbor: %s\n", olsr_ip_to_string((union olsr_ip_addr *) data)); ! data += ipsize; ! remsize -= ipsize; } --- 360,366 ---- { fprintf(handle, " +Neighbor: %s\n", olsr_ip_to_string((union olsr_ip_addr *) data)); ! data += olsr_cnf->ipsize; ! remsize -= olsr_cnf->ipsize; } *************** *** 376,384 **** { fprintf(handle, " +Network: %s\n", olsr_ip_to_string((union olsr_ip_addr *) data)); ! data += ipsize; fprintf(handle, " +Netmask: %s\n", olsr_ip_to_string((union olsr_ip_addr *) data)); ! data += ipsize; ! remsize -= (ipsize*2); } --- 376,384 ---- { fprintf(handle, " +Network: %s\n", olsr_ip_to_string((union olsr_ip_addr *) data)); ! data += olsr_cnf->ipsize; fprintf(handle, " +Netmask: %s\n", olsr_ip_to_string((union olsr_ip_addr *) data)); ! data += olsr_cnf->ipsize; ! remsize -= (olsr_cnf->ipsize*2); } *************** *** 393,398 **** { fprintf(handle, " +Alias: %s\n", olsr_ip_to_string((union olsr_ip_addr *) data)); ! data += ipsize; ! remsize -= ipsize; } } --- 393,398 ---- { fprintf(handle, " +Alias: %s\n", olsr_ip_to_string((union olsr_ip_addr *) data)); ! data += olsr_cnf->ipsize; ! remsize -= olsr_cnf->ipsize; } } Index: interfaces.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/interfaces.h,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** interfaces.h 6 Jan 2006 06:54:04 -0000 1.31 --- interfaces.h 7 Jan 2006 08:16:20 -0000 1.32 *************** *** 46,49 **** --- 46,50 ---- #include #include + #include #include "olsr_types.h" *************** *** 136,139 **** --- 137,142 ---- struct vtimes valtimes; + clock_t fwdtimer; /* Timeout for OLSR forwarding on this if */ + void *libnet_ctx; /* libnet context(void to avoid dependency */ Index: local_hna_set.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/local_hna_set.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** local_hna_set.c 27 Feb 2005 18:39:43 -0000 1.10 --- local_hna_set.c 7 Jan 2006 08:16:20 -0000 1.11 *************** *** 111,115 **** while(h6) { ! if((memcmp(net, &h6->net, ipsize) == 0) && (prefix_len == h6->prefix_len)) { --- 111,115 ---- while(h6) { ! if((memcmp(net, &h6->net, olsr_cnf->ipsize) == 0) && (prefix_len == h6->prefix_len)) { Index: process_package.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/process_package.c,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** process_package.c 29 Nov 2005 18:38:40 -0000 1.36 --- process_package.c 7 Jan 2006 08:16:20 -0000 1.37 *************** *** 53,56 **** --- 53,57 ---- #include "duplicate_set.h" #include "rebuild_packet.h" + #include "scheduler.h" *************** *** 143,147 **** // announce this neighbour ! changes = OLSR_TRUE; } } --- 144,148 ---- // announce this neighbour ! signal_link_changes(OLSR_TRUE); } } Index: lq_route.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/lq_route.c,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** lq_route.c 29 Nov 2005 18:37:58 -0000 1.40 --- lq_route.c 7 Jan 2006 08:16:20 -0000 1.41 *************** *** 75,79 **** static int avl_comp_ipv6(void *ip1, void *ip2) { ! return memcmp(ip1, ip2, ipsize); } --- 75,79 ---- static int avl_comp_ipv6(void *ip1, void *ip2) { ! return memcmp(ip1, ip2, olsr_cnf->ipsize); } *************** *** 206,210 **** // add the vertex to the list, if it's not us ! if ((*comp)(&main_addr, node->key) != 0) { vert->node.data = vert; --- 206,210 ---- // add the vertex to the list, if it's not us ! if ((*comp)(&olsr_cnf->main_addr, node->key) != 0) { vert->node.data = vert; *************** *** 224,228 **** // make ourselves the first vertex in the list ! node = avl_find(vertex_tree, &main_addr); vert = node->data; --- 224,228 ---- // make ourselves the first vertex in the list ! node = avl_find(vertex_tree, &olsr_cnf->main_addr); vert = node->data; *************** *** 371,375 **** struct interface *inter; ! if (ipsize == 4) avl_comp = avl_comp_ipv4; --- 371,375 ---- struct interface *inter; ! if (olsr_cnf->ipsize == 4) avl_comp = avl_comp_ipv4; *************** *** 384,388 **** // add ourselves to the vertex tree ! add_vertex(&vertex_tree, &main_addr, 0.0); // add our neighbours --- 384,388 ---- // add ourselves to the vertex tree ! add_vertex(&vertex_tree, &olsr_cnf->main_addr, 0.0); // add our neighbours *************** *** 435,439 **** etx = 1.0 / (link->loss_link_quality2 * link->neigh_link_quality2); ! add_edge(&vertex_tree, &neigh->neighbor_main_addr, &main_addr, etx); } } --- 435,439 ---- etx = 1.0 / (link->loss_link_quality2 * link->neigh_link_quality2); ! add_edge(&vertex_tree, &neigh->neighbor_main_addr, &olsr_cnf->main_addr, etx); } } Index: defs.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/defs.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** defs.c 29 May 2005 12:47:45 -0000 1.1 --- defs.c 7 Jan 2006 08:16:20 -0000 1.2 *************** *** 5,13 **** struct olsrd_config *olsr_cnf; - olsr_u16_t system_tick_divider; - - int exit_value; - - /* Timer data */ clock_t now_times; /* current idea of times(2) reported uptime */ --- 5,8 ---- *************** *** 15,46 **** struct tm *nowtm; /* current idea of time (in tm) */ - olsr_bool disp_pack_in; /* display incoming packet content? */ - olsr_bool disp_pack_out; /* display outgoing packet content? */ - - olsr_bool del_gws; - - float will_int; - float max_jitter; - - size_t ipsize; - - union olsr_ip_addr main_addr; - - int olsr_udp_port; - - int ioctl_s; - - #if defined __FreeBSD__ || defined __MacOSX__ || defined __NetBSD__ || defined __OpenBSD__ - int rts; - #endif - - float max_tc_vtime; - - clock_t fwdtimer[MAX_IFS]; /* forwarding timer */ - - int minsize; - - olsr_bool changes; /* is set if changes occur in MPRS set */ - - /* TC empty message sending */ - clock_t send_empty_tc; --- 10,11 ---- Index: net_olsr.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/net_olsr.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** net_olsr.h 6 Jan 2006 06:54:37 -0000 1.2 --- net_olsr.h 7 Jan 2006 08:16:20 -0000 1.3 *************** *** 75,78 **** --- 75,81 ---- void + net_set_disp_pack_out(olsr_bool); + + void init_net(void); Index: defs.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/defs.h,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** defs.h 4 Jan 2006 15:51:19 -0000 1.51 --- defs.h 7 Jan 2006 08:16:20 -0000 1.52 *************** *** 75,78 **** --- 75,79 ---- #define MAX_IFS 16 + #define MIN_PACKET_SIZE(ver) (int)(sizeof(olsr_u8_t) * ((ver == AF_INET) ? 4 : 7)) /* Debug helper macro */ #ifdef DEBUG *************** *** 98,102 **** according to system ticks returned by times(2) */ #define GET_TIMESTAMP(s1) \ ! (now_times + ((s1) / system_tick_divider)) #define TIMED_OUT(s1) \ --- 99,103 ---- according to system ticks returned by times(2) */ #define GET_TIMESTAMP(s1) \ ! (now_times + ((s1) / olsr_cnf->system_tick_divider)) #define TIMED_OUT(s1) \ *************** *** 127,136 **** extern struct olsrd_config *olsr_cnf; - /* Global tick resolution */ - extern olsr_u16_t system_tick_divider; - - extern int exit_value; /* Global return value for process termination */ - - /* Timer data */ extern clock_t now_times; /* current idea of times(2) reported uptime */ --- 128,131 ---- *************** *** 138,180 **** extern struct tm *nowtm; /* current idea of time (in tm) */ - extern olsr_bool disp_pack_in; /* display incoming packet content? */ - extern olsr_bool disp_pack_out; /* display outgoing packet content? */ - - extern olsr_bool del_gws; - - /* - * Timer values - */ - - extern float will_int; - extern float max_jitter; - - extern size_t ipsize; - - /* Main address of this node */ - extern union olsr_ip_addr main_addr; - - /* OLSR UPD port */ - extern int olsr_udp_port; - - /* The socket used for all ioctls */ - extern int ioctl_s; - - /* routing socket */ - #if defined __FreeBSD__ || defined __MacOSX__ || defined __NetBSD__ || defined __OpenBSD__ - extern int rts; - #endif - - extern float max_tc_vtime; - - extern clock_t fwdtimer[MAX_IFS]; /* forwarding timer */ - - extern int minsize; - - extern olsr_bool changes; /* is set if changes occur in MPRS set */ - - /* TC empty message sending */ - extern clock_t send_empty_tc; - /* *IPC functions --- 133,136 ---- Index: packet.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/packet.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** packet.c 27 Feb 2005 10:43:38 -0000 1.20 --- packet.c 7 Jan 2006 08:16:20 -0000 1.21 *************** *** 47,55 **** #include "olsr.h" #include "neighbor_table.h" static olsr_bool sending_tc = OLSR_FALSE; - - /** *Free the memory allocated for a HELLO packet. --- 47,54 ---- #include "olsr.h" #include "neighbor_table.h" + #include "build_msg.h" static olsr_bool sending_tc = OLSR_FALSE; /** *Free the memory allocated for a HELLO packet. *************** *** 114,118 **** message->ttl = 1; ! COPY_IP(&message->source_addr, &main_addr); #ifdef DEBUG --- 113,117 ---- message->ttl = 1; ! COPY_IP(&message->source_addr, &olsr_cnf->main_addr); #ifdef DEBUG *************** *** 356,361 **** message->ansn = get_local_ansn(); ! COPY_IP(&message->originator, &main_addr); ! COPY_IP(&message->source_addr, &main_addr); --- 355,360 ---- message->ansn = get_local_ansn(); ! COPY_IP(&message->originator, &olsr_cnf->main_addr); ! COPY_IP(&message->source_addr, &olsr_cnf->main_addr); *************** *** 431,435 **** /* Send empty TC */ OLSR_PRINTF(3, "No more MPR selectors - will send empty TCs\n") ! send_empty_tc = GET_TIMESTAMP((max_tc_vtime*3)*1000); sending_tc = OLSR_FALSE; --- 430,434 ---- /* Send empty TC */ OLSR_PRINTF(3, "No more MPR selectors - will send empty TCs\n") ! set_empty_tc_timer(GET_TIMESTAMP((olsr_cnf->max_tc_vtime*3)*1000)); sending_tc = OLSR_FALSE; Index: lq_packet.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/lq_packet.c,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** lq_packet.c 17 Nov 2005 01:58:51 -0000 1.19 --- lq_packet.c 7 Jan 2006 08:16:20 -0000 1.20 *************** *** 54,57 **** --- 54,58 ---- #include "hysteresis.h" #include "olsr.h" + #include "build_msg.h" olsr_bool lq_tc_pending = OLSR_FALSE; *************** *** 71,75 **** lq_hello->comm.size = 0; ! COPY_IP(&lq_hello->comm.orig, &main_addr); lq_hello->comm.ttl = 1; --- 72,76 ---- lq_hello->comm.size = 0; ! COPY_IP(&lq_hello->comm.orig, &olsr_cnf->main_addr); lq_hello->comm.ttl = 1; *************** *** 164,168 **** lq_tc->comm.size = 0; ! COPY_IP(&lq_tc->comm.orig, &main_addr); if (olsr_cnf->lq_fish > 0) --- 165,169 ---- lq_tc->comm.size = 0; ! COPY_IP(&lq_tc->comm.orig, &olsr_cnf->main_addr); if (olsr_cnf->lq_fish > 0) *************** *** 182,186 **** lq_tc->comm.seqno = get_msg_seqno(); ! COPY_IP(&lq_tc->from, &main_addr); lq_tc->ansn = get_local_ansn(); --- 183,187 ---- lq_tc->comm.seqno = get_msg_seqno(); ! COPY_IP(&lq_tc->from, &olsr_cnf->main_addr); lq_tc->ansn = get_local_ansn(); *************** *** 341,345 **** // force signed comparison ! if (rem < (int)(sizeof (struct lq_hello_info_header) + ipsize + 4)) { net_output(outif); --- 342,346 ---- // force signed comparison ! if (rem < (int)(sizeof (struct lq_hello_info_header) + olsr_cnf->ipsize + 4)) { net_output(outif); *************** *** 371,375 **** // information ! req = ipsize + 4; // no, we also need space for an info header, as this is the --- 372,376 ---- // information ! req = olsr_cnf->ipsize + 4; // no, we also need space for an info header, as this is the *************** *** 426,430 **** COPY_IP(buff + size, &neigh->addr); ! size += ipsize; // add the corresponding link quality --- 427,431 ---- COPY_IP(buff + size, &neigh->addr); ! size += olsr_cnf->ipsize; // add the corresponding link quality *************** *** 501,505 **** // force signed comparison ! if (rem < (int)(ipsize + 4)) { net_output(outif); --- 502,506 ---- // force signed comparison ! if (rem < (int)(olsr_cnf->ipsize + 4)) { net_output(outif); *************** *** 517,521 **** // force signed comparison ! if ((int)(size + ipsize + 4) > rem) { // finalize the OLSR header --- 518,522 ---- // force signed comparison ! if ((int)(size + olsr_cnf->ipsize + 4) > rem) { // finalize the OLSR header *************** *** 540,544 **** COPY_IP(buff + size, &neigh->main); ! size += ipsize; // add the corresponding link quality --- 541,545 ---- COPY_IP(buff + size, &neigh->main); ! size += olsr_cnf->ipsize; // add the corresponding link quality *************** *** 645,649 **** COPY_IP(&neigh->addr, curr); ! curr += ipsize; neigh->link_quality = (double)*curr++ / 255.0; --- 646,650 ---- COPY_IP(&neigh->addr, curr); ! curr += olsr_cnf->ipsize; neigh->link_quality = (double)*curr++ / 255.0; *************** *** 703,707 **** COPY_IP(&neigh->main, curr); ! curr += ipsize; neigh->link_quality = (double)*curr++ / 255.0; --- 704,708 ---- COPY_IP(&neigh->main, curr); ! curr += olsr_cnf->ipsize; neigh->link_quality = (double)*curr++ / 255.0; *************** *** 765,769 **** // initialize timer ! send_empty_tc = GET_TIMESTAMP((max_tc_vtime * 3) * 1000); prev_empty = 1; --- 766,770 ---- // initialize timer ! set_empty_tc_timer(GET_TIMESTAMP((olsr_cnf->max_tc_vtime * 3) * 1000)); prev_empty = 1; *************** *** 776,780 **** // c) this is not the first empty message, send if timer hasn't fired ! else if (!TIMED_OUT(send_empty_tc)) serialize_lq_tc(&lq_tc, outif); --- 777,781 ---- // c) this is not the first empty message, send if timer hasn't fired ! else if (!TIMED_OUT(get_empty_tc_timer())) serialize_lq_tc(&lq_tc, outif); *************** *** 783,787 **** destroy_lq_tc(&lq_tc); ! if(net_output_pending(outif) && TIMED_OUT(fwdtimer[outif->if_nr])) set_buffer_timer(outif); } --- 784,788 ---- destroy_lq_tc(&lq_tc); ! if(net_output_pending(outif) && TIMED_OUT(outif->fwdtimer)) set_buffer_timer(outif); } Index: net_olsr.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/net_olsr.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** net_olsr.c 6 Jan 2006 07:21:04 -0000 1.9 --- net_olsr.c 7 Jan 2006 08:16:20 -0000 1.10 *************** *** 55,58 **** --- 55,61 ---- extern olsr_bool lq_tc_pending; + static olsr_bool disp_pack_out = OLSR_FALSE; + + #ifdef WIN32 #define perror(x) WinSockPError(x) *************** *** 103,106 **** --- 106,116 ---- #endif + + void + net_set_disp_pack_out(olsr_bool val) + { + disp_pack_out = val; + } + void init_net() *************** *** 441,445 **** if (sin->sin_port == 0) ! sin->sin_port = olsr_udp_port; } else --- 451,455 ---- if (sin->sin_port == 0) ! sin->sin_port = htons(OLSRPORT); } else *************** *** 596,600 **** i = 0; ! memset(adr, 0, ipsize); for(;p > 0; p -= 8) --- 606,610 ---- i = 0; ! memset(adr, 0, olsr_cnf->ipsize); for(;p > 0; p -= 8) Index: build_msg.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/build_msg.c,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** build_msg.c 10 Nov 2005 19:35:12 -0000 1.31 --- build_msg.c 7 Jan 2006 08:16:19 -0000 1.32 *************** *** 67,70 **** --- 67,72 ---- static olsr_u8_t msg_buffer[MAXMESSAGESIZE - OLSR_HEADERSIZE]; + static clock_t send_empty_tc; /* TC empty message sending */ + /* Prototypes for internal functions */ *************** *** 97,101 **** --- 99,121 ---- serialize_hna6(struct interface *); + /** + * Set the timer that controls the generation of + * empty TC messages + */ + void + set_empty_tc_timer(clock_t empty_tc_new) + { + send_empty_tc = empty_tc_new; + } + /** + * Get the timer that controls the generation of + * empty TC messages + */ + clock_t + get_empty_tc_timer() + { + return send_empty_tc; + } /** *************** *** 279,283 **** m->v4.olsr_msgtype = HELLO_MESSAGE; /* Set source(main) addr */ ! COPY_IP(&m->v4.originator, &main_addr); m->v4.olsr_vtime = ifp->valtimes.hello; --- 299,303 ---- m->v4.olsr_msgtype = HELLO_MESSAGE; /* Set source(main) addr */ ! COPY_IP(&m->v4.originator, &olsr_cnf->main_addr); m->v4.olsr_vtime = ifp->valtimes.hello; *************** *** 330,334 **** * 4 bytes */ ! if((curr_size + ipsize + (first_entry ? 4 : 0)) > remainsize) { /* Only send partial HELLO if it contains data */ --- 350,354 ---- * 4 bytes */ ! if((curr_size + olsr_cnf->ipsize + (first_entry ? 4 : 0)) > remainsize) { /* Only send partial HELLO if it contains data */ *************** *** 361,365 **** /* Sanity check */ ! check_buffspace(curr_size + ipsize + 4, remainsize, "HELLO2"); } --- 381,385 ---- /* Sanity check */ ! check_buffspace(curr_size + olsr_cnf->ipsize + 4, remainsize, "HELLO2"); } *************** *** 376,380 **** /* Point to next address */ haddr = (union olsr_ip_addr *)&haddr->v6.s6_addr[4]; ! curr_size += ipsize; /* IP address added */ first_entry = OLSR_FALSE; --- 396,400 ---- /* Point to next address */ haddr = (union olsr_ip_addr *)&haddr->v6.s6_addr[4]; ! curr_size += olsr_cnf->ipsize; /* IP address added */ first_entry = OLSR_FALSE; *************** *** 439,443 **** remainsize = net_outbuffer_bytes_left(ifp); } ! check_buffspace(curr_size + ipsize + 4, remainsize, "HELLO"); h6 = &m->v6.message.hello; --- 459,463 ---- remainsize = net_outbuffer_bytes_left(ifp); } ! check_buffspace(curr_size + olsr_cnf->ipsize + 4, remainsize, "HELLO"); h6 = &m->v6.message.hello; *************** *** 450,454 **** m->v6.hopcnt = 0; /* Set source(main) addr */ ! COPY_IP(&m->v6.originator, &main_addr); m->v6.olsr_msgtype = HELLO_MESSAGE; --- 470,474 ---- m->v6.hopcnt = 0; /* Set source(main) addr */ ! COPY_IP(&m->v6.originator, &olsr_cnf->main_addr); m->v6.olsr_msgtype = HELLO_MESSAGE; *************** *** 496,500 **** * 4 bytes */ ! if((curr_size + ipsize + (first_entry ? 4 : 0)) > remainsize) { /* Only send partial HELLO if it contains data */ --- 516,520 ---- * 4 bytes */ ! if((curr_size + olsr_cnf->ipsize + (first_entry ? 4 : 0)) > remainsize) { /* Only send partial HELLO if it contains data */ *************** *** 525,529 **** remainsize = net_outbuffer_bytes_left(ifp); ! check_buffspace(curr_size + ipsize + 4, remainsize, "HELLO2"); } --- 545,549 ---- remainsize = net_outbuffer_bytes_left(ifp); ! check_buffspace(curr_size + olsr_cnf->ipsize + 4, remainsize, "HELLO2"); } *************** *** 541,545 **** /* Point to next address */ haddr++; ! curr_size += ipsize; /* IP address added */ first_entry = OLSR_FALSE; --- 561,565 ---- /* Point to next address */ haddr++; ! curr_size += olsr_cnf->ipsize; /* IP address added */ first_entry = OLSR_FALSE; *************** *** 626,630 **** { /*If packet is to be chomped */ ! if((curr_size + ipsize) > remainsize) { --- 646,650 ---- { /*If packet is to be chomped */ ! if((curr_size + olsr_cnf->ipsize) > remainsize) { *************** *** 650,654 **** net_output(ifp); remainsize = net_outbuffer_bytes_left(ifp); ! check_buffspace(curr_size + ipsize, remainsize, "TC2"); } --- 670,674 ---- net_output(ifp); remainsize = net_outbuffer_bytes_left(ifp); ! check_buffspace(curr_size + olsr_cnf->ipsize, remainsize, "TC2"); } *************** *** 660,664 **** COPY_IP(&mprsaddr->addr, &mprs->address); ! curr_size += ipsize; mprsaddr++; } --- 680,684 ---- COPY_IP(&mprsaddr->addr, &mprs->address); ! curr_size += olsr_cnf->ipsize; mprsaddr++; } *************** *** 752,756 **** /*If packet is to be chomped */ ! if((curr_size + ipsize) > remainsize) { /* Only add TC message if it contains data */ --- 772,776 ---- /*If packet is to be chomped */ ! if((curr_size + olsr_cnf->ipsize) > remainsize) { /* Only add TC message if it contains data */ *************** *** 771,775 **** net_output(ifp); remainsize = net_outbuffer_bytes_left(ifp); ! check_buffspace(curr_size + ipsize, remainsize, "TC2"); } --- 791,795 ---- net_output(ifp); remainsize = net_outbuffer_bytes_left(ifp); ! check_buffspace(curr_size + olsr_cnf->ipsize, remainsize, "TC2"); } *************** *** 780,784 **** #endif COPY_IP(&mprsaddr6->addr, &mprs->address); ! curr_size += ipsize; mprsaddr6++; --- 800,804 ---- #endif COPY_IP(&mprsaddr6->addr, &mprs->address); ! curr_size += olsr_cnf->ipsize; mprsaddr6++; *************** *** 853,857 **** m->v4.ttl = MAX_TTL; /* Set main(first) address */ ! COPY_IP(&m->v4.originator, &main_addr); m->v4.olsr_msgtype = MID_MESSAGE; m->v4.olsr_vtime = ifp->valtimes.mid; --- 873,877 ---- m->v4.ttl = MAX_TTL; /* Set main(first) address */ ! COPY_IP(&m->v4.originator, &olsr_cnf->main_addr); m->v4.olsr_msgtype = MID_MESSAGE; m->v4.olsr_vtime = ifp->valtimes.mid; *************** *** 862,869 **** for(ifs = ifnet; ifs != NULL; ifs = ifs->int_next) { ! if(!COMP_IP(&main_addr, &ifs->ip_addr)) { ! if((curr_size + ipsize) > remainsize) { /* Only add MID message if it contains data */ --- 882,889 ---- for(ifs = ifnet; ifs != NULL; ifs = ifs->int_next) { ! if(!COMP_IP(&olsr_cnf->main_addr, &ifs->ip_addr)) { ! if((curr_size + olsr_cnf->ipsize) > remainsize) { /* Only add MID message if it contains data */ *************** *** 893,897 **** COPY_IP(&addrs->addr, &ifs->ip_addr); addrs++; ! curr_size += ipsize; } } --- 913,917 ---- COPY_IP(&addrs->addr, &ifs->ip_addr); addrs++; ! curr_size += olsr_cnf->ipsize; } } *************** *** 943,947 **** remainsize = net_outbuffer_bytes_left(ifp); } ! check_buffspace(curr_size + ipsize, remainsize, "MID"); m = (union olsr_message *)msg_buffer; --- 963,967 ---- remainsize = net_outbuffer_bytes_left(ifp); } ! check_buffspace(curr_size + olsr_cnf->ipsize, remainsize, "MID"); m = (union olsr_message *)msg_buffer; *************** *** 953,957 **** m->v6.olsr_vtime = ifp->valtimes.mid; /* Set main(first) address */ ! COPY_IP(&m->v6.originator, &main_addr); --- 973,977 ---- m->v6.olsr_vtime = ifp->valtimes.mid; /* Set main(first) address */ ! COPY_IP(&m->v6.originator, &olsr_cnf->main_addr); *************** *** 961,967 **** for(ifs = ifnet; ifs != NULL; ifs = ifs->int_next) { ! if(!COMP_IP(&main_addr, &ifs->ip_addr)) { ! if((curr_size + ipsize) > remainsize) { /* Only add MID message if it contains data */ --- 981,987 ---- for(ifs = ifnet; ifs != NULL; ifs = ifs->int_next) { ! if(!COMP_IP(&olsr_cnf->main_addr, &ifs->ip_addr)) { ! if((curr_size + olsr_cnf->ipsize) > remainsize) { /* Only add MID message if it contains data */ *************** *** 981,985 **** net_output(ifp); remainsize = net_outbuffer_bytes_left(ifp); ! check_buffspace(curr_size + ipsize, remainsize, "MID2"); } #ifdef DEBUG --- 1001,1005 ---- net_output(ifp); remainsize = net_outbuffer_bytes_left(ifp); ! check_buffspace(curr_size + olsr_cnf->ipsize, remainsize, "MID2"); } #ifdef DEBUG *************** *** 991,995 **** COPY_IP(&addrs6->addr, &ifs->ip_addr); addrs6++; ! curr_size += ipsize; } } --- 1011,1015 ---- COPY_IP(&addrs6->addr, &ifs->ip_addr); addrs6++; ! curr_size += olsr_cnf->ipsize; } } *************** *** 1042,1046 **** /* Fill header */ ! COPY_IP(&m->v4.originator, &main_addr); m->v4.hopcnt = 0; m->v4.ttl = MAX_TTL; --- 1062,1066 ---- /* Fill header */ ! COPY_IP(&m->v4.originator, &olsr_cnf->main_addr); m->v4.hopcnt = 0; m->v4.ttl = MAX_TTL; *************** *** 1053,1057 **** while(h) { ! if((curr_size + (2 * ipsize)) > remainsize) { /* Only add HNA message if it contains data */ --- 1073,1077 ---- while(h) { ! if((curr_size + (2 * olsr_cnf->ipsize)) > remainsize) { /* Only add HNA message if it contains data */ *************** *** 1069,1073 **** net_output(ifp); remainsize = net_outbuffer_bytes_left(ifp); ! check_buffspace(curr_size + (2 * ipsize), remainsize, "HNA2"); } #ifdef DEBUG --- 1089,1093 ---- net_output(ifp); remainsize = net_outbuffer_bytes_left(ifp); ! check_buffspace(curr_size + (2 * olsr_cnf->ipsize), remainsize, "HNA2"); } #ifdef DEBUG *************** *** 1079,1083 **** COPY_IP(&pair->netmask, &h->netmask); pair++; ! curr_size += (2 * ipsize); h = h->next; } --- 1099,1103 ---- COPY_IP(&pair->netmask, &h->netmask); pair++; ! curr_size += (2 * olsr_cnf->ipsize); h = h->next; } *************** *** 1132,1136 **** /* Fill header */ ! COPY_IP(&m->v6.originator, &main_addr); m->v6.hopcnt = 0; m->v6.ttl = MAX_TTL; --- 1152,1156 ---- /* Fill header */ ! COPY_IP(&m->v6.originator, &olsr_cnf->main_addr); m->v6.hopcnt = 0; m->v6.ttl = MAX_TTL; *************** *** 1143,1147 **** while(h) { ! if((curr_size + (2 * ipsize)) > remainsize) { /* Only add HNA message if it contains data */ --- 1163,1167 ---- while(h) { ! if((curr_size + (2 * olsr_cnf->ipsize)) > remainsize) { /* Only add HNA message if it contains data */ *************** *** 1159,1163 **** net_output(ifp); remainsize = net_outbuffer_bytes_left(ifp); ! check_buffspace(curr_size + (2 * ipsize), remainsize, "HNA2"); } #ifdef DEBUG --- 1179,1183 ---- net_output(ifp); remainsize = net_outbuffer_bytes_left(ifp); ! check_buffspace(curr_size + (2 * olsr_cnf->ipsize), remainsize, "HNA2"); } #ifdef DEBUG *************** *** 1170,1174 **** COPY_IP(&pair6->netmask, &tmp_netmask); pair6++; ! curr_size += (2 * ipsize); h = h->next; } --- 1190,1194 ---- COPY_IP(&pair6->netmask, &tmp_netmask); pair6++; ! curr_size += (2 * olsr_cnf->ipsize); h = h->next; } Index: ipc_frontend.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/ipc_frontend.c,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** ipc_frontend.c 10 Nov 2005 19:33:57 -0000 1.27 --- ipc_frontend.c 7 Jan 2006 08:16:20 -0000 1.28 *************** *** 498,502 **** /* Main addr */ ! COPY_IP(&net_msg->main_addr, &main_addr); --- 498,502 ---- /* Main addr */ ! COPY_IP(&net_msg->main_addr, &olsr_cnf->main_addr); Index: main.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/main.c,v retrieving revision 1.83 retrieving revision 1.84 diff -C2 -d -r1.83 -r1.84 *** main.c 29 Sep 2005 05:53:34 -0000 1.83 --- main.c 7 Jan 2006 08:16:20 -0000 1.84 *************** *** 55,58 **** --- 55,59 ---- #include "apm.h" #include "net_os.h" + #include "build_msg.h" #ifdef WIN32 *************** *** 77,83 **** print_usage(void); - static void - set_default_values(void); - static int set_default_ifcnfs(struct olsr_if *, struct if_config_options *); --- 78,81 ---- *************** *** 115,121 **** #ifndef WIN32 - /* Initialize tick resolution */ - system_tick_divider = 1000/sysconf(_SC_CLK_TCK); - /* Check if user is root */ if(getuid() || getgid()) --- 113,116 ---- *************** *** 125,130 **** } #else - system_tick_divider = 1; - DisableIcmpRedirects(); --- 120,123 ---- *************** *** 142,148 **** olsr_openlog("olsrd"); - /* Set default values */ - set_default_values(); - /* Get initial timestep */ nowtm = NULL; --- 135,138 ---- *************** *** 152,158 **** } - /* The port to use for OLSR traffic */ - olsr_udp_port = htons(OLSRPORT); - printf("\n *** %s ***\n Build date: %s\n http://www.olsr.org\n\n", SOFTWARE_VERSION, --- 142,145 ---- *************** *** 220,223 **** --- 207,217 ---- } + /* Initialize tick resolution */ + #ifndef WIN32 + olsr_cnf->system_tick_divider = 1000/sysconf(_SC_CLK_TCK); + #else + olsr_cnf->system_tick_divider = 1; + #endif + /* * Process olsrd options. *************** *** 258,262 **** *socket for icotl calls */ ! if ((ioctl_s = socket(olsr_cnf->ip_version, SOCK_DGRAM, 0)) < 0) { --- 252,256 ---- *socket for icotl calls */ ! if ((olsr_cnf->ioctl_s = socket(olsr_cnf->ip_version, SOCK_DGRAM, 0)) < 0) { *************** *** 266,270 **** #if defined __FreeBSD__ || defined __MacOSX__ || defined __NetBSD__ || defined __OpenBSD__ ! if ((rts = socket(PF_ROUTE, SOCK_RAW, 0)) < 0) { olsr_syslog(OLSR_LOG_ERR, "routing socket: %m"); --- 260,264 ---- #if defined __FreeBSD__ || defined __MacOSX__ || defined __NetBSD__ || defined __OpenBSD__ ! if ((olsr_cnf->rts = socket(PF_ROUTE, SOCK_RAW, 0)) < 0) { olsr_syslog(OLSR_LOG_ERR, "routing socket: %m"); *************** *** 273,276 **** --- 267,273 ---- #endif + /* Init empty TC timer */ + set_empty_tc_timer(GET_TIMESTAMP(0)); + /* *enable ip forwarding on host *************** *** 305,324 **** olsr_cnf->willingness = olsr_calculate_willingness(); ! OLSR_PRINTF(1, "Willingness set to %d - next update in %.1f secs\n", olsr_cnf->willingness, will_int) } } ! /* Set ipsize and minimum packetsize */ if(olsr_cnf->ip_version == AF_INET6) { OLSR_PRINTF(1, "Using IP version 6\n") ! ipsize = sizeof(struct in6_addr); ! minsize = (int)sizeof(olsr_u8_t) * 7; /* Minimum packetsize IPv6 */ } else { OLSR_PRINTF(1, "Using IP version 4\n") ! ipsize = sizeof(olsr_u32_t); ! minsize = (int)sizeof(olsr_u8_t) * 4; /* Minimum packetsize IPv4 */ } --- 302,319 ---- olsr_cnf->willingness = olsr_calculate_willingness(); ! OLSR_PRINTF(1, "Willingness set to %d - next update in %.1f secs\n", olsr_cnf->willingness, olsr_cnf->will_int) } } ! /* Set ipsize */ if(olsr_cnf->ip_version == AF_INET6) { OLSR_PRINTF(1, "Using IP version 6\n") ! olsr_cnf->ipsize = sizeof(struct in6_addr); } else { OLSR_PRINTF(1, "Using IP version 4\n") ! olsr_cnf->ipsize = sizeof(olsr_u32_t); } *************** *** 375,379 **** olsr_load_plugins(); ! OLSR_PRINTF(1, "Main address: %s\n\n", olsr_ip_to_string(&main_addr)) /* Start syslog entry */ --- 370,374 ---- olsr_load_plugins(); ! OLSR_PRINTF(1, "Main address: %s\n\n", olsr_ip_to_string(&olsr_cnf->main_addr)) /* Start syslog entry */ *************** *** 481,489 **** /* ioctl socket */ ! close(ioctl_s); #if defined __FreeBSD__ || defined __MacOSX__ || defined __NetBSD__ || defined __OpenBSD__ /* routing socket */ ! close(rts); #endif --- 476,484 ---- /* ioctl socket */ ! close(olsr_cnf->ioctl_s); #if defined __FreeBSD__ || defined __MacOSX__ || defined __NetBSD__ || defined __OpenBSD__ /* routing socket */ ! close(olsr_cnf->rts); #endif *************** *** 492,522 **** OLSR_PRINTF(1, "\n <<<< %s - terminating >>>>\n http://www.olsr.org\n", SOFTWARE_VERSION) ! exit(exit_value); ! } ! ! ! ! ! ! /** ! *Sets the default values of variables at startup ! * ! */ ! static void ! set_default_values() ! { ! exit_value = EXIT_SUCCESS; ! /* If the application exits by signal it is concidered success, ! * if not, exit_value is set by the function calling olsr_exit. ! */ ! ! will_int = 10 * HELLO_INTERVAL; /* Willingness update interval */ ! ! /* Initialize empty TC timer */ ! send_empty_tc = GET_TIMESTAMP(0); } - - /** * Print the command line usage --- 487,493 ---- OLSR_PRINTF(1, "\n <<<< %s - terminating >>>>\n http://www.olsr.org\n", SOFTWARE_VERSION) ! exit(olsr_cnf->exit_value); } /** * Print the command line usage *************** *** 741,745 **** if (strcmp(*argv, "-dispin") == 0) { ! disp_pack_in = OLSR_TRUE; continue; } --- 712,716 ---- if (strcmp(*argv, "-dispin") == 0) { ! parser_set_disp_pack_in(OLSR_TRUE); continue; } *************** *** 750,754 **** if (strcmp(*argv, "-dispout") == 0) { ! disp_pack_out = OLSR_TRUE; continue; } --- 721,725 ---- if (strcmp(*argv, "-dispout") == 0) { ! net_set_disp_pack_out(OLSR_TRUE); continue; } *************** *** 820,824 **** if (strcmp(*argv, "-delgw") == 0) { ! del_gws = OLSR_TRUE; continue; } --- 791,795 ---- if (strcmp(*argv, "-delgw") == 0) { ! olsr_cnf->del_gws = OLSR_TRUE; continue; } Index: olsr.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/olsr.c,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** olsr.c 17 Nov 2005 04:25:44 -0000 1.47 --- olsr.c 7 Jan 2006 08:16:20 -0000 1.48 *************** *** 428,434 **** /* Set timer */ jitter = (float) random()/RAND_MAX; ! jitter *= max_jitter; ! fwdtimer[ifn->if_nr] = GET_TIMESTAMP(jitter*1000); } --- 428,434 ---- /* Set timer */ jitter = (float) random()/RAND_MAX; ! jitter *= olsr_cnf->max_jitter; ! ifn->fwdtimer = GET_TIMESTAMP(jitter*1000); } *************** *** 441,445 **** if(olsr_cnf->willingness_auto) olsr_register_scheduler_event(&olsr_update_willingness, ! NULL, will_int, will_int, NULL); } --- 441,445 ---- if(olsr_cnf->willingness_auto) olsr_register_scheduler_event(&olsr_update_willingness, ! NULL, olsr_cnf->will_int, olsr_cnf->will_int, NULL); } *************** *** 585,589 **** olsr_syslog(OLSR_LOG_ERR, "olsrd exit: %s\n", msg); fflush(stdout); ! exit_value = val; raise(SIGTERM); --- 585,589 ---- olsr_syslog(OLSR_LOG_ERR, "olsrd exit: %s\n", msg); fflush(stdout); ! olsr_cnf->exit_value = val; raise(SIGTERM); Index: build_msg.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/build_msg.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** build_msg.h 2 Feb 2005 19:59:18 -0000 1.12 --- build_msg.h 7 Jan 2006 08:16:20 -0000 1.13 *************** *** 45,48 **** --- 45,55 ---- #include "packet.h" #include "olsr_protocol.h" + #include /* For clock_t */ + + void + set_empty_tc_timer(clock_t); + + clock_t + get_empty_tc_timer(void); olsr_bool Index: mpr.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/mpr.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** mpr.c 27 Feb 2005 10:43:38 -0000 1.14 --- mpr.c 7 Jan 2006 08:16:20 -0000 1.15 *************** *** 45,48 **** --- 45,49 ---- #include "olsr.h" #include "neighbor_table.h" + #include "scheduler.h" /* Begin: *************** *** 542,546 **** OLSR_PRINTF(3, "CHANGES IN MPR SET\n") if(olsr_cnf->tc_redundancy > 0) ! changes = OLSR_TRUE; } --- 543,547 ---- OLSR_PRINTF(3, "CHANGES IN MPR SET\n") if(olsr_cnf->tc_redundancy > 0) ! signal_link_changes(OLSR_TRUE); } Index: olsr_cfg.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/olsr_cfg.h,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** olsr_cfg.h 4 Jan 2006 19:05:03 -0000 1.28 --- olsr_cfg.h 7 Jan 2006 08:16:20 -0000 1.29 *************** *** 220,223 **** --- 220,236 ---- struct olsr_if *interfaces; olsr_u16_t ifcnt; + + /* Stuff set by olsrd */ + size_t ipsize; /* Size of address */ + olsr_u16_t system_tick_divider; /* Tick resolution */ + olsr_bool del_gws; /* Delete InternetGWs at startup */ + union olsr_ip_addr main_addr; /* Main address of this node */ + float will_int; + float max_jitter; + int exit_value; /* Global return value for process termination */ + float max_tc_vtime; + + int ioctl_s; /* Socket used for ioctl calls */ + int rts; /* Socket used for route changes on BSDs */ }; Index: lq_mpr.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/lq_mpr.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** lq_mpr.c 29 Nov 2005 18:37:58 -0000 1.10 --- lq_mpr.c 7 Jan 2006 08:16:20 -0000 1.11 *************** *** 45,48 **** --- 45,49 ---- #include "link_set.h" #include "lq_mpr.h" + #include "scheduler.h" void olsr_calculate_lq_mpr(void) *************** *** 177,180 **** if (mpr_changes && olsr_cnf->tc_redundancy > 0) ! changes = OLSR_TRUE; } --- 178,181 ---- if (mpr_changes && olsr_cnf->tc_redundancy > 0) ! signal_link_changes(OLSR_TRUE); } Index: tc_set.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/tc_set.c,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** tc_set.c 17 Nov 2005 04:25:44 -0000 1.23 --- tc_set.c 7 Jan 2006 08:16:20 -0000 1.24 *************** *** 60,65 **** int index; - changes = OLSR_FALSE; - OLSR_PRINTF(5, "TC: init topo\n") --- 60,63 ---- Index: mpr_selector_set.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/mpr_selector_set.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** mpr_selector_set.c 16 Dec 2005 08:21:59 -0000 1.14 --- mpr_selector_set.c 7 Jan 2006 08:16:20 -0000 1.15 *************** *** 187,191 **** olsr_add_mpr_selector(addr, vtime); retval = 1; ! changes = OLSR_TRUE; } else --- 187,191 ---- olsr_add_mpr_selector(addr, vtime); retval = 1; ! signal_link_changes(OLSR_TRUE); } else *************** *** 227,231 **** /* Delete entry */ free(mprs_to_delete); ! changes = OLSR_TRUE; } else --- 227,231 ---- /* Delete entry */ free(mprs_to_delete); ! signal_link_changes(OLSR_TRUE); } else Index: parser.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/parser.c,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** parser.c 19 Nov 2005 08:49:44 -0000 1.29 --- parser.c 7 Jan 2006 08:16:20 -0000 1.30 *************** *** 66,69 **** --- 66,77 ---- static char inbuf[MAXMESSAGESIZE+1]; + static olsr_bool disp_pack_in = OLSR_FALSE; + + void + parser_set_disp_pack_in(olsr_bool val) + { + disp_pack_in = val; + } + /** *Initialize the parser. *************** *** 161,165 **** count = size - ((char *)m - (char *)olsr); ! if (count < minsize) return; --- 169,173 ---- count = size - ((char *)m - (char *)olsr); ! if (count < MIN_PACKET_SIZE(olsr_cnf->ip_version)) return; *************** *** 216,220 **** processed = 0; ! if (count < minsize) break; --- 224,228 ---- processed = 0; ! if (count < MIN_PACKET_SIZE(olsr_cnf->ip_version)) break; *************** *** 271,275 **** /* Should be the same for IPv4 and IPv6 */ ! if(COMP_IP(&m->v4.originator, &main_addr)) { #ifdef DEBUG --- 279,283 ---- /* Should be the same for IPv4 and IPv6 */ ! if(COMP_IP(&m->v4.originator, &olsr_cnf->main_addr)) { #ifdef DEBUG *************** *** 311,315 **** /* Forward message */ ! if(!COMP_IP(&unkpacket.originator, &main_addr)) { /* Forward */ --- 319,323 ---- /* Forward message */ ! if(!COMP_IP(&unkpacket.originator, &olsr_cnf->main_addr)) { /* Forward */ *************** *** 441,445 **** direct link */ ! if((cc = recv(fd, from_addr.v6.s6_addr, ipsize, 0)) != (int)ipsize) { fprintf(stderr, "Error receiving host-client IP hook(%d) %s!\n", cc, strerror(errno)); --- 449,453 ---- direct link */ ! if((cc = recv(fd, from_addr.v6.s6_addr, olsr_cnf->ipsize, 0)) != (int)olsr_cnf->ipsize) { fprintf(stderr, "Error receiving host-client IP hook(%d) %s!\n", cc, strerror(errno)); Index: scheduler.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/scheduler.c,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** scheduler.c 29 Dec 2005 22:34:37 -0000 1.33 --- scheduler.c 7 Jan 2006 08:16:20 -0000 1.34 *************** *** 64,69 **** static struct event_entry *event_functions; ! static void trigger_dijkstra(void *dummy) { OLSR_PRINTF(3, "Triggering Dijkstra\n"); --- 64,77 ---- static struct event_entry *event_functions; + static olsr_bool link_changes; /* is set if changes occur in MPRS set */ ! void ! signal_link_changes(olsr_bool val) ! { ! link_changes = val; ! } ! ! static void ! trigger_dijkstra(void *dummy) { OLSR_PRINTF(3, "Triggering Dijkstra\n"); *************** *** 108,111 **** --- 116,121 ---- struct tms tms_buf; + link_changes = OLSR_FALSE; + if(olsr_cnf->lq_level > 1 && olsr_cnf->lq_dinter > 0.0) olsr_register_scheduler_event(trigger_dijkstra, NULL, olsr_cnf->lq_dinter, 0, NULL); *************** *** 118,122 **** OLSR_PRINTF(1, "Scheduler started - polling every %0.2f seconds\n", pollrate) ! OLSR_PRINTF(3, "Max jitter is %f\n\n", max_jitter) /* Main scheduler event loop */ --- 128,132 ---- OLSR_PRINTF(1, "Scheduler started - polling every %0.2f seconds\n", pollrate) ! OLSR_PRINTF(3, "Max jitter is %f\n\n", olsr_cnf->max_jitter) /* Main scheduler event loop */ *************** *** 153,161 **** /* Check for changes in topology */ ! if(changes) { OLSR_PRINTF(3, "ANSN UPDATED %d\n\n", get_local_ansn()) increase_local_ansn(); ! changes = OLSR_FALSE; } --- 163,171 ---- /* Check for changes in topology */ ! if(link_changes) { OLSR_PRINTF(3, "ANSN UPDATED %d\n\n", get_local_ansn()) increase_local_ansn(); ! link_changes = OLSR_FALSE; } *************** *** 180,184 **** /* Set jitter */ entry->since_last = (float) random()/RAND_MAX; ! entry->since_last *= max_jitter; /* Reset trigger */ --- 190,194 ---- /* Set jitter */ entry->since_last = (float) random()/RAND_MAX; ! entry->since_last *= olsr_cnf->max_jitter; /* Reset trigger */ *************** *** 198,202 **** for (ifn = ifnet; ifn ; ifn = ifn->int_next) { ! if(net_output_pending(ifn) && TIMED_OUT(fwdtimer[ifn->if_nr])) net_output(ifn); } --- 208,212 ---- for (ifn = ifnet; ifn ; ifn = ifn->int_next) { ! if(net_output_pending(ifn) && TIMED_OUT(ifn->fwdtimer)) net_output(ifn); } *************** *** 206,211 **** //printf("Tick diff: %d\n", end_of_loop - now_times); ! time_used.tv_sec = ((end_of_loop - now_times) * system_tick_divider) / 1000; ! time_used.tv_usec = ((end_of_loop - now_times) * system_tick_divider) % 1000; //printf("Time used: %d.%04d\n", time_used.tv_sec, time_used.tv_usec); --- 216,221 ---- //printf("Tick diff: %d\n", end_of_loop - now_times); ! time_used.tv_sec = ((end_of_loop - now_times) * olsr_cnf->system_tick_divider) / 1000; ! time_used.tv_usec = ((end_of_loop - now_times) * olsr_cnf->system_tick_divider) % 1000; //printf("Time used: %d.%04d\n", time_used.tv_sec, time_used.tv_usec); Index: scheduler.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/scheduler.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** scheduler.h 6 Mar 2005 19:33:35 -0000 1.11 --- scheduler.h 7 Jan 2006 08:16:20 -0000 1.12 *************** *** 69,72 **** --- 69,75 ---- }; + void + signal_link_changes(olsr_bool); + int olsr_register_timeout_function(void (*)(void)); Index: parser.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/parser.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** parser.h 30 May 2005 13:13:38 -0000 1.10 --- parser.h 7 Jan 2006 08:16:20 -0000 1.11 *************** *** 61,64 **** --- 61,67 ---- void + parser_set_disp_pack_in(olsr_bool); + + void olsr_init_parser(void); From (spam-protected) Sat Jan 7 18:18:34 2006 From: (spam-protected) (Andreas Tønnesen) Date: Sat, 07 Jan 2006 17:18:34 +0000 Subject: [Olsr-cvs] olsrd-current/src main.c, 1.84, 1.85 scheduler.c, 1.34, 1.35 defs.c, 1.2, NONE Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7755 Modified Files: main.c scheduler.c Removed Files: defs.c Log Message: Removed defs.c. Declarations moved to scheduler and main Index: scheduler.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/scheduler.c,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** scheduler.c 7 Jan 2006 08:16:20 -0000 1.34 --- scheduler.c 7 Jan 2006 17:18:32 -0000 1.35 *************** *** 58,61 **** --- 58,66 ---- #endif + /* Timer data, global. Externed in defs.h */ + clock_t now_times; /* current idea of times(2) reported uptime */ + struct timeval now; /* current idea of time */ + struct tm *nowtm; /* current idea of time (in tm) */ + static float pollrate; --- defs.c DELETED --- Index: main.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/main.c,v retrieving revision 1.84 retrieving revision 1.85 diff -C2 -d -r1.84 -r1.85 *** main.c 7 Jan 2006 08:16:20 -0000 1.84 --- main.c 7 Jan 2006 17:18:32 -0000 1.85 *************** *** 57,60 **** --- 57,64 ---- #include "build_msg.h" + /* Global stuff externed in defs.h */ + FILE *debug_handle; /* Where to send debug(defaults to stdout) */ + struct olsrd_config *olsr_cnf; /* The global configuration */ + #ifdef WIN32 #define close(x) closesocket(x) *************** *** 90,93 **** --- 94,98 ---- static char copyright_string[] = "The olsr.org Optimized Link-State Routing daemon(olsrd) Copyright (c) 2004, Andreas T�nnesen(andreto at olsr.org) All rights reserved."; + /** * Main entrypoint From (spam-protected) Sat Jan 7 19:05:07 2006 From: (spam-protected) (Andreas Tønnesen) Date: Sat, 07 Jan 2006 18:05:07 +0000 Subject: [Olsr-cvs] olsrd-current/src main.c,1.85,1.86 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17724 Modified Files: main.c Log Message: Addee LQ command line options Index: main.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/main.c,v retrieving revision 1.85 retrieving revision 1.86 diff -C2 -d -r1.85 -r1.86 *** main.c 7 Jan 2006 17:18:32 -0000 1.85 --- main.c 7 Jan 2006 18:05:05 -0000 1.86 *************** *** 505,508 **** --- 505,509 ---- fprintf(stderr, "usage: olsrd [-f ] [ -i interface1 interface2 ... ]\n"); fprintf(stderr, " [-d ] [-ipv6] [-multi ]\n"); + fprintf(stderr, " [-lql ] [-lqw ]\n"); fprintf(stderr, " [-bcast ] [-ipc] [-dispin] [-dispout] [-delgw]\n"); fprintf(stderr, " [-hint ] [-tcint ]\n"); *************** *** 609,612 **** --- 610,649 ---- continue; } + + /* + * Set LQ level + */ + if (strcmp(*argv, "-lql") == 0) + { + int tmp_lq_level; + NEXT_ARG; + CHECK_ARGC; + + /* Sanity checking is done later */ + sscanf(*argv, "%d", &tmp_lq_level); + olsr_cnf->lq_level = tmp_lq_level; + continue; + } + + /* + * Set LQ winsize + */ + if (strcmp(*argv, "-lqw") == 0) + { + int tmp_lq_wsize; + NEXT_ARG; + CHECK_ARGC; + + sscanf(*argv, "%d", &tmp_lq_wsize); + + if(tmp_lq_wsize < MIN_LQ_WSIZE || tmp_lq_wsize > MAX_LQ_WSIZE) + { + printf("LQ winsize %d not allowed. Range [%d-%d]\n", + tmp_lq_wsize, MIN_LQ_WSIZE, MAX_LQ_WSIZE); + olsr_exit(__func__, EXIT_FAILURE); + } + olsr_cnf->lq_wsize = tmp_lq_wsize; + continue; + } /* From (spam-protected) Sat Jan 7 19:06:13 2006 From: (spam-protected) (Andreas Tønnesen) Date: Sat, 07 Jan 2006 18:06:13 +0000 Subject: [Olsr-cvs] olsrd-current/src main.c,1.83,1.83.2.1 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18225 Modified Files: Tag: olsrd_04 main.c Log Message: Added LQ command line options Index: main.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/main.c,v retrieving revision 1.83 retrieving revision 1.83.2.1 diff -C2 -d -r1.83 -r1.83.2.1 *** main.c 29 Sep 2005 05:53:34 -0000 1.83 --- main.c 7 Jan 2006 18:06:11 -0000 1.83.2.1 *************** *** 529,532 **** --- 529,533 ---- fprintf(stderr, "usage: olsrd [-f ] [ -i interface1 interface2 ... ]\n"); fprintf(stderr, " [-d ] [-ipv6] [-multi ]\n"); + fprintf(stderr, " [-lql ] [-lqw ]\n"); fprintf(stderr, " [-bcast ] [-ipc] [-dispin] [-dispout] [-delgw]\n"); fprintf(stderr, " [-hint ] [-tcint ]\n"); *************** *** 633,636 **** --- 634,673 ---- continue; } + + /* + * Set LQ level + */ + if (strcmp(*argv, "-lql") == 0) + { + int tmp_lq_level; + NEXT_ARG; + CHECK_ARGC; + + /* Sanity checking is done later */ + sscanf(*argv, "%d", &tmp_lq_level); + olsr_cnf->lq_level = tmp_lq_level; + continue; + } + + /* + * Set LQ winsize + */ + if (strcmp(*argv, "-lqw") == 0) + { + int tmp_lq_wsize; + NEXT_ARG; + CHECK_ARGC; + + sscanf(*argv, "%d", &tmp_lq_wsize); + + if(tmp_lq_wsize < MIN_LQ_WSIZE || tmp_lq_wsize > MAX_LQ_WSIZE) + { + printf("LQ winsize %d not allowed. Range [%d-%d]\n", + tmp_lq_wsize, MIN_LQ_WSIZE, MAX_LQ_WSIZE); + olsr_exit(__func__, EXIT_FAILURE); + } + olsr_cnf->lq_wsize = tmp_lq_wsize; + continue; + } /* From (spam-protected) Sun Jan 8 21:27:20 2006 From: (spam-protected) (Andreas Tønnesen) Date: Sun, 08 Jan 2006 20:27:20 +0000 Subject: [Olsr-cvs] olsrd-current/src/unix ifnet.c,1.33,1.34 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src/unix In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7804/unix Modified Files: ifnet.c Log Message: Added libnet IPv6 support. For some strange reason libnet_write failes on my debian box using libnet 1.1 with a free() failure detected by glibc. I cant see why, but Ill investigate further later on Index: ifnet.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/unix/ifnet.c,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** ifnet.c 7 Jan 2006 08:16:24 -0000 1.33 --- ifnet.c 8 Jan 2006 20:27:18 -0000 1.34 *************** *** 930,946 **** } - #ifdef USE_LIBNET - ifp->libnet_ctx = libnet_init(LIBNET_RAW4, ifp->int_name, get_libnet_errbuf()); - - if(ifp->libnet_ctx == NULL) - { - fprintf(stderr, "Could not initialize libnet... exiting!\n\n"); - olsr_syslog(OLSR_LOG_ERR, "Could not initialize libnet... exiting!\n\n"); - olsr_cnf->exit_value = EXIT_FAILURE; - kill(getpid(), SIGINT); - } - #else - ifp->libnet_ctx = NULL; - #endif } else --- 930,933 ---- *************** *** 969,972 **** --- 956,975 ---- } + + #ifdef USE_LIBNET + ifp->libnet_ctx = libnet_init((olsr_cnf->ip_version == AF_INET) ? + LIBNET_RAW4 : LIBNET_RAW6, + ifp->int_name, get_libnet_errbuf()); + + if(ifp->libnet_ctx == NULL) + { + fprintf(stderr, "Could not initialize libnet... exiting!\n\n"); + olsr_syslog(OLSR_LOG_ERR, "Could not initialize libnet... exiting!\n\n"); + olsr_cnf->exit_value = EXIT_FAILURE; + kill(getpid(), SIGINT); + } + #else + ifp->libnet_ctx = NULL; + #endif /* Register socket */ From (spam-protected) Sun Jan 8 21:27:20 2006 From: (spam-protected) (Andreas Tønnesen) Date: Sun, 08 Jan 2006 20:27:20 +0000 Subject: [Olsr-cvs] olsrd-current/src net_olsr.c,1.10,1.11 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7804 Modified Files: net_olsr.c Log Message: Added libnet IPv6 support. For some strange reason libnet_write failes on my debian box using libnet 1.1 with a free() failure detected by glibc. I cant see why, but Ill investigate further later on Index: net_olsr.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/net_olsr.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** net_olsr.c 7 Jan 2006 08:16:20 -0000 1.10 --- net_olsr.c 8 Jan 2006 20:27:17 -0000 1.11 *************** *** 402,407 **** } - - /** *Sends a packet on a given interface. --- 402,405 ---- *************** *** 413,416 **** --- 411,547 ---- int net_output(struct interface *ifp) + #ifdef USE_LIBNET + { + struct ptf *tmp_ptf_list; + union olsr_packet *outmsg; + int retval; + libnet_ptag_t udp_ptag = 0, ip_ptag = 0; + + if(!netbufs[ifp->if_nr]) + return -1; + + if(!netbufs[ifp->if_nr]->pending) + return 0; + + assert(ifp->libnet_ctx != NULL); + + netbufs[ifp->if_nr]->pending += OLSR_HEADERSIZE; + + retval = netbufs[ifp->if_nr]->pending; + + outmsg = (union olsr_packet *)netbufs[ifp->if_nr]->buff; + /* Add the Packet seqno */ + outmsg->v4.olsr_seqno = htons(ifp->olsr_seqnum++); + /* Set the packetlength */ + outmsg->v4.olsr_packlen = htons(netbufs[ifp->if_nr]->pending); + + /* + *Call possible packet transform functions registered by plugins + */ + tmp_ptf_list = ptf_list; + while(tmp_ptf_list != NULL) + { + tmp_ptf_list->function(netbufs[ifp->if_nr]->buff, &netbufs[ifp->if_nr]->pending); + tmp_ptf_list = tmp_ptf_list->next; + } + + /* + *if the -dispout option was given + *we print the contetnt of the packets + */ + if(disp_pack_out) + print_olsr_serialized_packet(stdout, (union olsr_packet *)netbufs[ifp->if_nr]->buff, + netbufs[ifp->if_nr]->pending, &ifp->ip_addr); + + printf("LIBNET TX %d bytes on %s\n", + netbufs[ifp->if_nr]->pending, ifp->int_name); + + udp_ptag = libnet_build_udp(OLSRPORT, + OLSRPORT, + LIBNET_UDP_H + netbufs[ifp->if_nr]->pending, + 0, + (u_int8_t *)netbufs[ifp->if_nr]->buff, + netbufs[ifp->if_nr]->pending, + ifp->libnet_ctx, + 0); + if(udp_ptag == -1) + { + OLSR_PRINTF (1, "libnet UDP header: %s\n", libnet_geterror (ifp->libnet_ctx)) + netbufs[ifp->if_nr]->pending = 0; + libnet_clear_packet(ifp->libnet_ctx); + return -1; + } + + if(olsr_cnf->ip_version == AF_INET) + { + /* IP version 4 */ + ip_ptag = libnet_build_ipv4(LIBNET_IPV4_H + LIBNET_UDP_H + netbufs[ifp->if_nr]->pending, + olsr_cnf->tos, + ifp->olsr_seqnum, + 0x4000, /* Don't fragment */ + 255, + IPPROTO_UDP, + 0, + ifp->ip_addr.v4, + ((struct sockaddr_in *)&ifp->int_broadaddr)->sin_addr.s_addr, + NULL, + 0, + ifp->libnet_ctx, + 0); + if(ip_ptag == -1) + { + OLSR_PRINTF (1, "libnet IP header: %s\n", libnet_geterror (ifp->libnet_ctx)) + netbufs[ifp->if_nr]->pending = 0; + libnet_clear_packet(ifp->libnet_ctx); + return -1; + } + + } + else + { + /* IP version 6 */ + struct libnet_in6_addr src, dst; + + memcpy(&src, &ifp->ip_addr.v6, sizeof(src)); + memcpy(&dst, &((struct sockaddr_in6 *)&ifp->int6_multaddr)->sin6_addr, sizeof(dst)); + + ip_ptag = libnet_build_ipv6(0, /* Traffic class */ + 0, /* Flow label */ + LIBNET_IPV6_H + LIBNET_UDP_H + netbufs[ifp->if_nr]->pending, + IPPROTO_UDP, /* Next Header */ + 64, /* Hop Limit */ + src, + dst, + NULL, /* Optional payload */ + 0, /* Optional payload length */ + ifp->libnet_ctx, + 0); + + if(ip_ptag == -1) + { + OLSR_PRINTF (1, "libnet IP header: %s\n", libnet_geterror (ifp->libnet_ctx)) + netbufs[ifp->if_nr]->pending = 0; + libnet_clear_packet(ifp->libnet_ctx); + return -1; + } + } + if((retval = libnet_write(ifp->libnet_ctx)) == -1) + { + OLSR_PRINTF (1, "libnet packet write: %s\n", libnet_geterror (ifp->libnet_ctx)) + } + + libnet_clear_packet(ifp->libnet_ctx); + + netbufs[ifp->if_nr]->pending = 0; + + // if we've just transmitted a TC message, let Dijkstra use the current + // link qualities for the links to our neighbours + + olsr_update_dijkstra_link_qualities(); + lq_tc_pending = OLSR_FALSE; + + return retval; + } + #else { struct sockaddr_in *sin; *************** *** 482,542 **** if(olsr_cnf->ip_version == AF_INET) { - #ifdef USE_LIBNET - libnet_ptag_t udp_ptag = 0, ip_ptag = 0; - - printf("LIBNET TX %d bytes on %s\n", - netbufs[ifp->if_nr]->pending, ifp->int_name); - - assert(ifp->libnet_ctx != NULL); - - udp_ptag = libnet_build_udp(OLSRPORT, - OLSRPORT, - LIBNET_UDP_H + netbufs[ifp->if_nr]->pending, - 0, - (u_int8_t *)netbufs[ifp->if_nr]->buff, - netbufs[ifp->if_nr]->pending, - ifp->libnet_ctx, - udp_ptag); - if(udp_ptag == -1) - { - OLSR_PRINTF (1, "libnet UDP header: %s\n", libnet_geterror (ifp->libnet_ctx)) - netbufs[ifp->if_nr]->pending = 0; - libnet_clear_packet(ifp->libnet_ctx); - return -1; - } - - ip_ptag = libnet_build_ipv4(LIBNET_IPV4_H + LIBNET_UDP_H + netbufs[ifp->if_nr]->pending, - olsr_cnf->tos, - ifp->olsr_seqnum, - 0x4000, /* Don't fragment */ - 255, - IPPROTO_UDP, - 0, - ifp->ip_addr.v4, - sin->sin_addr.s_addr, - NULL, - 0, - ifp->libnet_ctx, - ip_ptag); - if(ip_ptag == -1) - { - OLSR_PRINTF (1, "libnet IP header: %s\n", libnet_geterror (ifp->libnet_ctx)) - netbufs[ifp->if_nr]->pending = 0; - libnet_clear_packet(ifp->libnet_ctx); - return -1; - } - - if((retval = libnet_write(ifp->libnet_ctx)) == -1) - { - OLSR_PRINTF (1, "libnet packet write: %s\n", libnet_geterror (ifp->libnet_ctx)) - } - if(retval != (int)(LIBNET_IPV4_H + LIBNET_UDP_H + netbufs[ifp->if_nr]->pending)) - { - printf("libnet_write returned %d, expected %d\n", - retval, LIBNET_IPV4_H + LIBNET_UDP_H + netbufs[ifp->if_nr]->pending); - } - - libnet_clear_packet(ifp->libnet_ctx); - #else /* IP version 4 */ if(olsr_sendto(ifp->olsr_socket, --- 613,616 ---- *************** *** 552,556 **** retval = -1; } - #endif } else --- 626,629 ---- *************** *** 584,588 **** return retval; } ! --- 657,661 ---- return retval; } ! #endif From (spam-protected) Tue Jan 10 07:20:15 2006 From: (spam-protected) (Andreas Tønnesen) Date: Tue, 10 Jan 2006 06:20:15 +0000 Subject: [Olsr-cvs] olsrd-current/src main.c,1.86,1.87 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31776/src Modified Files: main.c Log Message: Removed getgid check Index: main.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/main.c,v retrieving revision 1.86 retrieving revision 1.87 diff -C2 -d -r1.86 -r1.87 *** main.c 7 Jan 2006 18:05:05 -0000 1.86 --- main.c 10 Jan 2006 06:20:13 -0000 1.87 *************** *** 119,123 **** #ifndef WIN32 /* Check if user is root */ ! if(getuid() || getgid()) { fprintf(stderr, "You must be root(uid = 0) to run olsrd!\nExiting\n\n"); --- 119,123 ---- #ifndef WIN32 /* Check if user is root */ ! if(getuid()) { fprintf(stderr, "You must be root(uid = 0) to run olsrd!\nExiting\n\n"); From (spam-protected) Tue Jan 10 07:20:40 2006 From: (spam-protected) (Andreas Tønnesen) Date: Tue, 10 Jan 2006 06:20:40 +0000 Subject: [Olsr-cvs] olsrd-current/src main.c,1.83.2.1,1.83.2.2 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31803/src Modified Files: Tag: olsrd_04 main.c Log Message: Removed getgid check Index: main.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/main.c,v retrieving revision 1.83.2.1 retrieving revision 1.83.2.2 diff -C2 -d -r1.83.2.1 -r1.83.2.2 *** main.c 7 Jan 2006 18:06:11 -0000 1.83.2.1 --- main.c 10 Jan 2006 06:20:38 -0000 1.83.2.2 *************** *** 119,123 **** /* Check if user is root */ ! if(getuid() || getgid()) { fprintf(stderr, "You must be root(uid = 0) to run olsrd!\nExiting\n\n"); --- 119,123 ---- /* Check if user is root */ ! if(getuid()) { fprintf(stderr, "You must be root(uid = 0) to run olsrd!\nExiting\n\n"); From (spam-protected) Tue Jan 10 18:43:34 2006 From: (spam-protected) (Andreas Tønnesen) Date: Tue, 10 Jan 2006 17:43:34 +0000 Subject: [Olsr-cvs] olsrd-current/src main.c,1.87,1.88 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2272/src Modified Files: main.c Log Message: Changed getuid to geteuid Index: main.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/main.c,v retrieving revision 1.87 retrieving revision 1.88 diff -C2 -d -r1.87 -r1.88 *** main.c 10 Jan 2006 06:20:13 -0000 1.87 --- main.c 10 Jan 2006 17:43:32 -0000 1.88 *************** *** 119,123 **** #ifndef WIN32 /* Check if user is root */ ! if(getuid()) { fprintf(stderr, "You must be root(uid = 0) to run olsrd!\nExiting\n\n"); --- 119,123 ---- #ifndef WIN32 /* Check if user is root */ ! if(geteuid()) { fprintf(stderr, "You must be root(uid = 0) to run olsrd!\nExiting\n\n"); From (spam-protected) Tue Jan 10 18:44:19 2006 From: (spam-protected) (Andreas Tønnesen) Date: Tue, 10 Jan 2006 17:44:19 +0000 Subject: [Olsr-cvs] olsrd-current/src main.c,1.83.2.2,1.83.2.3 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2404/src Modified Files: Tag: olsrd_04 main.c Log Message: Changed getuid to geteuid Index: main.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/main.c,v retrieving revision 1.83.2.2 retrieving revision 1.83.2.3 diff -C2 -d -r1.83.2.2 -r1.83.2.3 *** main.c 10 Jan 2006 06:20:38 -0000 1.83.2.2 --- main.c 10 Jan 2006 17:44:17 -0000 1.83.2.3 *************** *** 119,123 **** /* Check if user is root */ ! if(getuid()) { fprintf(stderr, "You must be root(uid = 0) to run olsrd!\nExiting\n\n"); --- 119,123 ---- /* Check if user is root */ ! if(geteuid()) { fprintf(stderr, "You must be root(uid = 0) to run olsrd!\nExiting\n\n"); From (spam-protected) Tue Jan 10 21:38:21 2006 From: (spam-protected) (Andreas Tønnesen) Date: Tue, 10 Jan 2006 20:38:21 +0000 Subject: [Olsr-cvs] olsrd-current/src/unix ifnet.c,1.34,1.35 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src/unix In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29496/unix Modified Files: ifnet.c Log Message: Wow, there are some serious issue with libnet using UDP+IPv6... To bad since this is what we really wanted libnet for. I'll see if I can create a workaround, as for now there is no UDP checksum in the IPv6 packets beeing sent... Index: ifnet.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/unix/ifnet.c,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** ifnet.c 8 Jan 2006 20:27:18 -0000 1.34 --- ifnet.c 10 Jan 2006 20:38:19 -0000 1.35 *************** *** 896,900 **** ifp = olsr_malloc(sizeof (struct interface), "Interface update 2"); ! iface->configured = 1; iface->interf = ifp; --- 896,900 ---- ifp = olsr_malloc(sizeof (struct interface), "Interface update 2"); ! iface->configured = 1; iface->interf = ifp; *************** *** 902,905 **** --- 902,906 ---- memcpy(ifp, &ifs, sizeof(struct interface)); + ifp->libnet_ctx = NULL; ifp->gen_properties = NULL; ifp->int_name = olsr_malloc(strlen(ifr.ifr_name) + 1, "Interface update 3"); *************** *** 958,976 **** #ifdef USE_LIBNET ! ifp->libnet_ctx = libnet_init((olsr_cnf->ip_version == AF_INET) ? ! LIBNET_RAW4 : LIBNET_RAW6, ! ifp->int_name, get_libnet_errbuf()); ! ! if(ifp->libnet_ctx == NULL) ! { ! fprintf(stderr, "Could not initialize libnet... exiting!\n\n"); ! olsr_syslog(OLSR_LOG_ERR, "Could not initialize libnet... exiting!\n\n"); ! olsr_cnf->exit_value = EXIT_FAILURE; ! kill(getpid(), SIGINT); ! } #else ! ifp->libnet_ctx = NULL; #endif ! /* Register socket */ add_olsr_socket(ifp->olsr_socket, &olsr_input); --- 959,980 ---- #ifdef USE_LIBNET ! #if 1 ! ifp->libnet_ctx = libnet_init((olsr_cnf->ip_version == AF_INET) ? ! LIBNET_RAW4 : LIBNET_RAW6, ! ifp->int_name, get_libnet_errbuf()); #else ! ifp->libnet_ctx = libnet_init(LIBNET_LINK, ifp->int_name, get_libnet_errbuf()); #endif ! ! if(ifp->libnet_ctx == NULL) ! { ! fprintf(stderr, "Could not initialize libnet... exiting!\n\n"); ! olsr_syslog(OLSR_LOG_ERR, "Could not initialize libnet... exiting!\n\n"); ! olsr_cnf->exit_value = EXIT_FAILURE; ! kill(getpid(), SIGINT); ! } ! #endif ! set_buffer_timer(ifp); ! /* Register socket */ add_olsr_socket(ifp->olsr_socket, &olsr_input); From (spam-protected) Tue Jan 10 21:38:21 2006 From: (spam-protected) (Andreas Tønnesen) Date: Tue, 10 Jan 2006 20:38:21 +0000 Subject: [Olsr-cvs] olsrd-current/src net_olsr.c,1.11,1.12 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29496 Modified Files: net_olsr.c Log Message: Wow, there are some serious issue with libnet using UDP+IPv6... To bad since this is what we really wanted libnet for. I'll see if I can create a workaround, as for now there is no UDP checksum in the IPv6 packets beeing sent... Index: net_olsr.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/net_olsr.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** net_olsr.c 8 Jan 2006 20:27:17 -0000 1.11 --- net_olsr.c 10 Jan 2006 20:38:19 -0000 1.12 *************** *** 402,405 **** --- 402,436 ---- } + /* + * Stolen from libnet + */ + + #define OLSR_CKSUM_CARRY(x) \ + (x = (x >> 16) + (x & 0xffff), (~(x + (x >> 16)) & 0xffff)) + + int + olsr_in_cksum(olsr_u16_t *buf, int len) + { + int sum; + u_int16_t last_byte; + + sum = 0; + last_byte = 0; + + while (len > 1) + { + sum += *buf++; + len -= 2; + } + if (len == 1) + { + *(u_int8_t*)&last_byte = *(u_int8_t*)buf; + sum += last_byte; + } + + return sum; + } + + /** *Sends a packet on a given interface. *************** *** 456,460 **** printf("LIBNET TX %d bytes on %s\n", netbufs[ifp->if_nr]->pending, ifp->int_name); ! udp_ptag = libnet_build_udp(OLSRPORT, OLSRPORT, --- 487,491 ---- printf("LIBNET TX %d bytes on %s\n", netbufs[ifp->if_nr]->pending, ifp->int_name); ! udp_ptag = libnet_build_udp(OLSRPORT, OLSRPORT, *************** *** 465,468 **** --- 496,500 ---- ifp->libnet_ctx, 0); + if(udp_ptag == -1) { *************** *** 472,476 **** return -1; } ! if(olsr_cnf->ip_version == AF_INET) { --- 504,508 ---- return -1; } ! if(olsr_cnf->ip_version == AF_INET) { *************** *** 502,509 **** /* IP version 6 */ struct libnet_in6_addr src, dst; memcpy(&src, &ifp->ip_addr.v6, sizeof(src)); memcpy(&dst, &((struct sockaddr_in6 *)&ifp->int6_multaddr)->sin6_addr, sizeof(dst)); ! ip_ptag = libnet_build_ipv6(0, /* Traffic class */ 0, /* Flow label */ --- 534,559 ---- /* IP version 6 */ struct libnet_in6_addr src, dst; + int sum; memcpy(&src, &ifp->ip_addr.v6, sizeof(src)); memcpy(&dst, &((struct sockaddr_in6 *)&ifp->int6_multaddr)->sin6_addr, sizeof(dst)); ! ! ! /* !!!ATTENTION!!! ! * There is a bug in libnet (libnet_build_udp) 1.1.2 that causes ! * a crash if requesting auto-generated UDP checksums when ! * using IPv6. ! * Since we want backwards compability(well... as of now it ! * is actually current compability), we MUST manually generate ! * a checksum when in IPv6 mode. ! * Yepp - it sux ! * - Andreas ! */ ! libnet_toggle_checksum(ifp->libnet_ctx, udp_ptag, LIBNET_OFF); ! ! /* TODO: generate and insert CHKSUM */ ! ! printf("Build IPv6 size: %d\n", ! LIBNET_IPV6_H + LIBNET_UDP_H + netbufs[ifp->if_nr]->pending); ip_ptag = libnet_build_ipv6(0, /* Traffic class */ 0, /* Flow label */ *************** *** 525,533 **** return -1; } ! } if((retval = libnet_write(ifp->libnet_ctx)) == -1) { OLSR_PRINTF (1, "libnet packet write: %s\n", libnet_geterror (ifp->libnet_ctx)) } libnet_clear_packet(ifp->libnet_ctx); --- 575,606 ---- return -1; } ! ! #if 0 ! { ! libnet_ptag_t ether_tag = 0; ! unsigned char enet_broadcast[6] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; ! ! ether_tag = libnet_build_ethernet(enet_broadcast, ! libnet_get_hwaddr(ifp->libnet_ctx), ! ETHERTYPE_IP, ! NULL, /* payload */ ! 0, /* payload size */ ! ifp->libnet_ctx, /* libnet handle */ ! 0); /* pblock tag */ ! if (ether_tag == -1) ! { ! OLSR_PRINTF (1, "libnet ethernet header: %s\n", libnet_geterror (ifp->libnet_ctx)) ! netbufs[ifp->if_nr]->pending = 0; ! libnet_clear_packet(ifp->libnet_ctx); ! return -1; ! } ! } ! #endif ! if((retval = libnet_write(ifp->libnet_ctx)) == -1) { OLSR_PRINTF (1, "libnet packet write: %s\n", libnet_geterror (ifp->libnet_ctx)) } + printf("RETVAL: %d\n", retval); fflush(stdout); libnet_clear_packet(ifp->libnet_ctx); From (spam-protected) Tue Jan 10 21:49:03 2006 From: (spam-protected) (Andreas Tønnesen) Date: Tue, 10 Jan 2006 20:49:03 +0000 Subject: [Olsr-cvs] olsrd-current/src net_olsr.c,1.12,1.13 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31623 Modified Files: net_olsr.c Log Message: Warnings fixed Index: net_olsr.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/net_olsr.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** net_olsr.c 10 Jan 2006 20:38:19 -0000 1.12 --- net_olsr.c 10 Jan 2006 20:49:01 -0000 1.13 *************** *** 97,100 **** --- 97,103 ---- #ifdef USE_LIBNET + int + olsr_in_cksum(olsr_u16_t *, int); + static char errbuf[LIBNET_ERRBUF_SIZE]; *************** *** 402,405 **** --- 405,409 ---- } + #ifdef USE_LIBNET /* * Stolen from libnet *************** *** 431,435 **** return sum; } ! /** --- 435,439 ---- return sum; } ! #endif /** *************** *** 534,538 **** /* IP version 6 */ struct libnet_in6_addr src, dst; ! int sum; memcpy(&src, &ifp->ip_addr.v6, sizeof(src)); --- 538,542 ---- /* IP version 6 */ struct libnet_in6_addr src, dst; ! //int sum; memcpy(&src, &ifp->ip_addr.v6, sizeof(src)); *************** *** 575,578 **** --- 579,583 ---- return -1; } + } #if 0 *************** *** 581,584 **** --- 586,590 ---- unsigned char enet_broadcast[6] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; + /* We should add layer2 as well later */ ether_tag = libnet_build_ethernet(enet_broadcast, libnet_get_hwaddr(ifp->libnet_ctx), From (spam-protected) Thu Jan 12 12:00:51 2006 From: (spam-protected) (Andreas Tønnesen) Date: Thu, 12 Jan 2006 11:00:51 +0000 Subject: [Olsr-cvs] olsrd-current/src olsr_protocol.h,1.20,1.21 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5104/src Modified Files: olsr_protocol.h Log Message: Changed TC redundancy default to 2 Index: olsr_protocol.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/olsr_protocol.h,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** olsr_protocol.h 7 Jan 2006 08:16:20 -0000 1.20 --- olsr_protocol.h 12 Jan 2006 11:00:49 -0000 1.21 *************** *** 149,153 **** *Redundancy defaults */ ! #define TC_REDUNDANCY 0 #define MPR_COVERAGE 1 --- 149,153 ---- *Redundancy defaults */ ! #define TC_REDUNDANCY 2 #define MPR_COVERAGE 1
Main address: %sIP version: %d