When originally writing snmp(1) I wanted to stay as close to netsnmp as
possible to make sure I didn't introduce anything I would regret.
Now that 6.6 is out the door and I'm feeling more comfortable with the
tool I want to start being a little more lenient. Here's a first step by
allowing the -C options that work on walk to also work on bulkget. I see
no reason why these should be exclusive to walk.
OK?
martijn@
Index: snmp.1
===================================================================
RCS file: /cvs/src/usr.bin/snmp/snmp.1,v
retrieving revision 1.8
diff -u -p -r1.8 snmp.1
--- snmp.1 26 Oct 2019 17:43:52 -0000 1.8
+++ snmp.1 28 Oct 2019 06:22:33 -0000
@@ -202,7 +202,9 @@ On some devices that return MIBs out of
this may cause an infinite loop.
.It Cm E Ar endoid
For
-.Cm walk ,
+.Cm walk
+and
+.Cm bulkwalk ,
walk the tree up to but excluding
.Ar endoid .
The blank before
@@ -210,7 +212,9 @@ The blank before
is mandatory.
.It Cm I
For
-.Cm walk ,
+.Cm walk
+and
+.Cm bulkwalk
do not fall back to returning the original MIB via a
.Cm get
request.
@@ -258,7 +262,9 @@ No blank is allowed before
.Ar maxrep .
.It Cm t
For
-.Cm walk ,
+.Cm walk
+and
+.Cm bulkwalk ,
Show how long it took to walk the entire tree.
.El
.It Fl c Ar community
Index: snmpc.c
===================================================================
RCS file: /cvs/src/usr.bin/snmp/snmpc.c,v
retrieving revision 1.17
diff -u -p -r1.17 snmpc.c
--- snmpc.c 26 Oct 2019 19:34:15 -0000 1.17
+++ snmpc.c 28 Oct 2019 06:22:33 -0000
@@ -328,12 +328,14 @@ main(int argc, char *argv[])
i = strtolp - optarg - 1;
break;
case 't':
- if (strcmp(snmp_app->name, "walk"))
+ if (strcmp(snmp_app->name, "walk") &&
+ strcmp(snmp_app->name, "bulkwalk"))
usage();
print_time = 1;
break;
case 'E':
- if (strcmp(snmp_app->name, "walk"))
+ if (strcmp(snmp_app->name, "walk") &&
+ strcmp(snmp_app->name, "bulkwalk"))
usage();
if (smi_string2oid(argv[optind],
&walk_end) != 0)
@@ -343,7 +345,8 @@ main(int argc, char *argv[])
optind++;
continue;
case 'I':
- if (strcmp(snmp_app->name, "walk"))
+ if (strcmp(snmp_app->name, "walk") &&
+ strcmp(snmp_app->name, "bulkwalk"))
usage();
walk_fallback_oid = 0;
break;