linux/net/l2tp/l2tp_netlink.c

// SPDX-License-Identifier: GPL-2.0-only
/* L2TP netlink layer, for management
 *
 * Copyright (c) 2008,2009,2010 Katalix Systems Ltd
 *
 * Partly based on the IrDA nelink implementation
 * (see net/irda/irnetlink.c) which is:
 * Copyright (c) 2007 Samuel Ortiz <[email protected]>
 * which is in turn partly based on the wireless netlink code:
 * Copyright 2006 Johannes Berg <[email protected]>
 */

#define pr_fmt(fmt)

#include <net/sock.h>
#include <net/genetlink.h>
#include <net/udp.h>
#include <linux/in.h>
#include <linux/udp.h>
#include <linux/socket.h>
#include <linux/module.h>
#include <linux/list.h>
#include <net/net_namespace.h>

#include <linux/l2tp.h>

#include "l2tp_core.h"

static struct genl_family l2tp_nl_family;

static const struct genl_multicast_group l2tp_multicast_group[] =;

static int l2tp_nl_tunnel_send(struct sk_buff *skb, u32 portid, u32 seq,
			       int flags, struct l2tp_tunnel *tunnel, u8 cmd);
static int l2tp_nl_session_send(struct sk_buff *skb, u32 portid, u32 seq,
				int flags, struct l2tp_session *session,
				u8 cmd);

/* Accessed under genl lock */
static const struct l2tp_nl_cmd_ops *l2tp_nl_cmd_ops[__L2TP_PWTYPE_MAX];

static struct l2tp_session *l2tp_nl_session_get(struct genl_info *info)
{}

static int l2tp_nl_cmd_noop(struct sk_buff *skb, struct genl_info *info)
{}

static int l2tp_tunnel_notify(struct genl_family *family,
			      struct genl_info *info,
			      struct l2tp_tunnel *tunnel,
			      u8 cmd)
{}

static int l2tp_session_notify(struct genl_family *family,
			       struct genl_info *info,
			       struct l2tp_session *session,
			       u8 cmd)
{}

static int l2tp_nl_cmd_tunnel_create_get_addr(struct nlattr **attrs, struct l2tp_tunnel_cfg *cfg)
{}

static int l2tp_nl_cmd_tunnel_create(struct sk_buff *skb, struct genl_info *info)
{}

static int l2tp_nl_cmd_tunnel_delete(struct sk_buff *skb, struct genl_info *info)
{}

static int l2tp_nl_cmd_tunnel_modify(struct sk_buff *skb, struct genl_info *info)
{}

#if IS_ENABLED(CONFIG_IPV6)
static int l2tp_nl_tunnel_send_addr6(struct sk_buff *skb, struct sock *sk,
				     enum l2tp_encap_type encap)
{}
#endif

static int l2tp_nl_tunnel_send_addr4(struct sk_buff *skb, struct sock *sk,
				     enum l2tp_encap_type encap)
{}

/* Append attributes for the tunnel address, handling the different attribute types
 * used for different tunnel encapsulation and AF_INET v.s. AF_INET6.
 */
static int l2tp_nl_tunnel_send_addr(struct sk_buff *skb, struct l2tp_tunnel *tunnel)
{}

static int l2tp_nl_tunnel_send(struct sk_buff *skb, u32 portid, u32 seq, int flags,
			       struct l2tp_tunnel *tunnel, u8 cmd)
{}

static int l2tp_nl_cmd_tunnel_get(struct sk_buff *skb, struct genl_info *info)
{}

static int l2tp_nl_cmd_tunnel_dump(struct sk_buff *skb, struct netlink_callback *cb)
{}

static int l2tp_nl_cmd_session_create(struct sk_buff *skb, struct genl_info *info)
{}

static int l2tp_nl_cmd_session_delete(struct sk_buff *skb, struct genl_info *info)
{}

static int l2tp_nl_cmd_session_modify(struct sk_buff *skb, struct genl_info *info)
{}

static int l2tp_nl_session_send(struct sk_buff *skb, u32 portid, u32 seq, int flags,
				struct l2tp_session *session, u8 cmd)
{}

static int l2tp_nl_cmd_session_get(struct sk_buff *skb, struct genl_info *info)
{}

static int l2tp_nl_cmd_session_dump(struct sk_buff *skb, struct netlink_callback *cb)
{}

static const struct nla_policy l2tp_nl_policy[L2TP_ATTR_MAX + 1] =;

static const struct genl_small_ops l2tp_nl_ops[] =;

static struct genl_family l2tp_nl_family __ro_after_init =;

int l2tp_nl_register_ops(enum l2tp_pwtype pw_type, const struct l2tp_nl_cmd_ops *ops)
{}
EXPORT_SYMBOL_GPL();

void l2tp_nl_unregister_ops(enum l2tp_pwtype pw_type)
{}
EXPORT_SYMBOL_GPL();

static int __init l2tp_nl_init(void)
{}

static void l2tp_nl_cleanup(void)
{}

module_init();
module_exit(l2tp_nl_cleanup);

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();
MODULE_VERSION();
MODULE_ALIAS_GENL_FAMILY();