summaryrefslogtreecommitdiff
path: root/proto/wireguard/config.Y
diff options
context:
space:
mode:
authorMikael Magnusson <mikma@users.sourceforge.net>2019-02-28 00:44:40 +0100
committerMikael Magnusson <mikma@users.sourceforge.net>2021-01-12 23:34:17 +0100
commit1b186fa5158a0a1c84ee2a30f8803c518a538623 (patch)
tree51e7259ffc5db874654853ec32b475eef3c1a9a9 /proto/wireguard/config.Y
parentdad58d2c4b331f839f8256fd29792dea368c70a4 (diff)
Wireguard: Initial commit
Diffstat (limited to 'proto/wireguard/config.Y')
-rw-r--r--proto/wireguard/config.Y48
1 files changed, 48 insertions, 0 deletions
diff --git a/proto/wireguard/config.Y b/proto/wireguard/config.Y
new file mode 100644
index 00000000..dfe621bd
--- /dev/null
+++ b/proto/wireguard/config.Y
@@ -0,0 +1,48 @@
+/*
+ * BIRD -- Wireguard Protocol Configuration
+ *
+ * (c) 1999 Martin Mares <mj@ucw.cz>
+ *
+ * Can be freely distributed and used under the terms of the GNU GPL.
+ */
+
+CF_HDR
+
+#include "proto/wireguard/wireguard.h"
+
+CF_DEFINES
+
+#define WG_CFG ((struct wg_config *) this_proto)
+
+CF_DECLS
+
+CF_KEYWORDS(WIREGUARD, PEERS)
+
+CF_GRAMMAR
+
+proto: wireguard_proto '}' ;
+
+wireguard_proto_start: proto_start WIREGUARD {
+ this_proto = proto_config_new(&proto_wireguard, $1);
+ }
+ ;
+
+wireguard_proto:
+ wireguard_proto_start proto_name '{'
+ | wireguard_proto proto_channel ';' { this_proto->net_type = $2->net_type; }
+ | wireguard_proto proto_item ';'
+ | wireguard_proto INTERFACE TEXT ';' { WG_CFG->ifname = $3; }
+ | wireguard_proto PEERS '{' peers '}'
+ ;
+
+peers:
+ /* empty */
+ | peers peer
+
+peer: ipa pubkey ';'
+
+pubkey: TEXT
+
+CF_CODE
+
+CF_END