[Olsr-cvs] olsrd-current/src ipcalc.c, NONE, 1.1 ipcalc.h, NONE, 1.1 build_msg.c, 1.39, 1.40 duplicate_set.c, 1.19, 1.20 hna_set.c, 1.25, 1.26 hna_set.h, 1.16, 1.17 hysteresis.c, 1.22, 1.23 interfaces.c, 1.37, 1.38 ipc_frontend.c, 1.40, 1.41 link_set.c, 1.77, 1.78 lq_avl.c, 1.17, 1.18 lq_packet.c, 1.32, 1.33 lq_route.c, 1.60, 1.61 main.c, 1.105, 1.106 mid_set.c, 1.24, 1.25 mpr.c, 1.20, 1.21 mpr_selector_set.c, 1.20, 1.21 neighbor_table.c, 1.35, 1.36 net_olsr.c, 1.36, 1.37 net_olsr.h, 1.18, 1.19 olsr_cfg.h, 1.39, 1.40 olsr_types.h, 1.12, 1.13 packet.c, 1.26, 1.27 packet.h, 1.18, 1.19 parser.c, 1.37, 1.38 print_packet.c, 1.13, 1.14 process_package.c, 1.46, 1.47 process_routes.c, 1.40, 1.41 rebuild_packet.c, 1.25, 1.26 routing_table.c, 1.35, 1.36 tc_set.c, 1.37, 1.38 two_hop_neighbor_table.c, 1.20, 1.21 local_hna_set.c, 1.16, NONE local_hna_set.h, 1.12, NONE

Bernd Petrovitsch (spam-protected)
Thu Nov 29 01:49:42 CET 2007


Update of /cvsroot/olsrd/olsrd-current/src
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16024/src

Modified Files:
	build_msg.c duplicate_set.c hna_set.c hna_set.h hysteresis.c 
	interfaces.c ipc_frontend.c link_set.c lq_avl.c lq_packet.c 
	lq_route.c main.c mid_set.c mpr.c mpr_selector_set.c 
	neighbor_table.c net_olsr.c net_olsr.h olsr_cfg.h olsr_types.h 
	packet.c packet.h parser.c print_packet.c process_package.c 
	process_routes.c rebuild_packet.c routing_table.c tc_set.c 
	two_hop_neighbor_table.c 
Added Files:
	ipcalc.c ipcalc.h 
Removed Files:
	local_hna_set.c local_hna_set.h 
Log Message:
Major Changes:
- renamed "struct local_hna_entry" to "struct ip_prefix_list" since
  it is exactly that. Renamed the functions in src/local_hna_set.{c,h}
  in the same way.
- each IPv4 and IPv6 function pairs in src/local_hna_set.{c,h} is
  called from the same place and have the same signature. So I
  condensed each of them.
- Since we have only 3 functions left in src/local_hna_set.{c,h}
  and they are used for the configuration, the .h file is now part
  of src/olsr_cfg.h and the ,c file of src/cfgparser/olsrd_conf.c.
- replaced "struct ipc_net" with "struct ip_prefix_list" since it
  serves the same purpose as the "struct ip_prefix_list"
- replaced "struct ipc_host" with "struct ip_prefix_list" since it
  serves the same purpose as the "struct ip_prefix_list" and is
  just a special case. No need to duplicate code etc.
- removed "union hna_netmask" from src/olsr_types since we use the
  prefix_len everywhere (and that is an olsr_u8_t in several other
  struct's).
  That implies changes and simplifications in the code handling
  them (since the IPv4 is similar to IPv6).
- the config file parser now understands for IPv4 addresses also
  "/$prefix".
- On the output side, the patch generates only "/$prefix" which
  kills code since it is the same as the IPv6 handling.
- There are some netmask conversions left (mainly in the plugins)
  but that be cleaned up afterwards.
- extracted ip{,4,6}{cmp,equal} and formatting functions from
  net_olsr.{c,h} into src/ipcalc.{c,h} since net_olsr.h became
  IMHO to much of a "put anything in there".
- renamed "sockaddr_to_string()" to "sockaddr4_to_string()"
  since it is exactly that (unless I'm missing something).

Minor Changes:
- lib/httpinfo/src/admin_html.h contained just some variable
  definitions so it is now integrated in the only user:
  admin_interface.c
- olsrd_dot_draw.c got rid of two indicator variables if
  a socket is valid or not. Since sockets may use "-1" as the
  "not open", "invalid" value, there is no need for two more
  ints.
- and the dot_draw plugin is somewhat smaller and easier to read.
- const'ified some functions


Index: hna_set.h
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/hna_set.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** hna_set.h	21 Oct 2007 20:37:58 -0000	1.16
--- hna_set.h	29 Nov 2007 00:49:38 -0000	1.17
***************
*** 47,50 ****
--- 47,52 ----
  #include "olsr_types.h"
  
+ #include <time.h>
+ 
  /* hna_netmask declared in packet.h */
  
***************
*** 52,56 ****
  {
    union olsr_ip_addr A_network_addr;
!   union hna_netmask  A_netmask;
    clock_t            A_time;
    struct hna_net     *next;
--- 54,58 ----
  {
    union olsr_ip_addr A_network_addr;
!   olsr_u8_t          prefixlen;
    clock_t            A_time;
    struct hna_net     *next;
***************
*** 73,81 ****
  olsr_init_hna_set(void);
  
- int
- olsr_get_hna_prefix_len(const struct hna_net *);
- 
  struct hna_net *
! olsr_lookup_hna_net(const struct hna_net *, const union olsr_ip_addr *, const union hna_netmask *);
  
  struct hna_entry *
--- 75,80 ----
  olsr_init_hna_set(void);
  
  struct hna_net *
! olsr_lookup_hna_net(const struct hna_net *, const union olsr_ip_addr *, olsr_u8_t);
  
  struct hna_entry *
***************
*** 86,93 ****
  
  struct hna_net *
! olsr_add_hna_net(struct hna_entry *, const union olsr_ip_addr *, const union hna_netmask *);
  
  void
! olsr_update_hna_entry(const union olsr_ip_addr *, const union olsr_ip_addr *, const union hna_netmask *, const float);
  
  void
--- 85,92 ----
  
  struct hna_net *
! olsr_add_hna_net(struct hna_entry *, const union olsr_ip_addr *, olsr_u8_t);
  
  void
! olsr_update_hna_entry(const union olsr_ip_addr *, const union olsr_ip_addr *, olsr_u8_t, const float);
  
  void

Index: rebuild_packet.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/rebuild_packet.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** rebuild_packet.c	16 Nov 2007 22:56:54 -0000	1.25
--- rebuild_packet.c	29 Nov 2007 00:49:39 -0000	1.26
***************
*** 42,45 ****
--- 42,46 ----
  
  #include "rebuild_packet.h"
+ #include "ipcalc.h"
  #include "defs.h"
  #include "olsr.h"
***************
*** 94,99 ****
        hna_pairs = NULL;
  
!       for(i = 0; i < no_pairs; i++)
! 	{	  
  	  hna_pairs = olsr_malloc(sizeof(struct hna_net_addr), "HNA chgestruct");
  	  
--- 95,99 ----
        hna_pairs = NULL;
  
!       for(i = 0; i < no_pairs; i++) {	  
  	  hna_pairs = olsr_malloc(sizeof(struct hna_net_addr), "HNA chgestruct");
  	  
***************
*** 101,108 ****
            hna_pairs->net.v4.s_addr = haddr->addr;
  	  //COPY_IP(&hna_pairs->netmask, &haddr->netmask);
!           hna_pairs->netmask.v4 = haddr->netmask;
  
! 	  hna_pairs->next = tmp_pairs;
! 	  
  	  tmp_pairs = hna_pairs;
  	  haddr++;
--- 101,107 ----
            hna_pairs->net.v4.s_addr = haddr->addr;
  	  //COPY_IP(&hna_pairs->netmask, &haddr->netmask);
!           hna_pairs->prefixlen = olsr_netmask4_to_prefix(&haddr->netmask);
  
! 	  hna_pairs->next = tmp_pairs;	  
  	  tmp_pairs = hna_pairs;
  	  haddr++;
***************
*** 139,143 ****
  	  //COPY_IP(&hna_pairs->net, &haddr6->addr);
  	  hna_pairs->net.v6 = haddr6->addr;
! 	  hna_pairs->netmask.v6 = olsr_netmask_to_prefix((const union olsr_ip_addr *)&haddr6->netmask);
  
  	  hna_pairs->next = tmp_pairs;
--- 138,142 ----
  	  //COPY_IP(&hna_pairs->net, &haddr6->addr);
  	  hna_pairs->net.v6 = haddr6->addr;
!           hna_pairs->prefixlen = olsr_netmask6_to_prefix(&haddr6->netmask);
  
  	  hna_pairs->next = tmp_pairs;

Index: hna_set.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/hna_set.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** hna_set.c	16 Nov 2007 22:56:54 -0000	1.25
--- hna_set.c	29 Nov 2007 00:49:38 -0000	1.26
***************
*** 40,43 ****
--- 40,44 ----
   */
  
+ #include "ipcalc.h"
  #include "defs.h"
  #include "olsr.h"
***************
*** 47,52 ****
  
  struct hna_entry hna_set[HASHSIZE];
- static size_t netmask_size;
- 
  
  /**
--- 48,51 ----
***************
*** 56,71 ****
  olsr_init_hna_set(void)
  {
- 
    int idx;
  
-   if(olsr_cnf->ip_version == AF_INET)
-     {
-       netmask_size = sizeof(olsr_u32_t);
-     }
-   else
-     {
-       netmask_size = sizeof(olsr_u16_t);
-     }
- 
    /* Since the holdingtime is assumed to be rather large for 
     * HNA entries, the timeoutfunction is only ran once every second
--- 55,60 ----
***************
*** 82,96 ****
  }
  
- int
- olsr_get_hna_prefix_len(const struct hna_net *hna)
- {
-   if (olsr_cnf->ip_version == AF_INET) {
-     return olsr_netmask_to_prefix((const union olsr_ip_addr *)&hna->A_netmask.v4);
-   } else {
-     return hna->A_netmask.v6;
-   }
- }
- 
- 
  /**
   *Lookup a network entry in a networkentry list
--- 71,74 ----
***************
*** 103,121 ****
   */
  struct hna_net *
! olsr_lookup_hna_net(const struct hna_net *nets, const union olsr_ip_addr *net, const union hna_netmask *mask)
  {
!   struct hna_net *tmp_net;
! 
! 
    /* Loop trough entrys */
!   for(tmp_net = nets->next;
!       tmp_net != nets;
!       tmp_net = tmp_net->next)
!     { 
!       if(ipequal(&tmp_net->A_network_addr, net) &&
! 	 (memcmp(&tmp_net->A_netmask, mask, netmask_size) == 0))
! 	return tmp_net;
      }
!   
    /* Not found */
    return NULL;
--- 81,93 ----
   */
  struct hna_net *
! olsr_lookup_hna_net(const struct hna_net *nets, const union olsr_ip_addr *net, olsr_u8_t prefixlen)
  {
!   struct hna_net *tmp;
    /* Loop trough entrys */
!   for (tmp = nets->next; tmp != nets; tmp = tmp->next) { 
!     if (tmp->prefixlen == prefixlen && ipequal(&tmp->A_network_addr, net)) {
!       return tmp;
      }
!   }
    /* Not found */
    return NULL;
***************
*** 201,205 ****
   */
  struct hna_net *
! olsr_add_hna_net(struct hna_entry *hna_gw, const union olsr_ip_addr *net, const union hna_netmask *mask)
  {
    /* Add the net */
--- 173,177 ----
   */
  struct hna_net *
! olsr_add_hna_net(struct hna_entry *hna_gw, const union olsr_ip_addr *net, olsr_u8_t prefixlen)
  {
    /* Add the net */
***************
*** 210,214 ****
    new_net->A_network_addr = *net;
    //memcpy(&new_net->A_netmask, mask, netmask_size);
!   new_net->A_netmask = *mask;
  
    /* Queue */
--- 182,186 ----
    new_net->A_network_addr = *net;
    //memcpy(&new_net->A_netmask, mask, netmask_size);
!   new_net->prefixlen = prefixlen;
  
    /* Queue */
***************
*** 238,260 ****
   */
  void
! olsr_update_hna_entry(const union olsr_ip_addr *gw, const union olsr_ip_addr *net, const union hna_netmask *mask, const float vtime)
  {
!   struct hna_entry *gw_entry;
    struct hna_net *net_entry;
  
!   if((gw_entry = olsr_lookup_hna_gw(gw)) == NULL)
      /* Need to add the entry */
      gw_entry = olsr_add_hna_entry(gw);
!   
!   if((net_entry = olsr_lookup_hna_net(&gw_entry->networks, net, mask)) == NULL)
!     {
!       /* Need to add the net */
!       net_entry = olsr_add_hna_net(gw_entry, net, mask);
!       changes_hna = OLSR_TRUE;
!     }
  
    /* Update holdingtime */
    net_entry->A_time = GET_TIMESTAMP(vtime*1000);
- 
  }
  
--- 210,231 ----
   */
  void
! olsr_update_hna_entry(const union olsr_ip_addr *gw, const union olsr_ip_addr *net, olsr_u8_t prefixlen, const float vtime)
  {
!   struct hna_entry *gw_entry = olsr_lookup_hna_gw(gw);
    struct hna_net *net_entry;
  
!   if (gw_entry == NULL) {
      /* Need to add the entry */
      gw_entry = olsr_add_hna_entry(gw);
!   }
!   net_entry = olsr_lookup_hna_net(&gw_entry->networks, net, prefixlen);
!   if (net_entry == NULL)  {
!     /* Need to add the net */
!     net_entry = olsr_add_hna_net(gw_entry, net, prefixlen);
!     changes_hna = OLSR_TRUE;
!   }
  
    /* Update holdingtime */
    net_entry->A_time = GET_TIMESTAMP(vtime*1000);
  }
  

Index: two_hop_neighbor_table.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/two_hop_neighbor_table.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** two_hop_neighbor_table.c	8 Nov 2007 22:47:41 -0000	1.20
--- two_hop_neighbor_table.c	29 Nov 2007 00:49:39 -0000	1.21
***************
*** 40,47 ****
   */
  
- 
- 
- #include "defs.h"
  #include "two_hop_neighbor_table.h"
  #include "mid_set.h"
  #include "neighbor_table.h"
--- 40,46 ----
   */
  
  #include "two_hop_neighbor_table.h"
+ #include "ipcalc.h"
+ #include "defs.h"
  #include "mid_set.h"
  #include "neighbor_table.h"

Index: olsr_types.h
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/olsr_types.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** olsr_types.h	8 Nov 2007 22:47:41 -0000	1.12
--- olsr_types.h	29 Nov 2007 00:49:38 -0000	1.13
***************
*** 75,78 ****
--- 75,79 ----
  #include <netinet/in.h>
  
+ 
  union olsr_ip_addr {
    struct in_addr v4;
***************
*** 85,92 ****
  };
  
- union hna_netmask {
-   olsr_u32_t v4;
-   olsr_u16_t v6;
- };
- 
  #endif
--- 86,88 ----

Index: link_set.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/link_set.c,v
retrieving revision 1.77
retrieving revision 1.78
diff -C2 -d -r1.77 -r1.78
*** link_set.c	8 Nov 2007 22:47:41 -0000	1.77
--- link_set.c	29 Nov 2007 00:49:38 -0000	1.78
***************
*** 55,58 ****
--- 55,59 ----
  #include "lq_route.h"
  #include "net_olsr.h"
+ #include "ipcalc.h"
  
  

Index: process_routes.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/process_routes.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -C2 -d -r1.40 -r1.41
*** process_routes.c	29 Nov 2007 00:18:53 -0000	1.40
--- process_routes.c	29 Nov 2007 00:49:39 -0000	1.41
***************
*** 44,47 ****
--- 44,48 ----
   */
  
+ #include "ipcalc.h"
  #include "defs.h"
  #include "olsr.h"
***************
*** 167,176 ****
      if(error < 0) {
        const char * const err_msg = strerror(errno);
  
!       OLSR_PRINTF(1, "KERN: ERROR deleting %s: %s\n",
!                   olsr_rt_to_string(rt), err_msg);
! 
!       olsr_syslog(OLSR_LOG_ERR, "Delete route: %s", err_msg);
! 
      }
    }
--- 168,175 ----
      if(error < 0) {
        const char * const err_msg = strerror(errno);
+       const char * const routestr = olsr_rt_to_string(rt);
+       OLSR_PRINTF(1, "KERN: ERROR deleting %s: %s\n", routestr, err_msg);
  
!       olsr_syslog(OLSR_LOG_ERR, "Delete route %s: %s", routestr, err_msg);
      }
    }
***************
*** 192,199 ****
      if(error < 0) {
        const char * const err_msg = strerror(errno);
!       OLSR_PRINTF(1, "KERN: ERROR adding %s: %s\n",
!                   olsr_rtp_to_string(rt->rt_best), err_msg);
  
!       olsr_syslog(OLSR_LOG_ERR, "Add route: %s", err_msg);
      } else {
  
--- 191,198 ----
      if(error < 0) {
        const char * const err_msg = strerror(errno);
!       const char * const routestr = olsr_rtp_to_string(rt->rt_best);
!       OLSR_PRINTF(1, "KERN: ERROR adding %s: %s\n", routestr, err_msg);
  
!       olsr_syslog(OLSR_LOG_ERR, "Add route %s: %s", routestr, err_msg);
      } else {
  

Index: neighbor_table.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/neighbor_table.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -C2 -d -r1.35 -r1.36
*** neighbor_table.c	8 Nov 2007 22:47:41 -0000	1.35
--- neighbor_table.c	29 Nov 2007 00:49:38 -0000	1.36
***************
*** 40,45 ****
   */
  
! 
! 
  #include "defs.h"
  #include "two_hop_neighbor_table.h"
--- 40,44 ----
   */
  
! #include "ipcalc.h"
  #include "defs.h"
  #include "two_hop_neighbor_table.h"

--- NEW FILE: ipcalc.h ---
(This appears to be a binary file; contents omitted.)

Index: interfaces.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/interfaces.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -d -r1.37 -r1.38
*** interfaces.c	16 Nov 2007 19:12:55 -0000	1.37
--- interfaces.c	29 Nov 2007 00:49:38 -0000	1.38
***************
*** 46,49 ****
--- 46,50 ----
  #include "olsr.h"
  #include "net_olsr.h"
+ #include "ipcalc.h"
  
  static olsr_u32_t if_property_id;

Index: print_packet.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/print_packet.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** print_packet.c	8 Nov 2007 22:47:41 -0000	1.13
--- print_packet.c	29 Nov 2007 00:49:39 -0000	1.14
***************
*** 41,44 ****
--- 41,45 ----
  
  #include "print_packet.h"
+ #include "ipcalc.h"
  #include "mantissa.h"
  #include "defs.h"

--- NEW FILE: ipcalc.c ---
(This appears to be a binary file; contents omitted.)

Index: lq_avl.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/lq_avl.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** lq_avl.c	18 Nov 2007 20:35:59 -0000	1.17
--- lq_avl.c	29 Nov 2007 00:49:38 -0000	1.18
***************
*** 45,48 ****
--- 45,49 ----
  #include <string.h>
  
+ #include "ipcalc.h"
  #include "lq_avl.h"
  #include "net_olsr.h"

Index: duplicate_set.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/duplicate_set.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** duplicate_set.c	8 Nov 2007 22:47:41 -0000	1.19
--- duplicate_set.c	29 Nov 2007 00:49:38 -0000	1.20
***************
*** 40,46 ****
   */
  
! 
! 
! #include "defs.h"
  #include "duplicate_set.h"
  #include "scheduler.h"
--- 40,44 ----
   */
  
! #include "ipcalc.h"
  #include "duplicate_set.h"
  #include "scheduler.h"

--- local_hna_set.c DELETED ---

Index: process_package.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/process_package.c,v
retrieving revision 1.46
retrieving revision 1.47
diff -C2 -d -r1.46 -r1.47
*** process_package.c	18 Nov 2007 22:28:35 -0000	1.46
--- process_package.c	29 Nov 2007 00:49:39 -0000	1.47
***************
*** 40,46 ****
   */
  
- 
- #include "defs.h"
  #include "process_package.h"
  #include "lq_packet.h"
  #include "hysteresis.h"
--- 40,46 ----
   */
  
  #include "process_package.h"
+ #include "ipcalc.h"
+ #include "defs.h"
  #include "lq_packet.h"
  #include "hysteresis.h"
***************
*** 54,60 ****
  #include "rebuild_packet.h"
  #include "scheduler.h"
- #include "local_hna_set.h"
  #include "net_olsr.h"
  
  static void process_message_neighbors(struct neighbor_entry *, const struct hello_message *);
  
--- 54,60 ----
  #include "rebuild_packet.h"
  #include "scheduler.h"
  #include "net_olsr.h"
  
+ 
  static void process_message_neighbors(struct neighbor_entry *, const struct hello_message *);
  
***************
*** 709,715 ****
      while (hna_tmp) {
        /* Don't add an HNA entry that we are advertising ourselves. */
!       if (!find_local_hna4_entry(&hna_tmp->net, hna_tmp->netmask.v4) &&
!           !find_local_hna6_entry(&hna_tmp->net, hna_tmp->netmask.v6)) {
!         olsr_update_hna_entry(&message.originator, &hna_tmp->net, &hna_tmp->netmask, (float)message.vtime);
        }
  
--- 709,714 ----
      while (hna_tmp) {
        /* Don't add an HNA entry that we are advertising ourselves. */
!       if (!ip_prefix_list_find(olsr_cnf->hna_entries, &hna_tmp->net, hna_tmp->prefixlen)) {
!         olsr_update_hna_entry(&message.originator, &hna_tmp->net, hna_tmp->prefixlen, message.vtime);
        }
  

--- local_hna_set.h DELETED ---

Index: lq_route.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/lq_route.c,v
retrieving revision 1.60
retrieving revision 1.61
diff -C2 -d -r1.60 -r1.61
*** lq_route.c	16 Nov 2007 22:56:54 -0000	1.60
--- lq_route.c	29 Nov 2007 00:49:38 -0000	1.61
***************
*** 44,47 ****
--- 44,48 ----
  #define SPF_PROFILING 1
  
+ #include "ipcalc.h"
  #include "defs.h"
  #include "olsr.h"
***************
*** 313,317 ****
    struct avl_tree cand_tree;
    struct list_node path_list;
!   int i, plen, path_count = 0;
    struct tc_entry *tc;
    struct tc_edge_entry *tc_edge;
--- 314,318 ----
    struct avl_tree cand_tree;
    struct list_node path_list;
!   int i, path_count = 0;
    struct tc_entry *tc;
    struct tc_edge_entry *tc_edge;
***************
*** 464,473 ****
             hna != &hna_gw->networks;
             hna = hna->next) {
! 
!         plen = olsr_get_hna_prefix_len(hna);
!         if (vert->path_etx != INFINITE_ETX)
!         olsr_insert_routing_table(&hna->A_network_addr, plen, &vert->addr,
!                                   &link->neighbor_iface_addr, inter->if_index,
!                                   vert->hops, vert->path_etx);
        }
      }
--- 465,473 ----
             hna != &hna_gw->networks;
             hna = hna->next) {
!         if (vert->path_etx != INFINITE_ETX) {
!           olsr_insert_routing_table(&hna->A_network_addr, hna->prefixlen, &vert->addr,
!                                     &link->neighbor_iface_addr, inter->if_index,
!                                     vert->hops, vert->path_etx);
!         }
        }
      }

Index: packet.h
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/packet.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** packet.h	18 Nov 2007 21:58:32 -0000	1.18
--- packet.h	29 Nov 2007 00:49:39 -0000	1.19
***************
*** 102,106 ****
  {
    union olsr_ip_addr  net;
!   union hna_netmask   netmask; /* IPv4 netmask */
    struct hna_net_addr *next;
  };
--- 102,106 ----
  {
    union olsr_ip_addr  net;
!   olsr_u8_t           prefixlen;
    struct hna_net_addr *next;
  };

Index: net_olsr.h
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/net_olsr.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** net_olsr.h	25 Nov 2007 21:23:29 -0000	1.18
--- net_olsr.h	29 Nov 2007 00:49:38 -0000	1.19
***************
*** 45,49 ****
  #define _NET_OLSR
  
! #include "defs.h"
  #include "interfaces.h"
  #include "process_routes.h"
--- 45,49 ----
  #define _NET_OLSR
  
! #include "olsr_types.h"
  #include "interfaces.h"
  #include "process_routes.h"
***************
*** 54,81 ****
  typedef int (*packet_transform_function)(olsr_u8_t *, int *);
  
- struct ipaddr_str {
-     char buf[MAX(INET6_ADDRSTRLEN, INET_ADDRSTRLEN)];
- };
- 
- /*
-  * Macros for comparing and copying IP addresses
-  */
- static INLINE int ip4cmp(const struct in_addr *a, const struct in_addr *b) { return a->s_addr > b->s_addr ? +1 : a->s_addr < b->s_addr ? -1 : 0; }
- static INLINE int ip4equal(const struct in_addr *a, const struct in_addr *b) { return a->s_addr == b->s_addr; }
- 
- static INLINE int ip6cmp(const struct in6_addr *a, const struct in6_addr *b) { return memcmp(a, b, sizeof(*a)); }
- static INLINE int ip6equal(const struct in6_addr *a, const struct in6_addr *b) { return ip6cmp(a, b) == 0; }
- 
- #if 0
- static INLINE int ipcmp(const union olsr_ip_addr *a, const union olsr_ip_addr *b) { return olsr_cnf->ip_version == AF_INET ? ip4cmp(&a->v4, &b->v4) : ip6cmp(&a->v6, &b->v6); }
- #endif
- static INLINE int ipequal(const union olsr_ip_addr *a, const union olsr_ip_addr *b) { return olsr_cnf->ip_version == AF_INET ? ip4equal(&a->v4, &b->v4) : ip6equal(&a->v6, &b->v6); }
- 
- /* Do not use this - this is as evil as the COPY_IP() macro was and only used in
-  * source which also needs cleanups.
-  */
- static INLINE void genipcopy(void *dst, const void *src) { memcpy(dst, src, olsr_cnf->ipsize); }
- 
- 
  void
  net_set_disp_pack_out(olsr_bool);
--- 54,57 ----
***************
*** 112,139 ****
  
  int
- olsr_prefix_to_netmask(union olsr_ip_addr *, const olsr_u16_t);
- 
- olsr_u16_t
- olsr_netmask_to_prefix(const union olsr_ip_addr *);
- 
- const char *
- sockaddr_to_string(struct ipaddr_str * const , const struct sockaddr *);
- 
- const char *
- ip4_to_string(struct ipaddr_str * const buf, const struct in_addr);
- 
- const char *
- ip6_to_string(struct ipaddr_str * const buf, const struct in6_addr * const addr6);
- 
- const char *
- olsr_ip_to_string(struct ipaddr_str * const buf, const union olsr_ip_addr *);
- 
- const char *
- sockaddr_to_string(struct ipaddr_str * const buf, const struct sockaddr *);
- 
- const char *
- olsr_ip_prefix_to_string(const struct olsr_ip_prefix *prefix);
- 
- int
  add_ptf(packet_transform_function);
  
--- 88,91 ----

Index: packet.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/packet.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** packet.c	8 Nov 2007 22:47:41 -0000	1.26
--- packet.c	29 Nov 2007 00:49:39 -0000	1.27
***************
*** 41,44 ****
--- 41,45 ----
  
  
+ #include "ipcalc.h"
  #include "defs.h"
  #include "link_set.h"

Index: lq_packet.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/lq_packet.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -d -r1.32 -r1.33
*** lq_packet.c	29 Nov 2007 00:24:00 -0000	1.32
--- lq_packet.c	29 Nov 2007 00:49:38 -0000	1.33
***************
*** 42,45 ****
--- 42,46 ----
   */
  
+ #include "ipcalc.h"
  #include "olsr_protocol.h"
  #include "defs.h"

Index: mid_set.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/mid_set.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** mid_set.c	29 Nov 2007 00:10:17 -0000	1.24
--- mid_set.c	29 Nov 2007 00:49:38 -0000	1.25
***************
*** 40,43 ****
--- 40,44 ----
   */
  
+ #include "ipcalc.h"
  #include "defs.h"
  #include "two_hop_neighbor_table.h"

Index: hysteresis.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/hysteresis.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** hysteresis.c	8 Nov 2007 22:47:41 -0000	1.22
--- hysteresis.c	29 Nov 2007 00:49:38 -0000	1.23
***************
*** 48,51 ****
--- 48,52 ----
  #include "olsr.h"
  #include "net_olsr.h"
+ #include "ipcalc.h"
  
  #define hscaling olsr_cnf->hysteresis_param.scaling

Index: net_olsr.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/net_olsr.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -d -r1.36 -r1.37
*** net_olsr.c	20 Nov 2007 23:16:17 -0000	1.36
--- net_olsr.c	29 Nov 2007 00:49:38 -0000	1.37
***************
*** 41,44 ****
--- 41,45 ----
  
  #include "net_olsr.h"
+ #include "ipcalc.h"
  #include "log.h"
  #include "olsr.h"
***************
*** 449,618 ****
  }
  
- 
- /**
-  * Create a IPv4 or IPv6 netmask based on a prefix length
-  *
-  * @param allocated address to build the netmask in
-  * @param prefix the prefix length
-  *
-  * @returns 1 on success 0 on failure
-  */
- int
- olsr_prefix_to_netmask(union olsr_ip_addr *adr, const olsr_u16_t prefix)
- {
- #if !defined(NODEBUG) && defined(DEBUG)
-   struct ipaddr_str buf;
- #endif
-   int p;
-   const olsr_u8_t * const a_end = adr->v6.s6_addr+olsr_cnf->ipsize;
-   olsr_u8_t *a;
- 
-   if (adr == NULL) {
-     return 0;
-   }
- 
-   a = adr->v6.s6_addr;
-   for (p = prefix; a < a_end && p > 8; p -= 8) {
-     *a++ = 0xff;
-   }
-   *a++ = 0xff << (8 - p);
-   while (a < a_end) {
-     *a++ = 0;
-   }
- 
- #ifdef DEBUG
-   OLSR_PRINTF(3, "Prefix %d = Netmask: %s\n", prefix, olsr_ip_to_string(&buf, adr));
- #endif
-   return 1;
- }
- 
- 
- 
- /**
-  * Calculate prefix length based on a netmask
-  *
-  * @param adr the address to use to calculate the prefix length
-  *
-  * @return the prefix length
-  */
- olsr_u16_t
- olsr_netmask_to_prefix(const union olsr_ip_addr *adr)
- {
- #ifndef NODEBUG
-   struct ipaddr_str buf;
- #endif
-   olsr_u16_t prefix = 0;
-   const olsr_u8_t * const a_end = adr->v6.s6_addr+olsr_cnf->ipsize;
-   const olsr_u8_t *a;
- 
-   for (a = adr->v6.s6_addr; a < a_end && *a == 0xff; a++) {
-     prefix += 8;
-   }
-   if (a < a_end) {
-     /* handle the last byte */
-     switch (*a) {
-     case   0: prefix += 0; break;
-     case 128: prefix += 1; break;
-     case 192: prefix += 2; break;
-     case 224: prefix += 3; break;
-     case 240: prefix += 4; break;
-     case 248: prefix += 5; break;
-     case 252: prefix += 6; break;
-     case 254: prefix += 7; break;
-     case 255: prefix += 8; break; /* Shouldn't happen */
-     default:
-       OLSR_PRINTF(0, "%s: Got bogus netmask %s\n", __func__, olsr_ip_to_string(&buf, adr));    
-       prefix = USHRT_MAX;
-       break;
-     }
-   }
- #ifdef DEBUG
-   OLSR_PRINTF(3, "Netmask: %s = Prefix %d\n", olsr_ip_to_string(&buf, adr), prefix);
- #endif
-   return prefix;
- }
- 
- /**
-  *Converts a sockaddr struct to a string representing
-  *the IP address from the sockaddr struct
-  *
-  *@param address_to_convert the sockaddr struct to "convert"
-  *@return a char pointer to the string containing the IP
-  */
- const char *
- sockaddr_to_string(struct ipaddr_str * const buf, const struct sockaddr * const addr)
- {
-     const struct sockaddr_in * const addr4 = (const struct sockaddr_in *)addr;
-     return ip4_to_string(buf, addr4->sin_addr);
- }
- 
- /**
-  *Converts the 32bit olsr_u32_t datatype to
-  *a char array.
-  *
-  *@param address the olsr_u32_t to "convert"
-  *@return a char pointer to the string containing the IP
-  */
- const char *
- ip4_to_string(struct ipaddr_str * const buf, const struct in_addr addr4)
- {
-     return inet_ntop(AF_INET, &addr4, buf->buf, sizeof(buf->buf));
- }
- 
- /**
-  *Converts the 32bit olsr_u32_t datatype to
-  *a char array.
-  *
-  *@param addr6 the address to "convert"
-  *@return a char pointer to the string containing the IP
-  */
- const char *
- ip6_to_string(struct ipaddr_str * const buf, const struct in6_addr * const addr6)
- {
-   return inet_ntop(AF_INET6, addr6, buf->buf, sizeof(buf->buf));
- }
- 
- const char *
- olsr_ip_to_string(struct ipaddr_str * const buf, const union olsr_ip_addr *addr)
- {
- #if 0
-     if (!addr) {
-         return "null";
-     }
- #endif
-     return inet_ntop(olsr_cnf->ip_version, addr, buf->buf, sizeof(buf->buf));
- }
- 
- const char *
- olsr_ip_prefix_to_string(const struct olsr_ip_prefix *prefix)
- {
-   /* We need for IPv6 an IP address + '/' + prefix and for IPv4 an IP address + '/' + a netmask */
-   static char buf[MAX(INET6_ADDRSTRLEN + 1 + 3, INET_ADDRSTRLEN + 1 + INET_ADDRSTRLEN)];
-   const char *rv;
- 
-   if (prefix == NULL) {
-       return "null";
-   }
-   
-   if(olsr_cnf->ip_version == AF_INET) {
-     int len;
-     union olsr_ip_addr netmask;
-     rv = inet_ntop(AF_INET, &prefix->prefix.v4, buf, sizeof(buf));
-     len = strlen(buf);
-     buf[len++] = '/';
-     olsr_prefix_to_netmask(&netmask, prefix->prefix_len);
-     inet_ntop(AF_INET, &netmask.v4, buf+len, sizeof(buf)-len);
-   } else {
-     int len;
-     /* IPv6 */
-     rv = inet_ntop(AF_INET6, &prefix->prefix.v6, buf, sizeof(buf));
-     len = strlen(buf);
-     buf[len++] = '/';
-     snprintf(buf+len, sizeof(buf)-len, "/%d", prefix->prefix_len);
-   }
-   return rv;
- }
- 
- 
  void
  olsr_add_invalid_address(const union olsr_ip_addr *adr)
--- 450,453 ----

Index: build_msg.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/build_msg.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -C2 -d -r1.39 -r1.40
*** build_msg.c	16 Nov 2007 19:12:55 -0000	1.39
--- build_msg.c	29 Nov 2007 00:49:38 -0000	1.40
***************
*** 40,48 ****
   */
  
! #include "defs.h"
  #include "olsr.h"
  #include "log.h"
- #include "build_msg.h"
- #include "local_hna_set.h"
  #include "mantissa.h"
  #include "net_olsr.h"
--- 40,47 ----
   */
  
! #include "build_msg.h"
! #include "ipcalc.h"
  #include "olsr.h"
  #include "log.h"
  #include "mantissa.h"
  #include "net_olsr.h"
***************
*** 1068,1076 ****
    union olsr_message *m;
    struct hnapair *pair;
!   struct local_hna_entry *h = olsr_cnf->hna_entries;
  
    /* No hna nets */
!   if((olsr_cnf->ip_version != AF_INET) || (!ifp) || h == NULL)
      return OLSR_FALSE;
      
    remainsize = net_outbuffer_bytes_left(ifp);
--- 1067,1083 ----
    union olsr_message *m;
    struct hnapair *pair;
!   struct ip_prefix_list *h;
  
    /* No hna nets */
!   if (ifp == NULL) {
      return OLSR_FALSE;
+   }
+   if (olsr_cnf->ip_version != AF_INET) {
+     return OLSR_FALSE;
+   }
+   h = olsr_cnf->hna_entries;
+   if (h == NULL) {
+     return OLSR_FALSE;
+   }
      
    remainsize = net_outbuffer_bytes_left(ifp);
***************
*** 1100,1105 ****
    pair = m->v4.message.hna.hna_net;
    
!   while(h)
!     {
        union olsr_ip_addr ip_addr;
        if((curr_size + (2 * olsr_cnf->ipsize)) > remainsize)
--- 1107,1111 ----
    pair = m->v4.message.hna.hna_net;
    
!   for (; h != NULL; h = h->next) {
        union olsr_ip_addr ip_addr;
        if((curr_size + (2 * olsr_cnf->ipsize)) > remainsize)
***************
*** 1130,1136 ****
        pair->netmask = ip_addr.v4.s_addr;
        pair++;
!       curr_size += (2 * olsr_cnf->ipsize);
!       h = h->next;
!     }
  
    m->v4.seqno = htons(get_msg_seqno());
--- 1136,1141 ----
        pair->netmask = ip_addr.v4.s_addr;
        pair++;
!       curr_size += (2 * olsr_cnf->ipsize);    
!   }
  
    m->v4.seqno = htons(get_msg_seqno());
***************
*** 1158,1162 ****
    struct hnapair6 *pair6;
    union olsr_ip_addr tmp_netmask;
!   struct local_hna_entry *h = olsr_cnf->hna_entries;
    
    /* No hna nets */
--- 1163,1167 ----
    struct hnapair6 *pair6;
    union olsr_ip_addr tmp_netmask;
!   struct ip_prefix_list *h = olsr_cnf->hna_entries;
    
    /* No hna nets */

Index: routing_table.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/routing_table.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -C2 -d -r1.35 -r1.36
*** routing_table.c	14 Nov 2007 11:03:52 -0000	1.35
--- routing_table.c	29 Nov 2007 00:49:39 -0000	1.36
***************
*** 41,44 ****
--- 41,46 ----
   */
  
+ #include "routing_table.h"
+ #include "ipcalc.h"
  #include "defs.h"
  #include "two_hop_neighbor_table.h"
***************
*** 48,52 ****
  #include "olsr.h"
  #include "link_set.h"
- #include "routing_table.h"
  #include "lq_avl.h"
  #include "lq_route.h"
--- 50,53 ----
***************
*** 522,526 ****
            /* update if better */
            olsr_insert_routing_table(&tmp_net->A_network_addr,
!                                     olsr_get_hna_prefix_len(tmp_net),
                                      &tmp_hna->A_gateway_addr,
                                      &rt->rt_best->rtp_nexthop.gateway,
--- 523,527 ----
            /* update if better */
            olsr_insert_routing_table(&tmp_net->A_network_addr,
!                                     tmp_net->prefixlen,
                                      &tmp_hna->A_gateway_addr,
                                      &rt->rt_best->rtp_nexthop.gateway,

Index: ipc_frontend.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/ipc_frontend.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -C2 -d -r1.40 -r1.41
*** ipc_frontend.c	20 Nov 2007 23:20:23 -0000	1.40
--- ipc_frontend.c	29 Nov 2007 00:49:38 -0000	1.41
***************
*** 53,58 ****
  #include "parser.h"
  #include "socket_parser.h"
- #include "local_hna_set.h"
  #include "net_olsr.h"
  
  #ifdef WIN32
--- 53,58 ----
  #include "parser.h"
  #include "socket_parser.h"
  #include "net_olsr.h"
+ #include "ipcalc.h"
  
  #ifdef WIN32
***************
*** 180,204 ****
  ipc_check_allowed_ip(const union olsr_ip_addr *addr)
  {
!   struct ipc_host *ipch = olsr_cnf->ipc_hosts;
!   struct ipc_net *ipcn = olsr_cnf->ipc_nets;
  
!   if(addr->v4.s_addr == ntohl(INADDR_LOOPBACK))
      return OLSR_TRUE;
! 
!   /* check hosts */
!   while(ipch)
!     {
!         if(ipequal(addr, &ipch->host))
! 	return OLSR_TRUE;
!       ipch = ipch->next;
!     }
  
    /* check nets */
!   while(ipcn)
!     {
!       if((addr->v4.s_addr & ipcn->mask.v4.s_addr) == (ipcn->net.v4.s_addr & ipcn->mask.v4.s_addr))
! 	return OLSR_TRUE;
!       ipcn = ipcn->next;
      }
  
    return OLSR_FALSE;
--- 180,195 ----
  ipc_check_allowed_ip(const union olsr_ip_addr *addr)
  {
!   struct ip_prefix_list *ipcn;
  
!   if(addr->v4.s_addr == ntohl(INADDR_LOOPBACK)) {
      return OLSR_TRUE;
!   }
  
    /* check nets */
!   for (ipcn = olsr_cnf->ipc_nets; ipcn != NULL; ipcn = ipcn->next) {
!     if (ip_in_net(addr, &ipcn->net)) { 
!       return OLSR_TRUE;
      }
+   }
  
    return OLSR_FALSE;
***************
*** 256,260 ****
        OLSR_PRINTF(1, "(OUTPUT)IPC connection lost!\n");
        CLOSE(ipc_conn);
-       //olsr_cnf->open_ipc = 0;
        ipc_active = OLSR_FALSE;
      }
--- 247,250 ----
***************
*** 281,291 ****
    char *tmp;
  
!   if(!olsr_cnf->open_ipc) {
      return -1;
    }
  
!   if(!ipc_active)
      return 0;
! 
    memset(&packet, 0, sizeof(struct ipcmsg));
    packet.size = htons(IPC_PACK_SIZE);
--- 271,281 ----
    char *tmp;
  
!   if (!olsr_cnf->open_ipc) {
      return -1;
    }
  
!   if (!ipc_active) {
      return 0;
!   }
    memset(&packet, 0, sizeof(struct ipcmsg));
    packet.size = htons(IPC_PACK_SIZE);
***************
*** 331,335 ****
        CLOSE(ipc_conn);
  
-       //olsr_cnf->open_ipc = 0;
        ipc_active = OLSR_FALSE;
        return -1;
--- 321,324 ----
***************
*** 456,460 ****
        OLSR_PRINTF(1, "(NETINFO)IPC connection lost!\n");
        CLOSE(ipc_conn);
-       //olsr_cnf->open_ipc = 0;
        return -1;
      }
--- 445,448 ----

Index: main.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/main.c,v
retrieving revision 1.105
retrieving revision 1.106
diff -C2 -d -r1.105 -r1.106
*** main.c	25 Nov 2007 13:08:54 -0000	1.105
--- main.c	29 Nov 2007 00:49:38 -0000	1.106
***************
*** 45,48 ****
--- 45,49 ----
  #include <assert.h>
  
+ #include "ipcalc.h"
  #include "defs.h"
  #include "olsr.h"

Index: mpr.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/mpr.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** mpr.c	8 Nov 2007 22:47:41 -0000	1.20
--- mpr.c	29 Nov 2007 00:49:38 -0000	1.21
***************
*** 40,43 ****
--- 40,44 ----
   */
  
+ #include "ipcalc.h"
  #include "defs.h"
  #include "mpr.h"

Index: olsr_cfg.h
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/olsr_cfg.h,v
retrieving revision 1.39
retrieving revision 1.40
diff -C2 -d -r1.39 -r1.40
*** olsr_cfg.h	25 Nov 2007 21:38:13 -0000	1.39
--- olsr_cfg.h	29 Nov 2007 00:49:38 -0000	1.40
***************
*** 1,5 ****
  /*
   * The olsr.org Optimized Link-State Routing daemon(olsrd)
!  * Copyright (c) 2004, Andreas Tønnesen((spam-protected))
   * All rights reserved.
   *
--- 1,5 ----
  /*
   * The olsr.org Optimized Link-State Routing daemon(olsrd)
!  * Copyright (c) 2004, Andreas T�¸nnesen((spam-protected))
   * All rights reserved.
   *
***************
*** 147,154 ****
  };
  
! struct local_hna_entry
  {
    struct olsr_ip_prefix    net;
!   struct local_hna_entry  *next;
  };
  
--- 147,154 ----
  };
  
! struct ip_prefix_list
  {
    struct olsr_ip_prefix    net;
!   struct ip_prefix_list    *next;
  };
  
***************
*** 174,189 ****
  };
  
- struct ipc_host
- {
-   union olsr_ip_addr       host;
-   struct ipc_host          *next;
- };
- 
- struct ipc_net
- {
-   union olsr_ip_addr       net;
-   union olsr_ip_addr       mask;
-   struct ipc_net           *next;
- };
  
  /*
--- 174,177 ----
***************
*** 207,213 ****
    struct hyst_param        hysteresis_param;
    struct plugin_entry      *plugins;
!   struct local_hna_entry   *hna_entries;
!   struct ipc_host          *ipc_hosts;
!   struct ipc_net           *ipc_nets;
    struct olsr_if           *interfaces;
    float                    pollrate;
--- 195,200 ----
    struct hyst_param        hysteresis_param;
    struct plugin_entry      *plugins;
!   struct ip_prefix_list    *hna_entries;
!   struct ip_prefix_list    *ipc_nets;
    struct olsr_if           *interfaces;
    float                    pollrate;
***************
*** 245,248 ****
--- 232,247 ----
  #endif
  
+ 
+ /*
+  * List functions
+  */
+ 
+ void ip_prefix_list_add(struct ip_prefix_list **, const union olsr_ip_addr *, olsr_u8_t);
+ 
+ int ip_prefix_list_remove(struct ip_prefix_list **, const union olsr_ip_addr *, olsr_u8_t);
+ 
+ struct ip_prefix_list *ip_prefix_list_find(struct ip_prefix_list *, const union olsr_ip_addr *net, olsr_u8_t prefix_len);
+ 
+ 
  /*
   * Interface to parser

Index: tc_set.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/tc_set.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -d -r1.37 -r1.38
*** tc_set.c	16 Nov 2007 21:43:55 -0000	1.37
--- tc_set.c	29 Nov 2007 00:49:39 -0000	1.38
***************
*** 42,45 ****
--- 42,46 ----
  
  #include "tc_set.h"
+ #include "ipcalc.h"
  #include "mid_set.h"
  #include "link_set.h"

Index: mpr_selector_set.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/mpr_selector_set.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** mpr_selector_set.c	8 Nov 2007 22:47:41 -0000	1.20
--- mpr_selector_set.c	29 Nov 2007 00:49:38 -0000	1.21
***************
*** 41,44 ****
--- 41,45 ----
  
  
+ #include "ipcalc.h"
  #include "defs.h"
  #include "mpr_selector_set.h"

Index: parser.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/parser.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -d -r1.37 -r1.38
*** parser.c	29 Nov 2007 00:24:00 -0000	1.37
--- parser.c	29 Nov 2007 00:49:39 -0000	1.38
***************
*** 41,44 ****
--- 41,45 ----
  
  #include "parser.h"
+ #include "ipcalc.h"
  #include "defs.h"
  #include "process_package.h"





More information about the Olsr-cvs mailing list