]> git.meshlink.io Git - meshlink/blobdiff - src/libmeshlink.h
Merge remote-tracking branch 'origin/master' into saverio
[meshlink] / src / libmeshlink.h
index c5e84462fba366d57b94db15023c50ec1ff996f9..0cbfec7ec9150200df350a3994d37b9b1d074178 100644 (file)
@@ -1,6 +1,6 @@
 /*
     libmeshlink.h -- Tincd Library
-    Copyright (C) 2014 Guus Sliepen <guus@tinc-vpn.org> Saverio Proto <zioproto@gmail.com>
+    Copyright (C) 2014 Guus Sliepen <guus@meshlink.io> Saverio Proto <zioproto@gmail.com>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
 
 #include "system.h"
 #include "node.h"
-#include "names.h"
 //#include "tincctl.h"
 #include "xalloc.h"
+#include "logger.h"
+#include "route.h"
+
+typedef void (*recvdata_cb_t)(void *data);
+void recvdata_register_cb(recvdata_cb_t cb);
+
+extern recvdata_cb_t recv_callback;
 
 extern char *hosts_dir;
 extern FILE *fopenmask(const char *filename, const char *mode, mode_t perms);
 
-extern int check_port(char *name);
+extern int check_port(const char *name);
 
-bool tinc_main_thread(void * in);
+void *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.
@@ -39,6 +45,12 @@ bool tinc_start(const char* path);
 
 bool tinc_stop();
 
+typedef struct tincpackethdr {
+  u_int8_t legacymtu[14];
+  u_int8_t destination[16];
+  u_int8_t source[16];
+} __attribute__ ((__packed__)) tincpackethdr;
+
 // can be called from any thread
 bool tinc_send_packet(node_t *receiver, const char* buf, unsigned int len);