* to the project. For more information see the website or contact
* the copyright holders.
*
- * $Id: link_set.c,v 1.36 2004/12/02 18:03:15 tlopatic Exp $
+ * $Id: link_set.c,v 1.37 2004/12/04 17:06:57 tlopatic Exp $
*/
static void
olsr_time_out_hysteresis(void);
-#if defined USE_LINK_QUALITY
static void olsr_time_out_packet_loss(void);
-#endif
static struct link_entry *
add_new_entry(union olsr_ip_addr *, union olsr_ip_addr *, union olsr_ip_addr *, double, double);
olsr_register_timeout_function(&olsr_time_out_hysteresis);
}
-#if defined USE_LINK_QUALITY
if (olsr_cnf->lq_level > 0)
{
olsr_register_timeout_function(&olsr_time_out_packet_loss);
}
-#endif
}
struct link_entry *tmp_link_set;
union olsr_ip_addr *remote_addr;
struct interface *if_to_use, *tmp_if, *backup_if;
-#if defined USE_LINK_QUALITY
float link_quality, backup_link_quality, curr;
-#endif
if_to_use = NULL;
backup_if = NULL;
-#if defined USE_LINK_QUALITY
link_quality = -1.0;
backup_link_quality = -1.0;
-#endif
if(remote == NULL || link_set == NULL)
{
/* Must be symmetric link! */
if(!TIMED_OUT(&tmp_link_set->SYM_time))
{
-#if defined USE_LINK_QUALITY
if (olsr_cnf->lq_level == 0)
{
-#endif
if (if_to_use == NULL ||
if_to_use->int_metric > tmp_if->int_metric)
if_to_use = tmp_if;
-#if defined USE_LINK_QUALITY
}
else
link_quality = curr;
}
}
-#endif
}
/* Backup solution in case the links have timed out */
else
{
-#if defined USE_LINK_QUALITY
if (olsr_cnf->lq_level == 0)
{
-#endif
if (if_to_use == NULL &&
(backup_if == NULL ||
backup_if->int_metric > tmp_if->int_metric))
backup_if = tmp_if;
-#if defined USE_LINK_QUALITY
}
else
backup_link_quality = curr;
}
}
-#endif
}
}
new_link->L_link_quality = 0.0;
-#if defined USE_LINK_QUALITY
if (olsr_cnf->lq_level > 0)
{
new_link->loss_hello_int = htime;
new_link->saved_loss_link_quality = 0.0;
new_link->saved_neigh_link_quality = 0.0;
-#endif
/* Add to queue */
new_link->next = link_set;
return;
}
-#if defined USE_LINK_QUALITY
void olsr_print_link_set(void)
{
struct link_entry *walker;
return res;
}
-#endif