~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/uapi/linux/ip.h

Version: ~ [ linux-5.11-rc3 ] ~ [ linux-5.10.7 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.89 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.167 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.215 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.251 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.251 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.85 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
  2 /*
  3  * INET         An implementation of the TCP/IP protocol suite for the LINUX
  4  *              operating system.  INET is implemented using the  BSD Socket
  5  *              interface as the means of communication with the user level.
  6  *
  7  *              Definitions for the IP protocol.
  8  *
  9  * Version:     @(#)ip.h        1.0.2   04/28/93
 10  *
 11  * Authors:     Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
 12  *
 13  *              This program is free software; you can redistribute it and/or
 14  *              modify it under the terms of the GNU General Public License
 15  *              as published by the Free Software Foundation; either version
 16  *              2 of the License, or (at your option) any later version.
 17  */
 18 #ifndef _UAPI_LINUX_IP_H
 19 #define _UAPI_LINUX_IP_H
 20 #include <linux/types.h>
 21 #include <asm/byteorder.h>
 22 
 23 #define IPTOS_TOS_MASK          0x1E
 24 #define IPTOS_TOS(tos)          ((tos)&IPTOS_TOS_MASK)
 25 #define IPTOS_LOWDELAY          0x10
 26 #define IPTOS_THROUGHPUT        0x08
 27 #define IPTOS_RELIABILITY       0x04
 28 #define IPTOS_MINCOST           0x02
 29 
 30 #define IPTOS_PREC_MASK         0xE0
 31 #define IPTOS_PREC(tos)         ((tos)&IPTOS_PREC_MASK)
 32 #define IPTOS_PREC_NETCONTROL           0xe0
 33 #define IPTOS_PREC_INTERNETCONTROL      0xc0
 34 #define IPTOS_PREC_CRITIC_ECP           0xa0
 35 #define IPTOS_PREC_FLASHOVERRIDE        0x80
 36 #define IPTOS_PREC_FLASH                0x60
 37 #define IPTOS_PREC_IMMEDIATE            0x40
 38 #define IPTOS_PREC_PRIORITY             0x20
 39 #define IPTOS_PREC_ROUTINE              0x00
 40 
 41 
 42 /* IP options */
 43 #define IPOPT_COPY              0x80
 44 #define IPOPT_CLASS_MASK        0x60
 45 #define IPOPT_NUMBER_MASK       0x1f
 46 
 47 #define IPOPT_COPIED(o)         ((o)&IPOPT_COPY)
 48 #define IPOPT_CLASS(o)          ((o)&IPOPT_CLASS_MASK)
 49 #define IPOPT_NUMBER(o)         ((o)&IPOPT_NUMBER_MASK)
 50 
 51 #define IPOPT_CONTROL           0x00
 52 #define IPOPT_RESERVED1         0x20
 53 #define IPOPT_MEASUREMENT       0x40
 54 #define IPOPT_RESERVED2         0x60
 55 
 56 #define IPOPT_END       (0 |IPOPT_CONTROL)
 57 #define IPOPT_NOOP      (1 |IPOPT_CONTROL)
 58 #define IPOPT_SEC       (2 |IPOPT_CONTROL|IPOPT_COPY)
 59 #define IPOPT_LSRR      (3 |IPOPT_CONTROL|IPOPT_COPY)
 60 #define IPOPT_TIMESTAMP (4 |IPOPT_MEASUREMENT)
 61 #define IPOPT_CIPSO     (6 |IPOPT_CONTROL|IPOPT_COPY)
 62 #define IPOPT_RR        (7 |IPOPT_CONTROL)
 63 #define IPOPT_SID       (8 |IPOPT_CONTROL|IPOPT_COPY)
 64 #define IPOPT_SSRR      (9 |IPOPT_CONTROL|IPOPT_COPY)
 65 #define IPOPT_RA        (20|IPOPT_CONTROL|IPOPT_COPY)
 66 
 67 #define IPVERSION       4
 68 #define MAXTTL          255
 69 #define IPDEFTTL        64
 70 
 71 #define IPOPT_OPTVAL 0
 72 #define IPOPT_OLEN   1
 73 #define IPOPT_OFFSET 2
 74 #define IPOPT_MINOFF 4
 75 #define MAX_IPOPTLEN 40
 76 #define IPOPT_NOP IPOPT_NOOP
 77 #define IPOPT_EOL IPOPT_END
 78 #define IPOPT_TS  IPOPT_TIMESTAMP
 79 
 80 #define IPOPT_TS_TSONLY         0               /* timestamps only */
 81 #define IPOPT_TS_TSANDADDR      1               /* timestamps and addresses */
 82 #define IPOPT_TS_PRESPEC        3               /* specified modules only */
 83 
 84 #define IPV4_BEET_PHMAXLEN 8
 85 
 86 struct iphdr {
 87 #if defined(__LITTLE_ENDIAN_BITFIELD)
 88         __u8    ihl:4,
 89                 version:4;
 90 #elif defined (__BIG_ENDIAN_BITFIELD)
 91         __u8    version:4,
 92                 ihl:4;
 93 #else
 94 #error  "Please fix <asm/byteorder.h>"
 95 #endif
 96         __u8    tos;
 97         __be16  tot_len;
 98         __be16  id;
 99         __be16  frag_off;
100         __u8    ttl;
101         __u8    protocol;
102         __sum16 check;
103         __be32  saddr;
104         __be32  daddr;
105         /*The options start here. */
106 };
107 
108 
109 struct ip_auth_hdr {
110         __u8  nexthdr;
111         __u8  hdrlen;           /* This one is measured in 32 bit units! */
112         __be16 reserved;
113         __be32 spi;
114         __be32 seq_no;          /* Sequence number */
115         __u8  auth_data[0];     /* Variable len but >=4. Mind the 64 bit alignment! */
116 };
117 
118 struct ip_esp_hdr {
119         __be32 spi;
120         __be32 seq_no;          /* Sequence number */
121         __u8  enc_data[0];      /* Variable len but >=8. Mind the 64 bit alignment! */
122 };
123 
124 struct ip_comp_hdr {
125         __u8 nexthdr;
126         __u8 flags;
127         __be16 cpi;
128 };
129 
130 struct ip_beet_phdr {
131         __u8 nexthdr;
132         __u8 hdrlen;
133         __u8 padlen;
134         __u8 reserved;
135 };
136 
137 /* index values for the variables in ipv4_devconf */
138 enum
139 {
140         IPV4_DEVCONF_FORWARDING=1,
141         IPV4_DEVCONF_MC_FORWARDING,
142         IPV4_DEVCONF_PROXY_ARP,
143         IPV4_DEVCONF_ACCEPT_REDIRECTS,
144         IPV4_DEVCONF_SECURE_REDIRECTS,
145         IPV4_DEVCONF_SEND_REDIRECTS,
146         IPV4_DEVCONF_SHARED_MEDIA,
147         IPV4_DEVCONF_RP_FILTER,
148         IPV4_DEVCONF_ACCEPT_SOURCE_ROUTE,
149         IPV4_DEVCONF_BOOTP_RELAY,
150         IPV4_DEVCONF_LOG_MARTIANS,
151         IPV4_DEVCONF_TAG,
152         IPV4_DEVCONF_ARPFILTER,
153         IPV4_DEVCONF_MEDIUM_ID,
154         IPV4_DEVCONF_NOXFRM,
155         IPV4_DEVCONF_NOPOLICY,
156         IPV4_DEVCONF_FORCE_IGMP_VERSION,
157         IPV4_DEVCONF_ARP_ANNOUNCE,
158         IPV4_DEVCONF_ARP_IGNORE,
159         IPV4_DEVCONF_PROMOTE_SECONDARIES,
160         IPV4_DEVCONF_ARP_ACCEPT,
161         IPV4_DEVCONF_ARP_NOTIFY,
162         IPV4_DEVCONF_ACCEPT_LOCAL,
163         IPV4_DEVCONF_SRC_VMARK,
164         IPV4_DEVCONF_PROXY_ARP_PVLAN,
165         IPV4_DEVCONF_ROUTE_LOCALNET,
166         IPV4_DEVCONF_IGMPV2_UNSOLICITED_REPORT_INTERVAL,
167         IPV4_DEVCONF_IGMPV3_UNSOLICITED_REPORT_INTERVAL,
168         IPV4_DEVCONF_IGNORE_ROUTES_WITH_LINKDOWN,
169         IPV4_DEVCONF_DROP_UNICAST_IN_L2_MULTICAST,
170         IPV4_DEVCONF_DROP_GRATUITOUS_ARP,
171         __IPV4_DEVCONF_MAX
172 };
173 
174 #define IPV4_DEVCONF_MAX (__IPV4_DEVCONF_MAX - 1)
175 
176 #endif /* _UAPI_LINUX_IP_H */
177 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp