PERFORCE change 90659 for review

soc-shteryana soc-shteryana at FreeBSD.org
Sun Jan 29 16:14:04 PST 2006


http://perforce.freebsd.org/chv.cgi?CH=90659

Change 90659 by soc-shteryana at prometheus on 2006/01/30 00:13:23

		IFC
	currently needs a dummy int debug_on = 0; to be able to compile around line 65
	in contrib/bsnmp/snmpd/main.c because of extern int debug_on in libbsnmp;
	to be fixed shortly 	

Affected files ...

.. //depot/projects/soc2005/bsnmp/contrib/bsnmp/FREEBSD-Xlist#2 integrate
.. //depot/projects/soc2005/bsnmp/contrib/bsnmp/NEWS#2 integrate
.. //depot/projects/soc2005/bsnmp/contrib/bsnmp/VERSION#2 integrate
.. //depot/projects/soc2005/bsnmp/contrib/bsnmp/gensnmpdef/gensnmpdef.1#2 integrate
.. //depot/projects/soc2005/bsnmp/contrib/bsnmp/gensnmptree/gensnmptree.1#2 integrate
.. //depot/projects/soc2005/bsnmp/contrib/bsnmp/gensnmptree/gensnmptree.c#3 integrate
.. //depot/projects/soc2005/bsnmp/contrib/bsnmp/lib/asn1.3#2 integrate
.. //depot/projects/soc2005/bsnmp/contrib/bsnmp/lib/asn1.c#2 integrate
.. //depot/projects/soc2005/bsnmp/contrib/bsnmp/lib/asn1.h#2 integrate
.. //depot/projects/soc2005/bsnmp/contrib/bsnmp/lib/bsnmpagent.3#2 integrate
.. //depot/projects/soc2005/bsnmp/contrib/bsnmp/lib/bsnmpclient.3#2 integrate
.. //depot/projects/soc2005/bsnmp/contrib/bsnmp/lib/bsnmplib.3#2 integrate
.. //depot/projects/soc2005/bsnmp/contrib/bsnmp/lib/snmp.c#2 integrate
.. //depot/projects/soc2005/bsnmp/contrib/bsnmp/lib/snmpagent.c#2 integrate
.. //depot/projects/soc2005/bsnmp/contrib/bsnmp/lib/snmpclient.c#2 integrate
.. //depot/projects/soc2005/bsnmp/contrib/bsnmp/snmp_mibII/mibII.c#7 integrate
.. //depot/projects/soc2005/bsnmp/contrib/bsnmp/snmp_mibII/mibII.h#2 integrate
.. //depot/projects/soc2005/bsnmp/contrib/bsnmp/snmp_mibII/mibII_interfaces.c#2 integrate
.. //depot/projects/soc2005/bsnmp/contrib/bsnmp/snmp_mibII/mibII_ipaddr.c#2 integrate
.. //depot/projects/soc2005/bsnmp/contrib/bsnmp/snmp_mibII/mibII_route.c#2 integrate
.. //depot/projects/soc2005/bsnmp/contrib/bsnmp/snmp_mibII/snmp_mibII.3#2 integrate
.. //depot/projects/soc2005/bsnmp/contrib/bsnmp/snmp_ntp/BEGEMOT-NTP-MIB.txt#2 integrate
.. //depot/projects/soc2005/bsnmp/contrib/bsnmp/snmp_ntp/snmp_ntp.c#2 integrate
.. //depot/projects/soc2005/bsnmp/contrib/bsnmp/snmpd/.gdbinit#2 delete
.. //depot/projects/soc2005/bsnmp/contrib/bsnmp/snmpd/bsnmpd.1#2 integrate
.. //depot/projects/soc2005/bsnmp/contrib/bsnmp/snmpd/config.c#2 integrate
.. //depot/projects/soc2005/bsnmp/contrib/bsnmp/snmpd/main.c#3 integrate
.. //depot/projects/soc2005/bsnmp/contrib/bsnmp/snmpd/snmpd.config#4 integrate
.. //depot/projects/soc2005/bsnmp/contrib/bsnmp/snmpd/snmpmod.3#2 integrate
.. //depot/projects/soc2005/bsnmp/contrib/bsnmp/snmpd/snmpmod.h#3 integrate
.. //depot/projects/soc2005/bsnmp/contrib/bsnmp/snmpd/trans_udp.c#2 integrate
.. //depot/projects/soc2005/bsnmp/contrib/bsnmp/snmpd/trap.c#2 integrate
.. //depot/projects/soc2005/bsnmp/lib/libbsnmp/libbsnmp/Makefile#3 integrate
.. //depot/projects/soc2005/bsnmp/usr.sbin/bsnmpd/bsnmpd/Makefile#2 integrate
.. //depot/projects/soc2005/bsnmp/usr.sbin/bsnmpd/gensnmptree/Makefile#2 integrate
.. //depot/projects/soc2005/bsnmp/usr.sbin/bsnmpd/modules/Makefile#6 integrate
.. //depot/projects/soc2005/bsnmp/usr.sbin/bsnmpd/modules/Makefile.inc#3 integrate
.. //depot/projects/soc2005/bsnmp/usr.sbin/bsnmpd/modules/snmp_atm/Makefile#2 integrate
.. //depot/projects/soc2005/bsnmp/usr.sbin/bsnmpd/modules/snmp_hostres/BEGEMOT-HOSTRES-MIB.txt#1 branch
.. //depot/projects/soc2005/bsnmp/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_begemot.c#1 branch
.. //depot/projects/soc2005/bsnmp/usr.sbin/bsnmpd/modules/snmp_hostres/snmp_hostres.3#1 branch
.. //depot/projects/soc2005/bsnmp/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile#4 integrate
.. //depot/projects/soc2005/bsnmp/usr.sbin/bsnmpd/modules/snmp_netgraph/Makefile#2 integrate
.. //depot/projects/soc2005/bsnmp/usr.sbin/bsnmpd/modules/snmp_netgraph/snmp_netgraph.3#3 integrate
.. //depot/projects/soc2005/bsnmp/usr.sbin/bsnmpd/modules/snmp_netgraph/snmp_netgraph.c#2 integrate
.. //depot/projects/soc2005/bsnmp/usr.sbin/bsnmpd/modules/snmp_pf/Makefile#2 integrate
.. //depot/projects/soc2005/bsnmp/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c#3 integrate

Differences ...

==== //depot/projects/soc2005/bsnmp/contrib/bsnmp/FREEBSD-Xlist#2 (text+ko) ====

@@ -1,4 +1,4 @@
-#$FreeBSD: src/contrib/bsnmp/FREEBSD-Xlist,v 1.3 2005/02/28 17:29:10 harti Exp $
+#$FreeBSD: src/contrib/bsnmp/FREEBSD-Xlist,v 1.4 2005/10/04 14:53:06 harti Exp $
 */Makefile.in
 */acinclude.m4
 */aclocal.m4
@@ -10,5 +10,6 @@
 */gensnmptree/Makefile.in
 */lib/Makefile.in
 */snmp_mibII/Makefile.in
+*/snmp_ntp/Makefile.in
 */snmpd/Makefile.in
 */snmpd/.gdbinit

==== //depot/projects/soc2005/bsnmp/contrib/bsnmp/NEWS#2 (text+ko) ====

@@ -1,3 +1,25 @@
+1.11	Make the Mib2 routing table use red-black tree. This vastly
+	reduces loading and access time. Load the table only every 10
+	minutes. In the meantime process message from the routing socket
+	to update the table.
+
+	Lot of man-page fixes from ru at freebsd.org.
+
+	Fixes to command line macros and macro redefinition.
+
+	Trap variables for ntp (still need trap definition and code).
+
+	Periodic timers from Victor Cruceru.
+
+	Man-page fixes from Christian Brueffer.
+
+	Lots of spelling fixes from Giorgios Keramidas.
+
+	A number of changes to facilitate building on FreeBSD-4 from
+	Andrey Elsukov.
+
+	Add repeatable timers.
+
 1.10
 	Change all the tick handling in the daemon from 32-bit to 64-bit.
 	Bump the modules' major version number to 3.
@@ -34,7 +56,7 @@
 	Maxim Konovalov)
 
 1.7
-	snmpd: Move event library initialisation before reading of
+	snmpd: Move event library initialization before reading of
 	config file (thanks to phk).
 
 	gensnmptree: can now read more than one tree and merge them.

==== //depot/projects/soc2005/bsnmp/contrib/bsnmp/VERSION#2 (text+ko) ====

@@ -1,1 +1,1 @@
-1.10
+1.11

==== //depot/projects/soc2005/bsnmp/contrib/bsnmp/gensnmpdef/gensnmpdef.1#2 (text+ko) ====

@@ -1,5 +1,5 @@
 .\"
-.\" Copyright (C) 2004
+.\" Copyright (C) 2004-2005
 .\"	Hartmut Brandt.
 .\"	All rights reserved.
 .\"
@@ -26,9 +26,9 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.\" $Begemot: bsnmp/gensnmpdef/gensnmpdef.1,v 1.3 2005/02/25 11:55:54 brandt_h Exp $
+.\" $Begemot: bsnmp/gensnmpdef/gensnmpdef.1,v 1.5 2005/10/04 08:46:46 brandt_h Exp $
 .\"
-.Dd April 14, 2004
+.Dd June 14, 2005
 .Dt GENSNMPDEF 1
 .Os
 .Sh NAME
@@ -43,7 +43,8 @@
 The
 .Nm
 utility is used to create an initial MIB description file from
-one or more MIBs. The description file must be edited to be actually useful
+one or more MIBs.
+The description file must be edited to be actually useful
 for feeding it into
 .Xr gensnmptree 1 .
 .Pp
@@ -57,13 +58,13 @@
 .Pp
 .Nm
 does no attempt on sorting the OID tree so in case of complex and
-non-standard MIBs it is necessay to sort the tree in the resulting definition
+non-standard MIBs it is necessary to sort the tree in the resulting definition
 file by hand.
 .Sh SEE ALSO
 .Xr snmpd 1
+.Sh AUTHORS
+.An Hartmut Brandt Aq harti at freebsd.org
 .Sh BUGS
 The utility is by no means bullet-proof and may fail for complex
 or non-standard MIBs.
 Its output is expected to be edited by hand.
-.Sh AUTHORS
-.An Hartmut Brandt Aq harti at freebsd.org

==== //depot/projects/soc2005/bsnmp/contrib/bsnmp/gensnmptree/gensnmptree.1#2 (text+ko) ====

@@ -1,5 +1,5 @@
 .\"
-.\" Copyright (c) 2001-2003
+.\" Copyright (c) 2001-2005
 .\"	Fraunhofer Institute for Open Communication Systems (FhG Fokus).
 .\"	All rights reserved.
 .\"
@@ -26,9 +26,9 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.\" $Begemot: bsnmp/gensnmptree/gensnmptree.1,v 1.4 2005/02/25 11:55:56 brandt_h Exp $
+.\" $Begemot: bsnmp/gensnmptree/gensnmptree.1,v 1.5 2005/06/15 11:31:25 brandt_h Exp $
 .\"
-.Dd October 7, 2003
+.Dd June 14, 2005
 .Dt GENSNMPTREE 1
 .Os
 .Sh NAME
@@ -43,8 +43,8 @@
 The
 .Nm
 utility is used to either generate C language tables and header files from
-a MIB description or to numeric OIDs from MIB descriptions. The first form
-is used only for maintaining the
+a MIB description or to numeric OIDs from MIB descriptions.
+The first form is used only for maintaining the
 .Xr snmpd 1
 daemon or for module writers.
 The second form may be used by SNMP client program writers.
@@ -70,7 +70,8 @@
 .Nm
 expects MIB variable names (only the last component) on its command line.
 It reads a MIB specification from standard input and for each MIB variable
-name emits two C preprocessor defines on its standard output. One define
+name emits two C preprocessor defines on its standard output.
+One define
 .Va OID_ Ns Ar name
 can be used as an array initialized to initialize a
 .Va struct asn_oid .
@@ -85,7 +86,8 @@
 .It Fl e
 Enter extract mode.
 .It Fl l
-Generate local preprocessor includes. This is used for bootstrapping
+Generate local preprocessor includes.
+This is used for bootstrapping
 .Xr snmpd 1 .
 .It Fl t
 Instead of normal output print the resulting tree.

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

@@ -30,7 +30,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $Begemot: bsnmp/gensnmptree/gensnmptree.c,v 1.42 2005/04/26 16:26:19 brandt_h Exp $
+ * $Begemot: bsnmp/gensnmptree/gensnmptree.c,v 1.43 2005/10/04 11:21:29 brandt_h Exp $
  *
  * Generate OID table from table description.
  *
@@ -353,6 +353,7 @@
 
 	node = xalloc(sizeof(struct node));
 	node->lno = lno;
+	node->flags = 0;
 
 	if (tok != '(')
 		report("'(' expected at begin of node");
@@ -595,7 +596,9 @@
 
 	fprintf(fp, "#include <sys/types.h>\n");
 	fprintf(fp, "#include <stdio.h>\n");
+#ifdef HAVE_STDINT_H
 	fprintf(fp, "#include <stdint.h>\n");
+#endif
 	if (localincs) {
 		fprintf(fp, "#include \"asn1.h\"\n");
 		fprintf(fp, "#include \"snmp.h\"\n");

==== //depot/projects/soc2005/bsnmp/contrib/bsnmp/lib/asn1.3#2 (text+ko) ====

@@ -1,4 +1,7 @@
 .\"
+.\" Copyright (c) 2004-2005
+.\"	Hartmut Brandt.
+.\"	All rights reserved.
 .\" Copyright (c) 2001-2003
 .\"	Fraunhofer Institute for Open Communication Systems (FhG Fokus).
 .\"	All rights reserved.
@@ -26,9 +29,9 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.\" $Begemot: bsnmp/lib/asn1.3,v 1.6 2005/02/25 11:55:57 brandt_h Exp $
+.\" $Begemot: bsnmp/lib/asn1.3,v 1.9 2005/10/04 08:46:49 brandt_h Exp $
 .\"
-.Dd August 15, 2002
+.Dd October 4, 2005
 .Dt ASN1 3
 .Os
 .Sh NAME
@@ -142,8 +145,8 @@
 .Fn asn_oid2str "const struct asn_oid *oid"
 .Sh DESCRIPTION
 The ASN.1 library contains routines to handle ASN.1 encoding for SNMP.
-It supports only the restricted form of ASN.1 as required by SNMP. There
-are two basic structures used throughout the library:
+It supports only the restricted form of ASN.1 as required by SNMP.
+There are two basic structures used throughout the library:
 .Bd -literal -offset indent
 /* these restrictions are in the SMI */
 #define ASN_MAXID	0xffffffff
@@ -176,17 +179,18 @@
 #define asn_ptr	asn_u.ptr
 .Ed
 .Pp
-This structure is used to encode and decode ASN.1. It describes the output
+This structure is used to encode and decode ASN.1.
+It describes the output
 buffer for encoding routines and the input buffer for decoding routines.
 For encoding
 .Fa asn_len
-holds the number of remaining free octets in the buffer. The first free byte
-is pointed to by
+holds the number of remaining free octets in the buffer.
+The first free byte is pointed to by
 .Fa asn_ptr .
 For decoding
 .Fa asn_len
-holds the number of remaining bytes to decode. The next byte to decode is pointed
-to by
+holds the number of remaining bytes to decode.
+The next byte to decode is pointed to by
 .Fa asn_cptr .
 .Pp
 Most of the functions return an error code
@@ -216,20 +220,20 @@
 .Pp
 The function
 .Fn asn_get_header
-reads the next header from the input octet stream. It returns the tag
-in the variable pointed to by
+reads the next header from the input octet stream.
+It returns the tag in the variable pointed to by
 .Fa type
 (note that only single byte tags are supported) and the decoded length field
 in the value pointed to by
 .Fa lenp
-(this is restricted to a unsigned 32-bit value). All errors in this function
-are fatal and stop processing.
+(this is restricted to a unsigned 32-bit value).
+All errors in this function are fatal and stop processing.
 .Pp
 The function
 .Fn asn_put_header
 writes an ASN.1 header.
 .Fa type
-is the tag to write and is restricted to one byte tags (i.e. tags
+is the tag to write and is restricted to one byte tags (i.e., tags
 lesser or equal than 0x30).
 .Fa len
 is the length of the value and is restricted to 16-bit.
@@ -246,15 +250,18 @@
 and space for the maximum supported length field and sets the pointer pointed
 to by
 .Fa ptr
-to the begin of this length field. This pointer must then be fed into
+to the begin of this length field.
+This pointer must then be fed into
 .Fn asn_commit_header
-directly after writing the value to the buffer. The function will compute the
+directly after writing the value to the buffer.
+The function will compute the
 length, insert it into the right place and shift the value if the resulting
 length field is shorter than the estimated one.
 .Pp
 The function
 .Fn asn_get_integer_raw
-is used to decode a signed integer value (32-bit). It assumes, that the
+is used to decode a signed integer value (32-bit).
+It assumes, that the
 header of the integer has been decoded already.
 .Fa len
 is the length obtained from the ASN.1 header and the integer will be returned
@@ -263,8 +270,8 @@
 .Pp
 The function
 .Fn asn_get_integer
-decodes a complete 32-bit signed integer including the header. If the
-tag is wrong
+decodes a complete 32-bit signed integer including the header.
+If the tag is wrong
 .Li ASN_ERR_TAG
 is returned.
 The function
@@ -273,14 +280,16 @@
 .Pp
 The function
 .Fn asn_get_octetstring_raw
-decodes the value field of an ASN.1 octet string. The length obtained from the
-header must be fed into the
+decodes the value field of an ASN.1 octet string.
+The length obtained from the header must be fed into the
 .Fa len
 argument and
 .Fa out
-must point to a buffer to receive the octet string. On entry to the function
+must point to a buffer to receive the octet string.
+On entry to the function
 .Fa outsize
-must point to the size of the buffer. On exit
+must point to the size of the buffer.
+On exit
 .Fa outsize
 will point to the number of octets decoded (if no error occurs this will be
 equal to
@@ -291,7 +300,8 @@
 .Fa out
 must point to a buffer to receive the string,
 .Fa outsize
-must point to the size of the buffer. On exit of the function
+must point to the size of the buffer.
+On exit of the function
 .Fa outsize
 will point to the number of octets decoded.
 The function
@@ -316,7 +326,8 @@
 .Pp
 The function
 .Fn asn_put_exception
-is used to encode an SNMPv2 exception. The exception type is
+is used to encode an SNMPv2 exception.
+The exception type is
 .Fa type .
 .Pp
 The function
@@ -369,8 +380,8 @@
 .Fn asn_get_counter64_raw
 decodes an unsigned 64-bit integer value.
 .Fa len
-must be the value length from the header. The resulting value is
-stored into the variable pointed to by
+must be the value length from the header.
+The resulting value is stored into the variable pointed to by
 .Fa res .
 The function
 .Fn asn_put_counter64
@@ -392,12 +403,12 @@
 .Pp
 The function
 .Fn asn_slice_oid
-splits a part out from an OID. It takes all the subids from the OID
-pointed to by
+splits a part out from an OID.
+It takes all the subids from the OID pointed to by
 .Fa src
 starting with the subid at position
 .Fa from
-(the first subid beeing subid 0) up to, but not including, subid
+(the first subid being subid 0) up to, but not including, subid
 .Fa to
 and generates a new OID in
 .Fa dest .
@@ -413,8 +424,8 @@
 .Fa from
 to the OID
 .Fa to
-given that the resulting OID is not too long. If the maximum length is exceeded
-the result is undefined.
+given that the resulting OID is not too long.
+If the maximum length is exceeded the result is undefined.
 .Pp
 The function
 .Fn asn_compare_oid
@@ -442,7 +453,8 @@
 .Fa oid .
 The buffer pointed to by
 .Fa str
-must be large enough to hold the result. The constant
+must be large enough to hold the result.
+The constant
 .Li ASN_OIDSTRLEN
 is defined to be the length of the maximum string generated by this function
 (including the trailing NUL).
@@ -452,7 +464,7 @@
 .Fa oid
 into a private buffer that is overwritten by each call.
 .Sh DIAGNOSTICS
-When an error occures in any of the function the function pointed to
+When an error occurs in any of the function the function pointed to
 by the global pointer
 .Bd -literal -offset indent
 extern void (*asn_error)(const struct asn_buf *, const char *, ...);
@@ -469,7 +481,7 @@
 followed by the error message and an optional dump of the buffer.
 .Sh SEE ALSO
 .Xr gensnmptree 1 ,
-.Xr snmpd 1 ,
+.Xr bsnmpd 1 ,
 .Xr bsnmpagent 3 ,
 .Xr bsnmpclient 3 ,
 .Xr bsnmplib 3

==== //depot/projects/soc2005/bsnmp/contrib/bsnmp/lib/asn1.c#2 (text+ko) ====

@@ -26,7 +26,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $Begemot: bsnmp/lib/asn1.c,v 1.28 2004/08/06 08:46:49 brandt Exp $
+ * $Begemot: bsnmp/lib/asn1.c,v 1.29 2005/10/04 11:21:31 brandt_h Exp $
  *
  * ASN.1 for SNMP.
  */
@@ -35,10 +35,24 @@
 #include <stdlib.h>
 #include <stdarg.h>
 #include <string.h>
+#ifdef HAVE_STDINT_H
 #include <stdint.h>
+#elif defined(HAVE_INTTYPES_H)
+#include <inttypes.h>
+#endif
 #include <assert.h>
 #include "asn1.h"
 
+#if !defined(INT32_MIN)
+#define	INT32_MIN	(-0x7fffffff-1)
+#endif
+#if !defined(INT32_MAX)
+#define	INT32_MAX	(0x7fffffff)
+#endif
+#if !defined(UINT32_MAX)
+#define	UINT32_MAX	(0xffffffff)
+#endif
+
 static void asn_error_func(const struct asn_buf *, const char *, ...);
 
 void (*asn_error)(const struct asn_buf *, const char *, ...) = asn_error_func;

==== //depot/projects/soc2005/bsnmp/contrib/bsnmp/lib/asn1.h#2 (text+ko) ====

@@ -26,7 +26,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $Begemot: bsnmp/lib/asn1.h,v 1.18 2004/08/06 08:46:50 brandt Exp $
+ * $Begemot: bsnmp/lib/asn1.h,v 1.19 2005/10/04 11:21:31 brandt_h Exp $
  *
  * ASN.1 for SNMP
  */

==== //depot/projects/soc2005/bsnmp/contrib/bsnmp/lib/bsnmpagent.3#2 (text+ko) ====

@@ -1,4 +1,7 @@
 .\"
+.\" Copyright (c) 2004-2005
+.\"	Hartmut Brandt.
+.\"	All rights reserved.
 .\" Copyright (c) 2001-2003
 .\"	Fraunhofer Institute for Open Communication Systems (FhG Fokus).
 .\"	All rights reserved.
@@ -26,9 +29,9 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.\" $Begemot: bsnmp/lib/bsnmpagent.3,v 1.7 2005/02/25 11:55:58 brandt_h Exp $
+.\" $Begemot: bsnmp/lib/bsnmpagent.3,v 1.10 2005/10/04 08:46:49 brandt_h Exp $
 .\"
-.Dd August 16, 2002
+.Dd October 4, 2005
 .Dt BSNMPAGENT 3
 .Os
 .Sh NAME
@@ -87,14 +90,15 @@
 .Fn snmp_dep_finish "struct snmp_context *ctx"
 .Sh DESCRIPTION
 The SNMP library contains routines to easily build SNMP agent applications
-that use SNMP versions 1 or 2. Note, however, that it may be even easier to
-build an
-.Xr snmpd 1
+that use SNMP versions 1 or 2.
+Note, however, that it may be even easier to build an
+.Xr bsnmpd 1
 loadable module, that handles the new MIB (see
-.Xr snmpmod 3 ).
+.Xr snmpmod 3 ) .
 .Pp
 Most of the agent routines operate on a global array that the describes the
-complete MIB served by the agent. This array is held in the two variables:
+complete MIB served by the agent.
+This array is held in the two variables:
 .Bd -literal -offset indent
 extern struct snmp_node *tree;
 extern u_int  tree_size;
@@ -126,7 +130,8 @@
 .It Va name
 Name of this variable.
 .It Va type
-Type of this variable. One of:
+Type of this variable.
+One of:
 .Bd -literal -offset indent
 enum snmp_node_type {
 	SNMP_NODE_LEAF = 1,
@@ -136,17 +141,20 @@
 .It Va syntax
 The SNMP syntax of this variable.
 .It Va op
-The user supplied handler for this variable. The handler is called with
-the following arguments:
+The user supplied handler for this variable.
+The handler is called with the following arguments:
 .Bl -tag -width "ctx"
 .It Fa ctx
 A pointer to the context (see below).
 .Li NULL .
 .It Fa val
-The value to be set or retrieved. For GETNEXT and GETBULK operations the oid in
-this value is the current OID. The function (called in this case only for
+The value to be set or retrieved.
+For GETNEXT and GETBULK operations the oid in
+this value is the current OID.
+The function (called in this case only for
 table rows) must find the lexically next existing OID within the same column and
-set the oid and value subfields accordingly. If the table column is exhausted the
+set the oid and value subfields accordingly.
+If the table column is exhausted the
 function must return
 .Li SNMP_ERR_NOSUCHNAME .
 For all other operations the oid in
@@ -169,18 +177,20 @@
 .Ed
 .El
 .Pp
-The user handler must return an appropiate SNMP v2 error code. If the original
+The user handler must return an appropriate SNMP v2 error code.
+If the original
 PDU was a version 1 PDU, the error code is mapped automatically.
 .It Va flags
 Currently only the flag
 .Li SNMP_NODE_CANSET is defined and set for nodes, that can be written or
 created.
 .It Va index
-This word describes the index for table columns. Each part of the index
-takes 4 bits starting at bit 4. Bits 0 to 3 hold the number of index parts.
-This arrangment allows for tables with up to seven indexes. Each bit group
-contains the syntax for the index part. There are a number of macros to
-help in parsing this field:
+This word describes the index for table columns.
+Each part of the index takes 4 bits starting at bit 4.
+Bits 0 to 3 hold the number of index parts.
+This arrangement allows for tables with up to seven indexes.
+Each bit group contains the syntax for the index part.
+There are a number of macros to help in parsing this field:
 .Bd -literal -offset indent
 #define SNMP_INDEXES_MAX	7
 #define SNMP_INDEX_SHIFT	4
@@ -197,8 +207,9 @@
 The easiest way to construct the node table is
 .Xr gensnmptree 1 .
 Note, that one must be careful when changing the tree while executing a SET
-operation. Consult the sources for
-.Xr snmpd 1 .
+operation.
+Consult the sources for
+.Xr bsnmpd 1 .
 .Pp
 The global variable
 .Va snmp_trace
@@ -218,7 +229,8 @@
 .Pp
 Setting a bit to true causes the library to call
 .Fn snmp_debug
-in strategic places with a debug string. The library contains a default
+in strategic places with a debug string.
+The library contains a default
 implementation for the debug function that prints a message to standard error.
 .Pp
 Many of the functions use a so called context:
@@ -234,8 +246,8 @@
 struct snmp_scratch {
 	void		*ptr1;
 	void		*ptr2;
-	u_int32_t	int1;
-	u_int32_t	int2;
+	uint32_t	int1;
+	uint32_t	int2;
 };
 .Ed
 .Pp
@@ -243,15 +255,17 @@
 .Bl -tag -width ".It Va var_index"
 .It Va va_index
 For the node operation callback this is the
-index of the variable binding that should be returned if an error occures.
-Set by the library. In all other functions this is undefined.
+index of the variable binding that should be returned if an error occurs.
+Set by the library.
+In all other functions this is undefined.
 .It Va scratch
 For the node operation callback this is a pointer to a per variable binding
-scratch area that can be used to implement the commit and rollback. Set
-by the library.
+scratch area that can be used to implement the commit and rollback.
+Set by the library.
 .It Va dep
 In the dependency callback function (see below) this is a pointer to the
-current dependency. Set by the library.
+current dependency.
+Set by the library.
 .It Va data
 This is the
 .Fa data
@@ -267,21 +281,24 @@
 .Fn snmp_getbulk
 executes an SNMP GETBULK operation.
 For all three functions the response PDU is constructed and encoded
-on the fly. If everything is ok, the response PDU is returned in
+on the fly.
+If everything is ok, the response PDU is returned in
 .Fa resp
 and
 .Fa resp_b .
 The caller must call
 .Fn snmp_pdu_free
-to free the response PDU in this case. One of the following values may be
-returned:
+to free the response PDU in this case.
+One of the following values may be returned:
 .Bl -tag -width ".It Li SNMP_RET_ERR"
 .It Li SNMP_RET_OK
 Operation successful, response PDU may be sent.
 .It Li SNMP_RET_IGN
-Operation failed, no response PDU constructed. Request is ignored.
+Operation failed, no response PDU constructed.
+Request is ignored.
 .It Li SNMP_RET_ERR
-Error in operation. The error code and index have been set in
+Error in operation.
+The error code and index have been set in
 .Fa pdu .
 No response PDU has been constructed.
 The caller may construct an error response PDU via
@@ -290,47 +307,56 @@
 .Pp
 The function
 .Fn snmp_set
-executes an SNMP SET operation. The arguments are the same as for the previous
-three functions. The operation of this functions is, however, much more complex.
+executes an SNMP SET operation.
+The arguments are the same as for the previous
+three functions.
+The operation of this functions is, however, much more complex.
 .Pp
-The SET operation occures in several stages:
+The SET operation occurs in several stages:
 .Bl -enum -offset indent
 .It
 For each binding search the corresponding nodes, check that the
-variable is writeable and the syntax is ok. The writeable check can be done
-only for scalars. For columns it must be done in the node's operation callback
-function.
+variable is writeable and the syntax is ok.
+The writeable check can be done only for scalars.
+For columns it must be done in the node's operation callback function.
 .It
 For each binding call the node's operation callback with function SNMP_OP_SET.
-The callback may create dependencies or finalizers (see below). For simple
+The callback may create dependencies or finalizers (see below).
+For simple
 scalars the scratch area may be enough to handle commit and rollback, for
-interdependend table columns dependencies may be necessary.
+interdependent table columns dependencies may be necessary.
 .It
 If the previous step fails at any point, the node's operation callback
 functions are called for all bindings for which SNMP_OP_SET was executed
-with SNMP_OP_ROLLBACK, in the opposite order. This allows all variables to
-undo the effect of the SET operation. After this all the dependencies
-are freed
-and the finalizers are executed with a fail flag of 1. Then the function
+with SNMP_OP_ROLLBACK, in the opposite order.
+This allows all variables to undo the effect of the SET operation.
+After this all the dependencies are freed
+and the finalizers are executed with a fail flag of 1.
+Then the function
 returns to the caller with an appropriate error indication.
 .It
 If the SET step was successful for all bindings, the dependency callbacks
 are executed in the order in which the dependencies were created with an
-operation of SNMP_DEPOP_COMMIT. If any of the dependencies fails, all the
+operation of SNMP_DEPOP_COMMIT.
+If any of the dependencies fails, all the
 committed dependencies are called again in the opposite order
-with SNMP_DEPOP_ROLLBACK. Than for all bindings from the last to the first
+with SNMP_DEPOP_ROLLBACK.
+Than for all bindings from the last to the first
 the node's operation callback is called with SNMP_OP_ROLLBACK to undo
-the effect of SNMP_OP_SET. At the end the dependencies are freed
-and the finalizers are called with a fail flag
-of 1 and the function returns to the caller with an appropriate error indication.
+the effect of SNMP_OP_SET.
+At the end the dependencies are freed and the finalizers are called with
+a fail flag of 1 and the function returns to the caller with an appropriate
+error indication.
 .It
 If the dependency commits were successful, for each binding the node's
-operation callback is called with SNMP_OP_COMMIT. Any error returned from
+operation callback is called with SNMP_OP_COMMIT.
+Any error returned from
 the callbacks is ignored (an error message is generated via
 .Fn snmp_error ).
 .It
 Now the dependencies are freed and the finalizers are called
-with a fail flag of 0. For each dependency just before freeing it
+with a fail flag of 0.
+For each dependency just before freeing it
 its callback is called with
 .Li SNMP_DEPOP_FINISH.
 Then the function returns
@@ -338,20 +364,26 @@
 .El
 .Pp
 There are to mechanisms to help in complex SET operations: dependencies and
-finalizers. A dependency is used if several bindings depend on each other.
+finalizers.
+A dependency is used if several bindings depend on each other.
 A typical example is the creation of a conceptual row, which requires
-the setting of several columns to succeed. A dependency is identified by
-two OIDs. In the table case, the first oid is typically the table's base OID
-and the second one the index. Both of these can easily be generated from the
+the setting of several columns to succeed.
+A dependency is identified by
+two OIDs.
+In the table case, the first oid is typically the table's base OID
+and the second one the index.
+Both of these can easily be generated from the
 variables OID with
 .Fn asn_slice_oid .
 The function
 .Fn snmp_dep_lookup
 tries to find a dependency based on these two OIDs and, if it cannot find one
-creates a new one. This means for the table example, that the function
+creates a new one.
+This means for the table example, that the function
 returns the same dependency for each of the columns of the same table row.
 This allows during the SNMP_OP_SET processing to collect all information
-about the row into the dependency. The arguments to
+about the row into the dependency.
+The arguments to
 .Fn snmp_dep_lookup
 are: the two OIDs to identify the dependency (they are copied into newly
 created dependencies), the size of the structure to allocate and
@@ -369,16 +401,17 @@
 .Pp
 The function
 .Fn snmp_make_errresp
-makes an error response if an operation has failed. It takes the original
-request PDU (it will look only on the error code and index fields), the
-buffer containing the original PDU and a buffer for the error PDU. It copies
-the bindings field from the original PDUs buffer directly to the response
-PDU and thus does not depend on the decodability of this field. It may return
-the same values as the operation functions.
+makes an error response if an operation has failed.
+It takes the original request PDU (it will look only on the error code and
+index fields), the buffer containing the original PDU and a buffer for the
+error PDU.
+It copies the bindings field from the original PDUs buffer directly to
+the response PDU and thus does not depend on the decodability of this field.
+It may return the same values as the operation functions.
 .Pp
 The next four functions allow some parts of the SET operation to be executed.
 This is only used in
-.Xr snmpd 1
+.Xr bsnmpd 1
 to implement the configuration as a single transaction.
 The function
 .Fn snmp_init_context
@@ -395,12 +428,12 @@
 .Fn snmp_dep_finish
 executes SNMP_DEPOP_FINISH for all dependencies.
 .Sh DIAGNOSTICS
-If an error occures in any of the function an error indication as described
-above is returned. Additionally the functions may call snmp_error on unexected
-errors.
+If an error occurs in any of the function an error indication as described
+above is returned.
+Additionally the functions may call snmp_error on unexpected errors.
 .Sh SEE ALSO
 .Xr gensnmptree 1 ,
-.Xr snmpd 1 ,
+.Xr bsnmpd 1 ,
 .Xr bsnmpclient 3 ,
 .Xr bsnmplib 3 ,
 .Xr snmpmod 3

==== //depot/projects/soc2005/bsnmp/contrib/bsnmp/lib/bsnmpclient.3#2 (text+ko) ====

@@ -29,9 +29,9 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.\" $Begemot: bsnmp/lib/bsnmpclient.3,v 1.9 2005/05/23 11:10:12 brandt_h Exp $
+.\" $Begemot: bsnmp/lib/bsnmpclient.3,v 1.12 2005/10/04 08:46:50 brandt_h Exp $
 .\"
-.Dd May 23, 2005
+.Dd October 4, 2005
 .Dt BSNMPCLIENT 3
 .Os
 .Sh NAME
@@ -104,7 +104,8 @@
 .Fn snmp_dialog "struct snmp_pdu *req" "struct snmp_pdu *resp"
 .Sh DESCRIPTION
 The SNMP library contains routines to easily build SNMP client applications
-that use SNMP versions 1 or 2. Most of the routines use a
+that use SNMP versions 1 or 2.
+Most of the routines use a
 .Vt struct snmp_client :
 .Bd -literal -offset indent
 struct snmp_client {
@@ -145,9 +146,11 @@
 The fields of this structure are described below.
 .Bl -tag -width "timeout_start"
 .It Va version
-This is the version of SNMP to use. See
+This is the version of SNMP to use.
+See
 .Xr bsnmplib 3
-for applicable values. The default version is
+for applicable values.
+The default version is
 .Li SNMP_V2c .
 .It Va trans
 If this is
@@ -163,12 +166,14 @@
 .Va chost
 field as the path to the server's socket for local sockets.
 .It Va cport
-The SNMP agent's UDP port number. This may be a symbolic port number (from
-.Pa /etc/services
-or a numeric port number. If this field is
+The SNMP agent's UDP port number.
+This may be a symbolic port number (from
+.Pa /etc/services )
+or a numeric port number.
+If this field is
 .Li NULL
-(the default) the standard SNMP port is used. This field should not be changed
-directly but rather by calling
+(the default) the standard SNMP port is used.
+This field should not be changed directly but rather by calling
 .Fn snmp_client_set_port .
 .It Va chost
 The SNMP agent's host name, IP address or
@@ -178,46 +183,52 @@
 .Li NULL
 (the default)
 .Li localhost
-is assumed. This field should not be changed directly but rather through
-calling
+is assumed.
+This field should not be changed directly but rather through calling
 .Fn snmp_client_set_host .
 .It Va read_community
 This is the community name to be used for all requests except SET requests.
 The default is
 .Sq public .
 .It Va write_community
-The community name to be used for SET requests. The default is
+The community name to be used for SET requests.
+The default is
 .Sq private .
 .It Va timeout
-The maximum time to wait for responses to requests. If the time elapses, the
-request is resent up to
+The maximum time to wait for responses to requests.
+If the time elapses, the request is resent up to
 .Va retries
-times. The default is 3 seconds.
+times.
+The default is 3 seconds.
 .It Va retries
-Number of times a request PDU is to be resent. If set to 0, the request is
-sent only once. The default is 3 retransmissions.
+Number of times a request PDU is to be resent.
+If set to 0, the request is sent only once.
+The default is 3 retransmissions.
 .It Va dump_pdus
 If set to a non-zero value all received and sent PDUs are dumped via
 .Xr snmp_pdu_dump 3 .
 The default is not to dump PDUs.
 .It Va txbuflen
-The encoding buffer size to be allocated for transmitted PDUs. The default is
-10000 octets.
+The encoding buffer size to be allocated for transmitted PDUs.
+The default is 10000 octets.
 .It Va rxbuflen
-The decoding buffer size to be allocated for received PDUs. This is the size
-of the maximum PDU that can be received. The default is 10000 octets.
+The decoding buffer size to be allocated for received PDUs.
+This is the size of the maximum PDU that can be received.
+The default is 10000 octets.
 .It Va fd
 After calling
 .Fn snmp_open
 this is the file socket file descriptor used for sending and receiving PDUs.
 .It Va next_reqid
-The request id of the next PDU to send. Used internal by the library.
+The request id of the next PDU to send.
+Used internal by the library.
 .It Va max_reqid
-The maximum request id to use for outging PDUs. The default is
+The maximum request id to use for outgoing PDUs.
+The default is
 .Li INT32_MAX .
 .It Va min_reqid
-The minimum request id to use for outgoing PDUs. Request ids are allocated
-linerily starting at
+The minimum request id to use for outgoing PDUs.
+Request ids are allocated linearily starting at
 .Va min_reqid
 up to
 .Va max_reqid .
@@ -225,29 +236,30 @@
 If an error happens, this field is set to a printable string describing the
 error.
 .It Va timeout_start
-This field must point to a function setting up a one shot timeout. After the

>>> TRUNCATED FOR MAIL (1000 lines) <<<


More information about the p4-projects mailing list