summaryrefslogtreecommitdiffstats
path: root/usr.bin/snmp (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Fix an of by one when printing the oid of the error index.martijn2020-05-311-2/+2
|
* OIDs are unsigned. Reflect this when printing them.martijn2020-05-311-2/+2
|
* Shave of some leftovers from snmpd's MIB initialization that are not neededmartijn2020-05-194-513/+10
| | | | | | for snmp. Minus 503 LoC and about 200KB on binary size. OK denis@
* Initialize a couple of variables to shut up gcc, which apparently isn'tmartijn2020-05-101-4/+4
| | | | | | | smart enough to see that there is a proper check in place to prevent uninitialized usage. OK deraadt@
* Fix obvious copy-past-O in calculation of maximum length of "Available"martijn2020-05-081-2/+2
| | | | column for df subcommand. Fixes misalignment in some cases.
* ce examples of "Ar arg Ar arg" with "Ar arg arg" and stop the spread;jmc2020-04-231-3/+3
|
* When doing a loop inside a loop for input validation make sure that themartijn2020-03-241-2/+4
| | | | | | continue statement for the outer loop is executed in the outer loop. Found the hard way by breaking snmpd(8) in my local tree.
* Fix agent address parsing:martijn2020-03-221-41/+47
| | | | | | | | | | | - 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@
* Remove a sleep call that I used for some testing that slipped in duringmartijn2020-01-251-2/+1
| | | | the import of the df subcommand.
* remove trailing whitespace;jmc2020-01-211-3/+3
|
* Some minor usage() bits omitted in the original diffs.martijn2020-01-172-5/+6
|
* Implement a df subcommand, this outputs disk and memory information in amartijn2020-01-172-5/+266
| | | | | | | df(1) format. OK jan@ General positive sounds from the hackroom and Michael W Lucas
* Add better support for exception contexts.martijn2020-01-172-5/+21
| | | | | | Now we can see proper nosuchinstance and endofmibtree messages. OK jan@
* Implement a -Cs option for snmp walk and bulkwalk.martijn2020-01-172-4/+50
| | | | | | | | 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
* Remove common from "common options" in usage to be closer to SYNOPSIS.martijn2019-10-261-2/+2
| | | | Discussed with jmc@
* Shorten the SYNOPSIS greatly.martijn2019-10-261-170/+115
| | | | | | | While here also fix some wrong definitions. With help from jmc@ Requested by and OK deraadt@
* The ber_* namespace is used by liblber since time immemorial,tb2019-10-244-129/+129
| | | | | | | | | | | | 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
* don't use sizeof(pointer) to represent buffer sizejsg2019-10-111-4/+5
| | | | ok martijn@ deraadt@
* Use snprintf instead of sprintf.martijn2019-10-091-10/+27
| | | | Requested by and OK deraadt@
* Free the "e" element in ber_printf_elements if it fails, since there's nomartijn2019-10-081-2/+5
| | | | | | chance that it's part of the new ber structure. Feedback and OK claudio@
* Don't rely on the pdu returning the correct errorindex.martijn2019-10-081-18/+52
| | | | | | Noticed by semarie@ Feedback and OK claudio@
* If optstring is NULL and usecommonopt is true, optstr was prependedbluhm2019-10-071-1/+2
| | | | | | by uninitialized garbage. Crash in snmp(1) found by regress/usr.sbin/snmpd. OK martijn@
* Implement snmp set.martijn2019-10-034-173/+270
| | | | | Manpage help jmc@ schwarze@ OK semarie@ claudio@
* use the right argv element for the error message.semarie2019-10-031-2/+2
| | | | ok martijn@
* Add support for some HP LaserJet systems. These systems don't return themartijn2019-09-181-1/+19
| | | | | | | boots and time on probing, but only return those on a fully encrypted packet. Add a minor workaround for these systems. Feedback and OK jmatthew@
* Add support for SNMPv3/USM privacy.martijn2019-09-186-39/+344
| | | | | | net-snmp's -3K is supported via the -K parameter, -3K is not supported. Feedback and OK jmatthew@
* Add support for SNMPv3/USM authentication.martijn2019-09-187-25/+390
| | | | | | net-snmp's -3k is supported via the -k parameter, -3m is not supported. Feedback and OK jmatthew@
* Initial SNMPv3/USM support.martijn2019-09-187-41/+699
| | | | | | This commit only implements noAuthNoPriv. Feedback and OK jmatthew@
* Move snmp packaging and unpackaging to their own function.martijn2019-09-183-54/+130
| | | | | | In preparation for SNMPv3/USM support. Feedback and OK jmatthew@
* Better error reporting on malformed packets.martijn2019-08-271-11/+36
|
* make usage() and SYNOPSIS more alikederaadt2019-08-142-12/+14
| | | | discussed with martijn
* Error-index starts at 1, not 0.martijn2019-08-131-4/+4
|
* Replace some err(1, NULL) with err(1, "malloc").martijn2019-08-111-4/+4
| | | | Requested by deraadt@
* Cleanup usage.martijn2019-08-111-15/+14
| | | | Prodded by and OK deraadt@
* whitespace issues like a knife in my eyesderaadt2019-08-111-6/+5
|
* error if malloc fails; ok martijnderaadt2019-08-111-1/+3
|
* ugly whitespacesderaadt2019-08-112-18/+16
|
* explicitly point out extraordinary and inconsistent syntax requirementsschwarze2019-08-101-2/+9
| | | | | regarding whitespace that result in a trap for the unwary; OK martijn@ jmc@
* Import snmp(1), a new snmp client which aims to be netsnmp compatible formartijn2019-08-099-0/+4259
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@