aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet
diff options
context:
space:
mode:
authorMatthew Dillon <dillon@FreeBSD.org>1998-12-04 04:21:25 +0000
committerMatthew Dillon <dillon@FreeBSD.org>1998-12-04 04:21:25 +0000
commit5fce7fc47f06028dd000712d8df55ff54de36c09 (patch)
tree9a00c5f1136db151cf6c3d3e102be064a45da1be /sys/netinet
parenta3e7459d60b3208fc90dcd99c20beedaee7c0eea (diff)
downloadsrc-5fce7fc47f06028dd000712d8df55ff54de36c09.tar.gz
src-5fce7fc47f06028dd000712d8df55ff54de36c09.zip
Cleanup icmp_var.h, make icmp bandlim sysctl permanent but if ICMP_BANDLIM
option not defined the sysctl int value is set to -1 and read-only. #ifdef KERNEL's added appropriately to wall off visibility of kernel routines from user code.
Notes
Notes: svn path=/head/; revision=41497
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/icmp_var.h14
-rw-r--r--sys/netinet/ip_icmp.c20
2 files changed, 19 insertions, 15 deletions
diff --git a/sys/netinet/icmp_var.h b/sys/netinet/icmp_var.h
index dcbc82eae282..7ccbe4b31ef2 100644
--- a/sys/netinet/icmp_var.h
+++ b/sys/netinet/icmp_var.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)icmp_var.h 8.1 (Berkeley) 6/10/93
- * $Id: icmp_var.h,v 1.10 1998/12/03 20:23:20 dillon Exp $
+ * $Id: icmp_var.h,v 1.11 1998/12/04 03:49:18 dillon Exp $
*/
#ifndef _NETINET_ICMP_VAR_H_
@@ -67,26 +67,20 @@ struct icmpstat {
*/
#define ICMPCTL_MASKREPL 1 /* allow replies to netmask requests */
#define ICMPCTL_STATS 2 /* statistics (read-only) */
-
-#ifdef ICMP_BANDLIM
#define ICMPCTL_ICMPLIM 3
#define ICMPCTL_MAXID 4
-#define ICMP_BANDLIM_INFO { "icmplim", CTLTYPE_INT },
-#else
-#define ICMPCTL_MAXID 3
-#define ICMP_BANDLIM_INFO
-#endif
-
#define ICMPCTL_NAMES { \
{ 0, 0 }, \
{ "maskrepl", CTLTYPE_INT }, \
{ "stats", CTLTYPE_STRUCT }, \
- ICMP_BANDLIM_INFO \
+ { "icmplim", CTLTYPE_INT }, \
}
+#ifdef KERNEL
#ifdef ICMP_BANDLIM
extern int badport_bandlim __P((int));
#endif
+#endif
#endif
diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c
index 5541363b2cc8..d4eb5ca816dd 100644
--- a/sys/netinet/ip_icmp.c
+++ b/sys/netinet/ip_icmp.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)ip_icmp.c 8.2 (Berkeley) 1/4/94
- * $Id: ip_icmp.c,v 1.31 1998/09/15 10:49:03 jkoshy Exp $
+ * $Id: ip_icmp.c,v 1.32 1998/12/03 20:23:20 dillon Exp $
*/
#include <sys/param.h>
@@ -71,16 +71,26 @@ SYSCTL_INT(_net_inet_icmp, ICMPCTL_MASKREPL, maskrepl, CTLFLAG_RW,
#ifdef ICMP_BANDLIM
- /*
- * ICMP error-response bandwidth limiting
- */
+/*
+ * ICMP error-response bandwidth limiting sysctl. If not enabled, sysctl
+ * variable content is -1 and read-only.
+ */
static int icmplim = 100;
SYSCTL_INT(_net_inet_icmp, ICMPCTL_ICMPLIM, icmplim, CTLFLAG_RW,
&icmplim, 0, "");
-
+#else
+
+static int icmplim = -1;
+SYSCTL_INT(_net_inet_icmp, ICMPCTL_ICMPLIM, icmplim, CTLFLAG_RD,
+ &icmplim, 0, "");
+
#endif
+/*
+ * ICMP broadcast echo sysctl
+ */
+
static int icmpbmcastecho = 0;
SYSCTL_INT(_net_inet_icmp, OID_AUTO, bmcastecho, CTLFLAG_RW, &icmpbmcastecho,
0, "");