mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-13 05:41:26 +01:00
Add lots of useful MIB variables and a few not-so-useful ones for
completeness.
This commit is contained in:
parent
bae74debca
commit
f2ea20e676
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=6472
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)icmp_var.h 8.1 (Berkeley) 6/10/93
|
||||
* $Id: icmp_var.h,v 1.2 1994/08/02 07:47:56 davidg Exp $
|
||||
* $Id: icmp_var.h,v 1.3 1994/08/21 05:27:23 paul Exp $
|
||||
*/
|
||||
|
||||
#ifndef _NETINET_ICMP_VAR_H_
|
||||
@ -60,15 +60,17 @@ struct icmpstat {
|
||||
* Names for ICMP sysctl objects
|
||||
*/
|
||||
#define ICMPCTL_MASKREPL 1 /* allow replies to netmask requests */
|
||||
#define ICMPCTL_MAXID 2
|
||||
#define ICMPCTL_STATS 2 /* statistics (read-only) */
|
||||
#define ICMPCTL_MAXID 3
|
||||
|
||||
#define ICMPCTL_NAMES { \
|
||||
{ 0, 0 }, \
|
||||
{ "maskrepl", CTLTYPE_INT }, \
|
||||
{ "stats", CTLTYPE_STRUCT }, \
|
||||
}
|
||||
|
||||
#ifdef KERNEL
|
||||
struct icmpstat icmpstat;
|
||||
extern struct icmpstat icmpstat;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -35,7 +35,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)igmp.c 8.1 (Berkeley) 7/19/93
|
||||
* $Id: igmp.c,v 1.5 1994/09/14 03:10:07 wollman Exp $
|
||||
* $Id: igmp.c,v 1.6 1994/10/31 06:36:47 pst Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -52,6 +52,9 @@
|
||||
#include <sys/mbuf.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/protosw.h>
|
||||
#include <sys/proc.h> /* XXX needed for sysctl.h */
|
||||
#include <vm/vm.h> /* XXX needed for sysctl.h */
|
||||
#include <sys/sysctl.h>
|
||||
|
||||
#include <net/if.h>
|
||||
#include <net/route.h>
|
||||
@ -629,3 +632,20 @@ igmp_sendleave(inm)
|
||||
{
|
||||
igmp_sendpkt(inm, IGMP_HOST_LEAVE_MESSAGE);
|
||||
}
|
||||
|
||||
int
|
||||
igmp_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp,
|
||||
void *newp, size_t newlen)
|
||||
{
|
||||
/* All sysctl names at this level are terminal. */
|
||||
if (namelen != 1)
|
||||
return ENOTDIR; /* XXX overloaded */
|
||||
|
||||
switch(name[0]) {
|
||||
case IGMPCTL_STATS:
|
||||
return sysctl_rdstruct(oldp, oldlenp, newp, &igmpstat,
|
||||
sizeof igmpstat);
|
||||
default:
|
||||
return ENOPROTOOPT;
|
||||
}
|
||||
}
|
||||
|
@ -35,7 +35,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)igmp_var.h 8.1 (Berkeley) 7/19/93
|
||||
* $Id: igmp_var.h,v 1.3 1994/08/21 05:27:26 paul Exp $
|
||||
* $Id: igmp_var.h,v 1.4 1994/09/06 22:42:17 wollman Exp $
|
||||
*/
|
||||
|
||||
#ifndef _NETINET_IGMP_VAR_H_
|
||||
@ -73,6 +73,20 @@ void igmp_joingroup __P((struct in_multi *));
|
||||
void igmp_leavegroup __P((struct in_multi *));
|
||||
void igmp_fasttimo __P((void));
|
||||
void igmp_slowtimo __P((void));
|
||||
int igmp_sysctl(int *, u_int, void *, size_t *, void *, size_t);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Names for IGMP sysctl objects
|
||||
*/
|
||||
#define IGMPCTL_STATS 1 /* statistics (read-only) */
|
||||
#define IGMPCTL_MAXID 2
|
||||
|
||||
#define IGMPCTL_NAMES { \
|
||||
{ 0, 0 }, \
|
||||
{ "stats", CTLTYPE_STRUCT }, \
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)ip_icmp.c 8.2 (Berkeley) 1/4/94
|
||||
* $Id: ip_icmp.c,v 1.3 1994/10/02 17:48:38 phk Exp $
|
||||
* $Id: ip_icmp.c,v 1.4 1994/10/08 22:39:56 phk Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -60,6 +60,7 @@
|
||||
* host table maintenance routines.
|
||||
*/
|
||||
|
||||
struct icmpstat icmpstat;
|
||||
int icmpmaskrepl = 0;
|
||||
#ifdef ICMPPRINTFS
|
||||
int icmpprintfs = 0;
|
||||
@ -582,14 +583,16 @@ icmp_sysctl(name, namelen, oldp, oldlenp, newp, newlen)
|
||||
void *newp;
|
||||
size_t newlen;
|
||||
{
|
||||
|
||||
/* All sysctl names at this level are terminal. */
|
||||
if (namelen != 1)
|
||||
return (ENOTDIR);
|
||||
return (ENOTDIR); /* XXX overloaded */
|
||||
|
||||
switch (name[0]) {
|
||||
case ICMPCTL_MASKREPL:
|
||||
return (sysctl_int(oldp, oldlenp, newp, newlen, &icmpmaskrepl));
|
||||
case ICMPCTL_STATS:
|
||||
return (sysctl_rdstruct(oldp, oldlenp, newp, &icmpstat,
|
||||
sizeof icmpstat));
|
||||
default:
|
||||
return (ENOPROTOOPT);
|
||||
}
|
||||
|
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)tcp_usrreq.c 8.2 (Berkeley) 1/3/94
|
||||
* $Id: tcp_usrreq.c,v 1.6 1994/12/15 20:39:34 wollman Exp $
|
||||
* $Id: tcp_usrreq.c,v 1.7 1995/02/09 23:13:27 wollman Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -590,13 +590,8 @@ tcp_ctloutput(op, so, level, optname, mp)
|
||||
* sizes, respectively. These are obsolescent (this information should
|
||||
* be set by the route).
|
||||
*/
|
||||
#ifdef TCP_SMALLSPACE
|
||||
u_long tcp_sendspace = 1024*4;
|
||||
u_long tcp_recvspace = 1024*4;
|
||||
#else
|
||||
u_long tcp_sendspace = 1024*16;
|
||||
u_long tcp_recvspace = 1024*16;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Attach TCP protocol to socket, allocating
|
||||
@ -721,11 +716,12 @@ tcp_sysctl(name, namelen, oldp, oldlenp, newp, newlen)
|
||||
void *newp;
|
||||
size_t newlen;
|
||||
{
|
||||
extern int tcp_do_rfc1323;
|
||||
extern int tcp_do_rfc1323; /* XXX */
|
||||
#ifdef TTCP
|
||||
extern int tcp_do_rfc1644;
|
||||
extern int tcp_do_rfc1644; /* XXX */
|
||||
#endif
|
||||
extern int tcp_mssdflt;
|
||||
extern int tcp_mssdflt; /* XXX */
|
||||
extern int tcp_rttdflt; /* XXX */
|
||||
|
||||
/* All sysctl names at this level are terminal. */
|
||||
if (namelen != 1)
|
||||
@ -743,6 +739,23 @@ tcp_sysctl(name, namelen, oldp, oldlenp, newp, newlen)
|
||||
case TCPCTL_MSSDFLT:
|
||||
return (sysctl_int(oldp, oldlenp, newp, newlen,
|
||||
&tcp_mssdflt));
|
||||
case TCPCTL_STATS:
|
||||
return (sysctl_rdstruct(oldp, oldlenp, newp, &tcpstat,
|
||||
sizeof tcpstat));
|
||||
case TCPCTL_RTTDFLT:
|
||||
return (sysctl_int(oldp, oldlenp, newp, newlen, &tcp_rttdflt));
|
||||
case TCPCTL_KEEPIDLE:
|
||||
return (sysctl_int(oldp, oldlenp, newp, newlen,
|
||||
&tcp_keepidle));
|
||||
case TCPCTL_KEEPINTVL:
|
||||
return (sysctl_int(oldp, oldlenp, newp, newlen,
|
||||
&tcp_keepintvl));
|
||||
case TCPCTL_SENDSPACE:
|
||||
return (sysctl_int(oldp, oldlenp, newp, newlen,
|
||||
(int *)&tcp_sendspace)); /* XXX */
|
||||
case TCPCTL_RECVSPACE:
|
||||
return (sysctl_int(oldp, oldlenp, newp, newlen,
|
||||
(int *)&tcp_recvspace)); /* XXX */
|
||||
default:
|
||||
return (ENOPROTOOPT);
|
||||
}
|
||||
|
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)tcp_var.h 8.3 (Berkeley) 4/10/94
|
||||
* $Id: tcp_var.h,v 1.6 1995/02/09 23:13:27 wollman Exp $
|
||||
* $Id: tcp_var.h,v 1.7 1995/02/14 02:35:19 wollman Exp $
|
||||
*/
|
||||
|
||||
#ifndef _NETINET_TCP_VAR_H_
|
||||
@ -285,13 +285,25 @@ struct tcpstat {
|
||||
#define TCPCTL_DO_RFC1323 1 /* use RFC-1323 extensions */
|
||||
#define TCPCTL_DO_RFC1644 2 /* use RFC-1644 extensions */
|
||||
#define TCPCTL_MSSDFLT 3 /* MSS default */
|
||||
#define TCPCTL_MAXID 4
|
||||
#define TCPCTL_STATS 4 /* statistics (read-only) */
|
||||
#define TCPCTL_RTTDFLT 5 /* default RTT estimate */
|
||||
#define TCPCTL_KEEPIDLE 6 /* keepalive idle timer */
|
||||
#define TCPCTL_KEEPINTVL 7 /* interval to send keepalives */
|
||||
#define TCPCTL_SENDSPACE 8 /* send buffer space */
|
||||
#define TCPCTL_RECVSPACE 9 /* receive buffer space */
|
||||
#define TCPCTL_MAXID 10
|
||||
|
||||
#define TCPCTL_NAMES { \
|
||||
{ 0, 0 }, \
|
||||
{ "rfc1323", CTLTYPE_INT }, \
|
||||
{ "rfc1644", CTLTYPE_INT }, \
|
||||
{ "mssdflt", CTLTYPE_INT }, \
|
||||
{ "stats", CTLTYPE_STRUCT }, \
|
||||
{ "rttdflt", CTLTYPE_INT }, \
|
||||
{ "keepidle", CTLTYPE_INT }, \
|
||||
{ "keepintvl", CTLTYPE_INT }, \
|
||||
{ "sendspace", CTLTYPE_INT }, \
|
||||
{ "recvspace", CTLTYPE_INT }, \
|
||||
}
|
||||
|
||||
#ifdef KERNEL
|
||||
|
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)udp_usrreq.c 8.4 (Berkeley) 1/21/94
|
||||
* $Id: udp_usrreq.c,v 1.3 1994/08/02 07:49:24 davidg Exp $
|
||||
* $Id: udp_usrreq.c,v 1.4 1994/10/02 17:48:45 phk Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -66,6 +66,9 @@ int udpcksum = 1;
|
||||
int udpcksum = 0; /* XXX */
|
||||
#endif
|
||||
|
||||
struct inpcb udb; /* from udp_var.h */
|
||||
struct udpstat udpstat; /* from udp_var.h */
|
||||
|
||||
struct sockaddr_in udp_in = { sizeof(udp_in), AF_INET };
|
||||
struct inpcb *udp_last_inpcb = &udb;
|
||||
|
||||
@ -637,6 +640,15 @@ udp_sysctl(name, namelen, oldp, oldlenp, newp, newlen)
|
||||
switch (name[0]) {
|
||||
case UDPCTL_CHECKSUM:
|
||||
return (sysctl_int(oldp, oldlenp, newp, newlen, &udpcksum));
|
||||
case UDPCTL_STATS:
|
||||
return (sysctl_rdstruct(oldp, oldlenp, newp, &udpstat,
|
||||
sizeof udpstat));
|
||||
case UDPCTL_MAXDGRAM:
|
||||
return (sysctl_int(oldp, oldlenp, newp, newlen,
|
||||
(int *)&udp_sendspace)); /* XXX */
|
||||
case UDPCTL_RECVSPACE:
|
||||
return (sysctl_int(oldp, oldlenp, newp, newlen,
|
||||
(int *)&udp_recvspace)); /* XXX */
|
||||
default:
|
||||
return (ENOPROTOOPT);
|
||||
}
|
||||
|
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)udp_var.h 8.1 (Berkeley) 6/10/93
|
||||
* $Id: udp_var.h,v 1.2 1994/08/02 07:49:26 davidg Exp $
|
||||
* $Id: udp_var.h,v 1.3 1994/08/21 05:27:42 paul Exp $
|
||||
*/
|
||||
|
||||
#ifndef _NETINET_UDP_VAR_H_
|
||||
@ -74,16 +74,22 @@ struct udpstat {
|
||||
* Names for UDP sysctl objects
|
||||
*/
|
||||
#define UDPCTL_CHECKSUM 1 /* checksum UDP packets */
|
||||
#define UDPCTL_MAXID 2
|
||||
#define UDPCTL_STATS 2 /* statistics (read-only) */
|
||||
#define UDPCTL_MAXDGRAM 3 /* max datagram size */
|
||||
#define UDPCTL_RECVSPACE 4 /* default receive buffer space */
|
||||
#define UDPCTL_MAXID 5
|
||||
|
||||
#define UDPCTL_NAMES { \
|
||||
{ 0, 0 }, \
|
||||
{ "checksum", CTLTYPE_INT }, \
|
||||
{ "stats", CTLTYPE_STRUCT }, \
|
||||
{ "maxdgram", CTLTYPE_INT }, \
|
||||
{ "recvspace", CTLTYPE_INT }, \
|
||||
}
|
||||
|
||||
#ifdef KERNEL
|
||||
struct inpcb udb;
|
||||
struct udpstat udpstat;
|
||||
extern struct inpcb udb;
|
||||
extern struct udpstat udpstat;
|
||||
|
||||
void udp_ctlinput __P((int, struct sockaddr *, struct ip *));
|
||||
void udp_init __P((void));
|
||||
|
Loading…
Reference in New Issue
Block a user