]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - support/sdk/c/blip/driver/nwstate.c
commit automake build system
[tinyos-2.x.git] / support / sdk / c / blip / driver / nwstate.c
index 0ef8ed6b10f9a5dd8a63af2bef23992d1e4926de..7a08edebe68608537e38a2b08217433577e224cf 100644 (file)
 #include <float.h>
 #include <time.h>
 #include <sys/time.h>
+#include "lib6lowpan/lib6lowpan.h"
+
 #include "nwstate.h"
 #include "hashtable.h"
 #include "logging.h"
-#include "lib6lowpan.h"
 #include "routing.h"
-#include "vty.h"
+#include "vty/vty.h"
 
 struct hashtable *links;
 struct hashtable *routers;
@@ -183,7 +184,7 @@ void nw_add_sticky_edge(int fd, int argc, char **argv) {
     l = nw_add_incr_edge(v1, &te);
     l->marked = L_STICKY;
   } else {
-    VTY_printf("add a link: 'a <n1> <n2>'\r\n");
+    VTY_printf("add a link: '%s <n1> <n2>'\r\n", argv[0]);
   }
   VTY_flush();
 }
@@ -212,6 +213,7 @@ router_t *get_insert_router(node_id_t rid) {
   if (ret == NULL) {
     key = (router_key_t *)malloc(sizeof(router_key_t));
     ret = (router_t *)malloc(sizeof(router_t));
+    memset(ret, 0, sizeof(router_t));
 
     ret->id = rid;
     ret->links = NULL;
@@ -265,6 +267,7 @@ link_t *nw_add_incr_edge(node_id_t v1, struct topology_entry *te) {
     router_t *r1 = get_insert_router(v1);
     router_t *r2 = get_insert_router(v2);
     link_str = (link_t *)malloc(sizeof(link_t));
+    memset(link_str, 0, sizeof(link_t));
 
     new_key->r1 = v1;
     new_key->r2 = v2;