2015-02-18 20:00:15 +03:00
|
|
|
/* $NetBSD: icmp_var.h,v 1.30 2015/02/18 17:00:15 christos Exp $ */
|
1994-06-29 10:29:24 +04:00
|
|
|
|
1993-03-21 12:45:37 +03:00
|
|
|
/*
|
1994-05-13 10:02:48 +04:00
|
|
|
* Copyright (c) 1982, 1986, 1993
|
|
|
|
* The Regents of the University of California. All rights reserved.
|
1993-03-21 12:45:37 +03:00
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
2003-08-07 20:26:28 +04:00
|
|
|
* 3. Neither the name of the University nor the names of its contributors
|
1993-03-21 12:45:37 +03:00
|
|
|
* may be used to endorse or promote products derived from this software
|
|
|
|
* without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
*
|
1994-06-29 10:29:24 +04:00
|
|
|
* @(#)icmp_var.h 8.1 (Berkeley) 6/10/93
|
1993-03-21 12:45:37 +03:00
|
|
|
*/
|
|
|
|
|
1998-02-10 04:26:19 +03:00
|
|
|
#ifndef _NETINET_ICMP_VAR_H_
|
|
|
|
#define _NETINET_ICMP_VAR_H_
|
|
|
|
|
1993-03-21 12:45:37 +03:00
|
|
|
/*
|
|
|
|
* Variables related to this implementation
|
|
|
|
* of the internet control message protocol.
|
|
|
|
*/
|
2008-04-06 23:04:48 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* ICMP stastistics.
|
|
|
|
* Each counter is an unsigned 64-bit value.
|
|
|
|
*/
|
|
|
|
#define ICMP_STAT_ERROR 0 /* # of calls to icmp_error */
|
|
|
|
#define ICMP_STAT_OLDSHORT 1 /* no error (old ip too short) */
|
|
|
|
#define ICMP_STAT_OLDICMP 2 /* no error (old was icmp) */
|
2011-12-24 23:54:41 +04:00
|
|
|
#define ICMP_STAT_BADCODE 3 /* icmp_code out of range */
|
|
|
|
#define ICMP_STAT_TOOSHORT 4 /* packet < ICMP_MINLEN */
|
|
|
|
#define ICMP_STAT_CHECKSUM 5 /* bad checksum */
|
|
|
|
#define ICMP_STAT_BADLEN 6 /* calculated bound mismatch */
|
|
|
|
#define ICMP_STAT_REFLECT 7 /* number of responses */
|
|
|
|
#define ICMP_STAT_PMTUCHG 8 /* path MTU changes */
|
|
|
|
#define ICMP_STAT_BMCASTECHO 9 /* b/mcast echo requests dropped */
|
|
|
|
#define ICMP_STAT_BMCASTTSTAMP 10 /* b/mcast tstamp requests dropped */
|
|
|
|
#define ICMP_STAT_LAST 16 /* Allow for 5 spare ones */
|
|
|
|
#define ICMP_STAT_OUTHIST ICMP_STAT_LAST
|
2015-02-18 20:00:15 +03:00
|
|
|
#define ICMP_STAT_INHIST (ICMP_STAT_LAST + ICMP_NTYPES)
|
|
|
|
#define ICMP_NSTATS (ICMP_STAT_LAST + 2 * ICMP_NTYPES)
|
1993-03-21 12:45:37 +03:00
|
|
|
|
1994-05-13 10:02:48 +04:00
|
|
|
/*
|
|
|
|
* Names for ICMP sysctl objects
|
|
|
|
*/
|
|
|
|
#define ICMPCTL_MASKREPL 1 /* allow replies to netmask requests */
|
2000-07-28 08:06:52 +04:00
|
|
|
#if 0 /*obsoleted*/
|
2000-02-15 07:03:49 +03:00
|
|
|
#define ICMPCTL_ERRRATELIMIT 2 /* error rate limit */
|
2000-07-28 08:06:52 +04:00
|
|
|
#endif
|
2000-06-10 16:39:19 +04:00
|
|
|
#define ICMPCTL_RETURNDATABYTES 3 /* # of bytes to include in errors */
|
2000-07-10 13:31:29 +04:00
|
|
|
#define ICMPCTL_ERRPPSLIMIT 4 /* ICMP error pps limitation */
|
2001-10-30 09:41:09 +03:00
|
|
|
#define ICMPCTL_REDIRACCEPT 5 /* Accept redirects from routers */
|
|
|
|
#define ICMPCTL_REDIRTIMEOUT 6 /* Remove routes added via redirects */
|
2005-08-05 13:21:25 +04:00
|
|
|
#define ICMPCTL_STATS 7 /* ICMP statistics */
|
2009-12-07 21:47:24 +03:00
|
|
|
#define ICMPCTL_BMCASTECHO 8 /* allow broad/mult-cast echo */
|
|
|
|
#define ICMPCTL_MAXID 9
|
1994-05-13 10:02:48 +04:00
|
|
|
|
|
|
|
#define ICMPCTL_NAMES { \
|
|
|
|
{ 0, 0 }, \
|
|
|
|
{ "maskrepl", CTLTYPE_INT }, \
|
2000-07-28 08:06:52 +04:00
|
|
|
{ 0, 0 }, \
|
2000-06-10 16:39:19 +04:00
|
|
|
{ "returndatabytes", CTLTYPE_INT }, \
|
2000-07-10 13:31:29 +04:00
|
|
|
{ "errppslimit", CTLTYPE_INT }, \
|
2001-10-30 09:41:09 +03:00
|
|
|
{ "rediraccept", CTLTYPE_INT }, \
|
|
|
|
{ "redirtimeout", CTLTYPE_INT }, \
|
2005-08-05 13:21:25 +04:00
|
|
|
{ "stats", CTLTYPE_STRUCT }, \
|
2009-12-07 21:47:24 +03:00
|
|
|
{ "bmcastecho", CTLTYPE_INT }, \
|
1994-05-13 10:02:48 +04:00
|
|
|
}
|
|
|
|
|
1995-03-27 00:23:52 +04:00
|
|
|
#ifdef _KERNEL
|
Changes to allow the IPv4 and IPv6 layers to align headers themseves,
as necessary:
* Implement a new mbuf utility routine, m_copyup(), is is like
m_pullup(), except that it always prepends and copies, rather
than only doing so if the desired length is larger than m->m_len.
m_copyup() also allows an offset into the destination mbuf, which
allows space for packet headers, in the forwarding case.
* Add *_HDR_ALIGNED_P() macros for IP, IPv6, ICMP, and IGMP. These
macros expand to 1 if __NO_STRICT_ALIGNMENT is defined, so that
architectures which do not have strict alignment constraints don't
pay for the test or visit the new align-if-needed path.
* Use the new macros to check if a header needs to be aligned, or to
assert that it already is, as appropriate.
Note: This code is still somewhat experimental. However, the new
code path won't be visited if individual device drivers continue
to guarantee that packets are delivered to layer 3 already properly
aligned (which are rules that are already in use).
2002-07-01 02:40:32 +04:00
|
|
|
|
2008-04-12 09:58:22 +04:00
|
|
|
void icmp_statinc(u_int stat);
|
|
|
|
|
Changes to allow the IPv4 and IPv6 layers to align headers themseves,
as necessary:
* Implement a new mbuf utility routine, m_copyup(), is is like
m_pullup(), except that it always prepends and copies, rather
than only doing so if the desired length is larger than m->m_len.
m_copyup() also allows an offset into the destination mbuf, which
allows space for packet headers, in the forwarding case.
* Add *_HDR_ALIGNED_P() macros for IP, IPv6, ICMP, and IGMP. These
macros expand to 1 if __NO_STRICT_ALIGNMENT is defined, so that
architectures which do not have strict alignment constraints don't
pay for the test or visit the new align-if-needed path.
* Use the new macros to check if a header needs to be aligned, or to
assert that it already is, as appropriate.
Note: This code is still somewhat experimental. However, the new
code path won't be visited if individual device drivers continue
to guarantee that packets are delivered to layer 3 already properly
aligned (which are rules that are already in use).
2002-07-01 02:40:32 +04:00
|
|
|
#endif /* _KERNEL_ */
|
1998-02-10 04:26:19 +03:00
|
|
|
|
2005-12-11 02:31:41 +03:00
|
|
|
#endif /* !_NETINET_ICMP_VAR_H_ */
|