Edit File by line
/home/barbar84/www/wp-conte.../plugins/sujqvwi/AnonR/anonr.TX.../usr/include/netinet
File: ip_icmp.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_ICMP_H
[17] Fix | Delete
#define __NETINET_IP_ICMP_H 1
[18] Fix | Delete
[19] Fix | Delete
#include <sys/types.h>
[20] Fix | Delete
#include <stdint.h>
[21] Fix | Delete
[22] Fix | Delete
__BEGIN_DECLS
[23] Fix | Delete
[24] Fix | Delete
struct icmphdr
[25] Fix | Delete
{
[26] Fix | Delete
uint8_t type; /* message type */
[27] Fix | Delete
uint8_t code; /* type sub-code */
[28] Fix | Delete
uint16_t checksum;
[29] Fix | Delete
union
[30] Fix | Delete
{
[31] Fix | Delete
struct
[32] Fix | Delete
{
[33] Fix | Delete
uint16_t id;
[34] Fix | Delete
uint16_t sequence;
[35] Fix | Delete
} echo; /* echo datagram */
[36] Fix | Delete
uint32_t gateway; /* gateway address */
[37] Fix | Delete
struct
[38] Fix | Delete
{
[39] Fix | Delete
uint16_t __glibc_reserved;
[40] Fix | Delete
uint16_t mtu;
[41] Fix | Delete
} frag; /* path mtu discovery */
[42] Fix | Delete
} un;
[43] Fix | Delete
};
[44] Fix | Delete
[45] Fix | Delete
#define ICMP_ECHOREPLY 0 /* Echo Reply */
[46] Fix | Delete
#define ICMP_DEST_UNREACH 3 /* Destination Unreachable */
[47] Fix | Delete
#define ICMP_SOURCE_QUENCH 4 /* Source Quench */
[48] Fix | Delete
#define ICMP_REDIRECT 5 /* Redirect (change route) */
[49] Fix | Delete
#define ICMP_ECHO 8 /* Echo Request */
[50] Fix | Delete
#define ICMP_TIME_EXCEEDED 11 /* Time Exceeded */
[51] Fix | Delete
#define ICMP_PARAMETERPROB 12 /* Parameter Problem */
[52] Fix | Delete
#define ICMP_TIMESTAMP 13 /* Timestamp Request */
[53] Fix | Delete
#define ICMP_TIMESTAMPREPLY 14 /* Timestamp Reply */
[54] Fix | Delete
#define ICMP_INFO_REQUEST 15 /* Information Request */
[55] Fix | Delete
#define ICMP_INFO_REPLY 16 /* Information Reply */
[56] Fix | Delete
#define ICMP_ADDRESS 17 /* Address Mask Request */
[57] Fix | Delete
#define ICMP_ADDRESSREPLY 18 /* Address Mask Reply */
[58] Fix | Delete
#define NR_ICMP_TYPES 18
[59] Fix | Delete
[60] Fix | Delete
[61] Fix | Delete
/* Codes for UNREACH. */
[62] Fix | Delete
#define ICMP_NET_UNREACH 0 /* Network Unreachable */
[63] Fix | Delete
#define ICMP_HOST_UNREACH 1 /* Host Unreachable */
[64] Fix | Delete
#define ICMP_PROT_UNREACH 2 /* Protocol Unreachable */
[65] Fix | Delete
#define ICMP_PORT_UNREACH 3 /* Port Unreachable */
[66] Fix | Delete
#define ICMP_FRAG_NEEDED 4 /* Fragmentation Needed/DF set */
[67] Fix | Delete
#define ICMP_SR_FAILED 5 /* Source Route failed */
[68] Fix | Delete
#define ICMP_NET_UNKNOWN 6
[69] Fix | Delete
#define ICMP_HOST_UNKNOWN 7
[70] Fix | Delete
#define ICMP_HOST_ISOLATED 8
[71] Fix | Delete
#define ICMP_NET_ANO 9
[72] Fix | Delete
#define ICMP_HOST_ANO 10
[73] Fix | Delete
#define ICMP_NET_UNR_TOS 11
[74] Fix | Delete
#define ICMP_HOST_UNR_TOS 12
[75] Fix | Delete
#define ICMP_PKT_FILTERED 13 /* Packet filtered */
[76] Fix | Delete
#define ICMP_PREC_VIOLATION 14 /* Precedence violation */
[77] Fix | Delete
#define ICMP_PREC_CUTOFF 15 /* Precedence cut off */
[78] Fix | Delete
#define NR_ICMP_UNREACH 15 /* instead of hardcoding immediate value */
[79] Fix | Delete
[80] Fix | Delete
/* Codes for REDIRECT. */
[81] Fix | Delete
#define ICMP_REDIR_NET 0 /* Redirect Net */
[82] Fix | Delete
#define ICMP_REDIR_HOST 1 /* Redirect Host */
[83] Fix | Delete
#define ICMP_REDIR_NETTOS 2 /* Redirect Net for TOS */
[84] Fix | Delete
#define ICMP_REDIR_HOSTTOS 3 /* Redirect Host for TOS */
[85] Fix | Delete
[86] Fix | Delete
/* Codes for TIME_EXCEEDED. */
[87] Fix | Delete
#define ICMP_EXC_TTL 0 /* TTL count exceeded */
[88] Fix | Delete
#define ICMP_EXC_FRAGTIME 1 /* Fragment Reass time exceeded */
[89] Fix | Delete
[90] Fix | Delete
[91] Fix | Delete
#ifdef __USE_MISC
[92] Fix | Delete
/*
[93] Fix | Delete
* Copyright (c) 1982, 1986, 1993
[94] Fix | Delete
* The Regents of the University of California. All rights reserved.
[95] Fix | Delete
*
[96] Fix | Delete
* Redistribution and use in source and binary forms, with or without
[97] Fix | Delete
* modification, are permitted provided that the following conditions
[98] Fix | Delete
* are met:
[99] Fix | Delete
* 1. Redistributions of source code must retain the above copyright
[100] Fix | Delete
* notice, this list of conditions and the following disclaimer.
[101] Fix | Delete
* 2. Redistributions in binary form must reproduce the above copyright
[102] Fix | Delete
* notice, this list of conditions and the following disclaimer in the
[103] Fix | Delete
* documentation and/or other materials provided with the distribution.
[104] Fix | Delete
* 4. Neither the name of the University nor the names of its contributors
[105] Fix | Delete
* may be used to endorse or promote products derived from this software
[106] Fix | Delete
* without specific prior written permission.
[107] Fix | Delete
*
[108] Fix | Delete
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
[109] Fix | Delete
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
[110] Fix | Delete
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
[111] Fix | Delete
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
[112] Fix | Delete
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
[113] Fix | Delete
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
[114] Fix | Delete
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
[115] Fix | Delete
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
[116] Fix | Delete
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
[117] Fix | Delete
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
[118] Fix | Delete
* SUCH DAMAGE.
[119] Fix | Delete
*
[120] Fix | Delete
* @(#)ip_icmp.h 8.1 (Berkeley) 6/10/93
[121] Fix | Delete
*/
[122] Fix | Delete
[123] Fix | Delete
#include <netinet/in.h>
[124] Fix | Delete
#include <netinet/ip.h>
[125] Fix | Delete
[126] Fix | Delete
/*
[127] Fix | Delete
* Internal of an ICMP Router Advertisement
[128] Fix | Delete
*/
[129] Fix | Delete
struct icmp_ra_addr
[130] Fix | Delete
{
[131] Fix | Delete
uint32_t ira_addr;
[132] Fix | Delete
uint32_t ira_preference;
[133] Fix | Delete
};
[134] Fix | Delete
[135] Fix | Delete
struct icmp
[136] Fix | Delete
{
[137] Fix | Delete
uint8_t icmp_type; /* type of message, see below */
[138] Fix | Delete
uint8_t icmp_code; /* type sub code */
[139] Fix | Delete
uint16_t icmp_cksum; /* ones complement checksum of struct */
[140] Fix | Delete
union
[141] Fix | Delete
{
[142] Fix | Delete
unsigned char ih_pptr; /* ICMP_PARAMPROB */
[143] Fix | Delete
struct in_addr ih_gwaddr; /* gateway address */
[144] Fix | Delete
struct ih_idseq /* echo datagram */
[145] Fix | Delete
{
[146] Fix | Delete
uint16_t icd_id;
[147] Fix | Delete
uint16_t icd_seq;
[148] Fix | Delete
} ih_idseq;
[149] Fix | Delete
uint32_t ih_void;
[150] Fix | Delete
[151] Fix | Delete
/* ICMP_UNREACH_NEEDFRAG -- Path MTU Discovery (RFC1191) */
[152] Fix | Delete
struct ih_pmtu
[153] Fix | Delete
{
[154] Fix | Delete
uint16_t ipm_void;
[155] Fix | Delete
uint16_t ipm_nextmtu;
[156] Fix | Delete
} ih_pmtu;
[157] Fix | Delete
[158] Fix | Delete
struct ih_rtradv
[159] Fix | Delete
{
[160] Fix | Delete
uint8_t irt_num_addrs;
[161] Fix | Delete
uint8_t irt_wpa;
[162] Fix | Delete
uint16_t irt_lifetime;
[163] Fix | Delete
} ih_rtradv;
[164] Fix | Delete
} icmp_hun;
[165] Fix | Delete
#define icmp_pptr icmp_hun.ih_pptr
[166] Fix | Delete
#define icmp_gwaddr icmp_hun.ih_gwaddr
[167] Fix | Delete
#define icmp_id icmp_hun.ih_idseq.icd_id
[168] Fix | Delete
#define icmp_seq icmp_hun.ih_idseq.icd_seq
[169] Fix | Delete
#define icmp_void icmp_hun.ih_void
[170] Fix | Delete
#define icmp_pmvoid icmp_hun.ih_pmtu.ipm_void
[171] Fix | Delete
#define icmp_nextmtu icmp_hun.ih_pmtu.ipm_nextmtu
[172] Fix | Delete
#define icmp_num_addrs icmp_hun.ih_rtradv.irt_num_addrs
[173] Fix | Delete
#define icmp_wpa icmp_hun.ih_rtradv.irt_wpa
[174] Fix | Delete
#define icmp_lifetime icmp_hun.ih_rtradv.irt_lifetime
[175] Fix | Delete
union
[176] Fix | Delete
{
[177] Fix | Delete
struct
[178] Fix | Delete
{
[179] Fix | Delete
uint32_t its_otime;
[180] Fix | Delete
uint32_t its_rtime;
[181] Fix | Delete
uint32_t its_ttime;
[182] Fix | Delete
} id_ts;
[183] Fix | Delete
struct
[184] Fix | Delete
{
[185] Fix | Delete
struct ip idi_ip;
[186] Fix | Delete
/* options and then 64 bits of data */
[187] Fix | Delete
} id_ip;
[188] Fix | Delete
struct icmp_ra_addr id_radv;
[189] Fix | Delete
uint32_t id_mask;
[190] Fix | Delete
uint8_t id_data[1];
[191] Fix | Delete
} icmp_dun;
[192] Fix | Delete
#define icmp_otime icmp_dun.id_ts.its_otime
[193] Fix | Delete
#define icmp_rtime icmp_dun.id_ts.its_rtime
[194] Fix | Delete
#define icmp_ttime icmp_dun.id_ts.its_ttime
[195] Fix | Delete
#define icmp_ip icmp_dun.id_ip.idi_ip
[196] Fix | Delete
#define icmp_radv icmp_dun.id_radv
[197] Fix | Delete
#define icmp_mask icmp_dun.id_mask
[198] Fix | Delete
#define icmp_data icmp_dun.id_data
[199] Fix | Delete
};
[200] Fix | Delete
[201] Fix | Delete
/*
[202] Fix | Delete
* Lower bounds on packet lengths for various types.
[203] Fix | Delete
* For the error advice packets must first insure that the
[204] Fix | Delete
* packet is large enough to contain the returned ip header.
[205] Fix | Delete
* Only then can we do the check to see if 64 bits of packet
[206] Fix | Delete
* data have been returned, since we need to check the returned
[207] Fix | Delete
* ip header length.
[208] Fix | Delete
*/
[209] Fix | Delete
#define ICMP_MINLEN 8 /* abs minimum */
[210] Fix | Delete
#define ICMP_TSLEN (8 + 3 * sizeof (n_time)) /* timestamp */
[211] Fix | Delete
#define ICMP_MASKLEN 12 /* address mask */
[212] Fix | Delete
#define ICMP_ADVLENMIN (8 + sizeof (struct ip) + 8) /* min */
[213] Fix | Delete
#ifndef _IP_VHL
[214] Fix | Delete
#define ICMP_ADVLEN(p) (8 + ((p)->icmp_ip.ip_hl << 2) + 8)
[215] Fix | Delete
/* N.B.: must separately check that ip_hl >= 5 */
[216] Fix | Delete
#else
[217] Fix | Delete
#define ICMP_ADVLEN(p) (8 + (IP_VHL_HL((p)->icmp_ip.ip_vhl) << 2) + 8)
[218] Fix | Delete
/* N.B.: must separately check that header length >= 5 */
[219] Fix | Delete
#endif
[220] Fix | Delete
[221] Fix | Delete
/* Definition of type and code fields. */
[222] Fix | Delete
/* defined above: ICMP_ECHOREPLY, ICMP_REDIRECT, ICMP_ECHO */
[223] Fix | Delete
#define ICMP_UNREACH 3 /* dest unreachable, codes: */
[224] Fix | Delete
#define ICMP_SOURCEQUENCH 4 /* packet lost, slow down */
[225] Fix | Delete
#define ICMP_ROUTERADVERT 9 /* router advertisement */
[226] Fix | Delete
#define ICMP_ROUTERSOLICIT 10 /* router solicitation */
[227] Fix | Delete
#define ICMP_TIMXCEED 11 /* time exceeded, code: */
[228] Fix | Delete
#define ICMP_PARAMPROB 12 /* ip header bad */
[229] Fix | Delete
#define ICMP_TSTAMP 13 /* timestamp request */
[230] Fix | Delete
#define ICMP_TSTAMPREPLY 14 /* timestamp reply */
[231] Fix | Delete
#define ICMP_IREQ 15 /* information request */
[232] Fix | Delete
#define ICMP_IREQREPLY 16 /* information reply */
[233] Fix | Delete
#define ICMP_MASKREQ 17 /* address mask request */
[234] Fix | Delete
#define ICMP_MASKREPLY 18 /* address mask reply */
[235] Fix | Delete
[236] Fix | Delete
#define ICMP_MAXTYPE 18
[237] Fix | Delete
[238] Fix | Delete
/* UNREACH codes */
[239] Fix | Delete
#define ICMP_UNREACH_NET 0 /* bad net */
[240] Fix | Delete
#define ICMP_UNREACH_HOST 1 /* bad host */
[241] Fix | Delete
#define ICMP_UNREACH_PROTOCOL 2 /* bad protocol */
[242] Fix | Delete
#define ICMP_UNREACH_PORT 3 /* bad port */
[243] Fix | Delete
#define ICMP_UNREACH_NEEDFRAG 4 /* IP_DF caused drop */
[244] Fix | Delete
#define ICMP_UNREACH_SRCFAIL 5 /* src route failed */
[245] Fix | Delete
#define ICMP_UNREACH_NET_UNKNOWN 6 /* unknown net */
[246] Fix | Delete
#define ICMP_UNREACH_HOST_UNKNOWN 7 /* unknown host */
[247] Fix | Delete
#define ICMP_UNREACH_ISOLATED 8 /* src host isolated */
[248] Fix | Delete
#define ICMP_UNREACH_NET_PROHIB 9 /* net denied */
[249] Fix | Delete
#define ICMP_UNREACH_HOST_PROHIB 10 /* host denied */
[250] Fix | Delete
#define ICMP_UNREACH_TOSNET 11 /* bad tos for net */
[251] Fix | Delete
#define ICMP_UNREACH_TOSHOST 12 /* bad tos for host */
[252] Fix | Delete
#define ICMP_UNREACH_FILTER_PROHIB 13 /* admin prohib */
[253] Fix | Delete
#define ICMP_UNREACH_HOST_PRECEDENCE 14 /* host prec vio. */
[254] Fix | Delete
#define ICMP_UNREACH_PRECEDENCE_CUTOFF 15 /* prec cutoff */
[255] Fix | Delete
[256] Fix | Delete
/* REDIRECT codes */
[257] Fix | Delete
#define ICMP_REDIRECT_NET 0 /* for network */
[258] Fix | Delete
#define ICMP_REDIRECT_HOST 1 /* for host */
[259] Fix | Delete
#define ICMP_REDIRECT_TOSNET 2 /* for tos and net */
[260] Fix | Delete
#define ICMP_REDIRECT_TOSHOST 3 /* for tos and host */
[261] Fix | Delete
[262] Fix | Delete
/* TIMEXCEED codes */
[263] Fix | Delete
#define ICMP_TIMXCEED_INTRANS 0 /* ttl==0 in transit */
[264] Fix | Delete
#define ICMP_TIMXCEED_REASS 1 /* ttl==0 in reass */
[265] Fix | Delete
[266] Fix | Delete
/* PARAMPROB code */
[267] Fix | Delete
#define ICMP_PARAMPROB_OPTABSENT 1 /* req. opt. absent */
[268] Fix | Delete
[269] Fix | Delete
#define ICMP_INFOTYPE(type) \
[270] Fix | Delete
((type) == ICMP_ECHOREPLY || (type) == ICMP_ECHO || \
[271] Fix | Delete
(type) == ICMP_ROUTERADVERT || (type) == ICMP_ROUTERSOLICIT || \
[272] Fix | Delete
(type) == ICMP_TSTAMP || (type) == ICMP_TSTAMPREPLY || \
[273] Fix | Delete
(type) == ICMP_IREQ || (type) == ICMP_IREQREPLY || \
[274] Fix | Delete
(type) == ICMP_MASKREQ || (type) == ICMP_MASKREPLY)
[275] Fix | Delete
[276] Fix | Delete
#endif /* __USE_MISC */
[277] Fix | Delete
[278] Fix | Delete
__END_DECLS
[279] Fix | Delete
[280] Fix | Delete
#endif /* netinet/ip_icmp.h */
[281] Fix | Delete
[282] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function