Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Aug 2005 14:12:24 GMT
From:      Victor Cruceru <soc-victor@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 82445 for review
Message-ID:  <200508231412.j7NECO7J038846@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=82445

Change 82445 by soc-victor@soc-victor_82.76.158.176 on 2005/08/23 14:11:39

	1)Start the SNMP work for RFC 4022 (unified IPv4 and IPv6 TCP-MIB):
	a) Deactivated the old IPv4 only implementation (RFC1213-MIB) which is now
	deprecated - but covered by RFC 4022 for backward compatibility -.
	b) Added the boilerplate code for the new RFC 4022 module
	
	2) Fixed a bug in HOST-RESOURCES-MIB's hrPrinterTable: if the printer's device
	is gone, this means that the printer is missing.
	
	3)Added an example in the agent config file about how HOST-RESOURCES-MIB can
	be configured.

Affected files ...

.. //depot/projects/soc2005/bsnmp/contrib/bsnmp/snmp_mibII/mibII.c#3 edit
.. //depot/projects/soc2005/bsnmp/contrib/bsnmp/snmp_mibII/mibII_tree.def#2 edit
.. //depot/projects/soc2005/bsnmp/contrib/bsnmp/snmpd/snmpd.config#2 edit
.. //depot/projects/soc2005/bsnmp/usr.sbin/bsnmpd/modules/Makefile#4 edit
.. //depot/projects/soc2005/bsnmp/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_printer_tbl.c#4 edit
.. //depot/projects/soc2005/bsnmp/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile#2 edit
.. //depot/projects/soc2005/bsnmp/usr.sbin/bsnmpd/modules/snmp_tcp46/INET-ADDRESS-MIB.txt#1 add
.. //depot/projects/soc2005/bsnmp/usr.sbin/bsnmpd/modules/snmp_tcp46/TCP-MIB.txt#1 add
.. //depot/projects/soc2005/bsnmp/usr.sbin/bsnmpd/modules/snmp_tcp46/tcp46_snmp.c#1 add
.. //depot/projects/soc2005/bsnmp/usr.sbin/bsnmpd/modules/snmp_tcp46/tcp46_tree.def#1 add

Differences ...

==== //depot/projects/soc2005/bsnmp/contrib/bsnmp/snmp_mibII/mibII.c#3 (text+ko) ====

@@ -57,7 +57,9 @@
 /* OR registrations */
 static u_int ifmib_reg;
 static u_int ipmib_reg;
+#if 0
 static u_int tcpmib_reg;
+#endif /*0*/
 static u_int udpmib_reg;
 static u_int ipForward_reg;
 
@@ -112,7 +114,9 @@
 
 static const struct asn_oid oid_ifMIB = OIDX_ifMIB;
 static const struct asn_oid oid_ipMIB = OIDX_ipMIB;
+#if 0
 static const struct asn_oid oid_tcpMIB = OIDX_tcpMIB;
+#endif /*0*/
 static const struct asn_oid oid_udpMIB = OIDX_udpMIB;
 static const struct asn_oid oid_ipForward = OIDX_ipForward;
 static const struct asn_oid oid_linkDown = OIDX_linkDown;
@@ -1441,9 +1445,10 @@
 	ipmib_reg = or_register(&oid_ipMIB,
 	   "The MIB module for managing IP and ICMP implementations, but "
 	   "excluding their management of IP routes.", module);
-
+#if 0
 	tcpmib_reg = or_register(&oid_tcpMIB,
 	   "The MIB module for managing TCP implementations.", module);
+#endif /*0*/
 
 	udpmib_reg = or_register(&oid_udpMIB,
 	   "The MIB module for managing UDP implementations.", module);
@@ -1505,7 +1510,9 @@
 
 	or_unregister(ipForward_reg);
 	or_unregister(udpmib_reg);
+#if 0	
 	or_unregister(tcpmib_reg);
+#endif /*0*/	
 	or_unregister(ipmib_reg);
 	or_unregister(ifmib_reg);
 

==== //depot/projects/soc2005/bsnmp/contrib/bsnmp/snmp_mibII/mibII_tree.def#2 (text+ko) ====

@@ -148,30 +148,30 @@
         (25 icmpOutAddrMasks COUNTER op_icmpstat GET)
         (26 icmpOutAddrMaskReps COUNTER op_icmpstat GET)
       )
-      (6 tcp
-        (1 tcpRtoAlgorithm INTEGER op_tcp GET)
-        (2 tcpRtoMin INTEGER32 op_tcp GET)
-        (3 tcpRtoMax INTEGER32 op_tcp GET)
-        (4 tcpMaxConn INTEGER32 op_tcp GET)
-        (5 tcpActiveOpens COUNTER op_tcp GET)
-        (6 tcpPassiveOpens COUNTER op_tcp GET)
-        (7 tcpAttemptFails COUNTER op_tcp GET)
-        (8 tcpEstabResets COUNTER op_tcp GET)
-        (9 tcpCurrEstab GAUGE op_tcp GET)
-        (10 tcpInSegs COUNTER op_tcp GET)
-        (11 tcpOutSegs COUNTER op_tcp GET)
-        (12 tcpRetransSegs COUNTER op_tcp GET)
-        (13 tcpConnTable
-          (1 tcpConnEntry : IPADDRESS INTEGER IPADDRESS INTEGER op_tcpconn
-            (1 tcpConnState INTEGER GET)
-            (2 tcpConnLocalAddress IPADDRESS GET)
-            (3 tcpConnLocalPort INTEGER GET)
-            (4 tcpConnRemAddress IPADDRESS GET)
-            (5 tcpConnRemPort INTEGER GET)
-        ))
-        (14 tcpInErrs COUNTER op_tcp GET)
-        (15 tcpOutRsts COUNTER op_tcp)		# don't know
-      )
+#      (6 tcp
+#        (1 tcpRtoAlgorithm INTEGER op_tcp GET)
+#        (2 tcpRtoMin INTEGER32 op_tcp GET)
+#        (3 tcpRtoMax INTEGER32 op_tcp GET)
+#        (4 tcpMaxConn INTEGER32 op_tcp GET)
+#        (5 tcpActiveOpens COUNTER op_tcp GET)
+#        (6 tcpPassiveOpens COUNTER op_tcp GET)
+#        (7 tcpAttemptFails COUNTER op_tcp GET)
+#        (8 tcpEstabResets COUNTER op_tcp GET)
+#        (9 tcpCurrEstab GAUGE op_tcp GET)
+#        (10 tcpInSegs COUNTER op_tcp GET)
+#        (11 tcpOutSegs COUNTER op_tcp GET)
+#        (12 tcpRetransSegs COUNTER op_tcp GET)
+#        (13 tcpConnTable
+#          (1 tcpConnEntry : IPADDRESS INTEGER IPADDRESS INTEGER op_tcpconn
+#            (1 tcpConnState INTEGER GET)
+#            (2 tcpConnLocalAddress IPADDRESS GET)
+#            (3 tcpConnLocalPort INTEGER GET)
+#            (4 tcpConnRemAddress IPADDRESS GET)
+#            (5 tcpConnRemPort INTEGER GET)
+#        ))
+#        (14 tcpInErrs COUNTER op_tcp GET)
+#        (15 tcpOutRsts COUNTER op_tcp)		# don't know
+#      )
       (7 udp
         (1 udpInDatagrams COUNTER op_udp GET)
         (2 udpNoPorts COUNTER op_udp GET)

==== //depot/projects/soc2005/bsnmp/contrib/bsnmp/snmpd/snmpd.config#2 (text+ko) ====

@@ -80,6 +80,13 @@
 #
 begemotSnmpdModulePath."mibII"	= "/usr/local/lib/snmp_mibII.so"
 
+
+#
+# Load HOST-RESOURCES-MIB module
+#
+begemotSnmpdModulePath."hostres"  = "/usr/lib/snmp_hostres.so"
+
+
 #
 # Netgraph module
 #

==== //depot/projects/soc2005/bsnmp/usr.sbin/bsnmpd/modules/Makefile#4 (text+ko) ====

@@ -10,7 +10,8 @@
         snmp_hostres \
 	snmp_mibII \
 	snmp_netgraph \
-	snmp_pf 
+	snmp_pf \
+	snmp_tcp46 
 
 INCS=	snmpmod.h
 INCSDIR= ${INCLUDEDIR}/bsnmp

==== //depot/projects/soc2005/bsnmp/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_printer_tbl.c#4 (text+ko) ====

@@ -79,6 +79,7 @@
 #include <paths.h>
 #include <syslog.h>
 #include <err.h>
+#include <sys/stat.h>
 
 
 #define	_PATH_PRINTCAP		"/etc/printcap"
@@ -692,7 +693,8 @@
 	struct hrDeviceTblEntry* dev_entry = NULL;
 	struct hrPrinterTblEntry* printer_entry = NULL;
 	char dev_only[128];
-
+	struct stat sb;
+	
 	if (pp->rp_matches_local != 1) {
 		HR_DPRINTF((stderr,
 		"hrPrinterTable: skipped %s because it is not a local one\n",
@@ -717,6 +719,16 @@
 		pp->printer,
 		dev_only ));	
 	
+	if (stat(pp->lp, &sb) < 0) {
+		if (errno == ENOENT) {
+			HR_DPRINTF((stderr,
+				"hrPrinterTable: printer %s has its device %s missing. SKIPPING it.\n",
+				pp->printer,
+				pp->lp));
+			return;	
+		}		
+		
+	}
 	
 	dev_entry = hrDeviceTblEntry_find_by_name(dev_only);
 

==== //depot/projects/soc2005/bsnmp/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile#2 (text+ko) ====

@@ -8,8 +8,8 @@
 MOD=	mibII
 SRCS=	mibII.c mibII_ifmib.c mibII_ip.c mibII_interfaces.c		\
 	mibII_ipaddr.c mibII_ifstack.c mibII_rcvaddr.c			\
-	mibII_nettomedia.c mibII_tcp.c mibII_udp.c mibII_route.c
-XSYM=	ipAddrTable ifTable ifRcvAddressEntry ifMIB ipMIB tcpMIB udpMIB	\
+	mibII_nettomedia.c mibII_udp.c mibII_route.c
+XSYM=	ipAddrTable ifTable ifRcvAddressEntry ifMIB ipMIB udpMIB	\
 	ipForward ifIndex linkDown linkUp
 MAN=	snmp_mibII.3
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200508231412.j7NECO7J038846>