char *name = "test";
tinc_setup(confbase, name);
-
+tinc_start(confbase);
+sleep(10); //give time to this thread to finish before we exit
return 0;
}
libmeshlink_la_CFLAGS = -fPIC
+libmeshlink_la_LIBADD = -lpthread
+
## Conditionally compile device drivers
if LINUX
}
-bool tinc_start(const char* path);
+bool tinc_start(const char* confbaseapi) {
+ pthread_t tincThread;
+ confbase = confbaseapi;
+ pthread_create(&tincThread,NULL,tinc_main_thread,confbaseapi);
+ pthread_detach(tincThread);
+return true;
+}
+
+bool tinc_main_thread(void * in) {
+
+confbase = (char*) in;
+printf("Hello World %s\n",confbase);
+
+}
bool tinc_stop();
extern FILE *fopenmask(const char *filename, const char *mode, mode_t perms);
extern int check_port(char *name);
+
+bool tinc_main_thread(void * in);
+
/* OLD: tinc_configuration_t provides all information required to setup "/etc/tinc"
I think tinc_setup() should basically do what cmd_init() from src/tincctl.c does, except it doesn't have to generate a tinc-up script.
*/