diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2015-06-05 15:58:00 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2016-06-25 16:48:39 +0200 |
commit | 99d303ac2739e65a02fbbc325b74ad6fcac63cc2 (patch) | |
tree | 6f4095f42d3d298cdd5ab8bc6f8ed89d9673b38b /src/main.c | |
download | wireguard-monolithic-historical-99d303ac2739e65a02fbbc325b74ad6fcac63cc2.tar.xz wireguard-monolithic-historical-99d303ac2739e65a02fbbc325b74ad6fcac63cc2.zip |
Initial commit
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c new file mode 100644 index 0000000..bcc432a --- /dev/null +++ b/src/main.c @@ -0,0 +1,50 @@ +/* Copyright 2015-2016 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved. */ + +#include "wireguard.h" +#include "device.h" +#include "crypto/chacha20poly1305.h" +#include "crypto/blake2s.h" +#include "crypto/siphash24.h" +#include "crypto/curve25519.h" +#include "noise.h" +#include "packets.h" +#include <linux/init.h> +#include <linux/module.h> +#include <net/rtnetlink.h> + +static int __init mod_init(void) +{ + int ret = 0; + +#ifdef DEBUG + routing_table_selftest(); + packet_counter_selftest(); + curve25519_selftest(); + chacha20poly1305_selftest(); + blake2s_selftest(); + siphash24_selftest(); +#endif + chacha20poly1305_init(); + noise_init(); + + ret = device_init(); + if (ret < 0) + return ret; + + pr_info("WireGuard loaded. See www.wireguard.io for information.\n"); + pr_info("(C) Copyright 2015-2016 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.\n"); + return ret; +} + +static void __exit mod_exit(void) +{ + device_uninit(); + pr_debug("Wireguard has been unloaded\n"); +} + +module_init(mod_init); +module_exit(mod_exit); +MODULE_LICENSE("GPL v2"); +MODULE_DESCRIPTION("Simple, secure, and speedy VPN tunnel"); +MODULE_AUTHOR("Jason A. Donenfeld <Jason@zx2c4.com>"); +MODULE_ALIAS_RTNL_LINK(KBUILD_MODNAME); |