Blame include/uapi/linux/ip.h

Packit Service 3880ab
/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
Packit Service 3880ab
/*
Packit Service 3880ab
 * INET		An implementation of the TCP/IP protocol suite for the LINUX
Packit Service 3880ab
 *		operating system.  INET is implemented using the  BSD Socket
Packit Service 3880ab
 *		interface as the means of communication with the user level.
Packit Service 3880ab
 *
Packit Service 3880ab
 *		Definitions for the IP protocol.
Packit Service 3880ab
 *
Packit Service 3880ab
 * Version:	@(#)ip.h	1.0.2	04/28/93
Packit Service 3880ab
 *
Packit Service 3880ab
 * Authors:	Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
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
#ifndef _LINUX_IP_H
Packit Service 3880ab
#define _LINUX_IP_H
Packit Service 3880ab
#include <linux/types.h>
Packit Service 3880ab
#include <asm/byteorder.h>
Packit Service 3880ab
Packit Service 3880ab
#define IPTOS_TOS_MASK		0x1E
Packit Service 3880ab
#define IPTOS_TOS(tos)		((tos)&IPTOS_TOS_MASK)
Packit Service 3880ab
#define	IPTOS_LOWDELAY		0x10
Packit Service 3880ab
#define	IPTOS_THROUGHPUT	0x08
Packit Service 3880ab
#define	IPTOS_RELIABILITY	0x04
Packit Service 3880ab
#define	IPTOS_MINCOST		0x02
Packit Service 3880ab
Packit Service 3880ab
#define IPTOS_PREC_MASK		0xE0
Packit Service 3880ab
#define IPTOS_PREC(tos)		((tos)&IPTOS_PREC_MASK)
Packit Service 3880ab
#define IPTOS_PREC_NETCONTROL           0xe0
Packit Service 3880ab
#define IPTOS_PREC_INTERNETCONTROL      0xc0
Packit Service 3880ab
#define IPTOS_PREC_CRITIC_ECP           0xa0
Packit Service 3880ab
#define IPTOS_PREC_FLASHOVERRIDE        0x80
Packit Service 3880ab
#define IPTOS_PREC_FLASH                0x60
Packit Service 3880ab
#define IPTOS_PREC_IMMEDIATE            0x40
Packit Service 3880ab
#define IPTOS_PREC_PRIORITY             0x20
Packit Service 3880ab
#define IPTOS_PREC_ROUTINE              0x00
Packit Service 3880ab
Packit Service 3880ab
Packit Service 3880ab
/* IP options */
Packit Service 3880ab
#define IPOPT_COPY		0x80
Packit Service 3880ab
#define IPOPT_CLASS_MASK	0x60
Packit Service 3880ab
#define IPOPT_NUMBER_MASK	0x1f
Packit Service 3880ab
Packit Service 3880ab
#define	IPOPT_COPIED(o)		((o)&IPOPT_COPY)
Packit Service 3880ab
#define	IPOPT_CLASS(o)		((o)&IPOPT_CLASS_MASK)
Packit Service 3880ab
#define	IPOPT_NUMBER(o)		((o)&IPOPT_NUMBER_MASK)
Packit Service 3880ab
Packit Service 3880ab
#define	IPOPT_CONTROL		0x00
Packit Service 3880ab
#define	IPOPT_RESERVED1		0x20
Packit Service 3880ab
#define	IPOPT_MEASUREMENT	0x40
Packit Service 3880ab
#define	IPOPT_RESERVED2		0x60
Packit Service 3880ab
Packit Service 3880ab
#define IPOPT_END	(0 |IPOPT_CONTROL)
Packit Service 3880ab
#define IPOPT_NOOP	(1 |IPOPT_CONTROL)
Packit Service 3880ab
#define IPOPT_SEC	(2 |IPOPT_CONTROL|IPOPT_COPY)
Packit Service 3880ab
#define IPOPT_LSRR	(3 |IPOPT_CONTROL|IPOPT_COPY)
Packit Service 3880ab
#define IPOPT_TIMESTAMP	(4 |IPOPT_MEASUREMENT)
Packit Service 3880ab
#define IPOPT_CIPSO	(6 |IPOPT_CONTROL|IPOPT_COPY)
Packit Service 3880ab
#define IPOPT_RR	(7 |IPOPT_CONTROL)
Packit Service 3880ab
#define IPOPT_SID	(8 |IPOPT_CONTROL|IPOPT_COPY)
Packit Service 3880ab
#define IPOPT_SSRR	(9 |IPOPT_CONTROL|IPOPT_COPY)
Packit Service 3880ab
#define IPOPT_RA	(20|IPOPT_CONTROL|IPOPT_COPY)
Packit Service 3880ab
Packit Service 3880ab
#define IPVERSION	4
Packit Service 3880ab
#define MAXTTL		255
Packit Service 3880ab
#define IPDEFTTL	64
Packit Service 3880ab
Packit Service 3880ab
#define IPOPT_OPTVAL 0
Packit Service 3880ab
#define IPOPT_OLEN   1
Packit Service 3880ab
#define IPOPT_OFFSET 2
Packit Service 3880ab
#define IPOPT_MINOFF 4
Packit Service 3880ab
#define MAX_IPOPTLEN 40
Packit Service 3880ab
#define IPOPT_NOP IPOPT_NOOP
Packit Service 3880ab
#define IPOPT_EOL IPOPT_END
Packit Service 3880ab
#define IPOPT_TS  IPOPT_TIMESTAMP
Packit Service 3880ab
Packit Service 3880ab
#define	IPOPT_TS_TSONLY		0		/* timestamps only */
Packit Service 3880ab
#define	IPOPT_TS_TSANDADDR	1		/* timestamps and addresses */
Packit Service 3880ab
#define	IPOPT_TS_PRESPEC	3		/* specified modules only */
Packit Service 3880ab
Packit Service 3880ab
#define IPV4_BEET_PHMAXLEN 8
Packit Service 3880ab
Packit Service 3880ab
struct iphdr {
Packit Service 3880ab
#if defined(__LITTLE_ENDIAN_BITFIELD)
Packit Service 3880ab
	__u8	ihl:4,
Packit Service 3880ab
		version:4;
Packit Service 3880ab
#elif defined (__BIG_ENDIAN_BITFIELD)
Packit Service 3880ab
	__u8	version:4,
Packit Service 3880ab
  		ihl:4;
Packit Service 3880ab
#else
Packit Service 3880ab
#error	"Please fix <asm/byteorder.h>"
Packit Service 3880ab
#endif
Packit Service 3880ab
	__u8	tos;
Packit Service 3880ab
	__be16	tot_len;
Packit Service 3880ab
	__be16	id;
Packit Service 3880ab
	__be16	frag_off;
Packit Service 3880ab
	__u8	ttl;
Packit Service 3880ab
	__u8	protocol;
Packit Service 3880ab
	__sum16	check;
Packit Service 3880ab
	__be32	saddr;
Packit Service 3880ab
	__be32	daddr;
Packit Service 3880ab
	/*The options start here. */
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
Packit Service 3880ab
struct ip_auth_hdr {
Packit Service 3880ab
	__u8  nexthdr;
Packit Service 3880ab
	__u8  hdrlen;		/* This one is measured in 32 bit units! */
Packit Service 3880ab
	__be16 reserved;
Packit Service 3880ab
	__be32 spi;
Packit Service 3880ab
	__be32 seq_no;		/* Sequence number */
Packit Service 3880ab
	__u8  auth_data[0];	/* Variable len but >=4. Mind the 64 bit alignment! */
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
struct ip_esp_hdr {
Packit Service 3880ab
	__be32 spi;
Packit Service 3880ab
	__be32 seq_no;		/* Sequence number */
Packit Service 3880ab
	__u8  enc_data[0];	/* Variable len but >=8. Mind the 64 bit alignment! */
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
struct ip_comp_hdr {
Packit Service 3880ab
	__u8 nexthdr;
Packit Service 3880ab
	__u8 flags;
Packit Service 3880ab
	__be16 cpi;
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
struct ip_beet_phdr {
Packit Service 3880ab
	__u8 nexthdr;
Packit Service 3880ab
	__u8 hdrlen;
Packit Service 3880ab
	__u8 padlen;
Packit Service 3880ab
	__u8 reserved;
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
/* index values for the variables in ipv4_devconf */
Packit Service 3880ab
enum
Packit Service 3880ab
{
Packit Service 3880ab
	IPV4_DEVCONF_FORWARDING=1,
Packit Service 3880ab
	IPV4_DEVCONF_MC_FORWARDING,
Packit Service 3880ab
	IPV4_DEVCONF_PROXY_ARP,
Packit Service 3880ab
	IPV4_DEVCONF_ACCEPT_REDIRECTS,
Packit Service 3880ab
	IPV4_DEVCONF_SECURE_REDIRECTS,
Packit Service 3880ab
	IPV4_DEVCONF_SEND_REDIRECTS,
Packit Service 3880ab
	IPV4_DEVCONF_SHARED_MEDIA,
Packit Service 3880ab
	IPV4_DEVCONF_RP_FILTER,
Packit Service 3880ab
	IPV4_DEVCONF_ACCEPT_SOURCE_ROUTE,
Packit Service 3880ab
	IPV4_DEVCONF_BOOTP_RELAY,
Packit Service 3880ab
	IPV4_DEVCONF_LOG_MARTIANS,
Packit Service 3880ab
	IPV4_DEVCONF_TAG,
Packit Service 3880ab
	IPV4_DEVCONF_ARPFILTER,
Packit Service 3880ab
	IPV4_DEVCONF_MEDIUM_ID,
Packit Service 3880ab
	IPV4_DEVCONF_NOXFRM,
Packit Service 3880ab
	IPV4_DEVCONF_NOPOLICY,
Packit Service 3880ab
	IPV4_DEVCONF_FORCE_IGMP_VERSION,
Packit Service 3880ab
	IPV4_DEVCONF_ARP_ANNOUNCE,
Packit Service 3880ab
	IPV4_DEVCONF_ARP_IGNORE,
Packit Service 3880ab
	IPV4_DEVCONF_PROMOTE_SECONDARIES,
Packit Service 3880ab
	IPV4_DEVCONF_ARP_ACCEPT,
Packit Service 3880ab
	IPV4_DEVCONF_ARP_NOTIFY,
Packit Service 3880ab
	IPV4_DEVCONF_ACCEPT_LOCAL,
Packit Service 3880ab
	IPV4_DEVCONF_SRC_VMARK,
Packit Service 3880ab
	IPV4_DEVCONF_PROXY_ARP_PVLAN,
Packit Service 3880ab
	IPV4_DEVCONF_ROUTE_LOCALNET,
Packit Service 3880ab
	IPV4_DEVCONF_IGMPV2_UNSOLICITED_REPORT_INTERVAL,
Packit Service 3880ab
	IPV4_DEVCONF_IGMPV3_UNSOLICITED_REPORT_INTERVAL,
Packit Service 3880ab
	IPV4_DEVCONF_IGNORE_ROUTES_WITH_LINKDOWN,
Packit Service 3880ab
	IPV4_DEVCONF_DROP_UNICAST_IN_L2_MULTICAST,
Packit Service 3880ab
	IPV4_DEVCONF_DROP_GRATUITOUS_ARP,
Packit Service 3880ab
	IPV4_DEVCONF_BC_FORWARDING,
Packit Service 3880ab
	__IPV4_DEVCONF_MAX
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
#define IPV4_DEVCONF_MAX (__IPV4_DEVCONF_MAX - 1)
Packit Service 3880ab
Packit Service 3880ab
#endif /* _LINUX_IP_H */