From (spam-protected) Wed Aug 1 18:18:32 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Wed, 01 Aug 2007 16:18:32 +0000 Subject: [Olsr-cvs] olsrd-current/src socket_parser.c,1.27,1.28 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21381/src Modified Files: socket_parser.c Log Message: *use NULL instead of 0 for pointers Index: socket_parser.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/socket_parser.c,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** socket_parser.c 8 May 2007 23:43:17 -0000 1.27 --- socket_parser.c 1 Aug 2007 16:18:30 -0000 1.28 *************** *** 181,185 **** /* Runnig select on the FD set */ ! n = olsr_select(hfd, &ibits, 0, 0, &tvp); if(n == 0) --- 181,185 ---- /* Runnig select on the FD set */ ! n = olsr_select(hfd, &ibits, NULL, NULL, &tvp); if(n == 0) From (spam-protected) Wed Aug 1 18:28:32 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Wed, 01 Aug 2007 16:28:32 +0000 Subject: [Olsr-cvs] olsrd-current/src/olsr_switch main.c,1.26,1.27 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src/olsr_switch In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25519/src/olsr_switch Modified Files: main.c Log Message: * removed a superflous cast Index: main.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/olsr_switch/main.c,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** main.c 28 Jul 2007 12:55:49 -0000 1.26 --- main.c 1 Aug 2007 16:28:30 -0000 1.27 *************** *** 113,117 **** { /* IPv6 */ ! ret = (char *)inet_ntop(AF_INET6, &addr->v6, ipv6_buf, sizeof(ipv6_buf)); } --- 113,117 ---- { /* IPv6 */ ! ret = inet_ntop(AF_INET6, &addr->v6, ipv6_buf, sizeof(ipv6_buf)); } From (spam-protected) Wed Aug 1 18:19:51 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Wed, 01 Aug 2007 16:19:51 +0000 Subject: [Olsr-cvs] olsrd-current/src ipc_frontend.c, 1.31, 1.32 ipc_frontend.h, 1.13, 1.14 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21795/src Modified Files: ipc_frontend.c ipc_frontend.h Log Message: * declare a locally only used variable static (and not in each .c file which happen to #include that .h file) Index: ipc_frontend.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/ipc_frontend.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** ipc_frontend.h 20 Apr 2007 13:46:04 -0000 1.13 --- ipc_frontend.h 1 Aug 2007 16:19:48 -0000 1.14 *************** *** 99,104 **** - olsr_bool ipc_active; - olsr_bool ipc_check_allowed_ip(union olsr_ip_addr *); --- 99,102 ---- Index: ipc_frontend.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/ipc_frontend.c,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** ipc_frontend.c 28 Apr 2007 20:45:06 -0000 1.31 --- ipc_frontend.c 1 Aug 2007 16:19:48 -0000 1.32 *************** *** 68,71 **** --- 68,72 ---- static int ipc_sock = -1; static int ipc_conn = -1; + static int ipc_active = OLSR_FALSE; static int From (spam-protected) Wed Aug 1 18:22:59 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Wed, 01 Aug 2007 16:22:59 +0000 Subject: [Olsr-cvs] olsrd-current/src olsr.c,1.55,1.56 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23148/src Modified Files: olsr.c Log Message: *use NULL instead of 0 for pointers Index: olsr.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/olsr.c,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** olsr.c 5 Jul 2007 22:43:47 -0000 1.55 --- olsr.c 1 Aug 2007 16:22:57 -0000 1.56 *************** *** 264,268 **** /* Set avl tree comparator */ if (olsr_cnf->ipsize == 4) { ! avl_comp_default = 0; } else { avl_comp_default = avl_comp_ipv6; --- 264,268 ---- /* Set avl tree comparator */ if (olsr_cnf->ipsize == 4) { ! avl_comp_default = NULL; } else { avl_comp_default = avl_comp_ipv6; From (spam-protected) Wed Aug 1 18:16:08 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Wed, 01 Aug 2007 16:16:08 +0000 Subject: [Olsr-cvs] olsrd-current/src plugin_loader.c,1.28,1.29 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20387/src Modified Files: plugin_loader.c Log Message: * made locally only used functions "static" Index: plugin_loader.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/plugin_loader.c,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** plugin_loader.c 26 Jul 2007 20:58:19 -0000 1.28 --- plugin_loader.c 1 Aug 2007 16:16:05 -0000 1.29 *************** *** 85,89 **** *@return negative on error */ ! int olsr_load_dl(char *libname, struct plugin_param *params) { struct olsr_plugin *plugin = olsr_malloc(sizeof(struct olsr_plugin), "Plugin entry"); --- 85,89 ---- *@return negative on error */ ! static int olsr_load_dl(char *libname, struct plugin_param *params) { struct olsr_plugin *plugin = olsr_malloc(sizeof(struct olsr_plugin), "Plugin entry"); *************** *** 238,242 **** *@return -1 if there was an error */ ! int init_olsr_plugin(struct olsr_plugin *entry) { int rv = 0; --- 238,242 ---- *@return -1 if there was an error */ ! static int init_olsr_plugin(struct olsr_plugin *entry) { int rv = 0; From (spam-protected) Thu Aug 2 12:20:27 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Thu, 02 Aug 2007 10:20:27 +0000 Subject: [Olsr-cvs] olsrd-current/src/olsr_switch main.c, 1.27, 1.28 olsr_host_switch.h, 1.9, 1.10 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src/olsr_switch In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21043/src/olsr_switch Modified Files: main.c olsr_host_switch.h Log Message: * const'ify function Index: olsr_host_switch.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/olsr_switch/olsr_host_switch.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** olsr_host_switch.h 28 Jul 2007 12:53:15 -0000 1.9 --- olsr_host_switch.h 2 Aug 2007 10:20:25 -0000 1.10 *************** *** 102,107 **** #endif ! char * ! olsr_ip_to_string(union olsr_ip_addr *); struct ohs_connection * --- 102,107 ---- #endif ! const char * ! olsr_ip_to_string(const union olsr_ip_addr *); struct ohs_connection * Index: main.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/olsr_switch/main.c,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** main.c 1 Aug 2007 16:28:30 -0000 1.27 --- main.c 2 Aug 2007 10:20:25 -0000 1.28 *************** *** 97,106 **** ohs_listen_loop(void); ! char * ! olsr_ip_to_string(union olsr_ip_addr *addr) { static int index = 0; static char buff[4][100]; ! char *ret; struct in_addr in; --- 97,106 ---- ohs_listen_loop(void); ! const char * ! olsr_ip_to_string(const union olsr_ip_addr *addr) { static int index = 0; static char buff[4][100]; ! const char *ret; struct in_addr in; From (spam-protected) Thu Aug 2 13:56:55 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Thu, 02 Aug 2007 11:56:55 +0000 Subject: [Olsr-cvs] olsrd-current/src/cfgparser Makefile,1.27,1.28 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src/cfgparser In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24597/src/cfgparser Modified Files: Makefile Log Message: * fixed build errors on Debian/HPPA and Debian/Alpha - patch against 0.4.10 was from Julien Cristau , now rediscovered by Holger Levsen Index: Makefile =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/cfgparser/Makefile,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** Makefile 26 Jul 2007 17:34:54 -0000 1.27 --- Makefile 2 Aug 2007 11:56:53 -0000 1.28 *************** *** 56,60 **** LIBNAME ?= olsrd_cfgparser.so.0.1 BINNAME ?= olsrd_cfgparser ! endif --- 56,60 ---- LIBNAME ?= olsrd_cfgparser.so.0.1 BINNAME ?= olsrd_cfgparser ! CFLAGS += -fPIC endif *************** *** 72,76 **** LDFLAGS += -dynamiclib -single_module else ! LDFLAGS += -shared -Wl,-soname,$(LIBNAME) endif --- 72,76 ---- LDFLAGS += -dynamiclib -single_module else ! LDFLAGS += -fPIC -shared -Wl,-soname,$(LIBNAME) endif From (spam-protected) Thu Aug 2 14:19:59 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Thu, 02 Aug 2007 12:19:59 +0000 Subject: [Olsr-cvs] olsrd-current CHANGELOG,1.68,1.69 Message-ID: Update of /cvsroot/olsrd/olsrd-current In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv1726 Modified Files: CHANGELOG Log Message: * fixed build errors on Debian/HPPA and Debian/Alpha - patch against 0.4.10 was from Julien Cristau , now rediscovered by Holger Levsen Index: CHANGELOG =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/CHANGELOG,v retrieving revision 1.68 retrieving revision 1.69 diff -C2 -d -r1.68 -r1.69 *** CHANGELOG 31 Jul 2007 12:02:18 -0000 1.68 --- CHANGELOG 2 Aug 2007 12:19:57 -0000 1.69 *************** *** 21,27 **** --- 21,32 ---- if nothing (as seen by the real C compiler, i.e. the C preprocessor) has changed. + BUILD FIX + Linux/Alpha and Linux/HPPA need "-fPIC" also for the cfgparser library. This was + fixed for Debian packages for 0.4.10 but apparetnly didn't make it into the CVS. + CLEANUPS - olsr_switch does no longer generate warnings - olsr_switch is also built with "build_all" and cleaned with "uberclean" + - More "const" all over the place. 0.5.2 --------------------------------------------------------------------- From (spam-protected) Thu Aug 2 14:24:40 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Thu, 02 Aug 2007 12:24:40 +0000 Subject: [Olsr-cvs] olsrd-current/src scheduler.c,1.40,1.41 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3745/src Modified Files: scheduler.c Log Message: * killed an unnecessary static variable Index: scheduler.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/scheduler.c,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** scheduler.c 17 Jul 2007 09:28:15 -0000 1.40 --- scheduler.c 2 Aug 2007 12:24:37 -0000 1.41 *************** *** 63,68 **** struct tm *nowtm; /* current idea of time (in tm) */ - static float pollrate; - /* Lists */ static struct timeout_entry *timeout_functions; --- 63,66 ---- *************** *** 127,137 **** olsr_register_scheduler_event(trigger_dijkstra, NULL, olsr_cnf->lq_dinter, 0, NULL); ! pollrate = olsr_cnf->pollrate; ! interval_usec = (olsr_u32_t)(pollrate * 1000000); interval.tv_sec = interval_usec / 1000000; interval.tv_usec = interval_usec % 1000000; ! OLSR_PRINTF(1, "Scheduler started - polling every %0.2f seconds\n", pollrate); OLSR_PRINTF(3, "Max jitter is %f\n\n", olsr_cnf->max_jitter); --- 125,134 ---- olsr_register_scheduler_event(trigger_dijkstra, NULL, olsr_cnf->lq_dinter, 0, NULL); ! interval_usec = (olsr_u32_t)(olsr_cnf->pollrate * 1000000); interval.tv_sec = interval_usec / 1000000; interval.tv_usec = interval_usec % 1000000; ! OLSR_PRINTF(1, "Scheduler started - polling every %0.2f seconds\n", olsr_cnf->pollrate); OLSR_PRINTF(3, "Max jitter is %f\n\n", olsr_cnf->max_jitter); *************** *** 182,186 **** while(entry) { ! entry->since_last += pollrate; /* Timed out */ --- 179,183 ---- while(entry) { ! entry->since_last += olsr_cnf->pollrate; /* Timed out */ From (spam-protected) Thu Aug 2 14:31:40 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Thu, 02 Aug 2007 12:31:40 +0000 Subject: [Olsr-cvs] olsrd-current Makefile.inc,1.22,1.23 Message-ID: Update of /cvsroot/olsrd/olsrd-current In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6566 Modified Files: Makefile.inc Log Message: * do not generate dependencies before cleaning as we delete them right away again Index: Makefile.inc =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/Makefile.inc,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** Makefile.inc 28 Jul 2007 13:40:19 -0000 1.22 --- Makefile.inc 2 Aug 2007 12:31:38 -0000 1.23 *************** *** 141,146 **** --- 141,148 ---- @echo + ifeq ($(filter clean% %clean, $(MAKECMDGOALS)),) # include dependencies -include $(SRCS:%.c=%.d) + endif # Local Variables: From (spam-protected) Thu Aug 2 14:34:55 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Thu, 02 Aug 2007 12:34:55 +0000 Subject: [Olsr-cvs] olsrd-current CHANGELOG,1.69,1.70 Message-ID: Update of /cvsroot/olsrd/olsrd-current In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv7740 Modified Files: CHANGELOG Log Message: * more info Index: CHANGELOG =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/CHANGELOG,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** CHANGELOG 2 Aug 2007 12:19:57 -0000 1.69 --- CHANGELOG 2 Aug 2007 12:34:53 -0000 1.70 *************** *** 29,32 **** --- 29,34 ---- - olsr_switch is also built with "build_all" and cleaned with "uberclean" - More "const" all over the place. + - More "static" for local functions and variables. + - Killed an unnecessary "static" variable. 0.5.2 --------------------------------------------------------------------- From (spam-protected) Thu Aug 2 16:37:11 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Thu, 02 Aug 2007 14:37:11 +0000 Subject: [Olsr-cvs] olsrd-current/lib/secure/src olsrd_secure.c,1.26,1.27 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/secure/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23765/lib/secure/src Modified Files: olsrd_secure.c Log Message: * also use on the function definition "static" Index: olsrd_secure.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/secure/src/olsrd_secure.c,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** olsrd_secure.c 15 Jul 2007 21:47:17 -0000 1.26 --- olsrd_secure.c 2 Aug 2007 14:37:09 -0000 1.27 *************** *** 258,262 **** /* XXX - ToDo */ ! int ifchange(struct interface *ifn, int action) { --- 258,262 ---- /* XXX - ToDo */ ! static int ifchange(struct interface *ifn, int action) { *************** *** 291,295 **** ! void packet_parser(int fd) { --- 291,295 ---- ! static void packet_parser(int fd) { *************** *** 408,412 **** * */ ! int check_auth(char *pck, int *size __attribute__((unused))) { --- 408,412 ---- * */ ! static int check_auth(char *pck, int *size __attribute__((unused))) { *************** *** 1167,1171 **** * */ ! int send_rres(union olsr_ip_addr *to, union olsr_ip_addr *from, olsr_u32_t chal_in) { --- 1167,1171 ---- * */ ! static int send_rres(union olsr_ip_addr *to, union olsr_ip_addr *from, olsr_u32_t chal_in) { *************** *** 1237,1241 **** ! struct stamp * lookup_timestamp_entry(union olsr_ip_addr *adr) { --- 1237,1241 ---- ! static struct stamp * lookup_timestamp_entry(union olsr_ip_addr *adr) { *************** *** 1307,1311 **** ! int read_key_from_file(char *file) { --- 1307,1311 ---- ! static int read_key_from_file(char *file) { From (spam-protected) Thu Aug 2 16:38:36 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Thu, 02 Aug 2007 14:38:36 +0000 Subject: [Olsr-cvs] olsrd-current/lib/pgraph/src olsrd_pgraph.c,1.5,1.6 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/pgraph/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24183/lib/pgraph/src Modified Files: olsrd_pgraph.c Log Message: * also use on the function definition "static" Index: olsrd_pgraph.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/pgraph/src/olsrd_pgraph.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** olsrd_pgraph.c 28 Apr 2007 20:48:57 -0000 1.5 --- olsrd_pgraph.c 2 Aug 2007 14:38:34 -0000 1.6 *************** *** 148,152 **** } ! int plugin_ipc_init(void) { --- 148,152 ---- } ! static int plugin_ipc_init(void) { *************** *** 402,406 **** ! int ipc_send(const char *data, int size) { --- 402,406 ---- ! static int ipc_send(const char *data, int size) { From (spam-protected) Thu Aug 2 16:47:28 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Thu, 02 Aug 2007 14:47:28 +0000 Subject: [Olsr-cvs] olsrd-current/src hashing.h, 1.9, 1.10 hashing.c, 1.14, 1.15 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27858/src Modified Files: hashing.h hashing.c Log Message: * const-ified parameters Index: hashing.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/hashing.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** hashing.c 10 Jul 2007 08:42:28 -0000 1.14 --- hashing.c 2 Aug 2007 14:47:26 -0000 1.15 *************** *** 50,54 **** * @return the hash(a value in the 0-31 range) */ ! olsr_u32_t olsr_hashing(union olsr_ip_addr *address) { olsr_u32_t hash; --- 50,54 ---- * @return the hash(a value in the 0-31 range) */ ! olsr_u32_t olsr_hashing(const union olsr_ip_addr * address) { olsr_u32_t hash; Index: hashing.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/hashing.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** hashing.h 31 Jan 2007 12:36:50 -0000 1.9 --- hashing.h 2 Aug 2007 14:47:26 -0000 1.10 *************** *** 50,54 **** olsr_u32_t ! olsr_hashing(union olsr_ip_addr *); --- 50,54 ---- olsr_u32_t ! olsr_hashing(const union olsr_ip_addr *); From (spam-protected) Thu Aug 2 17:51:56 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Thu, 02 Aug 2007 15:51:56 +0000 Subject: [Olsr-cvs] olsrd-current/make Makefile.linux,1.12,1.13 Message-ID: Update of /cvsroot/olsrd/olsrd-current/make In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21194/make Modified Files: Makefile.linux Log Message: * added "parisc64" to the list of architectures which want -fPIC and condensed it a little bit Index: Makefile.linux =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/make/Makefile.linux,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Makefile.linux 26 Jul 2007 17:34:54 -0000 1.12 --- Makefile.linux 2 Aug 2007 15:51:54 -0000 1.13 *************** *** 20,27 **** GENERATE_PIC = true endif ! ifeq ($(ARCH),x86_64) ! GENERATE_PIC = true ! endif ! ifeq ($(ARCH),alpha) GENERATE_PIC = true endif --- 20,24 ---- GENERATE_PIC = true endif ! ifeq ($(filter-out alpha x86_64 parisc64, $(ARCH)),) GENERATE_PIC = true endif From (spam-protected) Thu Aug 2 18:26:57 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Thu, 02 Aug 2007 16:26:57 +0000 Subject: [Olsr-cvs] olsrd-current/make Makefile.linux,1.13,1.14 Message-ID: Update of /cvsroot/olsrd/olsrd-current/make In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv1061/make Modified Files: Makefile.linux Log Message: * added "ia64" to the list of architectures which want -fPIC Index: Makefile.linux =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/make/Makefile.linux,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Makefile.linux 2 Aug 2007 15:51:54 -0000 1.13 --- Makefile.linux 2 Aug 2007 16:26:55 -0000 1.14 *************** *** 20,24 **** GENERATE_PIC = true endif ! ifeq ($(filter-out alpha x86_64 parisc64, $(ARCH)),) GENERATE_PIC = true endif --- 20,24 ---- GENERATE_PIC = true endif ! ifeq ($(filter-out alpha x86_64 parisc64 ia64, $(ARCH)),) GENERATE_PIC = true endif From (spam-protected) Thu Aug 2 21:59:17 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Thu, 02 Aug 2007 19:59:17 +0000 Subject: [Olsr-cvs] olsrd-current CHANGELOG,1.70,1.71 Message-ID: Update of /cvsroot/olsrd/olsrd-current In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19604 Modified Files: CHANGELOG Log Message: * fixed -fPIC breakage Index: CHANGELOG =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/CHANGELOG,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -d -r1.70 -r1.71 *** CHANGELOG 2 Aug 2007 12:34:53 -0000 1.70 --- CHANGELOG 2 Aug 2007 19:59:15 -0000 1.71 *************** *** 22,27 **** BUILD FIX ! Linux/Alpha and Linux/HPPA need "-fPIC" also for the cfgparser library. This was ! fixed for Debian packages for 0.4.10 but apparetnly didn't make it into the CVS. CLEANUPS --- 22,26 ---- BUILD FIX ! Linux/IA64 and Linux/HPPA also need "-fPIC". CLEANUPS From (spam-protected) Thu Aug 2 21:59:17 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Thu, 02 Aug 2007 19:59:17 +0000 Subject: [Olsr-cvs] olsrd-current/src/cfgparser Makefile,1.28,1.29 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src/cfgparser In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19604/src/cfgparser Modified Files: Makefile Log Message: * fixed -fPIC breakage Index: Makefile =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/cfgparser/Makefile,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** Makefile 2 Aug 2007 11:56:53 -0000 1.28 --- Makefile 2 Aug 2007 19:59:15 -0000 1.29 *************** *** 56,60 **** LIBNAME ?= olsrd_cfgparser.so.0.1 BINNAME ?= olsrd_cfgparser - CFLAGS += -fPIC endif --- 56,59 ---- *************** *** 72,76 **** LDFLAGS += -dynamiclib -single_module else ! LDFLAGS += -fPIC -shared -Wl,-soname,$(LIBNAME) endif --- 71,75 ---- LDFLAGS += -dynamiclib -single_module else ! LDFLAGS += -shared -Wl,-soname,$(LIBNAME) endif From (spam-protected) Thu Aug 2 22:02:58 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Thu, 02 Aug 2007 20:02:58 +0000 Subject: [Olsr-cvs] olsrd-current README,1.20,1.21 Message-ID: Update of /cvsroot/olsrd/olsrd-current In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20857 Modified Files: README Log Message: * new version and a little more blurb Index: README =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/README,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** README 17 Jul 2007 11:06:28 -0000 1.20 --- README 2 Aug 2007 20:02:56 -0000 1.21 *************** *** 1,5 **** +====================================================================+ ! | README - olsr.org OLSR daemon 0.5.2, 17.07.2007 | +====================================================================+ --- 1,5 ---- +====================================================================+ ! | README - olsr.org OLSR daemon 0.5.3, 02.08.2007 | +====================================================================+ *************** *** 83,87 **** =========== ! Olsrd supports dynamic loading of plugins(dynamically loaded libraries) for functions like generation and processing of private package types, setting olsrd configurations in run-time and much more. This design is chosen for --- 83,87 ---- =========== ! Olsrd supports dynamic loading of plugins (dynamically loaded libraries) for functions like generation and processing of private package types, setting olsrd configurations in run-time and much more. This design is chosen for *************** *** 114,118 **** Plugins that are part of this release(can be found in the lib/ directory): ! - Tiny Application Server(TAS). - HttpInfo. This plugin implements a simple HTTP server that serves dynamic --- 114,118 ---- Plugins that are part of this release(can be found in the lib/ directory): ! - Tiny Application Server (TAS). - HttpInfo. This plugin implements a simple HTTP server that serves dynamic *************** *** 154,157 **** --- 154,158 ---- There is no synchronization concept (and thus - and for Gods sake - no code). Some plugins use threads for concurrency so this should be solved. + ATM the bmf plugin is the only one using threads. =============== *************** *** 159,163 **** =============== ! Future work concentrates on reduction of ressource (ab)use nad to make it more scalable. Of course additional useful plugins are always appreciated. --- 160,164 ---- =============== ! Future work concentrates on reduction of ressource (ab)use and to make it more scalable. Of course additional useful plugins are always appreciated. *************** *** 184,187 **** --- 185,199 ---- for download at olsr.org + Ports exist for all major operating systems: + - Linux + - NetBSD/OpenBSD/FreeBSD: ATM the main development occurs on Linux with + GNU tools so occasionally it needs some minor tweaks to compile + it on *BSD. Please send patches if you fix problems there. + - Win32: You need (the relevant parts of) cygwin to compile the daemon + as such. The installer and GUI needs VisualC++ though. + + 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 *************** *** 195,198 **** --- 207,211 ---- while installing requires(as root): make install + in the plugins top directory (i.e. "lib/$plugin/"). To use the plugins add them to the olsrd configuration file. From (spam-protected) Thu Aug 2 22:06:50 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Thu, 02 Aug 2007 20:06:50 +0000 Subject: [Olsr-cvs] olsrd-current CHANGELOG,1.71,1.72 Message-ID: Update of /cvsroot/olsrd/olsrd-current In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22471 Modified Files: CHANGELOG Log Message: * fixed a typo Index: CHANGELOG =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/CHANGELOG,v retrieving revision 1.71 retrieving revision 1.72 diff -C2 -d -r1.71 -r1.72 *** CHANGELOG 2 Aug 2007 19:59:15 -0000 1.71 --- CHANGELOG 2 Aug 2007 20:06:47 -0000 1.72 *************** *** 51,55 **** added the spf refactoring patch from Hannes Gredler whicht saves ! a noteworthy amount of CPU time. To quite him: ---- snip ---- 1. use of an AVL tree as a min-heap implementation --- 51,55 ---- added the spf refactoring patch from Hannes Gredler whicht saves ! a noteworthy amount of CPU time. To quote him: ---- snip ---- 1. use of an AVL tree as a min-heap implementation From (spam-protected) Thu Aug 2 22:18:26 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Thu, 02 Aug 2007 20:18:26 +0000 Subject: [Olsr-cvs] olsrd-current/lib/txtinfo .cvsignore,1.1,1.2 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/txtinfo In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27301/lib/txtinfo Modified Files: .cvsignore Log Message: * ignore a ganerated file Index: .cvsignore =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/txtinfo/.cvsignore,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** .cvsignore 31 Jan 2007 12:38:26 -0000 1.1 --- .cvsignore 2 Aug 2007 20:18:24 -0000 1.2 *************** *** 1,2 **** --- 1,3 ---- *.d olsrd_txtinfo.so.* + olsrd_txtinfo.dll From (spam-protected) Thu Aug 2 22:31:39 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Thu, 02 Aug 2007 20:31:39 +0000 Subject: [Olsr-cvs] olsrd-current/redhat olsrd.spec,1.1,1.2 Message-ID: Update of /cvsroot/olsrd/olsrd-current/redhat In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv363/redhat Modified Files: olsrd.spec Log Message: * update with .spec file from the 0.5.2-*.src.rpm and killed the lines for the patch Index: olsrd.spec =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/redhat/olsrd.spec,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** olsrd.spec 5 Feb 2007 21:09:57 -0000 1.1 --- olsrd.spec 2 Aug 2007 20:31:37 -0000 1.2 *************** *** 6,10 **** Packager: roarbr at tihlde.org Group: System Environment/Daemons ! Source: http://www.olsr.org/releases/0.4/olsrd-%{version}.tar.bz2 URL: http://www.olsr.org/ BuildRoot: %{_tmppath}/%{name}-root --- 6,10 ---- Packager: roarbr at tihlde.org Group: System Environment/Daemons ! Source: http://www.olsr.org/releases/0.5/olsrd-%{version}.tar.bz2 URL: http://www.olsr.org/ BuildRoot: %{_tmppath}/%{name}-root *************** *** 19,23 **** %prep ! %setup %{__cat} << 'EOF' > %{name}.init --- 19,24 ---- %prep ! %setup ! %{__cat} << 'EOF' > %{name}.init *************** *** 109,119 **** make %{?_smp_mflags} make %{?_smp_mflags} libs - #cd lib/dyn_gw && make %{?_smp_mflags} OS=linux - #cd ../dot_draw && make %{?_smp_mflags} OS=linux - #cd ../httpinfo && make %{?_smp_mflags} OS=linux - #cd ../nameservice && make %{?_smp_mflags} OS=linux - #cd ../powerinfo && make %{?_smp_mflags} OS=linux - #cd ../secure && make %{?_smp_mflags} OS=linux - #cd ../.. %install --- 110,113 ---- *************** *** 145,152 **** %defattr(-, root, root, 0755) %doc README CHANGELOG ! %doc lib/dyn_gw/README_DYN_GW lib/dot_draw/README_DOT_DRAW lib/httpinfo/README_HTTPINFO ! %doc lib/secure/SOLSR-README lib/pgraph/README-OLSR ! # Do not overwrite original README, should rename these files ! #%doc lib/nameservice/README lib/mini/README %config(noreplace) %{_sysconfdir}/olsrd.conf %config %{_initrddir}/olsrd --- 139,144 ---- %defattr(-, root, root, 0755) %doc README CHANGELOG ! %doc lib/*/*README* ! %config(noreplace) %{_sysconfdir}/olsrd.conf %config %{_initrddir}/olsrd *************** *** 158,165 **** %changelog ! * Mon Feb 5 2007 Bernd Petrovitsch ! - updated to CVS-HEAD: ! - s/INSTALL_PREFIX/DESTDIR/ ! - removed references to the powerinfo plugin since it is gone * Wed Jan 04 2006 Roar Bj�rgum Rotvik --- 150,162 ---- %changelog ! * Tue Jul 17 2007 Roar Bj�rgum Rotvik ! - Created spec-file for 0.5.2 ! ! * Mon Jul 09 2007 Roar Bj�rgum Rotvik ! - Created spec-file for 0.5.1 ! ! * Tue Apr 03 2007 Roar Bj�rgum Rotvik ! - Created spec-file for 0.5.0 ! - Changed from INSTALL_PREFIX to DESTDIR * Wed Jan 04 2006 Roar Bj�rgum Rotvik From (spam-protected) Thu Aug 2 22:53:22 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Thu, 02 Aug 2007 20:53:22 +0000 Subject: [Olsr-cvs] olsrd-current Makefile,1.89,1.90 Message-ID: Update of /cvsroot/olsrd/olsrd-current In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9224 Modified Files: Makefile Log Message: * set version to 0.5.3 Index: Makefile =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/Makefile,v retrieving revision 1.89 retrieving revision 1.90 diff -C2 -d -r1.89 -r1.90 *** Makefile 28 Jul 2007 12:59:38 -0000 1.89 --- Makefile 2 Aug 2007 20:53:20 -0000 1.90 *************** *** 38,42 **** # $Id$ ! VERS = 0.5.3pre all: --- 38,42 ---- # $Id$ ! VERS = 0.5.3 all: From (spam-protected) Thu Aug 2 22:54:03 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Thu, 02 Aug 2007 20:54:03 +0000 Subject: [Olsr-cvs] olsrd-current Makefile,1.90,1.91 Message-ID: Update of /cvsroot/olsrd/olsrd-current In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9259 Modified Files: Makefile Log Message: * set version to 0.5.4.pre Index: Makefile =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/Makefile,v retrieving revision 1.90 retrieving revision 1.91 diff -C2 -d -r1.90 -r1.91 *** Makefile 2 Aug 2007 20:53:20 -0000 1.90 --- Makefile 2 Aug 2007 20:54:01 -0000 1.91 *************** *** 38,42 **** # $Id$ ! VERS = 0.5.3 all: --- 38,42 ---- # $Id$ ! VERS = 0.5.4pre all: From (spam-protected) Thu Aug 2 22:57:23 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Thu, 02 Aug 2007 20:57:23 +0000 Subject: [Olsr-cvs] olsrd-current CHANGELOG,1.72,1.73 Message-ID: Update of /cvsroot/olsrd/olsrd-current In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10860 Modified Files: CHANGELOG Log Message: * fixed more typos Index: CHANGELOG =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/CHANGELOG,v retrieving revision 1.72 retrieving revision 1.73 diff -C2 -d -r1.72 -r1.73 *** CHANGELOG 2 Aug 2007 20:06:47 -0000 1.72 --- CHANGELOG 2 Aug 2007 20:57:21 -0000 1.73 *************** *** 18,23 **** dependen on the Makefile in the current directory and the Makefile.inc so that changes there also lead to new compilation. ! Remeber: We support "ccache" so install it to save lot of meaningkless recompiles ! if nothing (as seen by the real C compiler, i.e. the C preprocessor) has changed. BUILD FIX --- 18,24 ---- dependen on the Makefile in the current directory and the Makefile.inc so that changes there also lead to new compilation. ! Remember: We support "ccache" so install it to save lot of meaningless recompiles ! if nothing (as seen by the real C compiler, i.e. after the C preprocessor) has ! changed. BUILD FIX From (spam-protected) Thu Aug 2 23:42:42 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Thu, 02 Aug 2007 21:42:42 +0000 Subject: [Olsr-cvs] olsrd-current CHANGELOG,1.73,1.74 Message-ID: Update of /cvsroot/olsrd/olsrd-current In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28646 Modified Files: CHANGELOG Log Message: * start with 0.5.4 Index: CHANGELOG =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/CHANGELOG,v retrieving revision 1.73 retrieving revision 1.74 diff -C2 -d -r1.73 -r1.74 *** CHANGELOG 2 Aug 2007 20:57:21 -0000 1.73 --- CHANGELOG 2 Aug 2007 21:42:40 -0000 1.74 *************** *** 2,5 **** --- 2,7 ---- $Id$ + 0.5.4 --------------------------------------------------------------------- + 0.5.3 --------------------------------------------------------------------- *************** *** 15,19 **** DEPENDENCIES FIXED ! The dependencies (*.d files) are now properly generated and used. Nd they also dependen on the Makefile in the current directory and the Makefile.inc so that changes there also lead to new compilation. --- 17,21 ---- DEPENDENCIES FIXED ! The dependencies (*.d files) are now properly generated and used. And they also dependen on the Makefile in the current directory and the Makefile.inc so that changes there also lead to new compilation. From (spam-protected) Thu Aug 2 23:45:35 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Thu, 02 Aug 2007 21:45:35 +0000 Subject: [Olsr-cvs] olsrd-current/src defs.h,1.60,1.61 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv29799/src Modified Files: defs.h Log Message: * boilerplate parentheses in macros Index: defs.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/defs.h,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** defs.h 2 May 2007 08:06:28 -0000 1.60 --- defs.h 2 Aug 2007 21:45:33 -0000 1.61 *************** *** 108,120 **** #define QUEUE_ELEM(pre, new) do { \ ! pre.next->prev = new; \ ! new->next = pre.next; \ ! new->prev = ⪯ \ ! pre.next = new; \ } while (0) #define DEQUEUE_ELEM(elem) do { \ ! elem->prev->next = elem->next; \ ! elem->next->prev = elem->prev; \ } while (0) --- 108,120 ---- #define QUEUE_ELEM(pre, new) do { \ ! (pre).next->prev = (new); \ ! (new)->next = (pre).next; \ ! (new)->prev = &(pre); \ ! (pre).next = (new); \ } while (0) #define DEQUEUE_ELEM(elem) do { \ ! (elem)->prev->next = (elem)->next; \ ! (elem)->next->prev = (elem)->prev; \ } while (0) From (spam-protected) Thu Aug 2 23:50:24 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Thu, 02 Aug 2007 21:50:24 +0000 Subject: [Olsr-cvs] olsrd-current/src mid_set.c, 1.20, 1.21 mid_set.h, 1.14, 1.15 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30980/src Modified Files: mid_set.c mid_set.h Log Message: * const-ify parameters * pave the way to add -Wshadow * use "NULL" instead for "0" for pointers Index: mid_set.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/mid_set.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** mid_set.h 10 Feb 2007 19:27:32 -0000 1.14 --- mid_set.h 2 Aug 2007 21:50:22 -0000 1.15 *************** *** 46,49 **** --- 46,50 ---- #include "olsr_types.h" + struct mid_address { *************** *** 80,93 **** void ! insert_mid_tuple(union olsr_ip_addr *, struct mid_address *, float); void ! insert_mid_alias(union olsr_ip_addr *, union olsr_ip_addr *, float); union olsr_ip_addr * ! mid_lookup_main_addr(union olsr_ip_addr *); struct mid_address * ! mid_lookup_aliases(union olsr_ip_addr *); void --- 81,94 ---- void ! insert_mid_tuple(const union olsr_ip_addr *, struct mid_address *, float); void ! insert_mid_alias(const union olsr_ip_addr *, const union olsr_ip_addr *, float); union olsr_ip_addr * ! mid_lookup_main_addr(const union olsr_ip_addr *); struct mid_address * ! mid_lookup_aliases(const union olsr_ip_addr *); void *************** *** 98,105 **** void ! olsr_prune_aliases(union olsr_ip_addr *m_addr, struct mid_alias *declared_aliases); int ! olsr_update_mid_table(union olsr_ip_addr *, float); int --- 99,106 ---- void ! olsr_prune_aliases(const union olsr_ip_addr *m_addr, struct mid_alias *declared_aliases); int ! olsr_update_mid_table(const union olsr_ip_addr *, float); int Index: mid_set.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/mid_set.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** mid_set.c 25 Apr 2007 22:08:09 -0000 1.20 --- mid_set.c 2 Aug 2007 21:50:22 -0000 1.21 *************** *** 53,57 **** struct mid_address reverse_mid_set[HASHSIZE]; ! struct mid_entry *mid_lookup_entry_bymain(union olsr_ip_addr *adr); /** --- 53,57 ---- struct mid_address reverse_mid_set[HASHSIZE]; ! struct mid_entry *mid_lookup_entry_bymain(const union olsr_ip_addr *adr); /** *************** *** 63,67 **** olsr_init_mid_set(void) { ! int index; OLSR_PRINTF(5, "MID: init\n"); --- 63,67 ---- olsr_init_mid_set(void) { ! int idx; OLSR_PRINTF(5, "MID: init\n"); *************** *** 72,82 **** olsr_register_scheduler_event(&olsr_time_out_mid_set, NULL, 1, 0, NULL); ! for(index=0;indexass_timer = GET_TIMESTAMP(vtime*1000); } - /*Create new node*/ else { tmp = olsr_malloc(sizeof(struct mid_entry), "MID new alias"); --- 134,140 ---- tmp->ass_timer = GET_TIMESTAMP(vtime*1000); } else { + /*Create new node*/ tmp = olsr_malloc(sizeof(struct mid_entry), "MID new alias"); *************** *** 213,217 **** */ void ! insert_mid_alias(union olsr_ip_addr *main_add, union olsr_ip_addr *alias, float vtime) { struct mid_address *adr; --- 213,217 ---- */ void ! insert_mid_alias(const union olsr_ip_addr *main_add, const union olsr_ip_addr *alias, float vtime) { struct mid_address *adr; *************** *** 261,267 **** } - - - /** *Lookup the main address for a alias address --- 261,264 ---- *************** *** 273,277 **** */ union olsr_ip_addr * ! mid_lookup_main_addr(union olsr_ip_addr *adr) { olsr_u32_t hash; --- 270,274 ---- */ union olsr_ip_addr * ! mid_lookup_main_addr(const union olsr_ip_addr *adr) { olsr_u32_t hash; *************** *** 291,295 **** } - /* Find mid entry to an address. * @param adr the main address to search for --- 288,291 ---- *************** *** 298,302 **** */ struct mid_entry * ! mid_lookup_entry_bymain(union olsr_ip_addr *adr) { struct mid_entry *tmp_list; --- 294,298 ---- */ struct mid_entry * ! mid_lookup_entry_bymain(const union olsr_ip_addr *adr) { struct mid_entry *tmp_list; *************** *** 315,324 **** return tmp_list; } - - return NULL; } - /* *Find all aliases for an address. --- 311,317 ---- *************** *** 329,333 **** */ struct mid_address * ! mid_lookup_aliases(union olsr_ip_addr *adr) { struct mid_entry *tmp = mid_lookup_entry_bymain(adr); --- 322,326 ---- */ struct mid_address * ! mid_lookup_aliases(const union olsr_ip_addr *adr) { struct mid_entry *tmp = mid_lookup_entry_bymain(adr); *************** *** 344,348 **** */ int ! olsr_update_mid_table(union olsr_ip_addr *adr, float vtime) { struct mid_entry *tmp_list = mid_set; --- 337,341 ---- */ int ! olsr_update_mid_table(const union olsr_ip_addr *adr, float vtime) { struct mid_entry *tmp_list = mid_set; *************** *** 379,383 **** */ void ! olsr_prune_aliases(union olsr_ip_addr *m_addr, struct mid_alias *declared_aliases) { struct mid_entry *entry; --- 372,376 ---- */ void ! olsr_prune_aliases(const union olsr_ip_addr *m_addr, struct mid_alias *declared_aliases) { struct mid_entry *entry; *************** *** 406,410 **** previous_alias = NULL; ! while(registered_aliases != 0) { struct mid_address *current_alias = registered_aliases; --- 399,403 ---- previous_alias = NULL; ! while(registered_aliases != NULL) { struct mid_address *current_alias = registered_aliases; *************** *** 420,424 **** } ! if (declared_aliases == 0) { /* Current alias not found in list of declared aliases: free current alias */ --- 413,417 ---- } ! if (declared_aliases == NULL) { /* Current alias not found in list of declared aliases: free current alias */ *************** *** 464,475 **** olsr_time_out_mid_set(void *foo __attribute__((unused))) { ! int index; ! ! for(index=0;indextm_hour, nowtm->tm_min, nowtm->tm_sec, now.tv_usec); ! for(index=0;indexnext) { struct mid_address *tmp_addr; --- 522,534 ---- olsr_print_mid_set(void) { ! int idx; OLSR_PRINTF(1, "mid set: %02d:%02d:%02d.%06lu\n",nowtm->tm_hour, nowtm->tm_min, nowtm->tm_sec, now.tv_usec); ! for(idx=0;idxnext) { struct mid_address *tmp_addr; From (spam-protected) Thu Aug 2 23:51:42 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Thu, 02 Aug 2007 21:51:42 +0000 Subject: [Olsr-cvs] olsrd-current/src interfaces.c, 1.32, 1.33 interfaces.h, 1.40, 1.41 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32177/src Modified Files: interfaces.c interfaces.h Log Message: * const-ify parameters Index: interfaces.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/interfaces.c,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** interfaces.c 13 May 2007 22:23:55 -0000 1.32 --- interfaces.c 2 Aug 2007 21:51:40 -0000 1.33 *************** *** 227,231 **** struct interface * ! if_ifwithaddr(union olsr_ip_addr *addr) { struct interface *ifp; --- 227,231 ---- struct interface * ! if_ifwithaddr(const union olsr_ip_addr * const addr) { struct interface *ifp; Index: interfaces.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/interfaces.h,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** interfaces.h 13 May 2007 22:23:55 -0000 1.40 --- interfaces.h 2 Aug 2007 21:51:40 -0000 1.41 *************** *** 207,211 **** struct interface * ! if_ifwithaddr(union olsr_ip_addr *); struct interface * --- 207,211 ---- struct interface * ! if_ifwithaddr(const union olsr_ip_addr *); struct interface * From (spam-protected) Thu Aug 2 23:54:56 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Thu, 02 Aug 2007 21:54:56 +0000 Subject: [Olsr-cvs] olsrd-current/src routing_table.c, 1.27, 1.28 routing_table.h, 1.17, 1.18 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv884/src Modified Files: routing_table.c routing_table.h Log Message: * const-ify parameters * pave the way to add -Wshadow Index: routing_table.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/routing_table.c,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** routing_table.c 25 Apr 2007 22:08:14 -0000 1.27 --- routing_table.c 2 Aug 2007 21:54:54 -0000 1.28 *************** *** 86,90 **** olsr_init_routing_table(void) { ! int index; /* *The hna routes hash will almost always --- 86,90 ---- olsr_init_routing_table(void) { ! int idx; /* *The hna routes hash will almost always *************** *** 94,103 **** *routing table */ ! for(index=0;indexrt_dst, dst); --- 193,204 ---- struct rt_entry * olsr_insert_routing_table(union olsr_ip_addr *dst, ! const union olsr_ip_addr *router, struct interface *iface, int metric, float etx) { ! const olsr_u32_t hash = olsr_hashing(dst); ! struct rt_entry *rt_list = &routingtable[hash]; ! struct rt_entry *new_route_entry = olsr_malloc(sizeof(struct rt_entry), "Insert routing table"); COPY_IP(&new_route_entry->rt_dst, dst); *************** *** 250,254 **** olsr_fill_routing_table_with_neighbors(void) { ! int index; #ifdef DEBUG --- 246,250 ---- olsr_fill_routing_table_with_neighbors(void) { ! int idx; #ifdef DEBUG *************** *** 256,264 **** #endif ! for(index=0;indexnext) { --- 252,260 ---- #endif ! for(idx=0;idxnext) { *************** *** 277,292 **** for(addrs2 = &addrs;addrs2!=NULL;addrs2 = addrs2->next_alias) { ! struct link_entry *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 = link->if_name ? if_ifwithname(link->if_name) : ! if_ifwithaddr(&link->local_iface_addr); if(iface) { olsr_insert_routing_table(&addrs2->alias, ! &link->neighbor_iface_addr, iface, 1, --- 273,288 ---- for(addrs2 = &addrs;addrs2!=NULL;addrs2 = addrs2->next_alias) { ! const struct link_entry *lnk = 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(lnk) { ! struct interface *iface = lnk->if_name ? if_ifwithname(lnk->if_name) : ! if_ifwithaddr(&lnk->local_iface_addr); if(iface) { olsr_insert_routing_table(&addrs2->alias, ! &lnk->neighbor_iface_addr, iface, 1, *************** *** 337,350 **** { struct destination_n *list_destination_n=NULL; ! int index; //printf("FILL ROUTING TABLE WITH TWO HOP NEIGHBORS\n"); ! for(index=0;indexnext) { --- 333,346 ---- { struct destination_n *list_destination_n=NULL; ! int idx; //printf("FILL ROUTING TABLE WITH TWO HOP NEIGHBORS\n"); ! for(idx=0;idxnext) { *************** *** 387,403 **** for(addrsp = &addrs; addrsp; addrsp = addrsp->next_alias) { ! struct link_entry *link = get_best_link_to_neighbor(&neighbor->neighbor_main_addr); #ifdef DEBUG OLSR_PRINTF(7, "(ROUTE)Adding neighbor %s\n", olsr_ip_to_string(&addrsp->alias)); #endif ! if(link) { ! struct interface *iface = link->if_name ? if_ifwithname(link->if_name) : ! if_ifwithaddr(&link->local_iface_addr); if(iface) { struct rt_entry *new_route_entry = olsr_insert_routing_table(&addrsp->alias, ! &link->neighbor_iface_addr, iface, 2, --- 383,399 ---- for(addrsp = &addrs; addrsp; addrsp = addrsp->next_alias) { ! const struct link_entry * const lnk = get_best_link_to_neighbor(&neighbor->neighbor_main_addr); #ifdef DEBUG OLSR_PRINTF(7, "(ROUTE)Adding neighbor %s\n", olsr_ip_to_string(&addrsp->alias)); #endif ! if(lnk) { ! struct interface *iface = lnk->if_name ? if_ifwithname(lnk->if_name) : ! if_ifwithaddr(&lnk->local_iface_addr); if(iface) { struct rt_entry *new_route_entry = olsr_insert_routing_table(&addrsp->alias, ! &lnk->neighbor_iface_addr, iface, 2, *************** *** 551,562 **** olsr_check_for_higher_quality(struct rt_entry *routes, struct hna_net *net, float etx) { ! int index; ! for(index=0;indexnext) { --- 547,558 ---- olsr_check_for_higher_quality(struct rt_entry *routes, struct hna_net *net, float etx) { ! int idx; ! for(idx=0;idxnext) { *************** *** 591,602 **** olsr_check_for_lower_quality(struct rt_entry *routes, struct hna_net *net, float etx) { ! int index; ! for(index=0;indexnext) { --- 587,598 ---- olsr_check_for_lower_quality(struct rt_entry *routes, struct hna_net *net, float etx) { ! int idx; ! for(idx=0;idxnext) { *************** *** 628,632 **** olsr_calculate_hna_routes(void) { ! int index; #ifdef DEBUG --- 624,628 ---- olsr_calculate_hna_routes(void) { ! int idx; #ifdef DEBUG *************** *** 636,645 **** olsr_move_route_table(hna_routes, old_hna); ! for(index=0;indexnext) { --- 632,641 ---- olsr_move_route_table(hna_routes, old_hna); ! for(idx=0;idxnext) { *************** *** 736,748 **** olsr_print_routing_table(struct rt_entry *table) { ! int index; printf("ROUTING TABLE\n"); printf("DESTINATION\tNEXT HOP\tHOPCNT\tINTERFACE\n"); ! for(index = 0; index < HASHSIZE; index++) { struct rt_entry *destination; ! for(destination = table[index].next; ! destination != &table[index]; destination = destination->next) { --- 732,744 ---- olsr_print_routing_table(struct rt_entry *table) { ! int idx; printf("ROUTING TABLE\n"); printf("DESTINATION\tNEXT HOP\tHOPCNT\tINTERFACE\n"); ! for(idx = 0; idx < HASHSIZE; idx++) { struct rt_entry *destination; ! for(destination = table[idx].next; ! destination != &table[idx]; destination = destination->next) { Index: routing_table.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/routing_table.h,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** routing_table.h 16 Nov 2005 23:55:54 -0000 1.17 --- routing_table.h 2 Aug 2007 21:54:54 -0000 1.18 *************** *** 108,112 **** struct rt_entry * ! olsr_insert_routing_table(union olsr_ip_addr *, union olsr_ip_addr *, struct interface *, int, float); struct rt_entry * --- 108,112 ---- struct rt_entry * ! olsr_insert_routing_table(union olsr_ip_addr *, const union olsr_ip_addr *, struct interface *, int, float); struct rt_entry * From (spam-protected) Thu Aug 2 23:57:08 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Thu, 02 Aug 2007 21:57:08 +0000 Subject: [Olsr-cvs] olsrd-current/src neighbor_table.c, 1.32, 1.33 neighbor_table.h, 1.14, 1.15 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv1703/src Modified Files: neighbor_table.c neighbor_table.h Log Message: * const-ify parameters * pave the way to add -Wshadow Index: neighbor_table.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/neighbor_table.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** neighbor_table.h 29 May 2005 12:47:45 -0000 1.14 --- neighbor_table.h 2 Aug 2007 21:57:06 -0000 1.15 *************** *** 87,103 **** struct neighbor_2_list_entry * ! olsr_lookup_my_neighbors(struct neighbor_entry *, union olsr_ip_addr *); int ! olsr_delete_neighbor_table(union olsr_ip_addr *); struct neighbor_entry * ! olsr_insert_neighbor_table(union olsr_ip_addr *); struct neighbor_entry * ! olsr_lookup_neighbor_table(union olsr_ip_addr *); struct neighbor_entry * ! olsr_lookup_neighbor_table_alias(union olsr_ip_addr *); void --- 87,103 ---- struct neighbor_2_list_entry * ! olsr_lookup_my_neighbors(const struct neighbor_entry *, const union olsr_ip_addr *); int ! olsr_delete_neighbor_table(const union olsr_ip_addr *); struct neighbor_entry * ! olsr_insert_neighbor_table(const union olsr_ip_addr *); struct neighbor_entry * ! olsr_lookup_neighbor_table(const union olsr_ip_addr *); struct neighbor_entry * ! olsr_lookup_neighbor_table_alias(const union olsr_ip_addr *); void Index: neighbor_table.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/neighbor_table.c,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** neighbor_table.c 25 Apr 2007 22:08:09 -0000 1.32 --- neighbor_table.c 2 Aug 2007 21:57:06 -0000 1.33 *************** *** 90,95 **** while(entry != &neighbor->neighbor_2_list) ! { ! if(COMP_IP(&entry->neighbor_2->neighbor_2_addr, address)) { --- 90,94 ---- while(entry != &neighbor->neighbor_2_list) ! { if(COMP_IP(&entry->neighbor_2->neighbor_2_addr, address)) { *************** *** 118,124 **** */ struct neighbor_2_list_entry * ! olsr_lookup_my_neighbors(struct neighbor_entry *neighbor, union olsr_ip_addr *neighbor_main_address) { - struct neighbor_2_list_entry *entry; --- 117,122 ---- */ struct neighbor_2_list_entry * ! olsr_lookup_my_neighbors(const struct neighbor_entry *neighbor, const union olsr_ip_addr *neighbor_main_address) { struct neighbor_2_list_entry *entry; *************** *** 148,152 **** int ! olsr_delete_neighbor_table(union olsr_ip_addr *neighbor_addr) { struct neighbor_2_list_entry *two_hop_list, *two_hop_to_delete; --- 146,150 ---- int ! olsr_delete_neighbor_table(const union olsr_ip_addr *neighbor_addr) { struct neighbor_2_list_entry *two_hop_list, *two_hop_to_delete; *************** *** 179,185 **** while(two_hop_list != &entry->neighbor_2_list) { ! struct neighbor_2_entry *two_hop_entry; ! ! two_hop_entry = two_hop_list->neighbor_2; two_hop_entry->neighbor_2_pointer--; --- 177,181 ---- while(two_hop_list != &entry->neighbor_2_list) { ! struct neighbor_2_entry *two_hop_entry = two_hop_list->neighbor_2; two_hop_entry->neighbor_2_pointer--; *************** *** 224,228 **** */ struct neighbor_entry * ! olsr_insert_neighbor_table(union olsr_ip_addr *main_addr) { olsr_u32_t hash; --- 220,224 ---- */ struct neighbor_entry * ! olsr_insert_neighbor_table(const union olsr_ip_addr *main_addr) { olsr_u32_t hash; *************** *** 274,306 **** */ struct neighbor_entry * ! olsr_lookup_neighbor_table(union olsr_ip_addr *dst) { - struct neighbor_entry *entry; - olsr_u32_t hash; - union olsr_ip_addr *tmp_ip; - /* *Find main address of node */ ! if((tmp_ip = mid_lookup_main_addr(dst)) != NULL) dst = tmp_ip; ! ! hash = olsr_hashing(dst); ! ! ! //printf("\nLookup %s\n", olsr_ip_to_string(dst)); ! for(entry = neighbortable[hash].next; ! entry != &neighbortable[hash]; ! entry = entry->next) ! { ! //printf("Checking %s\n", olsr_ip_to_string(&neighbor_table_tmp->neighbor_main_addr)); ! if(COMP_IP(&entry->neighbor_main_addr, dst)) ! return entry; ! ! } ! //printf("NOPE\n\n"); ! ! return NULL; ! } --- 270,282 ---- */ struct neighbor_entry * ! olsr_lookup_neighbor_table(const union olsr_ip_addr *dst) { /* *Find main address of node */ ! union olsr_ip_addr *tmp_ip = mid_lookup_main_addr(dst); ! if(tmp_ip != NULL) dst = tmp_ip; ! return olsr_lookup_neighbor_table_alias(dst); } *************** *** 315,325 **** */ struct neighbor_entry * ! olsr_lookup_neighbor_table_alias(union olsr_ip_addr *dst) { struct neighbor_entry *entry; ! olsr_u32_t hash; ! ! hash = olsr_hashing(dst); ! //printf("\nLookup %s\n", olsr_ip_to_string(dst)); --- 291,298 ---- */ struct neighbor_entry * ! olsr_lookup_neighbor_table_alias(const union olsr_ip_addr *dst) { struct neighbor_entry *entry; ! olsr_u32_t hash = olsr_hashing(dst); //printf("\nLookup %s\n", olsr_ip_to_string(dst)); *************** *** 342,346 **** int ! update_neighbor_status(struct neighbor_entry *entry, int link) { /* --- 315,319 ---- int ! update_neighbor_status(struct neighbor_entry *entry, int lnk) { /* *************** *** 348,352 **** */ ! if(link == SYM_LINK) { /* N_status is set to SYM */ --- 321,325 ---- */ ! if(lnk == SYM_LINK) { /* N_status is set to SYM */ *************** *** 398,404 **** olsr_time_out_two_hop_neighbors(struct neighbor_entry *neighbor) { ! struct neighbor_2_list_entry *two_hop_list; ! ! two_hop_list = neighbor->neighbor_2_list.next; while(two_hop_list != &neighbor->neighbor_2_list) --- 371,375 ---- olsr_time_out_two_hop_neighbors(struct neighbor_entry *neighbor) { ! struct neighbor_2_list_entry *two_hop_list = neighbor->neighbor_2_list.next; while(two_hop_list != &neighbor->neighbor_2_list) *************** *** 415,419 **** { DEQUEUE_ELEM(two_hop_entry); ! free((void *)two_hop_entry); } --- 386,390 ---- { DEQUEUE_ELEM(two_hop_entry); ! free(two_hop_entry); } *************** *** 440,449 **** olsr_time_out_neighborhood_tables(void) { ! olsr_u8_t index; ! for(index=0;indexnext) { olsr_time_out_two_hop_neighbors(entry); --- 411,420 ---- olsr_time_out_neighborhood_tables(void) { ! int idx; ! for(idx=0;idxnext) { olsr_time_out_two_hop_neighbors(entry); *************** *** 486,494 **** for(neigh = neighbortable[i].next; neigh != &neighbortable[i]; neigh = neigh->next) { ! struct link_entry *link = get_best_link_to_neighbor(&neigh->neighbor_main_addr); ! if(link) { ! double best_lq = link->neigh_link_quality; ! double inv_best_lq = link->loss_link_quality; OLSR_PRINTF(1, fstr, olsr_ip_to_string(&neigh->neighbor_main_addr), --- 457,465 ---- for(neigh = neighbortable[i].next; neigh != &neighbortable[i]; neigh = neigh->next) { ! struct link_entry *lnk = get_best_link_to_neighbor(&neigh->neighbor_main_addr); ! if(lnk) { ! const double best_lq = lnk->neigh_link_quality; ! const double inv_best_lq = lnk->loss_link_quality; OLSR_PRINTF(1, fstr, olsr_ip_to_string(&neigh->neighbor_main_addr), *************** *** 502,513 **** } } - - - - - - - - - - --- 473,474 ---- From (spam-protected) Thu Aug 2 23:58:45 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Thu, 02 Aug 2007 21:58:45 +0000 Subject: [Olsr-cvs] olsrd-current/src/unix misc.c,1.5,1.6 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src/unix In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2525/src/unix Modified Files: misc.c Log Message: * pave the way to add -Wshadow * save an int in the data segment Index: misc.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/unix/misc.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** misc.c 10 Mar 2005 07:01:48 -0000 1.5 --- misc.c 2 Aug 2007 21:58:43 -0000 1.6 *************** *** 48,75 **** void clear_console(void) { ! FILE *pipe; ! static int first_time = 1; static char clear_buff[100]; - static olsr_u16_t len = 0; - int c; int i; ! if (first_time != 0) { ! first_time = 0; ! ! pipe = popen("clear", "r"); ! ! for (len = 0; len < sizeof (clear_buff); len++) { ! c = fgetc(pipe); ! if (c == EOF) break; ! clear_buff[len] = (char)c; } ! pclose(pipe); } --- 48,68 ---- void clear_console(void) { ! static int len = -1; static char clear_buff[100]; int i; ! if (len < 0) { ! FILE *pip = popen("clear", "r"); ! for (len = 0; len < (int)sizeof(clear_buff); len++) { ! int c = fgetc(pip); if (c == EOF) break; ! clear_buff[len] = c; } ! pclose(pip); } From (spam-protected) Fri Aug 3 00:00:01 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Thu, 02 Aug 2007 22:00:01 +0000 Subject: [Olsr-cvs] olsrd-current/src hashing.c,1.15,1.16 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3000/src Modified Files: hashing.c Log Message: * fixed a bad cast Index: hashing.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/hashing.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** hashing.c 2 Aug 2007 14:47:26 -0000 1.15 --- hashing.c 2 Aug 2007 21:59:59 -0000 1.16 *************** *** 59,63 **** } else { /* IPv6 */ ! const char * const tmp = (char *)&address->v6; hash = ntohl(*tmp); } --- 59,63 ---- } else { /* IPv6 */ ! const char * const tmp = (const char *)&address->v6; hash = ntohl(*tmp); } From (spam-protected) Fri Aug 3 00:00:48 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Thu, 02 Aug 2007 22:00:48 +0000 Subject: [Olsr-cvs] olsrd-current/src lq_avl.c,1.10,1.11 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3453/src Modified Files: lq_avl.c Log Message: * use NULL instead for 0 for pointers Index: lq_avl.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/lq_avl.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** lq_avl.c 5 Jul 2007 22:43:46 -0000 1.10 --- lq_avl.c 2 Aug 2007 22:00:46 -0000 1.11 *************** *** 54,58 **** * set to zero for a fast inline ipv4 comparison */ ! int (*avl_comp_default)(void *, void *) = 0; int avl_comp_ipv4(void *ip1, void *ip2) --- 54,58 ---- * set to zero for a fast inline ipv4 comparison */ ! int (*avl_comp_default)(void *, void *) = NULL; int avl_comp_ipv4(void *ip1, void *ip2) From (spam-protected) Fri Aug 3 00:07:21 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Thu, 02 Aug 2007 22:07:21 +0000 Subject: [Olsr-cvs] olsrd-current/src two_hop_neighbor_table.c, 1.18, 1.19 process_package.c, 1.40, 1.41 tc_set.c, 1.26, 1.27 process_routes.c, 1.33, 1.34 packet.c, 1.22, 1.23 net_olsr.c, 1.24, 1.25 lq_mpr.c, 1.12, 1.13 link_set.c, 1.68, 1.69 lq_route.c, 1.47, 1.48 lq_packet.c, 1.23, 1.24 ipc_frontend.c, 1.32, 1.33 hysteresis.c, 1.20, 1.21 hna_set.c, 1.19, 1.20 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6557/src Modified Files: two_hop_neighbor_table.c process_package.c tc_set.c process_routes.c packet.c net_olsr.c lq_mpr.c link_set.c lq_route.c lq_packet.c ipc_frontend.c hysteresis.c hna_set.c Log Message: * pave the way to add -Wshadow Index: lq_route.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/lq_route.c,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** lq_route.c 5 Jul 2007 22:43:46 -0000 1.47 --- lq_route.c 2 Aug 2007 22:07:19 -0000 1.48 *************** *** 434,438 **** struct topo_dst *tcdst; struct olsr_spf_vertex *vert, *myself; - struct link_entry *link; struct neighbor_entry *neigh; struct mid_address *mid_walker; --- 434,437 ---- *************** *** 526,538 **** if (neigh->status == SYM) { ! link = get_best_link_to_neighbor(&neigh->neighbor_main_addr); ! if(!link) continue; ! if (link->loss_link_quality2 >= MIN_LINK_QUALITY && ! link->neigh_link_quality2 >= MIN_LINK_QUALITY) { ! etx = 1.0 / (link->loss_link_quality2 * link->neigh_link_quality2); olsr_spf_add_edge(&vertex_tree, &neigh->neighbor_main_addr, &olsr_cnf->main_addr, etx); --- 525,537 ---- if (neigh->status == SYM) { ! struct link_entry *lnk = get_best_link_to_neighbor(&neigh->neighbor_main_addr); ! if(!lnk) continue; ! if (lnk->loss_link_quality2 >= MIN_LINK_QUALITY && ! lnk->neigh_link_quality2 >= MIN_LINK_QUALITY) { ! etx = 1.0 / (lnk->loss_link_quality2 * lnk->neigh_link_quality2); olsr_spf_add_edge(&vertex_tree, &neigh->neighbor_main_addr, &olsr_cnf->main_addr, etx); *************** *** 607,611 **** tree_node != NULL; tree_node = avl_walk_next(tree_node)) { ! vert = tree_node->data; --- 606,610 ---- tree_node != NULL; tree_node = avl_walk_next(tree_node)) { ! struct link_entry *lnk; vert = tree_node->data; *************** *** 617,621 **** // find the best link to the one-hop neighbour ! link = get_best_link_to_neighbor(vert->next_hop); // we may see NULL here, if the one-hop neighbour is not in the --- 616,620 ---- // find the best link to the one-hop neighbour ! lnk = get_best_link_to_neighbor(vert->next_hop); // we may see NULL here, if the one-hop neighbour is not in the *************** *** 623,631 **** // between us and the one-hop neighbour from the TC set ! if (link != NULL) { // find the interface for the found link ! inter = link->if_name ? if_ifwithname(link->if_name) : ! if_ifwithaddr(&link->local_iface_addr); // we may see NULL here if the interface is down, but we have --- 622,630 ---- // between us and the one-hop neighbour from the TC set ! if (lnk != NULL) { // find the interface for the found link ! inter = lnk->if_name ? if_ifwithname(lnk->if_name) : ! if_ifwithaddr(&lnk->local_iface_addr); // we may see NULL here if the interface is down, but we have *************** *** 641,645 **** if (olsr_lookup_routing_table(&vert->addr) == NULL) ! olsr_insert_routing_table(&vert->addr, &link->neighbor_iface_addr, inter, vert->hops, vert->path_etx); --- 640,644 ---- if (olsr_lookup_routing_table(&vert->addr) == NULL) ! olsr_insert_routing_table(&vert->addr, &lnk->neighbor_iface_addr, inter, vert->hops, vert->path_etx); *************** *** 651,655 **** if (olsr_lookup_routing_table(&mid_walker->alias) == NULL) olsr_insert_routing_table(&mid_walker->alias, ! &link->neighbor_iface_addr, inter, vert->hops, vert->path_etx); --- 650,654 ---- if (olsr_lookup_routing_table(&mid_walker->alias) == NULL) olsr_insert_routing_table(&mid_walker->alias, ! &lnk->neighbor_iface_addr, inter, vert->hops, vert->path_etx); *************** *** 664,670 **** // MID entry has timed out ! if (olsr_lookup_routing_table(&link->neighbor_iface_addr) == NULL) ! olsr_insert_routing_table(&link->neighbor_iface_addr, ! &link->neighbor_iface_addr, inter, 1, vert->path_etx); } --- 663,669 ---- // MID entry has timed out ! if (olsr_lookup_routing_table(&lnk->neighbor_iface_addr) == NULL) ! olsr_insert_routing_table(&lnk->neighbor_iface_addr, ! &lnk->neighbor_iface_addr, inter, 1, vert->path_etx); } Index: process_package.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/process_package.c,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** process_package.c 25 Apr 2007 22:08:13 -0000 1.40 --- process_package.c 2 Aug 2007 22:07:19 -0000 1.41 *************** *** 87,91 **** * Update link status */ ! struct link_entry *link = update_link_entry(&in_if->ip_addr, from_addr, message, in_if); if (olsr_cnf->lq_level > 0) --- 87,91 ---- * Update link status */ ! struct link_entry *lnk = update_link_entry(&in_if->ip_addr, from_addr, message, in_if); if (olsr_cnf->lq_level > 0) *************** *** 95,99 **** struct hello_neighbor *walker; // just in case our neighbor has changed its HELLO interval ! olsr_update_packet_loss_hello_int(link, message->htime); // find the input interface in the list of neighbor interfaces --- 95,99 ---- struct hello_neighbor *walker; // just in case our neighbor has changed its HELLO interval ! olsr_update_packet_loss_hello_int(lnk, message->htime); // find the input interface in the list of neighbor interfaces *************** *** 105,109 **** // the current reference link quality ! saved_lq = link->saved_neigh_link_quality; if (saved_lq == 0.0) --- 105,109 ---- // the current reference link quality ! saved_lq = lnk->saved_neigh_link_quality; if (saved_lq == 0.0) *************** *** 114,130 **** if (walker != NULL) ! link->neigh_link_quality = walker->link_quality; else ! link->neigh_link_quality = 0.0; // if the link quality has changed by more than 10 percent, // print the new link quality table ! rel_lq = link->neigh_link_quality / saved_lq; if (rel_lq > 1.1 || rel_lq < 0.9) { ! link->saved_neigh_link_quality = link->neigh_link_quality; if (olsr_cnf->lq_dlimit > 0) --- 114,130 ---- if (walker != NULL) ! lnk->neigh_link_quality = walker->link_quality; else ! lnk->neigh_link_quality = 0.0; // if the link quality has changed by more than 10 percent, // print the new link quality table ! rel_lq = lnk->neigh_link_quality / saved_lq; if (rel_lq > 1.1 || rel_lq < 0.9) { ! lnk->saved_neigh_link_quality = lnk->neigh_link_quality; if (olsr_cnf->lq_dlimit > 0) *************** *** 146,150 **** } ! neighbor = link->neighbor; /* --- 146,150 ---- } ! neighbor = lnk->neighbor; /* *************** *** 155,159 **** /* Update HELLO timeout */ //printf("MESSAGE HTIME: %f\n", message->htime); ! olsr_update_hysteresis_hello(link, message->htime); } --- 155,159 ---- /* Update HELLO timeout */ //printf("MESSAGE HTIME: %f\n", message->htime); ! olsr_update_hysteresis_hello(lnk, message->htime); } *************** *** 161,165 **** if(olsr_lookup_mpr_status(message, in_if)) /* source_addr is always the main addr of a node! */ ! olsr_update_mprs_set(&message->source_addr, (float)message->vtime); --- 161,165 ---- if(olsr_lookup_mpr_status(message, in_if)) /* source_addr is always the main addr of a node! */ ! olsr_update_mprs_set(&message->source_addr, message->vtime); *************** *** 625,632 **** if (olsr_cnf->lq_level > 0) { ! struct link_entry *link = get_best_link_to_neighbor(&neighbor->neighbor_main_addr); ! if(!link) return; --- 625,632 ---- if (olsr_cnf->lq_level > 0) { ! struct link_entry *lnk = get_best_link_to_neighbor(&neighbor->neighbor_main_addr); ! if(!lnk) return; *************** *** 696,700 **** new_path_link_quality = new_second_hop_link_quality * ! link->loss_link_quality * link->neigh_link_quality; // Only copy the link quality if it is better than what we have --- 696,700 ---- new_path_link_quality = new_second_hop_link_quality * ! lnk->loss_link_quality * lnk->neigh_link_quality; // Only copy the link quality if it is better than what we have Index: ipc_frontend.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/ipc_frontend.c,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** ipc_frontend.c 1 Aug 2007 16:19:48 -0000 1.32 --- ipc_frontend.c 2 Aug 2007 22:07:19 -0000 1.33 *************** *** 336,340 **** struct rt_entry *destination; struct interface *ifn; ! olsr_u8_t index; struct ipcmsg packet; char *tmp; --- 336,340 ---- struct rt_entry *destination; struct interface *ifn; ! int idx; struct ipcmsg packet; char *tmp; *************** *** 344,351 **** return 0; ! for(index=0;indexnext) { --- 344,351 ---- return 0; ! for(idx=0;idxnext) { *************** *** 391,398 **** } ! for(index=0;indexnext) { --- 391,398 ---- } ! for(idx=0;idxnext) { Index: packet.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/packet.c,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** packet.c 25 Apr 2007 22:08:09 -0000 1.22 --- packet.c 2 Aug 2007 22:07:19 -0000 1.23 *************** *** 91,96 **** struct link_entry *links; struct neighbor_entry *neighbor; ! olsr_u16_t index; ! int link; #ifdef DEBUG --- 91,95 ---- struct link_entry *links; struct neighbor_entry *neighbor; ! int idx; #ifdef DEBUG *************** *** 124,129 **** while(links != NULL) { ! ! link = lookup_link_status(links); /* Update the status */ --- 123,127 ---- while(links != NULL) { ! int lnk = lookup_link_status(links); /* Update the status */ *************** *** 139,143 **** /* Find the link status */ ! message_neighbor->link = link; /* --- 137,141 ---- /* Find the link status */ ! message_neighbor->link = lnk; /* *************** *** 214,221 **** if(ifnet != NULL && ifnet->int_next != NULL) ! for(index=0;indexnext) { --- 212,219 ---- if(ifnet != NULL && ifnet->int_next != NULL) ! for(idx=0;idxnext) { *************** *** 340,349 **** olsr_build_tc_packet(struct tc_message *message) { ! struct tc_mpr_addr *message_mpr; //struct mpr_selector *mprs; ! olsr_u8_t index; struct neighbor_entry *entry; //struct mpr_selector_hash *mprs_hash; - //olsr_u16_t index; olsr_bool entry_added = OLSR_FALSE; --- 338,346 ---- olsr_build_tc_packet(struct tc_message *message) { ! struct tc_mpr_addr *message_mpr; //struct mpr_selector *mprs; ! int idx; struct neighbor_entry *entry; //struct mpr_selector_hash *mprs_hash; olsr_bool entry_added = OLSR_FALSE; *************** *** 360,367 **** /* Loop trough all neighbors */ ! for(index=0;indexnext) { --- 357,364 ---- /* Loop trough all neighbors */ ! for(idx=0;idxnext) { *************** *** 418,422 **** } /* Switch */ } /* For */ ! } /* For index */ if(entry_added) --- 415,419 ---- } /* Switch */ } /* For */ ! } /* For idx */ if(entry_added) Index: lq_packet.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/lq_packet.c,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** lq_packet.c 10 Feb 2007 17:36:51 -0000 1.23 --- lq_packet.c 2 Aug 2007 22:07:19 -0000 1.24 *************** *** 151,155 **** int i; struct neighbor_entry *walker; - struct link_entry *link; static int ttl_list[] = { 1, 2, 1, 4, 1, 2, 1, 8, 1, 2, 1, 4, 1, 2, 1, MAX_TTL-1, 0}; --- 151,154 ---- *************** *** 200,203 **** --- 199,203 ---- walker = walker->next) { + struct link_entry *lnk; // only consider symmetric neighbours *************** *** 227,235 **** // set the entry's link quality ! link = get_best_link_to_neighbor(&neigh->main); ! if (link) { ! neigh->link_quality = link->loss_link_quality; ! neigh->neigh_link_quality = link->neigh_link_quality; } --- 227,235 ---- // set the entry's link quality ! lnk = get_best_link_to_neighbor(&neigh->main); ! if (lnk) { ! neigh->link_quality = lnk->loss_link_quality; ! neigh->neigh_link_quality = lnk->neigh_link_quality; } Index: tc_set.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/tc_set.c,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** tc_set.c 25 Apr 2007 22:08:17 -0000 1.26 --- tc_set.c 2 Aug 2007 22:07:19 -0000 1.27 *************** *** 58,70 **** olsr_init_tc(void) { ! int index; OLSR_PRINTF(5, "TC: init topo\n"); olsr_register_timeout_function(&olsr_time_out_tc_set); ! for(index=0;indexL_link_quality = olsr_hyst_calc_stability(link->L_link_quality); #ifdef DEBUG ! OLSR_PRINTF(3, "HYST[%s]: %0.3f\n", olsr_ip_to_string(remote), link->L_link_quality); #endif --- 165,176 ---- update_hysteresis_incoming(union olsr_ip_addr *remote, struct interface *local, olsr_u16_t seqno) { ! struct link_entry *lnk = lookup_link_entry(remote, NULL, local); /* Calculate new quality */ ! if(lnk != NULL) { ! lnk->L_link_quality = olsr_hyst_calc_stability(lnk->L_link_quality); #ifdef DEBUG ! OLSR_PRINTF(3, "HYST[%s]: %0.3f\n", olsr_ip_to_string(remote), lnk->L_link_quality); #endif *************** *** 184,207 **** */ ! if (link->olsr_seqno_valid && ! (unsigned short)(seqno - link->olsr_seqno) < 100) ! while (link->olsr_seqno != seqno) { ! link->L_link_quality = olsr_hyst_calc_instability(link->L_link_quality); #ifdef DEBUG OLSR_PRINTF(5, "HYST[%s] PACKET LOSS! %0.3f\n", ! olsr_ip_to_string(remote), link->L_link_quality); #endif ! if(link->L_link_quality < olsr_cnf->hysteresis_param.thr_low) break; ! link->olsr_seqno++; } ! link->olsr_seqno = seqno + 1; ! link->olsr_seqno_valid = OLSR_TRUE; ! //printf("Updating seqno to: %d\n", link->olsr_seqno); } return; --- 182,205 ---- */ ! if (lnk->olsr_seqno_valid && ! (unsigned short)(seqno - lnk->olsr_seqno) < 100) ! while (lnk->olsr_seqno != seqno) { ! lnk->L_link_quality = olsr_hyst_calc_instability(lnk->L_link_quality); #ifdef DEBUG OLSR_PRINTF(5, "HYST[%s] PACKET LOSS! %0.3f\n", ! olsr_ip_to_string(remote), lnk->L_link_quality); #endif ! if(lnk->L_link_quality < olsr_cnf->hysteresis_param.thr_low) break; ! lnk->olsr_seqno++; } ! lnk->olsr_seqno = seqno + 1; ! lnk->olsr_seqno_valid = OLSR_TRUE; ! //printf("Updating seqno to: %d\n", lnk->olsr_seqno); } return; Index: net_olsr.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/net_olsr.c,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** net_olsr.c 5 Jul 2007 22:43:47 -0000 1.24 --- net_olsr.c 2 Aug 2007 22:07:19 -0000 1.25 *************** *** 613,617 **** olsr_ip_to_string(const union olsr_ip_addr *addr) { ! static int index = 0; static char buff[4][INET6_ADDRSTRLEN > INET_ADDRSTRLEN ? INET6_ADDRSTRLEN : INET_ADDRSTRLEN]; const char *ret; --- 613,617 ---- olsr_ip_to_string(const union olsr_ip_addr *addr) { ! static int idx = 0; static char buff[4][INET6_ADDRSTRLEN > INET_ADDRSTRLEN ? INET6_ADDRSTRLEN : INET_ADDRSTRLEN]; const char *ret; *************** *** 626,632 **** struct in_addr in; in.s_addr = addr->v4; ! ret = inet_ntop(AF_INET, &in, buff[index], sizeof(buff[index])); #else ! ret = inet_ntop(AF_INET, &addr->v6, buff[index], sizeof(buff[index])); #endif } --- 626,632 ---- struct in_addr in; in.s_addr = addr->v4; ! ret = inet_ntop(AF_INET, &in, buff[idx], sizeof(buff[idx])); #else ! ret = inet_ntop(AF_INET, &addr->v4, buff[idx], sizeof(buff[idx])); #endif } *************** *** 634,640 **** { /* IPv6 */ ! ret = inet_ntop(AF_INET6, &addr->v6, buff[index], sizeof(buff[index])); } ! index = (index + 1) & 3; return ret; --- 634,640 ---- { /* IPv6 */ ! ret = inet_ntop(AF_INET6, &addr->v6, buff[idx], sizeof(buff[idx])); } ! idx = (idx + 1) & 3; return ret; Index: hna_set.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/hna_set.c,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** hna_set.c 25 Apr 2007 22:08:08 -0000 1.19 --- hna_set.c 2 Aug 2007 22:07:19 -0000 1.20 *************** *** 56,60 **** { ! int index; if(olsr_cnf->ip_version == AF_INET) --- 56,60 ---- { ! int idx; if(olsr_cnf->ip_version == AF_INET) *************** *** 72,79 **** olsr_register_scheduler_event(&olsr_time_out_hna_set, NULL, 1, 0, NULL); ! for(index=0;indexnext) { --- 278,287 ---- struct destination_n *kernel_route_list = NULL; struct rt_entry *destination; ! int idx; ! for(idx=0;idxnext) { *************** *** 400,423 **** olsr_move_route_table(struct rt_entry *original, struct rt_entry *new) { ! olsr_16_t index; ! for(index=0;indexprev = &new[index]; ! new[index].prev = original[index].prev; ! new[index].prev->next = &new[index]; /* Clear original */ ! original[index].next = &original[index]; ! original[index].prev = &original[index]; } } --- 400,423 ---- olsr_move_route_table(struct rt_entry *original, struct rt_entry *new) { ! int idx; ! for(idx=0;idxprev = &new[idx]; ! new[idx].prev = original[idx].prev; ! new[idx].prev->next = &new[idx]; /* Clear original */ ! original[idx].next = &original[idx]; ! original[idx].prev = &original[idx]; } } Index: two_hop_neighbor_table.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/two_hop_neighbor_table.c,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** two_hop_neighbor_table.c 25 Apr 2007 22:08:17 -0000 1.18 --- two_hop_neighbor_table.c 2 Aug 2007 22:07:19 -0000 1.19 *************** *** 57,66 **** olsr_init_two_hop_table(void) { ! int index; ! for(index=0;index", olsr_ip_to_string(&ifs->ip_addr)); //printf("%s : ", olsr_ip_to_string(main_addr)); ! if((link = lookup_link_entry(main_addr, NULL, ifs)) != NULL) { //printf("%d\n", lookup_link_status(link)); ! if(lookup_link_status(link) == SYM_LINK) return SYM_LINK; } --- 199,210 ---- { struct mid_address *aliases; ! struct link_entry *lnk = lookup_link_entry(main_addr, NULL, ifs); //printf("\tChecking %s->", olsr_ip_to_string(&ifs->ip_addr)); //printf("%s : ", olsr_ip_to_string(main_addr)); ! if(lnk != NULL) { //printf("%d\n", lookup_link_status(link)); ! if(lookup_link_status(lnk) == SYM_LINK) return SYM_LINK; } *************** *** 216,224 **** //printf("\tChecking %s->", olsr_ip_to_string(&ifs->ip_addr)); //printf("%s : ", olsr_ip_to_string(&aliases->address)); ! if((link = lookup_link_entry(&aliases->alias, NULL, ifs)) != NULL) { //printf("%d\n", lookup_link_status(link)); ! if(lookup_link_status(link) == SYM_LINK) return SYM_LINK; } --- 216,225 ---- //printf("\tChecking %s->", olsr_ip_to_string(&ifs->ip_addr)); //printf("%s : ", olsr_ip_to_string(&aliases->address)); ! lnk = lookup_link_entry(&aliases->alias, NULL, ifs); ! if(lnk != NULL) { //printf("%d\n", lookup_link_status(link)); ! if(lookup_link_status(lnk) == SYM_LINK) return SYM_LINK; } *************** *** 979,983 **** { unsigned char mask = 1 << (entry->loss_index & 7); ! int index = entry->loss_index >> 3; double rel_lq, saved_lq; --- 980,984 ---- { unsigned char mask = 1 << (entry->loss_index & 7); ! const int idx = entry->loss_index >> 3; double rel_lq, saved_lq; *************** *** 986,995 **** // packet not lost ! if ((entry->loss_bitmap[index] & mask) != 0) { // but the packet that we replace was lost // => decrement packet loss ! entry->loss_bitmap[index] &= ~mask; entry->lost_packets--; } --- 987,996 ---- // packet not lost ! if ((entry->loss_bitmap[idx] & mask) != 0) { // but the packet that we replace was lost // => decrement packet loss ! entry->loss_bitmap[idx] &= ~mask; entry->lost_packets--; } *************** *** 1000,1009 **** // packet lost ! if ((entry->loss_bitmap[index] & mask) == 0) { // but the packet that we replace was not lost // => increment packet loss ! entry->loss_bitmap[index] |= mask; entry->lost_packets++; } --- 1001,1010 ---- // packet lost ! if ((entry->loss_bitmap[idx] & mask) == 0) { // but the packet that we replace was not lost // => increment packet loss ! entry->loss_bitmap[idx] |= mask; entry->lost_packets++; } Index: lq_mpr.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/lq_mpr.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** lq_mpr.c 10 Feb 2007 19:27:32 -0000 1.12 --- lq_mpr.c 2 Aug 2007 22:07:19 -0000 1.13 *************** *** 55,59 **** double best, best_1hop; olsr_bool mpr_changes = OLSR_FALSE; - struct link_entry *link; for(i = 0; i < HASHSIZE; i++) --- 55,58 ---- *************** *** 109,118 **** // determine the link quality of the direct link ! link = get_best_link_to_neighbor(&neigh->neighbor_main_addr); ! if(!link) continue; ! best_1hop = link->loss_link_quality * link->neigh_link_quality; // see wether we find a better route via an MPR --- 108,117 ---- // determine the link quality of the direct link ! struct link_entry *lnk = get_best_link_to_neighbor(&neigh->neighbor_main_addr); ! if (!lnk) continue; ! best_1hop = lnk->loss_link_quality * lnk->neigh_link_quality; // see wether we find a better route via an MPR From (spam-protected) Thu Aug 2 22:21:32 2007 From: (spam-protected) (Aaron Kaplan) Date: Fri, 3 Aug 2007 02:21:32 +0600 Subject: [Olsr-cvs] olsrd-current/lib/txtinfo/src olsrd_txtinfo.c, 1.6, 1.7 olsrd_txtinfo.h, 1.1, 1.2 In-Reply-To: References: Message-ID: some feedback for that: Andreas's Thesis stated that the interface will always remain the same. AFAIK this was the reason to keep the version numbers in there. [1] Andreas, could you confirm this? One reason is that there might be a bunch of plugins out there (some of them not open source) which depend on the old interface. IMHO we should not completely abandon the old interface but keep it as a compile option (as you did anyway, Bernd) :) ACK? a. [1] c.f. the diploma thesis, page 63 On Jul 16, 2007, at 2:29 AM, Bernd Petrovitsch wrote: > Update of /cvsroot/olsrd/olsrd-current/lib/txtinfo/src > In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5004/lib/ > txtinfo/src > > Modified Files: > olsrd_txtinfo.c olsrd_txtinfo.h > Log Message: > > I started to clean up the plugin parameter handling: > * Up to now some used case-insensitive, some used case-sensitive (with > differing cases BTW) parameter names. > * Most plugins silently ignored unknown parameters. > This makes it hard to find errors in the olsrd.conf file. > Instead of simply fixing all the various plugins (and the mostly - > more > or less - copied code), I reduced the plugin special code to a minimum > and (more or less automatically) all plugins behave the same (with > respect to the parameter handling). > > How does it look now? > Every plugins exports a table of { parameter-name, parse-function, > addr-of-storage } to allow to share more code, e.g. the parsing and > checking of a port number or IP addresses. > Every plugin will export a function > ---- snip ---- > void olsrd_get_plugin_parameters(const struct > olsrd_plugin_parameters **params, int *size); > ---- snip ---- > which delivers the address of the table and it's size. So in theory > the > plugin could generate the table at load time though ATM all current > ones export statically defined tables. > > What else is different? > - I introduced SUPPORT_OLD_PLUGIN_VERSIONS to simplifiy the compile- > time > removal of legacy support. It is not that much but more of a start. > - Plugin interface version 4 is supported until all plugins are > migrated. > - The plugin loader produces now much more output - on good and error > cases. I had too often to look into the source to find that I > mistyped > some parameter ..... > > ToDo: > - Several plugins cannot handle IPv6 at all - only IPv4 is > implemented. > Some of these functions are locally now but fixed versions can (and > should IMHO) be shared by all plugins. > > > > Index: olsrd_txtinfo.c > =================================================================== > RCS file: /cvsroot/olsrd/olsrd-current/lib/txtinfo/src/ > olsrd_txtinfo.c,v > retrieving revision 1.6 > retrieving revision 1.7 > diff -C2 -d -r1.6 -r1.7 > *** olsrd_txtinfo.c 9 May 2007 17:29:53 -0000 1.6 > --- olsrd_txtinfo.c 15 Jul 2007 19:29:37 -0000 1.7 > *************** > *** 93,123 **** > > /* IPC initialization function */ > ! static int > ! plugin_ipc_init(void); > > ! static void > ! send_info(int neighonly); > > ! static void > ! ipc_action(int); > > ! static void > ! ipc_print_neigh_link(void); > > ! static void > ! ipc_print_routes(void); > > ! static void > ! ipc_print_topology(void); > > ! static void > ! ipc_print_hna(void); > > ! static void > ! ipc_print_mid(void); > > #define TXT_IPC_BUFSIZE 256 > ! static int > ! ipc_sendf(const char* format, ...) __attribute__((format(printf, > 1, 2))); > > /** > --- 93,114 ---- > > /* IPC initialization function */ > ! static int plugin_ipc_init(void); > > ! static void send_info(int neighonly); > > ! static void ipc_action(int); > > ! static void ipc_print_neigh_link(void); > > ! static void ipc_print_routes(void); > > ! static void ipc_print_topology(void); > > ! static void ipc_print_hna(void); > > ! static void ipc_print_mid(void); > > #define TXT_IPC_BUFSIZE 256 > ! static int ipc_sendf(const char* format, ...) __attribute__ > ((format(printf, 1, 2))); > > /** > *************** > *** 130,139 **** > olsrd_plugin_init(void) > { > ! /* Initial IPC value */ > ! ipc_open = 0; > ! ipc_socket_up = 0; > > ! plugin_ipc_init(); > ! return 1; > } > > --- 121,130 ---- > olsrd_plugin_init(void) > { > ! /* Initial IPC value */ > ! ipc_open = 0; > ! ipc_socket_up = 0; > > ! plugin_ipc_init(); > ! return 1; > } > > *************** > *** 142,150 **** > * destructor - called at unload > */ > ! void > ! olsr_plugin_exit(void) > { > ! if(ipc_open) > ! close(ipc_socket); > } > > --- 133,140 ---- > * destructor - called at unload > */ > ! void olsr_plugin_exit(void) > { > ! if(ipc_open) > ! close(ipc_socket); > } > > *************** > *** 154,497 **** > 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)); > #endif > ! return 0; > ! } > ! else > ! { > ! if (setsockopt(ipc_socket, SOL_SOCKET, SO_REUSEADDR, (char > *)&yes, sizeof(yes)) < 0) > ! { > #ifndef NODEBUG > ! olsr_printf(1, "(TXTINFO) setsockopt()=%s\n", strerror(errno)); > #endif > ! return 0; > ! } > > #if defined __FreeBSD__ && defined SO_NOSIGPIPE > ! if (setsockopt(ipc_socket, SOL_SOCKET, SO_NOSIGPIPE, (char > *)&yes, sizeof(yes)) < 0) > ! { > ! perror("SO_REUSEADDR failed"); > ! return 0; > ! } > #endif > > ! /* Bind the socket */ > ! > ! /* 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)); > #endif > ! return 0; > ! } > ! > ! /* show that we are willing to listen */ > ! if (listen(ipc_socket, 1) == -1) > ! { > #ifndef NODEBUG > ! olsr_printf(1, "(TXTINFO) listen()=%s\n", strerror(errno)); > #endif > ! return 0; > ! } > ! > ! /* Register with olsrd */ > ! add_olsr_socket(ipc_socket, &ipc_action); > > #ifndef NODEBUG > ! olsr_printf(2, "(TXTINFO) listening on port %d\n",ipc_port); > #endif > ! ipc_socket_up = 1; > } > ! > ! return 1; > } > > > ! static void > ! ipc_action(int fd) > { > ! struct sockaddr_in pin; > ! socklen_t addrlen; > ! char *addr; > > ! addrlen = sizeof(struct sockaddr_in); > > ! if(ipc_open) > ! return; > > ! if ((ipc_connection = accept(fd, (struct sockaddr *) &pin, > &addrlen)) == -1) > ! { > #ifndef NODEBUG > ! olsr_printf(1, "(TXTINFO) accept()=%s\n", strerror(errno)); > #endif > ! exit(1); > } > - else > - { > - fd_set rfds; > - struct timeval tv = {0,0}; > - int neighonly = 0; > > ! addr = inet_ntoa(pin.sin_addr); > ! if(ntohl(pin.sin_addr.s_addr) != ntohl(ipc_accept_ip.s_addr)) > ! { > ! olsr_printf(1, "(TXTINFO) From host(%s) not allowed!\n", addr); > ! close(ipc_connection); > ! return; > ! } > ! else > ! { > ! ipc_open = 1; > #ifndef NODEBUG > ! olsr_printf(2, "(TXTINFO) Connect from %s\n",addr); > #endif > > ! /* purge read buffer to prevent blocking on linux*/ > ! FD_ZERO(&rfds); > ! FD_SET((unsigned int)ipc_connection, &rfds); /* Win32 needs > the cast here */ > ! if(select(ipc_connection+1, &rfds, NULL, NULL, &tv)) { > char requ[128]; > ssize_t s = recv(ipc_connection, (void*)&requ, sizeof > (requ), 0); /* Win32 needs the cast here */ > if (0 < s) { > ! requ[s] = 0; > ! /* To print out neighbours only on the Freifunk Status > ! * page the normal output is somewhat lengthy. The > ! * header parsing is sufficient for standard wget. > ! */ > ! neighonly = (0 != strstr(requ, "/neighbours")); > } > ! } > > ! send_info(neighonly); > > ! close(ipc_connection); > ! ipc_open = 0; > ! } > ! } > } > > ! static void > ! ipc_print_neigh_link(void) > { > ! struct neighbor_entry *neigh; > ! struct neighbor_2_list_entry *list_2; > ! struct link_entry *link = NULL; > ! int index, thop_cnt; > > ! ipc_sendf("Table: Links\nLocal IP\tremote IP\tHysteresis > \tLinkQuality\tlost\ttotal\tNLQ\tETX\n"); > > ! /* Link set */ > ! link = link_set; > ! while(link) > ! { > ipc_sendf( "%s\t%s\t%0.2f\t%0.2f\t%d\t%d\t%0.2f\t%0.2f\t\n", > ! olsr_ip_to_string(&link->local_iface_addr), > ! olsr_ip_to_string(&link->neighbor_iface_addr), > ! link->L_link_quality, > ! link->loss_link_quality, > ! link->lost_packets, > ! link->total_packets, > ! link->neigh_link_quality, > ! (link->loss_link_quality * link->neigh_link_quality) ? 1.0 / > (link->loss_link_quality * link->neigh_link_quality) : 0.0); > ! link = link->next; > ! } > ! ipc_sendf("\nTable: Neighbors\nIP address\tSYM\tMPR\tMPRS > \tWillingness\t2 Hop Neighbors\n"); > ! > ! /* Neighbors */ > ! for(index=0;index ! { > ! for(neigh = neighbortable[index].next; > ! neigh != &neighbortable[index]; > ! neigh = neigh->next) > ! { > ! ipc_sendf( > ! "%s\t%s\t%s\t%s\t%d\t", > ! olsr_ip_to_string(&neigh->neighbor_main_addr), > ! (neigh->status == SYM) ? "YES" : "NO", > ! neigh->is_mpr ? "YES" : "NO", > ! olsr_lookup_mprs_set(&neigh->neighbor_main_addr) ? "YES" : > "NO", > ! neigh->willingness); > > ! thop_cnt = 0; > > ! for(list_2 = neigh->neighbor_2_list.next; > ! list_2 != &neigh->neighbor_2_list; > ! list_2 = list_2->next) > ! { > ! //size += sprintf(&buf[size], "\n", > olsr_ip_to_string(&list_2->neighbor_2->neighbor_2_addr)); > ! thop_cnt ++; > ! } > ! ipc_sendf("%d\n", thop_cnt); > } > } > ! > ! ipc_sendf("\n"); > } > > ! > ! static void > ! ipc_print_routes(void) > { > ! int size = 0, index; > ! struct rt_entry *routes; > > ! ipc_sendf("Table: Routes\nDestination\tGateway\tMetric\tETX > \tInterface\tType\n"); > > ! /* Neighbors */ > ! for(index = 0;index < HASHSIZE;index++) > ! { > ! for(routes = routingtable[index].next; > ! routes != &routingtable[index]; > ! routes = routes->next) > ! { > ! size = 0; > ! ipc_sendf( "%s\t%s\t%d\t%.2f\t%s\tHOST\n", > ! olsr_ip_to_string(&routes->rt_dst), > ! olsr_ip_to_string(&routes->rt_router), > ! routes->rt_metric, > ! routes->rt_etx, > ! routes->rt_if->int_name); > } > } > > ! /* HNA */ > ! for(index = 0;index < HASHSIZE;index++) > ! { > ! for(routes = hna_routes[index].next; > ! routes != &hna_routes[index]; > ! routes = routes->next) > ! { > ! ipc_sendf("%s\t%s\t%d\t%s\t\tHNA\n", > ! olsr_ip_to_string(&routes->rt_dst), > ! olsr_ip_to_string(&routes->rt_router), > ! routes->rt_metric, > ! routes->rt_if->int_name); > } > } > ! > ! ipc_sendf("\n"); > > } > > ! static void > ! ipc_print_topology(void) > { > ! olsr_u8_t index; > ! struct tc_entry *entry; > ! struct topo_dst *dst_entry; > ! > > ! ipc_sendf("Table: Topology\nDestination IP\tLast hop IP\tLQ\tILQ > \tETX\n"); > > ! /* Topology */ > ! for(index=0;index ! { > ! /* For all TC entries */ > ! entry = tc_table[index].next; > ! while(entry != &tc_table[index]) > ! { > ! /* For all destination entries of that TC entry */ > ! dst_entry = entry->destinations.next; > ! while(dst_entry != &entry->destinations) > ! { > ! ipc_sendf( "%s\t%s\t%0.2f\t%0.2f\t%0.2f\n", > ! olsr_ip_to_string(&dst_entry->T_dest_addr), > ! olsr_ip_to_string(&entry->T_last_addr), > ! dst_entry->link_quality, > ! dst_entry->inverse_link_quality, > ! (dst_entry->link_quality * dst_entry- > >inverse_link_quality) ? 1.0 / (dst_entry->link_quality * dst_entry- > >inverse_link_quality) : 0.0); > > ! dst_entry = dst_entry->next; > } > ! entry = entry->next; > } > } > ! > ! ipc_sendf("\n"); > } > > ! static void > ! ipc_print_hna(void) > { > ! int size; > ! olsr_u8_t index; > ! struct hna_entry *tmp_hna; > ! struct hna_net *tmp_net; > ! struct hna4_entry *hna4; > ! struct hna6_entry *hna6; > > ! size = 0; > > ! ipc_sendf("Table: HNA\nNetwork\tNetmask\tGateway\n"); > > ! /* Announced HNA entries */ > ! for(hna4 = olsr_cnf->hna4_entries; hna4; hna4 = hna4->next) > ! { > ! ipc_sendf("%s\t%s\t%s\n", > ! olsr_ip_to_string(&hna4->net), > ! olsr_ip_to_string(&hna4->netmask), > ! olsr_ip_to_string(&olsr_cnf->main_addr)); > ! } > ! for(hna6 = olsr_cnf->hna6_entries; hna6; hna6 = hna6->next) > ! { > ! ipc_sendf("%s\t%d\t%s\n", > ! olsr_ip_to_string(&hna6->net), > ! hna6->prefix_len, > ! olsr_ip_to_string(&olsr_cnf->main_addr)); > ! } > > ! /* HNA entries */ > ! for(index=0;index ! { > ! tmp_hna = hna_set[index].next; > ! /* Check all entrys */ > ! while(tmp_hna != &hna_set[index]) > ! { > ! /* Check all networks */ > ! tmp_net = tmp_hna->networks.next; > > ! while(tmp_net != &tmp_hna->networks) > ! { > if (AF_INET == olsr_cnf->ip_version) { > ! ipc_sendf("%s\t%s\t%s\n", > ! olsr_ip_to_string(&tmp_net->A_network_addr), > ! olsr_ip_to_string((union olsr_ip_addr *)&tmp_net->A_netmask.v4), > ! olsr_ip_to_string(&tmp_hna->A_gateway_addr)); > ! } > ! else { > ! ipc_sendf("%s\t%d\t%s\n", > ! olsr_ip_to_string(&tmp_net->A_network_addr), > ! tmp_net->A_netmask.v6, > ! olsr_ip_to_string(&tmp_hna->A_gateway_addr)); > } > ! tmp_net = tmp_net->next; > } > > ! tmp_hna = tmp_hna->next; > } > } > ! > ! ipc_sendf("\n"); > > } > > ! static void > ! ipc_print_mid(void) > { > ! olsr_u8_t index; > unsigned short is_first; > struct mid_entry *entry; > --- 144,440 ---- > 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)); > #endif > ! return 0; > ! } else { > ! if (setsockopt(ipc_socket, SOL_SOCKET, SO_REUSEADDR, > (char *)&yes, sizeof(yes)) < 0) { > #ifndef NODEBUG > ! olsr_printf(1, "(TXTINFO) setsockopt()=%s\n", strerror > (errno)); > #endif > ! return 0; > ! } > > #if defined __FreeBSD__ && defined SO_NOSIGPIPE > ! if (setsockopt(ipc_socket, SOL_SOCKET, SO_NOSIGPIPE, > (char *)&yes, sizeof(yes)) < 0) { > ! perror("SO_REUSEADDR failed"); > ! return 0; > ! } > #endif > + /* Bind the socket */ > > ! /* 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)); > #endif > ! return 0; > ! } > ! > ! /* show that we are willing to listen */ > ! if (listen(ipc_socket, 1) == -1) { > #ifndef NODEBUG > ! olsr_printf(1, "(TXTINFO) listen()=%s\n", strerror > (errno)); > #endif > ! return 0; > ! } > > + /* Register with olsrd */ > + add_olsr_socket(ipc_socket, &ipc_action); > + > #ifndef NODEBUG > ! olsr_printf(2, "(TXTINFO) listening on port %d\n",ipc_port); > #endif > ! ipc_socket_up = 1; > } > ! return 1; > } > > > ! 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) > ! return; > > ! if ((ipc_connection = accept(fd, (struct sockaddr *) &pin, > &addrlen)) == -1) { > #ifndef NODEBUG > ! olsr_printf(1, "(TXTINFO) accept()=%s\n", strerror(errno)); > #endif > ! return; > } > > ! 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; > #ifndef NODEBUG > ! olsr_printf(2, "(TXTINFO) Connect from %s\n",addr); > #endif > > ! /* purge read buffer to prevent blocking on linux*/ > ! FD_ZERO(&rfds); > ! FD_SET((unsigned int)ipc_connection, &rfds); /* Win32 needs > the cast here */ > ! if(select(ipc_connection+1, &rfds, NULL, NULL, &tv)) { > char requ[128]; > ssize_t s = recv(ipc_connection, (void*)&requ, sizeof > (requ), 0); /* Win32 needs the cast here */ > if (0 < s) { > ! requ[s] = 0; > ! /* To print out neighbours only on the Freifunk Status > ! * page the normal output is somewhat lengthy. The > ! * header parsing is sufficient for standard wget. > ! */ > ! neighonly = (0 != strstr(requ, "/neighbours")); > } > ! } > > ! send_info(neighonly); > > ! close(ipc_connection); > ! ipc_open = 0; > } > > ! static void ipc_print_neigh_link(void) > { > ! struct neighbor_entry *neigh; > ! struct neighbor_2_list_entry *list_2; > ! struct link_entry *link = NULL; > ! int index, thop_cnt; > > ! ipc_sendf("Table: Links\nLocal IP\tremote IP\tHysteresis > \tLinkQuality\tlost\ttotal\tNLQ\tETX\n"); > > ! /* Link set */ > ! link = link_set; > ! while(link) { > ipc_sendf( "%s\t%s\t%0.2f\t%0.2f\t%d\t%d\t%0.2f\t%0.2f\t\n", > ! olsr_ip_to_string(&link->local_iface_addr), > ! olsr_ip_to_string(&link->neighbor_iface_addr), > ! link->L_link_quality, > ! link->loss_link_quality, > ! link->lost_packets, > ! link->total_packets, > ! link->neigh_link_quality, > ! (link->loss_link_quality * link- > >neigh_link_quality) ? 1.0 / (link->loss_link_quality * link- > >neigh_link_quality) : 0.0); > ! link = link->next; > ! } > ! ipc_sendf("\nTable: Neighbors\nIP address\tSYM\tMPR\tMPRS > \tWillingness\t2 Hop Neighbors\n"); > > ! /* Neighbors */ > ! for(index = 0; index < HASHSIZE; index++) { > ! for(neigh = neighbortable[index].next; > ! neigh != &neighbortable[index]; > ! neigh = neigh->next) { > ! ipc_sendf("%s\t%s\t%s\t%s\t%d\t", > ! olsr_ip_to_string(&neigh->neighbor_main_addr), > ! (neigh->status == SYM) ? "YES" : "NO", > ! neigh->is_mpr ? "YES" : "NO", > ! olsr_lookup_mprs_set(&neigh- > >neighbor_main_addr) ? "YES" : "NO", > ! neigh->willingness); > ! thop_cnt = 0; > > ! for(list_2 = neigh->neighbor_2_list.next; > ! list_2 != &neigh->neighbor_2_list; > ! list_2 = list_2->next) > ! { > ! //size += sprintf(&buf[size], "