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