linux/include/uapi/linux/in6.h

/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
/*
 *	Types and definitions for AF_INET6 
 *	Linux INET6 implementation 
 *
 *	Authors:
 *	Pedro Roque		<[email protected]>	
 *
 *	Sources:
 *	IPv6 Program Interfaces for BSD Systems
 *      <draft-ietf-ipngwg-bsd-api-05.txt>
 *
 *	Advanced Sockets API for IPv6
 *	<draft-stevens-advanced-api-00.txt>
 *
 *	This program is free software; you can redistribute it and/or
 *      modify it under the terms of the GNU General Public License
 *      as published by the Free Software Foundation; either version
 *      2 of the License, or (at your option) any later version.
 */

#ifndef _UAPI_LINUX_IN6_H
#define _UAPI_LINUX_IN6_H

#include <linux/types.h>
#include <linux/libc-compat.h>

/*
 *	IPv6 address structure
 */

#if __UAPI_DEF_IN6_ADDR
struct in6_addr {};
#endif /* __UAPI_DEF_IN6_ADDR */

#if __UAPI_DEF_SOCKADDR_IN6
struct sockaddr_in6 {};
#endif /* __UAPI_DEF_SOCKADDR_IN6 */

#if __UAPI_DEF_IPV6_MREQ
struct ipv6_mreq {};
#endif /* __UAPI_DEF_IVP6_MREQ */

#define ipv6mr_acaddr

struct in6_flowlabel_req {};

#define IPV6_FL_A_GET
#define IPV6_FL_A_PUT
#define IPV6_FL_A_RENEW

#define IPV6_FL_F_CREATE
#define IPV6_FL_F_EXCL
#define IPV6_FL_F_REFLECT
#define IPV6_FL_F_REMOTE

#define IPV6_FL_S_NONE
#define IPV6_FL_S_EXCL
#define IPV6_FL_S_PROCESS
#define IPV6_FL_S_USER
#define IPV6_FL_S_ANY


/*
 *	Bitmask constant declarations to help applications select out the 
 *	flow label and priority fields.
 *
 *	Note that this are in host byte order while the flowinfo field of
 *	sockaddr_in6 is in network byte order.
 */

#define IPV6_FLOWINFO_FLOWLABEL
#define IPV6_FLOWINFO_PRIORITY

/* These definitions are obsolete */
#define IPV6_PRIORITY_UNCHARACTERIZED
#define IPV6_PRIORITY_FILLER
#define IPV6_PRIORITY_UNATTENDED
#define IPV6_PRIORITY_RESERVED1
#define IPV6_PRIORITY_BULK
#define IPV6_PRIORITY_RESERVED2
#define IPV6_PRIORITY_INTERACTIVE
#define IPV6_PRIORITY_CONTROL
#define IPV6_PRIORITY_8
#define IPV6_PRIORITY_9
#define IPV6_PRIORITY_10
#define IPV6_PRIORITY_11
#define IPV6_PRIORITY_12
#define IPV6_PRIORITY_13
#define IPV6_PRIORITY_14
#define IPV6_PRIORITY_15

/*
 *	IPV6 extension headers
 */
#if __UAPI_DEF_IPPROTO_V6
#define IPPROTO_HOPOPTS
#define IPPROTO_ROUTING
#define IPPROTO_FRAGMENT
#define IPPROTO_ICMPV6
#define IPPROTO_NONE
#define IPPROTO_DSTOPTS
#define IPPROTO_MH
#endif /* __UAPI_DEF_IPPROTO_V6 */

/*
 *	IPv6 TLV options.
 */
#define IPV6_TLV_PAD1
#define IPV6_TLV_PADN
#define IPV6_TLV_ROUTERALERT
#define IPV6_TLV_CALIPSO
#define IPV6_TLV_IOAM
#define IPV6_TLV_JUMBO
#define IPV6_TLV_HAO

/*
 *	IPV6 socket options
 */
#if __UAPI_DEF_IPV6_OPTIONS
#define IPV6_ADDRFORM
#define IPV6_2292PKTINFO
#define IPV6_2292HOPOPTS
#define IPV6_2292DSTOPTS
#define IPV6_2292RTHDR
#define IPV6_2292PKTOPTIONS
#define IPV6_CHECKSUM
#define IPV6_2292HOPLIMIT
#define IPV6_NEXTHOP
#define IPV6_AUTHHDR
#define IPV6_FLOWINFO

#define IPV6_UNICAST_HOPS
#define IPV6_MULTICAST_IF
#define IPV6_MULTICAST_HOPS
#define IPV6_MULTICAST_LOOP
#define IPV6_ADD_MEMBERSHIP
#define IPV6_DROP_MEMBERSHIP
#define IPV6_ROUTER_ALERT
#define IPV6_MTU_DISCOVER
#define IPV6_MTU
#define IPV6_RECVERR
#define IPV6_V6ONLY
#define IPV6_JOIN_ANYCAST
#define IPV6_LEAVE_ANYCAST
#define IPV6_MULTICAST_ALL
#define IPV6_ROUTER_ALERT_ISOLATE
#define IPV6_RECVERR_RFC4884

/* IPV6_MTU_DISCOVER values */
#define IPV6_PMTUDISC_DONT
#define IPV6_PMTUDISC_WANT
#define IPV6_PMTUDISC_DO
#define IPV6_PMTUDISC_PROBE
/* same as IPV6_PMTUDISC_PROBE, provided for symetry with IPv4
 * also see comments on IP_PMTUDISC_INTERFACE
 */
#define IPV6_PMTUDISC_INTERFACE
/* weaker version of IPV6_PMTUDISC_INTERFACE, which allows packets to
 * get fragmented if they exceed the interface mtu
 */
#define IPV6_PMTUDISC_OMIT

/* Flowlabel */
#define IPV6_FLOWLABEL_MGR
#define IPV6_FLOWINFO_SEND

#define IPV6_IPSEC_POLICY
#define IPV6_XFRM_POLICY
#define IPV6_HDRINCL
#endif

/*
 * Multicast:
 * Following socket options are shared between IPv4 and IPv6.
 *
 * MCAST_JOIN_GROUP		42
 * MCAST_BLOCK_SOURCE		43
 * MCAST_UNBLOCK_SOURCE		44
 * MCAST_LEAVE_GROUP		45
 * MCAST_JOIN_SOURCE_GROUP	46
 * MCAST_LEAVE_SOURCE_GROUP	47
 * MCAST_MSFILTER		48
 */

/*
 * Advanced API (RFC3542) (1)
 *
 * Note: IPV6_RECVRTHDRDSTOPTS does not exist. see net/ipv6/datagram.c.
 */

#define IPV6_RECVPKTINFO
#define IPV6_PKTINFO
#define IPV6_RECVHOPLIMIT
#define IPV6_HOPLIMIT
#define IPV6_RECVHOPOPTS
#define IPV6_HOPOPTS
#define IPV6_RTHDRDSTOPTS
#define IPV6_RECVRTHDR
#define IPV6_RTHDR
#define IPV6_RECVDSTOPTS
#define IPV6_DSTOPTS
#define IPV6_RECVPATHMTU
#define IPV6_PATHMTU
#define IPV6_DONTFRAG
#if 0	/* not yet */
#define IPV6_USE_MIN_MTU
#endif

/*
 * Netfilter (1)
 *
 * Following socket options are used in ip6_tables;
 * see include/linux/netfilter_ipv6/ip6_tables.h.
 *
 * IP6T_SO_SET_REPLACE / IP6T_SO_GET_INFO		64
 * IP6T_SO_SET_ADD_COUNTERS / IP6T_SO_GET_ENTRIES	65
 */

/*
 * Advanced API (RFC3542) (2)
 */
#define IPV6_RECVTCLASS
#define IPV6_TCLASS

/*
 * Netfilter (2)
 *
 * Following socket options are used in ip6_tables;
 * see include/linux/netfilter_ipv6/ip6_tables.h.
 *
 * IP6T_SO_GET_REVISION_MATCH	68
 * IP6T_SO_GET_REVISION_TARGET	69
 * IP6T_SO_ORIGINAL_DST		80
 */

#define IPV6_AUTOFLOWLABEL
/* RFC5014: Source address selection */
#define IPV6_ADDR_PREFERENCES

#define IPV6_PREFER_SRC_TMP
#define IPV6_PREFER_SRC_PUBLIC
#define IPV6_PREFER_SRC_PUBTMP_DEFAULT
#define IPV6_PREFER_SRC_COA
#define IPV6_PREFER_SRC_HOME
#define IPV6_PREFER_SRC_CGA
#define IPV6_PREFER_SRC_NONCGA

/* RFC5082: Generalized Ttl Security Mechanism */
#define IPV6_MINHOPCOUNT

#define IPV6_ORIGDSTADDR
#define IPV6_RECVORIGDSTADDR
#define IPV6_TRANSPARENT
#define IPV6_UNICAST_IF
#define IPV6_RECVFRAGSIZE
#define IPV6_FREEBIND

/*
 * Multicast Routing:
 * see include/uapi/linux/mroute6.h.
 *
 * MRT6_BASE			200
 * ...
 * MRT6_MAX
 */
#endif /* _UAPI_LINUX_IN6_H */