OpenBSD CVS

CVS log for src/usr.sbin/snmpd/Attic/mps.c


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.31, Sun Nov 12 16:07:34 2023 UTC (6 months, 3 weeks ago) by martijn
Branch: MAIN
CVS Tags: HEAD
Changes since 1.30: +1 -1 lines
FILE REMOVED

Now that the last consumer of mps.c is gone, remove it and its
application_legacy.c companion.

OK tb@

Revision 1.30 / (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.29: +1 -93 lines
Diff to previous 1.29 (colored)

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

OK benno@ sthen@

Revision 1.29 / (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_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8
Changes since 1.28: +1 -31 lines
Diff to previous 1.28 (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.27.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.27: +20 -20 lines
Diff to previous 1.27 (colored) next main 1.28 (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.28 / (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.27: +20 -20 lines
Diff to previous 1.27 (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.27 / (download) - annotate - [select for diffs], Wed Oct 9 06:37:53 2019 UTC (4 years, 8 months ago) by martijn
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE
Branch point for: OPENBSD_6_6
Changes since 1.26: +1 -14 lines
Diff to previous 1.26 (colored)

Revert previous. This introduces problems when requesting the base oid of a
scalar.

For example if you getnext request 1.3.6.1.4.1.30155.6.1.1 you get a
varbind oid of 1.3.6.1.4.1.30155.6.1.1.0, but the value of
1.3.6.1.4.1.30155.6.1.2.0.  I have a fix in the making, but we're too close
to release and here be too many dragons.

Found by bluhm@

Revision 1.26 / (download) - annotate - [select for diffs], Thu Oct 3 12:00:40 2019 UTC (4 years, 8 months ago) by martijn
Branch: MAIN
Changes since 1.25: +15 -2 lines
Diff to previous 1.25 (colored)

For getnext request check if the requested oid or one of its parent
elements exists and is a (agentx) registered element. If so, forward the
getnext to the subagent, else get the actual next element.

This is only a partial fix, but lets us at least (together with a different
patch for relayd) walk relayd's elements.

OK claudio@

Revision 1.25 / (download) - annotate - [select for diffs], Thu May 16 05:00:00 2019 UTC (5 years ago) by martijn
Branch: MAIN
Changes since 1.24: +2 -2 lines
Diff to previous 1.24 (colored)

Allow arbitrary oids to be specified for the getnext request, instead of
oids needing to be part of the snmpd loaded tree.

This is in line with RFC3416.

OK gerhard@ who apparently has the exact same diff in his repo.

Revision 1.24 / (download) - annotate - [select for diffs], Fri Oct 28 08:01:53 2016 UTC (7 years, 7 months ago) by rzalamena
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.23: +1 -3 lines
Diff to previous 1.23 (colored)

Use snmpd_env as the only global variable for env to simplify the daemon
and avoid problems.

ok jca@

Revision 1.23 / (download) - annotate - [select for diffs], Sat Dec 5 06:42:18 2015 UTC (8 years, 6 months ago) by mmcc
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.22: +3 -5 lines
Diff to previous 1.22 (colored)

strings.h -> string.h to prevent an implicit declaration warning. Also
remove a handful of NULL-checks before free().

Revision 1.22 / (download) - annotate - [select for diffs], Thu Oct 8 08:17:30 2015 UTC (8 years, 8 months ago) by sthen
Branch: MAIN
Changes since 1.21: +7 -3 lines
Diff to previous 1.21 (colored)

Link the result of each mps_getbulkreq() to the end of the previous list
and not the start of it. Fixes getbulk requests for multiple OIDs.

From Gerhard Roth, ok blambert@

Revision 1.21 / (download) - annotate - [select for diffs], Sat Jul 18 16:54:43 2015 UTC (8 years, 10 months ago) by blambert
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.20: +20 -9 lines
Diff to previous 1.20 (colored)

Fix malformed packets when returning 'no such object/entry' errors
for snmp requests

ok reyk@

Revision 1.20 / (download) - annotate - [select for diffs], Fri Jan 16 00:05:13 2015 UTC (9 years, 4 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.19: +1 -2 lines
Diff to previous 1.19 (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.19 / (download) - annotate - [select for diffs], Wed Nov 19 10:19:00 2014 UTC (9 years, 6 months ago) by blambert
Branch: MAIN
Changes since 1.18: +95 -22 lines
Diff to previous 1.18 (colored)

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@

Revision 1.18 / (download) - annotate - [select for diffs], Wed Oct 2 09:36:21 2013 UTC (10 years, 8 months ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6, OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.17: +9 -11 lines
Diff to previous 1.17 (colored)

Fix GETBULK mode that got broken with r1.14.

ok sthen@

Revision 1.17 / (download) - annotate - [select for diffs], Mon Oct 1 11:36:55 2012 UTC (11 years, 8 months ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4, OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.16: +20 -7 lines
Diff to previous 1.16 (colored)

Support the 0.0.0.0 and 255.255.255.255 IPv4 addresses in the ipAddrTable.
This fixes an issue which aborted the address traversal / SNMP walk when
an "any"/0.0.0.0 address was configured on an interface.  The problem
was found with a pppoe(4) device that is typically configured with 0.0.0.0
on startup.

Found and fix tested by Gerhard Roth

Revision 1.16 / (download) - annotate - [select for diffs], Mon Sep 17 16:43:59 2012 UTC (11 years, 8 months ago) by reyk
Branch: MAIN
Changes since 1.15: +2 -2 lines
Diff to previous 1.15 (colored)

Update copyright and my email address in snmpd while I'm here.

Revision 1.15 / (download) - annotate - [select for diffs], Mon Sep 17 16:30:34 2012 UTC (11 years, 8 months ago) by reyk
Branch: MAIN
Changes since 1.14: +12 -4 lines
Diff to previous 1.14 (colored)

Add initial SNMPv3 support to snmpd(8).

Traps are still sent via SNMPv2 protocol. They can neither be
authenticated nor encrypted. - Transport mode is still UDP. Not
additional transport subsystems were added. - Only the User-based
Security Model (USM, RFC3414) is supported.  View-Based Access Control
(VACM, RFC3415) is not included. - Configuration is described in
snmpd.conf(5).

This diff includes a few minor changes to ber.c/h adding a necessary
callback for the USM HMAC calculation and merging it with other
minor changes from ldapd's ber code.

From Gerhard Roth at genua
ok claudio@ reyk@

Revision 1.14 / (download) - annotate - [select for diffs], Mon Sep 20 08:56:16 2010 UTC (13 years, 8 months ago) by martinh
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9
Changes since 1.13: +36 -11 lines
Diff to previous 1.13 (colored)

Return error on GET requests without an instance identifier, both for
tables and scalar values.

Fixes system/6468 by not calling table get functions with an unexpectedly
short OID.

Also fixes system/6071. Scalar variables without an instance specified now
returns a noSuchInstance error. GetNext requests correctly returns the .0
instance.

This means you can no longer rely on
$ snmpget -v2c -c public localhost SNMPv2-MIB::sysDescr
returning the .0 instance. You need to specify it explicitly:
$ snmpget -v2c -c public localhost SNMPv2-MIB::sysDescr.0

Also return proper SNMPv2 errors per varbind instead of a noSuchName error
status, unless SNMPv1 was specified in the request.

An earlier version of this diff tested by Remi Laurent, thanks.

Revision 1.13 / (download) - annotate - [select for diffs], Fri Jan 18 21:55:42 2008 UTC (16 years, 4 months ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_4_8_BASE, OPENBSD_4_8, OPENBSD_4_7_BASE, OPENBSD_4_7, OPENBSD_4_6_BASE, OPENBSD_4_6, OPENBSD_4_5_BASE, OPENBSD_4_5, OPENBSD_4_4_BASE, OPENBSD_4_4, OPENBSD_4_3_BASE, OPENBSD_4_3
Changes since 1.12: +7 -4 lines
Diff to previous 1.12 (colored)

free oid data before overwriting it

Revision 1.12 / (download) - annotate - [select for diffs], Wed Jan 16 09:51:15 2008 UTC (16 years, 4 months ago) by reyk
Branch: MAIN
Changes since 1.11: +2 -2 lines
Diff to previous 1.11 (colored)

bump copyright

Revision 1.11 / (download) - annotate - [select for diffs], Wed Jan 9 21:47:39 2008 UTC (16 years, 5 months ago) by reyk
Branch: MAIN
Changes since 1.10: +11 -6 lines
Diff to previous 1.10 (colored)

big endian fixes (tested on sparc64)

Revision 1.10 / (download) - annotate - [select for diffs], Fri Jan 4 12:57:40 2008 UTC (16 years, 5 months ago) by reyk
Branch: MAIN
Changes since 1.9: +5 -1 lines
Diff to previous 1.9 (colored)

always bzero the oid lookup key before initializing it.

Revision 1.9 / (download) - annotate - [select for diffs], Thu Jan 3 14:44:08 2008 UTC (16 years, 5 months ago) by reyk
Branch: MAIN
Changes since 1.8: +6 -4 lines
Diff to previous 1.8 (colored)

scalars have an index of 0 in the returned oid (like sysDescr.0).

Revision 1.8 / (download) - annotate - [select for diffs], Sat Dec 29 09:24:43 2007 UTC (16 years, 5 months ago) by reyk
Branch: MAIN
Changes since 1.7: +31 -7 lines
Diff to previous 1.7 (colored)

add the IP-MIB ipAddrTable.  it requires to encode the ipv4 addresses
in the OIDs as the table index.  the next step is to simplify the
common mib implementation regarding the special requirements of these
strange snmp tables.

Revision 1.7 / (download) - annotate - [select for diffs], Fri Dec 28 16:59:31 2007 UTC (16 years, 5 months ago) by reyk
Branch: MAIN
Changes since 1.6: +12 -185 lines
Diff to previous 1.6 (colored)

split code handling the "structure of management information" and the
"message processing subsystem" into separate files smi.c and mps.c

Revision 1.6 / (download) - annotate - [select for diffs], Fri Dec 28 16:27:51 2007 UTC (16 years, 5 months ago) by reyk
Branch: MAIN
Changes since 1.5: +17 -6 lines
Diff to previous 1.5 (colored)

split the MIB declarations (names) from the definitions (implementation).

Revision 1.5 / (download) - annotate - [select for diffs], Fri Dec 7 10:14:27 2007 UTC (16 years, 6 months ago) by reyk
Branch: MAIN
Changes since 1.4: +2 -3 lines
Diff to previous 1.4 (colored)

type

Revision 1.4 / (download) - annotate - [select for diffs], Wed Dec 5 23:29:19 2007 UTC (16 years, 6 months ago) by reyk
Branch: MAIN
Changes since 1.3: +2 -2 lines
Diff to previous 1.3 (colored)

more typos in comments etc.

From Leonardo Chiquitto (leonardo at ngdn dot org)

Revision 1.3 / (download) - annotate - [select for diffs], Wed Dec 5 22:54:07 2007 UTC (16 years, 6 months ago) by reyk
Branch: MAIN
Changes since 1.2: +2 -2 lines
Diff to previous 1.2 (colored)

typo s/beeing/being/g

From Paul 'WEiRD' de Weerd

Revision 1.2 / (download) - annotate - [select for diffs], Wed Dec 5 22:52:50 2007 UTC (16 years, 6 months ago) by reyk
Branch: MAIN
Changes since 1.1: +3 -3 lines
Diff to previous 1.1 (colored)

- add support joel's OPENBSD-SENSORS-MIB; it will dump the current
sensor status in a SNMP table.
- some other minor changes

Revision 1.1 / (download) - annotate - [select for diffs], Wed Dec 5 09:22:44 2007 UTC (16 years, 6 months ago) by reyk
Branch: MAIN

Start working on snmpd(8) and snmpctl(8), a lightweight SNMP implementation
for OpenBSD.  SNMP is a necessary evil.  This is work in progress, don't
expect too much from it yet.

ok 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.