linux/net/ipv6/anycast.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 *	Anycast support for IPv6
 *	Linux INET6 implementation
 *
 *	Authors:
 *	David L Stevens ([email protected])
 *
 *	based heavily on net/ipv6/mcast.c
 */

#include <linux/capability.h>
#include <linux/module.h>
#include <linux/errno.h>
#include <linux/types.h>
#include <linux/random.h>
#include <linux/string.h>
#include <linux/socket.h>
#include <linux/sockios.h>
#include <linux/net.h>
#include <linux/in6.h>
#include <linux/netdevice.h>
#include <linux/if_arp.h>
#include <linux/route.h>
#include <linux/init.h>
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include <linux/slab.h>

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

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

#include <net/checksum.h>

#define IN6_ADDR_HSIZE_SHIFT
#define IN6_ADDR_HSIZE
/*	anycast address hash table
 */
static struct hlist_head inet6_acaddr_lst[IN6_ADDR_HSIZE];
static DEFINE_SPINLOCK(acaddr_hash_lock);

static int ipv6_dev_ac_dec(struct net_device *dev, const struct in6_addr *addr);

static u32 inet6_acaddr_hash(struct net *net, const struct in6_addr *addr)
{}

/*
 *	socket join an anycast group
 */

int ipv6_sock_ac_join(struct sock *sk, int ifindex, const struct in6_addr *addr)
{}

/*
 *	socket leave an anycast group
 */
int ipv6_sock_ac_drop(struct sock *sk, int ifindex, const struct in6_addr *addr)
{}

void __ipv6_sock_ac_close(struct sock *sk)
{}

void ipv6_sock_ac_close(struct sock *sk)
{}

static void ipv6_add_acaddr_hash(struct net *net, struct ifacaddr6 *aca)
{}

static void ipv6_del_acaddr_hash(struct ifacaddr6 *aca)
{}

static void aca_get(struct ifacaddr6 *aca)
{}

static void aca_free_rcu(struct rcu_head *h)
{}

static void aca_put(struct ifacaddr6 *ac)
{}

static struct ifacaddr6 *aca_alloc(struct fib6_info *f6i,
				   const struct in6_addr *addr)
{}

/*
 *	device anycast group inc (add if not found)
 */
int __ipv6_dev_ac_inc(struct inet6_dev *idev, const struct in6_addr *addr)
{}

/*
 *	device anycast group decrement
 */
int __ipv6_dev_ac_dec(struct inet6_dev *idev, const struct in6_addr *addr)
{}

/* called with rtnl_lock() */
static int ipv6_dev_ac_dec(struct net_device *dev, const struct in6_addr *addr)
{}

void ipv6_ac_destroy_dev(struct inet6_dev *idev)
{}

/*
 *	check if the interface has this anycast address
 *	called with rcu_read_lock()
 */
static bool ipv6_chk_acast_dev(struct net_device *dev, const struct in6_addr *addr)
{}

/*
 *	check if given interface (or any, if dev==0) has this anycast address
 */
bool ipv6_chk_acast_addr(struct net *net, struct net_device *dev,
			 const struct in6_addr *addr)
{}

/*	check if this anycast address is link-local on given interface or
 *	is global
 */
bool ipv6_chk_acast_addr_src(struct net *net, struct net_device *dev,
			     const struct in6_addr *addr)
{}

#ifdef CONFIG_PROC_FS
struct ac6_iter_state {};

#define ac6_seq_private(seq)

static inline struct ifacaddr6 *ac6_get_first(struct seq_file *seq)
{}

static struct ifacaddr6 *ac6_get_next(struct seq_file *seq, struct ifacaddr6 *im)
{}

static struct ifacaddr6 *ac6_get_idx(struct seq_file *seq, loff_t pos)
{}

static void *ac6_seq_start(struct seq_file *seq, loff_t *pos)
	__acquires(RCU)
{}

static void *ac6_seq_next(struct seq_file *seq, void *v, loff_t *pos)
{}

static void ac6_seq_stop(struct seq_file *seq, void *v)
	__releases(RCU)
{}

static int ac6_seq_show(struct seq_file *seq, void *v)
{}

static const struct seq_operations ac6_seq_ops =;

int __net_init ac6_proc_init(struct net *net)
{}

void ac6_proc_exit(struct net *net)
{}
#endif

/*	Init / cleanup code
 */
int __init ipv6_anycast_init(void)
{}

void ipv6_anycast_cleanup(void)
{}