* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*
- * $Id: link_set.c,v 1.19 2004/11/07 20:09:11 tlopatic Exp $
+ * $Id: link_set.c,v 1.20 2004/11/08 00:15:46 tlopatic Exp $
*
*/
{
struct link_entry *walker;
- olsr_printf(1, "LINK SET --------------------------------------\n");
- olsr_printf(1, "IP address hyst LQ lost total NLQ\n");
+ olsr_printf(1, "\nLINKS --------------------------------------------------\n\n");
+ olsr_printf(1, "IP address hyst LQ lost total NLQ\n");
for (walker = link_set; walker != NULL; walker = walker->next)
- olsr_printf(1, "%15s %5.3f %5.3f %3d %3d %5.3f\n",
+ olsr_printf(1, "%-15s %5.3f %5.3f %-3d %-3d %5.3f\n",
olsr_ip_to_string(&walker->neighbor_iface_addr),
walker->L_link_quality, walker->loss_link_quality,
walker->lost_packets, walker->total_packets);
- olsr_printf(1, "-----------------------------------------------\n");
}
static void update_packet_loss_worker(struct link_entry *entry, int lost)
// whether the link's (bidirectional = forth x back) quality
// is better than what we have
- if(COMP_IP(&main, &walker->neighbor->neighbor_main_addr) &&
+ if(COMP_IP(main, &walker->neighbor->neighbor_main_addr) &&
walker->loss_link_quality * walker->neigh_link_quality >= res)
res = walker->loss_link_quality;
}
// check whether it's a link to the requested neighbor and
// whether the link's quality is better than what we have
- if(COMP_IP(&main, &walker->neighbor->neighbor_main_addr) &&
+ if(COMP_IP(main, &walker->neighbor->neighbor_main_addr) &&
walker->neigh_link_quality >= best)
{
best = walker->loss_link_quality;
// check whether it's a link to the requested neighbor and
// whether the link's quality is better than what we have
- if(COMP_IP(&main, &walker->neighbor->neighbor_main_addr) &&
+ if(COMP_IP(main, &walker->neighbor->neighbor_main_addr) &&
walker->loss_link_quality >= best)
{
best = walker->loss_link_quality;
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*
- * $Id: lq_packet.c,v 1.4 2004/11/07 20:09:11 tlopatic Exp $
+ * $Id: lq_packet.c,v 1.5 2004/11/08 00:15:46 tlopatic Exp $
*
*/
olsr_head_v4->ttl = comm->ttl;
olsr_head_v4->hops = comm->hops;
olsr_head_v4->seqno = htons(comm->seqno);
+
+ return;
}
// serialize an IPv6 OLSR message header
// add the corresponding link quality
- buff[size++] = (unsigned char)(neigh->link_quality * 256);
- buff[size++] = (unsigned char)(neigh->neigh_link_quality * 256);
+ buff[size++] = (unsigned char)(neigh->link_quality * 255);
+ buff[size++] = (unsigned char)(neigh->neigh_link_quality * 255);
// pad
// add the corresponding link quality
- buff[size++] = (unsigned char)(neigh->link_quality * 256);
- buff[size++] = (unsigned char)(neigh->neigh_link_quality * 256);
+ buff[size++] = (unsigned char)(neigh->link_quality * 255);
+ buff[size++] = (unsigned char)(neigh->neigh_link_quality * 255);
// pad
lq_hello->htime = me_to_double(head->htime);
lq_hello->will = head->will;
+ lq_hello->neigh = NULL;
+
curr = (unsigned char *)(head + 1);
while (curr < limit)
while (curr < limit2)
{
- neigh = olsr_malloc(sizeof (struct lq_tc_neighbor),
+ neigh = olsr_malloc(sizeof (struct lq_hello_neighbor),
"LQ_HELLO deserialization");
COPY_IP(&neigh->addr, curr);
curr += ipsize;
- neigh->link_quality = (double)*curr++ / 256.0;
- neigh->neigh_link_quality = (double)*curr++ / 256.0;
+ neigh->link_quality = (double)*curr++ / 255.0;
+ neigh->neigh_link_quality = (double)*curr++ / 255.0;
curr += 2;
lq_tc->ansn = ntohs(head->ansn);
+ lq_tc->neigh = NULL;
+
curr = (unsigned char *)(head + 1);
while (curr < limit)
COPY_IP(&neigh->main, curr);
curr += ipsize;
- neigh->link_quality = (double)*curr++ / 256.0;
- neigh->neigh_link_quality = (double)*curr++ / 256.0;
+ neigh->link_quality = (double)*curr++ / 255.0;
+ neigh->neigh_link_quality = (double)*curr++ / 255.0;
curr += 2;
hello.ttl = lq_hello->comm.ttl;
hello.willingness = lq_hello->will;
+ hello.neighbors = NULL;
+
// move all LQ_HELLO neighbours to HELLO
for (neigh = lq_hello->neigh; neigh != NULL; neigh = neigh->next)
new_neigh->status = neigh->neigh_type;
new_neigh->link = neigh->link_type;
new_neigh->link_quality = neigh->link_quality;
+ new_neigh->neigh_link_quality = neigh->neigh_link_quality;
COPY_IP(&new_neigh->address, &neigh->addr);
tc.ttl = lq_tc->comm.ttl;
tc.ansn = lq_tc->ansn;
+ tc.multipoint_relay_selector_address = NULL;
+
// move all LQ_TC neighbours to TC
for (neigh = lq_tc->neigh; neigh != NULL; neigh = neigh->next)