linux/net/ipv6/af_inet6.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 *	PF_INET6 socket protocol family
 *	Linux INET6 implementation
 *
 *	Authors:
 *	Pedro Roque		<[email protected]>
 *
 *	Adapted from linux/net/ipv4/af_inet.c
 *
 *	Fixes:
 *	piggy, Karl Knutson	:	Socket protocol table
 *	Hideaki YOSHIFUJI	:	sin6_scope_id support
 *	Arnaldo Melo		:	check proc_net_create return, cleanups
 */

#define pr_fmt(fmt)

#include <linux/module.h>
#include <linux/capability.h>
#include <linux/errno.h>
#include <linux/types.h>
#include <linux/socket.h>
#include <linux/in.h>
#include <linux/kernel.h>
#include <linux/timer.h>
#include <linux/string.h>
#include <linux/sockios.h>
#include <linux/net.h>
#include <linux/fcntl.h>
#include <linux/mm.h>
#include <linux/interrupt.h>
#include <linux/proc_fs.h>
#include <linux/stat.h>
#include <linux/init.h>
#include <linux/slab.h>

#include <linux/inet.h>
#include <linux/netdevice.h>
#include <linux/icmpv6.h>
#include <linux/netfilter_ipv6.h>

#include <net/ip.h>
#include <net/ipv6.h>
#include <net/udp.h>
#include <net/udplite.h>
#include <net/tcp.h>
#include <net/ping.h>
#include <net/protocol.h>
#include <net/inet_common.h>
#include <net/route.h>
#include <net/transp_v6.h>
#include <net/ip6_route.h>
#include <net/addrconf.h>
#include <net/ipv6_stubs.h>
#include <net/ndisc.h>
#ifdef CONFIG_IPV6_TUNNEL
#include <net/ip6_tunnel.h>
#endif
#include <net/calipso.h>
#include <net/seg6.h>
#include <net/rpl.h>
#include <net/compat.h>
#include <net/xfrm.h>
#include <net/ioam6.h>
#include <net/rawv6.h>
#include <net/rps.h>

#include <linux/uaccess.h>
#include <linux/mroute6.h>

#include "ip6_offload.h"

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();

/* The inetsw6 table contains everything that inet6_create needs to
 * build a new socket.
 */
static struct list_head inetsw6[SOCK_MAX];
static DEFINE_SPINLOCK(inetsw6_lock);

struct ipv6_params ipv6_defaults =;

static int disable_ipv6_mod;

module_param_named(disable, disable_ipv6_mod, int, 0444);
MODULE_PARM_DESC();

module_param_named(disable_ipv6, ipv6_defaults.disable_ipv6, int, 0444);
MODULE_PARM_DESC();

module_param_named(autoconf, ipv6_defaults.autoconf, int, 0444);
MODULE_PARM_DESC();

bool ipv6_mod_enabled(void)
{}
EXPORT_SYMBOL_GPL();

static struct ipv6_pinfo *inet6_sk_generic(struct sock *sk)
{}

void inet6_sock_destruct(struct sock *sk)
{}
EXPORT_SYMBOL_GPL();

static int inet6_create(struct net *net, struct socket *sock, int protocol,
			int kern)
{}

static int __inet6_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len,
			u32 flags)
{}

int inet6_bind_sk(struct sock *sk, struct sockaddr *uaddr, int addr_len)
{}

/* bind for INET6 API */
int inet6_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
{}
EXPORT_SYMBOL();

int inet6_release(struct socket *sock)
{}
EXPORT_SYMBOL();

void inet6_cleanup_sock(struct sock *sk)
{}
EXPORT_SYMBOL_GPL();

/*
 *	This does both peername and sockname.
 */
int inet6_getname(struct socket *sock, struct sockaddr *uaddr,
		  int peer)
{}
EXPORT_SYMBOL();

int inet6_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
{}
EXPORT_SYMBOL();

#ifdef CONFIG_COMPAT
struct compat_in6_rtmsg {};

static int inet6_compat_routing_ioctl(struct sock *sk, unsigned int cmd,
		struct compat_in6_rtmsg __user *ur)
{}

int inet6_compat_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
{}
EXPORT_SYMBOL_GPL();
#endif /* CONFIG_COMPAT */

INDIRECT_CALLABLE_DECLARE();
int inet6_sendmsg(struct socket *sock, struct msghdr *msg, size_t size)
{}

INDIRECT_CALLABLE_DECLARE();
int inet6_recvmsg(struct socket *sock, struct msghdr *msg, size_t size,
		  int flags)
{}

const struct proto_ops inet6_stream_ops =;

const struct proto_ops inet6_dgram_ops =;

static const struct net_proto_family inet6_family_ops =;

int inet6_register_protosw(struct inet_protosw *p)
{}
EXPORT_SYMBOL();

void
inet6_unregister_protosw(struct inet_protosw *p)
{}
EXPORT_SYMBOL();

int inet6_sk_rebuild_header(struct sock *sk)
{}
EXPORT_SYMBOL_GPL();

bool ipv6_opt_accepted(const struct sock *sk, const struct sk_buff *skb,
		       const struct inet6_skb_parm *opt)
{}
EXPORT_SYMBOL_GPL();

static struct packet_type ipv6_packet_type __read_mostly =;

static int __init ipv6_packet_init(void)
{}

static void ipv6_packet_cleanup(void)
{}

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

static void ipv6_cleanup_mibs(struct net *net)
{}

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

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

static struct pernet_operations inet6_net_ops =;

static int ipv6_route_input(struct sk_buff *skb)
{}

static const struct ipv6_stub ipv6_stub_impl =;

static const struct ipv6_bpf_stub ipv6_bpf_stub_impl =;

static int __init inet6_init(void)
{}
module_init();

MODULE_ALIAS_NETPROTO();