projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add the "fsck" command to the CLI.
[tinc]
/
src
/
tincctl.c
diff --git
a/src/tincctl.c
b/src/tincctl.c
index
0eb3a25
..
04fbdd5
100644
(file)
--- a/
src/tincctl.c
+++ b/
src/tincctl.c
@@
-31,6
+31,7
@@
#include "control_common.h"
#include "crypto.h"
#include "ecdsagen.h"
#include "control_common.h"
#include "crypto.h"
#include "ecdsagen.h"
+#include "fsck.h"
#include "info.h"
#include "invitation.h"
#include "names.h"
#include "info.h"
#include "invitation.h"
#include "names.h"
@@
-66,7
+67,7
@@
char line[4096];
static int code;
static int req;
static int result;
static int code;
static int req;
static int result;
-
static
bool force = false;
+bool force = false;
bool tty = true;
bool confbasegiven = false;
bool netnamegiven = false;
bool tty = true;
bool confbasegiven = false;
bool netnamegiven = false;
@@
-150,6
+151,7
@@
static void usage(bool status) {
" invite NODE [...] Generate an invitation for NODE\n"
" join INVITATION Join a VPN using an INVITIATION\n"
" network [NETNAME] List all known networks, or switch to the one named NETNAME.\n"
" invite NODE [...] Generate an invitation for NODE\n"
" join INVITATION Join a VPN using an INVITIATION\n"
" network [NETNAME] List all known networks, or switch to the one named NETNAME.\n"
+ " fsck Check the configuration files for problems.\n"
"\n");
printf("Report bugs to tinc@tinc-vpn.org.\n");
}
"\n");
printf("Report bugs to tinc@tinc-vpn.org.\n");
}
@@
-1364,6
+1366,10
@@
const var_t variables[] = {
{"ScriptsInterpreter", VAR_SERVER},
{"StrictSubnets", VAR_SERVER},
{"TunnelServer", VAR_SERVER},
{"ScriptsInterpreter", VAR_SERVER},
{"StrictSubnets", VAR_SERVER},
{"TunnelServer", VAR_SERVER},
+ {"UDPDiscovery", VAR_SERVER},
+ {"UDPDiscoveryKeepaliveInterval", VAR_SERVER},
+ {"UDPDiscoveryInterval", VAR_SERVER},
+ {"UDPDiscoveryTimeout", VAR_SERVER},
{"UDPRcvBuf", VAR_SERVER},
{"UDPSndBuf", VAR_SERVER},
{"VDEGroup", VAR_SERVER},
{"UDPRcvBuf", VAR_SERVER},
{"UDPSndBuf", VAR_SERVER},
{"VDEGroup", VAR_SERVER},
@@
-1848,7
+1854,7
@@
static int cmd_generate_keys(int argc, char *argv[]) {
name = get_my_name(false);
#ifndef DISABLE_LEGACY
name = get_my_name(false);
#ifndef DISABLE_LEGACY
- if(!rsa_keygen(argc > 1 ? atoi(argv[1]) : 2048, true)
+ if(!rsa_keygen(argc > 1 ? atoi(argv[1]) : 2048, true)
)
return 1;
#endif
return 1;
#endif
@@
-2150,7
+2156,6
@@
static int switch_network(char *name) {
free(netname);
netname = strcmp(name, ".") ? xstrdup(name) : NULL;
free(netname);
netname = strcmp(name, ".") ? xstrdup(name) : NULL;
- make_names();
xasprintf(&tinc_conf, "%s" SLASH "tinc.conf", confbase);
xasprintf(&hosts_dir, "%s" SLASH "hosts", confbase);
xasprintf(&prompt, "%s> ", identname);
xasprintf(&tinc_conf, "%s" SLASH "tinc.conf", confbase);
xasprintf(&hosts_dir, "%s" SLASH "hosts", confbase);
xasprintf(&prompt, "%s> ", identname);
@@
-2195,6
+2200,15
@@
static int cmd_network(int argc, char *argv[]) {
return 0;
}
return 0;
}
+static int cmd_fsck(int argc, char *argv[]) {
+ if(argc > 1) {
+ fprintf(stderr, "Too many arguments!\n");
+ return 1;
+ }
+
+ return fsck(orig_argv[0]);
+}
+
static const struct {
const char *command;
int (*function)(int argc, char *argv[]);
static const struct {
const char *command;
int (*function)(int argc, char *argv[]);
@@
-2237,6
+2251,7
@@
static const struct {
{"invite", cmd_invite},
{"join", cmd_join},
{"network", cmd_network},
{"invite", cmd_invite},
{"join", cmd_join},
{"network", cmd_network},
+ {"fsck", cmd_fsck},
{NULL, NULL},
};
{NULL, NULL},
};