[Olsr-cvs] olsrd-current/src link_set.c, 1.60, 1.61 link_set.h, 1.27, 1.28 lq_packet.c, 1.17, 1.18 lq_route.c, 1.36, 1.37 net_olsr.c, 1.4, 1.5
Thomas Lopatic
(spam-protected)
Sun Oct 23 22:58:16 CEST 2005
Update of /cvsroot/olsrd/olsrd-current/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17067/src
Modified Files:
link_set.c link_set.h lq_packet.c lq_route.c net_olsr.c
Log Message:
Only use updated link qualities for links between us and our neighbours
after we have announced them to the world via an LQ TC message. The idea
is that we use the updated link qualities only when everybody else does
so, too.
Index: lq_route.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/lq_route.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -d -r1.36 -r1.37
*** lq_route.c 23 Oct 2005 20:11:50 -0000 1.36
--- lq_route.c 23 Oct 2005 20:58:14 -0000 1.37
***************
*** 366,370 ****
--- 366,372 ----
struct rt_entry *gw_rt, *hna_rt, *head_rt;
struct neighbor_2_entry *neigh2;
+ #if 0
struct neighbor_list_entry *neigh_walker;
+ #endif
struct interface *inter;
***************
*** 425,432 ****
link = get_best_link_to_neighbor(&neigh->neighbor_main_addr);
! if (link->loss_link_quality >= MIN_LINK_QUALITY &&
! link->neigh_link_quality >= MIN_LINK_QUALITY)
{
! etx = 1.0 / (link->loss_link_quality * link->neigh_link_quality);
add_edge(&vertex_tree, &neigh->neighbor_main_addr, &main_addr, etx);
--- 427,434 ----
link = get_best_link_to_neighbor(&neigh->neighbor_main_addr);
! if (link->loss_link_quality2 >= MIN_LINK_QUALITY &&
! link->neigh_link_quality2 >= MIN_LINK_QUALITY)
{
! etx = 1.0 / (link->loss_link_quality2 * link->neigh_link_quality2);
add_edge(&vertex_tree, &neigh->neighbor_main_addr, &main_addr, etx);
***************
*** 434,437 ****
--- 436,443 ----
}
+ // we now rely solely on TC messages for routes to our two-hop neighbours
+
+ #if 0
+
// add edges between our neighbours and our two-hop neighbours
***************
*** 456,459 ****
--- 462,467 ----
}
+ #endif
+
// add remaining edges
Index: lq_packet.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/lq_packet.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** lq_packet.c 8 Oct 2005 15:43:56 -0000 1.17
--- lq_packet.c 23 Oct 2005 20:58:14 -0000 1.18
***************
*** 55,58 ****
--- 55,60 ----
#include "olsr.h"
+ olsr_bool lq_tc_pending = OLSR_FALSE;
+
static unsigned char msg_buffer[MAXMESSAGESIZE - OLSR_HEADERSIZE];
***************
*** 149,152 ****
--- 151,159 ----
struct link_entry *link;
+ // remember that we have generated an LQ TC message; this is
+ // checked in net_output()
+
+ lq_tc_pending = OLSR_TRUE;
+
// initialize the static fields
Index: net_olsr.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/net_olsr.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** net_olsr.c 8 Oct 2005 15:43:56 -0000 1.4
--- net_olsr.c 23 Oct 2005 20:58:14 -0000 1.5
***************
*** 45,50 ****
--- 45,53 ----
#include "net_os.h"
#include "print_packet.h"
+ #include "link_set.h"
#include <stdlib.h>
+ extern olsr_bool lq_tc_pending;
+
#ifdef WIN32
#define perror(x) WinSockPError(x)
***************
*** 489,492 ****
--- 492,501 ----
netbufs[ifp->if_nr]->pending = 0;
+ // if we've just transmitted a TC message, let Dijkstra use the current
+ // link qualities for the links to our neighbours
+
+ olsr_update_dijkstra_link_qualities();
+ lq_tc_pending = OLSR_FALSE;
+
return 1;
}
Index: link_set.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/link_set.c,v
retrieving revision 1.60
retrieving revision 1.61
diff -C2 -d -r1.60 -r1.61
*** link_set.c 30 May 2005 13:13:38 -0000 1.60
--- link_set.c 23 Oct 2005 20:58:14 -0000 1.61
***************
*** 476,479 ****
--- 476,482 ----
new_link->neigh_link_quality = 0.0;
+ new_link->loss_link_quality2 = 0.0;
+ new_link->neigh_link_quality2 = 0.0;
+
new_link->saved_loss_link_quality = 0.0;
new_link->saved_neigh_link_quality = 0.0;
***************
*** 1073,1074 ****
--- 1076,1089 ----
}
}
+
+ void olsr_update_dijkstra_link_qualities()
+ {
+ struct link_entry *walker;
+
+ for (walker = link_set; walker != NULL; walker = walker->next)
+ {
+ walker->loss_link_quality2 = walker->loss_link_quality;
+ walker->neigh_link_quality2 = walker->neigh_link_quality;
+ }
+ }
+
Index: link_set.h
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/link_set.h,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -d -r1.27 -r1.28
*** link_set.h 29 May 2005 12:47:45 -0000 1.27
--- link_set.h 23 Oct 2005 20:58:14 -0000 1.28
***************
*** 86,90 ****
int total_packets;
! double loss_link_quality;
double loss_link_multiplier;
--- 86,90 ----
int total_packets;
! double loss_link_quality, loss_link_quality2;
double loss_link_multiplier;
***************
*** 94,98 ****
unsigned char loss_bitmap[16];
! double neigh_link_quality;
double saved_loss_link_quality;
--- 94,98 ----
unsigned char loss_bitmap[16];
! double neigh_link_quality, neigh_link_quality2;
double saved_loss_link_quality;
***************
*** 145,147 ****
--- 145,150 ----
olsr_print_link_set(void);
+ void
+ olsr_update_dijkstra_link_qualities(void);
+
#endif
More information about the Olsr-cvs
mailing list