X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Flibmeshlink.h;h=471a90db0b5185afc10f393ad6b9348918379daa;hb=8eab1de5c6b24e90c865fd204887e313e99e32c6;hp=ab7cdded06777410df9c7c87c89e2bfca51cdcda;hpb=1d4439b5fcf05c8b191c9b9e3df57273eebc5ac2;p=meshlink diff --git a/src/libmeshlink.h b/src/libmeshlink.h index ab7cdded..471a90db 100644 --- a/src/libmeshlink.h +++ b/src/libmeshlink.h @@ -1,6 +1,6 @@ /* libmeshlink.h -- Tincd Library - Copyright (C) 2014 Guus Sliepen Saverio Proto + Copyright (C) 2014 Guus Sliepen Saverio Proto 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 @@ -19,18 +19,22 @@ #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. @@ -46,14 +50,8 @@ typedef struct tincpackethdr { u_int8_t source[16]; } __attribute__ ((__packed__)) tincpackethdr; -typedef struct tincremotehost { - char *name; - char *publickey; - -} tincremotehost; - // can be called from any thread -bool tinc_send_packet(tincremotehost *receiver, const char* buf, unsigned int len); +bool tinc_send_packet(node_t *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));