[Olsr-cvs] olsrd-current/src hna_set.h, 1.15, 1.16 hna_set.c, 1.22, 1.23

Bernd Petrovitsch (spam-protected)
Sun Oct 21 22:38:00 CEST 2007


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

Modified Files:
	hna_set.h hna_set.c 
Log Message:
* cont'ified it

Index: hna_set.h
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/hna_set.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** hna_set.h	5 Sep 2007 16:11:10 -0000	1.15
--- hna_set.h	21 Oct 2007 20:37:58 -0000	1.16
***************
*** 68,72 ****
  
  extern struct hna_entry hna_set[HASHSIZE];
- extern size_t netmask_size;
  
  
--- 68,71 ----
***************
*** 75,94 ****
  
  int
! olsr_get_hna_prefix_len(struct hna_net *);
  
  struct hna_net *
! olsr_lookup_hna_net(struct hna_net *, union olsr_ip_addr *, union hna_netmask *);
  
  struct hna_entry *
! olsr_lookup_hna_gw(union olsr_ip_addr *);
  
  struct hna_entry *
! olsr_add_hna_entry(union olsr_ip_addr *);
  
  struct hna_net *
! olsr_add_hna_net(struct hna_entry *, union olsr_ip_addr *, union hna_netmask *);
  
  void
! olsr_update_hna_entry(union olsr_ip_addr *, union olsr_ip_addr *, union hna_netmask *, float);
  
  void
--- 74,93 ----
  
  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 *
! olsr_lookup_hna_gw(const union olsr_ip_addr *);
  
  struct hna_entry *
! olsr_add_hna_entry(const union olsr_ip_addr *);
  
  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

Index: hna_set.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/hna_set.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** hna_set.c	17 Sep 2007 22:24:22 -0000	1.22
--- hna_set.c	21 Oct 2007 20:37:58 -0000	1.23
***************
*** 46,50 ****
  
  struct hna_entry hna_set[HASHSIZE];
! size_t netmask_size;
  
  
--- 46,50 ----
  
  struct hna_entry hna_set[HASHSIZE];
! static size_t netmask_size;
  
  
***************
*** 82,86 ****
  
  int
! olsr_get_hna_prefix_len(struct hna_net *hna)
  {
    if (olsr_cnf->ip_version == AF_INET) {
--- 82,86 ----
  
  int
! olsr_get_hna_prefix_len(const struct hna_net *hna)
  {
    if (olsr_cnf->ip_version == AF_INET) {
***************
*** 102,106 ****
   */
  struct hna_net *
! olsr_lookup_hna_net(struct hna_net *nets, union olsr_ip_addr *net, union hna_netmask *mask)
  {
    struct hna_net *tmp_net;
--- 102,106 ----
   */
  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;
***************
*** 122,127 ****
  
  
- 
- 
  /**
   *Lookup a gateway entry
--- 122,125 ----
***************
*** 132,144 ****
   */
  struct hna_entry *
! olsr_lookup_hna_gw(union olsr_ip_addr *gw)
  {
    struct hna_entry *tmp_hna;
!   olsr_u32_t hash;
! 
    //OLSR_PRINTF(5, "TC: lookup entry\n");
  
-   hash = olsr_hashing(gw);
-   
    /* Check for registered entry */
    for(tmp_hna = hna_set[hash].next;
--- 130,140 ----
   */
  struct hna_entry *
! olsr_lookup_hna_gw(const union olsr_ip_addr *gw)
  {
    struct hna_entry *tmp_hna;
!   olsr_u32_t hash = olsr_hashing(gw);
!   
    //OLSR_PRINTF(5, "TC: lookup entry\n");
  
    /* Check for registered entry */
    for(tmp_hna = hna_set[hash].next;
***************
*** 164,168 ****
   */
  struct hna_entry *
! olsr_add_hna_entry(union olsr_ip_addr *addr)
  {
    struct hna_entry *new_entry;
--- 160,164 ----
   */
  struct hna_entry *
! olsr_add_hna_entry(const union olsr_ip_addr *addr)
  {
    struct hna_entry *new_entry;
***************
*** 203,213 ****
   */
  struct hna_net *
! olsr_add_hna_net(struct hna_entry *hna_gw, union olsr_ip_addr *net, union hna_netmask *mask)
  {
-   struct hna_net *new_net;
- 
- 
    /* Add the net */
!   new_net = olsr_malloc(sizeof(struct hna_net), "Add HNA net");
    
    /* Fill struct */
--- 199,206 ----
   */
  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 */
!   struct hna_net *new_net = olsr_malloc(sizeof(struct hna_net), "Add HNA net");
    
    /* Fill struct */
***************
*** 241,245 ****
   */
  void
! olsr_update_hna_entry(union olsr_ip_addr *gw, union olsr_ip_addr *net, union hna_netmask *mask, float vtime)
  {
    struct hna_entry *gw_entry;
--- 234,238 ----
   */
  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;





More information about the Olsr-cvs mailing list