X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=support%2Fsdk%2Fc%2Fblip%2Fdriver%2Fnwstate.c;h=7a08edebe68608537e38a2b08217433577e224cf;hb=172fa87c323ce3c1ab76b10822ae5628e3dc5868;hp=0ef8ed6b10f9a5dd8a63af2bef23992d1e4926de;hpb=45442859cf10c23b847a4cacc988963105083db2;p=tinyos-2.x.git diff --git a/support/sdk/c/blip/driver/nwstate.c b/support/sdk/c/blip/driver/nwstate.c index 0ef8ed6b..7a08edeb 100644 --- a/support/sdk/c/blip/driver/nwstate.c +++ b/support/sdk/c/blip/driver/nwstate.c @@ -26,12 +26,13 @@ #include #include #include +#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 '\r\n"); + VTY_printf("add a link: '%s '\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;