X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Flibmeshlink.h;h=df1fc8d764be6df525b1b644d24d1a5ebfe6c178;hb=c53b009f21e97379cad24c811c8033e647cb2bb9;hp=2541b5f2888ea2242c863769aa2a4b3851971bcf;hpb=704f0cef66f94c2b17c8e591137c21b6af74fc7b;p=meshlink diff --git a/src/libmeshlink.h b/src/libmeshlink.h index 2541b5f2..df1fc8d7 100644 --- a/src/libmeshlink.h +++ b/src/libmeshlink.h @@ -23,6 +23,7 @@ //#include "tincctl.h" #include "xalloc.h" #include "logger.h" +#include "route.h" extern char *hosts_dir; extern FILE *fopenmask(const char *filename, const char *mode, mode_t perms); @@ -40,8 +41,23 @@ bool tinc_start(const char* path); bool tinc_stop(); +typedef struct tincpackethdr { + /* Use a standard Type-Length-Value (TLV) element */ + u_int8_t type; + u_int8_t len; + u_int16_t reserved; /* Always 0 */ + u_int32_t destination; + u_int32_t source; +} __attribute__ ((__packed__)) tincpackethdr; + +typedef struct tincremotehost { + char *name; + char *publickey; + +} tincremotehost; + // can be called from any thread -bool tinc_send_packet(node_t *receiver, const char* buf, unsigned int len); +bool tinc_send_packet(tincremotehost *receiver, const char* buf, unsigned int len); // handler runs in tinc thread and should return immediately bool tinc_set_packet_receive_handler(void (*handler)(const char* sender, const char* buf, unsigned int len));