[Olsr-cvs] olsrd-current/src local_hna_set.c, 1.13, 1.14 local_hna_set.h, 1.10, 1.11

Bernd Petrovitsch (spam-protected)
Mon Oct 15 22:58:36 CEST 2007


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

Modified Files:
	local_hna_set.c local_hna_set.h 
Log Message:
* const'ified functions
* fixed an obvious bug in the IPv6 code
whoever thinks that const'ifying as far as possible is superflous may take
this as a prime counter example.


Index: local_hna_set.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/local_hna_set.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** local_hna_set.c	20 Apr 2007 13:46:04 -0000	1.13
--- local_hna_set.c	15 Oct 2007 20:58:33 -0000	1.14
***************
*** 45,49 ****
  
  void
! add_local_hna4_entry(union olsr_ip_addr *net, union olsr_ip_addr *mask)
  {
    struct hna4_entry *new_entry;
--- 45,49 ----
  
  void
! add_local_hna4_entry(const union olsr_ip_addr *net, const union olsr_ip_addr *mask)
  {
    struct hna4_entry *new_entry;
***************
*** 61,65 ****
  
  void
! add_local_hna6_entry(union olsr_ip_addr *net, olsr_u16_t prefix_len)
  {
    struct hna6_entry *new_entry;
--- 61,65 ----
  
  void
! add_local_hna6_entry(const union olsr_ip_addr *net, const olsr_u16_t prefix_len)
  {
    struct hna6_entry *new_entry;
***************
*** 68,72 ****
    
    memcpy(&new_entry->net, net, sizeof(struct in6_addr));
!   prefix_len = prefix_len;
  
    /* Queue */
--- 68,72 ----
    
    memcpy(&new_entry->net, net, sizeof(struct in6_addr));
!   new_entry->prefix_len = prefix_len;
  
    /* Queue */
***************
*** 77,81 ****
  
  int
! remove_local_hna4_entry(union olsr_ip_addr *net, union olsr_ip_addr *mask)
  {
    struct hna4_entry *h4 = olsr_cnf->hna4_entries, *h4prev = NULL;
--- 77,81 ----
  
  int
! remove_local_hna4_entry(const union olsr_ip_addr *net, const union olsr_ip_addr *mask)
  {
    struct hna4_entry *h4 = olsr_cnf->hna4_entries, *h4prev = NULL;
***************
*** 105,109 ****
  
  int
! remove_local_hna6_entry(union olsr_ip_addr *net, olsr_u16_t prefix_len)
  {
    struct hna6_entry *h6, *h6prev = NULL;
--- 105,109 ----
  
  int
! remove_local_hna6_entry(const union olsr_ip_addr *net, const olsr_u16_t prefix_len)
  {
    struct hna6_entry *h6, *h6prev = NULL;
***************
*** 129,133 ****
  
  struct hna4_entry *
! find_local_hna4_entry(union olsr_ip_addr *net, olsr_u32_t mask)
  {
    struct hna4_entry *h4 = olsr_cnf->hna4_entries;
--- 129,133 ----
  
  struct hna4_entry *
! find_local_hna4_entry(const union olsr_ip_addr *net, const olsr_u32_t mask)
  {
    struct hna4_entry *h4 = olsr_cnf->hna4_entries;
***************
*** 149,153 ****
  
  struct hna6_entry *
! find_local_hna6_entry(union olsr_ip_addr *net, olsr_u16_t prefix_len)
  {
    struct hna6_entry *h6 = olsr_cnf->hna6_entries;
--- 149,153 ----
  
  struct hna6_entry *
! find_local_hna6_entry(const union olsr_ip_addr *net, const olsr_u16_t prefix_len)
  {
    struct hna6_entry *h6 = olsr_cnf->hna6_entries;

Index: local_hna_set.h
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/local_hna_set.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** local_hna_set.h	10 Feb 2007 19:27:32 -0000	1.10
--- local_hna_set.h	15 Oct 2007 20:58:33 -0000	1.11
***************
*** 48,67 ****
  
  void
! add_local_hna4_entry(union olsr_ip_addr *, union olsr_ip_addr *);
  
  void
! add_local_hna6_entry(union olsr_ip_addr *, olsr_u16_t);
  
  int
! remove_local_hna4_entry(union olsr_ip_addr *, union olsr_ip_addr *);
  
  int
! remove_local_hna6_entry(union olsr_ip_addr *, olsr_u16_t);
  
  struct hna4_entry *
! find_local_hna4_entry(union olsr_ip_addr *net, olsr_u32_t mask);
  
  struct hna6_entry *
! find_local_hna6_entry(union olsr_ip_addr *net, olsr_u16_t prefix_len);
  
  int
--- 48,67 ----
  
  void
! add_local_hna4_entry(const union olsr_ip_addr *, const union olsr_ip_addr *);
  
  void
! add_local_hna6_entry(const union olsr_ip_addr *, const olsr_u16_t);
  
  int
! remove_local_hna4_entry(const union olsr_ip_addr *, const union olsr_ip_addr *);
  
  int
! remove_local_hna6_entry(const union olsr_ip_addr *, const olsr_u16_t);
  
  struct hna4_entry *
! find_local_hna4_entry(const union olsr_ip_addr *net, const olsr_u32_t mask);
  
  struct hna6_entry *
! find_local_hna6_entry(const union olsr_ip_addr *net, const olsr_u16_t prefix_len);
  
  int





More information about the Olsr-cvs mailing list