OpenBSD CVS

CVS log for src/usr.sbin/snmpd/util.c


[BACK] Up to [local] / src / usr.sbin / snmpd

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.14 / (download) - annotate - [select for diffs], Thu Dec 21 12:43:31 2023 UTC (5 months, 2 weeks ago) by martijn
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, HEAD
Changes since 1.13: +4 -8 lines
Diff to previous 1.13 (colored)

Clean up snmpd's header situation.

With the help of tb@ and include-what-you-use.

OK tb@

Revision 1.13 / (download) - annotate - [select for diffs], Thu Oct 6 14:41:08 2022 UTC (20 months ago) by martijn
Branch: MAIN
CVS Tags: OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3
Changes since 1.12: +1 -26 lines
Diff to previous 1.12 (colored)

Remove a lot of old (dead) code that's either been superseded, or moved to
snmpd_metrics.

OK benno@ sthen@

Revision 1.12 / (download) - annotate - [select for diffs], Mon Aug 9 18:14:53 2021 UTC (2 years, 10 months ago) by martijn
Branch: MAIN
CVS Tags: OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0
Changes since 1.11: +42 -1 lines
Diff to previous 1.11 (colored)

Allow setting the engineid.

The previous engineid was based aronud the engine boottime and a random
value, which gives problems when sending/receiving unacknowledged PDUs
(trapv2) over SNMPv3 with authentication enabled, which need a consistent
engineid across restarts to determine the correct user from the sender.

The new default engineid takes a sha256 hash (chosen for its longer output)
of gethostname(3) and places the first 27 bytes after the new format number
129. This should give us a very low probability of collisions, assuming
all machines have a unique name.

The other formats as specified in SNMP-FRAMEWORK-MIB (RFC3411) are also
supported as well as arbitrary formats in the range 128-255 for other
private enterprise numbers in hex format.

OK jmatthew@

Revision 1.11 / (download) - annotate - [select for diffs], Thu Jan 28 20:45:14 2021 UTC (3 years, 4 months ago) by martijn
Branch: MAIN
CVS Tags: OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.10: +1 -25 lines
Diff to previous 1.10 (colored)

Remove print_{debug,verbose} since they're currently unused and I see no
reason to start using them in the future.

OK tb@

Revision 1.10 / (download) - annotate - [select for diffs], Tue Jun 30 17:11:49 2020 UTC (3 years, 11 months ago) by martijn
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8
Changes since 1.9: +1 -123 lines
Diff to previous 1.9 (colored)

Remove agentx and control socket support.

snmpctl has been removed two releases ago, which makes the control
interface obsolete.

agentx support has always been quirky at best, but got completely broken
with the BER_MAX_OID_LEN increase in ber.h. This change resulted in the
oid length on the snmp side being left uninitialized because of size
difference, resulting in weird behaviour. No one reported the breakage,
even after 6.7 was released.

This change requires users to remove the socket keyword from their
snmpd.conf.

OK denis@

Revision 1.8.2.1 / (download) - annotate - [select for diffs], Sun Oct 27 20:05:13 2019 UTC (4 years, 7 months ago) by tb
Branch: OPENBSD_6_6
Changes since 1.8: +14 -14 lines
Diff to previous 1.8 (colored) next main 1.9 (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.9 / (download) - annotate - [select for diffs], Thu Oct 24 12:39:27 2019 UTC (4 years, 7 months ago) by tb
Branch: MAIN
CVS Tags: OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.8: +14 -14 lines
Diff to previous 1.8 (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.8 / (download) - annotate - [select for diffs], Sat May 11 17:46:02 2019 UTC (5 years, 1 month ago) by rob
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE
Branch point for: OPENBSD_6_6
Changes since 1.7: +2 -2 lines
Diff to previous 1.7 (colored)

The BER API is currently used by ldap, ldapd, ldapctl, ypldap, snmpd, and
snmpctl. Separate copies of ber.[ch] have existed and been maintained in sync
in ldap, ldapd, ypldap and snmpd.

This commit moves the BER API into /usr/lib/libutil. All current consumers
already link libutil. ldapd and snmpd regress passes, and release builds.

With help from tb@ and guenther@.

ok deraadt@, tb@

Revision 1.7 / (download) - annotate - [select for diffs], Mon Jan 9 14:49:22 2017 UTC (7 years, 5 months ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.6: +3 -7 lines
Diff to previous 1.6 (colored)

Stop accessing verbose and debug variables from log.c directly.

This replaces log_verbose() and "extern int verbose" with the two functions
log_setverbose() and log_getverbose().

Pointed out by benno@
OK krw@ eric@ gilles@ (OK gilles@ for the snmpd bits as well)

Revision 1.6 / (download) - annotate - [select for diffs], Wed Nov 9 20:31:56 2016 UTC (7 years, 7 months ago) by jca
Branch: MAIN
Changes since 1.5: +123 -1 lines
Diff to previous 1.5 (colored)

Improve source IP address handling.

- send replies using a source address equal to the destination address
  of queries, using IP_SENDSRCADDR.  This help in multihomed setups and
  can remove the need to explicitely configure a bind address.
- config knob to set the source address of packets sent to trap
  receivers.  "trap receiver" gains an optional "source-address"
  setting.

Source address issues reported by Andy Lemin.  ok benno@

Revision 1.5 / (download) - annotate - [select for diffs], Sat Nov 21 13:06:22 2015 UTC (8 years, 6 months ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.4: +68 -1 lines
Diff to previous 1.4 (colored)

Move local logging functions to util.c and copy log.c from iked.  Now
a copy of the same log.c file is shared by relayd, httpd, iked, and
snmpd.  No functional changes.

Revision 1.4 / (download) - annotate - [select for diffs], Mon Jul 20 22:51:11 2015 UTC (8 years, 10 months ago) by blambert
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.3: +13 -1 lines
Diff to previous 1.3 (colored)

properly encode IpAddress, Gauge32, and Counter32
varbinds received from subagents

ok reyk@

Revision 1.3 / (download) - annotate - [select for diffs], Thu Jan 22 14:33:01 2015 UTC (9 years, 4 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.2: +1 -1 lines
Diff to previous 1.2 (colored)

Replace some obvious '$OpenBSD' and '$OpenBSD:' typos with '$OpenBSD$'.

Pointed out by dickman@.

ok sthen@ phessler@

Revision 1.2 / (download) - annotate - [select for diffs], Fri Jan 16 00:05:13 2015 UTC (9 years, 4 months ago) by deraadt
Branch: MAIN
Changes since 1.1: +0 -1 lines
Diff to previous 1.1 (colored)

first batch of cleanup to programs based upon the namespace cleanups
in net/pfvar.h sys/proc.h sys/ucred.h arpa/nameser.h
change to PATH_MAX, reduce use of MIN() and MAX(), HOST_NAME_MAX+1,
LOGIN_NAME_MAX, etc etc
ok millert guenther, some review by doug

Revision 1.1 / (download) - annotate - [select for diffs], Wed Nov 19 10:19:00 2014 UTC (9 years, 6 months ago) by blambert
Branch: MAIN

add support for AgentX subagents in snmpd

snmp requests are now packaged into pseudo-continuations
to allow for being dispatched to seperate processes;
lightly tested for interoperability with NetSNMP, but
doesn't implement the complete set of AgentX messages

while here, clean up return types of mps_get* functions,
and make smi_insert refuse to insert duplicate OIDs

okay benno@ reyk@

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.