aboutsummaryrefslogtreecommitdiffstats
path: root/protocol.capnp.h
diff options
context:
space:
mode:
authorTushar Pankaj <tushar.s.pankaj@gmail.com>2018-11-12 18:34:29 -0600
committerTushar Pankaj <tushar.s.pankaj@gmail.com>2018-11-12 18:34:29 -0600
commit5f4e092e04755bcb89d2252d828de2de8d3d7aca (patch)
treef785dd089389c10483fdb74d4001d8fdef4c338e /protocol.capnp.h
parentWrite basic mains so project compiles (diff)
downloadwg-dynamic-5f4e092e04755bcb89d2252d828de2de8d3d7aca.tar.xz
wg-dynamic-5f4e092e04755bcb89d2252d828de2de8d3d7aca.zip
Implement basic server/client + protocol
Includes WireGuard submodule to use the embeddable library Squashed commit of the following: commit 3e5252d93c87c4cddf596d4030d736e2cea81557 Author: Tushar Pankaj <tushar.s.pankaj@gmail.com> Date: Mon Nov 12 18:33:33 2018 -0600 Implement server check iface Signed-off-by: Tushar Pankaj <tushar.s.pankaj@gmail.com> commit a30c60e51ecae887fd89654bdedddcf0decb766c Author: Tushar Pankaj <tushar.s.pankaj@gmail.com> Date: Mon Nov 12 18:26:57 2018 -0600 Add WireGuard embeddable library Signed-off-by: Tushar Pankaj <tushar.s.pankaj@gmail.com> commit ea6ab8ce09d4e84440185536f7b3e92346789233 Author: Tushar Pankaj <tushar.s.pankaj@gmail.com> Date: Mon Nov 12 17:59:39 2018 -0600 Working client and server comms Signed-off-by: Tushar Pankaj <tushar.s.pankaj@gmail.com> commit 5d717e37baaa9882ea2356fa24a2b85beaf51558 Author: Tushar Pankaj <tushar.s.pankaj@gmail.com> Date: Mon Nov 12 17:13:32 2018 -0600 Add IP addr structs to protocol Signed-off-by: Tushar Pankaj <tushar.s.pankaj@gmail.com> commit 8c31eec08257f77a9c95c7437b21bf7eb8106916 Author: Tushar Pankaj <tushar.s.pankaj@gmail.com> Date: Mon Nov 12 17:06:18 2018 -0600 Style fixes Signed-off-by: Tushar Pankaj <tushar.s.pankaj@gmail.com> commit 64f825db92ce31102b29ac96fd382ac3643fb6ae Author: Tushar Pankaj <tushar.s.pankaj@gmail.com> Date: Mon Nov 12 17:06:07 2018 -0600 Write client connect_to_server Signed-off-by: Tushar Pankaj <tushar.s.pankaj@gmail.com> commit f33225d130263eea481e28269b6b01a7cf75b0c8 Author: Tushar Pankaj <tushar.s.pankaj@gmail.com> Date: Fri Nov 9 20:00:37 2018 -0600 Add pthread library Signed-off-by: Tushar Pankaj <tushar.s.pankaj@gmail.com> commit 1f73168641d92917dc942c3d6cc200fb7f557674 Merge: 98fe966 3048896 Author: Tushar Pankaj <tushar.s.pankaj@gmail.com> Date: Wed Nov 7 10:59:13 2018 -0600 Merge branch 'master' into tp/protocol_draft commit 98fe966940eaf324b5d8d1edc64f6d0ff1334441 Author: Tushar Pankaj <tushar.s.pankaj@gmail.com> Date: Wed Nov 7 10:55:53 2018 -0600 Add Makefile library includes for capnp Signed-off-by: Tushar Pankaj <tushar.s.pankaj@gmail.com> commit 3bd7dffda7db8e9bf4cd0dad2455328508efb9b2 Author: Tushar Pankaj <tushar.s.pankaj@gmail.com> Date: Wed Nov 7 10:49:50 2018 -0600 Make protocol.capnp.o compile Signed-off-by: Tushar Pankaj <tushar.s.pankaj@gmail.com> commit 14e708783433816fd6cead46e2aa823ab8e41294 Author: Tushar Pankaj <tushar.s.pankaj@gmail.com> Date: Wed Nov 7 10:38:29 2018 -0600 Untested first draft of protocol.capnp Signed-off-by: Tushar Pankaj <tushar.s.pankaj@gmail.com> commit 5558c37a1a2626beaee5bb69c83d4013f2bcaf44 Author: Tushar Pankaj <tushar.s.pankaj@gmail.com> Date: Tue Nov 6 20:51:49 2018 -0600 Exclude capnproto from clang-format Signed-off-by: Tushar Pankaj <tushar.s.pankaj@gmail.com> commit 50042af6aec61c495c08d1b83f4c63288a30cc90 Author: Tushar Pankaj <tushar.s.pankaj@gmail.com> Date: Wed Oct 31 20:40:23 2018 -0500 Make better var names Signed-off-by: Tushar Pankaj <tushar.s.pankaj@gmail.com> commit 2352cbc91e6be9bcd73ca2794372b1ed8361448e Author: Tushar Pankaj <tushar.s.pankaj@gmail.com> Date: Wed Oct 31 20:08:05 2018 -0500 First draft of protocol Signed-off-by: Tushar Pankaj <tushar.s.pankaj@gmail.com>
Diffstat (limited to '')
-rw-r--r--protocol.capnp.h119
1 files changed, 119 insertions, 0 deletions
diff --git a/protocol.capnp.h b/protocol.capnp.h
new file mode 100644
index 0000000..bf8a949
--- /dev/null
+++ b/protocol.capnp.h
@@ -0,0 +1,119 @@
+#ifndef CAPN_ED77208FB3340CC1
+#define CAPN_ED77208FB3340CC1
+/* AUTO GENERATED - DO NOT EDIT */
+#include <capnp_c.h>
+
+#if CAPN_VERSION != 1
+#error "version mismatch between capnp_c.h and generated code"
+#endif
+
+#ifndef capnp_nowarn
+# ifdef __GNUC__
+# define capnp_nowarn __extension__
+# else
+# define capnp_nowarn
+# endif
+#endif
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct WgClientMsg;
+struct WgIpv4Addr;
+struct WgIpv6Addr;
+struct WgServerSimpleMsg;
+
+typedef struct {capn_ptr p;} WgClientMsg_ptr;
+typedef struct {capn_ptr p;} WgIpv4Addr_ptr;
+typedef struct {capn_ptr p;} WgIpv6Addr_ptr;
+typedef struct {capn_ptr p;} WgServerSimpleMsg_ptr;
+
+typedef struct {capn_ptr p;} WgClientMsg_list;
+typedef struct {capn_ptr p;} WgIpv4Addr_list;
+typedef struct {capn_ptr p;} WgIpv6Addr_list;
+typedef struct {capn_ptr p;} WgServerSimpleMsg_list;
+
+enum WgClientMsg_WgClientRequestType {
+ WgClientMsg_WgClientRequestType_simple = 0
+};
+
+struct WgClientMsg {
+ enum WgClientMsg_WgClientRequestType request;
+};
+
+static const size_t WgClientMsg_word_count = 1;
+
+static const size_t WgClientMsg_pointer_count = 0;
+
+static const size_t WgClientMsg_struct_bytes_count = 8;
+
+struct WgIpv4Addr {
+ uint32_t addr;
+ uint8_t cidr;
+};
+
+static const size_t WgIpv4Addr_word_count = 1;
+
+static const size_t WgIpv4Addr_pointer_count = 0;
+
+static const size_t WgIpv4Addr_struct_bytes_count = 8;
+
+struct WgIpv6Addr {
+ capn_data addr;
+ uint8_t cidr;
+};
+
+static const size_t WgIpv6Addr_word_count = 1;
+
+static const size_t WgIpv6Addr_pointer_count = 1;
+
+static const size_t WgIpv6Addr_struct_bytes_count = 16;
+
+struct WgServerSimpleMsg {
+ WgIpv4Addr_ptr leasedIpv4;
+ uint32_t leaseTimeout;
+ WgIpv4Addr_list ipv4Routes;
+};
+
+static const size_t WgServerSimpleMsg_word_count = 1;
+
+static const size_t WgServerSimpleMsg_pointer_count = 2;
+
+static const size_t WgServerSimpleMsg_struct_bytes_count = 24;
+
+WgClientMsg_ptr new_WgClientMsg(struct capn_segment*);
+WgIpv4Addr_ptr new_WgIpv4Addr(struct capn_segment*);
+WgIpv6Addr_ptr new_WgIpv6Addr(struct capn_segment*);
+WgServerSimpleMsg_ptr new_WgServerSimpleMsg(struct capn_segment*);
+
+WgClientMsg_list new_WgClientMsg_list(struct capn_segment*, int len);
+WgIpv4Addr_list new_WgIpv4Addr_list(struct capn_segment*, int len);
+WgIpv6Addr_list new_WgIpv6Addr_list(struct capn_segment*, int len);
+WgServerSimpleMsg_list new_WgServerSimpleMsg_list(struct capn_segment*, int len);
+
+void read_WgClientMsg(struct WgClientMsg*, WgClientMsg_ptr);
+void read_WgIpv4Addr(struct WgIpv4Addr*, WgIpv4Addr_ptr);
+void read_WgIpv6Addr(struct WgIpv6Addr*, WgIpv6Addr_ptr);
+void read_WgServerSimpleMsg(struct WgServerSimpleMsg*, WgServerSimpleMsg_ptr);
+
+void write_WgClientMsg(const struct WgClientMsg*, WgClientMsg_ptr);
+void write_WgIpv4Addr(const struct WgIpv4Addr*, WgIpv4Addr_ptr);
+void write_WgIpv6Addr(const struct WgIpv6Addr*, WgIpv6Addr_ptr);
+void write_WgServerSimpleMsg(const struct WgServerSimpleMsg*, WgServerSimpleMsg_ptr);
+
+void get_WgClientMsg(struct WgClientMsg*, WgClientMsg_list, int i);
+void get_WgIpv4Addr(struct WgIpv4Addr*, WgIpv4Addr_list, int i);
+void get_WgIpv6Addr(struct WgIpv6Addr*, WgIpv6Addr_list, int i);
+void get_WgServerSimpleMsg(struct WgServerSimpleMsg*, WgServerSimpleMsg_list, int i);
+
+void set_WgClientMsg(const struct WgClientMsg*, WgClientMsg_list, int i);
+void set_WgIpv4Addr(const struct WgIpv4Addr*, WgIpv4Addr_list, int i);
+void set_WgIpv6Addr(const struct WgIpv6Addr*, WgIpv6Addr_list, int i);
+void set_WgServerSimpleMsg(const struct WgServerSimpleMsg*, WgServerSimpleMsg_list, int i);
+
+#ifdef __cplusplus
+}
+#endif
+#endif