On Sun, Sep 26, 2004 at 05:24:55PM -0400, Robert Story wrote:
> On Fri, 24 Sep 2004 17:34:53 +0100 Patrick wrote:
> PW> I would provide patches to man, but I don't really understand
> PW> what a subidentifier is..
>
> A sub-identifier is a single identifier from an OID. eg, .1.3.6 is composed of
> 3 sub-identifiers. OIDs usually have lengths in sub-identifiers (eg 3 above),
> versus bytes (eg 12 above [or 24 on a 64bit system]).
Thanks - I also add that extra NULL check in mib.c which avoids a core
dump if one doesn't use a sensible "width" values..
Cheers,
Patrick
Index: mib_api.3.def
===================================================================
RCS file: /cvsroot/net-snmp/net-snmp/man/mib_api.3.def,v
retrieving revision 5.3
diff -u -r5.3 mib_api.3.def
--- mib_api.3.def 14 Apr 2004 22:41:21 -0000 5.3
+++ mib_api.3.def 3 Oct 2004 12:56:31 -0000
@@ -34,25 +34,25 @@
.PP
.BI "void print_mib(FILE *" "fp" );
.PP
-.BI "int read_objid(char *" "input" ", oid *" "output" ", int *" "out_len" );
+.BI "int read_objid(char *" "input" ", oid *" "output" ", size_t *" "out_len" );
.br
-.BI "int get_module_node(char *" "name" ", char *" "module" ", oid *" "objid" ", int
*" "objidlen" );
+.BI "int get_module_node(const char *" "name" ", const char *" "module" ", oid *"
"objid" ", size_t *" "objidlen" );
.PP
-.BI "void print_variable(const oid *" "objid" ", size_t " "objidlen" ", struct
variable_list *" "variable" );
+.BI "void print_variable(const oid *" "objid" ", size_t " "objidlen" ", const
netsnmp_variable_list *" "variable" );
.br
-.BI "void fprint_variable(FILE *" fp ", const oid *" objid ", size_t " objidlen ",
struct variable_list *" variable );
+.BI "void fprint_variable(FILE *" fp ", const oid *" objid ", size_t " objidlen ",
const netsnmp_variable_list *" variable );
.br
-.BI "int snprint_variable(char *" "buf" ", size_t " "len" ", const oid *" "objid" ",
size_t " "objidlen" ", struct variable_list *" "variable" );
+.BI "int snprint_variable(char *" "buf" ", size_t " "len" ", const oid *" "objid" ",
size_t " "objidlen" ", const netsnmp_variable_list *" "variable" );
.br
-.BI "int sprint_realloc_variable(u_char **" buf ", size_t *" buf_len ", size_t *"
out_len ", int " allow_realloc ", const oid *" objid ", size_t " objidlen ", struct
variable_list *" variable );
+.BI "int sprint_realloc_variable(u_char **" buf ", size_t *" buf_len ", size_t *"
out_len ", int " allow_realloc ", const oid *" objid ", size_t " objidlen ", const
netsnmp_variable_list *" variable );
.PP
-.BI "void print_value(oid *objid, size_t objidlen, struct variable_list *variable)
+.BI "void print_value(oid *objid, size_t objidlen, const netsnmp_variable_list
*variable)
.br
-.BI "void fprint_value(FILE *" fp ", const oid *" objid ", size_t " objidlen ",
struct variable_list *" variable );
+.BI "void fprint_value(FILE *" fp ", const oid *" objid ", size_t " objidlen ", const
netsnmp_variable_list *" variable );
.br
-.BI "int snprint_value(char *" buf ", size_t " "len" ", const oid *" objid ", size_t
" objidlen ", struct variable_list *" variable );
+.BI "int snprint_value(char *" buf ", size_t " "len" ", const oid *" objid ", size_t
" objidlen ", const netsnmp_variable_list *" variable );
.br
-.BI "int sprint_realloc_value(u_char **" buf ", size_t *" buf_len ", size_t *"
out_len ", int " allow_realloc ", const oid *" objid ", size_t " objidlen ", struct
variable_list *" variable );
+.BI "int sprint_realloc_value(u_char **" buf ", size_t *" buf_len ", size_t *"
out_len ", int " allow_realloc ", const oid *" objid ", size_t " objidlen ", const
netsnmp_variable_list *" variable );
.PP
.BI "void print_objid(const oid *" objid ", size_t " objidlen );
.br
@@ -62,9 +62,9 @@
.br
.BI "int sprint_realloc_objid(u_char **" buf ", size_t *" buf_len ", size_t *"
out_len ", int "allow_realloc ", const oid *" objid ", size_t " objidlen );
.PP
-.BI "void print_description(const oid *" objid ", size_t " objidlen );
+.BI "void print_description(oid *" objid ", size_t " objidlen ", int " width );
.br
-.BI "void fprint_description(FILE *" fp ", const oid *" objid ", size_t " objidlen );
+.BI "void fprint_description(FILE *" fp ", const oid *" objid ", size_t " objidlen ",
int " width );
.PP
.BI "void snmp_set_mib_warnings(int " level );
.br
@@ -287,7 +287,10 @@
.B fprint_description
take an object identifier (as for
.B print_objid
-above) and print out the associated DESCRIPTION clause.
+above) and print out the associated DESCRIPTION clause. The
+.I width
+argument gives the number of subidentifiers of an OID, e.g., .1.3.6
+is composed of 3 subidentifiers.
.PP
Note that there are no corresponding routines
.B snprint_description
Index: mib.c
===================================================================
RCS file: /cvsroot/net-snmp/net-snmp/snmplib/mib.c,v
retrieving revision 5.73
diff -u -r5.73 mib.c
--- mib.c 7 Jul 2004 00:15:24 -0000 5.73
+++ mib.c 3 Oct 2004 12:58:32 -0000
@@ -4442,6 +4442,9 @@
char tmpbuf[128];
const char *cp;
+ if (tp == NULL)
+ return 0;
+
if (tp->type <= TYPE_SIMPLE_LAST)
cp = " OBJECT-TYPE";
else
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
Net-snmp-coders mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders