From (spam-protected) Thu Jul 5 21:59:06 2007 From: (spam-protected) (aaron) Date: Thu, 05 Jul 2007 19:59:06 +0000 Subject: [Olsr-cvs] olsrd-current foo.c,NONE,1.1 Message-ID: Update of /cvsroot/olsrd/olsrd-current In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv29087 Added Files: foo.c Log Message: testing the cvs mailinglist --- NEW FILE: foo.c --- From (spam-protected) Thu Jul 5 22:05:15 2007 From: (spam-protected) (aaron) Date: Thu, 05 Jul 2007 20:05:15 +0000 Subject: [Olsr-cvs] olsrd-current foo.c,1.1,NONE Message-ID: Update of /cvsroot/olsrd/olsrd-current In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31618 Removed Files: foo.c Log Message: and gone again. thanks for the patience... test finished --- foo.c DELETED --- From (spam-protected) Fri Jul 6 00:43:48 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Thu, 05 Jul 2007 22:43:48 +0000 Subject: [Olsr-cvs] olsrd-current CHANGELOG,1.61,1.62 Message-ID: Update of /cvsroot/olsrd/olsrd-current In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28283 Modified Files: CHANGELOG Log Message: added the SPF refactoring from Hannes Gredler : 1. use of an AVL tree as a min-heap implementation as a means for efficient sorting. (the etx metric is used as the key in the candidate tree) 2. next-hop propagation rather than tracking the previous node in olsr_relax() i have changed that model and pre-populate all one-hop neighbors with their own IP adress as 'next-hop' and pull that pointer up once new paths are explored. as a result no walker for counting hops and extracting next-hops is required - it turns out at this is slighly more efficient than the existing behaviour (even with the cache applied). Index: CHANGELOG =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/CHANGELOG,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** CHANGELOG 2 Jul 2007 11:05:48 -0000 1.61 --- CHANGELOG 5 Jul 2007 22:43:46 -0000 1.62 *************** *** 5,11 **** MISC ! Upgrade to olsr-bmf 1.5 ! latitude/longitude support is now in the nameservice plugin CLEANUPS --- 5,32 ---- MISC ! Upgrade to olsr-bmf 1.5 from Erik Tromp ! latitude/longitude support is now in the nameservice plugin done by ! Sven-Ola Tuecke ! ! 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 ! ! as a means for efficient sorting. ! (the etx metric is used as the key in the candidate tree) ! ! 2. next-hop propagation ! ! rather than tracking the previous node in olsr_relax() ! i have changed that model and pre-populate all one-hop neighbors ! with their own IP adress as 'next-hop' and pull that ! pointer up once new paths are explored. ! ! as a result no walker for counting hops and extracting next-hops ! is required - it turns out at this is slighly more efficient ! than the existing behaviour (even with the cache applied). ! ---- snip ---- CLEANUPS From (spam-protected) Fri Jul 6 00:43:49 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Thu, 05 Jul 2007 22:43:49 +0000 Subject: [Olsr-cvs] olsrd-current/src lq_avl.c, 1.9, 1.10 lq_avl.h, 1.8, 1.9 lq_route.c, 1.46, 1.47 lq_route.h, 1.3, 1.4 net_olsr.c, 1.23, 1.24 olsr.c, 1.54, 1.55 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28283/src Modified Files: lq_avl.c lq_avl.h lq_route.c lq_route.h net_olsr.c olsr.c Log Message: added the SPF refactoring from Hannes Gredler : 1. use of an AVL tree as a min-heap implementation as a means for efficient sorting. (the etx metric is used as the key in the candidate tree) 2. next-hop propagation rather than tracking the previous node in olsr_relax() i have changed that model and pre-populate all one-hop neighbors with their own IP adress as 'next-hop' and pull that pointer up once new paths are explored. as a result no walker for counting hops and extracting next-hops is required - it turns out at this is slighly more efficient than the existing behaviour (even with the cache applied). Index: lq_route.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/lq_route.c,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** lq_route.c 25 Apr 2007 22:08:09 -0000 1.46 --- lq_route.c 5 Jul 2007 22:43:46 -0000 1.47 *************** *** 3,6 **** --- 3,7 ---- * Copyright (c) 2004, Thomas Lopatic (thomas at lopatic.de) * IPv4 performance optimization (c) 2006, sven-ola(gmx.de) + * SPF implementation (c) 2007, Hannes Gredler (hannes at gredler.at) * All rights reserved. * *************** *** 54,124 **** #include "lq_route.h" [...1059 lines suppressed...] ! free_everything(&vertex_list); // move the route changes into the kernel --- 755,759 ---- // free the graph ! olsr_free_everything(&vertex_tree); // move the route changes into the kernel *************** *** 796,797 **** --- 767,774 ---- olsr_free_routing_table(old_hna); } + + /* + * Local Variables: + * c-basic-offset: 2 + * End: + */ Index: lq_avl.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/lq_avl.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** lq_avl.h 29 Mar 2007 00:05:50 -0000 1.8 --- lq_avl.h 5 Jul 2007 22:43:46 -0000 1.9 *************** *** 68,72 **** --- 68,78 ---- void avl_delete(struct avl_tree *, struct avl_node *); struct avl_node *avl_walk_first(struct avl_tree *); + struct avl_node *avl_walk_last(struct avl_tree *); struct avl_node *avl_walk_next(struct avl_node *); + struct avl_node *avl_walk_prev(struct avl_node *); + + extern int (*avl_comp_default)(void *, void *); + extern int avl_comp_ipv4(void *, void *); + extern int avl_comp_ipv6(void *, void *); #define inline_avl_comp_ipv4(ip1, ip2) \ *************** *** 75,76 **** --- 81,88 ---- #endif + + /* + * Local Variables: + * c-basic-offset: 2 + * End: + */ Index: lq_route.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/lq_route.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** lq_route.h 28 Nov 2004 13:43:59 -0000 1.3 --- lq_route.h 5 Jul 2007 22:43:47 -0000 1.4 *************** *** 44,47 **** --- 44,48 ---- #define INFINITE_ETX ((float)(1 << 30)) + #define ZERO_ETX 0.0 #define MIN_LINK_QUALITY 0.01 Index: net_olsr.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/net_olsr.c,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** net_olsr.c 13 May 2007 22:23:55 -0000 1.23 --- net_olsr.c 5 Jul 2007 22:43:47 -0000 1.24 *************** *** 616,619 **** --- 616,623 ---- static char buff[4][INET6_ADDRSTRLEN > INET_ADDRSTRLEN ? INET6_ADDRSTRLEN : INET_ADDRSTRLEN]; const char *ret; + + if (!addr) { + return "null"; + } if(olsr_cnf->ip_version == AF_INET) Index: lq_avl.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/lq_avl.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** lq_avl.c 20 Apr 2007 14:23:41 -0000 1.9 --- lq_avl.c 5 Jul 2007 22:43:46 -0000 1.10 *************** *** 43,46 **** --- 43,47 ---- #include #include + #include #include "lq_avl.h" *************** *** 49,52 **** --- 50,70 ---- #define AVLMIN(x, y) ((x < y) ? x : y) + /* + * dummy comparison pointer + * set to zero for a fast inline ipv4 comparison + */ + int (*avl_comp_default)(void *, void *) = 0; + + int avl_comp_ipv4(void *ip1, void *ip2) + { + return(*(unsigned int *)ip1 == *(unsigned int *)ip2 ? 0 : \ + *(unsigned int *)ip1 < *(unsigned int *)ip2 ? -1 : +1); + } + + int avl_comp_ipv6(void *ip1, void *ip2) + { + return memcmp(ip1, ip2, 16); + } + void avl_init(struct avl_tree *tree, int (*comp)(void *, void *)) { *************** *** 55,64 **** } ! static struct avl_node *find_rec_ipv4(struct avl_node *node, void *key) { if (*(unsigned int *)key < *(unsigned int *)node->key) { if (node->left != NULL) ! return find_rec_ipv4(node->left, key); } --- 73,82 ---- } ! static struct avl_node *avl_find_rec_ipv4(struct avl_node *node, void *key) { if (*(unsigned int *)key < *(unsigned int *)node->key) { if (node->left != NULL) ! return avl_find_rec_ipv4(node->left, key); } *************** *** 66,70 **** { if (node->right != NULL) ! return find_rec_ipv4(node->right, key); } --- 84,88 ---- { if (node->right != NULL) ! return avl_find_rec_ipv4(node->right, key); } *************** *** 72,82 **** } ! static struct avl_node *find_rec(struct avl_node *node, void *key, ! int (*comp)(void *, void *)) { int diff; if (0 == comp) ! return find_rec_ipv4(node, key); diff = (*comp)(key, node->key); --- 90,100 ---- } ! static struct avl_node *avl_find_rec(struct avl_node *node, void *key, ! int (*comp)(void *, void *)) { int diff; if (0 == comp) ! return avl_find_rec_ipv4(node, key); diff = (*comp)(key, node->key); *************** *** 85,89 **** { if (node->left != NULL) ! return find_rec(node->left, key, comp); return node; --- 103,107 ---- { if (node->left != NULL) ! return avl_find_rec(node->left, key, comp); return node; *************** *** 93,97 **** { if (node->right != NULL) ! return find_rec(node->right, key, comp); return node; --- 111,115 ---- { if (node->right != NULL) ! return avl_find_rec(node->right, key, comp); return node; *************** *** 108,112 **** return NULL; ! node = find_rec(tree->root, key, tree->comp); if (0 == tree->comp) --- 126,130 ---- return NULL; ! node = avl_find_rec(tree->root, key, tree->comp); if (0 == tree->comp) *************** *** 125,129 **** } ! static void rotate_right(struct avl_tree *tree, struct avl_node *node) { struct avl_node *left, *parent; --- 143,147 ---- } ! static void avl_rotate_right(struct avl_tree *tree, struct avl_node *node) { struct avl_node *left, *parent; *************** *** 157,161 **** } ! static void rotate_left(struct avl_tree *tree, struct avl_node *node) { struct avl_node *right, *parent; --- 175,179 ---- } ! static void avl_rotate_left(struct avl_tree *tree, struct avl_node *node) { struct avl_node *right, *parent; *************** *** 211,220 **** if (node->balance == -1) { ! rotate_right(tree, parent); return; } ! rotate_left(tree, node); ! rotate_right(tree, node->parent->parent); return; } --- 229,238 ---- if (node->balance == -1) { ! avl_rotate_right(tree, parent); return; } ! avl_rotate_left(tree, node); ! avl_rotate_right(tree, node->parent->parent); return; } *************** *** 233,246 **** if (node->balance == 1) { ! rotate_left(tree, parent); return; } ! rotate_right(tree, node); ! rotate_left(tree, node->parent->parent); return; } ! static void insert_before(struct avl_node *pos_node, struct avl_node *node) { if (pos_node->prev != NULL) --- 251,264 ---- if (node->balance == 1) { ! avl_rotate_left(tree, parent); return; } ! avl_rotate_right(tree, node); ! avl_rotate_left(tree, node->parent->parent); return; } ! static void avl_insert_before(struct avl_node *pos_node, struct avl_node *node) { if (pos_node->prev != NULL) *************** *** 253,257 **** } ! static void insert_after(struct avl_node *pos_node, struct avl_node *node) { if (pos_node->next != NULL) --- 271,275 ---- } ! static void avl_insert_after(struct avl_node *pos_node, struct avl_node *node) { if (pos_node->next != NULL) *************** *** 264,268 **** } ! static void remove(struct avl_node *node) { if (node->prev != NULL) --- 282,286 ---- } ! static void avl_remove(struct avl_node *node) { if (node->prev != NULL) *************** *** 296,300 **** } ! node = find_rec(tree->root, new->key, tree->comp); last = node; --- 314,318 ---- } ! node = avl_find_rec(tree->root, new->key, tree->comp); last = node; *************** *** 316,320 **** new->leader = 0; ! insert_after(last, new); return 0; } --- 334,338 ---- new->leader = 0; ! avl_insert_after(last, new); return 0; } *************** *** 322,326 **** if (node->balance == 1) { ! insert_before(node, new); node->balance = 0; --- 340,344 ---- if (node->balance == 1) { ! avl_insert_before(node, new); node->balance = 0; *************** *** 332,336 **** if (node->balance == -1) { ! insert_after(last, new); node->balance = 0; --- 350,354 ---- if (node->balance == -1) { ! avl_insert_after(last, new); node->balance = 0; *************** *** 342,346 **** if (diff < 0) { ! insert_before(node, new); node->balance = -1; --- 360,364 ---- if (diff < 0) { ! avl_insert_before(node, new); node->balance = -1; *************** *** 351,355 **** } ! insert_after(last, new); node->balance = 1; --- 369,373 ---- } ! avl_insert_after(last, new); node->balance = 1; *************** *** 360,364 **** } ! static void post_delete(struct avl_tree *tree, struct avl_node *node) { struct avl_node *parent; --- 378,382 ---- } ! static void avl_post_delete(struct avl_tree *tree, struct avl_node *node) { struct avl_node *parent; *************** *** 373,377 **** if (parent->balance == 0) { ! post_delete(tree, parent); return; } --- 391,395 ---- if (parent->balance == 0) { ! avl_post_delete(tree, parent); return; } *************** *** 382,386 **** if (parent->right->balance == 0) { ! rotate_left(tree, parent); return; } --- 400,404 ---- if (parent->right->balance == 0) { ! avl_rotate_left(tree, parent); return; } *************** *** 388,399 **** if (parent->right->balance == 1) { ! rotate_left(tree, parent); ! post_delete(tree, parent->parent); return; } ! rotate_right(tree, parent->right); ! rotate_left(tree, parent); ! post_delete(tree, parent->parent); return; } --- 406,417 ---- if (parent->right->balance == 1) { ! avl_rotate_left(tree, parent); ! avl_post_delete(tree, parent->parent); return; } ! avl_rotate_right(tree, parent->right); ! avl_rotate_left(tree, parent); ! avl_post_delete(tree, parent->parent); return; } *************** *** 403,407 **** if (parent->balance == 0) { ! post_delete(tree, parent); return; } --- 421,425 ---- if (parent->balance == 0) { ! avl_post_delete(tree, parent); return; } *************** *** 412,416 **** if (parent->left->balance == 0) { ! rotate_right(tree, parent); return; } --- 430,434 ---- if (parent->left->balance == 0) { ! avl_rotate_right(tree, parent); return; } *************** *** 418,432 **** if (parent->left->balance == -1) { ! rotate_right(tree, parent); ! post_delete(tree, parent->parent); return; } ! rotate_left(tree, parent->left); ! rotate_right(tree, parent); ! post_delete(tree, parent->parent); } ! static struct avl_node *local_min(struct avl_node *node) { while (node->left != NULL) --- 436,450 ---- if (parent->left->balance == -1) { ! avl_rotate_right(tree, parent); ! avl_post_delete(tree, parent->parent); return; } ! avl_rotate_left(tree, parent->left); ! avl_rotate_right(tree, parent); ! avl_post_delete(tree, parent->parent); } ! static struct avl_node *avl_local_min(struct avl_node *node) { while (node->left != NULL) *************** *** 436,440 **** } ! static void delete_worker(struct avl_tree *tree, struct avl_node *node) { struct avl_node *parent, *min; --- 454,466 ---- } ! static struct avl_node *avl_local_max(struct avl_node *node) ! { ! while (node->right != NULL) ! node = node->right; ! ! return node; ! } ! ! static void avl_delete_worker(struct avl_tree *tree, struct avl_node *node) { struct avl_node *parent, *min; *************** *** 460,464 **** if (parent->balance == 0) { ! post_delete(tree, parent); return; } --- 486,490 ---- if (parent->balance == 0) { ! avl_post_delete(tree, parent); return; } *************** *** 466,470 **** if (parent->right->balance == 0) { ! rotate_left(tree, parent); return; } --- 492,496 ---- if (parent->right->balance == 0) { ! avl_rotate_left(tree, parent); return; } *************** *** 472,483 **** if (parent->right->balance == 1) { ! rotate_left(tree, parent); ! post_delete(tree, parent->parent); return; } ! rotate_right(tree, parent->right); ! rotate_left(tree, parent); ! post_delete(tree, parent->parent); return; } --- 498,509 ---- if (parent->right->balance == 1) { ! avl_rotate_left(tree, parent); ! avl_post_delete(tree, parent->parent); return; } ! avl_rotate_right(tree, parent->right); ! avl_rotate_left(tree, parent); ! avl_post_delete(tree, parent->parent); return; } *************** *** 493,497 **** if (parent->balance == 0) { ! post_delete(tree, parent); return; } --- 519,523 ---- if (parent->balance == 0) { ! avl_post_delete(tree, parent); return; } *************** *** 499,503 **** if (parent->left->balance == 0) { ! rotate_right(tree, parent); return; } --- 525,529 ---- if (parent->left->balance == 0) { ! avl_rotate_right(tree, parent); return; } *************** *** 505,516 **** if (parent->left->balance == -1) { ! rotate_right(tree, parent); ! post_delete(tree, parent->parent); return; } ! rotate_left(tree, parent->left); ! rotate_right(tree, parent); ! post_delete(tree, parent->parent); return; } --- 531,542 ---- if (parent->left->balance == -1) { ! avl_rotate_right(tree, parent); ! avl_post_delete(tree, parent->parent); return; } ! avl_rotate_left(tree, parent->left); ! avl_rotate_right(tree, parent); ! avl_post_delete(tree, parent->parent); return; } *************** *** 534,538 **** parent->right = node->right; ! post_delete(tree, node->right); return; } --- 560,564 ---- parent->right = node->right; ! avl_post_delete(tree, node->right); return; } *************** *** 555,564 **** parent->right = node->left; ! post_delete(tree, node->left); return; } ! min = local_min(node->right); ! delete_worker(tree, min); parent = node->parent; --- 581,590 ---- parent->right = node->left; ! avl_post_delete(tree, node->left); return; } ! min = avl_local_min(node->right); ! avl_delete_worker(tree, min); parent = node->parent; *************** *** 633,640 **** else ! delete_worker(tree, node); } ! remove(node); } --- 659,666 ---- else ! avl_delete_worker(tree, node); } ! avl_remove(node); } *************** *** 646,650 **** return NULL; ! return local_min(node); } --- 672,686 ---- return NULL; ! return avl_local_min(node); ! } ! ! struct avl_node *avl_walk_last(struct avl_tree *tree) ! { ! struct avl_node *node = tree->root; ! ! if (node == NULL) ! return NULL; ! ! return avl_local_max(node); } *************** *** 653,654 **** --- 689,701 ---- return node->next; } + + struct avl_node *avl_walk_prev(struct avl_node *node) + { + return node->prev; + } + + /* + * Local Variables: + * c-basic-offset: 2 + * End: + */ Index: olsr.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/olsr.c,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** olsr.c 25 Apr 2007 22:08:09 -0000 1.54 --- olsr.c 5 Jul 2007 22:43:47 -0000 1.55 *************** *** 61,64 **** --- 61,65 ---- #include "log.h" #include "lq_packet.h" + #include "lq_avl.h" #include *************** *** 261,264 **** --- 262,272 ---- changes_hna = OLSR_FALSE; + /* Set avl tree comparator */ + if (olsr_cnf->ipsize == 4) { + avl_comp_default = 0; + } else { + avl_comp_default = avl_comp_ipv6; + } + /* Initialize link set */ olsr_init_link_set(); From (spam-protected) Fri Jul 6 00:45:42 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Thu, 05 Jul 2007 22:45:42 +0000 Subject: [Olsr-cvs] olsrd-current Makefile,1.84,1.85 Message-ID: Update of /cvsroot/olsrd/olsrd-current In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv29067 Modified Files: Makefile Log Message: * releasing 0.5.1 Index: Makefile =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/Makefile,v retrieving revision 1.84 retrieving revision 1.85 diff -C2 -d -r1.84 -r1.85 *** Makefile 1 May 2007 21:36:50 -0000 1.84 --- Makefile 5 Jul 2007 22:45:39 -0000 1.85 *************** *** 38,42 **** # $Id$ ! VERS = 0.5.1pre TOPDIR = . --- 38,42 ---- # $Id$ ! VERS = 0.5.1 TOPDIR = . From (spam-protected) Fri Jul 6 01:12:45 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Thu, 05 Jul 2007 23:12:45 +0000 Subject: [Olsr-cvs] olsrd-current Makefile,1.85,1.86 CHANGELOG,1.62,1.63 Message-ID: Update of /cvsroot/olsrd/olsrd-current In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv7159/olsrd-current Modified Files: Makefile CHANGELOG Log Message: * CVS-HEAD is not 0.5.2pre Index: Makefile =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/Makefile,v retrieving revision 1.85 retrieving revision 1.86 diff -C2 -d -r1.85 -r1.86 *** Makefile 5 Jul 2007 22:45:39 -0000 1.85 --- Makefile 5 Jul 2007 23:12:43 -0000 1.86 *************** *** 38,42 **** # $Id$ ! VERS = 0.5.1 TOPDIR = . --- 38,42 ---- # $Id$ ! VERS = 0.5.2pre TOPDIR = . Index: CHANGELOG =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/CHANGELOG,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** CHANGELOG 5 Jul 2007 22:43:46 -0000 1.62 --- CHANGELOG 5 Jul 2007 23:12:43 -0000 1.63 *************** *** 2,5 **** --- 2,7 ---- $Id$ + 0.5.2 --------------------------------------------------------------------- + 0.5.1 --------------------------------------------------------------------- From (spam-protected) Mon Jul 9 09:27:59 2007 From: (spam-protected) (Andreas Tønnesen) Date: Mon, 09 Jul 2007 07:27:59 +0000 Subject: [Olsr-cvs] olsrd-current README,1.18,1.19 Message-ID: Update of /cvsroot/olsrd/olsrd-current In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16586 Modified Files: README Log Message: Added patch from Roar Rotvik(The README file was not updated for 0.5.1) Index: README =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/README,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** README 3 Apr 2007 08:46:44 -0000 1.18 --- README 9 Jul 2007 07:27:57 -0000 1.19 *************** *** 1,5 **** +====================================================================+ ! | README - olsr.org OLSR daemon 0.5.0, 02.04.2007 | +====================================================================+ --- 1,5 ---- +====================================================================+ ! | README - olsr.org OLSR daemon 0.5.1, 06.07.2007 | +====================================================================+ From (spam-protected) Tue Jul 10 10:42:30 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Tue, 10 Jul 2007 08:42:30 +0000 Subject: [Olsr-cvs] olsrd-current/src hashing.c,1.13,1.14 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11065/src Modified Files: hashing.c Log Message: * fixed hashing bug found and fixed by Sven-Ola Tuecke Index: hashing.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/hashing.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** hashing.c 30 Jun 2007 23:03:10 -0000 1.13 --- hashing.c 10 Jul 2007 08:42:28 -0000 1.14 *************** *** 55,59 **** if(olsr_cnf->ip_version == AF_INET) { /* IPv4 */ ! const olsr_u8_t * const v4x = (const char *)&address; hash = v4x[0] ^ v4x[1] ^ v4x[2] ^ v4x[3]; } else { --- 55,59 ---- if(olsr_cnf->ip_version == AF_INET) { /* IPv4 */ ! const olsr_u8_t * const v4x = (const olsr_u8_t *)&address->v4; hash = v4x[0] ^ v4x[1] ^ v4x[2] ^ v4x[3]; } else { From (spam-protected) Sun Jul 15 19:41:35 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 15 Jul 2007 17:41:35 +0000 Subject: [Olsr-cvs] olsrd-current/lib/quagga/src olsrd_plugin.c,1.3,1.4 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/quagga/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27139/lib/quagga/src Modified Files: olsrd_plugin.c Log Message: * use the correct plugin interface version number Index: olsrd_plugin.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/quagga/src/olsrd_plugin.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** olsrd_plugin.c 11 Mar 2007 23:26:06 -0000 1.3 --- olsrd_plugin.c 15 Jul 2007 17:41:33 -0000 1.4 *************** *** 30,33 **** --- 30,35 ---- #define PLUGIN_AUTHOR "Immo 'FaUl' Wehrenberg" #define MOD_DESC PLUGIN_NAME " " PLUGIN_VERSION " by " PLUGIN_AUTHOR + #define PLUGIN_INTERFACE_VERSION 4 + static void __attribute__ ((constructor)) my_init(void); *************** *** 37,41 **** int olsrd_plugin_interface_version() { ! return OLSRD_PLUGIN_INTERFACE_VERSION; } --- 39,43 ---- int olsrd_plugin_interface_version() { ! return PLUGIN_INTERFACE_VERSION; } From (spam-protected) Sun Jul 15 19:41:35 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 15 Jul 2007 17:41:35 +0000 Subject: [Olsr-cvs] olsrd-current/lib/bmf/src olsrd_plugin.c,1.5,1.6 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/bmf/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27139/lib/bmf/src Modified Files: olsrd_plugin.c Log Message: * use the correct plugin interface version number Index: olsrd_plugin.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/bmf/src/olsrd_plugin.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** olsrd_plugin.c 30 Jun 2007 20:07:47 -0000 1.5 --- olsrd_plugin.c 15 Jul 2007 17:41:33 -0000 1.6 *************** *** 51,54 **** --- 51,56 ---- #include "PacketHistory.h" /* InitPacketHistory() */ + #define PLUGIN_INTERFACE_VERSION 4 + static void __attribute__ ((constructor)) my_init(void); static void __attribute__ ((destructor)) my_fini(void); *************** *** 68,72 **** int olsrd_plugin_interface_version(void) { ! return OLSRD_PLUGIN_INTERFACE_VERSION; } --- 70,74 ---- int olsrd_plugin_interface_version(void) { ! return PLUGIN_INTERFACE_VERSION; } From (spam-protected) Sun Jul 15 19:41:35 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 15 Jul 2007 17:41:35 +0000 Subject: [Olsr-cvs] olsrd-current/lib/txtinfo/src olsrd_plugin.c,1.2,1.3 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/txtinfo/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27139/lib/txtinfo/src Modified Files: olsrd_plugin.c Log Message: * use the correct plugin interface version number Index: olsrd_plugin.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/txtinfo/src/olsrd_plugin.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** olsrd_plugin.c 20 Apr 2007 13:46:04 -0000 1.2 --- olsrd_plugin.c 15 Jul 2007 17:41:33 -0000 1.3 *************** *** 54,57 **** --- 54,58 ---- #include "olsrd_plugin.h" #include "olsrd_txtinfo.h" + #include "defs.h" *************** *** 60,142 **** #define PLUGIN_AUTHOR "Lorenz Schori" #define MOD_DESC PLUGIN_NAME " " PLUGIN_VERSION " by " PLUGIN_AUTHOR ! #define PLUGIN_INTERFACE_VERSION 4 ! struct in_addr ipc_accept_ip; int ipc_port; int nompr; ! ! static void __attribute__ ((constructor)) ! my_init(void); ! ! static void __attribute__ ((destructor)) ! my_fini(void); ! /** *Constructor */ ! static void ! my_init(void) { ! /* Print plugin info to stdout */ ! printf("%s\n", MOD_DESC); ! /* defaults for parameters */ ! ipc_port = 2006; ! ipc_accept_ip.s_addr = htonl(INADDR_LOOPBACK); ! /* highlite neighbours by default */ ! nompr = 0; } - /** *Destructor */ ! static void ! my_fini(void) { ! /* Calls the destruction function ! * olsr_plugin_exit() ! * This function should be present in your ! * sourcefile and all data destruction ! * should happen there - NOT HERE! ! */ ! olsr_plugin_exit(); } ! int ! olsrd_plugin_interface_version(void) { ! return PLUGIN_INTERFACE_VERSION; } ! int ! olsrd_plugin_register_param(char *key, char *value) { ! if(!strcmp(key, "port")) ! { ! ipc_port = atoi(value); ! printf("(TXTINFO) listening on port: %d\n", ipc_port); ! } - if(!strcmp(key, "accept")) - { - inet_aton(value, &ipc_accept_ip); - printf("(TXTINFO) accept only: %s\n", inet_ntoa(ipc_accept_ip)); - } /* ! if(!strcmp(key, "hilitemprneighbours")) ! { ! if(!strcmp(value, "false") || !strcmp(value, "0")) ! { ! nompr=1; ! } ! } ! */ ! return 1; ! } --- 61,131 ---- #define PLUGIN_AUTHOR "Lorenz Schori" #define MOD_DESC PLUGIN_NAME " " PLUGIN_VERSION " by " PLUGIN_AUTHOR ! #define PLUGIN_INTERFACE_VERSION 5 ! union olsr_ip_addr ipc_accept_ip; int ipc_port; int nompr; ! static void my_init(void) __attribute__ ((constructor)); ! static void my_fini(void) __attribute__ ((destructor)); /** *Constructor */ ! static void my_init(void) { ! /* Print plugin info to stdout */ ! printf("%s\n", MOD_DESC); ! /* defaults for parameters */ ! ipc_port = 2006; ! if (olsr_cnf->ip_version == AF_INET) { ! ipc_accept_ip.v4 = htonl(INADDR_LOOPBACK); ! } else { ! ipc_accept_ip.v6 = in6addr_loopback; ! } ! /* highlite neighbours by default */ ! nompr = 0; } /** *Destructor */ ! static void my_fini(void) { ! /* Calls the destruction function ! * olsr_plugin_exit() ! * This function should be present in your ! * sourcefile and all data destruction ! * should happen there - NOT HERE! ! */ ! olsr_plugin_exit(); } ! int olsrd_plugin_interface_version(void) { ! return PLUGIN_INTERFACE_VERSION; } + static const struct olsrd_plugin_parameters plugin_parameters[] = { + { .name = "port", .set_plugin_parameter = &set_plugin_port, .data = &ipc_port }, + { .name = "accept", .set_plugin_parameter = &set_plugin_ipaddress, .data = &ipc_accept_ip }, + }; ! void olsrd_get_plugin_parameters(const struct olsrd_plugin_parameters **params, int *size) { ! *params = plugin_parameters; ! *size = sizeof(plugin_parameters)/sizeof(*plugin_parameters); ! } /* ! * Local Variables: ! * mode: c ! * style: linux ! * c-basic-offset: 4 ! * indent-tabs-mode: nil ! * End: ! */ From (spam-protected) Sun Jul 15 19:41:35 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 15 Jul 2007 17:41:35 +0000 Subject: [Olsr-cvs] olsrd-current/lib/nameservice/src olsrd_plugin.c, 1.13, 1.14 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/nameservice/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27139/lib/nameservice/src Modified Files: olsrd_plugin.c Log Message: * use the correct plugin interface version number Index: olsrd_plugin.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/nameservice/src/olsrd_plugin.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** olsrd_plugin.c 2 Jul 2007 10:59:12 -0000 1.13 --- olsrd_plugin.c 15 Jul 2007 17:41:33 -0000 1.14 *************** *** 46,49 **** --- 46,50 ---- #define PLUGIN_AUTHOR "Bruno Randolf, Jens Nachtigall, Sven-Ola" #define MOD_DESC PLUGIN_NAME " " PLUGIN_VERSION + #define PLUGIN_INTERFACE_VERSION 4 *************** *** 57,61 **** olsrd_plugin_interface_version(void) { ! return OLSRD_PLUGIN_INTERFACE_VERSION; } --- 58,62 ---- olsrd_plugin_interface_version(void) { ! return PLUGIN_INTERFACE_VERSION; } From (spam-protected) Sun Jul 15 19:46:22 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 15 Jul 2007 17:46:22 +0000 Subject: [Olsr-cvs] olsrd-current/src/olsr_switch .cvsignore,NONE,1.1 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src/olsr_switch In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv29091/src/olsr_switch Added Files: .cvsignore Log Message: * ignore dependency files --- NEW FILE: .cvsignore --- *.d From (spam-protected) Sun Jul 15 19:46:49 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 15 Jul 2007 17:46:49 +0000 Subject: [Olsr-cvs] olsrd-current/src plugin_util.h, NONE, 1.1 plugin_util.c, NONE, 1.1 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv29125/src Added Files: plugin_util.h plugin_util.c Log Message: * added common utility functions for plugins --- NEW FILE: plugin_util.c --- /* * The olsr.org Optimized Link-State Routing daemon(olsrd) * Copyright (c) 2007, Bernd Petrovitsch * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * Neither the name of olsr.org, olsrd nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * Visit http://www.olsr.org for more information. * * If you find this software useful feel free to make a donation * to the project. For more information see the website or contact * the copyright holders. * * $Id: plugin_util.c,v 1.1 2007/07/15 17:46:46 bernd67 Exp $ */ #include "plugin_util.h" #include "olsr.h" #include "defs.h" int set_plugin_port(const char *value, void *data) { char *endptr; const unsigned int port = strtoul(value, &endptr, 0); if (*endptr != '\0' || endptr == value) { OLSR_PRINTF(0, "Illegal port number \"%s\"", value); return 1; } if (port > 65535) { OLSR_PRINTF(0, "Port number %u out of range", port); return 1; } if (data != NULL) { unsigned int *v = data; *v = port; OLSR_PRINTF(1, "%s port number %u\n", "Got", port); } else { OLSR_PRINTF(0, "%s port number %u\n", "Ignored", port); } return 0; } int set_plugin_ipaddress(const char *value, void *data) { char buf[INET6_ADDRSTRLEN]; union olsr_ip_addr ip_addr; if (inet_pton(olsr_cnf->ip_version, value, &ip_addr) <= 0) { OLSR_PRINTF(0, "Illegal IP address \"%s\"", value); return 1; } inet_ntop(olsr_cnf->ip_version, &ip_addr, buf, sizeof(buf)); if (data != NULL) { union olsr_ip_addr *v = data; *v = ip_addr; OLSR_PRINTF(1, "%s IP address %s\n", "Got", buf); } else { OLSR_PRINTF(0, "%s IP address %s\n", "Ignored", buf); } return 0; } int set_boolean(const char *value, void *data) { int *v = data; if (strcasecmp (value, "yes") == 0) { *v = 1; } else if (strcasecmp (value, "no") == 0) { *v = 0; } else { return 1; } return 0; } /* * Local Variables: * mode: c * style: linux * c-basic-offset: 4 * indent-tabs-mode: nil * End: */ --- NEW FILE: plugin_util.h --- /* * Copyright (c) 2007, Bernd Petrovitsch * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * Neither the name of the UniK olsr daemon nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * */ /* $Id: plugin_util.h,v 1.1 2007/07/15 17:46:46 bernd67 Exp $ */ /* * Example plugin for olsrd.org OLSR daemon * Only the bare minimum */ #ifndef _OLSRD_PLUGIN_UTIL #define _OLSRD_PLUGIN_UTIL /* Common/utility functions for plugins */ int set_plugin_port(const char *value, void *data); int set_plugin_ipaddress(const char *value, void *data); int set_boolean(const char *value, void *data); #endif /* * Local Variables: * mode: c * style: linux * c-basic-offset: 4 * indent-tabs-mode: nil * End: */ From (spam-protected) Sun Jul 15 19:48:57 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 15 Jul 2007 17:48:57 +0000 Subject: [Olsr-cvs] olsrd-current/lib/tas test.c,1.1,1.2 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/tas In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv29946/lib/tas Modified Files: test.c Log Message: * fixed compile warnings Index: test.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/tas/test.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test.c 12 Apr 2005 17:17:25 -0000 1.1 --- test.c 15 Jul 2007 17:48:55 -0000 1.2 *************** *** 55,59 **** #include ! static void sigHand(int sig) { httpShutdown(); --- 55,60 ---- #include ! static void sigHand(int sig) __attribute__((noreturn)); ! static void sigHand(int sig __attribute__((unused))) { httpShutdown(); From (spam-protected) Sun Jul 15 19:51:24 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 15 Jul 2007 17:51:24 +0000 Subject: [Olsr-cvs] olsrd-current/lib/secure/src olsrd_plugin.c,1.11,1.12 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/secure/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31163/lib/secure/src Modified Files: olsrd_plugin.c Log Message: * use the correct plugin interface version number Index: olsrd_plugin.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/secure/src/olsrd_plugin.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** olsrd_plugin.c 20 Apr 2007 13:46:03 -0000 1.11 --- olsrd_plugin.c 15 Jul 2007 17:51:22 -0000 1.12 *************** *** 49,52 **** --- 49,53 ---- #define PLUGIN_AUTHOR "Andreas T�nnesen" #define MOD_DESC PLUGIN_NAME " " PLUGIN_VERSION " by " PLUGIN_AUTHOR + #define PLUGIN_INTERFACE_VERSION 4 *************** *** 66,70 **** olsrd_plugin_interface_version(void) { ! return OLSRD_PLUGIN_INTERFACE_VERSION; } --- 67,71 ---- olsrd_plugin_interface_version(void) { ! return PLUGIN_INTERFACE_VERSION; } From (spam-protected) Sun Jul 15 19:52:18 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 15 Jul 2007 17:52:18 +0000 Subject: [Olsr-cvs] olsrd-current/lib/nameservice Makefile,1.12,1.13 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/nameservice In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31555/lib/nameservice Modified Files: Makefile Log Message: * cleanup: have a newline at the end of the file Index: Makefile =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/nameservice/Makefile,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Makefile 2 Jul 2007 10:59:12 -0000 1.12 --- Makefile 15 Jul 2007 17:52:16 -0000 1.13 *************** *** 60,62 **** clean: rm -f $(OBJS) $(SRCS:%.c=%.d) $(PLUGIN_FULLNAME) ! endif \ No newline at end of file --- 60,62 ---- clean: rm -f $(OBJS) $(SRCS:%.c=%.d) $(PLUGIN_FULLNAME) ! endif From (spam-protected) Sun Jul 15 19:52:45 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 15 Jul 2007 17:52:45 +0000 Subject: [Olsr-cvs] olsrd-current/lib/dyn_gw_plain/src olsrd_dyn_gw_plain.c, 1.3, 1.4 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/dyn_gw_plain/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31586/lib/dyn_gw_plain/src Modified Files: olsrd_dyn_gw_plain.c Log Message: * use the correct plugin interface version number Index: olsrd_dyn_gw_plain.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/dyn_gw_plain/src/olsrd_dyn_gw_plain.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** olsrd_dyn_gw_plain.c 20 Apr 2007 14:06:18 -0000 1.3 --- olsrd_dyn_gw_plain.c 15 Jul 2007 17:52:43 -0000 1.4 *************** *** 52,55 **** --- 52,57 ---- #define DEBUGLEV 1 + #define PLUGIN_INTERFACE_VERSION 4 + static int has_inet_gateway; *************** *** 61,65 **** olsrd_plugin_interface_version(void) { ! return OLSRD_PLUGIN_INTERFACE_VERSION; } --- 63,67 ---- olsrd_plugin_interface_version(void) { ! return PLUGIN_INTERFACE_VERSION; } From (spam-protected) Sun Jul 15 19:54:09 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 15 Jul 2007 17:54:09 +0000 Subject: [Olsr-cvs] olsrd-current/lib/httpinfo/src admin_interface.h, 1.2, 1.3 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/httpinfo/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32324/lib/httpinfo/src Modified Files: admin_interface.h Log Message: * cosmetic Index: admin_interface.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/httpinfo/src/admin_interface.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** admin_interface.h 21 Feb 2005 19:33:48 -0000 1.2 --- admin_interface.h 15 Jul 2007 17:54:07 -0000 1.3 *************** *** 44,49 **** */ - - #ifndef ADMIN_INTERFACE_H #define ADMIN_INTERFACE_H --- 44,47 ---- From (spam-protected) Sun Jul 15 20:11:48 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 15 Jul 2007 18:11:48 +0000 Subject: [Olsr-cvs] olsrd-current Makefile.inc,1.16,1.17 Message-ID: Update of /cvsroot/olsrd/olsrd-current In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6953 Modified Files: Makefile.inc Log Message: * activate old plugin interface versions per default like before Index: Makefile.inc =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/Makefile.inc,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Makefile.inc 13 May 2007 23:44:23 -0000 1.16 --- Makefile.inc 15 Jul 2007 18:11:45 -0000 1.17 *************** *** 62,65 **** --- 62,68 ---- endif + # options to save space on small systems + DEFINES += -DSUPPORT_OLD_PLUGIN_VERSIONS=1 + # search sources and headers in current dir and in src/ SRCS = $(wildcard src/*.c) From (spam-protected) Sun Jul 15 21:29:39 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 15 Jul 2007 19:29:39 +0000 Subject: [Olsr-cvs] olsrd-current/lib/txtinfo/src olsrd_txtinfo.c, 1.6, 1.7 olsrd_txtinfo.h, 1.1, 1.2 Message-ID: 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;indexnext) ! { ! 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;indexdestinations.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;indexnetworks.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], "\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) { ! int 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 < HASHSIZE; 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 < HASHSIZE; 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) { ! int index; unsigned short is_first; struct mid_entry *entry; *************** *** 501,558 **** /* MID */ ! for( index = 0; index < HASHSIZE; index++ ) ! { entry = mid_set[index].next; ! ! while( entry != &mid_set[index] ) ! { ipc_sendf( olsr_ip_to_string( &entry->main_addr ) ); alias = entry->aliases; is_first = 1; ! while( alias ) ! { ipc_sendf( "%s%s", ! ( is_first ? "\t" : ";" ), ! olsr_ip_to_string( &alias->alias ) ! ); alias = alias->next_alias; is_first = 0; } - entry = entry->next; ipc_sendf("\n"); } } ! ! ipc_sendf("\n"); } ! static void ! send_info(int neighonly) { ! ! /* Print minimal http header */ ! ipc_sendf("HTTP/1.0 200 OK\n"); ! ipc_sendf("Content-type: text/plain\n\n"); ! /* Print tables to IPC socket */ ! /* links + Neighbors */ ! ipc_print_neigh_link(); ! /* topology */ ! if (!neighonly) ipc_print_topology(); ! /* hna */ ! if (!neighonly) ipc_print_hna(); ! /* mid */ ! if (!neighonly) ipc_print_mid(); ! /* routes */ ! if (!neighonly) ipc_print_routes(); } --- 444,494 ---- /* MID */ ! for(index = 0; index < HASHSIZE; index++) { entry = mid_set[index].next; ! ! while( entry != &mid_set[index] ) { ipc_sendf( olsr_ip_to_string( &entry->main_addr ) ); alias = entry->aliases; is_first = 1; ! while( alias ) { ipc_sendf( "%s%s", ! ( is_first ? "\t" : ";" ), ! olsr_ip_to_string( &alias->alias ) ! ); alias = alias->next_alias; is_first = 0; } entry = entry->next; ipc_sendf("\n"); } } ! ipc_sendf("\n"); } ! static void send_info(int neighonly) { ! /* Print minimal http header */ ! ipc_sendf("HTTP/1.0 200 OK\n"); ! ipc_sendf("Content-type: text/plain\n\n"); ! /* Print tables to IPC socket */ ! /* links + Neighbors */ ! ipc_print_neigh_link(); ! /* topology */ ! if (!neighonly) ipc_print_topology(); ! /* hna */ ! if (!neighonly) ipc_print_hna(); ! /* mid */ ! if (!neighonly) ipc_print_mid(); ! /* routes */ ! if (!neighonly) ipc_print_routes(); } *************** *** 564,591 **** */ ! static int ! ipc_sendf(const char* format, ...) { ! char txtnetbuf[TXT_IPC_BUFSIZE]; ! va_list arg; ! int rv; #if defined __FreeBSD__ || defined __NetBSD__ || defined __OpenBSD__ || defined __MacOSX__ ! int flags = 0; #else ! int flags = MSG_NOSIGNAL; #endif ! va_start(arg, format); ! rv = vsnprintf(txtnetbuf, sizeof(txtnetbuf), format, arg); ! va_end(arg); ! if(ipc_socket_up) { ! if (0 > send(ipc_connection, txtnetbuf, rv, flags)) { #ifndef NODEBUG ! olsr_printf(1, "(TXTINFO) Failed sending data to client!\n"); #endif ! close(ipc_connection); ! return - 1; ! } ! } ! return rv; } --- 500,535 ---- */ ! static int ipc_sendf(const char* format, ...) { ! char txtnetbuf[TXT_IPC_BUFSIZE]; ! va_list arg; ! int rv; #if defined __FreeBSD__ || defined __NetBSD__ || defined __OpenBSD__ || defined __MacOSX__ ! int flags = 0; #else ! int flags = MSG_NOSIGNAL; #endif ! va_start(arg, format); ! rv = vsnprintf(txtnetbuf, sizeof(txtnetbuf), format, arg); ! va_end(arg); ! if(ipc_socket_up) { ! if (0 > send(ipc_connection, txtnetbuf, rv, flags)) { #ifndef NODEBUG ! olsr_printf(1, "(TXTINFO) Failed sending data to client!\n"); #endif ! close(ipc_connection); ! return - 1; ! } ! } ! return rv; } + + /* + * Local Variables: + * mode: c + * style: linux + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */ Index: olsrd_txtinfo.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/txtinfo/src/olsrd_txtinfo.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** olsrd_txtinfo.h 31 Jan 2007 12:38:26 -0000 1.1 --- olsrd_txtinfo.h 15 Jul 2007 19:29:37 -0000 1.2 *************** *** 45,62 **** */ ! #ifndef _OLSRD_DOT_DRAW ! #define _OLSRD_DOT_DRAW ! extern struct in_addr ipc_accept_ip; extern int ipc_port; extern int nompr; ! ! int ! olsrd_plugin_init(void); ! ! void ! olsr_plugin_exit(void); #endif --- 45,63 ---- */ ! #ifndef _OLSRD_TXTINFO ! #define _OLSRD_TXTINFO + #include "olsr_types.h" + #include "olsrd_plugin.h" + #include "plugin_util.h" ! extern union olsr_ip_addr ipc_accept_ip; extern int ipc_port; extern int nompr; ! int olsrd_plugin_interface_version(void); ! int olsrd_plugin_init(void); ! void olsr_plugin_exit(void); ! void olsrd_get_plugin_parameters(const struct olsrd_plugin_parameters **params, int *size); #endif From (spam-protected) Sun Jul 15 21:29:40 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 15 Jul 2007 19:29:40 +0000 Subject: [Olsr-cvs] olsrd-current/lib/dot_draw version-script.txt,1.2,1.3 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/dot_draw In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5004/lib/dot_draw Modified Files: version-script.txt 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: version-script.txt =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/dot_draw/version-script.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** version-script.txt 29 May 2005 12:47:35 -0000 1.2 --- version-script.txt 15 Jul 2007 19:29:38 -0000 1.3 *************** *** 3,8 **** global: olsrd_plugin_interface_version; - olsrd_plugin_register_param; olsrd_plugin_init; local: --- 3,8 ---- global: olsrd_plugin_interface_version; olsrd_plugin_init; + olsrd_get_plugin_parameters; local: From (spam-protected) Sun Jul 15 21:29:39 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 15 Jul 2007 19:29:39 +0000 Subject: [Olsr-cvs] olsrd-current/lib/dot_draw/src olsrd_dot_draw.c, 1.24, 1.25 olsrd_dot_draw.h, 1.8, 1.9 olsrd_plugin.c, 1.15, 1.16 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/dot_draw/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5004/lib/dot_draw/src Modified Files: olsrd_dot_draw.c olsrd_dot_draw.h olsrd_plugin.c 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_dot_draw.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/dot_draw/src/olsrd_dot_draw.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** olsrd_dot_draw.h 20 Apr 2007 14:20:11 -0000 1.8 --- olsrd_dot_draw.h 15 Jul 2007 19:29:37 -0000 1.9 *************** *** 48,66 **** #define _OLSRD_DOT_DRAW extern struct in_addr ipc_accept_ip; extern int ipc_port; ! int ! olsrd_plugin_interface_version(void); ! ! int ! olsrd_plugin_init(void); ! ! int ! olsrd_plugin_register_param(char *key, char *value); ! ! void ! olsr_plugin_exit(void); #endif --- 48,61 ---- #define _OLSRD_DOT_DRAW + #include "olsrd_plugin.h" + #include "plugin_util.h" extern struct in_addr ipc_accept_ip; extern int ipc_port; ! int olsrd_plugin_interface_version(void); ! int olsrd_plugin_init(void); ! void olsr_plugin_exit(void); ! void olsrd_get_plugin_parameters(const struct olsrd_plugin_parameters **params, int *size); #endif Index: olsrd_dot_draw.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/dot_draw/src/olsrd_dot_draw.c,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** olsrd_dot_draw.c 1 Jul 2007 01:17:38 -0000 1.24 --- olsrd_dot_draw.c 15 Jul 2007 19:29:37 -0000 1.25 *************** *** 237,243 **** } - /* Register with olsrd */ ! printf("Adding socket with olsrd\n"); add_olsr_socket(ipc_socket, &ipc_action); ipc_socket_up = 1; --- 237,242 ---- } /* Register with olsrd */ ! //printf("Adding socket with olsrd\n"); add_olsr_socket(ipc_socket, &ipc_action); ipc_socket_up = 1; Index: olsrd_plugin.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/dot_draw/src/olsrd_plugin.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** olsrd_plugin.c 1 Jul 2007 01:17:38 -0000 1.15 --- olsrd_plugin.c 15 Jul 2007 19:29:37 -0000 1.16 *************** *** 43,48 **** * Dynamic linked library for the olsr.org olsr daemon */ - - #include #include --- 43,46 ---- *************** *** 61,76 **** #define PLUGIN_AUTHOR "Andreas T�nnesen" #define MOD_DESC PLUGIN_NAME " " PLUGIN_VERSION " by " PLUGIN_AUTHOR ! #define PLUGIN_INTERFACE_VERSION 4 ! struct in_addr ipc_accept_ip; int ipc_port; ! ! static void __attribute__ ((constructor)) ! my_init(void); ! ! static void __attribute__ ((destructor)) ! my_fini(void); --- 59,69 ---- #define PLUGIN_AUTHOR "Andreas T�nnesen" #define MOD_DESC PLUGIN_NAME " " PLUGIN_VERSION " by " PLUGIN_AUTHOR ! #define PLUGIN_INTERFACE_VERSION 5 struct in_addr ipc_accept_ip; int ipc_port; ! static void my_init(void) __attribute__ ((constructor)) ; ! static void my_fini(void) __attribute__ ((destructor)); *************** *** 78,90 **** *Constructor */ ! static void ! my_init(void) { ! /* Print plugin info to stdout */ ! printf("%s\n", MOD_DESC); ! /* defaults for parameters */ ! ipc_port = 2004; ! ipc_accept_ip.s_addr = htonl(INADDR_LOOPBACK); } --- 71,82 ---- *Constructor */ ! static void my_init(void) { ! /* Print plugin info to stdout */ ! printf("%s\n", MOD_DESC); ! /* defaults for parameters */ ! ipc_port = 2004; ! ipc_accept_ip.s_addr = htonl(INADDR_LOOPBACK); } *************** *** 93,133 **** *Destructor */ ! static void ! my_fini(void) { ! /* Calls the destruction function ! * olsr_plugin_exit() ! * This function should be present in your ! * sourcefile and all data destruction ! * should happen there - NOT HERE! ! */ ! olsr_plugin_exit(); } ! int ! olsrd_plugin_interface_version(void) { ! return PLUGIN_INTERFACE_VERSION; } ! int ! olsrd_plugin_register_param(char *key, char *value) ! { ! if(!strcmp(key, "Port")) ! { ! ipc_port = atoi(value); ! olsr_printf(0, "(DOT DRAW) listening on port: %d\n", ipc_port); ! return 1; ! } ! if(!strcmp(key, "Accept")) ! { ! inet_aton(value, &ipc_accept_ip); ! olsr_printf(0, "(DOT DRAW) accept only: %s\n", inet_ntoa(ipc_accept_ip)); ! return 1; ! } ! olsr_printf(0, "(DOT DRAW) ignored: %s=\"%s\"\n", key, value); ! return 1; } --- 85,123 ---- *Destructor */ ! static void my_fini(void) { ! /* Calls the destruction function ! * olsr_plugin_exit() ! * This function should be present in your ! * sourcefile and all data destruction ! * should happen there - NOT HERE! ! */ ! olsr_plugin_exit(); } ! int olsrd_plugin_interface_version(void) { ! return PLUGIN_INTERFACE_VERSION; } ! static const struct olsrd_plugin_parameters plugin_parameters[] = { ! { .name = "port", .set_plugin_parameter = &set_plugin_port, .data = &ipc_port }, ! { .name = "accept", .set_plugin_parameter = &set_plugin_ipaddress, .data = &ipc_accept_ip }, ! }; ! void olsrd_get_plugin_parameters(const struct olsrd_plugin_parameters **params, int *size) ! { ! *params = plugin_parameters; ! *size = sizeof(plugin_parameters)/sizeof(*plugin_parameters); } + + /* + * Local Variables: + * mode: c + * style: linux + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */ From (spam-protected) Sun Jul 15 21:29:39 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 15 Jul 2007 19:29:39 +0000 Subject: [Olsr-cvs] olsrd-current/src plugin_loader.c, 1.26, 1.27 plugin_loader.h, 1.16, 1.17 olsrd_plugin.h, 1.2, 1.3 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5004/src Modified Files: plugin_loader.c plugin_loader.h olsrd_plugin.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: plugin_loader.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/plugin_loader.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** plugin_loader.h 4 Jul 2007 01:52:35 -0000 1.16 --- plugin_loader.h 15 Jul 2007 19:29:37 -0000 1.17 *************** *** 43,48 **** #define _OLSR_PLUGIN_LOADER ! #include ! #include #include "olsr_types.h" #include "olsr_cfg.h" --- 43,47 ---- #define _OLSR_PLUGIN_LOADER ! #include "olsrd_plugin.h" #include "olsr_types.h" #include "olsr_cfg.h" *************** *** 50,77 **** #ifndef OLSR_PLUGIN ! struct olsr_plugin ! { ! /* The handle */ ! void *dlhandle; ! struct plugin_param *params; ! int plugin_interface_version; ! int (*register_param)(char *, char *); ! int (*plugin_init)(void); ! struct olsr_plugin *next; }; ! int ! olsr_load_plugins(void); ! void ! olsr_close_plugins(void); ! int ! olsr_plugin_io(int, void *, size_t); #endif #endif --- 49,100 ---- #ifndef OLSR_PLUGIN + /* all */ + typedef int (*plugin_init_func)(void); + typedef int (*get_interface_version_func)(void); ! #if SUPPORT_OLD_PLUGIN_VERSIONS ! /* version 4 */ ! typedef int (*register_param_func)(char *, char *); ! #endif ! ! /* version 5 */ ! typedef void (*get_plugin_parameters_func)(const struct olsrd_plugin_parameters **params, unsigned int *size); ! ! ! struct olsr_plugin { ! /* The handle */ ! void *dlhandle; ! struct plugin_param *params; ! int plugin_interface_version; ! #if SUPPORT_OLD_PLUGIN_VERSIONS ! /* version 4 */ ! register_param_func register_param; ! #endif ! plugin_init_func plugin_init; ! ! /* version 5 */ ! const struct olsrd_plugin_parameters *plugin_parameters; ! unsigned int plugin_parameters_size; ! struct olsr_plugin *next; }; ! void olsr_load_plugins(void); ! void olsr_close_plugins(void); ! int olsr_plugin_io(int, void *, size_t); #endif #endif + + /* + * Local Variables: + * mode: c + * style: linux + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */ Index: olsrd_plugin.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/olsrd_plugin.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** olsrd_plugin.h 20 Apr 2007 13:46:04 -0000 1.2 --- olsrd_plugin.h 15 Jul 2007 19:29:37 -0000 1.3 *************** *** 41,46 **** ! /* Interface version 4 is new direct access to main functions */ ! #define OLSRD_PLUGIN_INTERFACE_VERSION 4 --- 41,47 ---- ! /* Define the most recent version */ ! #define MOST_RECENT_PLUGIN_INTERFACE_VERSION 5 ! #define LAST_SUPPORTED_PLUGIN_INTERFACE_VERSION 4 *************** *** 48,52 **** * Functions that the plugin MUST provide * ****************************************************************************/ - #if 1 /* We hide them from the compiler here to allow the plugins itself to declare them --- 49,52 ---- *************** *** 60,82 **** * Used by main olsrd to check plugin interface version */ ! int ! olsrd_plugin_interface_version(void); /** * Register parameters from config file * Called for all plugin parameters */ ! int ! olsrd_plugin_register_param(char *key, char *value); /** ! * Initialize plugin ! * Called after all parameters are passed */ ! int ! olsrd_plugin_init(void); #endif #endif --- 60,105 ---- * Used by main olsrd to check plugin interface version */ ! int olsrd_plugin_interface_version(void); /** + * Initialize plugin + * Called after all parameters are passed + */ + int olsrd_plugin_init(void); + + + /* Interface version 4 */ + /** * Register parameters from config file * Called for all plugin parameters */ ! int olsrd_plugin_register_param(char *key, char *value); + /* Interface version 5 */ + + typedef int (*set_plugin_parameter)(const char *value, void *data); + + struct olsrd_plugin_parameters { + const char *name; + set_plugin_parameter set_plugin_parameter; + void *data; + }; /** ! * Delivers the (address of the) table and the size of the parameter description */ ! void olsrd_get_plugin_parameters(const struct olsrd_plugin_parameters **params, int *size); ! #endif #endif + + /* + * Local Variables: + * mode: c + * style: linux + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */ Index: plugin_loader.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/plugin_loader.c,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** plugin_loader.c 4 Jul 2007 01:50:45 -0000 1.26 --- plugin_loader.c 15 Jul 2007 19:29:37 -0000 1.27 *************** *** 42,56 **** #include "plugin_loader.h" #include "olsrd_plugin.h" #include "defs.h" #include "olsr.h" - /* Local functions */ ! static void ! init_olsr_plugin(struct olsr_plugin *); ! static int ! olsr_load_dl(char *, struct plugin_param *); ! static struct olsr_plugin *olsr_plugins; --- 42,57 ---- #include "plugin_loader.h" #include "olsrd_plugin.h" + #include "plugin_util.h" #include "defs.h" #include "olsr.h" ! #include ! /* Local functions */ ! static int init_olsr_plugin(struct olsr_plugin *); ! static int olsr_load_dl(char *, struct plugin_param *); ! static int olsr_add_dl(struct olsr_plugin *); ! static struct olsr_plugin *olsr_plugins = NULL; *************** *** 60,83 **** *@return the number of plugins loaded */ ! int ! olsr_load_plugins(void) { ! struct plugin_entry *entry = olsr_cnf->plugins; ! int loaded = 0; ! OLSR_PRINTF(0, "Loading plugins...\n\n"); ! while(entry) ! { ! if(olsr_load_dl(entry->name, entry->params) < 0) ! OLSR_PRINTF(0, "PLUGIN %s LOADING FAILED! --\n\n", entry->name); ! else { ! loaded++; ! } ! ! entry = entry->next; } ! return loaded; } - /** *Try to load a shared library and extract --- 61,80 ---- *@return the number of plugins loaded */ ! void olsr_load_plugins(void) { ! struct plugin_entry *entry = olsr_cnf->plugins; ! int rv = 0; ! for (entry = olsr_cnf->plugins; entry != NULL; entry = entry->next) { ! if(olsr_load_dl(entry->name, entry->params) < 0) { ! rv = 1; ! } } ! if (rv != 0) { ! OLSR_PRINTF(0, "-- PLUGIN LOADING FAILED! --\n"); ! exit(1); ! } ! OLSR_PRINTF(0, "-- ALL PLUGINS LOADED! --\n\n"); } /** *Try to load a shared library and extract *************** *** 88,191 **** *@return negative on error */ ! int ! olsr_load_dl(char *libname, struct plugin_param *params) { ! struct olsr_plugin new_entry, *entry; ! int (*get_interface_version)(void); ! int *interface_version; ! OLSR_PRINTF(0, "---------- Plugin loader ----------\nLibrary: %s\n", libname); ! if(NULL == (new_entry.dlhandle = dlopen(libname, RTLD_NOW))) ! { ! OLSR_PRINTF(0, "DL loading failed: \"%s\"!\n", dlerror()); ! return -1; } ! /* Fetch the interface version function, 3 different ways */ ! OLSR_PRINTF(1, "Checking plugin interface version... "); ! if((get_interface_version = dlsym(new_entry.dlhandle, "olsrd_plugin_interface_version")) == NULL) ! { ! OLSR_PRINTF(1, "trying v2 detection... "); ! if((get_interface_version = dlsym(new_entry.dlhandle, "get_plugin_interface_version")) == NULL) ! { ! OLSR_PRINTF(1, "trying v1 detection... "); ! if((interface_version = dlsym(new_entry.dlhandle, "plugin_interface_version")) == NULL) ! { ! OLSR_PRINTF(0, "FAILED: \"%s\"\n", dlerror()); ! dlclose(new_entry.dlhandle); ! return -1; ! } ! else ! { ! new_entry.plugin_interface_version = *interface_version; ! } ! } ! else ! { ! new_entry.plugin_interface_version = get_interface_version(); } } ! else ! { ! new_entry.plugin_interface_version = get_interface_version(); } ! OLSR_PRINTF(0, " %d - OK\n", new_entry.plugin_interface_version); ! if ( new_entry.plugin_interface_version < 4 ) ! { ! /* old plugin interface */ ! ! OLSR_PRINTF(0, "\nWARNING: YOU ARE USING AN OLD DEPRECATED PLUGIN INTERFACE! DETECTED VERSION %d CURRENT VERSION %d\nPLEASE UPGRADE YOUR PLUGIN!\nWILL CONTINUE IN 5 SECONDS...\n\n", new_entry.plugin_interface_version, OLSRD_PLUGIN_INTERFACE_VERSION); ! ! sleep(5); ! dlclose(new_entry.dlhandle); ! return -1; } ! else ! { ! /* new plugin interface */ ! ! if ( new_entry.plugin_interface_version != OLSRD_PLUGIN_INTERFACE_VERSION ) ! { ! OLSR_PRINTF(0, "\n\nWARNING: VERSION MISSMATCH! DETECTED %d CURRENT VERSION %d\nTHIS CAN CAUSE UNEXPECTED BEHAVIOUR AND CRASHES!\nWILL CONTINUE IN 5 SECONDS...\n\n", get_interface_version(), OLSRD_PLUGIN_INTERFACE_VERSION); ! sleep(5); ! } ! /* Fetch the init function */ ! OLSR_PRINTF(1, "Trying to fetch plugin init function... "); ! if((new_entry.plugin_init = dlsym(new_entry.dlhandle, "olsrd_plugin_init")) == NULL) ! { ! OLSR_PRINTF(1, "FAILED: \"%s\"\n", dlerror()); ! dlclose(new_entry.dlhandle); ! return -1; ! } ! else ! { ! OLSR_PRINTF(1, "OK\n"); ! } } - - /* Fetch the parameter function */ - OLSR_PRINTF(1, "Trying to fetch param function... "); - if((new_entry.register_param = dlsym(new_entry.dlhandle, "olsrd_plugin_register_param")) == NULL) - OLSR_PRINTF(1, "FAILED: \"%s\"\n", dlerror()); - else OLSR_PRINTF(1, "OK\n"); ! entry = olsr_malloc(sizeof(struct olsr_plugin), "Plugin entry"); ! memcpy(entry, &new_entry, sizeof(struct olsr_plugin)); ! entry->params = params; ! ! /* Initialize the plugin */ ! init_olsr_plugin(entry); ! /* queue */ ! entry->next = olsr_plugins; ! olsr_plugins = entry; ! OLSR_PRINTF(0, "---------- LIBRARY LOADED ----------\n\n"); ! return 0; } --- 85,228 ---- *@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"); ! int rv; ! OLSR_PRINTF(0, "---------- LOADING LIBRARY %s ----------\n", libname); ! plugin->dlhandle = dlopen(libname, RTLD_NOW); ! if(plugin->dlhandle == NULL) { ! const int save_errno = errno; ! OLSR_PRINTF(1, "DL loading failed: \"%s\"!\n", dlerror()); ! free(plugin); ! errno = save_errno; ! return -1; } ! rv = olsr_add_dl(plugin); ! if (rv == -1) { ! const int save_errno = errno; ! dlclose(plugin->dlhandle); ! free(plugin); ! errno = save_errno; ! } else { ! plugin->params = params; ! ! /* Initialize the plugin */ ! if (init_olsr_plugin(plugin) != 0) { ! rv = -1; } + + /* queue */ + plugin->next = olsr_plugins; + olsr_plugins = plugin; } ! OLSR_PRINTF(0, "---------- LIBRARY %s %s ----------\n\n", libname, rv == 0 ? "LOADED" : "FAILED"); ! return rv; ! } ! ! #if SUPPORT_OLD_PLUGIN_VERSIONS ! static int try_old_versions(const struct olsr_plugin *plugin) ! { ! get_interface_version_func get_interface_version; ! int *interface_version; ! ! OLSR_PRINTF(1, "trying v2 detection... "); ! get_interface_version = dlsym(plugin->dlhandle, "get_plugin_interface_version"); ! if (get_interface_version != NULL) { ! return get_interface_version(); } ! ! OLSR_PRINTF(1, "trying v1 detection... "); ! interface_version = dlsym(plugin->dlhandle, "plugin_interface_version"); ! if (interface_version != NULL) { ! return *interface_version; ! } ! OLSR_PRINTF(0, "FAILED: \"%s\"\n", dlerror()); ! return -1; ! } ! #else ! #define try_old_versions(plugin) -1 ! #endif ! ! static int olsr_add_dl(struct olsr_plugin *plugin) ! { ! get_interface_version_func get_interface_version; ! get_plugin_parameters_func get_plugin_parameters; ! int plugin_interface_version; ! ! /* Fetch the interface version function, 3 different ways */ ! OLSR_PRINTF(0, "Checking plugin interface version: "); ! get_interface_version = dlsym(plugin->dlhandle, "olsrd_plugin_interface_version"); ! if (get_interface_version == NULL) { ! plugin_interface_version = try_old_versions(plugin); ! } else { ! plugin_interface_version = get_interface_version(); ! } ! if (plugin_interface_version == -1) { ! OLSR_PRINTF(0, "FAILED: \"%s\"\n", dlerror()); ! return -1; ! } ! OLSR_PRINTF(0, " %d - OK\n", plugin_interface_version); ! if (plugin_interface_version < 5){ ! /* old plugin interface */ ! OLSR_PRINTF(0, "\nWARNING: YOU ARE USING AN OLD DEPRECATED PLUGIN INTERFACE!\n" ! "DETECTED VERSION %d AND THE CURRENT VERSION IS %d\n" ! "PLEASE UPGRADE YOUR PLUGIN!\n", plugin_interface_version, MOST_RECENT_PLUGIN_INTERFACE_VERSION); ! #if SUPPORT_OLD_PLUGIN_VERSIONS ! OLSR_PRINTF(0, "WILL CONTINUE IN 5 SECONDS...\n\n"); ! sleep(5); ! #else ! return -1; ! #endif } ! ! #if SUPPORT_OLD_PLUGIN_VERSIONS ! /* new plugin interface */ ! if (plugin_interface_version < LAST_SUPPORTED_PLUGIN_INTERFACE_VERSION) { ! OLSR_PRINTF(0, "\n\nWARNING: VERSION MISMATCH!\n" ! "DETECTED %d AND LAST SUPPORTED VERSION IS %d\n" ! "THIS CAN CAUSE UNEXPECTED BEHAVIOUR AND CRASHES!\n" ! "WILL CONTINUE IN 5 SECONDS...\n\n", get_interface_version(), LAST_SUPPORTED_PLUGIN_INTERFACE_VERSION); ! sleep(5); ! } ! #endif ! /* Fetch the init function */ ! OLSR_PRINTF(1, "Trying to fetch plugin init function: "); ! plugin->plugin_init = dlsym(plugin->dlhandle, "olsrd_plugin_init"); ! if (plugin->plugin_init == NULL) { ! OLSR_PRINTF(0, "FAILED: \"%s\"\n", dlerror()); ! return -1; } OLSR_PRINTF(1, "OK\n"); ! OLSR_PRINTF(1, "Trying to fetch parameter table and it's size... \n"); ! get_plugin_parameters = dlsym(plugin->dlhandle, "olsrd_get_plugin_parameters"); ! if (get_plugin_parameters != NULL) { ! (*get_plugin_parameters)(&plugin->plugin_parameters, &plugin->plugin_parameters_size); ! } else { ! #if SUPPORT_OLD_PLUGIN_VERSIONS ! /* Fetch the parameter function */ ! OLSR_PRINTF(1, "Trying to fetch param function: "); ! plugin->register_param = dlsym(plugin->dlhandle, "olsrd_plugin_register_param"); ! if(plugin->register_param == NULL) { ! OLSR_PRINTF(1, "FAILED: \"%s\"\n", dlerror()); ! } else { ! OLSR_PRINTF(1, "OK\n"); ! } ! plugin->plugin_parameters = NULL; ! plugin->plugin_parameters_size = 0; ! #else ! OLSR_PRINTF(0, "Old plugin interfaces are not supported\n"); ! return -1; ! #endif ! } ! return 0; } *************** *** 199,226 **** *@param entry the plugin to initialize * ! *@return nada */ ! void ! init_olsr_plugin(struct olsr_plugin *entry) { ! if(entry->register_param) ! { ! struct plugin_param *params; ! OLSR_PRINTF(1, "Sending parameters...\n"); ! for(params = entry->params; params; params = params->next) ! { ! int retval = entry->register_param(params->key, params->value); ! OLSR_PRINTF(1, "\"%s\"/\"%s\"... ", params->key, params->value); ! if(retval < 0) ! { ! fprintf(stderr, "\nFatal error in plugin parameter \"%s\"/\"%s\"\n", params->key, params->value); ! exit(EXIT_FAILURE); } ! OLSR_PRINTF(1, "%s\n", retval == 0 ? "FAILED" : "OK"); } } ! ! OLSR_PRINTF(1, "Running plugin_init function...\n"); entry->plugin_init(); } --- 236,290 ---- *@param entry the plugin to initialize * ! *@return -1 if there was an error */ ! int init_olsr_plugin(struct olsr_plugin *entry) { ! int rv = 0; ! struct plugin_param *params; ! OLSR_PRINTF(1, "Sending parameters...\n"); ! for(params = entry->params; params != NULL; params = params->next) { ! OLSR_PRINTF(1, "\"%s\"/\"%s\"... ", params->key, params->value); ! if (entry->plugin_parameters_size != 0) { ! unsigned int i; ! int rc = 0; ! for (i = 0; i < entry->plugin_parameters_size; i++) { ! if (strcasecmp(entry->plugin_parameters[i].name, params->key) == 0) { ! /* we have found it! */ ! rc = entry->plugin_parameters[i].set_plugin_parameter(params->value, entry->plugin_parameters[i].data); ! if (rc != 0) { ! fprintf(stderr, "\nFatal error in plugin parameter \"%s\"/\"%s\"\n", params->key, params->value); ! rv = -1; ! } ! break; ! } } ! if (i >= entry->plugin_parameters_size) { ! OLSR_PRINTF(0, "Ignored parameter \"%s\"\n", params->key); ! } else { ! OLSR_PRINTF(1, "%s: %s\n", params->key, rc == 0 ? "OK" : "FAILED"); ! if (rc != 0) { ! rv = -1; ! } ! } ! #if SUPPORT_OLD_PLUGIN_VERSIONS ! } else if(entry->register_param != NULL) { ! int rc; ! OLSR_PRINTF(0, "Registering parameter \"%s\": ", params->key); ! rc = entry->register_param(params->key, params->value); ! if(rc < 0) { ! fprintf(stderr, "\nFatal error in plugin parameter \"%s\"/\"%s\"\n", params->key, params->value); ! exit(EXIT_FAILURE); ! } ! OLSR_PRINTF(0, "%s\n", rc == 0 ? "FAILED" : "OK"); ! #endif ! } else { ! OLSR_PRINTF(0, "I don't know what to do with \"%s\"!\n", params->key); ! rv = -1; } } ! ! OLSR_PRINTF(1, "Running plugin_init function...\n"); entry->plugin_init(); + return rv; } *************** *** 229,239 **** *Close all loaded plugins */ ! void ! olsr_close_plugins(void) { ! struct olsr_plugin *entry; ! OLSR_PRINTF(1, "Closing plugins...\n"); ! for(entry = olsr_plugins; entry != NULL; entry = entry->next) ! dlclose(entry->dlhandle); } --- 293,313 ---- *Close all loaded plugins */ ! void olsr_close_plugins(void) { ! struct olsr_plugin *entry; ! OLSR_PRINTF(0, "Closing plugins...\n"); ! for(entry = olsr_plugins; entry != NULL; entry = entry->next) { ! dlclose(entry->dlhandle); ! entry->dlhandle = NULL; ! } } + + /* + * Local Variables: + * mode: c + * style: linux + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */ From (spam-protected) Sun Jul 15 21:29:40 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 15 Jul 2007 19:29:40 +0000 Subject: [Olsr-cvs] olsrd-current/lib/httpinfo version-script.txt,1.2,1.3 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/httpinfo In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5004/lib/httpinfo Modified Files: version-script.txt 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: version-script.txt =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/httpinfo/version-script.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** version-script.txt 29 May 2005 12:47:41 -0000 1.2 --- version-script.txt 15 Jul 2007 19:29:37 -0000 1.3 *************** *** 3,8 **** global: olsrd_plugin_interface_version; - olsrd_plugin_register_param; olsrd_plugin_init; local: --- 3,8 ---- global: olsrd_plugin_interface_version; olsrd_plugin_init; + olsrd_get_plugin_parameters; local: From (spam-protected) Sun Jul 15 21:29:39 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 15 Jul 2007 19:29:39 +0000 Subject: [Olsr-cvs] olsrd-current/lib/txtinfo version-script.txt,1.1,1.2 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/txtinfo In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5004/lib/txtinfo Modified Files: version-script.txt 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: version-script.txt =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/txtinfo/version-script.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** version-script.txt 31 Jan 2007 12:38:26 -0000 1.1 --- version-script.txt 15 Jul 2007 19:29:37 -0000 1.2 *************** *** 3,8 **** global: olsrd_plugin_interface_version; - olsrd_plugin_register_param; olsrd_plugin_init; local: --- 3,8 ---- global: olsrd_plugin_interface_version; olsrd_plugin_init; + olsrd_get_plugin_parameters; local: From (spam-protected) Sun Jul 15 21:29:40 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 15 Jul 2007 19:29:40 +0000 Subject: [Olsr-cvs] olsrd-current/lib/httpinfo/src olsrd_httpinfo.c, 1.68, 1.69 olsrd_httpinfo.h, 1.29, 1.30 olsrd_plugin.h, 1.22, 1.23 olsrd_plugin.c, 1.16, 1.17 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/httpinfo/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5004/lib/httpinfo/src Modified Files: olsrd_httpinfo.c olsrd_httpinfo.h olsrd_plugin.h olsrd_plugin.c 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_httpinfo.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/httpinfo/src/olsrd_httpinfo.c,v retrieving revision 1.68 retrieving revision 1.69 diff -C2 -d -r1.68 -r1.69 *** olsrd_httpinfo.c 2 Jul 2007 10:20:24 -0000 1.68 --- olsrd_httpinfo.c 15 Jul 2007 19:29:38 -0000 1.69 *************** *** 131,192 **** }; ! static int ! get_http_socket(int); ! ! static int ! build_tabs(char *, olsr_u32_t, int); ! ! static void ! parse_http_request(int); ! int ! build_http_header(http_header_type, olsr_bool, olsr_u32_t, char *, olsr_u32_t); ! static int ! build_frame(char *, char *, int, char *, olsr_u32_t, int(*frame_body_cb)(char *, olsr_u32_t)); ! int ! build_routes_body(char *, olsr_u32_t); ! int ! build_config_body(char *, olsr_u32_t); ! int ! build_neigh_body(char *, olsr_u32_t); ! int ! build_topo_body(char *, olsr_u32_t); ! int ! build_hna_body(char *, olsr_u32_t); ! int ! build_mid_body(char *, olsr_u32_t); ! int ! build_nodes_body(char *, olsr_u32_t); ! int ! build_all_body(char *, olsr_u32_t); ! int ! build_about_body(char *, olsr_u32_t); ! int ! build_cfgfile_body(char *, olsr_u32_t); ! char * ! sockaddr_to_string(struct sockaddr *); ! olsr_bool ! check_allowed_ip(union olsr_ip_addr *); ! static int ! build_ip_txt(char *buf, const olsr_u32_t bufsize, const olsr_bool want_link, const char * const ipstr, const char * const maskstr); ! static int ! build_ipaddr_link(char *buf, const olsr_u32_t bufsize, const olsr_bool want_link, union olsr_ip_addr * const ipaddr, const union hna_netmask * const mask); static ssize_t writen(int fd, const void *buf, size_t count); --- 131,171 ---- }; + static int get_http_socket(int); ! static int build_tabs(char *, olsr_u32_t, int); ! static void parse_http_request(int); ! static int build_http_header(http_header_type, olsr_bool, olsr_u32_t, char *, olsr_u32_t); ! static int build_frame(char *, char *, int, char *, olsr_u32_t, int(*frame_body_cb)(char *, olsr_u32_t)); ! static int build_routes_body(char *, olsr_u32_t); ! static int build_config_body(char *, olsr_u32_t); ! static int build_neigh_body(char *, olsr_u32_t); ! static int build_topo_body(char *, olsr_u32_t); ! static int build_hna_body(char *, olsr_u32_t); ! static int build_mid_body(char *, olsr_u32_t); ! static int build_nodes_body(char *, olsr_u32_t); ! static int build_all_body(char *, olsr_u32_t); ! static int build_about_body(char *, olsr_u32_t); + static int build_cfgfile_body(char *, olsr_u32_t); ! static int check_allowed_ip(const struct allowed_net * const allowed_nets, const union olsr_ip_addr * const addr); ! static int build_ip_txt(char *buf, const olsr_u32_t bufsize, const olsr_bool want_link, const char * const ipstr, const char * const maskstr); + static int build_ipaddr_link(char *buf, const olsr_u32_t bufsize, const olsr_bool want_link, union olsr_ip_addr * const ipaddr, const union hna_netmask * const mask); ! static char *olsr_netmask_to_string(union hna_netmask *); static ssize_t writen(int fd, const void *buf, size_t count); *************** *** 337,342 **** int c = 0, r = 1, size = 0; - addrlen = sizeof(struct sockaddr_in); - if(curr_clients >= MAX_CLIENTS) return; --- 316,319 ---- *************** *** 344,347 **** --- 321,325 ---- curr_clients++; + addrlen = sizeof(struct sockaddr_in); if ((client_sockets[curr_clients] = accept(fd, (struct sockaddr *) &pin, &addrlen)) == -1) { *************** *** 350,354 **** } ! if(!check_allowed_ip((union olsr_ip_addr *)&pin.sin_addr.s_addr)) { olsr_printf(1, "HTTP request from non-allowed host %s!\n", --- 328,332 ---- } ! if(!check_allowed_ip(allowed_nets, (union olsr_ip_addr *)&pin.sin_addr.s_addr)) { olsr_printf(1, "HTTP request from non-allowed host %s!\n", *************** *** 625,630 **** ! int ! build_tabs(char *buf, const olsr_u32_t bufsize, int active) { int size = 0, i = 0, tabs = 0; --- 603,607 ---- ! static int build_tabs(char *buf, const olsr_u32_t bufsize, int active) { int size = 0, i = 0, tabs = 0; *************** *** 679,689 **** ! static int ! build_frame(char *title __attribute__((unused)), ! char *link __attribute__((unused)), ! int width __attribute__((unused)), ! char *buf, ! olsr_u32_t bufsize, ! int(*frame_body_cb)(char *, olsr_u32_t)) { int i = 0, size = 0; --- 656,665 ---- ! static int build_frame(char *title __attribute__((unused)), ! char *link __attribute__((unused)), ! int width __attribute__((unused)), ! char *buf, ! olsr_u32_t bufsize, ! int(*frame_body_cb)(char *, olsr_u32_t)) { int i = 0, size = 0; *************** *** 702,707 **** } ! static int ! build_ip_txt(char *buf, const olsr_u32_t bufsize, const olsr_bool want_link, const char * const ipstr, const char * const maskstr) { int size = 0; --- 678,682 ---- } ! static int build_ip_txt(char *buf, const olsr_u32_t bufsize, const olsr_bool want_link, const char * const ipstr, const char * const maskstr) { int size = 0; *************** *** 723,728 **** } ! static int ! build_ipaddr_link(char *buf, const olsr_u32_t bufsize, const olsr_bool want_link, union olsr_ip_addr * const ipaddr, const union hna_netmask * const mask) { int size = 0; --- 698,702 ---- } ! static int build_ipaddr_link(char *buf, const olsr_u32_t bufsize, const olsr_bool want_link, union olsr_ip_addr * const ipaddr, const union hna_netmask * const mask) { int size = 0; *************** *** 764,769 **** #define build_ipaddr_no_link(buf, bufsize, ipaddr, mask) build_ipaddr_link((buf), (bufsize), OLSR_FALSE, (ipaddr), (mask)) ! int ! build_routes_body(char *buf, olsr_u32_t bufsize) { int size = 0, index; --- 738,742 ---- #define build_ipaddr_no_link(buf, bufsize, ipaddr, mask) build_ipaddr_link((buf), (bufsize), OLSR_FALSE, (ipaddr), (mask)) ! static int build_routes_body(char *buf, olsr_u32_t bufsize) { int size = 0, index; *************** *** 826,831 **** } ! int ! build_config_body(char *buf, olsr_u32_t bufsize) { char systime[100]; --- 799,803 ---- } ! static int build_config_body(char *buf, olsr_u32_t bufsize) { char systime[100]; *************** *** 1022,1027 **** ! int ! build_neigh_body(char *buf, olsr_u32_t bufsize) { struct neighbor_entry *neigh; --- 994,998 ---- ! static int build_neigh_body(char *buf, olsr_u32_t bufsize) { struct neighbor_entry *neigh; *************** *** 1110,1117 **** } ! ! ! int ! build_topo_body(char *buf, olsr_u32_t bufsize) { int size = 0; --- 1081,1085 ---- } ! static int build_topo_body(char *buf, olsr_u32_t bufsize) { int size = 0; *************** *** 1165,1172 **** } ! ! ! int ! build_hna_body(char *buf, olsr_u32_t bufsize) { int size; --- 1133,1137 ---- } ! static int build_hna_body(char *buf, olsr_u32_t bufsize) { int size; *************** *** 1209,1214 **** ! int ! build_mid_body(char *buf, olsr_u32_t bufsize) { int size = 0; --- 1174,1178 ---- ! static int build_mid_body(char *buf, olsr_u32_t bufsize) { int size = 0; *************** *** 1247,1252 **** ! int ! build_nodes_body(char *buf, olsr_u32_t bufsize) { int size = 0; --- 1211,1215 ---- ! static int build_nodes_body(char *buf, olsr_u32_t bufsize) { int size = 0; *************** *** 1260,1265 **** } ! int ! build_all_body(char *buf, olsr_u32_t bufsize) { int size = 0; --- 1223,1227 ---- } ! static int build_all_body(char *buf, olsr_u32_t bufsize) { int size = 0; *************** *** 1276,1281 **** ! int ! build_about_body(char *buf, olsr_u32_t bufsize) { int size = 0, i = 0; --- 1238,1242 ---- ! static int build_about_body(char *buf, olsr_u32_t bufsize) { int size = 0, i = 0; *************** *** 1288,1293 **** } ! int ! build_cfgfile_body(char *buf, olsr_u32_t bufsize) { int size = 0, i = 0; --- 1249,1253 ---- } ! static int build_cfgfile_body(char *buf, olsr_u32_t bufsize) { int size = 0, i = 0; *************** *** 1324,1362 **** } ! ! olsr_bool ! check_allowed_ip(union olsr_ip_addr *addr) { ! struct allowed_host *allh = allowed_hosts; ! struct allowed_net *alln = allowed_nets; ! ! if(addr->v4 == ntohl(INADDR_LOOPBACK)) ! return OLSR_TRUE; ! ! /* check hosts */ ! while(allh) ! { ! if(addr->v4 == allh->host.v4) ! return OLSR_TRUE; ! allh = allh->next; ! } ! ! /* check nets */ ! while(alln) ! { ! if((addr->v4 & alln->mask.v4) == (alln->net.v4 & alln->mask.v4)) ! return OLSR_TRUE; ! alln = alln->next; } ! ! return OLSR_FALSE; } /** *This function is just as bad as the previous one :-( */ ! char * ! olsr_netmask_to_string(union hna_netmask *mask) { char *ret; --- 1284,1304 ---- } ! static int check_allowed_ip(const struct allowed_net * const allowed_nets, const union olsr_ip_addr * const addr) { ! const struct allowed_net *alln; ! for (alln = allowed_nets; alln != NULL; alln = alln->next) { ! if((addr->v4 & alln->mask.v4) == (alln->net.v4 & alln->mask.v4)) { ! return 1; ! } } ! return 0; } + /** *This function is just as bad as the previous one :-( */ ! static char *olsr_netmask_to_string(union hna_netmask *mask) { char *ret; Index: olsrd_httpinfo.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/httpinfo/src/olsrd_httpinfo.h,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** olsrd_httpinfo.h 20 Apr 2007 14:06:18 -0000 1.29 --- olsrd_httpinfo.h 15 Jul 2007 19:29:38 -0000 1.30 *************** *** 48,51 **** --- 48,52 ---- #include "olsrd_plugin.h" + #include "plugin_util.h" *************** *** 62,91 **** ! typedef enum ! { HTTP_BAD_REQ, HTTP_BAD_FILE, HTTP_OK ! }http_header_type; ! struct http_stats ! { ! olsr_u32_t ok_hits; ! olsr_u32_t dyn_hits; ! olsr_u32_t err_hits; ! olsr_u32_t ill_hits; }; - extern struct olsrd_config *olsr_cfg; - - char * - olsr_netmask_to_string(union hna_netmask *); - /* Destructor function */ ! void ! olsr_plugin_exit(void); #endif --- 63,96 ---- ! typedef enum { HTTP_BAD_REQ, HTTP_BAD_FILE, HTTP_OK ! } http_header_type; ! struct http_stats { ! olsr_u32_t ok_hits; ! olsr_u32_t dyn_hits; ! olsr_u32_t err_hits; ! olsr_u32_t ill_hits; }; extern struct olsrd_config *olsr_cfg; /* Destructor function */ ! void olsr_plugin_exit(void); ! void olsr_plugin_exit(void); ! void olsrd_get_plugin_parameters(const struct olsrd_plugin_parameters **params, int *size); ! #endif + + /* + * Local Variables: + * mode: c + * style: linux + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */ Index: olsrd_plugin.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/httpinfo/src/olsrd_plugin.h,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** olsrd_plugin.h 2 Apr 2007 22:22:26 -0000 1.22 --- olsrd_plugin.h 15 Jul 2007 19:29:38 -0000 1.23 *************** *** 58,61 **** --- 58,62 ---- #include "olsr_types.h" + #include "../../../src/olsrd_plugin.h" #include "neighbor_table.h" #include "two_hop_neighbor_table.h" *************** *** 70,74 **** #define PLUGIN_AUTHOR "Andreas T�nnesen" #define MOD_DESC PLUGIN_NAME " " PLUGIN_VERSION " by " PLUGIN_AUTHOR ! #define PLUGIN_INTERFACE_VERSION 4 extern int http_port; --- 71,75 ---- #define PLUGIN_AUTHOR "Andreas T�nnesen" #define MOD_DESC PLUGIN_NAME " " PLUGIN_VERSION " by " PLUGIN_AUTHOR ! #define PLUGIN_INTERFACE_VERSION 5 extern int http_port; *************** *** 77,95 **** /* Allowed hosts stuff */ ! struct allowed_host ! { ! union olsr_ip_addr host; ! struct allowed_host *next; ! }; ! ! struct allowed_net ! { ! union olsr_ip_addr net; ! union olsr_ip_addr mask; ! struct allowed_net *next; }; ! struct allowed_host *allowed_hosts; ! struct allowed_net *allowed_nets; --- 78,88 ---- /* Allowed hosts stuff */ ! struct allowed_net { ! union olsr_ip_addr net; ! union olsr_ip_addr mask; ! struct allowed_net *next; }; ! extern struct allowed_net *allowed_nets; *************** *** 98,111 **** ****************************************************************************/ - /* Initialization function */ ! int ! olsrd_plugin_init(void); ! int ! olsrd_plugin_register_param(char *, char *); ! int ! olsrd_plugin_interface_version(void); #endif --- 91,109 ---- ****************************************************************************/ /* Initialization function */ ! int olsrd_plugin_init(void); ! void olsrd_get_plugin_parameters(const struct olsrd_plugin_parameters **params, int *size); ! int olsrd_plugin_interface_version(void); #endif + + /* + * Local Variables: + * mode: c + * style: linux + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */ Index: olsrd_plugin.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/httpinfo/src/olsrd_plugin.c,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** olsrd_plugin.c 9 May 2007 00:22:47 -0000 1.16 --- olsrd_plugin.c 15 Jul 2007 19:29:38 -0000 1.17 *************** *** 60,69 **** int http_port = 0; int resolve_ip_addresses = 0; ! static void __attribute__ ((constructor)) ! my_init(void); ! static void __attribute__ ((destructor)) ! my_fini(void); /* --- 60,72 ---- int http_port = 0; int resolve_ip_addresses = 0; + struct allowed_net *allowed_nets = NULL; ! static void my_init(void) __attribute__ ((constructor)); ! static void my_fini(void) __attribute__ ((destructor)); ! static int add_plugin_ipnet(const char *value, void *data); ! static int add_plugin_ipaddr(const char *value, void *data); ! ! static int insert_plugin_ipnet(const char *sz_net, const char *sz_mask, struct allowed_net **allowed_nets); /* *************** *** 72,93 **** * Do not alter unless you know what you are doing! */ ! int ! olsrd_plugin_interface_version(void) { ! return PLUGIN_INTERFACE_VERSION; } - - /** *Constructor */ ! static void ! my_init(void) { ! /* Print plugin info to stdout */ ! printf("%s\n", MOD_DESC); ! ! return; } --- 75,90 ---- * Do not alter unless you know what you are doing! */ ! int olsrd_plugin_interface_version(void) { ! return PLUGIN_INTERFACE_VERSION; } /** *Constructor */ ! static void my_init(void) { ! /* Print plugin info to stdout */ ! printf("%s\n", MOD_DESC); } *************** *** 95,186 **** *Destructor */ ! static void ! my_fini(void) { ! ! /* Calls the destruction function ! * olsr_plugin_exit() ! * This function should be present in your ! * sourcefile and all data destruction ! * should happen there - NOT HERE! ! */ ! olsr_plugin_exit(); ! ! return; } ! int ! olsrd_plugin_register_param(char *key, char *value) { ! if(!strcmp(key, "port") || !strcmp(key, "Port")) ! { ! http_port = atoi(value); ! printf("(HTTPINFO) listening on port: %d\n", http_port); ! } ! if(!strcmp(key, "host") || !strcmp(key, "Host")) ! { ! struct in_addr in; ! struct allowed_host *ah; ! ! if(inet_aton(value, &in) == 0) ! return 0; ! ah = malloc(sizeof(struct allowed_host)); ! if(!ah) ! { ! fprintf(stderr, "(HTTPINFO) register param host out of memory!\n"); ! exit(0); ! } ! ah->host.v4 = in.s_addr; ! ah->next = allowed_hosts; ! allowed_hosts = ah; ! return 1; } ! if(!strcmp(key, "net") || !strcmp(key, "Net")) ! { ! struct in_addr net, mask; ! struct allowed_net *an; ! char sz_net[100], sz_mask[100]; /* IPv6 in the future */ ! ! if(sscanf(value, "%99s %99s", sz_net, sz_mask) != 2) ! { ! olsr_printf(1, "(HTTPINFO) Error parsing net param \"%s\"!\n", value); ! return 0; ! } ! ! if(inet_aton(sz_net, &net) == 0) ! return 0; ! ! if(inet_aton(sz_mask, &mask) == 0) ! return 0; ! an = malloc(sizeof(struct allowed_net)); ! if(!an) ! { ! fprintf(stderr, "(HTTPINFO) register param net out of memory!\n"); ! exit(0); ! } ! an->net.v4 = net.s_addr; ! an->mask.v4 = mask.s_addr; ! an->next = allowed_nets; ! allowed_nets = an; ! return 1; ! ! } ! if(!strcasecmp(key, "resolve")) ! { ! if (!strcasecmp (value, "yes")) { ! resolve_ip_addresses = 1; ! } else if (!strcasecmp (value, "no")) { ! resolve_ip_addresses = 0; ! } else { ! return 0; ! } } ! return 1; } --- 92,166 ---- *Destructor */ ! static void my_fini(void) { ! /* Calls the destruction function ! * olsr_plugin_exit() ! * This function should be present in your ! * sourcefile and all data destruction ! * should happen there - NOT HERE! ! */ ! olsr_plugin_exit(); } + static const struct olsrd_plugin_parameters plugin_parameters[] = { + { .name = "port", .set_plugin_parameter = &set_plugin_port, .data = &http_port }, + { .name = "host", .set_plugin_parameter = &add_plugin_ipaddr, .data = &allowed_nets }, + { .name = "net", .set_plugin_parameter = &add_plugin_ipnet, .data = &allowed_nets }, + { .name = "resolve",.set_plugin_parameter = &set_boolean, .data = &resolve_ip_addresses }, + }; ! void olsrd_get_plugin_parameters(const struct olsrd_plugin_parameters **params, int *size) { ! *params = plugin_parameters; ! *size = sizeof(plugin_parameters)/sizeof(*plugin_parameters); ! } ! static int insert_plugin_ipnet(const char *sz_net, const char *sz_mask, struct allowed_net **allowed_nets) ! { ! struct in_addr net, mask; ! struct allowed_net *an; ! if(inet_aton(sz_net, &net) == 0) { ! return 1; ! } ! if(inet_aton(sz_mask, &mask) == 0) { ! return 1; } ! an = olsr_malloc(sizeof(*an), __func__); ! if (an == NULL) { ! fprintf(stderr, "(HTTPINFO) register param net out of memory!\n"); ! exit(0); ! } ! an->net.v4 = net.s_addr; ! an->mask.v4 = mask.s_addr; ! an->next = *allowed_nets; ! *allowed_nets = an; ! return 0; ! } ! static int add_plugin_ipnet(const char *value, void *data) ! { ! char sz_net[100], sz_mask[100]; /* IPv6 in the future */ ! if(sscanf(value, "%99s %99s", sz_net, sz_mask) != 2) { ! olsr_printf(1, "(HTTPINFO) Error parsing net param \"%s\"!\n", value); ! return 0; } ! return insert_plugin_ipnet(sz_net, sz_mask, data); ! } ! ! static int add_plugin_ipaddr(const char *value, void *data) ! { ! return insert_plugin_ipnet(value, "255.255.255.255", data); } + + /* + * Local Variables: + * mode: c + * style: linux + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */ From (spam-protected) Sun Jul 15 22:59:08 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 15 Jul 2007 20:59:08 +0000 Subject: [Olsr-cvs] olsrd-current/lib/httpinfo/src olsrd_httpinfo.c, 1.69, 1.70 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/httpinfo/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16667/lib/httpinfo/src Modified Files: olsrd_httpinfo.c Log Message: * fixed formatting Index: olsrd_httpinfo.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/httpinfo/src/olsrd_httpinfo.c,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** olsrd_httpinfo.c 15 Jul 2007 19:29:38 -0000 1.69 --- olsrd_httpinfo.c 15 Jul 2007 20:59:06 -0000 1.70 *************** *** 165,169 **** static int build_ip_txt(char *buf, const olsr_u32_t bufsize, const olsr_bool want_link, const char * const ipstr, const char * const maskstr); ! static int build_ipaddr_link(char *buf, const olsr_u32_t bufsize, const olsr_bool want_link, union olsr_ip_addr * const ipaddr, const union hna_netmask * const mask); static char *olsr_netmask_to_string(union hna_netmask *); --- 165,169 ---- static int build_ip_txt(char *buf, const olsr_u32_t bufsize, const olsr_bool want_link, const char * const ipstr, const char * const maskstr); ! static int build_ipaddr_link(char *buf, const olsr_u32_t bufsize, const olsr_bool want_link, const union olsr_ip_addr * const ipaddr, const union hna_netmask * const mask); static char *olsr_netmask_to_string(union hna_netmask *); *************** *** 698,702 **** } ! static int build_ipaddr_link(char *buf, const olsr_u32_t bufsize, const olsr_bool want_link, union olsr_ip_addr * const ipaddr, const union hna_netmask * const mask) { int size = 0; --- 698,702 ---- } ! static int build_ipaddr_link(char *buf, const olsr_u32_t bufsize, const olsr_bool want_link, const union olsr_ip_addr * const ipaddr, const union hna_netmask * const mask) { int size = 0; *************** *** 725,736 **** maskstr = NULL; } ! size += snprintf(&buf[size], bufsize-size, "", resolve_ip_addresses && hp ? "" : " colspan=\"2\""); size += build_ip_txt(&buf[size], bufsize-size, want_link, olsr_ip_to_string(ipaddr), maskstr); - if (hp) { - size += snprintf(&buf[size], bufsize-size, "("); - size += build_ip_txt(&buf[size], bufsize-size, want_link, hp->h_name, NULL); - size += snprintf(&buf[size], bufsize-size, ")"); - } size += snprintf(&buf[size], bufsize-size, ""); return size; } --- 725,740 ---- maskstr = NULL; } ! size += snprintf(&buf[size], bufsize-size, ""); size += build_ip_txt(&buf[size], bufsize-size, want_link, olsr_ip_to_string(ipaddr), maskstr); size += snprintf(&buf[size], bufsize-size, ""); + if (resolve_ip_addresses) { + if (hp) { + size += snprintf(&buf[size], bufsize-size, "("); + size += build_ip_txt(&buf[size], bufsize-size, want_link, hp->h_name, NULL); + size += snprintf(&buf[size], bufsize-size, ")"); + } else { + size += snprintf(&buf[size], bufsize-size, ""); + } + } return size; } *************** *** 738,741 **** --- 742,761 ---- #define build_ipaddr_no_link(buf, bufsize, ipaddr, mask) build_ipaddr_link((buf), (bufsize), OLSR_FALSE, (ipaddr), (mask)) + + static int build_route(char *buf, olsr_u32_t bufsize, const struct rt_entry * const route, const char * const title, const int print_netmask) + { + int size = 0; + size += snprintf(&buf[size], bufsize-size, ""); + size += build_ipaddr_with_link(&buf[size], bufsize-size, &route->rt_dst, print_netmask ? &route->rt_mask : NULL); + size += build_ipaddr_with_link(&buf[size], bufsize-size, &route->rt_router, NULL); + + size += snprintf(&buf[size], bufsize-size, "%d", route->rt_metric); + if (olsr_cnf->lq_level > 0) { + size += snprintf(&buf[size], bufsize-size, "%.2f", route->rt_etx); + } + size += snprintf(&buf[size], bufsize-size, "%s%s\n", route->rt_if->int_name, title); + return size; + } + static int build_routes_body(char *buf, olsr_u32_t bufsize) { *************** *** 745,749 **** size += snprintf(&buf[size], bufsize-size, "

OLSR routes in kernel

\n"); ! size += snprintf(&buf[size], bufsize-size, "Destination", resolve_ip_addresses ? " colspan=\"2\"" : ""); if (olsr_cnf->lq_level > 0) --- 765,769 ---- size += snprintf(&buf[size], bufsize-size, "

OLSR routes in kernel

\n"); ! size += snprintf(&buf[size], bufsize-size, "
GatewayMetric
DestinationGateway", resolve_ip_addresses ? " colspan=\"2\"" : ""); if (olsr_cnf->lq_level > 0) *************** *** 752,796 **** /* Neighbors */ ! for(index = 0;index < HASHSIZE;index++) ! { ! for(routes = routingtable[index].next; ! routes != &routingtable[index]; ! routes = routes->next) ! { ! size += snprintf(&buf[size], bufsize-size, ""); ! size += build_ipaddr_with_link(&buf[size], bufsize-size, &routes->rt_dst, NULL); ! size += build_ipaddr_with_link(&buf[size], bufsize-size, &routes->rt_router, NULL); ! ! size += snprintf(&buf[size], bufsize-size, "", routes->rt_metric); ! if (olsr_cnf->lq_level > 0) ! size += snprintf(&buf[size], bufsize-size, "", routes->rt_etx); ! size += snprintf(&buf[size], bufsize-size, ! "" ! "\n", ! 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) ! { ! size += snprintf(&buf[size], bufsize-size, ""); ! size += build_ipaddr_with_link(&buf[size], bufsize-size, &routes->rt_dst, &routes->rt_mask); ! size += build_ipaddr_with_link(&buf[size], bufsize-size, &routes->rt_router, NULL); ! size += snprintf(&buf[size], bufsize-size, ! "", ! routes->rt_metric); ! if (olsr_cnf->lq_level > 0) ! size += snprintf(&buf[size], bufsize-size, "", routes->rt_etx); ! size += snprintf(&buf[size], bufsize-size, ! "" ! "\n", ! routes->rt_if->int_name); ! } } size += snprintf(&buf[size], bufsize-size, "
Metric
%d%.2f%sHOST
%d%.2f%sHNA
\n"); --- 772,787 ---- /* Neighbors */ ! for(index = 0;index < HASHSIZE;index++) { ! for(routes = routingtable[index].next; routes != &routingtable[index]; routes = routes->next) { ! size += build_route(&buf[size], bufsize-size, routes, "HOST", OLSR_FALSE); } + } /* HNA */ ! for(index = 0;index < HASHSIZE;index++) { ! for(routes = hna_routes[index].next; routes != &hna_routes[index];routes = routes->next) { ! size += build_route(&buf[size], bufsize-size, routes, "HNA", OLSR_TRUE); } + } size += snprintf(&buf[size], bufsize-size, "\n"); From (spam-protected) Sun Jul 15 23:09:40 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 15 Jul 2007 21:09:40 +0000 Subject: [Olsr-cvs] olsrd-current/lib/httpinfo/src olsrd_httpinfo.c, 1.70, 1.71 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/httpinfo/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21710/lib/httpinfo/src Modified Files: olsrd_httpinfo.c Log Message: * killed warnings on win Index: olsrd_httpinfo.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/httpinfo/src/olsrd_httpinfo.c,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -d -r1.70 -r1.71 *** olsrd_httpinfo.c 15 Jul 2007 20:59:06 -0000 1.70 --- olsrd_httpinfo.c 15 Jul 2007 21:09:37 -0000 1.71 *************** *** 50,54 **** #include #include ! #ifndef WIN32 #include #endif --- 50,56 ---- #include #include ! #ifdef WIN32 ! #include ! #else #include #endif From (spam-protected) Sun Jul 15 23:09:40 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 15 Jul 2007 21:09:40 +0000 Subject: [Olsr-cvs] olsrd-current/src/win32 compat.c,1.15,1.16 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src/win32 In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21710/src/win32 Modified Files: compat.c Log Message: * killed warnings on win Index: compat.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/win32/compat.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** compat.c 9 May 2007 00:30:04 -0000 1.15 --- compat.c 15 Jul 2007 21:09:38 -0000 1.16 *************** *** 62,65 **** --- 62,66 ---- #include #include + #include #include "defs.h" *************** *** 124,128 **** } ! int inet_aton(char *AddrStr, struct in_addr *Addr) { Addr->s_addr = inet_addr(AddrStr); --- 125,129 ---- } ! int inet_aton(const char *AddrStr, struct in_addr *Addr) { Addr->s_addr = inet_addr(AddrStr); *************** *** 527,531 **** /* and we emulate a real write(2) syscall using send() */ ! ssize_t write(int fd, const void *buf, size_t count) { size_t written = 0; --- 528,532 ---- /* and we emulate a real write(2) syscall using send() */ ! int write(int fd, const void *buf, unsigned int count) { size_t written = 0; From (spam-protected) Sun Jul 15 23:09:40 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 15 Jul 2007 21:09:40 +0000 Subject: [Olsr-cvs] olsrd-current/src/win32/arpa inet.h,1.7,1.8 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src/win32/arpa In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21710/src/win32/arpa Modified Files: inet.h Log Message: * killed warnings on win Index: inet.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/win32/arpa/inet.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** inet.h 8 May 2007 23:18:56 -0000 1.7 --- inet.h 15 Jul 2007 21:09:38 -0000 1.8 *************** *** 49,53 **** #undef interface ! int inet_aton(char *cp, struct in_addr *addr); int inet_pton(int af, const char *src, void *dst); char *inet_ntop(int af, const void *src, char *dst, int size); --- 49,53 ---- #undef interface ! int inet_aton(const char *cp, struct in_addr *addr); int inet_pton(int af, const char *src, void *dst); char *inet_ntop(int af, const void *src, char *dst, int size); From (spam-protected) Sun Jul 15 23:09:44 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 15 Jul 2007 21:09:44 +0000 Subject: [Olsr-cvs] olsrd-current CHANGELOG,1.63,1.64 Message-ID: Update of /cvsroot/olsrd/olsrd-current In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21743 Modified Files: CHANGELOG Log Message: * update Index: CHANGELOG =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/CHANGELOG,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** CHANGELOG 5 Jul 2007 23:12:43 -0000 1.63 --- CHANGELOG 15 Jul 2007 21:09:42 -0000 1.64 *************** *** 4,7 **** --- 4,13 ---- 0.5.2 --------------------------------------------------------------------- + PLUGIN CLEANUP + Plugins handle parameters quite individually (case-sensitive vs case-insensitive, + different parsing functions for the same values, etc.). Plugin Interface version 5 + now exports a table of { parameter-name, parsing-function, addr-of-storage } and + it's size. Common functions should be shared. + 0.5.1 --------------------------------------------------------------------- From (spam-protected) Sun Jul 15 23:47:19 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 15 Jul 2007 21:47:19 +0000 Subject: [Olsr-cvs] olsrd-current/lib/secure/src olsrd_plugin.c, 1.12, 1.13 olsrd_secure.c, 1.25, 1.26 olsrd_secure.h, 1.7, 1.8 secure_messages.h, 1.2, 1.3 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/secure/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4585/lib/secure/src Modified Files: olsrd_plugin.c olsrd_secure.c olsrd_secure.h secure_messages.h Log Message: * moved to plugin interface version 5 Index: secure_messages.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/secure/src/secure_messages.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** secure_messages.h 31 Jan 2007 12:36:50 -0000 1.2 --- secure_messages.h 15 Jul 2007 21:47:17 -0000 1.3 *************** *** 69,73 **** ! char keyfile[FILENAME_MAX]; --- 69,73 ---- ! extern char keyfile[FILENAME_MAX+1]; Index: olsrd_secure.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/secure/src/olsrd_secure.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** olsrd_secure.h 31 Jan 2007 12:36:49 -0000 1.7 --- olsrd_secure.h 15 Jul 2007 21:47:17 -0000 1.8 *************** *** 67,166 **** #define LOWER_DIFF -3 ! char aes_key[16]; /* Seconds of slack allowed */ #define SLACK 3 ! /* Timestamp node */ ! struct stamp ! { ! union olsr_ip_addr addr; ! /* Timestamp difference */ ! int diff; ! olsr_u32_t challenge; ! olsr_u8_t validated; ! clock_t valtime; /* Validity time */ ! clock_t conftime; /* Reconfiguration time */ ! struct stamp *prev; ! struct stamp *next; ! }; ! ! /* Seconds to cache a valid timestamp entry */ ! #define TIMESTAMP_HOLD_TIME 30 ! /* Seconds to cache a not verified timestamp entry */ ! #define EXCHANGE_HOLD_TIME 5 ! ! struct stamp timestamps[HASHSIZE]; ! ! /* Input interface */ ! struct interface *olsr_in_if; ! ! /* Timeout function to register with the sceduler */ ! void ! olsr_timeout(void); ! ! ! /* Event function to register with the sceduler */ ! void ! olsr_event(void); ! ! int ! send_challenge(union olsr_ip_addr *); ! ! int ! ifchange(struct interface *, int); ! ! int ! send_cres(union olsr_ip_addr *, union olsr_ip_addr *, olsr_u32_t, struct stamp *); ! ! int ! send_rres(union olsr_ip_addr *, union olsr_ip_addr *, olsr_u32_t); ! ! int ! parse_challenge(char *); ! ! int ! parse_cres(char *); ! ! int ! parse_rres(char *); ! ! int ! check_auth(char *, int *); ! ! void ! ipc_action(int); ! ! int ! ipc_send(char *, int); ! ! int ! add_signature(olsr_u8_t *, int*); ! ! int ! validate_packet(char *, int*); ! ! void ! packet_parser(int); ! ! void ! timeout_timestamps(void*); ! ! int ! check_timestamp(union olsr_ip_addr *, time_t); ! ! struct stamp * ! lookup_timestamp_entry(union olsr_ip_addr *); ! ! int ! read_key_from_file(char *); ! ! int ! secure_plugin_init(void); ! void ! secure_plugin_exit(void); ! int ! plugin_ipc_init(void); #endif --- 67,79 ---- #define LOWER_DIFF -3 ! extern char aes_key[16]; /* Seconds of slack allowed */ #define SLACK 3 ! int secure_plugin_init(void); ! void secure_plugin_exit(void); ! int plugin_ipc_init(void); #endif Index: olsrd_plugin.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/secure/src/olsrd_plugin.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** olsrd_plugin.c 15 Jul 2007 17:51:22 -0000 1.12 --- olsrd_plugin.c 15 Jul 2007 21:47:17 -0000 1.13 *************** *** 49,61 **** #define PLUGIN_AUTHOR "Andreas T�nnesen" #define MOD_DESC PLUGIN_NAME " " PLUGIN_VERSION " by " PLUGIN_AUTHOR ! #define PLUGIN_INTERFACE_VERSION 4 ! ! ! static void __attribute__ ((constructor)) ! my_init(void); ! ! static void __attribute__ ((destructor)) ! my_fini(void); /* --- 49,56 ---- #define PLUGIN_AUTHOR "Andreas T�nnesen" #define MOD_DESC PLUGIN_NAME " " PLUGIN_VERSION " by " PLUGIN_AUTHOR ! #define PLUGIN_INTERFACE_VERSION 5 + static void my_init(void) __attribute__ ((constructor)); + static void my_fini(void) __attribute__ ((destructor)); /* *************** *** 64,69 **** * Do not alter unless you know what you are doing! */ ! int ! olsrd_plugin_interface_version(void) { return PLUGIN_INTERFACE_VERSION; --- 59,63 ---- * Do not alter unless you know what you are doing! */ ! int olsrd_plugin_interface_version(void) { return PLUGIN_INTERFACE_VERSION; *************** *** 74,79 **** *Constructor */ ! static void ! my_init(void) { /* Print plugin info to stdout */ --- 68,72 ---- *Constructor */ ! static void my_init(void) { /* Print plugin info to stdout */ *************** *** 86,91 **** *Destructor */ ! static void ! my_fini(void) { --- 79,83 ---- *Destructor */ ! static void my_fini(void) { *************** *** 99,117 **** } ! ! int ! olsrd_plugin_register_param(char *key, char *value) { ! if(!strcmp(key, "Keyfile")) ! { ! strncpy(keyfile, value, FILENAME_MAX); ! } ! ! return 1; } ! int ! olsrd_plugin_init(void) { /* Calls the initialization function * olsr_plugin_init() --- 91,113 ---- } ! static int store_string(const char *value, void *data) { ! char *str = data; ! snprintf(str, FILENAME_MAX+1, "%s", value); ! return 0; } ! static const struct olsrd_plugin_parameters plugin_parameters[] = { ! { .name = "keyfile", .set_plugin_parameter = &store_string, .data = keyfile }, ! }; ! ! void olsrd_get_plugin_parameters(const struct olsrd_plugin_parameters **params, int *size) ! { ! *params = plugin_parameters; ! *size = sizeof(plugin_parameters)/sizeof(*plugin_parameters); ! } ! ! int olsrd_plugin_init(void) { /* Calls the initialization function * olsr_plugin_init() Index: olsrd_secure.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/secure/src/olsrd_secure.c,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** olsrd_secure.c 9 May 2007 17:41:17 -0000 1.25 --- olsrd_secure.c 15 Jul 2007 21:47:17 -0000 1.26 *************** *** 108,111 **** --- 108,161 ---- + /* Timestamp node */ + struct stamp + { + union olsr_ip_addr addr; + /* Timestamp difference */ + int diff; + olsr_u32_t challenge; + olsr_u8_t validated; + clock_t valtime; /* Validity time */ + clock_t conftime; /* Reconfiguration time */ + struct stamp *prev; + struct stamp *next; + }; + + /* Seconds to cache a valid timestamp entry */ + #define TIMESTAMP_HOLD_TIME 30 + /* Seconds to cache a not verified timestamp entry */ + #define EXCHANGE_HOLD_TIME 5 + + static struct stamp timestamps[HASHSIZE]; + + + char keyfile[FILENAME_MAX+1]; + char aes_key[16]; + /* Input interface */ + static struct interface *olsr_in_if; + + /* Event function to register with the sceduler */ + #if 0 + static void olsr_event(void); + #endif + static int send_challenge(union olsr_ip_addr *); + static int ifchange(struct interface *, int); + static int send_cres(union olsr_ip_addr *, union olsr_ip_addr *, olsr_u32_t, struct stamp *); + static int send_rres(union olsr_ip_addr *, union olsr_ip_addr *, olsr_u32_t); + static int parse_challenge(char *); + static int parse_cres(char *); + static int parse_rres(char *); + static int check_auth(char *, int *); + #if 0 + static int ipc_send(char *, int); + #endif + static int add_signature(olsr_u8_t *, int*); + static int validate_packet(char *, int*); + static void packet_parser(int); + static void timeout_timestamps(void*); + static int check_timestamp(union olsr_ip_addr *, time_t); + static struct stamp *lookup_timestamp_entry(union olsr_ip_addr *); + static int read_key_from_file(char *); + /** *Do initialization here *************** *** 173,177 **** } - int plugin_ipc_init(void) --- 223,226 ---- *************** *** 180,184 **** } - /* * destructor - called at unload --- 229,232 ---- *************** *** 190,209 **** /** *Scheduled event */ ! void olsr_event(void) { } ! ! int ipc_send(char *data __attribute__((unused)), int size __attribute__((unused))) { return 1; } ! /* XXX - ToDo */ --- 238,259 ---- + #if 0 /** *Scheduled event */ ! static void olsr_event(void) { } + #endif ! #if 0 ! static int ipc_send(char *data __attribute__((unused)), int size __attribute__((unused))) { return 1; } ! #endif /* XXX - ToDo */ From (spam-protected) Sun Jul 15 23:47:19 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 15 Jul 2007 21:47:19 +0000 Subject: [Olsr-cvs] olsrd-current/lib/secure Makefile, 1.16, 1.17 version-script.txt, 1.2, 1.3 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/secure In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4585/lib/secure Modified Files: Makefile version-script.txt Log Message: * moved to plugin interface version 5 Index: Makefile =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/secure/Makefile,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Makefile 25 May 2005 13:50:22 -0000 1.16 --- Makefile 15 Jul 2007 21:47:17 -0000 1.17 *************** *** 52,56 **** default_target: $(PLUGIN_FULLNAME) ! $(PLUGIN_FULLNAME): $(OBJS) $(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS) --- 52,56 ---- default_target: $(PLUGIN_FULLNAME) ! $(PLUGIN_FULLNAME): $(OBJS) version-script.txt $(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS) Index: version-script.txt =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/secure/version-script.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** version-script.txt 29 May 2005 12:47:43 -0000 1.2 --- version-script.txt 15 Jul 2007 21:47:17 -0000 1.3 *************** *** 3,8 **** global: olsrd_plugin_interface_version; - olsrd_plugin_register_param; olsrd_plugin_init; local: --- 3,8 ---- global: olsrd_plugin_interface_version; olsrd_plugin_init; + olsrd_get_plugin_parameters; local: From (spam-protected) Sun Jul 15 23:50:47 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 15 Jul 2007 21:50:47 +0000 Subject: [Olsr-cvs] olsrd-current/lib/bmf Makefile,1.4,1.5 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/bmf In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5789/lib/bmf Modified Files: Makefile Log Message: * added a forgotten dependency Index: Makefile =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/bmf/Makefile,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Makefile 30 Jun 2007 20:07:47 -0000 1.4 --- Makefile 15 Jul 2007 21:50:45 -0000 1.5 *************** *** 51,55 **** default_target: $(PLUGIN_FULLNAME) ! $(PLUGIN_FULLNAME): $(OBJS) $(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS) --- 51,55 ---- default_target: $(PLUGIN_FULLNAME) ! $(PLUGIN_FULLNAME): $(OBJS) version-script.txt $(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS) *************** *** 61,63 **** rm -f $(OBJS) $(SRCS:%.c=%.d) $(PLUGIN_FULLNAME) ! endif \ No newline at end of file --- 61,63 ---- rm -f $(OBJS) $(SRCS:%.c=%.d) $(PLUGIN_FULLNAME) ! endif From (spam-protected) Sun Jul 15 23:50:47 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 15 Jul 2007 21:50:47 +0000 Subject: [Olsr-cvs] olsrd-current/lib/dot_draw Makefile,1.15,1.16 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/dot_draw In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5789/lib/dot_draw Modified Files: Makefile Log Message: * added a forgotten dependency Index: Makefile =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/dot_draw/Makefile,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Makefile 25 May 2005 13:50:22 -0000 1.15 --- Makefile 15 Jul 2007 21:50:45 -0000 1.16 *************** *** 47,51 **** default_target: $(PLUGIN_FULLNAME) ! $(PLUGIN_FULLNAME): $(OBJS) $(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS) --- 47,51 ---- default_target: $(PLUGIN_FULLNAME) ! $(PLUGIN_FULLNAME): $(OBJS) version-script.txt $(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS) From (spam-protected) Sun Jul 15 23:50:47 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 15 Jul 2007 21:50:47 +0000 Subject: [Olsr-cvs] olsrd-current/lib/dyn_gw Makefile,1.19,1.20 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/dyn_gw In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5789/lib/dyn_gw Modified Files: Makefile Log Message: * added a forgotten dependency Index: Makefile =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/dyn_gw/Makefile,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Makefile 2 Jun 2005 14:41:58 -0000 1.19 --- Makefile 15 Jul 2007 21:50:45 -0000 1.20 *************** *** 49,53 **** default_target: $(PLUGIN_FULLNAME) ! $(PLUGIN_FULLNAME): $(OBJS) $(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS) --- 49,53 ---- default_target: $(PLUGIN_FULLNAME) ! $(PLUGIN_FULLNAME): $(OBJS) version-script.txt $(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS) From (spam-protected) Sun Jul 15 23:50:47 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 15 Jul 2007 21:50:47 +0000 Subject: [Olsr-cvs] olsrd-current/lib/httpinfo Makefile,1.21,1.22 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/httpinfo In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5789/lib/httpinfo Modified Files: Makefile Log Message: * added a forgotten dependency Index: Makefile =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/httpinfo/Makefile,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** Makefile 25 May 2005 13:50:22 -0000 1.21 --- Makefile 15 Jul 2007 21:50:45 -0000 1.22 *************** *** 56,60 **** endif ! $(PLUGIN_FULLNAME): $(OBJS) $(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS) --- 56,60 ---- endif ! $(PLUGIN_FULLNAME): $(OBJS) version-script.txt $(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS) From (spam-protected) Sun Jul 15 23:50:47 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 15 Jul 2007 21:50:47 +0000 Subject: [Olsr-cvs] olsrd-current/lib/mini Makefile,1.1,1.2 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/mini In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5789/lib/mini Modified Files: Makefile Log Message: * added a forgotten dependency Index: Makefile =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/mini/Makefile,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Makefile 26 May 2005 16:09:25 -0000 1.1 --- Makefile 15 Jul 2007 21:50:45 -0000 1.2 *************** *** 47,51 **** default_target: $(PLUGIN_FULLNAME) ! $(PLUGIN_FULLNAME): $(OBJS) $(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS) --- 47,51 ---- default_target: $(PLUGIN_FULLNAME) ! $(PLUGIN_FULLNAME): $(OBJS) version-script.txt $(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS) From (spam-protected) Sun Jul 15 23:50:47 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 15 Jul 2007 21:50:47 +0000 Subject: [Olsr-cvs] olsrd-current/lib/dyn_gw_plain Makefile,1.1,1.2 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/dyn_gw_plain In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5789/lib/dyn_gw_plain Modified Files: Makefile Log Message: * added a forgotten dependency Index: Makefile =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/dyn_gw_plain/Makefile,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Makefile 31 Jan 2007 12:38:25 -0000 1.1 --- Makefile 15 Jul 2007 21:50:45 -0000 1.2 *************** *** 47,51 **** default_target: $(PLUGIN_FULLNAME) ! $(PLUGIN_FULLNAME): $(OBJS) $(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS) --- 47,51 ---- default_target: $(PLUGIN_FULLNAME) ! $(PLUGIN_FULLNAME): $(OBJS) version-script.txt $(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS) From (spam-protected) Sun Jul 15 23:50:48 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 15 Jul 2007 21:50:48 +0000 Subject: [Olsr-cvs] olsrd-current/lib/nameservice Makefile,1.13,1.14 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/nameservice In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5789/lib/nameservice Modified Files: Makefile Log Message: * added a forgotten dependency Index: Makefile =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/nameservice/Makefile,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Makefile 15 Jul 2007 17:52:16 -0000 1.13 --- Makefile 15 Jul 2007 21:50:45 -0000 1.14 *************** *** 51,55 **** default_target: $(PLUGIN_FULLNAME) ! $(PLUGIN_FULLNAME): $(OBJS) $(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS) --- 51,55 ---- default_target: $(PLUGIN_FULLNAME) ! $(PLUGIN_FULLNAME): $(OBJS) version-script.txt $(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS) From (spam-protected) Sun Jul 15 23:50:48 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 15 Jul 2007 21:50:48 +0000 Subject: [Olsr-cvs] olsrd-current/lib/txtinfo Makefile,1.1,1.2 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/txtinfo In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5789/lib/txtinfo Modified Files: Makefile Log Message: * added a forgotten dependency Index: Makefile =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/txtinfo/Makefile,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Makefile 31 Jan 2007 12:38:26 -0000 1.1 --- Makefile 15 Jul 2007 21:50:46 -0000 1.2 *************** *** 47,51 **** default_target: $(PLUGIN_FULLNAME) ! $(PLUGIN_FULLNAME): $(OBJS) $(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS) --- 47,51 ---- default_target: $(PLUGIN_FULLNAME) ! $(PLUGIN_FULLNAME): $(OBJS) version-script.txt $(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS) From (spam-protected) Sun Jul 15 23:50:48 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 15 Jul 2007 21:50:48 +0000 Subject: [Olsr-cvs] olsrd-current/lib/tas Makefile,1.4,1.5 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/tas In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5789/lib/tas Modified Files: Makefile Log Message: * added a forgotten dependency Index: Makefile =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/tas/Makefile,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Makefile 29 Dec 2005 19:48:43 -0000 1.4 --- Makefile 15 Jul 2007 21:50:46 -0000 1.5 *************** *** 45,50 **** include $(TOPDIR)/Makefile.inc ! SRCS = $(wildcard src/*.c src/lua/*.c) ! HDRS = $(wildcard src/*.h src/lua/*.h) ifneq ($(OS),win32) --- 45,50 ---- include $(TOPDIR)/Makefile.inc ! SRCS += $(wildcard src/lua/*.c) ! HDRS += $(wildcard src/lua/*.h) ifneq ($(OS),win32) *************** *** 61,65 **** default_target: $(PLUGIN_FULLNAME) ! $(PLUGIN_FULLNAME): $(OBJS) $(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS) --- 61,65 ---- default_target: $(PLUGIN_FULLNAME) ! $(PLUGIN_FULLNAME): $(OBJS) version-script.txt $(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS) From (spam-protected) Sun Jul 15 23:50:48 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 15 Jul 2007 21:50:48 +0000 Subject: [Olsr-cvs] olsrd-current/lib/pgraph Makefile,1.1,1.2 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/pgraph In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5789/lib/pgraph Modified Files: Makefile Log Message: * added a forgotten dependency Index: Makefile =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/pgraph/Makefile,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Makefile 13 Jul 2005 21:45:07 -0000 1.1 --- Makefile 15 Jul 2007 21:50:46 -0000 1.2 *************** *** 47,51 **** default_target: $(PLUGIN_FULLNAME) ! $(PLUGIN_FULLNAME): $(OBJS) $(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS) --- 47,51 ---- default_target: $(PLUGIN_FULLNAME) ! $(PLUGIN_FULLNAME): $(OBJS) version-script.txt $(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS) From (spam-protected) Sun Jul 15 23:50:48 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sun, 15 Jul 2007 21:50:48 +0000 Subject: [Olsr-cvs] olsrd-current/lib/quagga Makefile,1.5,1.6 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/quagga In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5789/lib/quagga Modified Files: Makefile Log Message: * added a forgotten dependency Index: Makefile =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/quagga/Makefile,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Makefile 11 Mar 2007 23:26:06 -0000 1.5 --- Makefile 15 Jul 2007 21:50:46 -0000 1.6 *************** *** 59,63 **** default_target: $(PLUGIN_FULLNAME) ! $(PLUGIN_FULLNAME): $(OBJS) $(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS) --- 59,63 ---- default_target: $(PLUGIN_FULLNAME) ! $(PLUGIN_FULLNAME): $(OBJS) version-script.txt $(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS) From (spam-protected) Tue Jul 17 11:28:17 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Tue, 17 Jul 2007 09:28:17 +0000 Subject: [Olsr-cvs] olsrd-current/src scheduler.c,1.39,1.40 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28430/olsrd-current/src Modified Files: scheduler.c Log Message: * added comment Index: scheduler.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/scheduler.c,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** scheduler.c 25 Apr 2007 22:08:16 -0000 1.39 --- scheduler.c 17 Jul 2007 09:28:15 -0000 1.40 *************** *** 119,123 **** struct interface *ifn; ! /* Global buffer for times(2) calls */ struct tms tms_buf; --- 119,123 ---- struct interface *ifn; ! /* Global buffer for times(2) calls. Do not remove - at least OpenBSD needs it. */ struct tms tms_buf; From (spam-protected) Tue Jul 17 11:52:03 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Tue, 17 Jul 2007 09:52:03 +0000 Subject: [Olsr-cvs] olsrd-current CHANGELOG,1.64,1.65 Message-ID: Update of /cvsroot/olsrd/olsrd-current In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5067 Modified Files: CHANGELOG Log Message: update Index: CHANGELOG =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/CHANGELOG,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** CHANGELOG 15 Jul 2007 21:09:42 -0000 1.64 --- CHANGELOG 17 Jul 2007 09:52:01 -0000 1.65 *************** *** 4,7 **** --- 4,10 ---- 0.5.2 --------------------------------------------------------------------- + URGENT BUG FIX + Sven-Ole Tuecke found a serious bug of the class "show stopper" and sent a patch. + PLUGIN CLEANUP Plugins handle parameters quite individually (case-sensitive vs case-insensitive, From (spam-protected) Tue Jul 17 13:06:31 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Tue, 17 Jul 2007 11:06:31 +0000 Subject: [Olsr-cvs] olsrd-current README,1.19,1.20 Message-ID: Update of /cvsroot/olsrd/olsrd-current In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3319 Modified Files: README Log Message: * updated README to 0.5.2. And I added a blurb about the txtinfo plugin. Index: README =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/README,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** README 9 Jul 2007 07:27:57 -0000 1.19 --- README 17 Jul 2007 11:06:28 -0000 1.20 *************** *** 1,5 **** +====================================================================+ ! | README - olsr.org OLSR daemon 0.5.1, 06.07.2007 | +====================================================================+ --- 1,5 ---- +====================================================================+ ! | README - olsr.org OLSR daemon 0.5.2, 17.07.2007 | +====================================================================+ *************** *** 119,122 **** --- 119,125 ---- pages with lots of information about the running olsrd process. + - TxtInfo. This delivers output similar to the above. However, it is intended + for external tools to use the output. + - Mini. From (spam-protected) Tue Jul 17 15:13:10 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Tue, 17 Jul 2007 13:13:10 +0000 Subject: [Olsr-cvs] olsrd-current Makefile,1.86,1.87 Message-ID: Update of /cvsroot/olsrd/olsrd-current In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23378 Modified Files: Makefile Log Message: * inc'd version Index: Makefile =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/Makefile,v retrieving revision 1.86 retrieving revision 1.87 diff -C2 -d -r1.86 -r1.87 *** Makefile 5 Jul 2007 23:12:43 -0000 1.86 --- Makefile 17 Jul 2007 13:13:08 -0000 1.87 *************** *** 38,42 **** # $Id$ ! VERS = 0.5.2pre TOPDIR = . --- 38,42 ---- # $Id$ ! VERS = 0.5.3pre TOPDIR = . From (spam-protected) Wed Jul 18 12:38:53 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Wed, 18 Jul 2007 10:38:53 +0000 Subject: [Olsr-cvs] olsrd-current Makefile.inc,1.17,1.18 Message-ID: Update of /cvsroot/olsrd/olsrd-current In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv13109 Modified Files: Makefile.inc Log Message: * activated supprot for the old plugin interface Index: Makefile.inc =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/Makefile.inc,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Makefile.inc 15 Jul 2007 18:11:45 -0000 1.17 --- Makefile.inc 18 Jul 2007 10:38:51 -0000 1.18 *************** *** 52,55 **** --- 52,58 ---- endif + # we have plugins with the old interface + CFLAGS += -DUPPORT_OLD_PLUGIN_VERSIONS=1 + ifdef OLSRD_PLUGIN # c and ld flags for libraries (plugins) From (spam-protected) Fri Jul 20 14:26:00 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Fri, 20 Jul 2007 12:26:00 +0000 Subject: [Olsr-cvs] olsrd-current/src plugin_util.c,1.1,1.2 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10161/src Modified Files: plugin_util.c Log Message: * port numbers are "int" and not "unsigned int" Index: plugin_util.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/plugin_util.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** plugin_util.c 15 Jul 2007 17:46:46 -0000 1.1 --- plugin_util.c 20 Jul 2007 12:25:56 -0000 1.2 *************** *** 57,61 **** } if (data != NULL) { ! unsigned int *v = data; *v = port; OLSR_PRINTF(1, "%s port number %u\n", "Got", port); --- 57,61 ---- } if (data != NULL) { ! int *v = data; *v = port; OLSR_PRINTF(1, "%s port number %u\n", "Got", port); From (spam-protected) Mon Jul 23 14:58:41 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Mon, 23 Jul 2007 12:58:41 +0000 Subject: [Olsr-cvs] olsrd-current/lib/dot_draw/src olsrd_dot_draw.c, 1.25, 1.26 olsrd_dot_draw.h, 1.9, 1.10 olsrd_plugin.c, 1.16, 1.17 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/dot_draw/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26846/lib/dot_draw/src Modified Files: olsrd_dot_draw.c olsrd_dot_draw.h olsrd_plugin.c Log Message: * fix for the dot-draw plugin breakage Index: olsrd_dot_draw.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/dot_draw/src/olsrd_dot_draw.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** olsrd_dot_draw.h 15 Jul 2007 19:29:37 -0000 1.9 --- olsrd_dot_draw.h 23 Jul 2007 12:58:38 -0000 1.10 *************** *** 51,55 **** #include "plugin_util.h" ! extern struct in_addr ipc_accept_ip; extern int ipc_port; --- 51,55 ---- #include "plugin_util.h" ! extern union olsr_ip_addr ipc_accept_ip; extern int ipc_port; Index: olsrd_dot_draw.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/dot_draw/src/olsrd_dot_draw.c,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** olsrd_dot_draw.c 15 Jul 2007 19:29:37 -0000 1.25 --- olsrd_dot_draw.c 23 Jul 2007 12:58:38 -0000 1.26 *************** *** 271,278 **** else { ! char *addr = inet_ntoa(pin.sin_addr); ! if(ntohl(pin.sin_addr.s_addr) != ntohl(ipc_accept_ip.s_addr)) { ! olsr_printf(0, "Front end-connection from foregin host(%s) not allowed!\n", addr); close(ipc_connection); ipc_connection = -1; --- 271,277 ---- else { ! if(ntohl(pin.sin_addr.s_addr) != ntohl(ipc_accept_ip.v4)) { ! olsr_printf(0, "Front end-connection from foreign host (%s) not allowed!\n", inet_ntoa(pin.sin_addr)); close(ipc_connection); ipc_connection = -1; *************** *** 281,285 **** { ipc_open = 1; ! olsr_printf(1, "(DOT DRAW)IPC: Connection from %s\n",addr); pcf_event(1, 1, 1); } --- 280,284 ---- { ipc_open = 1; ! olsr_printf(1, "(DOT DRAW)IPC: Connection from %s\n",inet_ntoa(pin.sin_addr)); pcf_event(1, 1, 1); } Index: olsrd_plugin.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/dot_draw/src/olsrd_plugin.c,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** olsrd_plugin.c 15 Jul 2007 19:29:37 -0000 1.16 --- olsrd_plugin.c 23 Jul 2007 12:58:38 -0000 1.17 *************** *** 61,69 **** #define PLUGIN_INTERFACE_VERSION 5 ! struct in_addr ipc_accept_ip; int ipc_port; ! static void my_init(void) __attribute__ ((constructor)) ; ! static void my_fini(void) __attribute__ ((destructor)); --- 61,69 ---- #define PLUGIN_INTERFACE_VERSION 5 ! union olsr_ip_addr ipc_accept_ip; int ipc_port; ! static void my_init(void) __attribute__((constructor)); ! static void my_fini(void) __attribute__((destructor)); *************** *** 78,82 **** /* defaults for parameters */ ipc_port = 2004; ! ipc_accept_ip.s_addr = htonl(INADDR_LOOPBACK); } --- 78,82 ---- /* defaults for parameters */ ipc_port = 2004; ! ipc_accept_ip.v4 = htonl(INADDR_LOOPBACK); } From (spam-protected) Mon Jul 23 15:04:05 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Mon, 23 Jul 2007 13:04:05 +0000 Subject: [Olsr-cvs] olsrd-current CHANGELOG,1.65,1.66 Message-ID: Update of /cvsroot/olsrd/olsrd-current In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28965 Modified Files: CHANGELOG Log Message: * and a section for 0.5.3 Index: CHANGELOG =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/CHANGELOG,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** CHANGELOG 17 Jul 2007 09:52:01 -0000 1.65 --- CHANGELOG 23 Jul 2007 13:04:01 -0000 1.66 *************** *** 2,9 **** $Id$ 0.5.2 --------------------------------------------------------------------- URGENT BUG FIX ! Sven-Ole Tuecke found a serious bug of the class "show stopper" and sent a patch. PLUGIN CLEANUP --- 2,15 ---- $Id$ + 0.5.3 --------------------------------------------------------------------- + + URGENT BUG FIX + Ignacio García Pérez found a serious bug in the dot-draw + plugin and identified it's source. + 0.5.2 --------------------------------------------------------------------- URGENT BUG FIX ! Sven-Ola Tuecke found a serious bug of the class "show stopper" and sent a patch. PLUGIN CLEANUP From (spam-protected) Thu Jul 26 18:03:42 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Thu, 26 Jul 2007 16:03:42 +0000 Subject: [Olsr-cvs] olsrd-current Makefile.inc,1.18,1.19 Message-ID: Update of /cvsroot/olsrd/olsrd-current In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25041 Modified Files: Makefile.inc Log Message: * fixed the "missing" #define more sane now Index: Makefile.inc =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/Makefile.inc,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Makefile.inc 18 Jul 2007 10:38:51 -0000 1.18 --- Makefile.inc 26 Jul 2007 16:03:40 -0000 1.19 *************** *** 52,58 **** endif - # we have plugins with the old interface - CFLAGS += -DUPPORT_OLD_PLUGIN_VERSIONS=1 - ifdef OLSRD_PLUGIN # c and ld flags for libraries (plugins) --- 52,55 ---- *************** *** 65,70 **** endif # options to save space on small systems ! DEFINES += -DSUPPORT_OLD_PLUGIN_VERSIONS=1 # search sources and headers in current dir and in src/ --- 62,71 ---- endif + ################################### + # # options to save space on small systems ! ! # we have plugins with the old interface ! CFLAGS += -DSUPPORT_OLD_PLUGIN_VERSIONS=1 # search sources and headers in current dir and in src/ From (spam-protected) Thu Jul 26 19:34:56 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Thu, 26 Jul 2007 17:34:56 +0000 Subject: [Olsr-cvs] olsrd-current/lib/secure Makefile,1.17,1.18 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/secure In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28549/lib/secure Modified Files: Makefile Log Message: * the contents of INCLUDES and DEFINES should now be placed into CPPFLAGS as it belongs in there * also all -I and -D options from CFALGS are now there * however, we add for the time being INCLUDES and DEFINES to CPPFLAGS (and warn) to not break ouf of tree modules. * and the -DSUPPORT_OLD_PLUGIN_VERSIONS=1 is now fixed as it should have been right from the start Index: Makefile =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/secure/Makefile,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Makefile 15 Jul 2007 21:47:17 -0000 1.17 --- Makefile 26 Jul 2007 17:34:54 -0000 1.18 *************** *** 46,51 **** ifdef USE_OPENSSL ! CFLAGS += -DUSE_OPENSSL ! LIBS += -lssl -lcrypto endif --- 46,51 ---- ifdef USE_OPENSSL ! CPPFLAGS += -DUSE_OPENSSL ! LIBS += -lssl -lcrypto endif From (spam-protected) Thu Jul 26 19:34:56 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Thu, 26 Jul 2007 17:34:56 +0000 Subject: [Olsr-cvs] olsrd-current/lib/httpinfo Makefile,1.22,1.23 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/httpinfo In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28549/lib/httpinfo Modified Files: Makefile Log Message: * the contents of INCLUDES and DEFINES should now be placed into CPPFLAGS as it belongs in there * also all -I and -D options from CFALGS are now there * however, we add for the time being INCLUDES and DEFINES to CPPFLAGS (and warn) to not break ouf of tree modules. * and the -DSUPPORT_OLD_PLUGIN_VERSIONS=1 is now fixed as it should have been right from the start Index: Makefile =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/httpinfo/Makefile,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** Makefile 15 Jul 2007 21:50:45 -0000 1.22 --- Makefile 26 Jul 2007 17:34:54 -0000 1.23 *************** *** 46,50 **** ifdef ADMIN_INTERFACE ! CFLAGS += -DADMIN_INTERFACE endif --- 46,50 ---- ifdef ADMIN_INTERFACE ! CPPFLAGS += -DADMIN_INTERFACE endif From (spam-protected) Thu Jul 26 19:34:56 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Thu, 26 Jul 2007 17:34:56 +0000 Subject: [Olsr-cvs] olsrd-current/src/cfgparser Makefile,1.26,1.27 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src/cfgparser In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28549/src/cfgparser Modified Files: Makefile Log Message: * the contents of INCLUDES and DEFINES should now be placed into CPPFLAGS as it belongs in there * also all -I and -D options from CFALGS are now there * however, we add for the time being INCLUDES and DEFINES to CPPFLAGS (and warn) to not break ouf of tree modules. * and the -DSUPPORT_OLD_PLUGIN_VERSIONS=1 is now fixed as it should have been right from the start Index: Makefile =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/cfgparser/Makefile,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** Makefile 13 May 2007 22:02:57 -0000 1.26 --- Makefile 26 Jul 2007 17:34:54 -0000 1.27 *************** *** 49,53 **** LIBNAME ?= olsrd_cfgparser.dll BINNAME ?= olsrd_cfgparser.exe ! CFLAGS += -DWIN32_STDIO_HACK OBJS += ../win32/compat.o --- 49,53 ---- LIBNAME ?= olsrd_cfgparser.dll BINNAME ?= olsrd_cfgparser.exe ! CPPFLAGS += -DWIN32_STDIO_HACK OBJS += ../win32/compat.o *************** *** 62,66 **** ifdef MAKEBIN ! CFLAGS += -DMAKEBIN NAME = $(BINNAME) --- 62,66 ---- ifdef MAKEBIN ! CPPFLAGS += -DMAKEBIN NAME = $(BINNAME) *************** *** 79,83 **** endif ! CFLAGS += -DMAKELIB NAME = $(LIBNAME) --- 79,83 ---- endif ! CPPFLAGS += -DMAKELIB NAME = $(LIBNAME) From (spam-protected) Thu Jul 26 19:34:56 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Thu, 26 Jul 2007 17:34:56 +0000 Subject: [Olsr-cvs] olsrd-current/make Makefile.fbsd, 1.9, 1.10 Makefile.linux, 1.11, 1.12 Makefile.nbsd, 1.6, 1.7 Makefile.obsd, 1.5, 1.6 Makefile.osx, 1.8, 1.9 Makefile.win32, 1.9, 1.10 Makefile.wince, 1.4, 1.5 Message-ID: Update of /cvsroot/olsrd/olsrd-current/make In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28549/make Modified Files: Makefile.fbsd Makefile.linux Makefile.nbsd Makefile.obsd Makefile.osx Makefile.win32 Makefile.wince Log Message: * the contents of INCLUDES and DEFINES should now be placed into CPPFLAGS as it belongs in there * also all -I and -D options from CFALGS are now there * however, we add for the time being INCLUDES and DEFINES to CPPFLAGS (and warn) to not break ouf of tree modules. * and the -DSUPPORT_OLD_PLUGIN_VERSIONS=1 is now fixed as it should have been right from the start Index: Makefile.obsd =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/make/Makefile.obsd,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Makefile.obsd 12 Nov 2006 21:54:53 -0000 1.5 --- Makefile.obsd 26 Jul 2007 17:34:54 -0000 1.6 *************** *** 6,14 **** LIBDIR = $(DESTDIR)/usr/lib ! SRCS += $(wildcard src/bsd/*.c) $(wildcard src/unix/*.c) ! HDRS += $(wildcard src/bsd/*.h) $(wildcard src/unix/*.h) ! DEFINES = -D__OpenBSD__ ! LIBS = PLUGIN_FULLNAME ?= $(PLUGIN_NAME).so.$(PLUGIN_VER) --- 6,14 ---- LIBDIR = $(DESTDIR)/usr/lib ! SRCS += $(wildcard src/bsd/*.c src/unix/*.c) ! HDRS += $(wildcard src/bsd/*.h src/unix/*.h) ! CPPFLAGS += -D__OpenBSD__ ! LIBS += PLUGIN_FULLNAME ?= $(PLUGIN_NAME).so.$(PLUGIN_VER) Index: Makefile.wince =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/make/Makefile.wince,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Makefile.wince 12 Nov 2006 21:54:53 -0000 1.4 --- Makefile.wince 26 Jul 2007 17:34:54 -0000 1.5 *************** *** 9,16 **** HDRS += $(wildcard src/win32/*.h) ! DEFINES = -DWIN32 -DWINCE ! LIBS = -lwinsock -liphlpapi ! INCLUDES += -Isrc/win32 -Isrc/win32/ce ifdef OLSRD_PLUGIN --- 9,16 ---- HDRS += $(wildcard src/win32/*.h) ! CPPFLAGS += -DWIN32 -DWINCE ! LIBS += -lwinsock -liphlpapi ! CPPFLAGS += -Isrc/win32 -Isrc/win32/ce ifdef OLSRD_PLUGIN Index: Makefile.win32 =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/make/Makefile.win32,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Makefile.win32 27 Mar 2007 03:58:47 -0000 1.9 --- Makefile.win32 26 Jul 2007 17:34:54 -0000 1.10 *************** *** 9,15 **** HDRS += $(wildcard src/win32/*.h) ! DEFINES += -DWIN32 -D_WIN32_WINNT=0x0600 LIBS += -mno-cygwin -lws2_32 -liphlpapi ! INCLUDES += -I$(TOPDIR)/src/win32 CFLAGS += -mno-cygwin --- 9,15 ---- HDRS += $(wildcard src/win32/*.h) ! CPPFLAGS += -DWIN32 -D_WIN32_WINNT=0x0600 LIBS += -mno-cygwin -lws2_32 -liphlpapi ! CPPFLAGS += -I$(TOPDIR)/src/win32 CFLAGS += -mno-cygwin Index: Makefile.linux =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/make/Makefile.linux,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Makefile.linux 27 Apr 2007 11:41:25 -0000 1.11 --- Makefile.linux 26 Jul 2007 17:34:54 -0000 1.12 *************** *** 7,15 **** LIBDIR = $(DESTDIR)$(shell if [ "$(ARCH)" = "x86_64" -a -d "/usr/lib64" ]; then echo "/usr/lib64"; else echo "/usr/lib"; fi) ! SRCS += $(wildcard src/linux/*.c) $(wildcard src/unix/*.c) ! HDRS += $(wildcard src/linux/*.h) $(wildcard src/unix/*.h) ! DEFINES = -Dlinux ! LIBS = PLUGIN_FULLNAME ?= $(PLUGIN_NAME).so.$(PLUGIN_VER) --- 7,15 ---- LIBDIR = $(DESTDIR)$(shell if [ "$(ARCH)" = "x86_64" -a -d "/usr/lib64" ]; then echo "/usr/lib64"; else echo "/usr/lib"; fi) ! SRCS += $(wildcard src/linux/*.c src/unix/*.c) ! HDRS += $(wildcard src/linux/*.h src/unix/*.h) ! CPPFLAGS += -Dlinux ! LIBS += PLUGIN_FULLNAME ?= $(PLUGIN_NAME).so.$(PLUGIN_VER) Index: Makefile.osx =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/make/Makefile.osx,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Makefile.osx 30 Jan 2007 16:51:04 -0000 1.8 --- Makefile.osx 26 Jul 2007 17:34:54 -0000 1.9 *************** *** 10,18 **** LIBDIR = $(DESTDIR)/usr/lib ! SRCS += $(wildcard src/bsd/*.c) $(wildcard src/unix/*.c) ! HDRS += $(wildcard src/bsd/*.h) $(wildcard src/unix/*.h) ! DEFINES = -D__MacOSX__ ! LIBS = PLUGIN_FULLNAME ?= $(PLUGIN_NAME).so.$(PLUGIN_VER) --- 10,18 ---- LIBDIR = $(DESTDIR)/usr/lib ! SRCS += $(wildcard src/bsd/*.c src/unix/*.c) ! HDRS += $(wildcard src/bsd/*.h src/unix/*.h) ! CPPFLAGS += -D__MacOSX__ ! LIBS += PLUGIN_FULLNAME ?= $(PLUGIN_NAME).so.$(PLUGIN_VER) Index: Makefile.fbsd =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/make/Makefile.fbsd,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Makefile.fbsd 12 Nov 2006 21:54:53 -0000 1.9 --- Makefile.fbsd 26 Jul 2007 17:34:54 -0000 1.10 *************** *** 15,27 **** LIBS = ! CFLAGS += -DOLSRD_GLOBAL_CONF_FILE=\"$(CFGFILE)\" ifdef NO_80211 ! CFLAGS += -DFBSD_NO_80211=1 endif ifdef LIBNET ! CFLAGS += -DSPOOF -I$(DESTDIR)/include LIBS += -L$(DESTDIR)/lib -lnet --- 15,27 ---- LIBS = ! CPPFLAGS += -DOLSRD_GLOBAL_CONF_FILE=\"$(CFGFILE)\" ifdef NO_80211 ! CPPFLAGS += -DFBSD_NO_80211=1 endif ifdef LIBNET ! CPPFLAGS += -DSPOOF -I$(DESTDIR)/include LIBS += -L$(DESTDIR)/lib -lnet Index: Makefile.nbsd =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/make/Makefile.nbsd,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Makefile.nbsd 12 Nov 2006 21:54:53 -0000 1.6 --- Makefile.nbsd 26 Jul 2007 17:34:54 -0000 1.7 *************** *** 6,14 **** LIBDIR = $(DESTDIR)/usr/lib ! SRCS += $(wildcard src/bsd/*.c) $(wildcard src/unix/*.c) ! HDRS += $(wildcard src/bsd/*.h) $(wildcard src/unix/*.h) ! DEFINES = -D__NetBSD__ ! LIBS = PLUGIN_FULLNAME ?= $(PLUGIN_NAME).so.$(PLUGIN_VER) --- 6,14 ---- LIBDIR = $(DESTDIR)/usr/lib ! SRCS += $(wildcard src/bsd/*.c src/unix/*.c) ! HDRS += $(wildcard src/bsd/*.h src/unix/*.h) ! CPPFLAGS += -D__NetBSD__ ! LIBS += PLUGIN_FULLNAME ?= $(PLUGIN_NAME).so.$(PLUGIN_VER) From (spam-protected) Thu Jul 26 19:34:56 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Thu, 26 Jul 2007 17:34:56 +0000 Subject: [Olsr-cvs] olsrd-current Makefile, 1.87, 1.88 Makefile.inc, 1.19, 1.20 Message-ID: Update of /cvsroot/olsrd/olsrd-current In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28549 Modified Files: Makefile Makefile.inc Log Message: * the contents of INCLUDES and DEFINES should now be placed into CPPFLAGS as it belongs in there * also all -I and -D options from CFALGS are now there * however, we add for the time being INCLUDES and DEFINES to CPPFLAGS (and warn) to not break ouf of tree modules. * and the -DSUPPORT_OLD_PLUGIN_VERSIONS=1 is now fixed as it should have been right from the start Index: Makefile =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/Makefile,v retrieving revision 1.87 retrieving revision 1.88 diff -C2 -d -r1.87 -r1.88 *** Makefile 17 Jul 2007 13:13:08 -0000 1.87 --- Makefile 26 Jul 2007 17:34:53 -0000 1.88 *************** *** 40,47 **** VERS = 0.5.3pre TOPDIR = . include Makefile.inc ! CFLAGS += -DVERSION=\"$(VERS)\" MAKECMD = $(MAKE) OS="$(OS)" WARNINGS="$(WARNINGS)" --- 40,49 ---- VERS = 0.5.3pre + all: + TOPDIR = . include Makefile.inc ! CPPFLAGS += -DVERSION=\"$(VERS)\" MAKECMD = $(MAKE) OS="$(OS)" WARNINGS="$(WARNINGS)" *************** *** 73,77 **** $(MAKECMD) -C $(CFGDIR) ! .PHONY: help libs clean_libs libs_clean clean uberclean install_libs libs_install install_bin install_olsrd install build_all install_all clean_all clean: --- 75,79 ---- $(MAKECMD) -C $(CFGDIR) ! .PHONY: help libs clean_libs libs_clean clean uberclean install_libs libs_install install_bin install_olsrd install build_all install_all clean_all clean: *************** *** 84,88 **** find . \( -name '*.[od]' -o -name '*~' \) -print | xargs -r rm -f $(MAKECMD) -C $(CFGDIR) uberclean - $(MAKECMD) -C $(SWITCHDIR) clean install: install_olsrd --- 86,89 ---- Index: Makefile.inc =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/Makefile.inc,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Makefile.inc 26 Jul 2007 16:03:40 -0000 1.19 --- Makefile.inc 26 Jul 2007 17:34:53 -0000 1.20 *************** *** 21,25 **** EXENAME ?= olsrd ! INCLUDES = -Isrc -I$(TOPDIR)/src # add gcc warnings and optimizations if CFLAGS not set --- 21,25 ---- EXENAME ?= olsrd ! CPPFLAGS = -Isrc -I$(TOPDIR)/src # add gcc warnings and optimizations if CFLAGS not set *************** *** 54,58 **** ifdef OLSRD_PLUGIN # c and ld flags for libraries (plugins) ! CFLAGS += -DOLSR_PLUGIN LDFLAGS += -shared -Wl,-soname,$(PLUGIN_NAME) LDFLAGS += -Wl,--version-script=version-script.txt --- 54,58 ---- ifdef OLSRD_PLUGIN # c and ld flags for libraries (plugins) ! CPPFLAGS += -DOLSR_PLUGIN LDFLAGS += -shared -Wl,-soname,$(PLUGIN_NAME) LDFLAGS += -Wl,--version-script=version-script.txt *************** *** 67,77 **** # we have plugins with the old interface ! CFLAGS += -DSUPPORT_OLD_PLUGIN_VERSIONS=1 # search sources and headers in current dir and in src/ ! SRCS = $(wildcard src/*.c) ! SRCS += $(wildcard *.c) ! HDRS = $(wildcard src/*.h) ! HDRS += $(wildcard *.h) all: default_target --- 67,75 ---- # we have plugins with the old interface ! CPPFLAGS += -DSUPPORT_OLD_PLUGIN_VERSIONS=1 # search sources and headers in current dir and in src/ ! SRCS += $(wildcard src/*.c *.c) ! HDRS += $(wildcard src/*.h *.h) all: default_target *************** *** 79,86 **** # OS detection ifeq ($(OS),Windows_NT) ! OS = win32 endif ifeq ($(OS),) ! OS := $(shell sh $(TOPDIR)/make/guess_os.sh) endif ifeq ($(OS),UNKNOWN) --- 77,84 ---- # OS detection ifeq ($(OS),Windows_NT) ! OS := win32 endif ifeq ($(OS),) ! OS := $(shell sh $(TOPDIR)/make/guess_os.sh) endif ifeq ($(OS),UNKNOWN) *************** *** 93,111 **** # one object for each source file ! OBJS += $(patsubst %.c,%.o,$(SRCS)) # debugging or non-debugging flags ifdef DEBUG ! CFLAGS += -DDEBUG endif ifdef NODEBUG ! CFLAGS += -DNODEBUG endif ! # let gcc generate dependency information (*.d) ! CFLAGS += -MD # we always need the includes and defines ! CFLAGS += $(INCLUDES) $(DEFINES) TAGFILE ?= src/TAGS --- 91,117 ---- # one object for each source file ! OBJS += $(SRCS:%.c=%.o) # debugging or non-debugging flags ifdef DEBUG ! CPPFLAGS += -DDEBUG endif ifdef NODEBUG ! CPPFLAGS += -DNODEBUG endif ! # fully automatic and working dependency generation ! %.d: %.c ! @$(CC) -M $(CPPFLAGS) "$<" | sed -e '1s|\($(*F)\)\.o[ :]*|$(*D)/\1.o $@: Makefile $(TOPDIR)$(if $(TOPDIR),/)Makefile.inc \\\n |g' >"$@" # we always need the includes and defines ! # for legacy since now ! CPPFLAGS += $(INCLUDES) $(DEFINES) ! ifneq ($(INCLUDES),) ! $(warning Use CPPFLAGS instead of INCLUDES for -I) ! endif ! ifneq ($(DEFINES),) ! $(warning Use CPPFLAGS instead of DEFINES for -D) ! endif TAGFILE ?= src/TAGS From (spam-protected) Thu Jul 26 19:34:56 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Thu, 26 Jul 2007 17:34:56 +0000 Subject: [Olsr-cvs] olsrd-current/lib/quagga Makefile,1.6,1.7 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/quagga In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28549/lib/quagga Modified Files: Makefile Log Message: * the contents of INCLUDES and DEFINES should now be placed into CPPFLAGS as it belongs in there * also all -I and -D options from CFALGS are now there * however, we add for the time being INCLUDES and DEFINES to CPPFLAGS (and warn) to not break ouf of tree modules. * and the -DSUPPORT_OLD_PLUGIN_VERSIONS=1 is now fixed as it should have been right from the start Index: Makefile =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/quagga/Makefile,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Makefile 15 Jul 2007 21:50:46 -0000 1.6 --- Makefile 26 Jul 2007 17:34:54 -0000 1.7 *************** *** 42,52 **** PLUGIN_VER = 0.2.2 ! #CFLAGS +=-DMY_DEBUG ! CFLAGS += -g ! CFLAGS +=-DUSE_UNIX_DOMAIN_SOCKET #uncomment the following line only if you are sure what you're doing, it will #probably break things! ! # CFLAGS +=-DZEBRA_HEADER_MARKER=255 TOPDIR = ../.. --- 42,52 ---- PLUGIN_VER = 0.2.2 ! #CPPFLAGS += -DMY_DEBUG ! CFLAGS += -g ! CPPFLAGS += -DUSE_UNIX_DOMAIN_SOCKET #uncomment the following line only if you are sure what you're doing, it will #probably break things! ! #CPPFLAGS += -DZEBRA_HEADER_MARKER=255 TOPDIR = ../.. From (spam-protected) Thu Jul 26 22:58:21 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Thu, 26 Jul 2007 20:58:21 +0000 Subject: [Olsr-cvs] olsrd-current/src plugin_loader.c,1.27,1.28 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11806/src Modified Files: plugin_loader.c Log Message: * always show failed loading of a plugin Index: plugin_loader.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/plugin_loader.c,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** plugin_loader.c 15 Jul 2007 19:29:37 -0000 1.27 --- plugin_loader.c 26 Jul 2007 20:58:19 -0000 1.28 *************** *** 95,99 **** if(plugin->dlhandle == NULL) { const int save_errno = errno; ! OLSR_PRINTF(1, "DL loading failed: \"%s\"!\n", dlerror()); free(plugin); errno = save_errno; --- 95,99 ---- if(plugin->dlhandle == NULL) { const int save_errno = errno; ! OLSR_PRINTF(0, "DL loading failed: \"%s\"!\n", dlerror()); free(plugin); errno = save_errno; From (spam-protected) Sat Jul 28 14:53:18 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sat, 28 Jul 2007 12:53:18 +0000 Subject: [Olsr-cvs] olsrd-current/src/olsr_switch main.c, 1.24, 1.25 ohs_cmd.c, 1.22, 1.23 ohs_cmd.h, 1.5, 1.6 olsr_host_switch.h, 1.8, 1.9 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src/olsr_switch In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27084/src/olsr_switch Modified Files: main.c ohs_cmd.c ohs_cmd.h olsr_host_switch.h Log Message: * fixed warnings Index: ohs_cmd.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/olsr_switch/ohs_cmd.c,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** ohs_cmd.c 31 May 2007 00:14:53 -0000 1.22 --- ohs_cmd.c 28 Jul 2007 12:53:15 -0000 1.23 *************** *** 537,541 **** int ! ohs_cmd_exit(char *args) { --- 537,541 ---- int ! ohs_cmd_exit(char *args __attribute__((unused))) { *************** *** 543,547 **** ohs_close(0); - return 0; } --- 543,546 ---- Index: olsr_host_switch.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/olsr_switch/olsr_host_switch.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** olsr_host_switch.h 4 Jun 2005 21:07:33 -0000 1.8 --- olsr_host_switch.h 28 Jul 2007 12:53:15 -0000 1.9 *************** *** 60,67 **** #ifdef WIN32 #define close(x) closesocket(x) ! int __stdcall ohs_close(unsigned long signal); #else ! void ! ohs_close(int); #endif --- 60,66 ---- #ifdef WIN32 #define close(x) closesocket(x) ! int __stdcall ohs_close(unsigned long signal) __attribute__((noreturn)); #else ! void ohs_close(int) __attribute__((noreturn)); #endif Index: main.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/olsr_switch/main.c,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** main.c 20 Apr 2007 14:23:41 -0000 1.24 --- main.c 28 Jul 2007 12:53:15 -0000 1.25 *************** *** 128,135 **** #ifdef WIN32 int __stdcall ! ohs_close(unsigned long signal) #else void ! ohs_close(int signal) #endif { --- 128,135 ---- #ifdef WIN32 int __stdcall ! ohs_close(unsigned long signal __attribut__((unused))) #else void ! ohs_close(int signal __attribute__((unused))) #endif { *************** *** 312,316 **** static int ! ohs_init_connect_sockets() { olsr_u32_t yes = 1; --- 312,316 ---- static int ! ohs_init_connect_sockets(void) { olsr_u32_t yes = 1; *************** *** 359,363 **** static int ! ohs_configure() { --- 359,363 ---- static int ! ohs_configure(void) { *************** *** 396,400 **** static void ! ohs_listen_loop() { #if !defined WIN32 --- 396,400 ---- static void ! ohs_listen_loop(void) { #if !defined WIN32 *************** *** 535,539 **** int ! main(int argc, char *argv[]) { --- 535,539 ---- int ! main(void) { Index: ohs_cmd.h =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/olsr_switch/ohs_cmd.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ohs_cmd.h 23 Oct 2005 19:01:04 -0000 1.5 --- ohs_cmd.h 28 Jul 2007 12:53:15 -0000 1.6 *************** *** 72,76 **** int ! ohs_cmd_exit(char *); int --- 72,76 ---- int ! ohs_cmd_exit(char *) __attribute__((noreturn)); int From (spam-protected) Sat Jul 28 14:55:51 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sat, 28 Jul 2007 12:55:51 +0000 Subject: [Olsr-cvs] olsrd-current/src/olsr_switch main.c,1.25,1.26 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src/olsr_switch In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27857/src/olsr_switch Modified Files: main.c Log Message: * ooops, fixed typo Index: main.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/olsr_switch/main.c,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** main.c 28 Jul 2007 12:53:15 -0000 1.25 --- main.c 28 Jul 2007 12:55:49 -0000 1.26 *************** *** 128,132 **** #ifdef WIN32 int __stdcall ! ohs_close(unsigned long signal __attribut__((unused))) #else void --- 128,132 ---- #ifdef WIN32 int __stdcall ! ohs_close(unsigned long signal __attribute__((unused))) #else void From (spam-protected) Sat Jul 28 14:58:25 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sat, 28 Jul 2007 12:58:25 +0000 Subject: [Olsr-cvs] olsrd-current/src/olsr_switch ohs_cmd.c,1.23,1.24 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src/olsr_switch In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28990/src/olsr_switch Modified Files: ohs_cmd.c Log Message: * ooops, fixed another warning in the Windows port Index: ohs_cmd.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/olsr_switch/ohs_cmd.c,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** ohs_cmd.c 28 Jul 2007 12:53:15 -0000 1.23 --- ohs_cmd.c 28 Jul 2007 12:58:23 -0000 1.24 *************** *** 95,105 **** } int ! ohs_cmd_olsrd(char *args) { - #ifdef WIN32 printf("olsrd command not available in windows version\nStart instances manually\n"); return 0; #else char *olsrd_args[MAX_OLSRD_ARGS]; struct in_addr iaddr; --- 95,109 ---- } + #ifdef WIN32 int ! ohs_cmd_olsrd(char *args __attribute__((unused))) { printf("olsrd command not available in windows version\nStart instances manually\n"); return 0; + } #else + int + ohs_cmd_olsrd(char *args) + { char *olsrd_args[MAX_OLSRD_ARGS]; struct in_addr iaddr; *************** *** 229,234 **** printf("Usage: olsrd [start|stop|show|setb|seta] [IP|path|args]\n"); return 0; - #endif } int --- 233,238 ---- printf("Usage: olsrd [start|stop|show|setb|seta] [IP|path|args]\n"); return 0; } + #endif int From (spam-protected) Sat Jul 28 14:59:40 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sat, 28 Jul 2007 12:59:40 +0000 Subject: [Olsr-cvs] olsrd-current .cvsignore, 1.2, 1.3 Makefile, 1.88, 1.89 Makefile.inc, 1.20, 1.21 Message-ID: Update of /cvsroot/olsrd/olsrd-current In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv29427 Modified Files: .cvsignore Makefile Makefile.inc Log Message: * ignore the generated olsr_switch binary.cvsignore Index: .cvsignore =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/.cvsignore,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** .cvsignore 5 Feb 2007 21:17:26 -0000 1.2 --- .cvsignore 28 Jul 2007 12:59:38 -0000 1.3 *************** *** 2,3 **** --- 2,4 ---- *.d olsrd-current.tar.bz2 + olsr_switch Index: Makefile =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/Makefile,v retrieving revision 1.88 retrieving revision 1.89 diff -C2 -d -r1.88 -r1.89 *** Makefile 26 Jul 2007 17:34:53 -0000 1.88 --- Makefile 28 Jul 2007 12:59:38 -0000 1.89 *************** *** 80,84 **** -rm -f $(OBJS) $(SRCS:%.c=%.d) olsrd olsrd.exe $(MAKECMD) -C $(CFGDIR) clean - $(MAKECMD) -C $(SWITCHDIR) clean uberclean: clean clean_libs --- 80,83 ---- *************** *** 86,89 **** --- 85,89 ---- find . \( -name '*.[od]' -o -name '*~' \) -print | xargs -r rm -f $(MAKECMD) -C $(CFGDIR) uberclean + $(MAKECMD) -C $(SWITCHDIR) clean install: install_olsrd *************** *** 182,186 **** ! build_all: cfgparser olsrd libs install_all: install install_libs clean_all: uberclean clean_libs --- 182,186 ---- ! build_all: cfgparser olsrd libs switch install_all: install install_libs clean_all: uberclean clean_libs Index: Makefile.inc =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/Makefile.inc,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** Makefile.inc 26 Jul 2007 17:34:53 -0000 1.20 --- Makefile.inc 28 Jul 2007 12:59:38 -0000 1.21 *************** *** 2,8 **** CCACHE ?= $(shell sh -c "type -path ccache") ifeq ($(origin CC),default) ! CC = $(CCACHE) gcc else ! CC ?= $(CCACHE) gcc endif STRIP ?= strip --- 2,8 ---- CCACHE ?= $(shell sh -c "type -path ccache") ifeq ($(origin CC),default) ! CC = $(CCACHE) gcc4 else ! CC ?= $(CCACHE) gcc4 endif STRIP ?= strip *************** *** 34,38 **** WARNINGS += -Wmissing-declarations WARNINGS += -Wsign-compare ! WARNINGS += -Waggregate-return WARNINGS += -Wmissing-noreturn WARNINGS += -Wmissing-format-attribute --- 34,38 ---- WARNINGS += -Wmissing-declarations WARNINGS += -Wsign-compare ! #WARNINGS += -Waggregate-return WARNINGS += -Wmissing-noreturn WARNINGS += -Wmissing-format-attribute *************** *** 44,54 **** WARNINGS += -Winline WARNINGS += -Wdisabled-optimization ! #WARNINGS += -Werror WARNINGS := $(shell CC="$(CC)" $(TOPDIR)/gcc-warnings $(WARNINGS)) endif CFLAGS += $(WARNINGS) ! CFLAGS += -O2 CFLAGS += -g endif ifdef OLSRD_PLUGIN --- 44,55 ---- WARNINGS += -Winline WARNINGS += -Wdisabled-optimization ! WARNINGS += -Werror WARNINGS := $(shell CC="$(CC)" $(TOPDIR)/gcc-warnings $(WARNINGS)) endif CFLAGS += $(WARNINGS) ! CFLAGS += -Os CFLAGS += -g endif + CFLAGS += -fmudflapth ifdef OLSRD_PLUGIN *************** *** 61,64 **** --- 62,66 ---- LDFLAGS += -Wl,-export-dynamic endif + LDFLAGS += -lmudflap ################################### From (spam-protected) Sat Jul 28 15:40:26 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sat, 28 Jul 2007 13:40:26 +0000 Subject: [Olsr-cvs] olsrd-current Makefile.inc,1.21,1.22 Message-ID: Update of /cvsroot/olsrd/olsrd-current In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11039 Modified Files: Makefile.inc Log Message: * ooops Index: Makefile.inc =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/Makefile.inc,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** Makefile.inc 28 Jul 2007 12:59:38 -0000 1.21 --- Makefile.inc 28 Jul 2007 13:40:19 -0000 1.22 *************** *** 2,8 **** CCACHE ?= $(shell sh -c "type -path ccache") ifeq ($(origin CC),default) ! CC = $(CCACHE) gcc4 else ! CC ?= $(CCACHE) gcc4 endif STRIP ?= strip --- 2,8 ---- CCACHE ?= $(shell sh -c "type -path ccache") ifeq ($(origin CC),default) ! CC = $(CCACHE) gcc else ! CC ?= $(CCACHE) gcc endif STRIP ?= strip *************** *** 34,38 **** WARNINGS += -Wmissing-declarations WARNINGS += -Wsign-compare ! #WARNINGS += -Waggregate-return WARNINGS += -Wmissing-noreturn WARNINGS += -Wmissing-format-attribute --- 34,38 ---- WARNINGS += -Wmissing-declarations WARNINGS += -Wsign-compare ! WARNINGS += -Waggregate-return WARNINGS += -Wmissing-noreturn WARNINGS += -Wmissing-format-attribute *************** *** 44,55 **** WARNINGS += -Winline WARNINGS += -Wdisabled-optimization ! WARNINGS += -Werror WARNINGS := $(shell CC="$(CC)" $(TOPDIR)/gcc-warnings $(WARNINGS)) endif CFLAGS += $(WARNINGS) ! CFLAGS += -Os CFLAGS += -g endif - CFLAGS += -fmudflapth ifdef OLSRD_PLUGIN --- 44,54 ---- WARNINGS += -Winline WARNINGS += -Wdisabled-optimization ! #WARNINGS += -Werror WARNINGS := $(shell CC="$(CC)" $(TOPDIR)/gcc-warnings $(WARNINGS)) endif CFLAGS += $(WARNINGS) ! CFLAGS += -O2 CFLAGS += -g endif ifdef OLSRD_PLUGIN *************** *** 62,66 **** LDFLAGS += -Wl,-export-dynamic endif - LDFLAGS += -lmudflap ################################### --- 61,64 ---- From (spam-protected) Sat Jul 28 15:45:31 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sat, 28 Jul 2007 13:45:31 +0000 Subject: [Olsr-cvs] olsrd-current CHANGELOG,1.66,1.67 Message-ID: Update of /cvsroot/olsrd/olsrd-current In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv12971 Modified Files: CHANGELOG Log Message: * update Index: CHANGELOG =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/CHANGELOG,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -d -r1.66 -r1.67 *** CHANGELOG 23 Jul 2007 13:04:01 -0000 1.66 --- CHANGELOG 28 Jul 2007 13:45:29 -0000 1.67 *************** *** 8,11 **** --- 8,22 ---- plugin and identified it's source. + 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. + 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. + + CLEANUPS + - olsr_switch does no longer generate warnings + - olsr_switch is also built with "build_all" and cleaned with "uberclean" + 0.5.2 --------------------------------------------------------------------- From (spam-protected) Sat Jul 28 21:33:51 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Sat, 28 Jul 2007 19:33:51 +0000 Subject: [Olsr-cvs] olsrd-current/src/olsr_switch Makefile,1.10,1.11 Message-ID: Update of /cvsroot/olsrd/olsrd-current/src/olsr_switch In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20257/src/olsr_switch Modified Files: Makefile Log Message: * also delete the dependency files correctly Index: Makefile =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/src/olsr_switch/Makefile,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Makefile 4 Aug 2005 18:57:11 -0000 1.10 --- Makefile 28 Jul 2007 19:33:48 -0000 1.11 *************** *** 13,17 **** clean: ! rm -f *.o *.d rm -f *~ rm -f $(TOPDIR)/$(BINNAME) --- 13,17 ---- clean: ! rm -f *.[od] rm -f *~ rm -f $(TOPDIR)/$(BINNAME) From (spam-protected) Tue Jul 31 14:02:20 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Tue, 31 Jul 2007 12:02:20 +0000 Subject: [Olsr-cvs] olsrd-current/lib/bmf/src Bmf.c,1.6,1.7 Message-ID: Update of /cvsroot/olsrd/olsrd-current/lib/bmf/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11886/lib/bmf/src Modified Files: Bmf.c Log Message: * fixed SIGSEGV reported by Cédric Krier Index: Bmf.c =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/lib/bmf/src/Bmf.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Bmf.c 30 Jun 2007 20:07:47 -0000 1.6 --- Bmf.c 31 Jul 2007 12:02:18 -0000 1.7 *************** *** 1452,1468 **** } ! /* Signal BmfThread to exit */ ! /* Strangely enough, all running threads receive the SIGALRM signal. But only the ! * BMF thread is affected by this signal, having specified a handler for this ! * signal in its thread entry function BmfRun(...). */ ! if (pthread_kill(BmfThread, SIGALRM) != 0) { ! BmfPError("pthread_kill() error"); ! } ! /* Wait for BmfThread to acknowledge */ ! if (pthread_join(BmfThread, NULL) != 0) ! { ! BmfPError("pthread_join() error"); } --- 1452,1471 ---- } ! if (BmfThreadRunning) { ! /* Signal BmfThread to exit */ ! /* Strangely enough, all running threads receive the SIGALRM signal. But only the ! * BMF thread is affected by this signal, having specified a handler for this ! * signal in its thread entry function BmfRun(...). */ ! if (pthread_kill(BmfThread, SIGALRM) != 0) ! { ! BmfPError("pthread_kill() error"); ! } ! /* Wait for BmfThread to acknowledge */ ! if (pthread_join(BmfThread, NULL) != 0) ! { ! BmfPError("pthread_join() error"); ! } } From (spam-protected) Tue Jul 31 14:02:21 2007 From: (spam-protected) (Bernd Petrovitsch) Date: Tue, 31 Jul 2007 12:02:21 +0000 Subject: [Olsr-cvs] olsrd-current CHANGELOG,1.67,1.68 Message-ID: Update of /cvsroot/olsrd/olsrd-current In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11886 Modified Files: CHANGELOG Log Message: * fixed SIGSEGV reported by Cédric Krier Index: CHANGELOG =================================================================== RCS file: /cvsroot/olsrd/olsrd-current/CHANGELOG,v retrieving revision 1.67 retrieving revision 1.68 diff -C2 -d -r1.67 -r1.68 *** CHANGELOG 28 Jul 2007 13:45:29 -0000 1.67 --- CHANGELOG 31 Jul 2007 12:02:18 -0000 1.68 *************** *** 8,11 **** --- 8,17 ---- plugin and identified it's source. + BUG FIX + The bmf plugin wanted to kill a not-started thread and this causes a segmentation + violation. This happens if the old plugin interface support is not compiled in + and one uses - or more asccurate: wants to use - the bmf plugin which uses that + ATM. Thanks to Cédric Krier for reporting this. + DEPENDENCIES FIXED The dependencies (*.d files) are now properly generated and used. Nd they also