[Olsr-cvs] olsrd-current/src/bsd kernel_routes.c,1.14,1.15

Bernd Petrovitsch (spam-protected)
Mon Nov 12 00:10:26 CET 2007


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

Modified Files:
	kernel_routes.c 
Log Message:
* const'ified olsr_ioctl_{add,del}_route{,6}()
  There are probably a few "const" missing for win32 and BSD.
* const'ified moer parameters in many more functions in the .h and
  .c files
* init-functions with constant or ignored return values are "void"
* created a typedef fro the callback in "struct export_route_entry"
  and using it!
* moved the initilaization of the {add,chg,del}_kernel_list variables
  into process_routes.c. So they are now "static" there.
* olsr_export_{add,del}_route{,6} are now static in process_routes.c
  since they are not used elsewhere.
* olsr_addroute_add_function() and olsr_deldroute_add_function() were
  almost identical - made one function out of it.
  Same for olsr_addroute_del_function() and olsr_deldroute_del_function().
* factored out common code
* fixed the sort order in avl_comp_ipv4_prefix(): We compare now the IPv4
  values in host byte order (and not network byte order). So the route
  list in the e.g. httpinfo plugin is now nicely sorted.


Index: kernel_routes.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/bsd/kernel_routes.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** kernel_routes.c	4 Oct 2007 22:27:31 -0000	1.14
--- kernel_routes.c	11 Nov 2007 23:10:24 -0000	1.15
***************
*** 50,54 ****
  static unsigned int seq = 0;
  
! static int add_del_route(struct rt_entry *rt, int add)
  {
    struct rt_msghdr *rtm;
--- 50,54 ----
  static unsigned int seq = 0;
  
! static int add_del_route(const struct rt_entry *rt, int add)
  {
    struct rt_msghdr *rtm;
***************
*** 165,179 ****
  }
  
! int olsr_ioctl_add_route(struct rt_entry *rt)
  {
    return add_del_route(rt, 1);
  }
  
! int olsr_ioctl_del_route(struct rt_entry *rt)
  {
    return add_del_route(rt, 0);
  }
  
! static int add_del_route6(struct rt_entry *rt, int add)
  {
    struct rt_msghdr *rtm;
--- 165,179 ----
  }
  
! int olsr_ioctl_add_route(const struct rt_entry *rt)
  {
    return add_del_route(rt, 1);
  }
  
! int olsr_ioctl_del_route(const struct rt_entry *rt)
  {
    return add_del_route(rt, 0);
  }
  
! static int add_del_route6(const struct rt_entry *rt, int add)
  {
    struct rt_msghdr *rtm;
***************
*** 301,310 ****
  }
  
! int olsr_ioctl_add_route6(struct rt_entry *rt)
  {
    return add_del_route6(rt, 1);
  }
  
! int olsr_ioctl_del_route6(struct rt_entry *rt)
  {
    return add_del_route6(rt, 0);
--- 301,310 ----
  }
  
! int olsr_ioctl_add_route6(const struct rt_entry *rt)
  {
    return add_del_route6(rt, 1);
  }
  
! int olsr_ioctl_del_route6(const struct rt_entry *rt)
  {
    return add_del_route6(rt, 0);





More information about the Olsr-cvs mailing list