linux/net/ipv6/ndisc.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 *	Neighbour Discovery for IPv6
 *	Linux INET6 implementation
 *
 *	Authors:
 *	Pedro Roque		<[email protected]>
 *	Mike Shaver		<[email protected]>
 */

/*
 *	Changes:
 *
 *	Alexey I. Froloff		:	RFC6106 (DNSSL) support
 *	Pierre Ynard			:	export userland ND options
 *						through netlink (RDNSS support)
 *	Lars Fenneberg			:	fixed MTU setting on receipt
 *						of an RA.
 *	Janos Farkas			:	kmalloc failure checks
 *	Alexey Kuznetsov		:	state machine reworked
 *						and moved to net/core.
 *	Pekka Savola			:	RFC2461 validation
 *	YOSHIFUJI Hideaki @USAGI	:	Verify ND options properly
 */

#define pr_fmt(fmt)

#include <linux/module.h>
#include <linux/errno.h>
#include <linux/types.h>
#include <linux/socket.h>
#include <linux/sockios.h>
#include <linux/sched.h>
#include <linux/net.h>
#include <linux/in6.h>
#include <linux/route.h>
#include <linux/init.h>
#include <linux/rcupdate.h>
#include <linux/slab.h>
#ifdef CONFIG_SYSCTL
#include <linux/sysctl.h>
#endif

#include <linux/if_addr.h>
#include <linux/if_ether.h>
#include <linux/if_arp.h>
#include <linux/ipv6.h>
#include <linux/icmpv6.h>
#include <linux/jhash.h>

#include <net/sock.h>
#include <net/snmp.h>

#include <net/ipv6.h>
#include <net/protocol.h>
#include <net/ndisc.h>
#include <net/ip6_route.h>
#include <net/addrconf.h>
#include <net/icmp.h>

#include <net/netlink.h>
#include <linux/rtnetlink.h>

#include <net/flow.h>
#include <net/ip6_checksum.h>
#include <net/inet_common.h>
#include <linux/proc_fs.h>

#include <linux/netfilter.h>
#include <linux/netfilter_ipv6.h>

static u32 ndisc_hash(const void *pkey,
		      const struct net_device *dev,
		      __u32 *hash_rnd);
static bool ndisc_key_eq(const struct neighbour *neigh, const void *pkey);
static bool ndisc_allow_add(const struct net_device *dev,
			    struct netlink_ext_ack *extack);
static int ndisc_constructor(struct neighbour *neigh);
static void ndisc_solicit(struct neighbour *neigh, struct sk_buff *skb);
static void ndisc_error_report(struct neighbour *neigh, struct sk_buff *skb);
static int pndisc_constructor(struct pneigh_entry *n);
static void pndisc_destructor(struct pneigh_entry *n);
static void pndisc_redo(struct sk_buff *skb);
static int ndisc_is_multicast(const void *pkey);

static const struct neigh_ops ndisc_generic_ops =;

static const struct neigh_ops ndisc_hh_ops =;


static const struct neigh_ops ndisc_direct_ops =;

struct neigh_table nd_tbl =;
EXPORT_SYMBOL_GPL();

void __ndisc_fill_addr_option(struct sk_buff *skb, int type, const void *data,
			      int data_len, int pad)
{}
EXPORT_SYMBOL_GPL();

static inline void ndisc_fill_addr_option(struct sk_buff *skb, int type,
					  const void *data, u8 icmp6_type)
{}

static inline void ndisc_fill_redirect_addr_option(struct sk_buff *skb,
						   void *ha,
						   const u8 *ops_data)
{}

static struct nd_opt_hdr *ndisc_next_option(struct nd_opt_hdr *cur,
					    struct nd_opt_hdr *end)
{}

static inline int ndisc_is_useropt(const struct net_device *dev,
				   struct nd_opt_hdr *opt)
{}

static struct nd_opt_hdr *ndisc_next_useropt(const struct net_device *dev,
					     struct nd_opt_hdr *cur,
					     struct nd_opt_hdr *end)
{}

struct ndisc_options *ndisc_parse_options(const struct net_device *dev,
					  u8 *opt, int opt_len,
					  struct ndisc_options *ndopts)
{}

int ndisc_mc_map(const struct in6_addr *addr, char *buf, struct net_device *dev, int dir)
{}
EXPORT_SYMBOL();

static u32 ndisc_hash(const void *pkey,
		      const struct net_device *dev,
		      __u32 *hash_rnd)
{}

static bool ndisc_key_eq(const struct neighbour *n, const void *pkey)
{}

static int ndisc_constructor(struct neighbour *neigh)
{}

static int pndisc_constructor(struct pneigh_entry *n)
{}

static void pndisc_destructor(struct pneigh_entry *n)
{}

/* called with rtnl held */
static bool ndisc_allow_add(const struct net_device *dev,
			    struct netlink_ext_ack *extack)
{}

static struct sk_buff *ndisc_alloc_skb(struct net_device *dev,
				       int len)
{}

static void ip6_nd_hdr(struct sk_buff *skb,
		       const struct in6_addr *saddr,
		       const struct in6_addr *daddr,
		       int hop_limit, int len)
{}

void ndisc_send_skb(struct sk_buff *skb, const struct in6_addr *daddr,
		    const struct in6_addr *saddr)
{}
EXPORT_SYMBOL();

void ndisc_send_na(struct net_device *dev, const struct in6_addr *daddr,
		   const struct in6_addr *solicited_addr,
		   bool router, bool solicited, bool override, bool inc_opt)
{}

static void ndisc_send_unsol_na(struct net_device *dev)
{}

struct sk_buff *ndisc_ns_create(struct net_device *dev, const struct in6_addr *solicit,
				const struct in6_addr *saddr, u64 nonce)
{}
EXPORT_SYMBOL();

void ndisc_send_ns(struct net_device *dev, const struct in6_addr *solicit,
		   const struct in6_addr *daddr, const struct in6_addr *saddr,
		   u64 nonce)
{}

void ndisc_send_rs(struct net_device *dev, const struct in6_addr *saddr,
		   const struct in6_addr *daddr)
{}


static void ndisc_error_report(struct neighbour *neigh, struct sk_buff *skb)
{}

/* Called with locked neigh: either read or both */

static void ndisc_solicit(struct neighbour *neigh, struct sk_buff *skb)
{}

static int pndisc_is_router(const void *pkey,
			    struct net_device *dev)
{}

void ndisc_update(const struct net_device *dev, struct neighbour *neigh,
		  const u8 *lladdr, u8 new, u32 flags, u8 icmp6_type,
		  struct ndisc_options *ndopts)
{}

static enum skb_drop_reason ndisc_recv_ns(struct sk_buff *skb)
{}

static int accept_untracked_na(struct net_device *dev, struct in6_addr *saddr)
{}

static enum skb_drop_reason ndisc_recv_na(struct sk_buff *skb)
{}

static enum skb_drop_reason ndisc_recv_rs(struct sk_buff *skb)
{}

static void ndisc_ra_useropt(struct sk_buff *ra, struct nd_opt_hdr *opt)
{}

static enum skb_drop_reason ndisc_router_discovery(struct sk_buff *skb)
{}

static enum skb_drop_reason ndisc_redirect_rcv(struct sk_buff *skb)
{}

static void ndisc_fill_redirect_hdr_option(struct sk_buff *skb,
					   struct sk_buff *orig_skb,
					   int rd_len)
{}

void ndisc_send_redirect(struct sk_buff *skb, const struct in6_addr *target)
{}

static void pndisc_redo(struct sk_buff *skb)
{}

static int ndisc_is_multicast(const void *pkey)
{}

static bool ndisc_suppress_frag_ndisc(struct sk_buff *skb)
{}

enum skb_drop_reason ndisc_rcv(struct sk_buff *skb)
{}

static int ndisc_netdev_event(struct notifier_block *this, unsigned long event, void *ptr)
{}

static struct notifier_block ndisc_netdev_notifier =;

#ifdef CONFIG_SYSCTL
static void ndisc_warn_deprecated_sysctl(const struct ctl_table *ctl,
					 const char *func, const char *dev_name)
{}

int ndisc_ifinfo_sysctl_change(const struct ctl_table *ctl, int write, void *buffer,
		size_t *lenp, loff_t *ppos)
{}


#endif

static int __net_init ndisc_net_init(struct net *net)
{}

static void __net_exit ndisc_net_exit(struct net *net)
{}

static struct pernet_operations ndisc_net_ops =;

int __init ndisc_init(void)
{}

int __init ndisc_late_init(void)
{}

void ndisc_late_cleanup(void)
{}

void ndisc_cleanup(void)
{}