Blame include/uapi/linux/in6.h

Packit Service 3880ab
/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
Packit Service 3880ab
/*
Packit Service 3880ab
 *	Types and definitions for AF_INET6 
Packit Service 3880ab
 *	Linux INET6 implementation 
Packit Service 3880ab
 *
Packit Service 3880ab
 *	Authors:
Packit Service 3880ab
 *	Pedro Roque		<roque@di.fc.ul.pt>	
Packit Service 3880ab
 *
Packit Service 3880ab
 *	Sources:
Packit Service 3880ab
 *	IPv6 Program Interfaces for BSD Systems
Packit Service 3880ab
 *      <draft-ietf-ipngwg-bsd-api-05.txt>
Packit Service 3880ab
 *
Packit Service 3880ab
 *	Advanced Sockets API for IPv6
Packit Service 3880ab
 *	<draft-stevens-advanced-api-00.txt>
Packit Service 3880ab
 *
Packit Service 3880ab
 *	This program is free software; you can redistribute it and/or
Packit Service 3880ab
 *      modify it under the terms of the GNU General Public License
Packit Service 3880ab
 *      as published by the Free Software Foundation; either version
Packit Service 3880ab
 *      2 of the License, or (at your option) any later version.
Packit Service 3880ab
 */
Packit Service 3880ab
Packit Service 3880ab
#ifndef _LINUX_IN6_H
Packit Service 3880ab
#define _LINUX_IN6_H
Packit Service 3880ab
Packit Service 3880ab
#include <linux/types.h>
Packit Service 3880ab
#include <linux/libc-compat.h>
Packit Service 3880ab
Packit Service 3880ab
/*
Packit Service 3880ab
 *	IPv6 address structure
Packit Service 3880ab
 */
Packit Service 3880ab
Packit Service 3880ab
#if __UAPI_DEF_IN6_ADDR
Packit Service 3880ab
struct in6_addr {
Packit Service 3880ab
	union {
Packit Service 3880ab
		__u8		u6_addr8[16];
Packit Service 3880ab
#if __UAPI_DEF_IN6_ADDR_ALT
Packit Service 3880ab
		__be16		u6_addr16[8];
Packit Service 3880ab
		__be32		u6_addr32[4];
Packit Service 3880ab
#endif
Packit Service 3880ab
	} in6_u;
Packit Service 3880ab
#define s6_addr			in6_u.u6_addr8
Packit Service 3880ab
#if __UAPI_DEF_IN6_ADDR_ALT
Packit Service 3880ab
#define s6_addr16		in6_u.u6_addr16
Packit Service 3880ab
#define s6_addr32		in6_u.u6_addr32
Packit Service 3880ab
#endif
Packit Service 3880ab
};
Packit Service 3880ab
#endif /* __UAPI_DEF_IN6_ADDR */
Packit Service 3880ab
Packit Service 3880ab
#if __UAPI_DEF_SOCKADDR_IN6
Packit Service 3880ab
struct sockaddr_in6 {
Packit Service 3880ab
	unsigned short int	sin6_family;    /* AF_INET6 */
Packit Service 3880ab
	__be16			sin6_port;      /* Transport layer port # */
Packit Service 3880ab
	__be32			sin6_flowinfo;  /* IPv6 flow information */
Packit Service 3880ab
	struct in6_addr		sin6_addr;      /* IPv6 address */
Packit Service 3880ab
	__u32			sin6_scope_id;  /* scope id (new in RFC2553) */
Packit Service 3880ab
};
Packit Service 3880ab
#endif /* __UAPI_DEF_SOCKADDR_IN6 */
Packit Service 3880ab
Packit Service 3880ab
#if __UAPI_DEF_IPV6_MREQ
Packit Service 3880ab
struct ipv6_mreq {
Packit Service 3880ab
	/* IPv6 multicast address of group */
Packit Service 3880ab
	struct in6_addr ipv6mr_multiaddr;
Packit Service 3880ab
Packit Service 3880ab
	/* local IPv6 address of interface */
Packit Service 3880ab
	int		ipv6mr_ifindex;
Packit Service 3880ab
};
Packit Service 3880ab
#endif /* __UAPI_DEF_IVP6_MREQ */
Packit Service 3880ab
Packit Service 3880ab
#define ipv6mr_acaddr	ipv6mr_multiaddr
Packit Service 3880ab
Packit Service 3880ab
struct in6_flowlabel_req {
Packit Service 3880ab
	struct in6_addr	flr_dst;
Packit Service 3880ab
	__be32	flr_label;
Packit Service 3880ab
	__u8	flr_action;
Packit Service 3880ab
	__u8	flr_share;
Packit Service 3880ab
	__u16	flr_flags;
Packit Service 3880ab
	__u16 	flr_expires;
Packit Service 3880ab
	__u16	flr_linger;
Packit Service 3880ab
	__u32	__flr_pad;
Packit Service 3880ab
	/* Options in format of IPV6_PKTOPTIONS */
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
#define IPV6_FL_A_GET	0
Packit Service 3880ab
#define IPV6_FL_A_PUT	1
Packit Service 3880ab
#define IPV6_FL_A_RENEW	2
Packit Service 3880ab
Packit Service 3880ab
#define IPV6_FL_F_CREATE	1
Packit Service 3880ab
#define IPV6_FL_F_EXCL		2
Packit Service 3880ab
#define IPV6_FL_F_REFLECT	4
Packit Service 3880ab
#define IPV6_FL_F_REMOTE	8
Packit Service 3880ab
Packit Service 3880ab
#define IPV6_FL_S_NONE		0
Packit Service 3880ab
#define IPV6_FL_S_EXCL		1
Packit Service 3880ab
#define IPV6_FL_S_PROCESS	2
Packit Service 3880ab
#define IPV6_FL_S_USER		3
Packit Service 3880ab
#define IPV6_FL_S_ANY		255
Packit Service 3880ab
Packit Service 3880ab
Packit Service 3880ab
/*
Packit Service 3880ab
 *	Bitmask constant declarations to help applications select out the 
Packit Service 3880ab
 *	flow label and priority fields.
Packit Service 3880ab
 *
Packit Service 3880ab
 *	Note that this are in host byte order while the flowinfo field of
Packit Service 3880ab
 *	sockaddr_in6 is in network byte order.
Packit Service 3880ab
 */
Packit Service 3880ab
Packit Service 3880ab
#define IPV6_FLOWINFO_FLOWLABEL		0x000fffff
Packit Service 3880ab
#define IPV6_FLOWINFO_PRIORITY		0x0ff00000
Packit Service 3880ab
Packit Service 3880ab
/* These definitions are obsolete */
Packit Service 3880ab
#define IPV6_PRIORITY_UNCHARACTERIZED	0x0000
Packit Service 3880ab
#define IPV6_PRIORITY_FILLER		0x0100
Packit Service 3880ab
#define IPV6_PRIORITY_UNATTENDED	0x0200
Packit Service 3880ab
#define IPV6_PRIORITY_RESERVED1		0x0300
Packit Service 3880ab
#define IPV6_PRIORITY_BULK		0x0400
Packit Service 3880ab
#define IPV6_PRIORITY_RESERVED2		0x0500
Packit Service 3880ab
#define IPV6_PRIORITY_INTERACTIVE	0x0600
Packit Service 3880ab
#define IPV6_PRIORITY_CONTROL		0x0700
Packit Service 3880ab
#define IPV6_PRIORITY_8			0x0800
Packit Service 3880ab
#define IPV6_PRIORITY_9			0x0900
Packit Service 3880ab
#define IPV6_PRIORITY_10		0x0a00
Packit Service 3880ab
#define IPV6_PRIORITY_11		0x0b00
Packit Service 3880ab
#define IPV6_PRIORITY_12		0x0c00
Packit Service 3880ab
#define IPV6_PRIORITY_13		0x0d00
Packit Service 3880ab
#define IPV6_PRIORITY_14		0x0e00
Packit Service 3880ab
#define IPV6_PRIORITY_15		0x0f00
Packit Service 3880ab
Packit Service 3880ab
/*
Packit Service 3880ab
 *	IPV6 extension headers
Packit Service 3880ab
 */
Packit Service 3880ab
#if __UAPI_DEF_IPPROTO_V6
Packit Service 3880ab
#define IPPROTO_HOPOPTS		0	/* IPv6 hop-by-hop options	*/
Packit Service 3880ab
#define IPPROTO_ROUTING		43	/* IPv6 routing header		*/
Packit Service 3880ab
#define IPPROTO_FRAGMENT	44	/* IPv6 fragmentation header	*/
Packit Service 3880ab
#define IPPROTO_ICMPV6		58	/* ICMPv6			*/
Packit Service 3880ab
#define IPPROTO_NONE		59	/* IPv6 no next header		*/
Packit Service 3880ab
#define IPPROTO_DSTOPTS		60	/* IPv6 destination options	*/
Packit Service 3880ab
#define IPPROTO_MH		135	/* IPv6 mobility header		*/
Packit Service 3880ab
#endif /* __UAPI_DEF_IPPROTO_V6 */
Packit Service 3880ab
Packit Service 3880ab
/*
Packit Service 3880ab
 *	IPv6 TLV options.
Packit Service 3880ab
 */
Packit Service 3880ab
#define IPV6_TLV_PAD1		0
Packit Service 3880ab
#define IPV6_TLV_PADN		1
Packit Service 3880ab
#define IPV6_TLV_ROUTERALERT	5
Packit Service 3880ab
#define IPV6_TLV_CALIPSO	7	/* RFC 5570 */
Packit Service 3880ab
#define IPV6_TLV_JUMBO		194
Packit Service 3880ab
#define IPV6_TLV_HAO		201	/* home address option */
Packit Service 3880ab
Packit Service 3880ab
/*
Packit Service 3880ab
 *	IPV6 socket options
Packit Service 3880ab
 */
Packit Service 3880ab
#if __UAPI_DEF_IPV6_OPTIONS
Packit Service 3880ab
#define IPV6_ADDRFORM		1
Packit Service 3880ab
#define IPV6_2292PKTINFO	2
Packit Service 3880ab
#define IPV6_2292HOPOPTS	3
Packit Service 3880ab
#define IPV6_2292DSTOPTS	4
Packit Service 3880ab
#define IPV6_2292RTHDR		5
Packit Service 3880ab
#define IPV6_2292PKTOPTIONS	6
Packit Service 3880ab
#define IPV6_CHECKSUM		7
Packit Service 3880ab
#define IPV6_2292HOPLIMIT	8
Packit Service 3880ab
#define IPV6_NEXTHOP		9
Packit Service 3880ab
#define IPV6_AUTHHDR		10	/* obsolete */
Packit Service 3880ab
#define IPV6_FLOWINFO		11
Packit Service 3880ab
Packit Service 3880ab
#define IPV6_UNICAST_HOPS	16
Packit Service 3880ab
#define IPV6_MULTICAST_IF	17
Packit Service 3880ab
#define IPV6_MULTICAST_HOPS	18
Packit Service 3880ab
#define IPV6_MULTICAST_LOOP	19
Packit Service 3880ab
#define IPV6_ADD_MEMBERSHIP	20
Packit Service 3880ab
#define IPV6_DROP_MEMBERSHIP	21
Packit Service 3880ab
#define IPV6_ROUTER_ALERT	22
Packit Service 3880ab
#define IPV6_MTU_DISCOVER	23
Packit Service 3880ab
#define IPV6_MTU		24
Packit Service 3880ab
#define IPV6_RECVERR		25
Packit Service 3880ab
#define IPV6_V6ONLY		26
Packit Service 3880ab
#define IPV6_JOIN_ANYCAST	27
Packit Service 3880ab
#define IPV6_LEAVE_ANYCAST	28
Packit Service 3880ab
#define IPV6_MULTICAST_ALL	29
Packit Service 3880ab
#define IPV6_ROUTER_ALERT_ISOLATE	30
Packit Service 3880ab
#define IPV6_RECVERR_RFC4884	31
Packit Service 3880ab
Packit Service 3880ab
/* IPV6_MTU_DISCOVER values */
Packit Service 3880ab
#define IPV6_PMTUDISC_DONT		0
Packit Service 3880ab
#define IPV6_PMTUDISC_WANT		1
Packit Service 3880ab
#define IPV6_PMTUDISC_DO		2
Packit Service 3880ab
#define IPV6_PMTUDISC_PROBE		3
Packit Service 3880ab
/* same as IPV6_PMTUDISC_PROBE, provided for symetry with IPv4
Packit Service 3880ab
 * also see comments on IP_PMTUDISC_INTERFACE
Packit Service 3880ab
 */
Packit Service 3880ab
#define IPV6_PMTUDISC_INTERFACE		4
Packit Service 3880ab
/* weaker version of IPV6_PMTUDISC_INTERFACE, which allows packets to
Packit Service 3880ab
 * get fragmented if they exceed the interface mtu
Packit Service 3880ab
 */
Packit Service 3880ab
#define IPV6_PMTUDISC_OMIT		5
Packit Service 3880ab
Packit Service 3880ab
/* Flowlabel */
Packit Service 3880ab
#define IPV6_FLOWLABEL_MGR	32
Packit Service 3880ab
#define IPV6_FLOWINFO_SEND	33
Packit Service 3880ab
Packit Service 3880ab
#define IPV6_IPSEC_POLICY	34
Packit Service 3880ab
#define IPV6_XFRM_POLICY	35
Packit Service 3880ab
#define IPV6_HDRINCL		36
Packit Service 3880ab
#endif
Packit Service 3880ab
Packit Service 3880ab
/*
Packit Service 3880ab
 * Multicast:
Packit Service 3880ab
 * Following socket options are shared between IPv4 and IPv6.
Packit Service 3880ab
 *
Packit Service 3880ab
 * MCAST_JOIN_GROUP		42
Packit Service 3880ab
 * MCAST_BLOCK_SOURCE		43
Packit Service 3880ab
 * MCAST_UNBLOCK_SOURCE		44
Packit Service 3880ab
 * MCAST_LEAVE_GROUP		45
Packit Service 3880ab
 * MCAST_JOIN_SOURCE_GROUP	46
Packit Service 3880ab
 * MCAST_LEAVE_SOURCE_GROUP	47
Packit Service 3880ab
 * MCAST_MSFILTER		48
Packit Service 3880ab
 */
Packit Service 3880ab
Packit Service 3880ab
/*
Packit Service 3880ab
 * Advanced API (RFC3542) (1)
Packit Service 3880ab
 *
Packit Service 3880ab
 * Note: IPV6_RECVRTHDRDSTOPTS does not exist. see net/ipv6/datagram.c.
Packit Service 3880ab
 */
Packit Service 3880ab
Packit Service 3880ab
#define IPV6_RECVPKTINFO	49
Packit Service 3880ab
#define IPV6_PKTINFO		50
Packit Service 3880ab
#define IPV6_RECVHOPLIMIT	51
Packit Service 3880ab
#define IPV6_HOPLIMIT		52
Packit Service 3880ab
#define IPV6_RECVHOPOPTS	53
Packit Service 3880ab
#define IPV6_HOPOPTS		54
Packit Service 3880ab
#define IPV6_RTHDRDSTOPTS	55
Packit Service 3880ab
#define IPV6_RECVRTHDR		56
Packit Service 3880ab
#define IPV6_RTHDR		57
Packit Service 3880ab
#define IPV6_RECVDSTOPTS	58
Packit Service 3880ab
#define IPV6_DSTOPTS		59
Packit Service 3880ab
#define IPV6_RECVPATHMTU	60
Packit Service 3880ab
#define IPV6_PATHMTU		61
Packit Service 3880ab
#define IPV6_DONTFRAG		62
Packit Service 3880ab
#if 0	/* not yet */
Packit Service 3880ab
#define IPV6_USE_MIN_MTU	63
Packit Service 3880ab
#endif
Packit Service 3880ab
Packit Service 3880ab
/*
Packit Service 3880ab
 * Netfilter (1)
Packit Service 3880ab
 *
Packit Service 3880ab
 * Following socket options are used in ip6_tables;
Packit Service 3880ab
 * see include/linux/netfilter_ipv6/ip6_tables.h.
Packit Service 3880ab
 *
Packit Service 3880ab
 * IP6T_SO_SET_REPLACE / IP6T_SO_GET_INFO		64
Packit Service 3880ab
 * IP6T_SO_SET_ADD_COUNTERS / IP6T_SO_GET_ENTRIES	65
Packit Service 3880ab
 */
Packit Service 3880ab
Packit Service 3880ab
/*
Packit Service 3880ab
 * Advanced API (RFC3542) (2)
Packit Service 3880ab
 */
Packit Service 3880ab
#define IPV6_RECVTCLASS		66
Packit Service 3880ab
#define IPV6_TCLASS		67
Packit Service 3880ab
Packit Service 3880ab
/*
Packit Service 3880ab
 * Netfilter (2)
Packit Service 3880ab
 *
Packit Service 3880ab
 * Following socket options are used in ip6_tables;
Packit Service 3880ab
 * see include/linux/netfilter_ipv6/ip6_tables.h.
Packit Service 3880ab
 *
Packit Service 3880ab
 * IP6T_SO_GET_REVISION_MATCH	68
Packit Service 3880ab
 * IP6T_SO_GET_REVISION_TARGET	69
Packit Service 3880ab
 * IP6T_SO_ORIGINAL_DST		80
Packit Service 3880ab
 */
Packit Service 3880ab
Packit Service 3880ab
#define IPV6_AUTOFLOWLABEL	70
Packit Service 3880ab
/* RFC5014: Source address selection */
Packit Service 3880ab
#define IPV6_ADDR_PREFERENCES	72
Packit Service 3880ab
Packit Service 3880ab
#define IPV6_PREFER_SRC_TMP		0x0001
Packit Service 3880ab
#define IPV6_PREFER_SRC_PUBLIC		0x0002
Packit Service 3880ab
#define IPV6_PREFER_SRC_PUBTMP_DEFAULT	0x0100
Packit Service 3880ab
#define IPV6_PREFER_SRC_COA		0x0004
Packit Service 3880ab
#define IPV6_PREFER_SRC_HOME		0x0400
Packit Service 3880ab
#define IPV6_PREFER_SRC_CGA		0x0008
Packit Service 3880ab
#define IPV6_PREFER_SRC_NONCGA		0x0800
Packit Service 3880ab
Packit Service 3880ab
/* RFC5082: Generalized Ttl Security Mechanism */
Packit Service 3880ab
#define IPV6_MINHOPCOUNT		73
Packit Service 3880ab
Packit Service 3880ab
#define IPV6_ORIGDSTADDR        74
Packit Service 3880ab
#define IPV6_RECVORIGDSTADDR    IPV6_ORIGDSTADDR
Packit Service 3880ab
#define IPV6_TRANSPARENT        75
Packit Service 3880ab
#define IPV6_UNICAST_IF         76
Packit Service 3880ab
#define IPV6_RECVFRAGSIZE	77
Packit Service 3880ab
#define IPV6_FREEBIND		78
Packit Service 3880ab
Packit Service 3880ab
/*
Packit Service 3880ab
 * Multicast Routing:
Packit Service 3880ab
 * see include/uapi/linux/mroute6.h.
Packit Service 3880ab
 *
Packit Service 3880ab
 * MRT6_BASE			200
Packit Service 3880ab
 * ...
Packit Service 3880ab
 * MRT6_MAX
Packit Service 3880ab
 */
Packit Service 3880ab
#endif /* _LINUX_IN6_H */