94df21d8a89d3fb94a5506c4f42418b03f84e519
[tinc] / src / tincctl.h
1 #ifndef TINC_TINCCTL_H
2 #define TINC_TINCCTL_H
3
4 /*
5     tincctl.h -- header for tincctl.c.
6     Copyright (C) 2011-2022 Guus Sliepen <guus@tinc-vpn.org>
7
8     This program is free software; you can redistribute it and/or modify
9     it under the terms of the GNU General Public License as published by
10     the Free Software Foundation; either version 2 of the License, or
11     (at your option) any later version.
12
13     This program is distributed in the hope that it will be useful,
14     but WITHOUT ANY WARRANTY; without even the implied warranty of
15     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16     GNU General Public License for more details.
17
18     You should have received a copy of the GNU General Public License along
19     with this program; if not, write to the Free Software Foundation, Inc.,
20     51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 */
22
23 #include "system.h"
24 #include "ecdsa.h"
25
26 extern bool tty;
27 extern bool force;
28 extern char line[4096];
29 extern int fd;
30 extern char buffer[4096];
31 extern size_t blen;
32 extern bool confbasegiven;
33 extern char *tinc_conf;
34 extern char *hosts_dir;
35
36 #define VAR_SERVER 1    /* Should be in tinc.conf */
37 #define VAR_HOST 2      /* Can be in host config file */
38 #define VAR_MULTIPLE 4  /* Multiple statements allowed */
39 #define VAR_OBSOLETE 8  /* Should not be used anymore */
40 #define VAR_SAFE 16     /* Variable is safe when accepting invitations */
41
42 typedef struct {
43         const char *name;
44         int type;
45 } var_t;
46
47 extern const var_t variables[];
48
49 extern size_t rstrip(char *value);
50 extern char *get_my_name(bool verbose) ATTR_MALLOC;
51 extern bool connect_tincd(bool verbose);
52 extern bool sendline(int fd, const char *format, ...) ATTR_FORMAT(printf, 2, 3);
53 extern bool recvline(int fd, char *line, size_t len);
54 extern int check_port(const char *name);
55
56 #endif