Sending LQ_HELLOs looks good so far, i.e. it does not crash the daemon.
authorThomas Lopatic <thomas@lopatic.de>
Mon, 1 Nov 2004 20:04:12 +0000 (20:04 +0000)
committerThomas Lopatic <thomas@lopatic.de>
Mon, 1 Nov 2004 20:04:12 +0000 (20:04 +0000)
src/generate_msg.h
src/linux/ifnet.c
src/win32/ifnet.c

index 7b95286..657eb4f 100644 (file)
@@ -19,7 +19,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  * 
  * 
- * $Id: generate_msg.h,v 1.7 2004/10/18 13:13:36 kattemat Exp $
+ * $Id: generate_msg.h,v 1.8 2004/11/01 20:04:12 tlopatic Exp $
  *
  */
 
@@ -45,4 +45,12 @@ generate_tc(void *);
 void
 generate_tabledisplay(void *);
 
+#if defined USE_LINK_QUALITY
+void
+generate_lq_hello(void *para);
+
+void
+generate_lq_tc(void *para);
+#endif
+
 #endif
index 6cb367e..6a99f3a 100644 (file)
@@ -20,7 +20,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  * 
  * 
- * $Id: ifnet.c,v 1.14 2004/10/19 21:06:34 kattemat Exp $
+ * $Id: ifnet.c,v 1.15 2004/11/01 20:04:12 tlopatic Exp $
  *
  */
 
@@ -435,6 +435,7 @@ chk_if_changed(struct olsr_if *iface)
   /*
    * Deregister scheduled functions 
    */
+#if !defined USE_LINK_QUALITY
   olsr_remove_scheduler_event(&generate_hello, 
                              ifp, 
                              iface->cnf->hello_params.emission_interval, 
@@ -445,6 +446,18 @@ chk_if_changed(struct olsr_if *iface)
                              iface->cnf->tc_params.emission_interval,
                              0, 
                              NULL);
+#else
+  olsr_remove_scheduler_event(&generate_lq_hello, 
+                             ifp, 
+                             iface->cnf->hello_params.emission_interval, 
+                             0, 
+                             NULL);
+  olsr_remove_scheduler_event(&generate_lq_tc, 
+                             ifp, 
+                             iface->cnf->tc_params.emission_interval,
+                             0, 
+                             NULL);
+#endif
   olsr_remove_scheduler_event(&generate_mid, 
                              ifp, 
                              iface->cnf->mid_params.emission_interval,
@@ -758,6 +771,7 @@ chk_if_up(struct olsr_if *iface, int debuglvl)
   /*
    * Register scheduled functions 
    */
+#if !defined USE_LINK_QUALITY
   olsr_register_scheduler_event(&generate_hello, 
                                ifp, 
                                iface->cnf->hello_params.emission_interval, 
@@ -768,6 +782,18 @@ chk_if_up(struct olsr_if *iface, int debuglvl)
                                iface->cnf->tc_params.emission_interval,
                                0, 
                                NULL);
+#else
+  olsr_register_scheduler_event(&generate_lq_hello, 
+                               ifp, 
+                               iface->cnf->hello_params.emission_interval, 
+                               0, 
+                               NULL);
+  olsr_register_scheduler_event(&generate_lq_tc, 
+                               ifp, 
+                               iface->cnf->tc_params.emission_interval,
+                               0, 
+                               NULL);
+#endif
   olsr_register_scheduler_event(&generate_mid, 
                                ifp, 
                                iface->cnf->mid_params.emission_interval,
index 62e0bad..f92fba9 100644 (file)
@@ -21,7 +21,7 @@
  * along with olsr.org; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
- * $Id: ifnet.c,v 1.6 2004/10/19 21:44:56 tlopatic Exp $
+ * $Id: ifnet.c,v 1.7 2004/11/01 20:04:12 tlopatic Exp $
  *
  */
 
@@ -513,6 +513,7 @@ void RemoveInterface(struct olsr_if *IntConf)
     }
   }
 
+#if !defined USE_LINK_QUALITY
   olsr_remove_scheduler_event(&generate_hello, Int,
                               IntConf->cnf->hello_params.emission_interval,
                               0, NULL);
@@ -520,7 +521,15 @@ void RemoveInterface(struct olsr_if *IntConf)
   olsr_remove_scheduler_event(&generate_tc, Int,
                               IntConf->cnf->tc_params.emission_interval,
                               0, NULL);
+#else
+  olsr_remove_scheduler_event(&generate_lq_hello, Int,
+                              IntConf->cnf->hello_params.emission_interval,
+                              0, NULL);
 
+  olsr_remove_scheduler_event(&generate_lq_tc, Int,
+                              IntConf->cnf->tc_params.emission_interval,
+                              0, NULL);
+#endif
   olsr_remove_scheduler_event(&generate_mid, Int,
                               IntConf->cnf->mid_params.emission_interval,
                               0, NULL);
@@ -790,6 +799,7 @@ int chk_if_up(struct olsr_if *IntConf, int DebugLevel)
 
   net_add_buffer(New);
 
+#if !defined USE_LINK_QUALITY
   olsr_register_scheduler_event(&generate_hello, New,
                                 IntConf->cnf->hello_params.emission_interval,
                                 0, NULL);
@@ -797,7 +807,15 @@ int chk_if_up(struct olsr_if *IntConf, int DebugLevel)
   olsr_register_scheduler_event(&generate_tc, New,
                                 IntConf->cnf->tc_params.emission_interval,
                                 0, NULL);
+#else
+  olsr_register_scheduler_event(&generate_lq_hello, New,
+                                IntConf->cnf->hello_params.emission_interval,
+                                0, NULL);
 
+  olsr_register_scheduler_event(&generate_lq_tc, New,
+                                IntConf->cnf->tc_params.emission_interval,
+                                0, NULL);
+#endif
   olsr_register_scheduler_event(&generate_mid, New,
                                 IntConf->cnf->mid_params.emission_interval,
                                 0, NULL);