X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Flibmeshlink.h;h=af1c1bab07c4ebe9bba6cf643638d34c8ce4857a;hb=fb7b6e7a0c966a88a682f656ca1caeb9a0583c5b;hp=d5263c9cde413d3ca457238fac24a5aab7b5fbef;hpb=d3be999ba1c4dae92b94dd55cb9a2097c09b377a;p=meshlink diff --git a/src/libmeshlink.h b/src/libmeshlink.h index d5263c9c..af1c1bab 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,16 +19,33 @@ #include "system.h" #include "node.h" +//#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); + +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. */ -bool tinc_setup(const char* path); +bool tinc_setup(const char* confbase, const char* name); 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);