linux/net/ipv6/ip6_flowlabel.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 *	ip6_flowlabel.c		IPv6 flowlabel manager.
 *
 *	Authors:	Alexey Kuznetsov, <[email protected]>
 */

#include <linux/capability.h>
#include <linux/errno.h>
#include <linux/types.h>
#include <linux/socket.h>
#include <linux/net.h>
#include <linux/netdevice.h>
#include <linux/in6.h>
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include <linux/slab.h>
#include <linux/export.h>
#include <linux/pid_namespace.h>
#include <linux/jump_label_ratelimit.h>

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

#include <net/ipv6.h>
#include <net/rawv6.h>
#include <net/transp_v6.h>

#include <linux/uaccess.h>

#define FL_MIN_LINGER
#define FL_MAX_LINGER

/* FL hash table */

#define FL_MAX_PER_SOCK
#define FL_MAX_SIZE
#define FL_HASH_MASK
#define FL_HASH(l)

static atomic_t fl_size =;
static struct ip6_flowlabel __rcu *fl_ht[FL_HASH_MASK+1];

static void ip6_fl_gc(struct timer_list *unused);
static DEFINE_TIMER(ip6_fl_gc_timer, ip6_fl_gc);

/* FL hash table lock: it protects only of GC */

static DEFINE_SPINLOCK(ip6_fl_lock);

/* Big socket sock */

static DEFINE_SPINLOCK(ip6_sk_fl_lock);

DEFINE_STATIC_KEY_DEFERRED_FALSE();
EXPORT_SYMBOL();

#define for_each_fl_rcu(hash, fl)
#define for_each_fl_continue_rcu(fl)

#define for_each_sk_fl_rcu(np, sfl)

static inline struct ip6_flowlabel *__fl_lookup(struct net *net, __be32 label)
{}

static struct ip6_flowlabel *fl_lookup(struct net *net, __be32 label)
{}

static bool fl_shared_exclusive(struct ip6_flowlabel *fl)
{}

static void fl_free_rcu(struct rcu_head *head)
{}


static void fl_free(struct ip6_flowlabel *fl)
{}

static void fl_release(struct ip6_flowlabel *fl)
{}

static void ip6_fl_gc(struct timer_list *unused)
{}

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

static struct ip6_flowlabel *fl_intern(struct net *net,
				       struct ip6_flowlabel *fl, __be32 label)
{}



/* Socket flowlabel lists */

struct ip6_flowlabel *__fl6_sock_lookup(struct sock *sk, __be32 label)
{}
EXPORT_SYMBOL_GPL();

void fl6_free_socklist(struct sock *sk)
{}

/* Service routines */


/*
   It is the only difficult place. flowlabel enforces equal headers
   before and including routing header, however user may supply options
   following rthdr.
 */

struct ipv6_txoptions *fl6_merge_options(struct ipv6_txoptions *opt_space,
					 struct ip6_flowlabel *fl,
					 struct ipv6_txoptions *fopt)
{}
EXPORT_SYMBOL_GPL();

static unsigned long check_linger(unsigned long ttl)
{}

static int fl6_renew(struct ip6_flowlabel *fl, unsigned long linger, unsigned long expires)
{}

static struct ip6_flowlabel *
fl_create(struct net *net, struct sock *sk, struct in6_flowlabel_req *freq,
	  sockptr_t optval, int optlen, int *err_p)
{}

static int mem_check(struct sock *sk)
{}

static inline void fl_link(struct ipv6_pinfo *np, struct ipv6_fl_socklist *sfl,
		struct ip6_flowlabel *fl)
{}

int ipv6_flowlabel_opt_get(struct sock *sk, struct in6_flowlabel_req *freq,
			   int flags)
{}

#define socklist_dereference(__sflp)

static int ipv6_flowlabel_put(struct sock *sk, struct in6_flowlabel_req *freq)
{}

static int ipv6_flowlabel_renew(struct sock *sk, struct in6_flowlabel_req *freq)
{}

static int ipv6_flowlabel_get(struct sock *sk, struct in6_flowlabel_req *freq,
		sockptr_t optval, int optlen)
{}

int ipv6_flowlabel_opt(struct sock *sk, sockptr_t optval, int optlen)
{}

#ifdef CONFIG_PROC_FS

struct ip6fl_iter_state {};

#define ip6fl_seq_private(seq)

static struct ip6_flowlabel *ip6fl_get_first(struct seq_file *seq)
{}

static struct ip6_flowlabel *ip6fl_get_next(struct seq_file *seq, struct ip6_flowlabel *fl)
{}

static struct ip6_flowlabel *ip6fl_get_idx(struct seq_file *seq, loff_t pos)
{}

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

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

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

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

static const struct seq_operations ip6fl_seq_ops =;

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

static void __net_exit ip6_flowlabel_proc_fini(struct net *net)
{}
#else
static inline int ip6_flowlabel_proc_init(struct net *net)
{
	return 0;
}
static inline void ip6_flowlabel_proc_fini(struct net *net)
{
}
#endif

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

static struct pernet_operations ip6_flowlabel_net_ops =;

int ip6_flowlabel_init(void)
{}

void ip6_flowlabel_cleanup(void)
{}