#include "netlink.h"
#include "device.h"
#include "peer.h"
#include "socket.h"
#include "queueing.h"
#include "messages.h"
#include <uapi/linux/wireguard.h>
#include <linux/if.h>
#include <net/genetlink.h>
#include <net/sock.h>
#include <crypto/utils.h>
static struct genl_family genl_family;
static const struct nla_policy device_policy[WGDEVICE_A_MAX + 1] = …;
static const struct nla_policy peer_policy[WGPEER_A_MAX + 1] = …;
static const struct nla_policy allowedip_policy[WGALLOWEDIP_A_MAX + 1] = …;
static struct wg_device *lookup_interface(struct nlattr **attrs,
struct sk_buff *skb)
{ … }
static int get_allowedips(struct sk_buff *skb, const u8 *ip, u8 cidr,
int family)
{ … }
struct dump_ctx { … };
#define DUMP_CTX(cb) …
static int
get_peer(struct wg_peer *peer, struct sk_buff *skb, struct dump_ctx *ctx)
{ … }
static int wg_get_device_start(struct netlink_callback *cb)
{ … }
static int wg_get_device_dump(struct sk_buff *skb, struct netlink_callback *cb)
{ … }
static int wg_get_device_done(struct netlink_callback *cb)
{ … }
static int set_port(struct wg_device *wg, u16 port)
{ … }
static int set_allowedip(struct wg_peer *peer, struct nlattr **attrs)
{ … }
static int set_peer(struct wg_device *wg, struct nlattr **attrs)
{ … }
static int wg_set_device(struct sk_buff *skb, struct genl_info *info)
{ … }
static const struct genl_ops genl_ops[] = …;
static struct genl_family genl_family __ro_after_init = …;
int __init wg_genetlink_init(void)
{ … }
void __exit wg_genetlink_uninit(void)
{ … }