Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ShExBy/shex_roo.../usr/include/netinet
File: ip.h
/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
[0] Fix | Delete
This file is part of the GNU C Library.
[1] Fix | Delete
[2] Fix | Delete
The GNU C Library is free software; you can redistribute it and/or
[3] Fix | Delete
modify it under the terms of the GNU Lesser General Public
[4] Fix | Delete
License as published by the Free Software Foundation; either
[5] Fix | Delete
version 2.1 of the License, or (at your option) any later version.
[6] Fix | Delete
[7] Fix | Delete
The GNU C Library is distributed in the hope that it will be useful,
[8] Fix | Delete
but WITHOUT ANY WARRANTY; without even the implied warranty of
[9] Fix | Delete
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
[10] Fix | Delete
Lesser General Public License for more details.
[11] Fix | Delete
[12] Fix | Delete
You should have received a copy of the GNU Lesser General Public
[13] Fix | Delete
License along with the GNU C Library; if not, see
[14] Fix | Delete
<http://www.gnu.org/licenses/>. */
[15] Fix | Delete
[16] Fix | Delete
#ifndef __NETINET_IP_H
[17] Fix | Delete
#define __NETINET_IP_H 1
[18] Fix | Delete
[19] Fix | Delete
#include <features.h>
[20] Fix | Delete
#include <sys/types.h>
[21] Fix | Delete
[22] Fix | Delete
#include <netinet/in.h>
[23] Fix | Delete
[24] Fix | Delete
__BEGIN_DECLS
[25] Fix | Delete
[26] Fix | Delete
struct timestamp
[27] Fix | Delete
{
[28] Fix | Delete
uint8_t len;
[29] Fix | Delete
uint8_t ptr;
[30] Fix | Delete
#if __BYTE_ORDER == __LITTLE_ENDIAN
[31] Fix | Delete
unsigned int flags:4;
[32] Fix | Delete
unsigned int overflow:4;
[33] Fix | Delete
#elif __BYTE_ORDER == __BIG_ENDIAN
[34] Fix | Delete
unsigned int overflow:4;
[35] Fix | Delete
unsigned int flags:4;
[36] Fix | Delete
#else
[37] Fix | Delete
# error "Please fix <bits/endian.h>"
[38] Fix | Delete
#endif
[39] Fix | Delete
uint32_t data[9];
[40] Fix | Delete
};
[41] Fix | Delete
[42] Fix | Delete
struct iphdr
[43] Fix | Delete
{
[44] Fix | Delete
#if __BYTE_ORDER == __LITTLE_ENDIAN
[45] Fix | Delete
unsigned int ihl:4;
[46] Fix | Delete
unsigned int version:4;
[47] Fix | Delete
#elif __BYTE_ORDER == __BIG_ENDIAN
[48] Fix | Delete
unsigned int version:4;
[49] Fix | Delete
unsigned int ihl:4;
[50] Fix | Delete
#else
[51] Fix | Delete
# error "Please fix <bits/endian.h>"
[52] Fix | Delete
#endif
[53] Fix | Delete
uint8_t tos;
[54] Fix | Delete
uint16_t tot_len;
[55] Fix | Delete
uint16_t id;
[56] Fix | Delete
uint16_t frag_off;
[57] Fix | Delete
uint8_t ttl;
[58] Fix | Delete
uint8_t protocol;
[59] Fix | Delete
uint16_t check;
[60] Fix | Delete
uint32_t saddr;
[61] Fix | Delete
uint32_t daddr;
[62] Fix | Delete
/*The options start here. */
[63] Fix | Delete
};
[64] Fix | Delete
[65] Fix | Delete
#ifdef __USE_MISC
[66] Fix | Delete
/*
[67] Fix | Delete
* Copyright (c) 1982, 1986, 1993
[68] Fix | Delete
* The Regents of the University of California. All rights reserved.
[69] Fix | Delete
*
[70] Fix | Delete
* Redistribution and use in source and binary forms, with or without
[71] Fix | Delete
* modification, are permitted provided that the following conditions
[72] Fix | Delete
* are met:
[73] Fix | Delete
* 1. Redistributions of source code must retain the above copyright
[74] Fix | Delete
* notice, this list of conditions and the following disclaimer.
[75] Fix | Delete
* 2. Redistributions in binary form must reproduce the above copyright
[76] Fix | Delete
* notice, this list of conditions and the following disclaimer in the
[77] Fix | Delete
* documentation and/or other materials provided with the distribution.
[78] Fix | Delete
* 4. Neither the name of the University nor the names of its contributors
[79] Fix | Delete
* may be used to endorse or promote products derived from this software
[80] Fix | Delete
* without specific prior written permission.
[81] Fix | Delete
*
[82] Fix | Delete
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
[83] Fix | Delete
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
[84] Fix | Delete
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
[85] Fix | Delete
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
[86] Fix | Delete
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
[87] Fix | Delete
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
[88] Fix | Delete
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
[89] Fix | Delete
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
[90] Fix | Delete
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
[91] Fix | Delete
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
[92] Fix | Delete
* SUCH DAMAGE.
[93] Fix | Delete
*
[94] Fix | Delete
* @(#)ip.h 8.1 (Berkeley) 6/10/93
[95] Fix | Delete
*/
[96] Fix | Delete
[97] Fix | Delete
/*
[98] Fix | Delete
* Definitions for internet protocol version 4.
[99] Fix | Delete
* Per RFC 791, September 1981.
[100] Fix | Delete
*/
[101] Fix | Delete
[102] Fix | Delete
/*
[103] Fix | Delete
* Structure of an internet header, naked of options.
[104] Fix | Delete
*/
[105] Fix | Delete
struct ip
[106] Fix | Delete
{
[107] Fix | Delete
#if __BYTE_ORDER == __LITTLE_ENDIAN
[108] Fix | Delete
unsigned int ip_hl:4; /* header length */
[109] Fix | Delete
unsigned int ip_v:4; /* version */
[110] Fix | Delete
#endif
[111] Fix | Delete
#if __BYTE_ORDER == __BIG_ENDIAN
[112] Fix | Delete
unsigned int ip_v:4; /* version */
[113] Fix | Delete
unsigned int ip_hl:4; /* header length */
[114] Fix | Delete
#endif
[115] Fix | Delete
uint8_t ip_tos; /* type of service */
[116] Fix | Delete
unsigned short ip_len; /* total length */
[117] Fix | Delete
unsigned short ip_id; /* identification */
[118] Fix | Delete
unsigned short ip_off; /* fragment offset field */
[119] Fix | Delete
#define IP_RF 0x8000 /* reserved fragment flag */
[120] Fix | Delete
#define IP_DF 0x4000 /* dont fragment flag */
[121] Fix | Delete
#define IP_MF 0x2000 /* more fragments flag */
[122] Fix | Delete
#define IP_OFFMASK 0x1fff /* mask for fragmenting bits */
[123] Fix | Delete
uint8_t ip_ttl; /* time to live */
[124] Fix | Delete
uint8_t ip_p; /* protocol */
[125] Fix | Delete
unsigned short ip_sum; /* checksum */
[126] Fix | Delete
struct in_addr ip_src, ip_dst; /* source and dest address */
[127] Fix | Delete
};
[128] Fix | Delete
[129] Fix | Delete
/*
[130] Fix | Delete
* Time stamp option structure.
[131] Fix | Delete
*/
[132] Fix | Delete
struct ip_timestamp
[133] Fix | Delete
{
[134] Fix | Delete
uint8_t ipt_code; /* IPOPT_TS */
[135] Fix | Delete
uint8_t ipt_len; /* size of structure (variable) */
[136] Fix | Delete
uint8_t ipt_ptr; /* index of current entry */
[137] Fix | Delete
#if __BYTE_ORDER == __LITTLE_ENDIAN
[138] Fix | Delete
unsigned int ipt_flg:4; /* flags, see below */
[139] Fix | Delete
unsigned int ipt_oflw:4; /* overflow counter */
[140] Fix | Delete
#endif
[141] Fix | Delete
#if __BYTE_ORDER == __BIG_ENDIAN
[142] Fix | Delete
unsigned int ipt_oflw:4; /* overflow counter */
[143] Fix | Delete
unsigned int ipt_flg:4; /* flags, see below */
[144] Fix | Delete
#endif
[145] Fix | Delete
uint32_t data[9];
[146] Fix | Delete
};
[147] Fix | Delete
#endif /* __USE_MISC */
[148] Fix | Delete
[149] Fix | Delete
#define IPVERSION 4 /* IP version number */
[150] Fix | Delete
#define IP_MAXPACKET 65535 /* maximum packet size */
[151] Fix | Delete
[152] Fix | Delete
/*
[153] Fix | Delete
* Definitions for Explicit Congestion Notification (ECN)
[154] Fix | Delete
*
[155] Fix | Delete
* Taken from RFC-3168, Section 5.
[156] Fix | Delete
*/
[157] Fix | Delete
[158] Fix | Delete
#define IPTOS_ECN_MASK 0x03
[159] Fix | Delete
#define IPTOS_ECN(x) ((x) & IPTOS_ECN_MASK)
[160] Fix | Delete
#define IPTOS_ECN_NOT_ECT 0x00
[161] Fix | Delete
#define IPTOS_ECN_ECT1 0x01
[162] Fix | Delete
#define IPTOS_ECN_ECT0 0x02
[163] Fix | Delete
#define IPTOS_ECN_CE 0x03
[164] Fix | Delete
[165] Fix | Delete
/*
[166] Fix | Delete
* Definitions for IP differentiated services code points (DSCP)
[167] Fix | Delete
*
[168] Fix | Delete
* Taken from RFC-2597, Section 6 and RFC-2598, Section 2.3.
[169] Fix | Delete
*/
[170] Fix | Delete
[171] Fix | Delete
#define IPTOS_DSCP_MASK 0xfc
[172] Fix | Delete
#define IPTOS_DSCP(x) ((x) & IPTOS_DSCP_MASK)
[173] Fix | Delete
#define IPTOS_DSCP_AF11 0x28
[174] Fix | Delete
#define IPTOS_DSCP_AF12 0x30
[175] Fix | Delete
#define IPTOS_DSCP_AF13 0x38
[176] Fix | Delete
#define IPTOS_DSCP_AF21 0x48
[177] Fix | Delete
#define IPTOS_DSCP_AF22 0x50
[178] Fix | Delete
#define IPTOS_DSCP_AF23 0x58
[179] Fix | Delete
#define IPTOS_DSCP_AF31 0x68
[180] Fix | Delete
#define IPTOS_DSCP_AF32 0x70
[181] Fix | Delete
#define IPTOS_DSCP_AF33 0x78
[182] Fix | Delete
#define IPTOS_DSCP_AF41 0x88
[183] Fix | Delete
#define IPTOS_DSCP_AF42 0x90
[184] Fix | Delete
#define IPTOS_DSCP_AF43 0x98
[185] Fix | Delete
#define IPTOS_DSCP_EF 0xb8
[186] Fix | Delete
[187] Fix | Delete
/*
[188] Fix | Delete
* In RFC 2474, Section 4.2.2.1, the Class Selector Codepoints subsume
[189] Fix | Delete
* the old ToS Precedence values.
[190] Fix | Delete
*/
[191] Fix | Delete
[192] Fix | Delete
#define IPTOS_CLASS_MASK 0xe0
[193] Fix | Delete
#define IPTOS_CLASS(class) ((class) & IPTOS_CLASS_MASK)
[194] Fix | Delete
#define IPTOS_CLASS_CS0 0x00
[195] Fix | Delete
#define IPTOS_CLASS_CS1 0x20
[196] Fix | Delete
#define IPTOS_CLASS_CS2 0x40
[197] Fix | Delete
#define IPTOS_CLASS_CS3 0x60
[198] Fix | Delete
#define IPTOS_CLASS_CS4 0x80
[199] Fix | Delete
#define IPTOS_CLASS_CS5 0xa0
[200] Fix | Delete
#define IPTOS_CLASS_CS6 0xc0
[201] Fix | Delete
#define IPTOS_CLASS_CS7 0xe0
[202] Fix | Delete
[203] Fix | Delete
#define IPTOS_CLASS_DEFAULT IPTOS_CLASS_CS0
[204] Fix | Delete
[205] Fix | Delete
/*
[206] Fix | Delete
* Definitions for IP type of service (ip_tos) [deprecated; use DSCP
[207] Fix | Delete
* and CS definitions above instead.]
[208] Fix | Delete
*/
[209] Fix | Delete
#define IPTOS_TOS_MASK 0x1E
[210] Fix | Delete
#define IPTOS_TOS(tos) ((tos) & IPTOS_TOS_MASK)
[211] Fix | Delete
#define IPTOS_LOWDELAY 0x10
[212] Fix | Delete
#define IPTOS_THROUGHPUT 0x08
[213] Fix | Delete
#define IPTOS_RELIABILITY 0x04
[214] Fix | Delete
#define IPTOS_LOWCOST 0x02
[215] Fix | Delete
#define IPTOS_MINCOST IPTOS_LOWCOST
[216] Fix | Delete
[217] Fix | Delete
/*
[218] Fix | Delete
* Definitions for IP precedence (also in ip_tos) [also deprecated.]
[219] Fix | Delete
*/
[220] Fix | Delete
#define IPTOS_PREC_MASK IPTOS_CLASS_MASK
[221] Fix | Delete
#define IPTOS_PREC(tos) IPTOS_CLASS(tos)
[222] Fix | Delete
#define IPTOS_PREC_NETCONTROL IPTOS_CLASS_CS7
[223] Fix | Delete
#define IPTOS_PREC_INTERNETCONTROL IPTOS_CLASS_CS6
[224] Fix | Delete
#define IPTOS_PREC_CRITIC_ECP IPTOS_CLASS_CS5
[225] Fix | Delete
#define IPTOS_PREC_FLASHOVERRIDE IPTOS_CLASS_CS4
[226] Fix | Delete
#define IPTOS_PREC_FLASH IPTOS_CLASS_CS3
[227] Fix | Delete
#define IPTOS_PREC_IMMEDIATE IPTOS_CLASS_CS2
[228] Fix | Delete
#define IPTOS_PREC_PRIORITY IPTOS_CLASS_CS1
[229] Fix | Delete
#define IPTOS_PREC_ROUTINE IPTOS_CLASS_CS0
[230] Fix | Delete
[231] Fix | Delete
/*
[232] Fix | Delete
* Definitions for options.
[233] Fix | Delete
*/
[234] Fix | Delete
#define IPOPT_COPY 0x80
[235] Fix | Delete
#define IPOPT_CLASS_MASK 0x60
[236] Fix | Delete
#define IPOPT_NUMBER_MASK 0x1f
[237] Fix | Delete
[238] Fix | Delete
#define IPOPT_COPIED(o) ((o) & IPOPT_COPY)
[239] Fix | Delete
#define IPOPT_CLASS(o) ((o) & IPOPT_CLASS_MASK)
[240] Fix | Delete
#define IPOPT_NUMBER(o) ((o) & IPOPT_NUMBER_MASK)
[241] Fix | Delete
[242] Fix | Delete
#define IPOPT_CONTROL 0x00
[243] Fix | Delete
#define IPOPT_RESERVED1 0x20
[244] Fix | Delete
#define IPOPT_DEBMEAS 0x40
[245] Fix | Delete
#define IPOPT_MEASUREMENT IPOPT_DEBMEAS
[246] Fix | Delete
#define IPOPT_RESERVED2 0x60
[247] Fix | Delete
[248] Fix | Delete
#define IPOPT_EOL 0 /* end of option list */
[249] Fix | Delete
#define IPOPT_END IPOPT_EOL
[250] Fix | Delete
#define IPOPT_NOP 1 /* no operation */
[251] Fix | Delete
#define IPOPT_NOOP IPOPT_NOP
[252] Fix | Delete
[253] Fix | Delete
#define IPOPT_RR 7 /* record packet route */
[254] Fix | Delete
#define IPOPT_TS 68 /* timestamp */
[255] Fix | Delete
#define IPOPT_TIMESTAMP IPOPT_TS
[256] Fix | Delete
#define IPOPT_SECURITY 130 /* provide s,c,h,tcc */
[257] Fix | Delete
#define IPOPT_SEC IPOPT_SECURITY
[258] Fix | Delete
#define IPOPT_LSRR 131 /* loose source route */
[259] Fix | Delete
#define IPOPT_SATID 136 /* satnet id */
[260] Fix | Delete
#define IPOPT_SID IPOPT_SATID
[261] Fix | Delete
#define IPOPT_SSRR 137 /* strict source route */
[262] Fix | Delete
#define IPOPT_RA 148 /* router alert */
[263] Fix | Delete
[264] Fix | Delete
/*
[265] Fix | Delete
* Offsets to fields in options other than EOL and NOP.
[266] Fix | Delete
*/
[267] Fix | Delete
#define IPOPT_OPTVAL 0 /* option ID */
[268] Fix | Delete
#define IPOPT_OLEN 1 /* option length */
[269] Fix | Delete
#define IPOPT_OFFSET 2 /* offset within option */
[270] Fix | Delete
#define IPOPT_MINOFF 4 /* min value of above */
[271] Fix | Delete
[272] Fix | Delete
#define MAX_IPOPTLEN 40
[273] Fix | Delete
[274] Fix | Delete
/* flag bits for ipt_flg */
[275] Fix | Delete
#define IPOPT_TS_TSONLY 0 /* timestamps only */
[276] Fix | Delete
#define IPOPT_TS_TSANDADDR 1 /* timestamps and addresses */
[277] Fix | Delete
#define IPOPT_TS_PRESPEC 3 /* specified modules only */
[278] Fix | Delete
[279] Fix | Delete
/* bits for security (not byte swapped) */
[280] Fix | Delete
#define IPOPT_SECUR_UNCLASS 0x0000
[281] Fix | Delete
#define IPOPT_SECUR_CONFID 0xf135
[282] Fix | Delete
#define IPOPT_SECUR_EFTO 0x789a
[283] Fix | Delete
#define IPOPT_SECUR_MMMM 0xbc4d
[284] Fix | Delete
#define IPOPT_SECUR_RESTR 0xaf13
[285] Fix | Delete
#define IPOPT_SECUR_SECRET 0xd788
[286] Fix | Delete
#define IPOPT_SECUR_TOPSECRET 0x6bc5
[287] Fix | Delete
[288] Fix | Delete
/*
[289] Fix | Delete
* Internet implementation parameters.
[290] Fix | Delete
*/
[291] Fix | Delete
#define MAXTTL 255 /* maximum time to live (seconds) */
[292] Fix | Delete
#define IPDEFTTL 64 /* default ttl, from RFC 1340 */
[293] Fix | Delete
#define IPFRAGTTL 60 /* time to live for frags, slowhz */
[294] Fix | Delete
#define IPTTLDEC 1 /* subtracted when forwarding */
[295] Fix | Delete
[296] Fix | Delete
#define IP_MSS 576 /* default maximum segment size */
[297] Fix | Delete
[298] Fix | Delete
__END_DECLS
[299] Fix | Delete
[300] Fix | Delete
#endif /* netinet/ip.h */
[301] Fix | Delete
[302] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function