OpenBSD CVS

CVS log for src/usr.bin/snmp/snmpc.c


[BACK] Up to [local] / src / usr.bin / snmp

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.41 / (download) - annotate - [select for diffs], Tue Apr 23 13:34:50 2024 UTC (3 weeks, 4 days ago) by jsg
Branch: MAIN
CVS Tags: HEAD
Changes since 1.40: +2 -2 lines
Diff to previous 1.40 (colored)

correct indentation; no functional change
ok tb@

Revision 1.40 / (download) - annotate - [select for diffs], Mon Dec 26 19:16:03 2022 UTC (16 months, 3 weeks ago) by jmc
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3
Changes since 1.39: +2 -2 lines
Diff to previous 1.39 (colored)

spelling fixes; from paul tagliamonte
amendments to his diff are noted on tech

Revision 1.39 / (download) - annotate - [select for diffs], Tue Dec 20 20:12:27 2022 UTC (16 months, 4 weeks ago) by martijn
Branch: MAIN
Changes since 1.38: +4 -2 lines
Diff to previous 1.38 (colored)

If we don't have usecommonopt for our application we shouldn't check the
default values for snmp protocol level stuff. Makes snmp mibtree work
again which got broken since the defaults changed back in 2021.

Reported by Matthias Pitzl (pitzl <at> genua <dot> de)
Hint to use usecommonopt and OK gerhard@

Revision 1.38 / (download) - annotate - [select for diffs], Thu Oct 21 08:17:34 2021 UTC (2 years, 6 months ago) by martijn
Branch: MAIN
CVS Tags: OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1
Changes since 1.37: +8 -8 lines
Diff to previous 1.37 (colored)

Sync ober_oid_cmp with ax_oid_cmp from libagentx.
This flips the returned signedness and adds the weight of 2 for
parent-child relationship in both direction.

This makes ober_oid_cmp consistent with the rest of the *_cmp based
functions.

OK tb@

Revision 1.37 / (download) - annotate - [select for diffs], Wed Aug 11 18:53:45 2021 UTC (2 years, 9 months ago) by martijn
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_7_0
Changes since 1.36: +7 -4 lines
Diff to previous 1.36 (colored)

Change default version to -v3 and remove the default community.
Similar to what happend in snmpd(8).

OK sthen@

Revision 1.36 / (download) - annotate - [select for diffs], Wed Aug 11 17:54:19 2021 UTC (2 years, 9 months ago) by martijn
Branch: MAIN
Changes since 1.35: +2 -2 lines
Diff to previous 1.35 (colored)

On usage for commands without the common flags (mibtree) make sure there's
a space between the subcommand and the flags.

OK sthen@

Revision 1.35 / (download) - annotate - [select for diffs], Sun Aug 8 13:41:26 2021 UTC (2 years, 9 months ago) by sthen
Branch: MAIN
Changes since 1.34: +2 -2 lines
Diff to previous 1.34 (colored)

Switch default snmpd and snmp auth back to hmac-sha1.

Practical experience on several machines after updates suggests the snmp
world isn't really ready for hmac-sha2-256, and the HMAC construction doesn't
require collision resistance (which is the weakness of MD5/SHA1; see e.g.
"New proofs for NMAC and HMAC: Security without collision-resistance",
Bellare 2014).

Feedback from martijn@ (who would prefer to keep using the sha2 hmac),
deraadt@, tb@.

Revision 1.34 / (download) - annotate - [select for diffs], Sun Jun 20 20:02:14 2021 UTC (2 years, 10 months ago) by martijn
Branch: MAIN
Changes since 1.33: +3 -3 lines
Diff to previous 1.33 (colored)

Change the authentication protocol (-a) default to SHA-256 and the privacy
protocol (-x) default to AES. The old defaults are just not sane anymore.

OK sthen@

Revision 1.33 / (download) - annotate - [select for diffs], Tue Mar 23 22:07:36 2021 UTC (3 years, 1 month ago) by martijn
Branch: MAIN
CVS Tags: OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.32: +16 -6 lines
Diff to previous 1.32 (colored)

Fix some ranges and type handling.

OK sthen@

Revision 1.32 / (download) - annotate - [select for diffs], Wed Mar 3 09:06:20 2021 UTC (3 years, 2 months ago) by jsg
Branch: MAIN
Changes since 1.31: +1 -3 lines
Diff to previous 1.31 (colored)

remove unreachable and unneeded code
ok martijn@

Revision 1.31 / (download) - annotate - [select for diffs], Wed Dec 2 15:45:51 2020 UTC (3 years, 5 months ago) by martijn
Branch: MAIN
Changes since 1.30: +4 -1 lines
Diff to previous 1.30 (colored)

Add argc check for snmp trap and drop to usage if we're short.

OK deraadt@

Revision 1.30 / (download) - annotate - [select for diffs], Mon Sep 14 15:12:27 2020 UTC (3 years, 8 months ago) by martijn
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8
Changes since 1.29: +19 -5 lines
Diff to previous 1.29 (colored)

Allow snmp mibtree to take one or more arguments who will be converted to
an output format of your choosing.

OK deraadt@ jan@

Revision 1.29 / (download) - annotate - [select for diffs], Sat Sep 12 18:11:43 2020 UTC (3 years, 8 months ago) by martijn
Branch: MAIN
Changes since 1.28: +48 -16 lines
Diff to previous 1.28 (colored)

Let snmp df make use of the new displayhint code, so we don't print random
garbage to the description column if the server gives us that.

OK jan@

Revision 1.28 / (download) - annotate - [select for diffs], Mon Aug 3 14:45:54 2020 UTC (3 years, 9 months ago) by martijn
Branch: MAIN
Changes since 1.27: +17 -2 lines
Diff to previous 1.27 (colored)

Add support for UTF-8 DISPLAY-HINTs with octet length. For now only
sysContact is supported with SnmpAdminString, but more shall follow
soon(tm).

Note that this will change output even in the C locale: Previously every
unprintable byte would be tranformed to a '.', with this diff a valid UTF-8
multibyte or unprintable character will be squished into a single dot to
give a better understanding of the intention of the original message.
Invalid bytes will now be printed as question marks.

Lot's of help and back and forth with schwarze@ who also kindly offered to
walk away when I mentioned looking through MIB files for more objects to
convert to this new code, which is understandable.

OK schwarze@

Revision 1.27 / (download) - annotate - [select for diffs], Tue Jun 30 19:26:40 2020 UTC (3 years, 10 months ago) by martijn
Branch: MAIN
Changes since 1.26: +4 -2 lines
Diff to previous 1.26 (colored)

Fix two minor issues in snmpc_parseagent.

Revision 1.26 / (download) - annotate - [select for diffs], Sun May 31 21:01:59 2020 UTC (3 years, 11 months ago) by martijn
Branch: MAIN
Changes since 1.25: +2 -2 lines
Diff to previous 1.25 (colored)

Fix an of by one when printing the oid of the error index.

Revision 1.25 / (download) - annotate - [select for diffs], Tue May 19 13:41:01 2020 UTC (4 years ago) by martijn
Branch: MAIN
Changes since 1.24: +2 -2 lines
Diff to previous 1.24 (colored)

Shave of some leftovers from snmpd's MIB initialization that are not needed
for snmp. Minus 503 LoC and about 200KB on binary size.

OK denis@

Revision 1.24 / (download) - annotate - [select for diffs], Sun May 10 21:14:30 2020 UTC (4 years ago) by martijn
Branch: MAIN
Changes since 1.23: +4 -4 lines
Diff to previous 1.23 (colored)

Initialize a couple of variables to shut up gcc, which apparently isn't
smart enough to see that there is a proper check in place to prevent
uninitialized usage.

OK deraadt@

Revision 1.23 / (download) - annotate - [select for diffs], Fri May 8 12:21:07 2020 UTC (4 years ago) by martijn
Branch: MAIN
Changes since 1.22: +2 -2 lines
Diff to previous 1.22 (colored)

Fix obvious copy-past-O in calculation of maximum length of "Available"
column for df subcommand. Fixes misalignment in some cases.

Revision 1.22 / (download) - annotate - [select for diffs], Sun Mar 22 08:59:22 2020 UTC (4 years, 1 month ago) by martijn
Branch: MAIN
CVS Tags: OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.21: +47 -41 lines
Diff to previous 1.21 (colored)

Fix agent address parsing:
- Allow IPv6 addresses to be used based on format.
- Allow IPv6 addresses without brackets skip the port if it results in a
  nonsensical address. This allows us to use ::1
- Try to connect to the address immediately instead of only trying the
  socket.
- Add pledge unix so we can actually create a unix socket.

Feedback, additional testing and OK jan@

Revision 1.21 / (download) - annotate - [select for diffs], Sat Jan 25 17:17:31 2020 UTC (4 years, 3 months ago) by martijn
Branch: MAIN
Changes since 1.20: +1 -2 lines
Diff to previous 1.20 (colored)

Remove a sleep call that I used for some testing that slipped in during
the import of the df subcommand.

Revision 1.20 / (download) - annotate - [select for diffs], Fri Jan 17 10:10:32 2020 UTC (4 years, 4 months ago) by martijn
Branch: MAIN
Changes since 1.19: +4 -4 lines
Diff to previous 1.19 (colored)

Some minor usage() bits omitted in the original diffs.

Revision 1.19 / (download) - annotate - [select for diffs], Fri Jan 17 10:03:39 2020 UTC (4 years, 4 months ago) by martijn
Branch: MAIN
Changes since 1.18: +242 -2 lines
Diff to previous 1.18 (colored)

Implement a df subcommand, this outputs disk and memory information in a
df(1) format.

OK jan@
General positive sounds from the hackroom and Michael W Lucas

Revision 1.18 / (download) - annotate - [select for diffs], Fri Jan 17 09:49:47 2020 UTC (4 years, 4 months ago) by martijn
Branch: MAIN
Changes since 1.17: +37 -2 lines
Diff to previous 1.17 (colored)

Implement a -Cs option for snmp walk and bulkwalk.

This option allows you to skip subsections of a tree and allows for faster
walking with less (undesired) clutter on screen.

OK florian@ jan@
Happy sounds from Michael W. Lucas

Revision 1.15.2.1 / (download) - annotate - [select for diffs], Sun Oct 27 20:05:12 2019 UTC (4 years, 6 months ago) by tb
Branch: OPENBSD_6_6
Changes since 1.15: +32 -32 lines
Diff to previous 1.15 (colored) next main 1.16 (colored)

The ber_* namespace is used by liblber since time immemorial,
so move our BER API to the unused ober_* prefix to avoid some
breakage in ports.

Problem diagnosed by jmatthew with ber_free() in samba, but
there are many others as pointed out by sthen.

tests & ok rob
ok sthen (who had an almost identical diff for libutil)
"go head hit it" deraadt

OpenBSD 6.6 errata 002

Revision 1.17 / (download) - annotate - [select for diffs], Sat Oct 26 19:34:15 2019 UTC (4 years, 6 months ago) by martijn
Branch: MAIN
Changes since 1.16: +2 -2 lines
Diff to previous 1.16 (colored)

Remove common from "common options" in usage to be closer to SYNOPSIS.

Discussed with jmc@

Revision 1.16 / (download) - annotate - [select for diffs], Thu Oct 24 12:39:26 2019 UTC (4 years, 6 months ago) by tb
Branch: MAIN
Changes since 1.15: +32 -32 lines
Diff to previous 1.15 (colored)

The ber_* namespace is used by liblber since time immemorial,
so move our BER API to the unused ober_* prefix to avoid some
breakage in ports.

Problem diagnosed by jmatthew with ber_free() in samba, but
there are many others as pointed out by sthen.

tests & ok rob
ok sthen (who had an almost identical diff for libutil)
"go head hit it" deraadt

Revision 1.15 / (download) - annotate - [select for diffs], Tue Oct 8 08:41:31 2019 UTC (4 years, 7 months ago) by martijn
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE
Branch point for: OPENBSD_6_6
Changes since 1.14: +52 -18 lines
Diff to previous 1.14 (colored)

Don't rely on the pdu returning the correct errorindex.
Noticed by semarie@

Feedback and OK claudio@

Revision 1.14 / (download) - annotate - [select for diffs], Mon Oct 7 07:39:50 2019 UTC (4 years, 7 months ago) by bluhm
Branch: MAIN
Changes since 1.13: +2 -1 lines
Diff to previous 1.13 (colored)

If optstring is NULL and usecommonopt is true, optstr was prepended
by uninitialized garbage.  Crash in snmp(1) found by
regress/usr.sbin/snmpd.
OK martijn@

Revision 1.13 / (download) - annotate - [select for diffs], Thu Oct 3 11:02:26 2019 UTC (4 years, 7 months ago) by martijn
Branch: MAIN
Changes since 1.12: +219 -167 lines
Diff to previous 1.12 (colored)

Implement snmp set.

Manpage help jmc@ schwarze@
OK semarie@ claudio@

Revision 1.12 / (download) - annotate - [select for diffs], Thu Oct 3 07:23:46 2019 UTC (4 years, 7 months ago) by semarie
Branch: MAIN
Changes since 1.11: +2 -2 lines
Diff to previous 1.11 (colored)

use the right argv element for the error message.

ok martijn@

Revision 1.11 / (download) - annotate - [select for diffs], Wed Sep 18 09:54:36 2019 UTC (4 years, 8 months ago) by martijn
Branch: MAIN
Changes since 1.10: +46 -5 lines
Diff to previous 1.10 (colored)

Add support for SNMPv3/USM privacy.
net-snmp's -3K is supported via the -K parameter, -3K is not supported.

Feedback and OK jmatthew@

Revision 1.10 / (download) - annotate - [select for diffs], Wed Sep 18 09:52:47 2019 UTC (4 years, 8 months ago) by martijn
Branch: MAIN
Changes since 1.9: +59 -3 lines
Diff to previous 1.9 (colored)

Add support for SNMPv3/USM authentication.
net-snmp's -3k is supported via the -k parameter, -3m is not supported.

Feedback and OK jmatthew@

Revision 1.9 / (download) - annotate - [select for diffs], Wed Sep 18 09:48:14 2019 UTC (4 years, 8 months ago) by martijn
Branch: MAIN
Changes since 1.8: +156 -17 lines
Diff to previous 1.8 (colored)

Initial SNMPv3/USM support.
This commit only implements noAuthNoPriv.

Feedback and OK jmatthew@

Revision 1.8 / (download) - annotate - [select for diffs], Wed Sep 18 09:44:38 2019 UTC (4 years, 8 months ago) by martijn
Branch: MAIN
Changes since 1.7: +17 -9 lines
Diff to previous 1.7 (colored)

Move snmp packaging and unpackaging to their own function.
In preparation for SNMPv3/USM support.

Feedback and OK jmatthew@

Revision 1.7 / (download) - annotate - [select for diffs], Wed Aug 14 14:40:23 2019 UTC (4 years, 9 months ago) by deraadt
Branch: MAIN
Changes since 1.6: +2 -2 lines
Diff to previous 1.6 (colored)

make usage() and SYNOPSIS more alike
discussed with martijn

Revision 1.6 / (download) - annotate - [select for diffs], Tue Aug 13 12:28:03 2019 UTC (4 years, 9 months ago) by martijn
Branch: MAIN
Changes since 1.5: +4 -4 lines
Diff to previous 1.5 (colored)

Error-index starts at 1, not 0.

Revision 1.5 / (download) - annotate - [select for diffs], Sun Aug 11 18:11:10 2019 UTC (4 years, 9 months ago) by martijn
Branch: MAIN
Changes since 1.4: +4 -4 lines
Diff to previous 1.4 (colored)

Replace some err(1, NULL) with err(1, "malloc").

Requested by deraadt@

Revision 1.4 / (download) - annotate - [select for diffs], Sun Aug 11 17:22:31 2019 UTC (4 years, 9 months ago) by martijn
Branch: MAIN
Changes since 1.3: +14 -15 lines
Diff to previous 1.3 (colored)

Cleanup usage.

Prodded by and OK deraadt@

Revision 1.3 / (download) - annotate - [select for diffs], Sun Aug 11 14:41:49 2019 UTC (4 years, 9 months ago) by deraadt
Branch: MAIN
Changes since 1.2: +3 -1 lines
Diff to previous 1.2 (colored)

error if malloc fails; ok martijn

Revision 1.2 / (download) - annotate - [select for diffs], Sun Aug 11 14:41:20 2019 UTC (4 years, 9 months ago) by deraadt
Branch: MAIN
Changes since 1.1: +14 -15 lines
Diff to previous 1.1 (colored)

ugly whitespaces

Revision 1.1 / (download) - annotate - [select for diffs], Fri Aug 9 06:17:59 2019 UTC (4 years, 9 months ago) by martijn
Branch: MAIN

Import snmp(1), a new snmp client which aims to be netsnmp compatible for
supported features.  It only supports get, getnext, walk, bulkget, bulkwalk,
trap, mibtree, and is SNMPv1 and SNMPv2c for now.

This will shortly replace snmpctl entirely. People using snmpctl are encouraged
to test and migrate to this code as soon as possible.

Much help with the manpage from schwarze@ and jmc@
No objections from reyk@
"Roll it in" deraadt@

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.