From (spam-protected) Fri Oct 5 00:27:33 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Thu, 04 Oct 2007 22:27:33 +0000 Subject: [Olsr-cvs] olsrd-current CHANGELOG,1.92,1.93 Message-ID: Update of /cvsroot/olsrd/olsrd-current In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31525 Modified Files: CHANGELOG Log Message: * bug fixes and cleanups by John Hay for FreeBSD Index: CHANGELOG =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/CHANGELOG,v retrieving revision 1.92 retrieving revision 1.93 diff -C2 -d -r1.92 -r1.93 *** CHANGELOG 17 Sep 2007 22:27:24 -0000 1.92 --- CHANGELOG 4 Oct 2007 22:27:31 -0000 1.93 *************** *** 143,146 **** --- 143,149 ---- - update to new FreeBSD WLAN API - do not require /bin/bash, use /bin/sh + - Fixed alignment so that olsrd runs on FreeBSD/arm + - allow more interface in an IPv6 subnet on FreeBSD + - use PREFIX and DESTDIR as all the other Makefile.$OS also for FreeBSD PATCH by Andreas Jacobs From (spam-protected) Fri Oct 5 00:27:33 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Thu, 04 Oct 2007 22:27:33 +0000 Subject: [Olsr-cvs] olsrd-current/make Makefile.fbsd,1.11,1.12 Message-ID: Update of /cvsroot/olsrd/olsrd-current/make In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31525/make Modified Files: Makefile.fbsd Log Message: * bug fixes and cleanups by John Hay for FreeBSD Index: Makefile.fbsd =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/make/Makefile.fbsd,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Makefile.fbsd 29 Aug 2007 21:46:25 -0000 1.11 --- Makefile.fbsd 4 Oct 2007 22:27:31 -0000 1.12 *************** *** 3,12 **** # ! DESTDIR ?= /usr/local ! SBINDIR = $(DESTDIR)/sbin ! ETCDIR = $(DESTDIR)/etc ! LIBDIR = $(DESTDIR)/lib ! DOCDIR = $(DESTDIR)/share/doc ! MANDIR = $(DESTDIR)/man SRCS += $(wildcard src/bsd/*.c) $(wildcard src/unix/*.c) --- 3,12 ---- # ! PREFIX ?= /usr/local ! SBINDIR = $(PREFIX)/sbin ! ETCDIR = $(PREFIX)/etc ! LIBDIR = $(PREFIX)/lib ! DOCDIR = $(PREFIX)/share/doc ! MANDIR = $(PREFIX)/man SRCS += $(wildcard src/bsd/*.c) $(wildcard src/unix/*.c) *************** *** 23,28 **** ifdef LIBNET ! CPPFLAGS += -DSPOOF -I$(DESTDIR)/include ! LIBS += -L$(DESTDIR)/lib -lnet endif --- 23,28 ---- ifdef LIBNET ! CPPFLAGS += -DSPOOF -I$(PREFIX)/include ! LIBS += -L$(PREFIX)/lib -lnet endif From (spam-protected) Fri Oct 5 00:27:33 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Thu, 04 Oct 2007 22:27:33 +0000 Subject: [Olsr-cvs] olsrd-current/src/bsd net.c, 1.37, 1.38 kernel_routes.c, 1.13, 1.14 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src/bsd In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31525/src/bsd Modified Files: net.c kernel_routes.c Log Message: * bug fixes and cleanups by John Hay for FreeBSD Index: net.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/bsd/net.c,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** net.c 7 Sep 2007 08:53:36 -0000 1.37 --- net.c 4 Oct 2007 22:27:31 -0000 1.38 *************** *** 728,731 **** --- 728,735 ---- struct msghdr mhdr; struct iovec iov; + union { + struct cmsghdr cmsg; + unsigned char chdr[4096]; + } cmu; struct cmsghdr *cm; struct sockaddr_dl *sdl; *************** *** 737,745 **** char addrstr[INET6_ADDRSTRLEN]; char iname[IFNAMSIZ]; - unsigned char chdr[4096]; int count; ! bzero(&mhdr, sizeof(mhdr)); ! bzero(&iov, sizeof(iov)); mhdr.msg_name = (caddr_t) from; --- 741,748 ---- char addrstr[INET6_ADDRSTRLEN]; char iname[IFNAMSIZ]; int count; ! memset(&mhdr, 0, sizeof(mhdr)); ! memset(&iov, 0, sizeof(iov)); mhdr.msg_name = (caddr_t) from; *************** *** 747,754 **** mhdr.msg_iov = &iov; mhdr.msg_iovlen = 1; ! mhdr.msg_control = (caddr_t) chdr; ! mhdr.msg_controllen = sizeof (chdr); ! iov.iov_len = MAXMESSAGESIZE; iov.iov_base = buf; --- 750,757 ---- mhdr.msg_iov = &iov; mhdr.msg_iovlen = 1; ! mhdr.msg_control = (caddr_t) &cmu; ! mhdr.msg_controllen = sizeof (cmu); ! iov.iov_len = len; iov.iov_base = buf; *************** *** 776,782 **** else { ! cm = (struct cmsghdr *) chdr; sdl = (struct sockaddr_dl *) CMSG_DATA (cm); ! bzero (iname, sizeof (iname)); memcpy (iname, sdl->sdl_data, sdl->sdl_nlen); } --- 779,785 ---- else { ! cm = &cmu.cmsg; sdl = (struct sockaddr_dl *) CMSG_DATA (cm); ! memset (iname, 0, sizeof (iname)); memcpy (iname, sdl->sdl_data, sdl->sdl_nlen); } Index: kernel_routes.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/bsd/kernel_routes.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** kernel_routes.c 5 Sep 2007 16:17:36 -0000 1.13 --- kernel_routes.c 4 Oct 2007 22:27:31 -0000 1.14 *************** *** 224,227 **** --- 224,235 ---- memcpy(&sin6.sin6_addr.s6_addr, &nexthop->gateway.v6, sizeof(struct in6_addr)); + memset(&sin6.sin6_addr.s6_addr, 0, 8); + sin6.sin6_addr.s6_addr[0] = 0xfe; + sin6.sin6_addr.s6_addr[1] = 0x80; + sin6.sin6_scope_id = nexthop->iif_index; + #ifdef __KAME__ + *(u_int16_t *)&sin6.sin6_addr.s6_addr[2] = htons(sin6.sin6_scope_id); + sin6.sin6_scope_id = 0; + #endif memcpy(walker, &sin6, sizeof (sin6)); walker += step; *************** *** 232,248 **** else { ! // Sven-Ola: This looks really ugly (please compar to IPv4 above) ! struct interface* iface = if_ifwithindex(nexthop->iif_index); ! if (NULL == iface) ! { ! fprintf(stderr, "interface %s not found\n", if_ifwithindex_name(nexthop->iif_index)); ! return -1; ! } ! memcpy(&sin6.sin6_addr.s6_addr, &iface->int6_addr.sin6_addr.s6_addr, ! sizeof(struct in6_addr)); memcpy(walker, &sin6, sizeof (sin6)); walker += step; ! rtm->rtm_flags |= RTF_LLINFO; } --- 240,256 ---- else { ! memcpy(&sin6.sin6_addr.s6_addr, &rt->rt_dst.prefix.v6, sizeof(struct in6_addr)); ! memset(&sin6.sin6_addr.s6_addr, 0, 8); ! sin6.sin6_addr.s6_addr[0] = 0xfe; ! sin6.sin6_addr.s6_addr[1] = 0x80; ! sin6.sin6_scope_id = nexthop->iif_index; ! #ifdef __KAME__ ! *(u_int16_t *)&sin6.sin6_addr.s6_addr[2] = htons(sin6.sin6_scope_id); ! sin6.sin6_scope_id = 0; ! #endif memcpy(walker, &sin6, sizeof (sin6)); walker += step; ! rtm->rtm_flags |= RTF_GATEWAY; } *************** *** 255,274 **** } - if ((rtm->rtm_flags & RTF_GATEWAY) != 0) - { - strcpy(&sdl.sdl_data[0], if_ifwithindex_name(nexthop->iif_index)); - sdl.sdl_nlen = (u_char)strlen((char*)&sdl.sdl_data[0]); - memcpy(walker, &sdl, sizeof (sdl)); - walker += step_dl; - rtm->rtm_addrs |= RTA_IFP; - } - rtm->rtm_msglen = (unsigned short)(walker - buff); len = write(olsr_cnf->rts, buff, rtm->rtm_msglen); ! ! if (len < rtm->rtm_msglen) fprintf(stderr, "cannot write to routing socket: %s\n", strerror(errno)); return 0; } --- 263,301 ---- } rtm->rtm_msglen = (unsigned short)(walker - buff); len = write(olsr_cnf->rts, buff, rtm->rtm_msglen); ! if (len < 0 && !(errno == EEXIST || errno == ESRCH)) fprintf(stderr, "cannot write to routing socket: %s\n", strerror(errno)); + /* If we get an EEXIST error while adding, delete and retry. */ + if (len < 0 && errno == EEXIST && rtm->rtm_type == RTM_ADD) { + struct rt_msghdr *drtm; + unsigned char dbuff[512]; + + memset(dbuff, 0, sizeof (dbuff)); + drtm = (struct rt_msghdr *)dbuff; + drtm->rtm_version = RTM_VERSION; + drtm->rtm_type = RTM_DELETE; + drtm->rtm_addrs = RTA_DST; + drtm->rtm_index = 0; + drtm->rtm_flags = olsr_rt_flags(rt); + drtm->rtm_seq = ++seq; + + walker = dbuff + sizeof (struct rt_msghdr); + memcpy(&sin6.sin6_addr.s6_addr, &rt->rt_dst.prefix.v6, + sizeof(struct in6_addr)); + memcpy(walker, &sin6, sizeof (sin6)); + walker += step; + drtm->rtm_msglen = (unsigned short)(walker - dbuff); + len = write(olsr_cnf->rts, dbuff, drtm->rtm_msglen); + if (len < 0) + fprintf(stderr, "cannot delete route: %s\n", strerror(errno)); + rtm->rtm_seq = ++seq; + len = write(olsr_cnf->rts, buff, rtm->rtm_msglen); + if (len < 0) + fprintf(stderr, "still cannot add route: %s\n", strerror(errno)); + } + return 0; } From (spam-protected) Fri Oct 5 00:29:53 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Thu, 04 Oct 2007 22:29:53 +0000 Subject: [Olsr-cvs] olsrd-current/lib/quagga Makefile,1.7,1.8 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/quagga In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32326/lib/quagga Modified Files: Makefile Log Message: * bug fix by Acinonyx Index: Makefile =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/quagga/Makefile,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Makefile 26 Jul 2007 17:34:54 -0000 1.7 --- Makefile 4 Oct 2007 22:29:51 -0000 1.8 *************** *** 42,45 **** --- 42,48 ---- PLUGIN_VER = 0.2.2 + TOPDIR = ../.. + include $(TOPDIR)/Makefile.inc + #CPPFLAGS += -DMY_DEBUG CFLAGS += -g *************** *** 50,56 **** #CPPFLAGS += -DZEBRA_HEADER_MARKER=255 - TOPDIR = ../.. - include $(TOPDIR)/Makefile.inc - ifeq ($(OS),win32) default_target install clean: --- 53,56 ---- From (spam-protected) Fri Oct 5 00:29:53 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Thu, 04 Oct 2007 22:29:53 +0000 Subject: [Olsr-cvs] olsrd-current CHANGELOG,1.93,1.94 Message-ID: Update of /cvsroot/olsrd/olsrd-current In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32326 Modified Files: CHANGELOG Log Message: * bug fix by Acinonyx Index: CHANGELOG =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/CHANGELOG,v retrieving revision 1.93 retrieving revision 1.94 diff -C2 -d -r1.93 -r1.94 *** CHANGELOG 4 Oct 2007 22:27:31 -0000 1.93 --- CHANGELOG 4 Oct 2007 22:29:51 -0000 1.94 *************** *** 150,153 **** --- 150,156 ---- - fix the loss link quality calculation for "windows size % 4 != 0" + PATCH by Acinonyx + - Bug fix: include $(TOPDIR)/Makefile.inc at the begin in the Quagga plugin + PATCHES and CLEANUPS by Bernd Petrovitsch - Made a function from the ME_TO_DOUBLE() macro (in src/mantissa.h). From (spam-protected) Fri Oct 5 00:40:21 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Thu, 04 Oct 2007 22:40:21 +0000 Subject: [Olsr-cvs] olsrd-current/lib/quagga/src olsrd_plugin.c,1.6,1.7 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/quagga/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4200/lib/quagga/src Modified Files: olsrd_plugin.c Log Message: * fixed warnings Index: olsrd_plugin.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/quagga/src/olsrd_plugin.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** olsrd_plugin.c 17 Sep 2007 22:24:22 -0000 1.6 --- olsrd_plugin.c 4 Oct 2007 22:40:19 -0000 1.7 *************** *** 34,41 **** static void __attribute__ ((constructor)) my_init(void); static void __attribute__ ((destructor)) my_fini(void); - static void redist_hna (void); - ! int olsrd_plugin_interface_version() { return PLUGIN_INTERFACE_VERSION; } --- 34,39 ---- static void __attribute__ ((constructor)) my_init(void); static void __attribute__ ((destructor)) my_fini(void); ! int olsrd_plugin_interface_version(void) { return PLUGIN_INTERFACE_VERSION; } *************** *** 92,96 **** ! int olsrd_plugin_init() { if(olsr_cnf->ip_version != AF_INET) { fputs("see the source - ipv6 so far not supported\n" ,stderr); --- 90,94 ---- ! int olsrd_plugin_init(void) { if(olsr_cnf->ip_version != AF_INET) { fputs("see the source - ipv6 so far not supported\n" ,stderr); From (spam-protected) Fri Oct 5 01:06:12 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Thu, 04 Oct 2007 23:06:12 +0000 Subject: [Olsr-cvs] olsrd-current/src/cfgparser oscan.lex,1.25,1.26 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src/cfgparser In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv13129/src/cfgparser Modified Files: oscan.lex Log Message: * apparently no one is using hex values in olsrd.conf as the HEXDIGIT reg-exp was totally broken. fixed it. And renamed it to HEX8 * renamed HEXBYTE to HEX16 as IPv6 actually has 16bit values there (and byte is misleading) * rearranged the regexps to look more similar. Since flex (and lex) generate DEAs out of it, it doesn't make a difference. * use "size_t". * use more options: I don't know if that breaks on *BSD. Index: oscan.lex =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/cfgparser/oscan.lex,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** oscan.lex 13 Sep 2007 16:08:13 -0000 1.25 --- oscan.lex 4 Oct 2007 23:06:10 -0000 1.26 *************** *** 72,76 **** static struct conf_token *get_conf_token(void); ! static struct conf_token *get_string_token(const char * const s, int const n); static struct conf_token *get_integer_token(const char * const s); static struct conf_token *get_floating_token(const char * const s); --- 72,76 ---- static struct conf_token *get_conf_token(void); ! static struct conf_token *get_string_token(const char * const s, const size_t n); static struct conf_token *get_integer_token(const char * const s); static struct conf_token *get_floating_token(const char * const s); *************** *** 86,90 **** } ! static struct conf_token *get_string_token(const char * const s, int const n) { struct conf_token *rv = get_conf_token(); --- 86,90 ---- } ! static struct conf_token *get_string_token(const char * const s, const size_t n) { struct conf_token *rv = get_conf_token(); *************** *** 131,152 **** %} %option noyywrap DECDIGIT [0-9] FLOAT {DECDIGIT}+\.{DECDIGIT}+ ! HEXDIGIT [a-f][A-F][0-9] ! IPV4ADDR ({DECDIGIT}){1,3}\.({DECDIGIT}){1,3}\.({DECDIGIT}){1,3}\.({DECDIGIT}){1,3} ! HEXBYTE ([a-f]|[A-F]|[0-9]){1,4} ! IP6PAT1 ({HEXBYTE}:){7}{HEXBYTE} ! IP6PAT2 {HEXBYTE}::({HEXBYTE}:){0,5}{HEXBYTE} ! IP6PAT3 ({HEXBYTE}:){2}:({HEXBYTE}:){0,4}{HEXBYTE} ! IP6PAT4 ({HEXBYTE}:){3}:({HEXBYTE}:){0,3}{HEXBYTE} ! IP6PAT5 ({HEXBYTE}:){4}:({HEXBYTE}:){0,2}{HEXBYTE} ! IP6PAT6 ({HEXBYTE}:){5}:({HEXBYTE}:){0,1}{HEXBYTE} ! IP6PAT7 ({HEXBYTE}:){6}:{HEXBYTE} ! IP6PAT8 ({HEXBYTE}:){1,7}: IP6PAT9 :: --- 131,157 ---- %} + %option never-interactive + %option noalways-interactive + %option nomain + %option nostack %option noyywrap DECDIGIT [0-9] FLOAT {DECDIGIT}+\.{DECDIGIT}+ ! HEX8 [a-fA-F0-9] ! QUAD {DECDIGIT}{1,3} ! IPV4ADDR {QUAD}\.{QUAD}\.{QUAD}\.{QUAD} ! HEX16 {HEX8}{1,4} ! IP6PAT2 ({HEX16}:){1}:({HEX16}:){0,5}{HEX16} ! IP6PAT3 ({HEX16}:){2}:({HEX16}:){0,4}{HEX16} ! IP6PAT4 ({HEX16}:){3}:({HEX16}:){0,3}{HEX16} ! IP6PAT5 ({HEX16}:){4}:({HEX16}:){0,2}{HEX16} ! IP6PAT6 ({HEX16}:){5}:({HEX16}:){0,1}{HEX16} ! IP6PAT7 ({HEX16}:){6}:({HEX16}) ! IP6PAT1 ({HEX16}:){7}{HEX16} ! IP6PAT8 ({HEX16}:){1,7}: IP6PAT9 :: *************** *** 178,182 **** } ! 0x{HEXDIGIT}+ { yylval = get_integer_token(yytext); return TOK_INTEGER; --- 183,187 ---- } ! 0x{HEX8}+ { yylval = get_integer_token(yytext); return TOK_INTEGER; From (spam-protected) Fri Oct 5 10:06:14 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Fri, 05 Oct 2007 08:06:14 +0000 Subject: [Olsr-cvs] olsrd-current CHANGELOG,1.94,1.95 Message-ID: Update of /cvsroot/olsrd/olsrd-current In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31163 Modified Files: CHANGELOG Log Message: patch by David Cornejo : use of an uninitialized variable Index: CHANGELOG =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/CHANGELOG,v retrieving revision 1.94 retrieving revision 1.95 diff -C2 -d -r1.94 -r1.95 *** CHANGELOG 4 Oct 2007 22:29:51 -0000 1.94 --- CHANGELOG 5 Oct 2007 08:06:12 -0000 1.95 *************** *** 153,156 **** --- 153,160 ---- - Bug fix: include $(TOPDIR)/Makefile.inc at the begin in the Quagga plugin + PATCH by David Cornejo + - fixed an "+=" of an uninitialized variable (detected with/by the + scan.coverty.com). + PATCHES and CLEANUPS by Bernd Petrovitsch - Made a function from the ME_TO_DOUBLE() macro (in src/mantissa.h). From (spam-protected) Fri Oct 5 10:06:14 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Fri, 05 Oct 2007 08:06:14 +0000 Subject: [Olsr-cvs] olsrd-current/src mpr.c,1.17,1.18 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31163/src Modified Files: mpr.c Log Message: patch by David Cornejo : use of an uninitialized variable Index: mpr.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/mpr.c,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** mpr.c 25 Apr 2007 22:08:09 -0000 1.17 --- mpr.c 5 Oct 2007 08:06:12 -0000 1.18 *************** *** 469,473 **** olsr_clear_mprs(); two_hop_count = olsr_calculate_two_hop_neighbors(); ! two_hop_covered_count += add_will_always_nodes(); /* --- 469,473 ---- olsr_clear_mprs(); two_hop_count = olsr_calculate_two_hop_neighbors(); ! two_hop_covered_count = add_will_always_nodes(); /* From (spam-protected) Fri Oct 5 10:39:15 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Fri, 05 Oct 2007 08:39:15 +0000 Subject: [Olsr-cvs] olsrd-current Makefile,1.98,1.99 Message-ID: Update of /cvsroot/olsrd/olsrd-current In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9529 Modified Files: Makefile Log Message: as reported by Aaron Kaplan : * BSD-xargs doesn't know "--no-run-if-empty" aka "-r". So we simply kill it (leaving a comment for me to not add it again in 6 months - I have yet to encounter a situation where "-r" is actually wrong) as "rm -f" without parameters does nothing anyways. * But it knows "-0" as I learned. So we use that too. And yes, if I use "find | xargs" it actually is written as "find -print0 | xargs -0r". Everytime. Index: Makefile =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/Makefile,v retrieving revision 1.98 retrieving revision 1.99 diff -C2 -d -r1.98 -r1.99 *** Makefile 16 Sep 2007 21:50:17 -0000 1.98 --- Makefile 5 Oct 2007 08:39:12 -0000 1.99 *************** *** 93,97 **** uberclean: clean clean_libs -rm -f $(TAGFILE) ! find . \( -name '*.[od]' -o -name '*~' \) -print | xargs -r rm -f $(MAKECMD) -C $(CFGDIR) uberclean $(MAKECMD) -C $(SWITCHDIR) clean --- 93,98 ---- uberclean: clean clean_libs -rm -f $(TAGFILE) ! # BSD-xargs has no "--no-run-if-empty" aka "-r" ! find . \( -name '*.[od]' -o -name '*~' \) -print0 | xargs -0 rm -f $(MAKECMD) -C $(CFGDIR) uberclean $(MAKECMD) -C $(SWITCHDIR) clean From (spam-protected) Fri Oct 5 10:39:16 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Fri, 05 Oct 2007 08:39:16 +0000 Subject: [Olsr-cvs] olsrd-current CHANGELOG,1.95,1.96 Message-ID: Update of /cvsroot/olsrd/olsrd-current In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11469 Modified Files: CHANGELOG Log Message: as reported by Aaron Kaplan : * BSD-xargs doesn't know "--no-run-if-empty" aka "-r". So we simply kill it (leaving a comment for me to not add it again in 6 months - I have yet to encounter a situation where "-r" is actually wrong) as "rm -f" without parameters does nothing anyways. * But it knows "-0" as I learned. So we use that too. And yes, if I use "find | xargs" it actually is written as "find -print0 | xargs -0r". Everytime. Index: CHANGELOG =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/CHANGELOG,v retrieving revision 1.95 retrieving revision 1.96 diff -C2 -d -r1.95 -r1.96 *** CHANGELOG 5 Oct 2007 08:06:12 -0000 1.95 --- CHANGELOG 5 Oct 2007 08:39:14 -0000 1.96 *************** *** 157,160 **** --- 157,163 ---- scan.coverty.com). + BUG erported by Aaron Kaplan + - BSD-xargs doesn't know "-r". + PATCHES and CLEANUPS by Bernd Petrovitsch - Made a function from the ME_TO_DOUBLE() macro (in src/mantissa.h). From (spam-protected) Fri Oct 5 22:10:27 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Fri, 05 Oct 2007 20:10:27 +0000 Subject: [Olsr-cvs] olsrd-current/src link_set.h, 1.31, 1.32 link_set.c, 1.73, 1.74 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17183/src Modified Files: link_set.h link_set.c Log Message: Misc changes: - several fields in struct link_entry since I see no reason ot keep them signed and it avoids warnings - killed the "loss_window_size" field in struct link_entry since it is only initalized and never changed. - minimized constant strings in olsr_print_link_set(). cleanup stuff: - const'ified parameters - reformatted to make it (IMHO) more readable Index: link_set.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/link_set.h,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** link_set.h 10 Feb 2007 19:27:32 -0000 1.31 --- link_set.h 5 Oct 2007 20:10:24 -0000 1.32 *************** *** 84,95 **** int loss_missed_hellos; ! int lost_packets; ! int total_packets; double loss_link_quality, loss_link_quality2; double loss_link_multiplier; ! int loss_window_size; ! int loss_index; unsigned char loss_bitmap[16]; --- 84,94 ---- int loss_missed_hellos; ! unsigned int lost_packets; ! unsigned int total_packets; double loss_link_quality, loss_link_quality2; double loss_link_multiplier; ! unsigned int loss_index; unsigned char loss_bitmap[16]; *************** *** 119,142 **** void ! del_if_link_entries(union olsr_ip_addr *); struct link_entry * ! get_best_link_to_neighbor(union olsr_ip_addr *); struct link_entry * ! lookup_link_entry(union olsr_ip_addr *, union olsr_ip_addr *remote_main, struct interface *); struct link_entry * ! update_link_entry(union olsr_ip_addr *, union olsr_ip_addr *, struct hello_message *, struct interface *); int ! check_neighbor_link(union olsr_ip_addr *); int ! replace_neighbor_link_set(struct neighbor_entry *, struct neighbor_entry *); int ! lookup_link_status(struct link_entry *); void --- 118,141 ---- void ! del_if_link_entries(const union olsr_ip_addr *); struct link_entry * ! get_best_link_to_neighbor(const union olsr_ip_addr *); struct link_entry * ! lookup_link_entry(const union olsr_ip_addr *, const union olsr_ip_addr *remote_main, const struct interface *); struct link_entry * ! update_link_entry(const union olsr_ip_addr *, const union olsr_ip_addr *, const struct hello_message *, const struct interface *); int ! check_neighbor_link(const union olsr_ip_addr *); int ! replace_neighbor_link_set(const struct neighbor_entry *, struct neighbor_entry *); int ! lookup_link_status(const struct link_entry *); void *************** *** 144,148 **** void ! olsr_update_packet_loss(union olsr_ip_addr *, struct interface *, olsr_u16_t); void --- 143,147 ---- void ! olsr_update_packet_loss(const union olsr_ip_addr *, const struct interface *, olsr_u16_t); void Index: link_set.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/link_set.c,v retrieving revision 1.73 retrieving revision 1.74 diff -C2 -d -r1.73 -r1.74 *** link_set.c 17 Sep 2007 22:24:22 -0000 1.73 --- link_set.c 5 Oct 2007 20:10:24 -0000 1.74 *************** *** 62,66 **** static int ! check_link_status(struct hello_message *message, struct interface *in_if); static void --- 62,66 ---- static int ! check_link_status(const struct hello_message *message, const struct interface *in_if); static void *************** *** 70,74 **** static struct link_entry * ! add_link_entry(union olsr_ip_addr *, union olsr_ip_addr *, union olsr_ip_addr *, double, double, struct interface *); static void --- 70,74 ---- static struct link_entry * ! add_link_entry(const union olsr_ip_addr *, const union olsr_ip_addr *, const union olsr_ip_addr *, double, double, const struct interface *); static void *************** *** 76,80 **** static int ! get_neighbor_status(union olsr_ip_addr *); --- 76,80 ---- static int ! get_neighbor_status(const union olsr_ip_addr *); *************** *** 121,125 **** */ int ! lookup_link_status(struct link_entry *entry) { --- 121,125 ---- */ int ! lookup_link_status(const struct link_entry *entry) { *************** *** 182,188 **** */ static int ! get_neighbor_status(union olsr_ip_addr *address) { ! union olsr_ip_addr *main_addr; struct interface *ifs; --- 182,188 ---- */ static int ! get_neighbor_status(const union olsr_ip_addr *address) { ! const union olsr_ip_addr *main_addr; struct interface *ifs; *************** *** 235,241 **** struct link_entry * ! get_best_link_to_neighbor(union olsr_ip_addr *remote) { ! union olsr_ip_addr *main_addr; struct link_entry *walker, *good_link, *backup_link; int curr_metric = MAX_IF_METRIC; --- 235,241 ---- struct link_entry * ! get_best_link_to_neighbor(const union olsr_ip_addr *remote) { ! const union olsr_ip_addr *main_addr; struct link_entry *walker, *good_link, *backup_link; int curr_metric = MAX_IF_METRIC; *************** *** 390,394 **** void ! del_if_link_entries(union olsr_ip_addr *int_addr) { struct link_entry *tmp_link_set, *last_link_entry; --- 390,394 ---- void ! del_if_link_entries(const union olsr_ip_addr *int_addr) { struct link_entry *tmp_link_set, *last_link_entry; *************** *** 459,469 **** static struct link_entry * ! add_link_entry(union olsr_ip_addr *local, union olsr_ip_addr *remote, union olsr_ip_addr *remote_main, double vtime, double htime, struct interface *local_if) { ! struct link_entry *tmp_link_set, *new_link; struct neighbor_entry *neighbor; ! ! if((tmp_link_set = lookup_link_entry(remote, remote_main, local_if))) return tmp_link_set; ! /* * if there exists no link tuple with --- 459,475 ---- static struct link_entry * ! add_link_entry(const union olsr_ip_addr *local, ! const union olsr_ip_addr *remote, ! const union olsr_ip_addr *remote_main, ! double vtime, ! double htime, ! const struct interface *local_if) { ! struct link_entry *new_link; struct neighbor_entry *neighbor; ! struct link_entry *tmp_link_set = lookup_link_entry(remote, remote_main, local_if); ! if (tmp_link_set) { ! return tmp_link_set; ! } /* * if there exists no link tuple with *************** *** 532,536 **** new_link->total_packets = 0; - new_link->loss_window_size = olsr_cnf->lq_wsize; new_link->loss_index = 0; --- 538,541 ---- *************** *** 613,617 **** int ! check_neighbor_link(union olsr_ip_addr *int_addr) { struct link_entry *tmp_link_set; --- 618,622 ---- int ! check_neighbor_link(const union olsr_ip_addr *int_addr) { struct link_entry *tmp_link_set; *************** *** 639,643 **** */ struct link_entry * ! lookup_link_entry(union olsr_ip_addr *remote, union olsr_ip_addr *remote_main, struct interface *local) { struct link_entry *tmp_link_set; --- 644,648 ---- */ struct link_entry * ! lookup_link_entry(const union olsr_ip_addr *remote, const union olsr_ip_addr *remote_main, const struct interface *local) { struct link_entry *tmp_link_set; *************** *** 682,689 **** */ struct link_entry * ! update_link_entry(union olsr_ip_addr *local, ! union olsr_ip_addr *remote, ! struct hello_message *message, ! struct interface *in_if) { struct link_entry *entry; --- 687,694 ---- */ struct link_entry * ! update_link_entry(const union olsr_ip_addr *local, ! const union olsr_ip_addr *remote, ! const struct hello_message *message, ! const struct interface *in_if) { struct link_entry *entry; *************** *** 755,759 **** */ int ! replace_neighbor_link_set(struct neighbor_entry *old, struct neighbor_entry *new) { --- 760,764 ---- */ int ! replace_neighbor_link_set(const struct neighbor_entry *old, struct neighbor_entry *new) { *************** *** 793,797 **** */ static int ! check_link_status(struct hello_message *message, struct interface *in_if) { int ret = UNSPEC_LINK; --- 798,802 ---- */ static int ! check_link_status(const struct hello_message *message, const struct interface *in_if) { int ret = UNSPEC_LINK; *************** *** 945,949 **** { struct link_entry *walker; ! char *fstr; OLSR_PRINTF(1, "\n--- %02d:%02d:%02d.%02d ---------------------------------------------------- LINKS\n\n", --- 950,954 ---- { struct link_entry *walker; ! const int addrsize = olsr_cnf->ip_version == AF_INET ? 15 : 39; OLSR_PRINTF(1, "\n--- %02d:%02d:%02d.%02d ---------------------------------------------------- LINKS\n\n", *************** *** 951,967 **** nowtm->tm_min, nowtm->tm_sec, ! (int)now.tv_usec/10000); ! ! if (olsr_cnf->ip_version == AF_INET) ! { ! OLSR_PRINTF(1, "IP address hyst LQ lost total NLQ ETX\n"); ! fstr = "%-15s %5.3f %5.3f %-3d %-3d %5.3f %.2f\n"; ! } ! ! else ! { ! OLSR_PRINTF(1, "IP address hyst LQ lost total NLQ ETX\n"); ! fstr = "%-39s %5.3f %5.3f %-3d %-3d %5.3f %.2f\n"; ! } for (walker = link_set; walker != NULL; walker = walker->next) --- 956,961 ---- nowtm->tm_min, nowtm->tm_sec, ! (int)now.tv_usec/10000U); ! OLSR_PRINTF(1, "%-*s %-6s %-6s %-6s %-6s %-6s %s\n", addrsize, "IP address", "hyst", "LQ", "lost", "total","NLQ", "ETX"); for (walker = link_set; walker != NULL; walker = walker->next) *************** *** 969,983 **** float etx; ! if (walker->loss_link_quality < MIN_LINK_QUALITY || ! walker->neigh_link_quality < MIN_LINK_QUALITY) etx = 0.0; - else etx = 1.0 / (walker->loss_link_quality * walker->neigh_link_quality); ! OLSR_PRINTF(1, fstr, olsr_ip_to_string(&walker->neighbor_iface_addr), ! walker->L_link_quality, walker->loss_link_quality, ! walker->lost_packets, walker->total_packets, ! walker->neigh_link_quality, etx); } } --- 963,979 ---- float etx; ! if (walker->loss_link_quality < MIN_LINK_QUALITY || walker->neigh_link_quality < MIN_LINK_QUALITY) etx = 0.0; else etx = 1.0 / (walker->loss_link_quality * walker->neigh_link_quality); ! OLSR_PRINTF(1, "%-*s %5.3f %5.3f %-3d %-3d %5.3f %.2f\n", ! addrsize, olsr_ip_to_string(&walker->neighbor_iface_addr), ! walker->L_link_quality, ! walker->loss_link_quality, ! walker->lost_packets, ! walker->total_packets, ! walker->neigh_link_quality, ! etx); } } *************** *** 1023,1032 **** // wrap around at the end of the packet loss window ! if (entry->loss_index >= entry->loss_window_size) entry->loss_index = 0; // count the total number of handled packets up to the window size ! if (entry->total_packets < entry->loss_window_size) entry->total_packets++; --- 1019,1028 ---- // wrap around at the end of the packet loss window ! if (entry->loss_index >= olsr_cnf->lq_wsize) entry->loss_index = 0; // count the total number of handled packets up to the window size ! if (entry->total_packets < olsr_cnf->lq_wsize) entry->total_packets++; *************** *** 1042,1050 **** // start slowly: receive the first packet => link quality = 1 / n // (n = window size) - entry->loss_link_quality = (float)(entry->total_packets - entry->lost_packets) / ! (float)(entry->loss_window_size < (2 * 4) ? entry->loss_window_size: ! 4 * (((float)entry->loss_window_size / 4 - 1) * entry->total_packets + entry->loss_window_size) / entry->loss_window_size); // multiply the calculated link quality with the user-specified multiplier --- 1038,1045 ---- // start slowly: receive the first packet => link quality = 1 / n // (n = window size) entry->loss_link_quality = (float)(entry->total_packets - entry->lost_packets) / ! (float)(olsr_cnf->lq_wsize < (2 * 4) ? olsr_cnf->lq_wsize: ! 4 * (((float)olsr_cnf->lq_wsize / 4 - 1) * entry->total_packets + olsr_cnf->lq_wsize) / olsr_cnf->lq_wsize); // multiply the calculated link quality with the user-specified multiplier *************** *** 1088,1092 **** } ! void olsr_update_packet_loss(union olsr_ip_addr *rem, struct interface *loc, olsr_u16_t seqno) { --- 1083,1087 ---- } ! void olsr_update_packet_loss(const union olsr_ip_addr *rem, const struct interface *loc, olsr_u16_t seqno) { From (spam-protected) Fri Oct 5 22:24:49 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Fri, 05 Oct 2007 20:24:49 +0000 Subject: [Olsr-cvs] olsrd-current/lib/nameservice/src nameservice.h, 1.13, 1.14 nameservice.c, 1.31, 1.32 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/nameservice/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25511/lib/nameservice/src Modified Files: nameservice.h nameservice.c Log Message: cleanups: * localized a global buffer * made local functions "static" * const'ified parameters Index: nameservice.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/nameservice/src/nameservice.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** nameservice.h 5 Sep 2007 16:11:10 -0000 1.13 --- nameservice.h 5 Oct 2007 20:24:47 -0000 1.14 *************** *** 121,125 **** struct name_entry* ! add_name_to_list(struct name_entry *my_list, char *value, int type, const union olsr_ip_addr *ip); struct name_entry* --- 121,125 ---- struct name_entry* ! add_name_to_list(struct name_entry *my_list, const char *value, int type, const union olsr_ip_addr *ip); struct name_entry* Index: nameservice.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/nameservice/src/nameservice.c,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** nameservice.c 17 Sep 2007 22:24:22 -0000 1.31 --- nameservice.c 5 Oct 2007 20:24:47 -0000 1.32 *************** *** 64,70 **** - /* send buffer: huge */ - static char buffer[10240]; - /* config parameters */ static char my_hosts_file[MAX_FILE + 1]; --- 64,67 ---- *************** *** 77,81 **** static char latlon_in_file[MAX_FILE + 1]; static char my_latlon_file[MAX_FILE + 1]; ! float my_lat = 0.0, my_lon = 0.0; /* the databases (using hashing) --- 74,78 ---- static char latlon_in_file[MAX_FILE + 1]; static char my_latlon_file[MAX_FILE + 1]; ! static float my_lat = 0.0, my_lon = 0.0; /* the databases (using hashing) *************** *** 85,111 **** * are store in a linked list (without hashing) * */ ! struct db_entry* list[HASHSIZE]; ! struct name_entry *my_names = NULL; ! olsr_bool name_table_changed = OLSR_TRUE; ! struct db_entry* service_list[HASHSIZE]; ! struct name_entry *my_services = NULL; ! olsr_bool service_table_changed = OLSR_TRUE; ! struct db_entry* forwarder_list[HASHSIZE]; ! struct name_entry *my_forwarders = NULL; ! olsr_bool forwarder_table_changed = OLSR_TRUE; ! struct db_entry* latlon_list[HASHSIZE]; ! olsr_bool latlon_table_changed = OLSR_TRUE; /* regular expression to be matched by valid hostnames, compiled in name_init() */ ! regex_t regex_t_name; ! regmatch_t regmatch_t_name; /* regular expression to be matched by valid service_lines, compiled in name_init() */ ! regex_t regex_t_service; ! int pmatch_service = 10; ! regmatch_t regmatch_t_service[10]; /** --- 82,108 ---- * are store in a linked list (without hashing) * */ ! static struct db_entry* list[HASHSIZE]; ! static struct name_entry *my_names = NULL; ! static olsr_bool name_table_changed = OLSR_TRUE; ! static struct db_entry* service_list[HASHSIZE]; ! static struct name_entry *my_services = NULL; ! static olsr_bool service_table_changed = OLSR_TRUE; ! static struct db_entry* forwarder_list[HASHSIZE]; ! static struct name_entry *my_forwarders = NULL; ! static olsr_bool forwarder_table_changed = OLSR_TRUE; ! static struct db_entry* latlon_list[HASHSIZE]; ! static olsr_bool latlon_table_changed = OLSR_TRUE; /* regular expression to be matched by valid hostnames, compiled in name_init() */ ! static regex_t regex_t_name; ! static regmatch_t regmatch_t_name; /* regular expression to be matched by valid service_lines, compiled in name_init() */ ! static regex_t regex_t_service; ! static int pmatch_service = 10; ! static regmatch_t regmatch_t_service[10]; /** *************** *** 269,273 **** */ struct name_entry* ! add_name_to_list(struct name_entry *my_list, char *value, int type, const union olsr_ip_addr *ip) { struct name_entry *tmp = olsr_malloc(sizeof(struct name_entry), "new name_entry add_name_to_list"); --- 266,270 ---- */ struct name_entry* ! add_name_to_list(struct name_entry *my_list, const char *value, int type, const union olsr_ip_addr *ip) { struct name_entry *tmp = olsr_malloc(sizeof(struct name_entry), "new name_entry add_name_to_list"); *************** *** 552,556 **** olsr_event(void *foo __attribute__((unused))) { ! union olsr_message *message = (union olsr_message*)buffer; struct interface *ifn; int namesize; --- 549,555 ---- olsr_event(void *foo __attribute__((unused))) { ! /* send buffer: huge */ ! char buffer[10240]; ! union olsr_message *message = (union olsr_message *)buffer; struct interface *ifn; int namesize; From (spam-protected) Fri Oct 5 22:57:56 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Fri, 05 Oct 2007 20:57:56 +0000 Subject: [Olsr-cvs] olsrd-current/src olsr.c,1.58,1.59 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9340/src Modified Files: olsr.c Log Message: * simplify the formula avoiding unnecessary floating point calculations and give the compiler as much freedom as possible. Index: olsr.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/olsr.c,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** olsr.c 16 Sep 2007 21:20:16 -0000 1.58 --- olsr.c 5 Oct 2007 20:57:53 -0000 1.59 *************** *** 395,406 **** void set_buffer_timer(struct interface *ifn) ! { ! float jitter; ! /* Set timer */ ! jitter = (float) random()/RAND_MAX; ! jitter *= olsr_cnf->max_jitter; ! ! ifn->fwdtimer = GET_TIMESTAMP(jitter*1000); } --- 395,401 ---- void set_buffer_timer(struct interface *ifn) ! { /* Set timer */ ! ifn->fwdtimer = GET_TIMESTAMP(random() * olsr_cnf->max_jitter * 1000 / RAND_MAX); } *************** *** 486,490 **** } ! snprintf(type, 20, "UNKNOWN(%d)", msgtype); return type; } --- 481,485 ---- } ! snprintf(type, sizeof(type), "UNKNOWN(%d)", msgtype); return type; } *************** *** 512,516 **** } ! snprintf(type, 20, "UNKNOWN(%d)", linktype); return type; } --- 507,511 ---- } ! snprintf(type, sizeof(type), "UNKNOWN(%d)", linktype); return type; } *************** *** 534,538 **** } ! snprintf(type, 20, "UNKNOWN(%d)", status); return type; } --- 529,533 ---- } ! snprintf(type, sizeof(type), "UNKNOWN(%d)", status); return type; } *************** *** 570,576 **** olsr_malloc(size_t size, const char *id) { ! void *ptr; ! ! if((ptr = malloc(size)) == 0) { const char * const err_msg = strerror(errno); --- 565,570 ---- olsr_malloc(size_t size, const char *id) { ! void *ptr = malloc(size); ! if(ptr == 0) { const char * const err_msg = strerror(errno); From (spam-protected) Wed Oct 10 22:44:36 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Wed, 10 Oct 2007 20:44:36 +0000 Subject: [Olsr-cvs] olsrd-current/src/cfgparser oscan.lex,1.26,1.27 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src/cfgparser In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20713/src/cfgparser Modified Files: oscan.lex Log Message: * kill a warning on 64bit Index: oscan.lex =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/cfgparser/oscan.lex,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** oscan.lex 4 Oct 2007 23:06:10 -0000 1.26 --- oscan.lex 10 Oct 2007 20:44:34 -0000 1.27 *************** *** 92,96 **** rv->string = malloc(n+1); if (rv->string == NULL) { ! fprintf(stderr, "Cannot allocate %d bytes for string token data.\n", n+1); free(rv); return NULL; --- 92,96 ---- rv->string = malloc(n+1); if (rv->string == NULL) { ! fprintf(stderr, "Cannot allocate %lu bytes for string token data.\n", (unsigned long)(n+1)); /* size_t on 64bit */ free(rv); return NULL; From (spam-protected) Wed Oct 10 23:24:56 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Wed, 10 Oct 2007 21:24:56 +0000 Subject: [Olsr-cvs] olsrd-current/lib/quagga Contributors, 1.1, 1.2 Makefile, 1.8, 1.9 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/quagga In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5038/lib/quagga Modified Files: Contributors Makefile Log Message: * updated to SVN trunk - revision 48 Index: Makefile =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/quagga/Makefile,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Makefile 4 Oct 2007 22:29:51 -0000 1.8 --- Makefile 10 Oct 2007 21:24:54 -0000 1.9 *************** *** 42,63 **** PLUGIN_VER = 0.2.2 ! TOPDIR = ../.. include $(TOPDIR)/Makefile.inc ! #CPPFLAGS += -DMY_DEBUG ! CFLAGS += -g ! CPPFLAGS += -DUSE_UNIX_DOMAIN_SOCKET #uncomment the following line only if you are sure what you're doing, it will #probably break things! ! #CPPFLAGS += -DZEBRA_HEADER_MARKER=255 ifeq ($(OS),win32) default_target install clean: ! @echo "**** Quagga not supportet on Windows (so it would be pointless to build the Quagga Plugin" else default_target: $(PLUGIN_FULLNAME) ! $(PLUGIN_FULLNAME): $(OBJS) version-script.txt $(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS) --- 42,63 ---- PLUGIN_VER = 0.2.2 ! TOPDIR= ../.. include $(TOPDIR)/Makefile.inc ! #CPPFLAGS +=-DMY_DEBUG ! CFLAGS += -g ! CPPFLAGS +=-DUSE_UNIX_DOMAIN_SOCKET #uncomment the following line only if you are sure what you're doing, it will #probably break things! ! # CPPFLAGS +=-DZEBRA_HEADER_MARKER=255 ifeq ($(OS),win32) default_target install clean: ! @echo "**** Quagga not supportet on Windows (so it would be pointless to build the Quagga Plugin)" else default_target: $(PLUGIN_FULLNAME) ! $(PLUGIN_FULLNAME): $(OBJS) $(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS) Index: Contributors =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/quagga/Contributors,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Contributors 16 Aug 2007 19:07:28 -0000 1.1 --- Contributors 10 Oct 2007 21:24:54 -0000 1.2 *************** *** 3,4 **** --- 3,7 ---- * Vassilis T. for a lot of cleanups and fixes * Johannes Joemann <5 at free.de> for a lot of testing + * Bernd Petrovitsch for support and new plugin-interface + * Hannes Gredler for new routing-core + * Sven Ola Tucke for various bugfixes From (spam-protected) Wed Oct 10 23:24:56 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Wed, 10 Oct 2007 21:24:56 +0000 Subject: [Olsr-cvs] olsrd-current/lib/quagga/src olsrd_plugin.c, 1.7, 1.8 quagga.c, 1.7, 1.8 quagga.h, 1.4, 1.5 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/quagga/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5038/lib/quagga/src Modified Files: olsrd_plugin.c quagga.c quagga.h Log Message: * updated to SVN trunk - revision 48 Index: olsrd_plugin.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/quagga/src/olsrd_plugin.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** olsrd_plugin.c 4 Oct 2007 22:40:19 -0000 1.7 --- olsrd_plugin.c 10 Oct 2007 21:24:54 -0000 1.8 *************** *** 20,23 **** --- 20,24 ---- #include "olsrd_plugin.h" + #include "plugin_util.h" #include "olsr.h" #include "scheduler.h" *************** *** 30,90 **** #define PLUGIN_AUTHOR "Immo 'FaUl' Wehrenberg" #define MOD_DESC PLUGIN_NAME " " PLUGIN_VERSION " by " PLUGIN_AUTHOR ! #define PLUGIN_INTERFACE_VERSION 4 static void __attribute__ ((constructor)) my_init(void); static void __attribute__ ((destructor)) my_fini(void); ! int olsrd_plugin_interface_version(void) { return PLUGIN_INTERFACE_VERSION; } ! int olsrd_plugin_register_param(char *key, char *value) { ! const char *zebra_route_types[] = {"system","kernel","connect","static", ! "rip","ripng","ospf","ospf6","isis", ! "bgp","hsls", NULL}; ! unsigned char i = 0; ! if(!strcmp(key, "redistribute")) { ! for (i = 0; zebra_route_types[i]; i++) ! if (!strcmp(value, zebra_route_types[i])) { ! zebra_redistribute(i); ! return 1; ! } ! } ! else if(!strcmp(key, "ExportRoutes")) { ! if (!strcmp(value, "only")) { ! if (!olsr_addroute_remove_function(&olsr_ioctl_add_route, AF_INET)) ! puts ("AIII, could not remove the kernel route exporter"); ! if (!olsr_delroute_remove_function(&olsr_ioctl_del_route, AF_INET)) ! puts ("AIII, could not remove the kernel route deleter"); ! olsr_addroute_add_function(&zebra_add_olsr_v4_route, AF_INET); ! olsr_delroute_add_function(&zebra_del_olsr_v4_route, AF_INET); ! zebra_export_routes(1); ! return 1; ! } ! else if (!strcmp(value, "additional")) { ! olsr_addroute_add_function(&zebra_add_olsr_v4_route, AF_INET); ! olsr_delroute_add_function(&zebra_del_olsr_v4_route, AF_INET); ! zebra_export_routes(1); ! return 1; } - else zebra_export_routes(0); } ! else if (!strcmp(key, "Distance")) { ! unsigned int distance = atoi (value); ! if (distance < 255) ! zebra_olsr_distance(distance); ! return 1; } ! ! else if (!strcmp(key, "LocalPref")) { ! if (!strcmp(value, "true")) ! zebra_olsr_localpref(); ! else if (strcmp (value, "false")) ! return -1; ! return 1; } ! return -1; } --- 31,117 ---- #define PLUGIN_AUTHOR "Immo 'FaUl' Wehrenberg" #define MOD_DESC PLUGIN_NAME " " PLUGIN_VERSION " by " PLUGIN_AUTHOR ! #define PLUGIN_INTERFACE_VERSION 5 static void __attribute__ ((constructor)) my_init(void); static void __attribute__ ((destructor)) my_fini(void); ! static set_plugin_parameter set_redistribute; ! static set_plugin_parameter set_exportroutes; ! static set_plugin_parameter set_distance; ! static set_plugin_parameter set_localpref; ! ! ! int olsrd_plugin_interface_version (void) { return PLUGIN_INTERFACE_VERSION; } + static const struct olsrd_plugin_parameters plugin_parameters[] = { + { .name = "redistribute", .set_plugin_parameter = &set_redistribute, }, + { .name = "ExportRoutes", .set_plugin_parameter = &set_exportroutes, }, + { .name = "Distance", .set_plugin_parameter = &set_distance, }, + { .name = "LocalPref", .set_plugin_parameter = &set_localpref, }, + }; ! void olsrd_get_plugin_parameters (const struct olsrd_plugin_parameters **params, ! int *size) { ! *params = plugin_parameters; ! *size = sizeof plugin_parameters / sizeof *plugin_parameters; ! } ! static int set_redistribute (const char *value, ! void *data __attribute__((unused)), ! set_plugin_parameter_addon addon __attribute__((unused))) { ! const char *zebra_route_types[] = {"system","kernel","connect", ! "static","rip","ripng","ospf", ! "ospf6","isis","bgp","hsls"}; ! unsigned int i; ! ! for (i = 0; i < ARRAYSIZE(zebra_route_types); i++) { ! if (!strcmp(value, zebra_route_types[i])) { ! zebra_redistribute(i); ! return 0; } } ! return 1; ! } ! ! static int set_exportroutes (const char *value, ! void *data __attribute__((unused)), ! set_plugin_parameter_addon addon __attribute__((unused))) { ! if (!strcmp(value, "only")) { ! if (!olsr_addroute_remove_function(&olsr_ioctl_add_route, AF_INET)) ! puts ("AIII, could not remove the kernel route exporter"); ! if (!olsr_delroute_remove_function(&olsr_ioctl_del_route, AF_INET)) ! puts ("AIII, could not remove the kernel route deleter"); ! olsr_addroute_add_function(&zebra_add_olsr_v4_route, AF_INET); ! olsr_delroute_add_function(&zebra_del_olsr_v4_route, AF_INET); ! zebra_export_routes(1); } ! else if (!strcmp(value, "additional")) { ! olsr_addroute_add_function(&zebra_add_olsr_v4_route, AF_INET); ! olsr_delroute_add_function(&zebra_del_olsr_v4_route, AF_INET); ! zebra_export_routes(1); } ! else zebra_export_routes(0); ! return 0; ! } ! ! static int set_distance(const char *value, void *data __attribute__((unused)), ! set_plugin_parameter_addon addon __attribute__((unused))) { ! int distance; ! ! if (set_plugin_int(value, &distance, addon)) return 1; ! if (distance < 0 || distance > 255) return 1; ! zebra_olsr_distance(distance); ! return 0; ! } ! ! static int set_localpref(const char *value, void *data __attribute__((unused)), ! set_plugin_parameter_addon addon __attribute__((unused))) { ! int b; ! ! if (set_plugin_boolean(value, &b, addon)) return 1; ! if (b) zebra_olsr_localpref(); ! return 0; } Index: quagga.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/quagga/src/quagga.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** quagga.h 25 Aug 2007 19:48:42 -0000 1.4 --- quagga.h 10 Oct 2007 21:24:54 -0000 1.5 *************** *** 63,70 **** int add_hna4_route (struct ipv4_route); int delete_hna4_route (struct ipv4_route); ! void *my_realloc (void *, size_t, const char*); ! int zebra_add_olsr_v4_route (struct rt_entry*); ! int zebra_del_olsr_v4_route (struct rt_entry*); void zebra_olsr_localpref (void); ! void zebra_olsr_distance (char); ! void zebra_export_routes (unsigned char); --- 63,70 ---- int add_hna4_route (struct ipv4_route); int delete_hna4_route (struct ipv4_route); ! void *my_realloc (void *, size_t, const char *); ! int zebra_add_olsr_v4_route (struct rt_entry *); ! int zebra_del_olsr_v4_route (struct rt_entry *); void zebra_olsr_localpref (void); ! void zebra_olsr_distance (unsigned char); ! void zebra_export_routes(unsigned char); Index: quagga.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/quagga/src/quagga.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** quagga.c 5 Sep 2007 16:17:35 -0000 1.7 --- quagga.c 10 Oct 2007 21:24:54 -0000 1.8 *************** *** 33,36 **** --- 33,37 ---- #include "defs.h" #include "local_hna_set.h" + #include "routing_table.h" #ifdef USE_UNIX_DOMAIN_SOCKET *************** *** 78,81 **** --- 79,83 ---- static uint32_t prefixlentomask (uint8_t); static void free_ipv4_route (struct ipv4_route); + /* static void update_olsr_zebra_routes (struct ipv4_route*, struct ipv4_route*); static struct ipv4_route *zebra_create_ipv4_route_table_entry (uint32_t, *************** *** 84,88 **** static struct ipv4_route *zebra_create_ipv4_route_table (void); static void zebra_free_ipv4_route_table (struct ipv4_route*); ! static uint8_t masktoprefixlen (uint32_t); --- 86,92 ---- static struct ipv4_route *zebra_create_ipv4_route_table (void); static void zebra_free_ipv4_route_table (struct ipv4_route*); ! */ ! ! /*static uint8_t masktoprefixlen (uint32_t);*/ *************** *** 164,175 **** void zebra_cleanup (void) { int i; if (zebra.options & OPTION_EXPORT) { ! struct rt_entry *rt; ! OLSR_FOR_ALL_RT_ENTRIES(rt) { ! zebra_del_olsr_v4_route (rt); ! } OLSR_FOR_ALL_RT_ENTRIES_END(rt); ! } ! for (i = 0; ZEBRA_ROUTE_MAX - 1; i++) if (zebra.redistribute[i]) zebra_disable_redistribute(i + 1); } --- 168,180 ---- void zebra_cleanup (void) { int i; + struct rt_entry *tmp; + if (zebra.options & OPTION_EXPORT) { ! OLSR_FOR_ALL_RT_ENTRIES(tmp) { ! zebra_del_olsr_v4_route(tmp); ! } OLSR_FOR_ALL_RT_ENTRIES_END(tmp); ! } ! for (i = 0; i < ZEBRA_ROUTE_MAX; i++) if (zebra.redistribute[i]) zebra_disable_redistribute(i + 1); } *************** *** 177,180 **** --- 182,186 ---- static void zebra_reconnect (void) { + struct rt_entry *tmp; int i; *************** *** 183,193 **** if (zebra.options & OPTION_EXPORT) { ! struct rt_entry *rt; ! OLSR_FOR_ALL_RT_ENTRIES(rt) { ! zebra_add_olsr_v4_route (rt); ! } OLSR_FOR_ALL_RT_ENTRIES_END(rt); } ! for (i = 0; ZEBRA_ROUTE_MAX - 1; i++) if (zebra.redistribute[i]) zebra_redistribute(i + 1); /* Zebra sends us all routes of type it knows after --- 189,198 ---- if (zebra.options & OPTION_EXPORT) { ! OLSR_FOR_ALL_RT_ENTRIES(tmp) { ! zebra_add_olsr_v4_route (tmp); ! } OLSR_FOR_ALL_RT_ENTRIES_END(tmp); } ! for (i = 0; i < ZEBRA_ROUTE_MAX; i++) if (zebra.redistribute[i]) zebra_redistribute(i + 1); /* Zebra sends us all routes of type it knows after *************** *** 199,202 **** --- 204,209 ---- /* Connect to the zebra-daemon, returns a socket */ static void zebra_connect (void) { + + int ret; #ifndef USE_UNIX_DOMAIN_SOCKET *************** *** 213,218 **** #endif - int ret; - if (zebra.sock <0 ) olsr_exit("(QUAGGA) Could not create socket!", EXIT_FAILURE); --- 220,223 ---- *************** *** 237,241 **** the command defined in zebra.h, options is the packet-payload, optlen the length, of the payload */ ! unsigned char zebra_send_command (unsigned char command, unsigned char * options, int optlen) { #ifdef ZEBRA_HEADER_MARKER --- 242,247 ---- the command defined in zebra.h, options is the packet-payload, optlen the length, of the payload */ ! unsigned char zebra_send_command (unsigned char command, ! unsigned char *options, int optlen) { #ifdef ZEBRA_HEADER_MARKER *************** *** 291,295 **** /* Creates a Route-Packet-Payload, needs address, netmask, nexthop, distance, and a pointer of an size_t */ ! static unsigned char* zebra_route_packet (struct ipv4_route r, ssize_t *optlen) { int count; --- 297,302 ---- /* Creates a Route-Packet-Payload, needs address, netmask, nexthop, distance, and a pointer of an size_t */ ! static unsigned char* zebra_route_packet (struct ipv4_route r, ! ssize_t *optlen) { int count; *************** *** 298,302 **** *optlen = 4; // first: type, flags, message, prefixlen *optlen += r.prefixlen / 8 + (r.prefixlen % 8 ? 1 : 0); // + prefix ! if (r.message & ZAPI_MESSAGE_NEXTHOP) if (r.nexthops->type == ZEBRA_NEXTHOP_IPV4 || r.nexthops->type == ZEBRA_NEXTHOP_IPV4_IFINDEX){ --- 305,309 ---- *optlen = 4; // first: type, flags, message, prefixlen *optlen += r.prefixlen / 8 + (r.prefixlen % 8 ? 1 : 0); // + prefix ! if (r.message & ZAPI_MESSAGE_NEXTHOP) { if (r.nexthops->type == ZEBRA_NEXTHOP_IPV4 || r.nexthops->type == ZEBRA_NEXTHOP_IPV4_IFINDEX){ *************** *** 306,309 **** --- 313,317 ---- else if (r.nexthops->type == 0) *optlen += 5; + } if (r.message & ZAPI_MESSAGE_IFINDEX) *optlen += r.ind_num * sizeof *r.index + 1; *************** *** 402,408 **** do { ret = zebra_parse_packet (f, len); ! if (!ret) { // something wired happened olsr_exit ("(QUAGGA) Zero message length??? ", EXIT_FAILURE); - } f += ret; } while ((f - data) < len); --- 410,415 ---- do { ret = zebra_parse_packet (f, len); ! if (!ret) // something wired happened olsr_exit ("(QUAGGA) Zero message length??? ", EXIT_FAILURE); f += ret; } while ((f - data) < len); *************** *** 716,719 **** --- 723,727 ---- } + /* static uint8_t masktoprefixlen (uint32_t mask) { *************** *** 727,730 **** --- 735,739 ---- } + */ int zebra_add_olsr_v4_route (struct rt_entry *r) { *************** *** 736,742 **** route.message = ZAPI_MESSAGE_METRIC; route.flags = zebra.flags; ! route.prefixlen = r->rt_dst.prefix_len; route.prefix = r->rt_dst.prefix.v4; ! if ((r->rt_best->rtp_nexthop.gateway.v4 == r->rt_dst.prefix.v4 && route.prefixlen == 32)) { route.message |= ZAPI_MESSAGE_IFINDEX | ZAPI_MESSAGE_NEXTHOP; --- 745,751 ---- route.message = ZAPI_MESSAGE_METRIC; route.flags = zebra.flags; ! route.prefixlen =(r->rt_dst.prefix_len); route.prefix = r->rt_dst.prefix.v4; ! if ((r->rt_best->rtp_nexthop.gateway.v4 == r->rt_dst.prefix.v4 && route.prefixlen == 32)) { route.message |= ZAPI_MESSAGE_IFINDEX | ZAPI_MESSAGE_NEXTHOP; *************** *** 784,788 **** route.prefixlen = r->rt_dst.prefix_len; route.prefix = r->rt_dst.prefix.v4; ! if ((r->rt_best->rtp_nexthop.gateway.v4 == r->rt_dst.prefix.v4 && route.prefixlen == 32)){ route.message |= ZAPI_MESSAGE_IFINDEX; route.ind_num = 1; --- 793,798 ---- route.prefixlen = r->rt_dst.prefix_len; route.prefix = r->rt_dst.prefix.v4; ! if ((r->rt_best->rtp_nexthop.gateway.v4 == r->rt_dst.prefix.v4 && ! route.prefixlen == 32)){ route.message |= ZAPI_MESSAGE_IFINDEX; route.ind_num = 1; *************** *** 814,823 **** } ! del_v4_route_status(route); free_ipv4_route (route); return retval; } ! void zebra_olsr_distance (char dist) { zebra.distance = dist; } --- 824,834 ---- } ! retval = zebra_delete_v4_route(route); ! free_ipv4_route (route); return retval; } ! void zebra_olsr_distance (unsigned char dist) { zebra.distance = dist; } *************** *** 827,831 **** } ! void zebra_export (char t) { if (t) zebra.options |= OPTION_EXPORT; --- 838,842 ---- } ! void zebra_export_routes (unsigned char t) { if (t) zebra.options |= OPTION_EXPORT; From (spam-protected) Wed Oct 10 23:29:50 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Wed, 10 Oct 2007 21:29:50 +0000 Subject: [Olsr-cvs] olsrd-current/lib/quagga/src quagga.c,1.8,1.9 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/quagga/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv7036/lib/quagga/src Modified Files: quagga.c Log Message: * killed warnings - all are trivial Index: quagga.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/quagga/src/quagga.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** quagga.c 10 Oct 2007 21:24:54 -0000 1.8 --- quagga.c 10 Oct 2007 21:29:48 -0000 1.9 *************** *** 397,401 **** /* Check wether there is data from zebra aviable */ ! void zebra_check (void* foo) { unsigned char *data, *f; ssize_t len, ret; --- 397,401 ---- /* Check wether there is data from zebra aviable */ ! void zebra_check (void* foo __attribute__((unused))) { unsigned char *data, *f; ssize_t len, ret; *************** *** 495,499 **** if (maxlen < length) { ! olsr_printf (1, "(QUAGGA) maxlen = %d, packet_length = %d\n", maxlen, length); olsr_exit ("(QUAGGA) programmer is an idiot", EXIT_FAILURE); } --- 495,499 ---- if (maxlen < length) { ! olsr_printf (1, "(QUAGGA) maxlen = %lu, packet_length = %d\n", (unsigned long)maxlen, length); olsr_exit ("(QUAGGA) programmer is an idiot", EXIT_FAILURE); } *************** *** 525,529 **** ! static int parse_interface_add (unsigned char *opt, size_t len) { //todo return 0; --- 525,529 ---- ! static int parse_interface_add (unsigned char *opt __attribute__((unused)), size_t len __attribute__((unused))) { //todo return 0; *************** *** 531,535 **** ! static int parse_interface_delete (unsigned char *opt, size_t len) { //todo return 0; --- 531,535 ---- ! static int parse_interface_delete (unsigned char *opt __attribute__((unused)), size_t len __attribute__((unused))) { //todo return 0; *************** *** 537,541 **** ! static int parse_interface_address_add (unsigned char *opt, size_t len) { //todo --- 537,541 ---- ! static int parse_interface_address_add (unsigned char *opt __attribute__((unused)), size_t len __attribute__((unused))) { //todo *************** *** 543,547 **** } ! static int parse_interface_up (unsigned char *opt, size_t len) { //todo --- 543,547 ---- } ! static int parse_interface_up (unsigned char *opt __attribute__((unused)), size_t len __attribute__((unused))) { //todo *************** *** 549,553 **** } ! static int parse_interface_down (unsigned char *opt, size_t len) { //todo --- 549,553 ---- } ! static int parse_interface_down (unsigned char *opt __attribute__((unused)), size_t len __attribute__((unused))) { //todo *************** *** 556,560 **** ! static int parse_interface_address_delete (unsigned char *opt, size_t len) { //todo return 0; --- 556,560 ---- ! static int parse_interface_address_delete (unsigned char *opt __attribute__((unused)), size_t len __attribute__((unused))) { //todo return 0; *************** *** 645,649 **** } ! static int parse_ipv6_route_add (unsigned char *opt, size_t len) { //todo return 0; --- 645,649 ---- } ! static int parse_ipv6_route_add (unsigned char *opt __attribute__((unused)), size_t len __attribute__((unused))) { //todo return 0; From (spam-protected) Sat Oct 13 14:04:12 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sat, 13 Oct 2007 12:04:12 +0000 Subject: [Olsr-cvs] olsrd-current/lib/httpinfo/src html.h,1.8,1.9 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/httpinfo/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24387/lib/httpinfo/src Modified Files: html.h Log Message: * fixed up the html Index: html.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/httpinfo/src/html.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** html.h 16 Sep 2007 21:20:07 -0000 1.8 --- html.h 13 Oct 2007 12:04:10 -0000 1.9 *************** *** 103,107 **** "\"olsrd", "", - "

", "", "\n\n", --- 103,106 ---- *************** *** 133,137 **** "(C)2005 Andreas Tønnesen
\n", "http://www.olsr.org\n", ! "\n", "\n", "\n", --- 132,136 ---- "(C)2005 Andreas Tønnesen
\n", "http://www.olsr.org\n", ! "

\n", "\n", "\n", From (spam-protected) Sat Oct 13 14:04:59 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sat, 13 Oct 2007 12:04:59 +0000 Subject: [Olsr-cvs] olsrd-current/lib/httpinfo/src olsrd_httpinfo.c, 1.77, 1.78 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/httpinfo/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24441/lib/httpinfo/src Modified Files: olsrd_httpinfo.c Log Message: * fixed up the html Index: olsrd_httpinfo.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/httpinfo/src/olsrd_httpinfo.c,v retrieving revision 1.77 retrieving revision 1.78 diff -C2 -d -r1.77 -r1.78 *** olsrd_httpinfo.c 16 Sep 2007 21:20:07 -0000 1.77 --- olsrd_httpinfo.c 13 Oct 2007 12:04:57 -0000 1.78 *************** *** 780,785 **** size += snprintf(&buf[size], bufsize-size, "

OLSR routes in kernel

\n"); ! size += snprintf(&buf[size], bufsize-size, "DestinationGateway", ! resolve_ip_addresses ? " colspan=\"2\"" : ""); size += snprintf(&buf[size], bufsize-size, ""); --- 780,787 ---- size += snprintf(&buf[size], bufsize-size, "

OLSR routes in kernel

\n"); ! size += snprintf(&buf[size], bufsize-size, ! "
MetricETX
" ! "DestinationGateway", ! resolve_ip_addresses ? " colspan=\"2\"" : ""); size += snprintf(&buf[size], bufsize-size, ""); *************** *** 959,967 **** if((olsr_cnf->ip_version == AF_INET) && (olsr_cnf->hna4_entries)) { struct hna4_entry *hna4; - size += snprintf(&buf[size], bufsize-size, "

Announced HNA entries

\n"); size += snprintf(&buf[size], bufsize-size, "
MetricETX
\n"); --- 961,969 ---- + size += snprintf(&buf[size], bufsize-size, "

Announced HNA entries

\n"); if((olsr_cnf->ip_version == AF_INET) && (olsr_cnf->hna4_entries)) { struct hna4_entry *hna4; size += snprintf(&buf[size], bufsize-size, "
NetworkNetmask
\n"); *************** *** 979,983 **** struct hna6_entry *hna6; - size += snprintf(&buf[size], bufsize-size, "

Announced HNA entries

\n"); size += snprintf(&buf[size], bufsize-size, "
NetworkNetmask
\n"); --- 981,984 ---- *************** *** 1006,1010 **** size += snprintf(&buf[size], bufsize-size, "

Links

\n"); ! size += snprintf(&buf[size], bufsize-size, "
NetworkPrefix length
\n"); if (olsr_cnf->lq_level > 0) size += snprintf(&buf[size], bufsize-size, "\n"); --- 1007,1011 ---- size += snprintf(&buf[size], bufsize-size, "

Links

\n"); ! size += snprintf(&buf[size], bufsize-size, "
Local IPRemote IPHysteresisLinkQualitylosttotalNLQETX
\n"); if (olsr_cnf->lq_level > 0) size += snprintf(&buf[size], bufsize-size, "\n"); *************** *** 1016,1020 **** { size += snprintf(&buf[size], bufsize-size, ""); ! size += build_ipaddr_no_link(&buf[size], bufsize, &link->local_iface_addr, -1); size += build_ipaddr_with_link(&buf[size], bufsize, &link->neighbor_iface_addr, -1); size += snprintf(&buf[size], bufsize-size, --- 1017,1021 ---- { size += snprintf(&buf[size], bufsize-size, ""); ! size += build_ipaddr_with_link(&buf[size], bufsize, &link->local_iface_addr, -1); size += build_ipaddr_with_link(&buf[size], bufsize, &link->neighbor_iface_addr, -1); size += snprintf(&buf[size], bufsize-size, *************** *** 1091,1095 **** struct tc_edge_entry *tc_edge; ! size += snprintf(&buf[size], bufsize-size, "

Topology entries

\n
Local IPRemote IPHysteresisLinkQualitylosttotalNLQETX
"); if (olsr_cnf->lq_level > 0) size += snprintf(&buf[size], bufsize-size, ""); --- 1092,1100 ---- struct tc_edge_entry *tc_edge; ! size += snprintf(&buf[size], bufsize-size, ! "

Topology entries

\n" ! "
Destination IPLast Hop IPLQILQETX
\n" ! "Destination IPLast Hop IP", ! resolve_ip_addresses ? " colspan=\"2\"" : ""); if (olsr_cnf->lq_level > 0) size += snprintf(&buf[size], bufsize-size, ""); From (spam-protected) Sat Oct 13 14:09:13 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sat, 13 Oct 2007 12:09:13 +0000 Subject: [Olsr-cvs] olsrd-current/src interfaces.c, 1.34, 1.35 interfaces.h, 1.42, 1.43 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26478/src Modified Files: interfaces.c interfaces.h Log Message: * cleanup: const'ified parameters and reduced duplicated code Index: interfaces.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/interfaces.c,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** interfaces.c 5 Sep 2007 16:17:36 -0000 1.34 --- interfaces.c 13 Oct 2007 12:09:11 -0000 1.35 *************** *** 319,323 **** */ struct interface * ! if_ifwithindex(int if_index) { struct interface *ifp = ifnet; --- 319,323 ---- */ struct interface * ! if_ifwithindex(const int if_index) { struct interface *ifp = ifnet; *************** *** 339,353 **** *@return "" or interface name. */ ! char * ! if_ifwithindex_name(int if_index) { ! struct interface *ifp = ifnet; ! while (ifp) ! { ! if (ifp->if_index == if_index) ! return ifp->int_name; ! ifp = ifp->int_next; ! } ! return "void"; } --- 339,347 ---- *@return "" or interface name. */ ! const char * ! if_ifwithindex_name(const int if_index) { ! const struct interface * const ifp = if_ifwithindex(if_index); ! return ifp == NULL ? "void" : ifp->int_name; } Index: interfaces.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/interfaces.h,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** interfaces.h 5 Sep 2007 16:17:36 -0000 1.42 --- interfaces.h 13 Oct 2007 12:09:11 -0000 1.43 *************** *** 213,220 **** struct interface * ! if_ifwithindex(int if_index); ! char * ! if_ifwithindex_name(int if_index); struct olsr_if * --- 213,220 ---- struct interface * ! if_ifwithindex(const int if_index); ! const char * ! if_ifwithindex_name(const int if_index); struct olsr_if * From (spam-protected) Sat Oct 13 14:09:39 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sat, 13 Oct 2007 12:09:39 +0000 Subject: [Olsr-cvs] olsrd-current/lib/httpinfo/src olsrd_httpinfo.c, 1.78, 1.79 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/httpinfo/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26503/lib/httpinfo/src Modified Files: olsrd_httpinfo.c Log Message: * more HTML cleanup Index: olsrd_httpinfo.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/httpinfo/src/olsrd_httpinfo.c,v retrieving revision 1.78 retrieving revision 1.79 diff -C2 -d -r1.78 -r1.79 *** olsrd_httpinfo.c 13 Oct 2007 12:04:57 -0000 1.78 --- olsrd_httpinfo.c 13 Oct 2007 12:09:37 -0000 1.79 *************** *** 778,787 **** struct rt_entry *rt; - size += snprintf(&buf[size], bufsize-size, "

OLSR routes in kernel

\n"); - size += snprintf(&buf[size], bufsize-size, ! "
LQILQETX
" "DestinationGateway", ! resolve_ip_addresses ? " colspan=\"2\"" : ""); size += snprintf(&buf[size], bufsize-size, ""); --- 778,786 ---- struct rt_entry *rt; size += snprintf(&buf[size], bufsize-size, ! "

OLSR routes in kernel

\n" ! "
MetricETX
\n" "DestinationGateway", ! resolve_ip_addresses ? " colspan=\"2\"" : ""); size += snprintf(&buf[size], bufsize-size, ""); *************** *** 842,846 **** size += snprintf(&buf[size], bufsize-size, "

Variables

\n"); ! size += snprintf(&buf[size], bufsize-size, "
MetricETX
\n"); size += snprintf(&buf[size], bufsize-size, "\n", olsr_ip_to_string(&olsr_cnf->main_addr)); --- 841,845 ---- size += snprintf(&buf[size], bufsize-size, "

Variables

\n"); ! size += snprintf(&buf[size], bufsize-size, "
Main address: %s
\n"); size += snprintf(&buf[size], bufsize-size, "\n", olsr_ip_to_string(&olsr_cnf->main_addr)); *************** *** 893,897 **** ! size += snprintf(&buf[size], bufsize-size, "
Main address: %s
\n"); --- 892,896 ---- ! size += snprintf(&buf[size], bufsize-size, "
\n"); *************** *** 939,943 **** size += snprintf(&buf[size], bufsize-size, "

Plugins

\n"); ! size += snprintf(&buf[size], bufsize-size, "
\n"); for(pentry = olsr_cnf->plugins; pentry; pentry = pentry->next) --- 938,942 ---- size += snprintf(&buf[size], bufsize-size, "

Plugins

\n"); ! size += snprintf(&buf[size], bufsize-size, "
NameParameters
\n"); for(pentry = olsr_cnf->plugins; pentry; pentry = pentry->next) *************** *** 961,976 **** ! size += snprintf(&buf[size], bufsize-size, "

Announced HNA entries

\n"); if((olsr_cnf->ip_version == AF_INET) && (olsr_cnf->hna4_entries)) { struct hna4_entry *hna4; ! size += snprintf(&buf[size], bufsize-size, "
NameParameters
\n"); for(hna4 = olsr_cnf->hna4_entries; hna4; hna4 = hna4->next) { size += snprintf(&buf[size], bufsize-size, "\n", ! olsr_ip_to_string((union olsr_ip_addr *)&hna4->net), ! olsr_ip_to_string((union olsr_ip_addr *)&hna4->netmask)); } --- 960,979 ---- ! size += snprintf(&buf[size], bufsize-size, ! "

Announced HNA entries

\n" ! "
NetworkNetmask
%s%s
\n" ! ); if((olsr_cnf->ip_version == AF_INET) && (olsr_cnf->hna4_entries)) { struct hna4_entry *hna4; ! size += snprintf(&buf[size], bufsize-size, ! "\n"); for(hna4 = olsr_cnf->hna4_entries; hna4; hna4 = hna4->next) { size += snprintf(&buf[size], bufsize-size, "\n", ! olsr_ip_to_string(&hna4->net), ! olsr_ip_to_string(&hna4->netmask)); } *************** *** 981,990 **** struct hna6_entry *hna6; ! size += snprintf(&buf[size], bufsize-size, "
NetworkNetmask
%s%s
\n"); for(hna6 = olsr_cnf->hna6_entries; hna6; hna6 = hna6->next) { size += snprintf(&buf[size], bufsize-size, "\n", ! olsr_ip_to_string((union olsr_ip_addr *)&hna6->net), hna6->prefix_len); } --- 984,994 ---- struct hna6_entry *hna6; ! size += snprintf(&buf[size], bufsize-size, ! "\n"); for(hna6 = olsr_cnf->hna6_entries; hna6; hna6 = hna6->next) { size += snprintf(&buf[size], bufsize-size, "\n", ! olsr_ip_to_string(&hna6->net), hna6->prefix_len); } *************** *** 1006,1011 **** int size = 0, index, thop_cnt; ! size += snprintf(&buf[size], bufsize-size, "

Links

\n"); ! size += snprintf(&buf[size], bufsize-size, "
NetworkPrefix length
%s%d
NetworkPrefix length
%s%d
\n"); if (olsr_cnf->lq_level > 0) size += snprintf(&buf[size], bufsize-size, "\n"); --- 1010,1017 ---- int size = 0, index, thop_cnt; ! size += snprintf(&buf[size], bufsize-size, ! "

Links

\n" ! "
Local IPRemote IPHysteresisLinkQualitylosttotalNLQETX
\n" ! "\n"); if (olsr_cnf->lq_level > 0) size += snprintf(&buf[size], bufsize-size, "\n"); *************** *** 1043,1048 **** size += snprintf(&buf[size], bufsize-size, "
Local IPRemote IPHysteresisLinkQualitylosttotalNLQETX
\n"); ! size += snprintf(&buf[size], bufsize-size, "

Neighbors

\n"); ! size += snprintf(&buf[size], bufsize-size, "\n"); /* Neighbors */ for(index=0;index\n"); ! size += snprintf(&buf[size], bufsize-size, ! "

Neighbors

\n" ! "
IP addressSYMMPRMPRSWillingness2 Hop Neighbors
\n" ! "\n"); /* Neighbors */ for(index=0;indexTopology entries\n" ! "
IP addressSYMMPRMPRSWillingness2 Hop Neighbors
\n" ! "Destination IPLast Hop IP", ! resolve_ip_addresses ? " colspan=\"2\"" : ""); ! if (olsr_cnf->lq_level > 0) size += snprintf(&buf[size], bufsize-size, ""); size += snprintf(&buf[size], bufsize-size, "\n"); OLSR_FOR_ALL_TC_ENTRIES(tc) { OLSR_FOR_ALL_TC_EDGE_ENTRIES(tc, tc_edge) { --- 1098,1113 ---- int size = 0; struct tc_entry *tc; size += snprintf(&buf[size], bufsize-size, "

Topology entries

\n" ! "
LQILQETX
\n" ! ""); ! if (olsr_cnf->lq_level > 0) { size += snprintf(&buf[size], bufsize-size, ""); + } size += snprintf(&buf[size], bufsize-size, "\n"); OLSR_FOR_ALL_TC_ENTRIES(tc) { + struct tc_edge_entry *tc_edge; OLSR_FOR_ALL_TC_EDGE_ENTRIES(tc, tc_edge) { *************** *** 1133,1137 **** olsr_u8_t index; ! size += snprintf(&buf[size], bufsize-size, "

MID entries

\n
Destination IPLast Hop IPLQILQETX
\n"); /* MID */ --- 1141,1148 ---- olsr_u8_t index; ! size += snprintf(&buf[size], bufsize-size, ! "

MID entries

\n" ! "
Main AddressAliases
\n" ! "\n"); /* MID */ From (spam-protected) Sat Oct 13 14:31:06 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sat, 13 Oct 2007 12:31:06 +0000 Subject: [Olsr-cvs] olsrd-current/src/linux kernel_routes.c,1.28,1.29 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src/linux In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2551/src/linux Modified Files: kernel_routes.c Log Message: * cleanup: moved ipc_route_send_rtentry() declaration into ipc_frontend.h where it belongs Index: kernel_routes.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/linux/kernel_routes.c,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** kernel_routes.c 17 Sep 2007 22:57:41 -0000 1.28 --- kernel_routes.c 13 Oct 2007 12:31:04 -0000 1.29 *************** *** 42,45 **** --- 42,46 ---- #include "kernel_routes.h" + #include "ipc_frontend.h" #if !LINUX_POLICY_ROUTING From (spam-protected) Sat Oct 13 14:31:06 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sat, 13 Oct 2007 12:31:06 +0000 Subject: [Olsr-cvs] olsrd-current/src ipc_frontend.h, 1.14, 1.15 ipc_frontend.c, 1.35, 1.36 defs.h, 1.63, 1.64 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2551/src Modified Files: ipc_frontend.h ipc_frontend.c defs.h Log Message: * cleanup: moved ipc_route_send_rtentry() declaration into ipc_frontend.h where it belongs Index: defs.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/defs.h,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** defs.h 16 Sep 2007 21:20:07 -0000 1.63 --- defs.h 13 Oct 2007 12:31:04 -0000 1.64 *************** *** 160,165 **** ipc_output(struct olsr *); - int - ipc_route_send_rtentry(union olsr_ip_addr*, union olsr_ip_addr *, int, int, char *); - #endif --- 160,162 ---- Index: ipc_frontend.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/ipc_frontend.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** ipc_frontend.h 1 Aug 2007 16:19:48 -0000 1.14 --- ipc_frontend.h 13 Oct 2007 12:31:04 -0000 1.15 *************** *** 108,110 **** --- 108,113 ---- frontend_msgparser(union olsr_message *, struct interface *, union olsr_ip_addr *); + int + ipc_route_send_rtentry(union olsr_ip_addr *, union olsr_ip_addr *, int, int, const char *); + #endif Index: ipc_frontend.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/ipc_frontend.c,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** ipc_frontend.c 5 Sep 2007 16:17:36 -0000 1.35 --- ipc_frontend.c 13 Oct 2007 12:31:04 -0000 1.36 *************** *** 272,276 **** int ipc_route_send_rtentry(union olsr_ip_addr *dst, union olsr_ip_addr *gw, ! int met, int add, char *int_name) { struct ipcmsg packet; --- 272,276 ---- int ipc_route_send_rtentry(union olsr_ip_addr *dst, union olsr_ip_addr *gw, ! int met, int add, const char *int_name) { struct ipcmsg packet; From (spam-protected) Sat Oct 13 14:43:04 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sat, 13 Oct 2007 12:43:04 +0000 Subject: [Olsr-cvs] olsrd-current Makefile.inc,1.32,1.33 Message-ID: Update of /cvsroot/olsrd/olsrd-current In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv7479 Modified Files: Makefile.inc Log Message: * increase the inline size limit needed on 64bit machines Index: Makefile.inc =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/Makefile.inc,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** Makefile.inc 17 Sep 2007 21:43:28 -0000 1.32 --- Makefile.inc 13 Oct 2007 12:43:02 -0000 1.33 *************** *** 53,56 **** --- 53,60 ---- #CFLAGS += -g CFLAGS += $(EXTRA_CFLAGS) + CFLAGS += -finline-functions-called-once + CFLAGS += -fearly-inlining + # we have small inline functions in src/lq_route.c which should always be inlined + CFLAGS += -finline-limit=40 # Must be specified along with -lpthread on linux From (spam-protected) Sat Oct 13 14:47:41 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sat, 13 Oct 2007 12:47:41 +0000 Subject: [Olsr-cvs] olsrd-current Makefile.inc,1.33,1.34 Message-ID: Update of /cvsroot/olsrd/olsrd-current In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9463 Modified Files: Makefile.inc Log Message: * increase the inline size limit somewhat more - needed on 32bit machines with gcc-3.4.6 Index: Makefile.inc =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/Makefile.inc,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** Makefile.inc 13 Oct 2007 12:43:02 -0000 1.33 --- Makefile.inc 13 Oct 2007 12:47:39 -0000 1.34 *************** *** 56,60 **** CFLAGS += -fearly-inlining # we have small inline functions in src/lq_route.c which should always be inlined ! CFLAGS += -finline-limit=40 # Must be specified along with -lpthread on linux --- 56,60 ---- CFLAGS += -fearly-inlining # we have small inline functions in src/lq_route.c which should always be inlined ! CFLAGS += -finline-limit=50 # Must be specified along with -lpthread on linux From (spam-protected) Sat Oct 13 16:51:34 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sat, 13 Oct 2007 14:51:34 +0000 Subject: [Olsr-cvs] olsrd-current Makefile.inc, 1.34, 1.35 gcc-warnings, 1.3, 1.4 Message-ID: Update of /cvsroot/olsrd/olsrd-current In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26611 Modified Files: Makefile.inc gcc-warnings Log Message: * CygWin gcc doesn know -fearly-inlining. So we also check it Index: gcc-warnings =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/gcc-warnings,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** gcc-warnings 7 Sep 2007 09:07:25 -0000 1.3 --- gcc-warnings 13 Oct 2007 14:51:32 -0000 1.4 *************** *** 12,16 **** for param; do case "$param" in ! -W?*) OPTS="$OPTS $param";; *) echo "Ignoring $param" >&2 esac --- 12,16 ---- for param; do case "$param" in ! -[fW]?*) OPTS="$OPTS $param";; *) echo "Ignoring $param" >&2 esac Index: Makefile.inc =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/Makefile.inc,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** Makefile.inc 13 Oct 2007 12:47:39 -0000 1.34 --- Makefile.inc 13 Oct 2007 14:51:32 -0000 1.35 *************** *** 47,50 **** --- 47,54 ---- WARNINGS += -Wdisabled-optimization #WARNINGS += -Werror + WARNINGS += -finline-functions-called-once + WARNINGS += -fearly-inlining + # we have small inline functions in src/lq_route.c which should always be inlined + WARNINGS += -finline-limit=50 WARNINGS := $(shell CC="$(CC)" $(TOPDIR)/gcc-warnings $(WARNINGS)) endif *************** *** 53,60 **** #CFLAGS += -g CFLAGS += $(EXTRA_CFLAGS) - CFLAGS += -finline-functions-called-once - CFLAGS += -fearly-inlining - # we have small inline functions in src/lq_route.c which should always be inlined - CFLAGS += -finline-limit=50 # Must be specified along with -lpthread on linux --- 57,60 ---- From (spam-protected) Sun Oct 14 16:11:13 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 14 Oct 2007 14:11:13 +0000 Subject: [Olsr-cvs] olsrd-current CHANGELOG,1.96,1.97 Message-ID: Update of /cvsroot/olsrd/olsrd-current In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31869 Modified Files: CHANGELOG Log Message: * applied patch by John Hay : make txtinfo plugin work with IPv6 Index: CHANGELOG =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/CHANGELOG,v retrieving revision 1.96 retrieving revision 1.97 diff -C2 -d -r1.96 -r1.97 *** CHANGELOG 5 Oct 2007 08:39:14 -0000 1.96 --- CHANGELOG 14 Oct 2007 14:11:11 -0000 1.97 *************** *** 146,149 **** --- 146,150 ---- - allow more interface in an IPv6 subnet on FreeBSD - use PREFIX and DESTDIR as all the other Makefile.$OS also for FreeBSD + - make txtinfo plugin work with IPv6 PATCH by Andreas Jacobs From (spam-protected) Sun Oct 14 16:11:13 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 14 Oct 2007 14:11:13 +0000 Subject: [Olsr-cvs] olsrd-current/lib/txtinfo/src olsrd_txtinfo.c, 1.11, 1.12 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/txtinfo/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31869/lib/txtinfo/src Modified Files: olsrd_txtinfo.c Log Message: * applied patch by John Hay : make txtinfo plugin work with IPv6 Index: olsrd_txtinfo.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/txtinfo/src/olsrd_txtinfo.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** olsrd_txtinfo.c 17 Sep 2007 22:08:01 -0000 1.11 --- olsrd_txtinfo.c 14 Oct 2007 14:11:11 -0000 1.12 *************** *** 144,152 **** plugin_ipc_init(void) { ! struct sockaddr_in sin; olsr_u32_t yes = 1; /* Init ipc socket */ ! if ((ipc_socket = socket(AF_INET, SOCK_STREAM, 0)) == -1) { #ifndef NODEBUG olsr_printf(1, "(TXTINFO) socket()=%s\n", strerror(errno)); --- 144,155 ---- plugin_ipc_init(void) { ! struct sockaddr_storage sst; ! struct sockaddr_in *sin; ! struct sockaddr_in6 *sin6; olsr_u32_t yes = 1; + socklen_t addrlen; /* Init ipc socket */ ! if ((ipc_socket = socket(olsr_cnf->ip_version, SOCK_STREAM, 0)) == -1) { #ifndef NODEBUG olsr_printf(1, "(TXTINFO) socket()=%s\n", strerror(errno)); *************** *** 170,180 **** /* complete the socket structure */ ! memset(&sin, 0, sizeof(sin)); ! sin.sin_family = AF_INET; ! sin.sin_addr.s_addr = INADDR_ANY; ! sin.sin_port = htons(ipc_port); /* bind the socket to the port number */ ! if (bind(ipc_socket, (struct sockaddr *) &sin, sizeof(sin)) == -1) { #ifndef NODEBUG olsr_printf(1, "(TXTINFO) bind()=%s\n", strerror(errno)); --- 173,199 ---- /* complete the socket structure */ ! memset(&sst, 0, sizeof(sst)); ! if (olsr_cnf->ip_version == AF_INET) { ! sin = (struct sockaddr_in *)&sst; ! sin->sin_family = AF_INET; ! addrlen = sizeof(struct sockaddr_in); ! #ifdef SIN6_LEN ! sin->sin_len = addrlen; ! #endif ! sin->sin_addr.s_addr = INADDR_ANY; ! sin->sin_port = htons(ipc_port); ! } else { ! sin6 = (struct sockaddr_in6 *)&sst; ! sin6->sin6_family = AF_INET6; ! addrlen = sizeof(struct sockaddr_in6); ! #ifdef SIN6_LEN ! sin6->sin6_len = addrlen; ! #endif ! sin6->sin6_addr = in6addr_any; ! sin6->sin6_port = htons(ipc_port); ! } /* bind the socket to the port number */ ! if (bind(ipc_socket, (struct sockaddr *) &sst, addrlen) == -1) { #ifndef NODEBUG olsr_printf(1, "(TXTINFO) bind()=%s\n", strerror(errno)); *************** *** 205,215 **** static void ipc_action(int fd) { ! struct sockaddr_in pin; ! char *addr; fd_set rfds; struct timeval tv; int neighonly = 0; ! socklen_t addrlen = sizeof(struct sockaddr_in); if(ipc_open) --- 224,236 ---- static void ipc_action(int fd) { ! struct sockaddr_storage pin; ! struct sockaddr_in *sin4; ! struct sockaddr_in6 *sin6; ! char addr[INET6_ADDRSTRLEN]; fd_set rfds; struct timeval tv; int neighonly = 0; ! socklen_t addrlen = sizeof(struct sockaddr_storage); if(ipc_open) *************** *** 224,232 **** tv.tv_sec = tv.tv_usec = 0; ! addr = inet_ntoa(pin.sin_addr); ! if (ntohl(pin.sin_addr.s_addr) != ntohl(ipc_accept_ip.v4)) { ! olsr_printf(1, "(TXTINFO) From host(%s) not allowed!\n", addr); ! close(ipc_connection); ! return; } ipc_open = 1; --- 245,270 ---- tv.tv_sec = tv.tv_usec = 0; ! if (olsr_cnf->ip_version == AF_INET) { ! sin4 = (struct sockaddr_in *)&pin; ! if (inet_ntop(olsr_cnf->ip_version, &sin4->sin_addr, addr, ! INET6_ADDRSTRLEN) == NULL) ! addr[0] = '\0'; ! if (!COMP_IP(&sin4->sin_addr, &ipc_accept_ip.v4)) { ! olsr_printf(1, "(TXTINFO) From host(%s) not allowed!\n", addr); ! close(ipc_connection); ! return; ! } ! } else { ! sin6 = (struct sockaddr_in6 *)&pin; ! if (inet_ntop(olsr_cnf->ip_version, &sin6->sin6_addr, addr, ! INET6_ADDRSTRLEN) == NULL) ! addr[0] = '\0'; ! /* Use in6addr_any (::) in olsr.conf to allow anybody. */ ! if (!COMP_IP(&in6addr_any, &ipc_accept_ip.v6) && ! !COMP_IP(&sin6->sin6_addr, &ipc_accept_ip.v6)) { ! olsr_printf(1, "(TXTINFO) From host(%s) not allowed!\n", addr); ! close(ipc_connection); ! return; ! } } ipc_open = 1; From (spam-protected) Mon Oct 15 00:46:05 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 14 Oct 2007 22:46:05 +0000 Subject: [Olsr-cvs] olsrd-current/lib/httpinfo/src html.h, 1.9, 1.10 olsrd_httpinfo.c, 1.79, 1.80 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/httpinfo/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv7105/lib/httpinfo/src Modified Files: html.h olsrd_httpinfo.c Log Message: cleanups: - killed sprintf() - simplified stuff in html.h - fixed generated HTML to test the TotalValidator extension from Firefox (and there is more to do) Index: olsrd_httpinfo.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/httpinfo/src/olsrd_httpinfo.c,v retrieving revision 1.79 retrieving revision 1.80 diff -C2 -d -r1.79 -r1.80 *** olsrd_httpinfo.c 13 Oct 2007 12:09:37 -0000 1.79 --- olsrd_httpinfo.c 14 Oct 2007 22:46:03 -0000 1.80 *************** *** 100,105 **** #define FRAMEWIDTH 800 - #define ACTIVE_TAB "class=\"active\"" - #define FILENREQ_MATCH(req, filename) \ !strcmp(req, filename) || \ --- 100,103 ---- *************** *** 141,145 **** static int build_http_header(http_header_type, olsr_bool, olsr_u32_t, char *, olsr_u32_t); ! static int build_frame(char *, char *, int, char *, olsr_u32_t, int(*frame_body_cb)(char *, olsr_u32_t)); static int build_routes_body(char *, olsr_u32_t); --- 139,143 ---- static int build_http_header(http_header_type, olsr_bool, olsr_u32_t, char *, olsr_u32_t); ! static int build_frame(char *, olsr_u32_t, char *, char *, int, int(*frame_body_cb)(char *, olsr_u32_t)); static int build_routes_body(char *, olsr_u32_t); *************** *** 169,172 **** --- 167,171 ---- const union olsr_ip_addr * const ipaddr, const int prefix_len); + static int section_title(char *buf, olsr_u32_t bufsize, const char *title); static ssize_t writen(int fd, const void *buf, size_t count); *************** *** 186,216 **** #endif ! static const struct tab_entry tab_entries[] = ! { ! {"Configuration", "config", build_config_body, OLSR_TRUE}, ! {"Routes", "routes", build_routes_body, OLSR_TRUE}, ! {"Links/Topology", "nodes", build_nodes_body, OLSR_TRUE}, ! {"All", "all", build_all_body, OLSR_TRUE}, #ifdef ADMIN_INTERFACE ! {"Admin", "admin", build_admin_body, OLSR_TRUE}, #endif ! {"About", "about", build_about_body, OLSR_TRUE}, ! {"FOO", "cfgfile", build_cfgfile_body, OLSR_FALSE}, ! {NULL, NULL, NULL, OLSR_FALSE} ! }; ! static const struct static_bin_file_entry static_bin_files[] = ! { {"favicon.ico", favicon_ico, 1406/*favicon_ico_len*/}, {"logo.gif", logo_gif, 2801/*logo_gif_len*/}, {"grayline.gif", grayline_gif, 43/*grayline_gif_len*/}, {NULL, NULL, 0} ! }; ! static const struct static_txt_file_entry static_txt_files[] = ! { {"httpinfo.css", httpinfo_css}, {NULL, NULL} ! }; --- 185,212 ---- #endif ! static const struct tab_entry tab_entries[] = { ! {"Configuration", "config", build_config_body, OLSR_TRUE}, ! {"Routes", "routes", build_routes_body, OLSR_TRUE}, ! {"Links/Topology", "nodes", build_nodes_body, OLSR_TRUE}, ! {"All", "all", build_all_body, OLSR_TRUE}, #ifdef ADMIN_INTERFACE ! {"Admin", "admin", build_admin_body, OLSR_TRUE}, #endif ! {"About", "about", build_about_body, OLSR_TRUE}, ! {"FOO", "cfgfile", build_cfgfile_body, OLSR_FALSE}, ! {NULL, NULL, NULL, OLSR_FALSE} ! }; ! static const struct static_bin_file_entry static_bin_files[] = { {"favicon.ico", favicon_ico, 1406/*favicon_ico_len*/}, {"logo.gif", logo_gif, 2801/*logo_gif_len*/}, {"grayline.gif", grayline_gif, 43/*grayline_gif_len*/}, {NULL, NULL, 0} ! }; ! static const struct static_txt_file_entry static_txt_files[] = { {"httpinfo.css", httpinfo_css}, {NULL, NULL} ! }; *************** *** 439,443 **** while(static_txt_files[i].data[y]) { ! size += sprintf(&body[size], static_txt_files[i].data[y]); y++; } --- 435,439 ---- while(static_txt_files[i].data[y]) { ! size += snprintf(&body[size], sizeof(body)-size, static_txt_files[i].data[y]); y++; } *************** *** 472,498 **** netsprintf_direct = 1; #endif ! y = 0; ! while(http_ok_head[y]) ! { ! size += sprintf(&body[size], http_ok_head[y]); ! y++; ! } size += build_tabs(&body[size], sizeof(body)-size, i); ! size += build_frame("Current Routes", "routes", FRAMEWIDTH, - &body[size], - sizeof(body)-size, tab_entries[i].build_body_cb); stats.ok_hits++; ! ! y = 0; ! while(http_ok_tail[y]) ! { ! size += sprintf(&body[size], http_ok_tail[y]); ! y++; ! } #ifdef NETDIRECT --- 468,484 ---- netsprintf_direct = 1; #endif ! size += snprintf(&body[size], sizeof(body)-size, "%s", http_ok_head); size += build_tabs(&body[size], sizeof(body)-size, i); ! size += build_frame(&body[size], ! sizeof(body)-size, ! "Current Routes", "routes", FRAMEWIDTH, tab_entries[i].build_body_cb); stats.ok_hits++; ! ! size += snprintf(&body[size], sizeof(body)-size, http_ok_tail); #ifdef NETDIRECT *************** *** 605,644 **** static int build_tabs(char *buf, const olsr_u32_t bufsize, int active) { ! int size = 0, i = 0, tabs = 0; ! ! while(strcmp(html_tabs[i], "")) ! { ! size += snprintf(&buf[size], bufsize-size, html_tabs[i]); ! i++; ! } ! ! i++; ! for(tabs = 0; tab_entries[tabs].tab_label; tabs++) ! { ! if(!tab_entries[tabs].display_tab) ! continue; ! if(tabs == active) ! size += snprintf(&buf[size], bufsize-size, ! html_tabs[i], ! tab_entries[tabs].filename, ! ACTIVE_TAB, ! tab_entries[tabs].tab_label); ! else ! size += snprintf(&buf[size], bufsize-size, ! html_tabs[i], ! tab_entries[tabs].filename, ! " ", ! tab_entries[tabs].tab_label); ! } ! ! i++; ! while(html_tabs[i]) ! { ! size += snprintf(&buf[size], bufsize-size, html_tabs[i]); ! i++; ! } ! return size; } --- 591,608 ---- static int build_tabs(char *buf, const olsr_u32_t bufsize, int active) { ! int size = 0, tabs = 0; ! size += snprintf(&buf[size], bufsize-size, html_tabs_prolog); ! for(tabs = 0; tab_entries[tabs].tab_label; tabs++) { ! if(!tab_entries[tabs].display_tab) ! continue; ! size += snprintf(&buf[size], bufsize-size, ! "
  • %s
  • \n", ! tab_entries[tabs].filename, ! tabs == active ? " class=\"active\"" : "", ! tab_entries[tabs].tab_label); ! } ! size += snprintf(&buf[size], bufsize-size, html_tabs_epilog); return size; } *************** *** 656,678 **** ! static int build_frame(char *title __attribute__((unused)), char *link __attribute__((unused)), int width __attribute__((unused)), - char *buf, - olsr_u32_t bufsize, int(*frame_body_cb)(char *, olsr_u32_t)) { ! int i = 0, size = 0; ! ! while(http_frame[i]) ! { ! if(!strcmp(http_frame[i], "")) ! size += frame_body_cb(&buf[size], bufsize-size); ! else ! size += snprintf(&buf[size], bufsize-size, "%s", http_frame[i]); ! ! i++; ! } ! return size; } --- 620,641 ---- ! static int section_title(char *buf, olsr_u32_t bufsize, const char *title) ! { ! return snprintf(buf, bufsize, ! "

    %s

    \n" ! "
    Main AddressAliases
    \n", title); ! } ! ! static int build_frame(char *buf, ! olsr_u32_t bufsize, ! char *title __attribute__((unused)), char *link __attribute__((unused)), int width __attribute__((unused)), int(*frame_body_cb)(char *, olsr_u32_t)) { ! int size = 0; ! size += snprintf(&buf[size], bufsize-size, "
    \n"); ! size += frame_body_cb(&buf[size], bufsize-size); ! size += snprintf(&buf[size], bufsize-size, "
    \n"); return size; } *************** *** 777,790 **** int size = 0; struct rt_entry *rt; ! size += snprintf(&buf[size], bufsize-size, ! "

    OLSR routes in kernel

    \n" ! "
    \n" ! "DestinationGateway", resolve_ip_addresses ? " colspan=\"2\"" : ""); - size += snprintf(&buf[size], bufsize-size, ""); - size += snprintf(&buf[size], bufsize-size, "\n"); - /* Walk the route table */ OLSR_FOR_ALL_RT_ENTRIES(rt) { --- 740,748 ---- int size = 0; struct rt_entry *rt; ! size += section_title(&buf[size], bufsize-size, "OLSR Routes in Kernel"); size += snprintf(&buf[size], bufsize-size, ! "DestinationGateway\n", resolve_ip_addresses ? " colspan=\"2\"" : ""); /* Walk the route table */ OLSR_FOR_ALL_RT_ENTRIES(rt) { *************** *** 843,847 **** size += snprintf(&buf[size], bufsize-size, "
    MetricETXInterface
    MetricETXInterface
    \n"); ! size += snprintf(&buf[size], bufsize-size, "\n", olsr_ip_to_string(&olsr_cnf->main_addr)); size += snprintf(&buf[size], bufsize-size, "\n", olsr_cnf->ip_version == AF_INET ? 4 : 6); --- 801,805 ---- size += snprintf(&buf[size], bufsize-size, "
    Main address: %sIP version: %d
    \n"); ! size += snprintf(&buf[size], bufsize-size, "\n", olsr_ip_to_string(&olsr_cnf->main_addr)); size += snprintf(&buf[size], bufsize-size, "\n", olsr_cnf->ip_version == AF_INET ? 4 : 6); *************** *** 862,866 **** size += snprintf(&buf[size], bufsize-size, "\n", olsr_cnf->tos); ! size += sprintf(&buf[size], "\n", olsr_cnf->rttable); size += snprintf(&buf[size], bufsize-size, "\n", olsr_cnf->willingness, olsr_cnf->willingness_auto ? "(auto)" : ""); --- 820,824 ---- size += snprintf(&buf[size], bufsize-size, "\n", olsr_cnf->tos); ! size += snprintf(&buf[size], bufsize-size, "\n", olsr_cnf->rttable); size += snprintf(&buf[size], bufsize-size, "\n", olsr_cnf->willingness, olsr_cnf->willingness_auto ? "(auto)" : ""); *************** *** 959,967 **** size += snprintf(&buf[size], bufsize-size, "
    Main address: %sIP version: %dTOS: 0x%04xRtTable: 0x%04xWillingness: %d %sTOS: 0x%04xRtTable: 0x%04xWillingness: %d %s
    \n"); - size += snprintf(&buf[size], bufsize-size, - "

    Announced HNA entries

    \n" - "\n" - ); if((olsr_cnf->ip_version == AF_INET) && (olsr_cnf->hna4_entries)) { --- 917,922 ---- size += snprintf(&buf[size], bufsize-size, "
    \n"); + size += section_title(&buf[size], bufsize-size, "Announced HNA entries"); if((olsr_cnf->ip_version == AF_INET) && (olsr_cnf->hna4_entries)) { *************** *** 977,982 **** olsr_ip_to_string(&hna4->netmask)); } - - size += snprintf(&buf[size], bufsize-size, "\n"); } else if((olsr_cnf->ip_version == AF_INET6) && (olsr_cnf->hna6_entries)) --- 932,935 ---- *************** *** 994,1000 **** } - size += snprintf(&buf[size], bufsize-size, "\n"); } ! return size; --- 947,952 ---- } } ! size += snprintf(&buf[size], bufsize-size, "\n"); return size; *************** *** 1010,1019 **** int size = 0, index, thop_cnt; size += snprintf(&buf[size], bufsize-size, - "

    Links

    \n" - "\n" "\n"); ! if (olsr_cnf->lq_level > 0) ! size += snprintf(&buf[size], bufsize-size, "\n"); size += snprintf(&buf[size], bufsize-size, "\n"); --- 962,972 ---- int size = 0, index, thop_cnt; + size += section_title(&buf[size], bufsize-size, "Links"); + size += snprintf(&buf[size], bufsize-size, "\n"); ! if (olsr_cnf->lq_level > 0) { ! size += snprintf(&buf[size], bufsize-size, "\n"); ! } size += snprintf(&buf[size], bufsize-size, "\n"); *************** *** 1025,1033 **** size += build_ipaddr_with_link(&buf[size], bufsize, &link->local_iface_addr, -1); size += build_ipaddr_with_link(&buf[size], bufsize, &link->neighbor_iface_addr, -1); ! size += snprintf(&buf[size], bufsize-size, ! "", ! link->L_link_quality); ! if (olsr_cnf->lq_level > 0) ! { size += snprintf(&buf[size], bufsize-size, "" --- 978,983 ---- size += build_ipaddr_with_link(&buf[size], bufsize, &link->local_iface_addr, -1); size += build_ipaddr_with_link(&buf[size], bufsize, &link->neighbor_iface_addr, -1); ! size += snprintf(&buf[size], bufsize-size, "", link->L_link_quality); ! if (olsr_cnf->lq_level > 0) { size += snprintf(&buf[size], bufsize-size, "" *************** *** 1041,1045 **** link->neigh_link_quality, (link->loss_link_quality * link->neigh_link_quality) ? 1.0 / (link->loss_link_quality * link->neigh_link_quality) : 0.0); ! } size += snprintf(&buf[size], bufsize-size, "\n"); --- 991,995 ---- link->neigh_link_quality, (link->loss_link_quality * link->neigh_link_quality) ? 1.0 / (link->loss_link_quality * link->neigh_link_quality) : 0.0); ! } size += snprintf(&buf[size], bufsize-size, "\n"); *************** *** 1049,1056 **** size += snprintf(&buf[size], bufsize-size, "
    Local IPRemote IPHysteresisLinkQualitylosttotalNLQETX
    Local IPRemote IPHysteresisLinkQualitylosttotalNLQETX
    %0.2f%0.2f%0.2f%0.2f
    \n"); size += snprintf(&buf[size], bufsize-size, ! "

    Neighbors

    \n" ! "\n" ! "\n"); /* Neighbors */ for(index=0;index\n"); + size += section_title(&buf[size], bufsize-size, "Neighbors"); size += snprintf(&buf[size], bufsize-size, ! "\n"); /* Neighbors */ for(index=0;indexneighbor_main_addr, -1); size += snprintf(&buf[size], bufsize-size, ! "" ! "" ! "" ! "", (neigh->status == SYM) ? "YES" : "NO", neigh->is_mpr ? "YES" : "NO", --- 1012,1019 ---- size += build_ipaddr_with_link(&buf[size], bufsize, &neigh->neighbor_main_addr, -1); size += snprintf(&buf[size], bufsize-size, ! "" ! "" ! "" ! "", (neigh->status == SYM) ? "YES" : "NO", neigh->is_mpr ? "YES" : "NO", *************** *** 1072,1085 **** neigh->willingness); ! size += snprintf(&buf[size], bufsize-size, "
    IP addressSYMMPRMPRSWillingness2 Hop Neighbors
    IP addressSYMMPRMPRSWillingness2 Hop Neighbors
    %s%s%s%d%s%s%s%d\n" ! ""); if (olsr_cnf->lq_level > 0) { ! size += snprintf(&buf[size], bufsize-size, ""); } size += snprintf(&buf[size], bufsize-size, "\n"); --- 1047,1054 ---- struct tc_entry *tc; ! size += section_title(&buf[size], bufsize-size, "Topology Entries"); ! size += snprintf(&buf[size], bufsize-size, ""); if (olsr_cnf->lq_level > 0) { ! size += snprintf(&buf[size], bufsize-size, ""); } size += snprintf(&buf[size], bufsize-size, "\n"); *************** *** 1115,1120 **** size += build_ipaddr_with_link(&buf[size], bufsize, &tc_edge->T_dest_addr, -1); size += build_ipaddr_with_link(&buf[size], bufsize, &tc->addr, -1); ! if (olsr_cnf->lq_level > 0) ! { const double d = tc_edge->link_quality * tc_edge->inverse_link_quality; size += snprintf(&buf[size], bufsize-size, --- 1061,1065 ---- size += build_ipaddr_with_link(&buf[size], bufsize, &tc_edge->T_dest_addr, -1); size += build_ipaddr_with_link(&buf[size], bufsize, &tc->addr, -1); ! if (olsr_cnf->lq_level > 0) { const double d = tc_edge->link_quality * tc_edge->inverse_link_quality; size += snprintf(&buf[size], bufsize-size, *************** *** 1141,1147 **** olsr_u8_t index; size += snprintf(&buf[size], bufsize-size, - "

    MID entries

    \n" - "
    Destination IPLast Hop IPLQILQETX
    Destination IPLast Hop IPLQILQETX
    \n" "\n"); --- 1086,1091 ---- olsr_u8_t index; + size += section_title(&buf[size], bufsize-size, "MID Entries"); size += snprintf(&buf[size], bufsize-size, "\n"); *************** *** 1229,1233 **** if(size < 0) { ! size = sprintf(&buf[0], "ERROR GENERATING CONFIGFILE!\n"); } --- 1173,1177 ---- if(size < 0) { ! size = snprintf(buf, size, "ERROR GENERATING CONFIGFILE!\n"); } Index: html.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/httpinfo/src/html.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** html.h 13 Oct 2007 12:04:10 -0000 1.9 --- html.h 14 Oct 2007 22:46:03 -0000 1.10 *************** *** 85,140 **** ! static const char *http_ok_head[] = ! { ! "\n", ! "\n", ! "\n", ! "olsr.org httpinfo plugin\n", ! "\n", ! "\n", ! "\n", ! "\n", ! "\n", "
    Main AddressAliases
    Main AddressAliases
    " ! "", ! "", ! "", ! "", ! "
    ", ! "   olsr.org OLSR daemon", ! "\"olsrd
    ", ! "\n\n", ! NULL ! }; ! static const char *html_tabs[] = ! { ! "\n", ! "\n", ! "\n\n"; ! static const char admin_basic_setting_float[] = "\n\n"; ! static const char admin_basic_setting_string[] = "\n\n"; #endif Index: admin_interface.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/httpinfo/src/admin_interface.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** admin_interface.c 19 Aug 2007 23:00:22 -0000 1.9 --- admin_interface.c 20 Oct 2007 20:41:04 -0000 1.10 *************** *** 66,80 **** build_admin_body(char *buf, olsr_u32_t bufsize __attribute__((unused))) { ! int size = 0, i = 0; ! ! while(admin_frame[i] && strcmp(admin_frame[i], "\n")) ! { ! size += snprintf(&buf[size], bufsize-size, admin_frame[i]); ! i++; ! } ! ! if(!admin_frame[i]) ! return size; ! size += snprintf(&buf[size], bufsize-size, "\n"); --- 66,71 ---- build_admin_body(char *buf, olsr_u32_t bufsize __attribute__((unused))) { ! int size = 0; ! size += snprintf(&buf[size], bufsize-size, admin_frame_prolog); size += snprintf(&buf[size], bufsize-size, "\n"); *************** *** 97,185 **** "Willingness:", "willingness", 1, olsr_cnf->willingness); ! size += snprintf(&buf[size], bufsize-size, "\n"); ! size += snprintf(&buf[size], bufsize-size, "\n"); ! if(olsr_cnf->use_hysteresis) ! { ! size += snprintf(&buf[size], bufsize-size, admin_basic_setting_float, ! "Hyst scaling:", "hyst_scaling", 4, olsr_cnf->hysteresis_param.scaling); ! size += snprintf(&buf[size], bufsize-size, admin_basic_setting_float, ! "Lower thr:", "hyst_lower", 4, olsr_cnf->hysteresis_param.thr_low); ! size += snprintf(&buf[size], bufsize-size, admin_basic_setting_float, ! "Upper thr:", "hyst_upper", 4, olsr_cnf->hysteresis_param.thr_high); ! } ! else ! { ! size += snprintf(&buf[size], bufsize-size, "\n"); ! } ! size += snprintf(&buf[size], bufsize-size, "\n"); ! size += snprintf(&buf[size], bufsize-size, "\n"); ! if(olsr_cnf->lq_level) ! { ! size += snprintf(&buf[size], bufsize-size, admin_basic_setting_int, ! "LQ level:", "lq_level", 1, olsr_cnf->lq_level); ! size += snprintf(&buf[size], bufsize-size, admin_basic_setting_int, ! "LQ winsize:", "lq_wsize", 2, olsr_cnf->lq_wsize); ! } ! else ! { ! size += snprintf(&buf[size], bufsize-size, "\n"); ! } ! ! ! size += snprintf(&buf[size], bufsize-size, "\n"); ! size += snprintf(&buf[size], bufsize-size, "\n"); size += snprintf(&buf[size], bufsize-size, "\n"); ! i++; ! ! while(admin_frame[i] && strcmp(admin_frame[i], "\n")) ! { ! size += snprintf(&buf[size], bufsize-size, admin_frame[i]); ! i++; ! } ! ! if(!admin_frame[i] || !admin_frame[i+1]) ! return size; ! ! i++; ! if((olsr_cnf->ip_version == AF_INET) && (olsr_cnf->hna4_entries)) ! { ! struct hna4_entry *hna4; ! ! for(hna4 = olsr_cnf->hna4_entries; hna4; hna4 = hna4->next) ! { ! size += snprintf(&buf[size], bufsize-size, admin_frame[i], ! olsr_ip_to_string((union olsr_ip_addr *)&hna4->net), ! olsr_ip_to_string((union olsr_ip_addr *)&hna4->netmask), ! olsr_ip_to_string((union olsr_ip_addr *)&hna4->net), ! olsr_ip_to_string((union olsr_ip_addr *)&hna4->netmask)); ! } ! } ! else if((olsr_cnf->ip_version == AF_INET6) && (olsr_cnf->hna6_entries)) ! { ! struct hna6_entry *hna6; ! ! for(hna6 = olsr_cnf->hna6_entries; hna6; hna6 = hna6->next) ! { ! size += snprintf(&buf[size], bufsize-size, admin_frame[i], ! olsr_ip_to_string((union olsr_ip_addr *)&hna6->net), ! "TBD"/*hna6->prefix_len*/); ! } } ! ! i++; ! ! while(admin_frame[i]) ! { ! size += snprintf(&buf[size], bufsize-size, admin_frame[i]); ! i++; } ! return size; } --- 88,149 ---- "Willingness:", "willingness", 1, olsr_cnf->willingness); ! size += snprintf(&buf[size], bufsize-size, "\n" ! "\n"); ! if(olsr_cnf->use_hysteresis) { ! size += snprintf(&buf[size], bufsize-size, admin_basic_setting_float, ! "Hyst scaling:", "hyst_scaling", 4, olsr_cnf->hysteresis_param.scaling); ! size += snprintf(&buf[size], bufsize-size, admin_basic_setting_float, ! "Lower thr:", "hyst_lower", 4, olsr_cnf->hysteresis_param.thr_low); ! size += snprintf(&buf[size], bufsize-size, admin_basic_setting_float, ! "Upper thr:", "hyst_upper", 4, olsr_cnf->hysteresis_param.thr_high); ! } else { ! size += snprintf(&buf[size], bufsize-size, "\n"); ! } ! size += snprintf(&buf[size], bufsize-size, "\n" ! "\n"); ! if(olsr_cnf->lq_level) { ! size += snprintf(&buf[size], bufsize-size, admin_basic_setting_int, ! "LQ level:", "lq_level", 1, olsr_cnf->lq_level); ! size += snprintf(&buf[size], bufsize-size, admin_basic_setting_int, ! "LQ winsize:", "lq_wsize", 2, olsr_cnf->lq_wsize); ! } else { ! size += snprintf(&buf[size], bufsize-size, "\n"); ! } + size += snprintf(&buf[size], bufsize-size, "\n" + "\n"); size += snprintf(&buf[size], bufsize-size, "\n"); ! size += snprintf(&buf[size], bufsize-size, admin_frame_mid); ! if(olsr_cnf->ip_version == AF_INET) { ! struct hna4_entry *hna4; ! for(hna4 = olsr_cnf->hna4_entries; hna4; hna4 = hna4->next) { ! const char * const net = olsr_ip_to_string((union olsr_ip_addr *)&hna4->net); ! const char * const mask = olsr_ip_to_string((union olsr_ip_addr *)&hna4->netmask); ! size += snprintf(&buf[size], bufsize-size, ! "\n", ! net, ! mask, ! net, ! mask); } ! } else { ! struct hna6_entry *hna6; ! for(hna6 = olsr_cnf->hna6_entries; hna6; hna6 = hna6->next) { ! const char * const net = olsr_ip_to_string((union olsr_ip_addr *)&hna6->net); ! size += snprintf(&buf[size], bufsize-size, ! "\n", ! net, ! hna6->prefix_len, ! net, ! hna6->prefix_len); } ! } ! size += snprintf(&buf[size], bufsize-size, admin_frame_epilog); return size; } Index: html.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/httpinfo/src/html.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** html.h 14 Oct 2007 22:46:03 -0000 1.10 --- html.h 20 Oct 2007 20:41:04 -0000 1.11 *************** *** 120,128 **** static const char * const http_ok_tail = "\n" ! "
    \n\n" ! "

    \n" "(C)2005 Andreas Tønnesen
    \n" "http://www.olsr.org\n" ! "

    \n" "
    \n" "\n"; --- 120,128 ---- static const char * const http_ok_tail = "\n" ! "
    \n" ! "
    \n" "(C)2005 Andreas Tønnesen
    \n" "http://www.olsr.org\n" ! "
    \n" "
    \n" "\n"; From (spam-protected) Sat Oct 20 23:07:27 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sat, 20 Oct 2007 21:07:27 +0000 Subject: [Olsr-cvs] olsrd-current/src defs.h,1.64,1.65 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28939/src Modified Files: defs.h Log Message: * added a MIN and MAX macro Index: defs.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/defs.h,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** defs.h 13 Oct 2007 12:31:04 -0000 1.64 --- defs.h 20 Oct 2007 21:07:24 -0000 1.65 *************** *** 102,105 **** --- 102,111 ---- #define ARRAYSIZE(x) (sizeof(x)/sizeof(*(x))) + #ifndef MAX + #define MAX(x,y) ((x) > (y) ? (x) : (y)) + #endif + #ifndef MIN + #define MIN(x,y) ((x) < (y) ? (x) : (y)) + #endif /* From (spam-protected) Sun Oct 21 22:09:11 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 21 Oct 2007 20:09:11 +0000 Subject: [Olsr-cvs] olsrd-current/src link_set.c,1.74,1.75 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv13962/src Modified Files: link_set.c Log Message: * avoid warnings Index: link_set.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/link_set.c,v retrieving revision 1.74 retrieving revision 1.75 diff -C2 -d -r1.74 -r1.75 *** link_set.c 5 Oct 2007 20:10:24 -0000 1.74 --- link_set.c 21 Oct 2007 20:09:09 -0000 1.75 *************** *** 949,952 **** --- 949,954 ---- void olsr_print_link_set(void) { + #ifndef NODEBUG + /* The whole function makes no sense without it. */ struct link_entry *walker; const int addrsize = olsr_cnf->ip_version == AF_INET ? 15 : 39; *************** *** 977,980 **** --- 979,983 ---- etx); } + #endif } From (spam-protected) Sun Oct 21 22:15:53 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 21 Oct 2007 20:15:53 +0000 Subject: [Olsr-cvs] olsrd-current/src duplicate_set.h, 1.10, 1.11 duplicate_set.c, 1.16, 1.17 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16372/src Modified Files: duplicate_set.h duplicate_set.c Log Message: * cont'ified it Index: duplicate_set.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/duplicate_set.c,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** duplicate_set.c 17 Sep 2007 22:24:22 -0000 1.16 --- duplicate_set.c 21 Oct 2007 20:15:51 -0000 1.17 *************** *** 87,91 **** */ struct dup_entry * ! olsr_add_dup_entry(union olsr_ip_addr *originator, olsr_u16_t seqno) { olsr_u32_t hash; --- 87,91 ---- */ struct dup_entry * ! olsr_add_dup_entry(const union olsr_ip_addr *originator, const olsr_u16_t seqno) { olsr_u32_t hash; *************** *** 126,130 **** */ int ! olsr_check_dup_table_proc(union olsr_ip_addr *originator, olsr_u16_t seqno) { olsr_u32_t hash; --- 126,130 ---- */ int ! olsr_check_dup_table_proc(const union olsr_ip_addr *originator, const olsr_u16_t seqno) { olsr_u32_t hash; *************** *** 150,154 **** - /** * Check wether or not a message should be forwarded --- 150,153 ---- *************** *** 156,162 **** */ int ! olsr_check_dup_table_fwd(union olsr_ip_addr *originator, ! olsr_u16_t seqno, ! union olsr_ip_addr *int_addr) { olsr_u32_t hash; --- 155,161 ---- */ int ! olsr_check_dup_table_fwd(const union olsr_ip_addr *originator, ! const olsr_u16_t seqno, ! const union olsr_ip_addr *int_addr) { olsr_u32_t hash; *************** *** 195,200 **** - - /** *Delete and dequeue a duplicate entry --- 194,197 ---- *************** *** 257,266 **** - - int ! olsr_update_dup_entry(union olsr_ip_addr *originator, ! olsr_u16_t seqno, ! union olsr_ip_addr *iface) { olsr_u32_t hash; --- 254,261 ---- int ! olsr_update_dup_entry(const union olsr_ip_addr *originator, ! const olsr_u16_t seqno, ! const union olsr_ip_addr *iface) { olsr_u32_t hash; *************** *** 303,312 **** } - - - int ! olsr_set_dup_forward(union olsr_ip_addr *originator, ! olsr_u16_t seqno) { olsr_u32_t hash; --- 298,304 ---- } int ! olsr_set_dup_forward(const union olsr_ip_addr *originator, ! const olsr_u16_t seqno) { olsr_u32_t hash; Index: duplicate_set.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/duplicate_set.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** duplicate_set.h 20 Feb 2005 18:52:18 -0000 1.10 --- duplicate_set.h 21 Oct 2007 20:15:51 -0000 1.11 *************** *** 72,79 **** int ! olsr_check_dup_table_proc(union olsr_ip_addr *, olsr_u16_t); int ! olsr_check_dup_table_fwd(union olsr_ip_addr *, olsr_u16_t, union olsr_ip_addr *); void --- 72,79 ---- int ! olsr_check_dup_table_proc(const union olsr_ip_addr *, const olsr_u16_t); int ! olsr_check_dup_table_fwd(const union olsr_ip_addr *, const olsr_u16_t, const union olsr_ip_addr *); void *************** *** 84,94 **** struct dup_entry * ! olsr_add_dup_entry(union olsr_ip_addr *, olsr_u16_t); int ! olsr_update_dup_entry(union olsr_ip_addr *, olsr_u16_t, union olsr_ip_addr *); int ! olsr_set_dup_forward(union olsr_ip_addr *, olsr_u16_t); int --- 84,94 ---- struct dup_entry * ! olsr_add_dup_entry(const union olsr_ip_addr *, const olsr_u16_t); int ! olsr_update_dup_entry(const union olsr_ip_addr *, const olsr_u16_t, const union olsr_ip_addr *); int ! olsr_set_dup_forward(const union olsr_ip_addr *, const olsr_u16_t); int From (spam-protected) Sun Oct 21 22:38:00 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 21 Oct 2007 20:38:00 +0000 Subject: [Olsr-cvs] olsrd-current/src hna_set.h, 1.15, 1.16 hna_set.c, 1.22, 1.23 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24944/src Modified Files: hna_set.h hna_set.c Log Message: * cont'ified it Index: hna_set.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/hna_set.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** hna_set.h 5 Sep 2007 16:11:10 -0000 1.15 --- hna_set.h 21 Oct 2007 20:37:58 -0000 1.16 *************** *** 68,72 **** extern struct hna_entry hna_set[HASHSIZE]; - extern size_t netmask_size; --- 68,71 ---- *************** *** 75,94 **** int ! olsr_get_hna_prefix_len(struct hna_net *); struct hna_net * ! olsr_lookup_hna_net(struct hna_net *, union olsr_ip_addr *, union hna_netmask *); struct hna_entry * ! olsr_lookup_hna_gw(union olsr_ip_addr *); struct hna_entry * ! olsr_add_hna_entry(union olsr_ip_addr *); struct hna_net * ! olsr_add_hna_net(struct hna_entry *, union olsr_ip_addr *, union hna_netmask *); void ! olsr_update_hna_entry(union olsr_ip_addr *, union olsr_ip_addr *, union hna_netmask *, float); void --- 74,93 ---- int ! olsr_get_hna_prefix_len(const struct hna_net *); struct hna_net * ! olsr_lookup_hna_net(const struct hna_net *, const union olsr_ip_addr *, const union hna_netmask *); struct hna_entry * ! olsr_lookup_hna_gw(const union olsr_ip_addr *); struct hna_entry * ! olsr_add_hna_entry(const union olsr_ip_addr *); struct hna_net * ! olsr_add_hna_net(struct hna_entry *, const union olsr_ip_addr *, const union hna_netmask *); void ! olsr_update_hna_entry(const union olsr_ip_addr *, const union olsr_ip_addr *, const union hna_netmask *, const float); void Index: hna_set.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/hna_set.c,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** hna_set.c 17 Sep 2007 22:24:22 -0000 1.22 --- hna_set.c 21 Oct 2007 20:37:58 -0000 1.23 *************** *** 46,50 **** struct hna_entry hna_set[HASHSIZE]; ! size_t netmask_size; --- 46,50 ---- struct hna_entry hna_set[HASHSIZE]; ! static size_t netmask_size; *************** *** 82,86 **** int ! olsr_get_hna_prefix_len(struct hna_net *hna) { if (olsr_cnf->ip_version == AF_INET) { --- 82,86 ---- int ! olsr_get_hna_prefix_len(const struct hna_net *hna) { if (olsr_cnf->ip_version == AF_INET) { *************** *** 102,106 **** */ struct hna_net * ! olsr_lookup_hna_net(struct hna_net *nets, union olsr_ip_addr *net, union hna_netmask *mask) { struct hna_net *tmp_net; --- 102,106 ---- */ struct hna_net * ! olsr_lookup_hna_net(const struct hna_net *nets, const union olsr_ip_addr *net, const union hna_netmask *mask) { struct hna_net *tmp_net; *************** *** 122,127 **** - - /** *Lookup a gateway entry --- 122,125 ---- *************** *** 132,144 **** */ struct hna_entry * ! olsr_lookup_hna_gw(union olsr_ip_addr *gw) { struct hna_entry *tmp_hna; ! olsr_u32_t hash; ! //OLSR_PRINTF(5, "TC: lookup entry\n"); - hash = olsr_hashing(gw); - /* Check for registered entry */ for(tmp_hna = hna_set[hash].next; --- 130,140 ---- */ struct hna_entry * ! olsr_lookup_hna_gw(const union olsr_ip_addr *gw) { struct hna_entry *tmp_hna; ! olsr_u32_t hash = olsr_hashing(gw); ! //OLSR_PRINTF(5, "TC: lookup entry\n"); /* Check for registered entry */ for(tmp_hna = hna_set[hash].next; *************** *** 164,168 **** */ struct hna_entry * ! olsr_add_hna_entry(union olsr_ip_addr *addr) { struct hna_entry *new_entry; --- 160,164 ---- */ struct hna_entry * ! olsr_add_hna_entry(const union olsr_ip_addr *addr) { struct hna_entry *new_entry; *************** *** 203,213 **** */ struct hna_net * ! olsr_add_hna_net(struct hna_entry *hna_gw, union olsr_ip_addr *net, union hna_netmask *mask) { - struct hna_net *new_net; - - /* Add the net */ ! new_net = olsr_malloc(sizeof(struct hna_net), "Add HNA net"); /* Fill struct */ --- 199,206 ---- */ struct hna_net * ! olsr_add_hna_net(struct hna_entry *hna_gw, const union olsr_ip_addr *net, const union hna_netmask *mask) { /* Add the net */ ! struct hna_net *new_net = olsr_malloc(sizeof(struct hna_net), "Add HNA net"); /* Fill struct */ *************** *** 241,245 **** */ void ! olsr_update_hna_entry(union olsr_ip_addr *gw, union olsr_ip_addr *net, union hna_netmask *mask, float vtime) { struct hna_entry *gw_entry; --- 234,238 ---- */ void ! olsr_update_hna_entry(const union olsr_ip_addr *gw, const union olsr_ip_addr *net, const union hna_netmask *mask, const float vtime) { struct hna_entry *gw_entry; From (spam-protected) Sun Oct 21 22:53:15 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 21 Oct 2007 20:53:15 +0000 Subject: [Olsr-cvs] olsrd-current/src mpr.c,1.18,1.19 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31195/src Modified Files: mpr.c Log Message: * avoid useless warnings Index: mpr.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/mpr.c,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** mpr.c 5 Oct 2007 08:06:12 -0000 1.18 --- mpr.c 21 Oct 2007 20:53:13 -0000 1.19 *************** *** 593,601 **** } - - void olsr_print_mpr_set(void) { int index; --- 593,601 ---- } void olsr_print_mpr_set(void) { + #ifndef NODEBUG + /* The whole function makes no sense without it. */ int index; *************** *** 617,619 **** --- 617,620 ---- } OLSR_PRINTF(1, "\n"); + #endif } From (spam-protected) Sun Oct 21 22:55:13 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 21 Oct 2007 20:55:13 +0000 Subject: [Olsr-cvs] olsrd-current/src mpr_selector_set.c, 1.18, 1.19 mpr_selector_set.h, 1.13, 1.14 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31979/src Modified Files: mpr_selector_set.c mpr_selector_set.h Log Message: * cont'ified it Index: mpr_selector_set.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/mpr_selector_set.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** mpr_selector_set.h 16 Dec 2005 08:21:59 -0000 1.13 --- mpr_selector_set.h 21 Oct 2007 20:55:11 -0000 1.14 *************** *** 63,80 **** increase_local_ansn(void); ! int olsr_init_mprs_set(void); struct mpr_selector * ! olsr_add_mpr_selector(union olsr_ip_addr *, float); struct mpr_selector * ! olsr_lookup_mprs_set(union olsr_ip_addr *); int ! olsr_update_mprs_set(union olsr_ip_addr *, float); --- 63,80 ---- increase_local_ansn(void); ! void olsr_init_mprs_set(void); struct mpr_selector * ! olsr_add_mpr_selector(const union olsr_ip_addr *, float); struct mpr_selector * ! olsr_lookup_mprs_set(const union olsr_ip_addr *); int ! olsr_update_mprs_set(const union olsr_ip_addr *, float); Index: mpr_selector_set.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/mpr_selector_set.c,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** mpr_selector_set.c 17 Sep 2007 22:24:22 -0000 1.18 --- mpr_selector_set.c 21 Oct 2007 20:55:11 -0000 1.19 *************** *** 55,59 **** */ ! int olsr_init_mprs_set(void) { --- 55,59 ---- */ ! void olsr_init_mprs_set(void) { *************** *** 66,71 **** mprs_list.next = &mprs_list; mprs_list.prev = &mprs_list; - - return 1; } --- 66,69 ---- *************** *** 102,106 **** */ struct mpr_selector * ! olsr_add_mpr_selector(union olsr_ip_addr *addr, float vtime) { struct mpr_selector *new_entry; --- 100,104 ---- */ struct mpr_selector * ! olsr_add_mpr_selector(const union olsr_ip_addr *addr, float vtime) { struct mpr_selector *new_entry; *************** *** 122,126 **** mprs_list.next = new_entry; */ - return new_entry; } --- 120,123 ---- *************** *** 137,141 **** */ struct mpr_selector * ! olsr_lookup_mprs_set(union olsr_ip_addr *addr) { struct mpr_selector *mprs; --- 134,138 ---- */ struct mpr_selector * ! olsr_lookup_mprs_set(const union olsr_ip_addr *addr) { struct mpr_selector *mprs; *************** *** 145,161 **** //OLSR_PRINTF(1, "MPRS: Lookup...."); ! mprs = mprs_list.next; ! ! while(mprs != &mprs_list) ! { ! ! if(COMP_IP(&mprs->MS_main_addr, addr)) ! { ! //OLSR_PRINTF(1, "MATCH\n"); ! return mprs; ! } ! mprs = mprs->next; } ! //OLSR_PRINTF(1, "NO MACH\n"); return NULL; --- 142,151 ---- //OLSR_PRINTF(1, "MPRS: Lookup...."); ! for (mprs = mprs_list.next; mprs != &mprs_list; mprs = mprs->next) { ! if(COMP_IP(&mprs->MS_main_addr, addr)) { ! //OLSR_PRINTF(1, "MATCH\n"); ! return mprs; } ! } //OLSR_PRINTF(1, "NO MACH\n"); return NULL; *************** *** 173,196 **** */ int ! olsr_update_mprs_set(union olsr_ip_addr *addr, float vtime) { ! struct mpr_selector *mprs; ! int retval; OLSR_PRINTF(5, "MPRS: Update %s\n", olsr_ip_to_string(addr)); ! retval = 0; ! ! if(NULL == (mprs = olsr_lookup_mprs_set(addr))) ! { ! olsr_add_mpr_selector(addr, vtime); ! retval = 1; ! signal_link_changes(OLSR_TRUE); ! } ! else ! { ! mprs->MS_time = GET_TIMESTAMP(vtime*1000); ! } ! return retval; } --- 163,179 ---- */ int ! olsr_update_mprs_set(const union olsr_ip_addr *addr, float vtime) { ! struct mpr_selector *mprs = olsr_lookup_mprs_set(addr); OLSR_PRINTF(5, "MPRS: Update %s\n", olsr_ip_to_string(addr)); ! if(mprs == NULL) { ! olsr_add_mpr_selector(addr, vtime); ! signal_link_changes(OLSR_TRUE); ! return 1; ! } ! mprs->MS_time = GET_TIMESTAMP(vtime*1000); ! return 0; } *************** *** 205,210 **** struct mpr_selector *mprs = mprs_list.next; ! while(mprs != &mprs_list) ! { if(TIMED_OUT(mprs->MS_time)) { --- 188,192 ---- struct mpr_selector *mprs = mprs_list.next; ! while(mprs != &mprs_list) { if(TIMED_OUT(mprs->MS_time)) { *************** *** 234,242 **** struct mpr_selector *mprs; OLSR_PRINTF(1, "MPR SELECTORS: "); ! ! for(mprs = mprs_list.next; mprs != &mprs_list; mprs = mprs->next) ! { ! OLSR_PRINTF(1, "%s ", olsr_ip_to_string(&mprs->MS_main_addr)); ! } OLSR_PRINTF(1, "\n"); } --- 216,222 ---- struct mpr_selector *mprs; OLSR_PRINTF(1, "MPR SELECTORS: "); ! for (mprs = mprs_list.next; mprs != &mprs_list; mprs = mprs->next) { ! OLSR_PRINTF(1, "%s ", olsr_ip_to_string(&mprs->MS_main_addr)); ! } OLSR_PRINTF(1, "\n"); } From (spam-protected) Sun Oct 21 23:16:13 2007 From: (spam-protected) (aaron) Date: Sun, 21 Oct 2007 21:16:13 +0000 Subject: [Olsr-cvs] olsrd-current README,1.22,1.23 Message-ID: Update of /cvsroot/olsrd/olsrd-current In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv7838 Modified Files: README Log Message: updated reality on Mac OS X. Added some extra infos Index: README =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/README,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** README 13 Sep 2007 22:52:55 -0000 1.22 --- README 21 Oct 2007 21:16:11 -0000 1.23 *************** *** 1,12 **** +====================================================================+ ! | README - olsr.org OLSR daemon 0.5.4rc1, 02.08.2007 | +====================================================================+ Andreas Tonnesen(andreto at olsr.org) Thomas Lopatic (thomas at lopatic.de) http://www.olsr.org CONTENTS: --- 1,16 ---- +====================================================================+ ! | README - olsr.org OLSR daemon 0.5.4, 21.10.2007 | +====================================================================+ + Authors: Andreas Tonnesen(andreto at olsr.org) Thomas Lopatic (thomas at lopatic.de) + Aaron Kaplan (aaron at lo-res.org) + http://www.olsr.org + CONTENTS: *************** *** 60,63 **** --- 64,70 ---- for the cutting edge features ;-) + The current Olsrd work is done via http://olsr.funkfeuer.at/ in the OLSR-NG + project. + ================= *************** *** 139,142 **** --- 146,151 ---- You need to have the OpenSSL libs installed to use this plugin. + + ======================== * LINK QUALITY ROUTING *************** *** 164,170 **** appreciated. ! Future releases of the 0.4 series will be maintainance releases focused ! on bugfixing. Work will soon begin on a 0.5 series where we will focus ! much more on new ideas. 0.4 and 0.5 might coexist for some time. ---------------------------------------------------------------------- --- 173,179 ---- appreciated. ! The current track of development is documented in the OLSR-NG ! project: http://olsr.funkfeuer.at ! ---------------------------------------------------------------------- *************** *** 187,190 **** --- 196,200 ---- Ports exist for all major operating systems: - Linux + - Mac OS X - NetBSD/OpenBSD/FreeBSD: ATM the main development occurs on Linux with GNU tools so occasionally it needs some minor tweaks to compile *************** *** 192,199 **** --- 202,211 ---- - Win32: You need (the relevant parts of) cygwin to compile the daemon as such. The installer and GUI needs VisualC++ though. + Win32 is the least supported port. Feel free to send patches! Packages for the operating systems and various distributions are available at olsr.org. Feel free to package it and announce it on the mailing lists. + =========== * PLUGINS *************** *** 220,235 **** ------------------------------------------------------------ PLUGINS ! bmf +/+ +/? +/+ +/+ +/+ ? ! dot_draw +/+ +/? +/+ +/+ +/+ ? ! dyn_gw +/+ +/? +/- +/- +/- ? ! dyn_gw_plain +/+ +/? +/- +/- +/- ? ! httpinfo +/+ +/+ +/+ +/+ +/+ ? ! mini +/+ +/? +/+ +/+ +/+ ? ! nameservice +/+ +/? +/+ +/+ +/+ ? ! pgraph +/+ +/+ +/+ +/+ +/+ ? quagga +/+ -/- +/+ +/+ +/+ ? ! secure +/+ +/+ +/+ +/+ +/+ ? tas +/+ - - - - ? ! txtinfo +/+ +/+ +/+ +/+ +/+ ? ------------------------------------------------------------ --- 232,247 ---- ------------------------------------------------------------ PLUGINS ! bmf +/+ +/? +/+ +/+ +/+ - ! dot_draw +/+ +/? +/+ +/+ +/+ +/+ ! dyn_gw +/+ +/? +/- +/- +/- +/+ ! dyn_gw_plain +/+ +/? +/- +/- +/- +/+ ! httpinfo +/+ +/+ +/+ +/+ +/+ +/+ ! mini +/+ +/? +/+ +/+ +/+ +/+ ! nameservice +/+ +/? +/+ +/+ +/+ +/+ ! pgraph +/+ +/+ +/+ +/+ +/+ +/+ quagga +/+ -/- +/+ +/+ +/+ ? ! secure +/+ +/+ +/+ +/+ +/+ +/+ tas +/+ - - - - ? ! txtinfo +/+ +/+ +/+ +/+ +/+ +/+ ------------------------------------------------------------ From (spam-protected) Sun Oct 21 23:46:45 2007 From: (spam-protected) (aaron) Date: Sun, 21 Oct 2007 21:46:45 +0000 Subject: [Olsr-cvs] olsrd-current/src/cfgparser olsrd.conf.example,1.8,1.9 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src/cfgparser In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23390 Modified Files: olsrd.conf.example Log Message: document NatThreshold (even though it is only a freifunk fw patch at the moment) Index: olsrd.conf.example =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/cfgparser/olsrd.conf.example,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** olsrd.conf.example 12 Nov 2004 20:48:19 -0000 1.8 --- olsrd.conf.example 21 Oct 2007 21:46:43 -0000 1.9 *************** *** 121,124 **** --- 121,133 ---- TcRedundancy 0 + # + # NatThreshold + # + # (currently this is only in the freifunk firmware) + # If the NAT-Endpoint (the preferred 0/0 HNA + # emitting node) is to be changed, the ETX value of the current 0/0 is + # compared to the new one. If the ETX difference is too small, the default + # route isn't changed. + #NatThreshold 0.9 # From (spam-protected) Mon Oct 22 23:02:51 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Mon, 22 Oct 2007 21:02:51 +0000 Subject: [Olsr-cvs] olsrd-current/src olsr_cfg.h,1.34,1.35 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31350/src Modified Files: olsr_cfg.h Log Message: * killed unused functions Index: olsr_cfg.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/olsr_cfg.h,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** olsr_cfg.h 16 Sep 2007 21:20:17 -0000 1.34 --- olsr_cfg.h 22 Oct 2007 21:02:49 -0000 1.35 *************** *** 282,291 **** olsrd_get_default_cnf(void); - void * - olsrd_cnf_malloc(unsigned int); - - void - olsrd_cnf_free(void *); - #if defined __cplusplus } --- 282,285 ---- From (spam-protected) Mon Oct 22 23:02:51 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Mon, 22 Oct 2007 21:02:51 +0000 Subject: [Olsr-cvs] olsrd-current/src/cfgparser olsrd_conf.c,1.55,1.56 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src/cfgparser In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31350/src/cfgparser Modified Files: olsrd_conf.c Log Message: * killed unused functions Index: olsrd_conf.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/cfgparser/olsrd_conf.c,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** olsrd_conf.c 13 Sep 2007 16:08:13 -0000 1.55 --- olsrd_conf.c 22 Oct 2007 21:02:49 -0000 1.56 *************** *** 696,709 **** } - void *olsrd_cnf_malloc(unsigned int len) - { - return malloc(len); - } - - void olsrd_cnf_free(void *addr) - { - free(addr); - } - #if defined WIN32_STDIO_HACK struct ioinfo --- 696,699 ---- From (spam-protected) Wed Oct 24 15:44:29 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Wed, 24 Oct 2007 13:44:29 +0000 Subject: [Olsr-cvs] olsrd-current/src/linux apm.c,1.18,1.19 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src/linux In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15083/src/linux Modified Files: apm.c Log Message: * cleanup: use ARRAYSIZE, const'ifications and killed an unsed #define Index: apm.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/linux/apm.c,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** apm.c 25 Apr 2007 22:08:17 -0000 1.18 --- apm.c 24 Oct 2007 13:44:26 -0000 1.19 *************** *** 71,78 **** /* ACPI related stuff */ ! ! #define ACPI_PROC "/proc/acpi/info" ! ! static const char * acpi_info[] = { "/proc/acpi/battery/0/info", --- 71,75 ---- /* ACPI related stuff */ ! static const char * const acpi_info[] = { "/proc/acpi/battery/0/info", *************** *** 83,87 **** }; ! static const char * acpi_state[] = { "/proc/acpi/battery/0/status", --- 80,84 ---- }; ! static const char * const acpi_state[] = { "/proc/acpi/battery/0/status", *************** *** 93,100 **** ! #define ACPI_BT_CNT (sizeof(acpi_state) / sizeof(char *)) ! static const char * acpi_ac[] = { "/proc/acpi/ac_adapter/0/status", --- 90,97 ---- ! #define ACPI_BT_CNT ARRAYSIZE(acpi_state) ! static const char * const acpi_ac[] = { "/proc/acpi/ac_adapter/0/status", *************** *** 103,107 **** }; ! #define ACPI_AC_CNT (sizeof(acpi_ac) / sizeof(char *)) --- 100,104 ---- }; ! #define ACPI_AC_CNT ARRAYSIZE(acpi_ac) *************** *** 214,218 **** units); ! lainfo.using_minutes = !strncmp(units, "min", 3) ? 1 : 0; /* --- 211,215 ---- units); ! lainfo.using_minutes = strncmp(units, "min", 3) ? 0 : 1; /* *************** *** 249,253 **** printf("READING ACPI\n"); - if(fd_index < 0) { --- 246,249 ---- From (spam-protected) Wed Oct 24 15:45:03 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Wed, 24 Oct 2007 13:45:03 +0000 Subject: [Olsr-cvs] olsrd-current/src plugin_util.c,1.6,1.7 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15150/src Modified Files: plugin_util.c Log Message: * avoid a warning Index: plugin_util.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/plugin_util.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** plugin_util.c 17 Sep 2007 21:57:06 -0000 1.6 --- plugin_util.c 24 Oct 2007 13:45:00 -0000 1.7 *************** *** 122,126 **** if (data != NULL) { char *v = data; ! if (strlen(value) >= addon.ui) { OLSR_PRINTF(0, "String too long \"%s\"", value); return 1; --- 122,126 ---- if (data != NULL) { char *v = data; ! if ((unsigned)strlen(value) >= addon.ui) { OLSR_PRINTF(0, "String too long \"%s\"", value); return 1; From (spam-protected) Wed Oct 24 15:46:38 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Wed, 24 Oct 2007 13:46:38 +0000 Subject: [Olsr-cvs] olsrd-current/src/cfgparser olsrd_conf.c,1.56,1.57 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src/cfgparser In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16018/src/cfgparser Modified Files: olsrd_conf.c Log Message: * cleanup: use for() instead of while to save lots of lines - and minor other stuff Index: olsrd_conf.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/cfgparser/olsrd_conf.c,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** olsrd_conf.c 22 Oct 2007 21:02:49 -0000 1.56 --- olsrd_conf.c 24 Oct 2007 13:46:36 -0000 1.57 *************** *** 51,54 **** --- 51,55 ---- #include "olsrd_conf.h" + #include "olsr_cfg.h" *************** *** 56,60 **** extern int yyparse(void); ! 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."; #ifdef MAKEBIN --- 57,61 ---- extern int yyparse(void); ! static char copyright_string[] __attribute__((unused)) = "The olsr.org Optimized Link-State Routing daemon(olsrd) Copyright (c) 2004, Andreas T�nnesen(andreto at olsr.org) All rights reserved."; #ifdef MAKEBIN *************** *** 101,115 **** olsrd_parse_cnf(const char *filename) { ! struct olsr_if *in, *new_ifqueue, *in_tmp; ! ! /* Stop the compiler from complaining */ ! (void)strlen(copyright_string); ! cnf = malloc(sizeof(struct olsrd_config)); ! if (cnf == NULL) ! { ! fprintf(stderr, "Out of memory %s\n", __func__); ! return NULL; ! } set_default_cnf(cnf); --- 102,113 ---- olsrd_parse_cnf(const char *filename) { ! struct olsr_if *in, *new_ifqueue; ! int rc; ! struct olsrd_config *cnf = malloc(sizeof(struct olsrd_config)); ! if (cnf == NULL) { ! fprintf(stderr, "Out of memory %s\n", __func__); ! return NULL; ! } set_default_cnf(cnf); *************** *** 118,140 **** yyin = fopen(filename, "r"); ! ! if (yyin == NULL) ! { ! fprintf(stderr, "Cannot open configuration file '%s': %s.\n", ! filename, strerror(errno)); ! free(cnf); ! return NULL; ! } current_line = 1; ! ! if (yyparse() != 0) ! { ! fclose(yyin); ! olsrd_free_cnf(cnf); ! return NULL; ! } ! fclose(yyin); /* Reverse the queue (added by user request) */ --- 116,133 ---- yyin = fopen(filename, "r"); ! if (yyin == NULL) { ! fprintf(stderr, "Cannot open configuration file '%s': %s.\n", ! filename, strerror(errno)); ! free(cnf); ! return NULL; ! } current_line = 1; ! rc = yyparse(); fclose(yyin); + if (rc != 0) { + olsrd_free_cnf(cnf); + return NULL; + } /* Reverse the queue (added by user request) */ *************** *** 142,168 **** new_ifqueue = NULL; ! while(in) ! { ! in_tmp = in; ! in = in->next; ! in_tmp->next = new_ifqueue; ! new_ifqueue = in_tmp; ! } cnf->interfaces = new_ifqueue; ! in = cnf->interfaces; ! ! while(in) ! { /* set various stuff */ in->configured = OLSR_FALSE; in->interf = NULL; in->host_emul = OLSR_FALSE; ! in = in->next; ! } ! ! return cnf; } --- 135,154 ---- new_ifqueue = NULL; ! while(in) { ! struct olsr_if *in_tmp = in; ! in = in->next; ! in_tmp->next = new_ifqueue; ! new_ifqueue = in_tmp; ! } cnf->interfaces = new_ifqueue; ! for (in = cnf->interfaces; in != NULL; in = in->next) { /* set various stuff */ in->configured = OLSR_FALSE; in->interf = NULL; in->host_emul = OLSR_FALSE; ! } return cnf; } From (spam-protected) Wed Oct 24 15:51:13 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Wed, 24 Oct 2007 13:51:13 +0000 Subject: [Olsr-cvs] olsrd-current/src olsr_types.h,1.9,1.10 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18284/src Modified Files: olsr_types.h Log Message: * unified typedefs of olsr_{u,}{8,16,32}_t: It builds that way on Linux and Windows and *BSD had it before. That leaves MacOSx for someone to test. Index: olsr_types.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/olsr_types.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** olsr_types.h 5 Sep 2007 16:11:11 -0000 1.9 --- olsr_types.h 24 Oct 2007 13:51:11 -0000 1.10 *************** *** 49,53 **** /* types */ ! #include typedef enum { --- 49,54 ---- /* types */ ! #include ! typedef enum { *************** *** 56,86 **** } olsr_bool; ! #if defined linux || defined __MacOSX__ ! ! typedef u_int8_t olsr_u8_t; ! typedef u_int16_t olsr_u16_t; ! typedef u_int32_t olsr_u32_t; ! typedef int8_t olsr_8_t; ! typedef int16_t olsr_16_t; ! typedef int32_t olsr_32_t; ! ! #elif defined __FreeBSD__ || defined __NetBSD__ || defined __OpenBSD__ ! typedef uint8_t olsr_u8_t; ! typedef uint16_t olsr_u16_t; ! typedef uint32_t olsr_u32_t; typedef int8_t olsr_8_t; typedef int16_t olsr_16_t; typedef int32_t olsr_32_t; - #elif defined WIN32 - - typedef unsigned char olsr_u8_t; - typedef unsigned short olsr_u16_t; - typedef unsigned int olsr_u32_t; - typedef char olsr_8_t; - typedef short olsr_16_t; - typedef int olsr_32_t; - #else # error "Unsupported system" --- 57,69 ---- } olsr_bool; ! #if defined linux || defined __MacOSX__ || defined WIN32 || defined __FreeBSD__ || defined __NetBSD__ || defined __OpenBSD__ ! typedef uint8_t olsr_u8_t; ! typedef uint16_t olsr_u16_t; ! typedef uint32_t olsr_u32_t; typedef int8_t olsr_8_t; typedef int16_t olsr_16_t; typedef int32_t olsr_32_t; #else # error "Unsupported system" From (spam-protected) Tue Oct 30 10:19:24 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Tue, 30 Oct 2007 09:19:24 +0000 Subject: [Olsr-cvs] olsrd-current/src/cfgparser olsrd_conf.c, 1.57, 1.58 olsrd_conf.h, 1.13, 1.14 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src/cfgparser In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24635/src/cfgparser Modified Files: olsrd_conf.c olsrd_conf.h Log Message: * fix startup breakage Index: olsrd_conf.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/cfgparser/olsrd_conf.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** olsrd_conf.h 28 Apr 2007 20:46:32 -0000 1.13 --- olsrd_conf.h 30 Oct 2007 09:19:22 -0000 1.14 *************** *** 50,56 **** ! int current_line; ! struct olsrd_config *cnf; struct conf_token --- 50,56 ---- ! extern int current_line; ! extern struct olsrd_config *cnf; struct conf_token Index: olsrd_conf.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/cfgparser/olsrd_conf.c,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** olsrd_conf.c 24 Oct 2007 13:46:36 -0000 1.57 --- olsrd_conf.c 30 Oct 2007 09:19:22 -0000 1.58 *************** *** 59,62 **** --- 59,65 ---- static char copyright_string[] __attribute__((unused)) = "The olsr.org Optimized Link-State Routing daemon(olsrd) Copyright (c) 2004, Andreas T�nnesen(andreto at olsr.org) All rights reserved."; + int current_line; + struct olsrd_config *cnf; + #ifdef MAKEBIN *************** *** 105,109 **** int rc; ! struct olsrd_config *cnf = malloc(sizeof(struct olsrd_config)); if (cnf == NULL) { fprintf(stderr, "Out of memory %s\n", __func__); --- 108,113 ---- int rc; ! /* Initialize the global varibles - oparse.y needs it there */ ! cnf = malloc(sizeof(struct olsrd_config)); if (cnf == NULL) { fprintf(stderr, "Out of memory %s\n", __func__);
    \n", ! "
      \n", ! "", ! "
    • %s
    • \n", ! "
    \n", ! "
    \n", ! NULL ! }; ! ! static const char *http_ok_tail[] = ! { ! "\n\n\n", ! "
    \n\n", ! "

    \n", ! "(C)2005 Andreas Tønnesen
    \n", ! "http://www.olsr.org\n", ! "

    \n", ! "
    \n", ! "\n", ! NULL ! }; static const char *cfgfile_body[] = --- 85,130 ---- ! static const char * const http_ok_head = ! "\n" ! "\n" ! "\n" ! "olsr.org httpinfo plugin\n" ! "\n" ! "\n" ! "\n" ! "\n" ! "\n" "" ! "" ! "" ! "" ! "" ! "" ! "
    " ! "   olsr.org OLSR daemon" ! "\"olsrd
    " ! "\n\n"; ! static const char * const html_tabs_prolog = ! "\n" ! "\n" + "\n\n"; ! static char admin_basic_setting_float[] = "\n\n"; ! static char admin_basic_setting_string[] = "\n\n"; #endif --- 49,83 ---- #define ADMIN_HTML_H ! static const char admin_frame_prolog[] = ! "Administrator interface
    \n" ! "

    Change basic settings

    \n" ! "\n" ! "
    \n" ! "
      \n"; + static const char * const html_tabs_epilog = + "
    \n" + "
    \n"; ! static const char * const http_ok_tail = ! "\n" ! "
    \n\n" ! "

    \n" ! "(C)2005 Andreas Tønnesen
    \n" ! "http://www.olsr.org\n" ! "

    \n" ! "
    \n" ! "\n"; static const char *cfgfile_body[] = *************** *** 194,207 **** }; - - - static const char *http_frame[] = - { - "
    \n", - "", - "
    \n", - NULL - }; - - #endif --- 184,186 ---- From (spam-protected) Mon Oct 15 22:58:36 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Mon, 15 Oct 2007 20:58:36 +0000 Subject: [Olsr-cvs] olsrd-current/src local_hna_set.c, 1.13, 1.14 local_hna_set.h, 1.10, 1.11 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23024/src Modified Files: local_hna_set.c local_hna_set.h Log Message: * const'ified functions * fixed an obvious bug in the IPv6 code whoever thinks that const'ifying as far as possible is superflous may take this as a prime counter example. Index: local_hna_set.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/local_hna_set.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** local_hna_set.c 20 Apr 2007 13:46:04 -0000 1.13 --- local_hna_set.c 15 Oct 2007 20:58:33 -0000 1.14 *************** *** 45,49 **** void ! add_local_hna4_entry(union olsr_ip_addr *net, union olsr_ip_addr *mask) { struct hna4_entry *new_entry; --- 45,49 ---- void ! add_local_hna4_entry(const union olsr_ip_addr *net, const union olsr_ip_addr *mask) { struct hna4_entry *new_entry; *************** *** 61,65 **** void ! add_local_hna6_entry(union olsr_ip_addr *net, olsr_u16_t prefix_len) { struct hna6_entry *new_entry; --- 61,65 ---- void ! add_local_hna6_entry(const union olsr_ip_addr *net, const olsr_u16_t prefix_len) { struct hna6_entry *new_entry; *************** *** 68,72 **** memcpy(&new_entry->net, net, sizeof(struct in6_addr)); ! prefix_len = prefix_len; /* Queue */ --- 68,72 ---- memcpy(&new_entry->net, net, sizeof(struct in6_addr)); ! new_entry->prefix_len = prefix_len; /* Queue */ *************** *** 77,81 **** int ! remove_local_hna4_entry(union olsr_ip_addr *net, union olsr_ip_addr *mask) { struct hna4_entry *h4 = olsr_cnf->hna4_entries, *h4prev = NULL; --- 77,81 ---- int ! remove_local_hna4_entry(const union olsr_ip_addr *net, const union olsr_ip_addr *mask) { struct hna4_entry *h4 = olsr_cnf->hna4_entries, *h4prev = NULL; *************** *** 105,109 **** int ! remove_local_hna6_entry(union olsr_ip_addr *net, olsr_u16_t prefix_len) { struct hna6_entry *h6, *h6prev = NULL; --- 105,109 ---- int ! remove_local_hna6_entry(const union olsr_ip_addr *net, const olsr_u16_t prefix_len) { struct hna6_entry *h6, *h6prev = NULL; *************** *** 129,133 **** struct hna4_entry * ! find_local_hna4_entry(union olsr_ip_addr *net, olsr_u32_t mask) { struct hna4_entry *h4 = olsr_cnf->hna4_entries; --- 129,133 ---- struct hna4_entry * ! find_local_hna4_entry(const union olsr_ip_addr *net, const olsr_u32_t mask) { struct hna4_entry *h4 = olsr_cnf->hna4_entries; *************** *** 149,153 **** struct hna6_entry * ! find_local_hna6_entry(union olsr_ip_addr *net, olsr_u16_t prefix_len) { struct hna6_entry *h6 = olsr_cnf->hna6_entries; --- 149,153 ---- struct hna6_entry * ! find_local_hna6_entry(const union olsr_ip_addr *net, const olsr_u16_t prefix_len) { struct hna6_entry *h6 = olsr_cnf->hna6_entries; Index: local_hna_set.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/local_hna_set.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** local_hna_set.h 10 Feb 2007 19:27:32 -0000 1.10 --- local_hna_set.h 15 Oct 2007 20:58:33 -0000 1.11 *************** *** 48,67 **** void ! add_local_hna4_entry(union olsr_ip_addr *, union olsr_ip_addr *); void ! add_local_hna6_entry(union olsr_ip_addr *, olsr_u16_t); int ! remove_local_hna4_entry(union olsr_ip_addr *, union olsr_ip_addr *); int ! remove_local_hna6_entry(union olsr_ip_addr *, olsr_u16_t); struct hna4_entry * ! find_local_hna4_entry(union olsr_ip_addr *net, olsr_u32_t mask); struct hna6_entry * ! find_local_hna6_entry(union olsr_ip_addr *net, olsr_u16_t prefix_len); int --- 48,67 ---- void ! add_local_hna4_entry(const union olsr_ip_addr *, const union olsr_ip_addr *); void ! add_local_hna6_entry(const union olsr_ip_addr *, const olsr_u16_t); int ! remove_local_hna4_entry(const union olsr_ip_addr *, const union olsr_ip_addr *); int ! remove_local_hna6_entry(const union olsr_ip_addr *, const olsr_u16_t); struct hna4_entry * ! find_local_hna4_entry(const union olsr_ip_addr *net, const olsr_u32_t mask); struct hna6_entry * ! find_local_hna6_entry(const union olsr_ip_addr *net, const olsr_u16_t prefix_len); int From (spam-protected) Mon Oct 15 23:01:19 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Mon, 15 Oct 2007 21:01:19 +0000 Subject: [Olsr-cvs] olsrd-current/src/cfgparser cfgfile_gen.c,1.8,1.9 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src/cfgparser In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24635/src/cfgparser Modified Files: cfgfile_gen.c Log Message: * made a statement-like macro out of WRITE_BUF Index: cfgfile_gen.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/cfgparser/cfgfile_gen.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** cfgfile_gen.c 13 Sep 2007 16:08:13 -0000 1.8 --- cfgfile_gen.c 15 Oct 2007 21:01:17 -0000 1.9 *************** *** 362,371 **** #define MAX_LINESIZE 250 ! #define WRITE_TO_BUF(s,args...) \ ! { \ ! if((bufsize - size) < MAX_LINESIZE) \ ! return -1; \ ! size += snprintf(&buf[size], MAX_LINESIZE, s, ##args);\ ! } int --- 362,372 ---- #define MAX_LINESIZE 250 ! #define WRITE_TO_BUF(fmt, args...) \ ! do { \ ! if((bufsize - size) < MAX_LINESIZE) { \ ! return -1; \ ! } \ ! size += snprintf(&buf[size], MAX_LINESIZE, fmt, ##args); \ ! } while (0) int *************** *** 394,462 **** } ! WRITE_TO_BUF("#\n# Configuration file for olsr.org olsrd\n# automatically generated by olsrd-cnf %s\n#\n\n\n", PARSER_VERSION) /* Debug level */ ! WRITE_TO_BUF("# Debug level(0-9)\n# If set to 0 the daemon runs in the background\n\nDebugLevel\t%d\n\n", cnf->debug_level) /* IP version */ if(cnf->ip_version == AF_INET6) ! WRITE_TO_BUF("# IP version to use (4 or 6)\n\nIpVersion\t6\n\n") else ! WRITE_TO_BUF("# IP version to use (4 or 6)\n\nIpVersion\t4\n\n") /* HNA IPv4 */ ! WRITE_TO_BUF("# HNA IPv4 routes\n# syntax: netaddr netmask\n\nHna4\n{\n") while(h4) { in4.s_addr = h4->net.v4; ! WRITE_TO_BUF(" %s ", inet_ntoa(in4)) in4.s_addr = h4->netmask.v4; ! WRITE_TO_BUF("%s\n", inet_ntoa(in4)) h4 = h4->next; } ! WRITE_TO_BUF("}\n\n") /* HNA IPv6 */ ! WRITE_TO_BUF("# HNA IPv6 routes\n# syntax: netaddr prefix\n\nHna6\n{\n") while(h6) { ! WRITE_TO_BUF(" %s/%d\n", (char *)inet_ntop(AF_INET6, &h6->net.v6, ipv6_buf, sizeof(ipv6_buf)), h6->prefix_len) h6 = h6->next; } ! WRITE_TO_BUF("}\n\n") /* No interfaces */ ! WRITE_TO_BUF("# Should olsrd keep on running even if there are\n# no interfaces available? This is a good idea\n# for a PCMCIA/USB hotswap environment.\n# \"yes\" OR \"no\"\n\nAllowNoInt\t") if(cnf->allow_no_interfaces) ! WRITE_TO_BUF("yes\n\n") else ! WRITE_TO_BUF("no\n\n") /* TOS */ ! WRITE_TO_BUF("# TOS(type of service) to use. Default is 16\n\n") ! WRITE_TO_BUF("TosValue\t%d\n\n", cnf->tos) /* RtTable */ ! WRITE_TO_BUF("# Policy Routing Tableto use. Default is 254\n\n") ! WRITE_TO_BUF("RtTable\t%d\n\n", cnf->rttable) /* Willingness */ ! WRITE_TO_BUF("# The fixed willingness to use(0-7)\n# If not set willingness will be calculated\n# dynammically based on battery/power status\n\n") if(cnf->willingness_auto) ! WRITE_TO_BUF("#Willingness\t4\n\n") else ! WRITE_TO_BUF("Willingness%d\n\n", cnf->willingness) /* IPC */ ! WRITE_TO_BUF("# Allow processes like the GUI front-end\n# to connect to the daemon.\n\n") ! WRITE_TO_BUF("IpcConnect\n{\n") ! WRITE_TO_BUF(" MaxConnections %d\n", cnf->ipc_connections) while(ih) { in4.s_addr = ih->host.v4; ! WRITE_TO_BUF(" Host %s\n", inet_ntoa(in4)) ih = ih->next; } --- 395,463 ---- } ! WRITE_TO_BUF("#\n# Configuration file for olsr.org olsrd\n# automatically generated by olsrd-cnf %s\n#\n\n\n", PARSER_VERSION); /* Debug level */ ! WRITE_TO_BUF("# Debug level(0-9)\n# If set to 0 the daemon runs in the background\n\nDebugLevel\t%d\n\n", cnf->debug_level); /* IP version */ if(cnf->ip_version == AF_INET6) ! WRITE_TO_BUF("# IP version to use (4 or 6)\n\nIpVersion\t6\n\n"); else ! WRITE_TO_BUF("# IP version to use (4 or 6)\n\nIpVersion\t4\n\n"); /* HNA IPv4 */ ! WRITE_TO_BUF("# HNA IPv4 routes\n# syntax: netaddr netmask\n\nHna4\n{\n"); while(h4) { in4.s_addr = h4->net.v4; ! WRITE_TO_BUF(" %s ", inet_ntoa(in4)); in4.s_addr = h4->netmask.v4; ! WRITE_TO_BUF("%s\n", inet_ntoa(in4)); h4 = h4->next; } ! WRITE_TO_BUF("}\n\n"); /* HNA IPv6 */ ! WRITE_TO_BUF("# HNA IPv6 routes\n# syntax: netaddr prefix\n\nHna6\n{\n"); while(h6) { ! WRITE_TO_BUF(" %s/%d\n", (char *)inet_ntop(AF_INET6, &h6->net.v6, ipv6_buf, sizeof(ipv6_buf)), h6->prefix_len); h6 = h6->next; } ! WRITE_TO_BUF("}\n\n"); /* No interfaces */ ! WRITE_TO_BUF("# Should olsrd keep on running even if there are\n# no interfaces available? This is a good idea\n# for a PCMCIA/USB hotswap environment.\n# \"yes\" OR \"no\"\n\nAllowNoInt\t"); if(cnf->allow_no_interfaces) ! WRITE_TO_BUF("yes\n\n"); else ! WRITE_TO_BUF("no\n\n"); /* TOS */ ! WRITE_TO_BUF("# TOS(type of service) to use. Default is 16\n\n"); ! WRITE_TO_BUF("TosValue\t%d\n\n", cnf->tos); /* RtTable */ ! WRITE_TO_BUF("# Policy Routing Tableto use. Default is 254\n\n"); ! WRITE_TO_BUF("RtTable\t%d\n\n", cnf->rttable); /* Willingness */ ! WRITE_TO_BUF("# The fixed willingness to use(0-7)\n# If not set willingness will be calculated\n# dynammically based on battery/power status\n\n"); if(cnf->willingness_auto) ! WRITE_TO_BUF("#Willingness\t4\n\n"); else ! WRITE_TO_BUF("Willingness%d\n\n", cnf->willingness); /* IPC */ ! WRITE_TO_BUF("# Allow processes like the GUI front-end\n# to connect to the daemon.\n\n"); ! WRITE_TO_BUF("IpcConnect\n{\n"); ! WRITE_TO_BUF(" MaxConnections %d\n", cnf->ipc_connections); while(ih) { in4.s_addr = ih->host.v4; ! WRITE_TO_BUF(" Host %s\n", inet_ntoa(in4)); ih = ih->next; } *************** *** 464,538 **** { in4.s_addr = ie->net.v4; ! WRITE_TO_BUF(" Net %s ", inet_ntoa(in4)) in4.s_addr = ie->mask.v4; ! WRITE_TO_BUF("%s\n", inet_ntoa(in4)) ie = ie->next; } ! WRITE_TO_BUF("}\n\n") /* Hysteresis */ ! WRITE_TO_BUF("# Hysteresis adds more robustness to the\n# link sensing.\n# Used by default. 'yes' or 'no'\n\n") if(cnf->use_hysteresis) { ! WRITE_TO_BUF("UseHysteresis\tyes\n\n") ! WRITE_TO_BUF("# Hysteresis parameters\n# Do not alter these unless you know \n# what you are doing!\n# Set to auto by default. Allowed\n# values are floating point values\n# in the interval 0,1\n# THR_LOW must always be lower than\n# THR_HIGH!!\n\n") ! WRITE_TO_BUF("HystScaling\t%0.2f\n", cnf->hysteresis_param.scaling) ! WRITE_TO_BUF("HystThrHigh\t%0.2f\n", cnf->hysteresis_param.thr_high) ! WRITE_TO_BUF("HystThrLow\t%0.2f\n\n", cnf->hysteresis_param.thr_low) } else { ! WRITE_TO_BUF("UseHysteresis\tno\n\n") ! WRITE_TO_BUF("# Hysteresis parameters\n# Do not alter these unless you know \n# what you are doing!\n# Set to auto by default. Allowed\n# values are floating point values\n# in the interval 0,1\n# THR_LOW must always be lower than\n# THR_HIGH!!\n\n") ! WRITE_TO_BUF("#HystScaling\t%0.2f\n", cnf->hysteresis_param.scaling) ! WRITE_TO_BUF("#HystThrHigh\t%0.2f\n", cnf->hysteresis_param.thr_high) ! WRITE_TO_BUF("#HystThrLow\t%0.2f\n\n", cnf->hysteresis_param.thr_low) } /* Pollrate */ ! WRITE_TO_BUF("# Polling rate in seconds(float).\n# Auto uses default value 0.05 sec\n\n") ! WRITE_TO_BUF("Pollrate\t%0.2f\n", cnf->pollrate) /* TC redundancy */ ! WRITE_TO_BUF("# TC redundancy\n# Specifies how much neighbor info should\n# be sent in TC messages\n# Possible values are:\n# 0 - only send MPR selectors\n# 1 - send MPR selectors and MPRs\n# 2 - send all neighbors\n#\n# defaults to 0\n\n") ! WRITE_TO_BUF("TcRedundancy\t%d\n\n", cnf->tc_redundancy) /* MPR coverage */ ! WRITE_TO_BUF("# MPR coverage\n# Specifies how many MPRs a node should\n# try select to reach every 2 hop neighbor\n# Can be set to any integer >0\n# defaults to 1\n\n") ! WRITE_TO_BUF("MprCoverage\t%d\n\n", cnf->mpr_coverage) ! WRITE_TO_BUF("# Link quality level\n# 0 = do not use link quality\n# 1 = use link quality for MPR selection\n# 2 = use link quality for MPR selection and routing\n\n") ! WRITE_TO_BUF("LinkQualityLevel\t%d\n\n", cnf->lq_level) ! WRITE_TO_BUF("# Link quality window size\n\n") ! WRITE_TO_BUF("LinkQualityWinSize\t%d\n\n", cnf->lq_wsize) ! WRITE_TO_BUF("# Clear screen when printing debug output?\n\n") ! WRITE_TO_BUF("ClearScreen\t%s\n\n", cnf->clear_screen ? "yes" : "no") /* Plugins */ ! WRITE_TO_BUF("# Olsrd plugins to load\n# This must be the absolute path to the file\n# or the loader will use the following scheme:\n") ! WRITE_TO_BUF("# - Try the paths in the LD_LIBRARY_PATH \n# environment variable.\n# - The list of libraries cached in /etc/ld.so.cache\n# - /lib, followed by /usr/lib\n\n") if(pe) { while(pe) { ! WRITE_TO_BUF("LoadPlugin \"%s\"\n{\n", pe->name) pp = pe->params; while(pp) { ! WRITE_TO_BUF(" PlParam \"%s\" \"%s\"\n", pp->key, pp->value) pp = pp->next; } ! WRITE_TO_BUF("}\n") pe = pe->next; } } ! WRITE_TO_BUF("\n") --- 465,539 ---- { in4.s_addr = ie->net.v4; ! WRITE_TO_BUF(" Net %s ", inet_ntoa(in4)); in4.s_addr = ie->mask.v4; ! WRITE_TO_BUF("%s\n", inet_ntoa(in4)); ie = ie->next; } ! WRITE_TO_BUF("}\n\n"); /* Hysteresis */ ! WRITE_TO_BUF("# Hysteresis adds more robustness to the\n# link sensing.\n# Used by default. 'yes' or 'no'\n\n"); if(cnf->use_hysteresis) { ! WRITE_TO_BUF("UseHysteresis\tyes\n\n"); ! WRITE_TO_BUF("# Hysteresis parameters\n# Do not alter these unless you know \n# what you are doing!\n# Set to auto by default. Allowed\n# values are floating point values\n# in the interval 0,1\n# THR_LOW must always be lower than\n# THR_HIGH!!\n\n"); ! WRITE_TO_BUF("HystScaling\t%0.2f\n", cnf->hysteresis_param.scaling); ! WRITE_TO_BUF("HystThrHigh\t%0.2f\n", cnf->hysteresis_param.thr_high); ! WRITE_TO_BUF("HystThrLow\t%0.2f\n\n", cnf->hysteresis_param.thr_low); } else { ! WRITE_TO_BUF("UseHysteresis\tno\n\n"); ! WRITE_TO_BUF("# Hysteresis parameters\n# Do not alter these unless you know \n# what you are doing!\n# Set to auto by default. Allowed\n# values are floating point values\n# in the interval 0,1\n# THR_LOW must always be lower than\n# THR_HIGH!!\n\n"); ! WRITE_TO_BUF("#HystScaling\t%0.2f\n", cnf->hysteresis_param.scaling); ! WRITE_TO_BUF("#HystThrHigh\t%0.2f\n", cnf->hysteresis_param.thr_high); ! WRITE_TO_BUF("#HystThrLow\t%0.2f\n\n", cnf->hysteresis_param.thr_low); } /* Pollrate */ ! WRITE_TO_BUF("# Polling rate in seconds(float).\n# Auto uses default value 0.05 sec\n\n"); ! WRITE_TO_BUF("Pollrate\t%0.2f\n", cnf->pollrate); /* TC redundancy */ ! WRITE_TO_BUF("# TC redundancy\n# Specifies how much neighbor info should\n# be sent in TC messages\n# Possible values are:\n# 0 - only send MPR selectors\n# 1 - send MPR selectors and MPRs\n# 2 - send all neighbors\n#\n# defaults to 0\n\n"); ! WRITE_TO_BUF("TcRedundancy\t%d\n\n", cnf->tc_redundancy); /* MPR coverage */ ! WRITE_TO_BUF("# MPR coverage\n# Specifies how many MPRs a node should\n# try select to reach every 2 hop neighbor\n# Can be set to any integer >0\n# defaults to 1\n\n"); ! WRITE_TO_BUF("MprCoverage\t%d\n\n", cnf->mpr_coverage); ! WRITE_TO_BUF("# Link quality level\n# 0 = do not use link quality\n# 1 = use link quality for MPR selection\n# 2 = use link quality for MPR selection and routing\n\n"); ! WRITE_TO_BUF("LinkQualityLevel\t%d\n\n", cnf->lq_level); ! WRITE_TO_BUF("# Link quality window size\n\n"); ! WRITE_TO_BUF("LinkQualityWinSize\t%d\n\n", cnf->lq_wsize); ! WRITE_TO_BUF("# Clear screen when printing debug output?\n\n"); ! WRITE_TO_BUF("ClearScreen\t%s\n\n", cnf->clear_screen ? "yes" : "no"); /* Plugins */ ! WRITE_TO_BUF("# Olsrd plugins to load\n# This must be the absolute path to the file\n# or the loader will use the following scheme:\n"); ! WRITE_TO_BUF("# - Try the paths in the LD_LIBRARY_PATH \n# environment variable.\n# - The list of libraries cached in /etc/ld.so.cache\n# - /lib, followed by /usr/lib\n\n"); if(pe) { while(pe) { ! WRITE_TO_BUF("LoadPlugin \"%s\"\n{\n", pe->name); pp = pe->params; while(pp) { ! WRITE_TO_BUF(" PlParam \"%s\" \"%s\"\n", pp->key, pp->value); pp = pp->next; } ! WRITE_TO_BUF("}\n"); pe = pe->next; } } ! WRITE_TO_BUF("\n"); *************** *** 540,545 **** /* Interfaces */ ! WRITE_TO_BUF("# Interfaces\n# Multiple interfaces with the same configuration\n") ! WRITE_TO_BUF("# can shar the same config block. Just list the\n# interfaces(e.g. Interface \"eth0\" \"eth2\"\n\n") /* Interfaces */ if(in) --- 541,546 ---- /* Interfaces */ ! WRITE_TO_BUF("# Interfaces\n# Multiple interfaces with the same configuration\n"); ! WRITE_TO_BUF("# can shar the same config block. Just list the\n# interfaces(e.g. Interface \"eth0\" \"eth2\"\n\n"); /* Interfaces */ if(in) *************** *** 548,555 **** while(in) { ! WRITE_TO_BUF("Interface \"%s\"\n{\n", in->name) if(first) ! WRITE_TO_BUF(" # IPv4 broadcast address to use. The\n # one usefull example would be 255.255.255.255\n # If not defined the broadcastaddress\n # every card is configured with is used\n\n") --- 549,556 ---- while(in) { ! WRITE_TO_BUF("Interface \"%s\"\n{\n", in->name); if(first) ! WRITE_TO_BUF(" # IPv4 broadcast address to use. The\n # one usefull example would be 255.255.255.255\n # If not defined the broadcastaddress\n # every card is configured with is used\n\n"); *************** *** 557,625 **** { in4.s_addr = in->cnf->ipv4_broadcast.v4; ! WRITE_TO_BUF(" Ip4Broadcast\t %s\n", inet_ntoa(in4)) } else { if(first) ! WRITE_TO_BUF(" #Ip4Broadcast\t255.255.255.255\n") } ! if(first) WRITE_TO_BUF("\n") if(first) ! WRITE_TO_BUF(" # IPv6 address scope to use.\n # Must be 'site-local' or 'global'\n\n") if(in->cnf->ipv6_addrtype) ! WRITE_TO_BUF(" Ip6AddrType \tsite-local\n") else ! WRITE_TO_BUF(" Ip6AddrType \tglobal\n") ! if(first) WRITE_TO_BUF("\n") if(first) ! WRITE_TO_BUF(" # IPv6 multicast address to use when\n # using site-local addresses.\n # If not defined, ff05::15 is used\n") ! WRITE_TO_BUF(" Ip6MulticastSite\t%s\n", (char *)inet_ntop(AF_INET6, &in->cnf->ipv6_multi_site.v6, ipv6_buf, sizeof(ipv6_buf))) ! if(first) WRITE_TO_BUF("\n") if(first) ! WRITE_TO_BUF(" # IPv6 multicast address to use when\n # using global addresses\n # If not defined, ff0e::1 is used\n") ! WRITE_TO_BUF(" Ip6MulticastGlobal\t%s\n", (char *)inet_ntop(AF_INET6, &in->cnf->ipv6_multi_glbl.v6, ipv6_buf, sizeof(ipv6_buf))) ! if(first) WRITE_TO_BUF("\n") if(first) ! WRITE_TO_BUF(" # Emission and validity intervals.\n # If not defined, RFC proposed values will\n # in most cases be used.\n\n") if(in->cnf->hello_params.emission_interval != HELLO_INTERVAL) ! WRITE_TO_BUF(" HelloInterval\t%0.2f\n", in->cnf->hello_params.emission_interval) else if(first) ! WRITE_TO_BUF(" #HelloInterval\t%0.2f\n", in->cnf->hello_params.emission_interval) if(in->cnf->hello_params.validity_time != NEIGHB_HOLD_TIME) ! WRITE_TO_BUF(" HelloValidityTime\t%0.2f\n", in->cnf->hello_params.validity_time) else if(first) ! WRITE_TO_BUF(" #HelloValidityTime\t%0.2f\n", in->cnf->hello_params.validity_time) if(in->cnf->tc_params.emission_interval != TC_INTERVAL) ! WRITE_TO_BUF(" TcInterval\t\t%0.2f\n", in->cnf->tc_params.emission_interval) else if(first) ! WRITE_TO_BUF(" #TcInterval\t\t%0.2f\n", in->cnf->tc_params.emission_interval) if(in->cnf->tc_params.validity_time != TOP_HOLD_TIME) ! WRITE_TO_BUF(" TcValidityTime\t%0.2f\n", in->cnf->tc_params.validity_time) else if(first) ! WRITE_TO_BUF(" #TcValidityTime\t%0.2f\n", in->cnf->tc_params.validity_time) if(in->cnf->mid_params.emission_interval != MID_INTERVAL) ! WRITE_TO_BUF(" MidInterval\t\t%0.2f\n", in->cnf->mid_params.emission_interval) else if(first) ! WRITE_TO_BUF(" #MidInterval\t%0.2f\n", in->cnf->mid_params.emission_interval) if(in->cnf->mid_params.validity_time != MID_HOLD_TIME) ! WRITE_TO_BUF(" MidValidityTime\t%0.2f\n", in->cnf->mid_params.validity_time) else if(first) ! WRITE_TO_BUF(" #MidValidityTime\t%0.2f\n", in->cnf->mid_params.validity_time) if(in->cnf->hna_params.emission_interval != HNA_INTERVAL) ! WRITE_TO_BUF(" HnaInterval\t\t%0.2f\n", in->cnf->hna_params.emission_interval) else if(first) ! WRITE_TO_BUF(" #HnaInterval\t%0.2f\n", in->cnf->hna_params.emission_interval) if(in->cnf->hna_params.validity_time != HNA_HOLD_TIME) ! WRITE_TO_BUF(" HnaValidityTime\t%0.2f\n", in->cnf->hna_params.validity_time) else if(first) ! WRITE_TO_BUF(" #HnaValidityTime\t%0.2f\n", in->cnf->hna_params.validity_time) mult = in->cnf->lq_mult; --- 558,626 ---- { in4.s_addr = in->cnf->ipv4_broadcast.v4; ! WRITE_TO_BUF(" Ip4Broadcast\t %s\n", inet_ntoa(in4)); } else { if(first) ! WRITE_TO_BUF(" #Ip4Broadcast\t255.255.255.255\n"); } ! if(first) WRITE_TO_BUF("\n"); if(first) ! WRITE_TO_BUF(" # IPv6 address scope to use.\n # Must be 'site-local' or 'global'\n\n"); if(in->cnf->ipv6_addrtype) ! WRITE_TO_BUF(" Ip6AddrType \tsite-local\n"); else ! WRITE_TO_BUF(" Ip6AddrType \tglobal\n"); ! if(first) WRITE_TO_BUF("\n"); if(first) ! WRITE_TO_BUF(" # IPv6 multicast address to use when\n # using site-local addresses.\n # If not defined, ff05::15 is used\n"); ! WRITE_TO_BUF(" Ip6MulticastSite\t%s\n", (char *)inet_ntop(AF_INET6, &in->cnf->ipv6_multi_site.v6, ipv6_buf, sizeof(ipv6_buf))); ! if(first) WRITE_TO_BUF("\n"); if(first) ! WRITE_TO_BUF(" # IPv6 multicast address to use when\n # using global addresses\n # If not defined, ff0e::1 is used\n"); ! WRITE_TO_BUF(" Ip6MulticastGlobal\t%s\n", (char *)inet_ntop(AF_INET6, &in->cnf->ipv6_multi_glbl.v6, ipv6_buf, sizeof(ipv6_buf))); ! if(first) WRITE_TO_BUF("\n"); if(first) ! WRITE_TO_BUF(" # Emission and validity intervals.\n # If not defined, RFC proposed values will\n # in most cases be used.\n\n"); if(in->cnf->hello_params.emission_interval != HELLO_INTERVAL) ! WRITE_TO_BUF(" HelloInterval\t%0.2f\n", in->cnf->hello_params.emission_interval); else if(first) ! WRITE_TO_BUF(" #HelloInterval\t%0.2f\n", in->cnf->hello_params.emission_interval); if(in->cnf->hello_params.validity_time != NEIGHB_HOLD_TIME) ! WRITE_TO_BUF(" HelloValidityTime\t%0.2f\n", in->cnf->hello_params.validity_time); else if(first) ! WRITE_TO_BUF(" #HelloValidityTime\t%0.2f\n", in->cnf->hello_params.validity_time); if(in->cnf->tc_params.emission_interval != TC_INTERVAL) ! WRITE_TO_BUF(" TcInterval\t\t%0.2f\n", in->cnf->tc_params.emission_interval); else if(first) ! WRITE_TO_BUF(" #TcInterval\t\t%0.2f\n", in->cnf->tc_params.emission_interval); if(in->cnf->tc_params.validity_time != TOP_HOLD_TIME) ! WRITE_TO_BUF(" TcValidityTime\t%0.2f\n", in->cnf->tc_params.validity_time); else if(first) ! WRITE_TO_BUF(" #TcValidityTime\t%0.2f\n", in->cnf->tc_params.validity_time); if(in->cnf->mid_params.emission_interval != MID_INTERVAL) ! WRITE_TO_BUF(" MidInterval\t\t%0.2f\n", in->cnf->mid_params.emission_interval); else if(first) ! WRITE_TO_BUF(" #MidInterval\t%0.2f\n", in->cnf->mid_params.emission_interval); if(in->cnf->mid_params.validity_time != MID_HOLD_TIME) ! WRITE_TO_BUF(" MidValidityTime\t%0.2f\n", in->cnf->mid_params.validity_time); else if(first) ! WRITE_TO_BUF(" #MidValidityTime\t%0.2f\n", in->cnf->mid_params.validity_time); if(in->cnf->hna_params.emission_interval != HNA_INTERVAL) ! WRITE_TO_BUF(" HnaInterval\t\t%0.2f\n", in->cnf->hna_params.emission_interval); else if(first) ! WRITE_TO_BUF(" #HnaInterval\t%0.2f\n", in->cnf->hna_params.emission_interval); if(in->cnf->hna_params.validity_time != HNA_HOLD_TIME) ! WRITE_TO_BUF(" HnaValidityTime\t%0.2f\n", in->cnf->hna_params.validity_time); else if(first) ! WRITE_TO_BUF(" #HnaValidityTime\t%0.2f\n", in->cnf->hna_params.validity_time); mult = in->cnf->lq_mult; *************** *** 628,632 **** { if(first) ! WRITE_TO_BUF(" #LinkQualityMult\tdefault 1.0\n") } else --- 629,633 ---- { if(first) ! WRITE_TO_BUF(" #LinkQualityMult\tdefault 1.0\n"); } else *************** *** 637,642 **** sizeof (ipv6_buf)); ! WRITE_TO_BUF(" LinkQualityMult\t%s %0.2f\n", ! ipv6_buf, mult->val) mult = mult->next; --- 638,642 ---- sizeof (ipv6_buf)); ! WRITE_TO_BUF(" LinkQualityMult\t%s %0.2f\n", ipv6_buf, mult->val); mult = mult->next; *************** *** 646,673 **** if(first) { ! WRITE_TO_BUF(" # When multiple links exist between hosts\n"); ! WRITE_TO_BUF(" # the weight of interface is used to determine\n"); ! WRITE_TO_BUF(" # the link to use. Normally the weight is\n") ! WRITE_TO_BUF(" # automatically calculated by olsrd based\n"); ! WRITE_TO_BUF(" # on the characteristics of the interface,\n"); ! WRITE_TO_BUF(" # but here you can specify a fixed value.\n"); ! WRITE_TO_BUF(" # Olsrd will choose links with the lowest value.\n") ! WRITE_TO_BUF(" # Note:\n"); ! WRITE_TO_BUF(" # Interface weight is used only when LinkQualityLevel is 0.\n"); ! WRITE_TO_BUF(" # For any other value of LinkQualityLevel, the interface ETX\n"); ! WRITE_TO_BUF(" # value is used instead.\n\n"); } if(in->cnf->weight.fixed) { ! WRITE_TO_BUF(" Weight\t %d\n\n", in->cnf->weight.value) } else { if(first) ! WRITE_TO_BUF(" #Weight\t 0\n\n") } ! WRITE_TO_BUF("}\n\n") in = in->next; first = OLSR_FALSE; --- 646,673 ---- if(first) { ! WRITE_TO_BUF(" # When multiple links exist between hosts\n");; ! WRITE_TO_BUF(" # the weight of interface is used to determine\n");; ! WRITE_TO_BUF(" # the link to use. Normally the weight is\n"); ! WRITE_TO_BUF(" # automatically calculated by olsrd based\n");; ! WRITE_TO_BUF(" # on the characteristics of the interface,\n");; ! WRITE_TO_BUF(" # but here you can specify a fixed value.\n");; ! WRITE_TO_BUF(" # Olsrd will choose links with the lowest value.\n"); ! WRITE_TO_BUF(" # Note:\n");; ! WRITE_TO_BUF(" # Interface weight is used only when LinkQualityLevel is 0.\n");; ! WRITE_TO_BUF(" # For any other value of LinkQualityLevel, the interface ETX\n");; ! WRITE_TO_BUF(" # value is used instead.\n\n");; } if(in->cnf->weight.fixed) { ! WRITE_TO_BUF(" Weight\t %d\n\n", in->cnf->weight.value); } else { if(first) ! WRITE_TO_BUF(" #Weight\t 0\n\n"); } ! WRITE_TO_BUF("}\n\n"); in = in->next; first = OLSR_FALSE; *************** *** 677,681 **** ! WRITE_TO_BUF("\n# END AUTOGENERATED CONFIG\n") return size; --- 677,681 ---- ! WRITE_TO_BUF("\n# END AUTOGENERATED CONFIG\n"); return size; From (spam-protected) Tue Oct 16 11:54:48 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Tue, 16 Oct 2007 09:54:48 +0000 Subject: [Olsr-cvs] olsrd-current/src lq_route.c, 1.52, 1.53 routing_table.c, 1.31, 1.32 routing_table.h, 1.22, 1.23 tc_set.c, 1.30, 1.31 tc_set.h, 1.17, 1.18 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv12884/src Modified Files: lq_route.c routing_table.c routing_table.h tc_set.c tc_set.h Log Message: * applied http://gredler.at/download/olsrd/neighbor_routes3.diff Index: tc_set.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/tc_set.h,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** tc_set.h 13 Sep 2007 22:43:15 -0000 1.17 --- tc_set.h 16 Oct 2007 09:54:44 -0000 1.18 *************** *** 1,5 **** /* * The olsr.org Optimized Link-State Routing daemon(olsrd) ! * Copyright (c) 2004, Andreas T�nnesen(andreto at olsr.org) * LSDB rewrite (c) 2007, Hannes Gredler (hannes at gredler.at) * All rights reserved. --- 1,5 ---- /* * The olsr.org Optimized Link-State Routing daemon(olsrd) ! * Copyright (c) 2004, Andreas Tønnesen(andreto at olsr.org) * LSDB rewrite (c) 2007, Hannes Gredler (hannes at gredler.at) * All rights reserved. *************** *** 117,120 **** --- 117,121 ---- int olsr_init_tc(void); + void olsr_change_myself_tc(void); int olsr_tc_delete_mprs(struct tc_entry *, struct tc_message *); int olsr_tc_update_mprs(struct tc_entry *, struct tc_message *); Index: lq_route.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/lq_route.c,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** lq_route.c 16 Sep 2007 21:20:07 -0000 1.52 --- lq_route.c 16 Oct 2007 09:54:43 -0000 1.53 *************** *** 338,341 **** --- 338,342 ---- * zero ourselves and add us to the candidate tree. */ + olsr_change_myself_tc(); tc_myself->path_etx = ZERO_ETX; olsr_spf_add_cand_tree(&cand_tree, tc_myself); *************** *** 402,407 **** #endif - olsr_fill_routing_table_with_neighbors(); - /* * In the path tree we have all the reachable nodes in our topology. --- 403,406 ---- Index: tc_set.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/tc_set.c,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** tc_set.c 17 Sep 2007 22:24:22 -0000 1.30 --- tc_set.c 16 Oct 2007 09:54:43 -0000 1.31 *************** *** 1,5 **** /* * The olsr.org Optimized Link-State Routing daemon(olsrd) ! * Copyright (c) 2004, Andreas T�nnesen(andreto at olsr.org) * LSDB rewrite (c) 2007, Hannes Gredler (hannes at gredler.at) * All rights reserved. --- 1,5 ---- /* * The olsr.org Optimized Link-State Routing daemon(olsrd) ! * Copyright (c) 2004, Andreas Tønnesen(andreto at olsr.org) * LSDB rewrite (c) 2007, Hannes Gredler (hannes at gredler.at) * All rights reserved. *************** *** 73,76 **** --- 73,109 ---- /** + * The main ip address has changed. + * Do the needful. + */ + void + olsr_change_myself_tc(void) + { + struct tc_edge_entry *tc_edge; + + if (tc_myself) { + + /* + * Check if there was a change. + */ + if (COMP_IP(&tc_myself->addr, &olsr_cnf->main_addr)) { + return; + } + + /* + * Flush all edges. This causes our own tc_entry to vanish. + */ + OLSR_FOR_ALL_TC_EDGE_ENTRIES(tc_myself, tc_edge) { + olsr_delete_tc_edge_entry(tc_edge); + } OLSR_FOR_ALL_TC_EDGE_ENTRIES_END(tc_myself, tc_edge); + } + + /* + * The old entry for ourselves is gone, generate a new one and trigger SPF. + */ + tc_myself = olsr_add_tc_entry(&olsr_cnf->main_addr); + changes_topology = OLSR_TRUE; + } + + /** * Delete a TC entry. * *************** *** 396,400 **** * If the edge gets refreshed in subsequent packets then we have * avoided a two edge transistion. ! * If the edge really went away then after the garbace collection * timer has expired olsr_time_out_tc_set() will do the needful. */ --- 429,433 ---- * If the edge gets refreshed in subsequent packets then we have * avoided a two edge transistion. ! * If the edge really went away then after the garbage collection * timer has expired olsr_time_out_tc_set() will do the needful. */ Index: routing_table.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/routing_table.c,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** routing_table.c 16 Sep 2007 21:20:17 -0000 1.31 --- routing_table.c 16 Oct 2007 09:54:43 -0000 1.32 *************** *** 1,5 **** /* * The olsr.org Optimized Link-State Routing daemon(olsrd) ! * Copyright (c) 2004, Andreas T�nnesen(andreto at olsr.org) * RIB implementation (c) 2007, Hannes Gredler (hannes at gredler.at) * All rights reserved. --- 1,5 ---- /* * The olsr.org Optimized Link-State Routing daemon(olsrd) ! * Copyright (c) 2004, Andreas Tønnesen(andreto at olsr.org) * RIB implementation (c) 2007, Hannes Gredler (hannes at gredler.at) * All rights reserved. *************** *** 508,586 **** /** - *Insert all the one hop neighbors in the routing table. - * - *@return - */ - int - olsr_fill_routing_table_with_neighbors(void) - { - int index; - float etx; - - #ifdef DEBUG - OLSR_PRINTF(7, "FILL ROUTING TABLE WITH NEIGHBORS\n"); - #endif - - for (index=0;indexnext) { - - if (neighbor->status == SYM) { - - static struct mid_address addrs; - struct mid_address *addrs2; - - /* - * Insert all the neighbors addresses - */ - COPY_IP(&addrs.alias, &neighbor->neighbor_main_addr); - addrs.next_alias = mid_lookup_aliases(&neighbor->neighbor_main_addr); - - for (addrs2 = &addrs; addrs2; addrs2 = addrs2->next_alias) { - - struct link_entry *link; - - link = get_best_link_to_neighbor(&addrs2->alias); - - #ifdef DEBUG - OLSR_PRINTF(7, "(ROUTE)Adding neighbor %s\n", olsr_ip_to_string(&addrs.alias)); - #endif - if (link) { - - struct interface *iface; - - iface = link->if_name ? if_ifwithname(link->if_name) : - if_ifwithaddr(&link->local_iface_addr); - - etx = 1.0 / (link->loss_link_quality2 * link->neigh_link_quality2); - - if (iface) { - - /* neighbor main IP address */ - olsr_insert_routing_table(&link->neighbor_iface_addr, olsr_cnf->maxplen, - &link->neighbor->neighbor_main_addr, - &link->neighbor_iface_addr, - iface->if_index, 1, etx); - - /* this is the nexthop route that all routes will be tracking */ - olsr_insert_routing_table(&addrs2->alias, olsr_cnf->maxplen, - &link->neighbor->neighbor_main_addr, - &link->neighbor_iface_addr, - iface->if_index, 1, etx); - } - } - } - } - } - } - return 1; - } - - - /** *Calculate the HNA routes * --- 508,511 ---- Index: routing_table.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/routing_table.h,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** routing_table.h 16 Sep 2007 21:20:17 -0000 1.22 --- routing_table.h 16 Oct 2007 09:54:43 -0000 1.23 *************** *** 1,5 **** /* * The olsr.org Optimized Link-State Routing daemon(olsrd) ! * Copyright (c) 2004, Andreas T�nnesen(andreto at olsr.org) * RIB implementation (c) 2007, Hannes Gredler (hannes at gredler.at) * All rights reserved. --- 1,5 ---- /* * The olsr.org Optimized Link-State Routing daemon(olsrd) ! * Copyright (c) 2004, Andreas Tønnesen(andreto at olsr.org) * RIB implementation (c) 2007, Hannes Gredler (hannes at gredler.at) * All rights reserved. *************** *** 158,162 **** void olsr_calculate_hna_routes(void); - int olsr_fill_routing_table_with_neighbors(void); char *olsr_rt_to_string(struct rt_entry *); char *olsr_rtp_to_string(struct rt_path *); --- 158,161 ---- From (spam-protected) Tue Oct 16 11:54:45 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Tue, 16 Oct 2007 09:54:45 +0000 Subject: [Olsr-cvs] olsrd-current CHANGELOG,1.97,1.98 Message-ID: Update of /cvsroot/olsrd/olsrd-current In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv12884 Modified Files: CHANGELOG Log Message: * applied http://gredler.at/download/olsrd/neighbor_routes3.diff Index: CHANGELOG =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/CHANGELOG,v retrieving revision 1.97 retrieving revision 1.98 diff -C2 -d -r1.97 -r1.98 *** CHANGELOG 14 Oct 2007 14:11:11 -0000 1.97 --- CHANGELOG 16 Oct 2007 09:54:43 -0000 1.98 *************** *** 74,77 **** --- 74,82 ---- - add display of SPF runtime (masked behind #ifdef SPF_PROFILING) + + - http://gredler.at/download/olsrd/neighbor_routes3.diff: This updates the own + IP address (read: the main address) after changes (e.g. on + `ifup wlan0; sleep 1; ifdown wlan0`) and kills the + olsr_fill_routing_table_with_neighbors() function. ---- snip ---- And Sven-Ola Tuecke fixed an instability issue on interface From (spam-protected) Tue Oct 16 12:01:31 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Tue, 16 Oct 2007 10:01:31 +0000 Subject: [Olsr-cvs] olsrd-current CHANGELOG,1.98,1.99 Message-ID: Update of /cvsroot/olsrd/olsrd-current In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15606 Modified Files: CHANGELOG Log Message: * applied a nad-edited version of Sven-Ola Tückes "Save the fish" patch Index: CHANGELOG =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/CHANGELOG,v retrieving revision 1.98 retrieving revision 1.99 diff -C2 -d -r1.98 -r1.99 *** CHANGELOG 16 Oct 2007 09:54:43 -0000 1.98 --- CHANGELOG 16 Oct 2007 10:01:29 -0000 1.99 *************** *** 139,142 **** --- 139,146 ---- 116-olsrd-fix-pluginparam-addons.patch fixing the compilation warning on 64bit and lots of other improvements. + - "Save the fish" patch: Avoid forwarding of packets with too low TTL. This + kills lots of packet forwarding storms. + NB: The oneliner was applied by hand by BP and formatted to look (in BPs O) + more readable. PATCH by Arnd Hannemann From (spam-protected) Tue Oct 16 12:01:31 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Tue, 16 Oct 2007 10:01:31 +0000 Subject: [Olsr-cvs] olsrd-current/src olsr.c,1.59,1.60 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15606/src Modified Files: olsr.c Log Message: * applied a nad-edited version of Sven-Ola Tückes "Save the fish" patch Index: olsr.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/olsr.c,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** olsr.c 5 Oct 2007 20:57:53 -0000 1.59 --- olsr.c 16 Oct 2007 10:01:29 -0000 1.60 *************** *** 300,305 **** int msgsize; struct interface *ifn; ! if(!olsr_check_dup_table_fwd(originator, seqno, &in_if->ip_addr)) { --- 300,308 ---- int msgsize; struct interface *ifn; + const int ttl = olsr_cnf->ip_version == AF_INET ? m->v4.ttl : m->v6.ttl; ! if (ttl < 2) { ! return 0; ! } if(!olsr_check_dup_table_fwd(originator, seqno, &in_if->ip_addr)) { From (spam-protected) Wed Oct 17 09:30:37 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Wed, 17 Oct 2007 07:30:37 +0000 Subject: [Olsr-cvs] olsrd-current/src tc_set.c,1.31,1.32 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10726/src Modified Files: tc_set.c Log Message: * Bug fix from Sven-Ola Tücke: initialize malloc()ed struct Index: tc_set.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/tc_set.c,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** tc_set.c 16 Oct 2007 09:54:43 -0000 1.31 --- tc_set.c 17 Oct 2007 07:30:34 -0000 1.32 *************** *** 189,192 **** --- 189,193 ---- return NULL; } + memset(tc, 0, sizeof(struct tc_entry)); /* Fill entry */ From (spam-protected) Wed Oct 17 12:22:52 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Wed, 17 Oct 2007 10:22:52 +0000 Subject: [Olsr-cvs] olsrd-current CHANGELOG,1.99,1.100 Message-ID: Update of /cvsroot/olsrd/olsrd-current In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15483 Modified Files: CHANGELOG Log Message: * Bug fix from Sven-Ola Tücke: initialize malloc()ed struct Index: CHANGELOG =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/CHANGELOG,v retrieving revision 1.99 retrieving revision 1.100 diff -C2 -d -r1.99 -r1.100 *** CHANGELOG 16 Oct 2007 10:01:29 -0000 1.99 --- CHANGELOG 17 Oct 2007 10:22:49 -0000 1.100 *************** *** 81,85 **** ---- snip ---- And Sven-Ola Tuecke fixed an instability issue on interface ! up/down operations (see 102-olsrd-rt-refactoring-fixes.patch below). PATCH by Hannes Gredler which "consolidates --- 81,86 ---- ---- snip ---- And Sven-Ola Tuecke fixed an instability issue on interface ! up/down operations (see 102-olsrd-rt-refactoring-fixes.patch below) and a missing ! initialization. PATCH by Hannes Gredler which "consolidates From (spam-protected) Sat Oct 20 13:26:27 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sat, 20 Oct 2007 11:26:27 +0000 Subject: [Olsr-cvs] olsrd-current Makefile,1.99,1.100 Message-ID: Update of /cvsroot/olsrd/olsrd-current In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28982 Modified Files: Makefile Log Message: * set version to 0.5.4 Index: Makefile =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/Makefile,v retrieving revision 1.99 retrieving revision 1.100 diff -C2 -d -r1.99 -r1.100 *** Makefile 5 Oct 2007 08:39:12 -0000 1.99 --- Makefile 20 Oct 2007 11:26:25 -0000 1.100 *************** *** 38,42 **** # $Id$ ! VERS = 0.5.4rc1 TOPDIR = . --- 38,42 ---- # $Id$ ! VERS = 0.5.4 TOPDIR = . From (spam-protected) Sat Oct 20 13:55:26 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sat, 20 Oct 2007 11:55:26 +0000 Subject: [Olsr-cvs] olsrd-current Makefile, 1.100, 1.101 CHANGELOG, 1.100, 1.101 Message-ID: Update of /cvsroot/olsrd/olsrd-current In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8218 Modified Files: Makefile CHANGELOG Log Message: * set version to 0.5.5pre Index: Makefile =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/Makefile,v retrieving revision 1.100 retrieving revision 1.101 diff -C2 -d -r1.100 -r1.101 *** Makefile 20 Oct 2007 11:26:25 -0000 1.100 --- Makefile 20 Oct 2007 11:55:23 -0000 1.101 *************** *** 38,42 **** # $Id$ ! VERS = 0.5.4 TOPDIR = . --- 38,42 ---- # $Id$ ! VERS = 0.5.5pre TOPDIR = . Index: CHANGELOG =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/CHANGELOG,v retrieving revision 1.100 retrieving revision 1.101 diff -C2 -d -r1.100 -r1.101 *** CHANGELOG 17 Oct 2007 10:22:49 -0000 1.100 --- CHANGELOG 20 Oct 2007 11:55:23 -0000 1.101 *************** *** 2,5 **** --- 2,7 ---- $Id$ + 0.5.5 --------------------------------------------------------------------- + 0.5.4 --------------------------------------------------------------------- From (spam-protected) Sat Oct 20 14:59:10 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sat, 20 Oct 2007 12:59:10 +0000 Subject: [Olsr-cvs] olsrd-current/src/unix ifnet.c,1.51,1.52 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src/unix In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32510/src/unix Modified Files: ifnet.c Log Message: * fixed compile bugs if DEBUG is enabled Index: ifnet.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/unix/ifnet.c,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** ifnet.c 23 Aug 2007 21:20:02 -0000 1.51 --- ifnet.c 20 Oct 2007 12:59:08 -0000 1.52 *************** *** 129,133 **** #ifdef DEBUG /* Don't check this interface */ ! OLSR_PRINTF(3, "Not checking interface %s\n", tmp_if->name) #endif continue; --- 129,133 ---- #ifdef DEBUG /* Don't check this interface */ ! OLSR_PRINTF(3, "Not checking interface %s\n", tmp_if->name); #endif continue; From (spam-protected) Sat Oct 20 14:59:10 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sat, 20 Oct 2007 12:59:10 +0000 Subject: [Olsr-cvs] olsrd-current/src lq_route.c, 1.53, 1.54 packet.c, 1.23, 1.24 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32510/src Modified Files: lq_route.c packet.c Log Message: * fixed compile bugs if DEBUG is enabled Index: lq_route.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/lq_route.c,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** lq_route.c 16 Oct 2007 09:54:43 -0000 1.53 --- lq_route.c 20 Oct 2007 12:59:08 -0000 1.54 *************** *** 257,261 **** olsr_ip_to_string(vert->next_hop ? &vert->next_hop->neighbor_iface_addr : NULL), ! new_vert->->hops); #endif --- 257,261 ---- olsr_ip_to_string(vert->next_hop ? &vert->next_hop->neighbor_iface_addr : NULL), ! new_vert->hops); #endif Index: packet.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/packet.c,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** packet.c 2 Aug 2007 22:07:19 -0000 1.23 --- packet.c 20 Oct 2007 12:59:08 -0000 1.24 *************** *** 94,98 **** #ifdef DEBUG ! OLSR_PRINTF(3, "\tBuilding HELLO on interface %d\n", outif->if_nr); #endif --- 94,98 ---- #ifdef DEBUG ! OLSR_PRINTF(3, "\tBuilding HELLO on interface %d\n", outif->int_name); #endif From (spam-protected) Sat Oct 20 17:16:34 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sat, 20 Oct 2007 15:16:34 +0000 Subject: [Olsr-cvs] olsrd-current/src lq_route.c, 1.54, 1.55 packet.c, 1.24, 1.25 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21739/src Modified Files: lq_route.c packet.c Log Message: * fixed more compile bugs if DEBUG is enabled Index: lq_route.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/lq_route.c,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** lq_route.c 20 Oct 2007 12:59:08 -0000 1.54 --- lq_route.c 20 Oct 2007 15:16:32 -0000 1.55 *************** *** 186,190 **** #ifdef DEBUG OLSR_PRINTF(1, "SPF: exploring node %s, cost %f\n", ! olsr_ip_to_string(&(vert->addr)), vert->path_etx); #endif --- 186,190 ---- #ifdef DEBUG OLSR_PRINTF(1, "SPF: exploring node %s, cost %f\n", ! olsr_ip_to_string(&vert->addr), vert->path_etx); #endif *************** *** 225,229 **** OLSR_PRINTF(1, "SPF: exploring edge %s, cost %s\n", olsr_ip_to_string(&(tc_edge->T_dest_addr)), ! olsr_etx_to_string(new_vert->path_etx)); #endif --- 225,229 ---- OLSR_PRINTF(1, "SPF: exploring edge %s, cost %s\n", olsr_ip_to_string(&(tc_edge->T_dest_addr)), ! olsr_etx_to_string(new_etx)); #endif Index: packet.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/packet.c,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** packet.c 20 Oct 2007 12:59:08 -0000 1.24 --- packet.c 20 Oct 2007 15:16:32 -0000 1.25 *************** *** 94,98 **** #ifdef DEBUG ! OLSR_PRINTF(3, "\tBuilding HELLO on interface %d\n", outif->int_name); #endif --- 94,98 ---- #ifdef DEBUG ! OLSR_PRINTF(3, "\tBuilding HELLO on interface %s\n", outif->int_name); #endif From (spam-protected) Sat Oct 20 17:16:34 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sat, 20 Oct 2007 15:16:34 +0000 Subject: [Olsr-cvs] olsrd-current/lib/secure/src olsrd_secure.c,1.27,1.28 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/secure/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21739/lib/secure/src Modified Files: olsrd_secure.c Log Message: * fixed more compile bugs if DEBUG is enabled Index: olsrd_secure.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/secure/src/olsrd_secure.c,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** olsrd_secure.c 2 Aug 2007 14:37:09 -0000 1.27 --- olsrd_secure.c 20 Oct 2007 15:16:32 -0000 1.28 *************** *** 450,454 **** struct s_olsrmsg *msg; #ifdef DEBUG ! int i, j; char *sigmsg; #endif --- 450,455 ---- struct s_olsrmsg *msg; #ifdef DEBUG ! unsigned int i; ! int j; char *sigmsg; #endif *************** *** 528,533 **** #ifdef DEBUG ! int i, j; ! char *sigmsg; #endif --- 529,535 ---- #ifdef DEBUG ! unsigned int i; ! int j; ! olsr_u8_t *sigmsg; #endif *************** *** 546,550 **** j = 0; ! sigmsg = (char *)sig; for(i = 0; i < sizeof(struct s_olsrmsg); i++) --- 548,552 ---- j = 0; ! sigmsg = (olsr_u8_t *)sig; for(i = 0; i < sizeof(struct s_olsrmsg); i++) *************** *** 609,613 **** olsr_printf(1, "Recevied hash:\n"); ! sigmsg = (char *)sig->sig.signature; for(i = 0; i < SIGNATURE_SIZE; i++) --- 611,615 ---- olsr_printf(1, "Recevied hash:\n"); ! sigmsg = (olsr_u8_t *)sig->sig.signature; for(i = 0; i < SIGNATURE_SIZE; i++) From (spam-protected) Sat Oct 20 21:27:35 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sat, 20 Oct 2007 19:27:35 +0000 Subject: [Olsr-cvs] olsrd-current Makefile.inc,1.35,1.36 Message-ID: Update of /cvsroot/olsrd/olsrd-current In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20173 Modified Files: Makefile.inc Log Message: - added "-fomit-frame-pointer" to the normal build . start a new era on configuration: We introduce a new higher level configuratino layer to enable or disable features/configuration options: Rationale: Take "debug build" as prime example. To have a real debug build, you want (at least) "-g" in CFLAGS and no stripping. It is cumbersome and error prone to edit that by hand (or pass parameters to the "make") and with a new options somewhere (e.g. "-fomit-frame-pointer" from above) one has to adjust that. For these (so called) high leveloptions, I started with --- snip ---- # activate debugging with 1 or deactivate with 0 DEBUG ?= 0 # the optimize option to be set for gcc OPTIMIZE ?= -O2 # enable mudflap with 1 or deactivate with 0 # you need a recent enough gcc and the libmudflap installed MUDFLAP ?= 0 --- snip ---- Feel free to propose other useful ones (and submit patches;-). The lower part, which is basically the former Makefile.inc, gets now "ifeq" etc. so that a simple "make DEBUG=1" makes a real debug build. ANd this is available and usefule to the plugin Makeifle's too of course. Index: Makefile.inc =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/Makefile.inc,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** Makefile.inc 13 Oct 2007 14:51:32 -0000 1.35 --- Makefile.inc 20 Oct 2007 19:27:33 -0000 1.36 *************** *** 1,2 **** --- 1,25 ---- + ###################### + # + # Highlevel configuration options for all + # + # $Id$ + # + + # activate debugging with 1 or deactivate with 0 + DEBUG ?= 0 + + # the optimize option to be set for gcc + OPTIMIZE ?= -O2 + + # enable mudflap with 1 or deactivate with 0 + # you need a recent enough gcc and the libmudflap installed + MUDFLAP ?= 0 + + + ###################### + # + # Lowlevel options and rules + # + # programs CCACHE ?= $(shell which ccache 2> /dev/null) *************** *** 6,10 **** --- 29,37 ---- CC ?= $(CCACHE) gcc endif + ifeq ($(DEBUG),0) STRIP ?= strip + else + STRIP ?= : + endif BISON ?= bison FLEX ?= flex *************** *** 22,26 **** CFGFILE ?= $(ETCDIR)/$(CFGNAME) ! CPPFLAGS = -Isrc -I$(TOPDIR)/src # add gcc warnings and optimizations if CFLAGS not set --- 49,56 ---- CFGFILE ?= $(ETCDIR)/$(CFGNAME) ! CPPFLAGS = -Isrc ! ifneq ($(TOPDIR),.) ! CPPFLAGS += -I$(TOPDIR)/src ! endif # add gcc warnings and optimizations if CFLAGS not set *************** *** 41,45 **** --- 71,78 ---- WARNINGS += -Wno-deprecated-declarations #WARNINGS += -Wredundant-decls + ifeq ($(MUDFLAP),0) + # work around a bug in gcc-4.* WARNINGS += -Wnested-externs + endif # Alas, htons() triggers this so we can't seriously activate it. #WARNINGS += -Wunreachable-code *************** *** 49,52 **** --- 82,88 ---- WARNINGS += -finline-functions-called-once WARNINGS += -fearly-inlining + ifeq ($(DEBUG),0) + WARNINGS += -fomit-framepointers + endif # we have small inline functions in src/lq_route.c which should always be inlined WARNINGS += -finline-limit=50 *************** *** 54,59 **** endif CFLAGS += $(WARNINGS) ! CFLAGS += -O2 ! #CFLAGS += -g CFLAGS += $(EXTRA_CFLAGS) --- 90,94 ---- endif CFLAGS += $(WARNINGS) ! CFLAGS += $(OPTIMIZE) CFLAGS += $(EXTRA_CFLAGS) *************** *** 61,64 **** --- 96,102 ---- CPPFLAGS += $(OS_CFLAG_PTHREAD) endif + ifneq ($(MUDFLAP),0) + CFLAGS += -fmudflapth + endif ifdef OLSRD_PLUGIN *************** *** 71,74 **** --- 109,116 ---- LDFLAGS += -Wl,-export-dynamic endif + ifneq ($(MUDFLAP),0) + LIBS += -lmudflapth + endif + LIBS += $(OS_LIB_PTHREAD) ################################### *************** *** 77,81 **** # we have plugins with the old interface ! CPPFLAGS += -DSUPPORT_OLD_PLUGIN_VERSIONS=1 # search sources and headers in current dir and in src/ --- 119,123 ---- # we have plugins with the old interface ! #CPPFLAGS += -DSUPPORT_OLD_PLUGIN_VERSIONS=1 # search sources and headers in current dir and in src/ *************** *** 102,109 **** # debugging or non-debugging flags ! ifdef DEBUG CPPFLAGS += -DDEBUG ! endif ! ifdef NODEBUG CPPFLAGS += -DNODEBUG endif --- 144,152 ---- # debugging or non-debugging flags ! ifeq ($(DEBUG),1) CPPFLAGS += -DDEBUG ! CFLAGS += -g ! else ! CPPFLAGS += -DNDEBUG CPPFLAGS += -DNODEBUG endif From (spam-protected) Sat Oct 20 22:23:15 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sat, 20 Oct 2007 20:23:15 +0000 Subject: [Olsr-cvs] olsrd-current Makefile.inc,1.36,1.37 Message-ID: Update of /cvsroot/olsrd/olsrd-current In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11084 Modified Files: Makefile.inc Log Message: Ooops, I overlooked that NODEBUG is also used in defs.h (and not only the txtinfo plugin): * added a 4th high level variable: NO_DEBUG_MESSAGES to compile the debug OLSR_PRINTF completely out. Index: Makefile.inc =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/Makefile.inc,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** Makefile.inc 20 Oct 2007 19:27:33 -0000 1.36 --- Makefile.inc 20 Oct 2007 20:23:12 -0000 1.37 *************** *** 9,12 **** --- 9,15 ---- DEBUG ?= 0 + # compile OLSR_PRINTF out + NO_DEBUG_MESSAGES ?= 0 + # the optimize option to be set for gcc OPTIMIZE ?= -O2 *************** *** 149,152 **** --- 152,157 ---- else CPPFLAGS += -DNDEBUG + endif + ifeq ($(NO_DEBUG_MESSAGES),1) CPPFLAGS += -DNODEBUG endif From (spam-protected) Sat Oct 20 22:41:06 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sat, 20 Oct 2007 20:41:06 +0000 Subject: [Olsr-cvs] olsrd-current/lib/httpinfo/src admin_html.h, 1.4, 1.5 admin_interface.c, 1.9, 1.10 html.h, 1.10, 1.11 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/httpinfo/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18520/lib/httpinfo/src Modified Files: admin_html.h admin_interface.c html.h Log Message: * fixed a few compile bugs (and simplified it a little bit) Index: admin_html.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/httpinfo/src/admin_html.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** admin_html.h 28 Feb 2005 20:28:59 -0000 1.4 --- admin_html.h 20 Oct 2007 20:41:04 -0000 1.5 *************** *** 49,87 **** #define ADMIN_HTML_H ! static const char *admin_frame[] = ! { ! "Administrator interface
    \n" ! "

    Change basic settings

    \n", ! "
    \n", ! "\n", ! "\n", ! "
    \n
    \n", ! "
    \n", ! "
    \n", ! "
    \n", ! "

    Add/remove local HNA entries

    \n", ! "
    \n", ! "\n", ! "\n", ! "\n", ! "\n", ! "\n", ! "
    Network:Netmask/Prefix:

    \n", ! "
    \n", ! "\n", ! "\n", ! "\n", ! "\n", ! "
    DeleteNetworkNetmask
    %s%s
    \n
    \n", ! "
    \n", ! "
    \n", ! NULL ! }; ! static char admin_basic_setting_int[] = "
    %s %s %s
    \n"; ! static const char admin_frame_mid[] = ! "
    \n
    \n" ! "
    \n" ! "
    \n" ! "\n" ! "

    Add/remove local HNA entries

    \n" ! "
    \n" ! "\n" ! "\n" ! "\n" ! "\n" ! "\n" ! "
    Network:Netmask/Prefix:

    \n" ! "
    \n" ! "\n" ! "\n"; + static const char admin_frame_epilog[] = + "
    DeleteNetworkNetmask
    \n
    \n" + "
    \n" + "
    \n"; ! static const char admin_basic_setting_int[] = "
    %s %s %s
    Hysteresis disabled
    LQ disabled
    Hysteresis disabled
    LQ disabled
    %s%s
    %s%d