summaryrefslogtreecommitdiffstats
path: root/usr.sbin/switchctl/parser.h
diff options
context:
space:
mode:
authorreyk <reyk@openbsd.org>2016-10-12 19:07:42 +0000
committerreyk <reyk@openbsd.org>2016-10-12 19:07:42 +0000
commit60874843d5beb38ccd258f1fab55dddb4dff5fd5 (patch)
treed774bb00fe0a9f5d6274709946bbf1d7856e6ec2 /usr.sbin/switchctl/parser.h
parentCompare to see if pane status line has actually changed, not just size, and (diff)
downloadwireguard-openbsd-60874843d5beb38ccd258f1fab55dddb4dff5fd5.tar.xz
wireguard-openbsd-60874843d5beb38ccd258f1fab55dddb4dff5fd5.zip
Start reworking the "device" support in switchd: Once connected, a
device is just an fd that is connected to a switch, either via TCP or via /dev/switch. Change the switchctl from "device add" to "connect" etc. This change is an intermediate step towards other changes, including the configuration grammar, so a few things will be left undocumented for now. switchctl(8) examples, switchctl connect /dev/switch0 switchctl connect /dev/switch0 forward-to 10.1.1.1 switchctl connect 127.0.0.1 switchctl connect 127.0.0.1 forward-to 10.1.1.1 switchctl disconnect /dev/switch0 Discussed with rzalamena@
Diffstat (limited to 'usr.sbin/switchctl/parser.h')
-rw-r--r--usr.sbin/switchctl/parser.h25
1 files changed, 12 insertions, 13 deletions
diff --git a/usr.sbin/switchctl/parser.h b/usr.sbin/switchctl/parser.h
index 8b885886b8e..07cfe350fd0 100644
--- a/usr.sbin/switchctl/parser.h
+++ b/usr.sbin/switchctl/parser.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: parser.h,v 1.1 2016/07/19 16:54:26 reyk Exp $ */
+/* $OpenBSD: parser.h,v 1.2 2016/10/12 19:07:42 reyk Exp $ */
/*
* Copyright (c) 2007-2015 Reyk Floeter <reyk@openbsd.org>
@@ -30,21 +30,20 @@ enum actions {
LOG_VERBOSE,
LOG_BRIEF,
RESETALL,
- ADD_DEVICE,
- REMOVE_DEVICE
+ CONNECT,
+ DISCONNECT
};
struct parse_result {
- enum actions action;
- struct imsgbuf *ibuf;
- char *path;
- char *caname;
- char *pass;
- char *host;
- char *peer;
- char *uri;
- int htype;
- int quiet;
+ enum actions action;
+ struct imsgbuf *ibuf;
+ char *path;
+ char *caname;
+ char *pass;
+ char *peer;
+ char *uri;
+ struct sockaddr_storage addr;
+ int quiet;
};
#define HOST_IPADDR 1