1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (C) 2015-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
10 #include "ratelimiter.h"
13 #include <uapi/linux/wireguard.h>
15 #include <linux/init.h>
16 #include <linux/module.h>
17 #include <net/genetlink.h>
18 #include <net/rtnetlink.h>
20 static int __init
wg_mod_init(void)
24 ret
= wg_allowedips_slab_init();
29 ret
= -ENOTRECOVERABLE
;
30 if (!wg_allowedips_selftest() || !wg_packet_counter_selftest() ||
31 !wg_ratelimiter_selftest())
40 ret
= wg_device_init();
44 ret
= wg_genetlink_init();
48 pr_info("WireGuard " WIREGUARD_VERSION
" loaded. See www.wireguard.com for information.\n");
49 pr_info("Copyright (C) 2015-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.\n");
58 wg_allowedips_slab_uninit();
63 static void __exit
wg_mod_exit(void)
65 wg_genetlink_uninit();
68 wg_allowedips_slab_uninit();
71 module_init(wg_mod_init
);
72 module_exit(wg_mod_exit
);
73 MODULE_LICENSE("GPL v2");
74 MODULE_DESCRIPTION("WireGuard secure network tunnel");
75 MODULE_AUTHOR("Jason A. Donenfeld <Jason@zx2c4.com>");
76 MODULE_VERSION(WIREGUARD_VERSION
);
77 MODULE_ALIAS_RTNL_LINK(KBUILD_MODNAME
);
78 MODULE_ALIAS_GENL_FAMILY(WG_GENL_NAME
);