1 #include <libmeshlink.h>
3 int main(int argc , char **argv){
5 char *confbase = argc > 1 ? argv[1] : "/tmp/meshlink/";
6 char *name = argc > 2 ? argv[2] : "foo";
9 node_t* remotenode = new_node();
10 char *remotename = argc > 3 ? argv[3] : "bar";
12 //TODO: change this, calling a function that returns node_t
13 remotenode->name = malloc(16);
14 remotenode->name = remotename;
16 tinc_setup(confbase, name);
18 sleep(2); //there is a race condition here, tinc_start detaches to a thread the needs time to setup stuff
21 //sample data to send out
24 strcpy(mydata,"Hello World!");
27 tinc_send_packet(remotenode,mydata,sizeof(mydata));
28 sleep(10); //give time to this thread to finish before we exit