OpenBSD CVS

CVS log for src/usr.sbin/snmpd/snmpd.h


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.120 / (download) - annotate - [select for diffs], Tue May 21 05:00:48 2024 UTC (2 weeks, 4 days ago) by jsg
Branch: MAIN
CVS Tags: HEAD
Changes since 1.119: +1 -2 lines
Diff to previous 1.119 (colored)

remove prototypes with no matching function and externs with no var
partly checked by millert@

Revision 1.119 / (download) - annotate - [select for diffs], Tue Feb 6 15:36:11 2024 UTC (4 months ago) by martijn
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5
Changes since 1.118: +3 -3 lines
Diff to previous 1.118 (colored)

Let the config parser make use of the mib_string2oid().
If a descriptor is not found in the loaded MIB files it falls back to
the old smi_oid2string(), which then throws a deprecation warning. This
won't trigger for most cases in the default install, but the
UCD-DISKIO-MIB and dependencies aren't included (yet?) (which can be
fixed by manually including them via "mib directory") and there's a
couple of misspellings (e.g. mib_2 vs mib-2, and
usmStatsNotInTimeWindow vs usmStatsNotInTimeWindows).

Feedback and OK tb@

Revision 1.118 / (download) - annotate - [select for diffs], Tue Feb 6 12:44:28 2024 UTC (4 months ago) by martijn
Branch: MAIN
Changes since 1.117: +3 -1 lines
Diff to previous 1.117 (colored)

Replace most smi_oid2string() calls with the new mib_oid2string().
smi_oid2string() is still called from trap handle context to not break
any existing scripts.

OK tb@

Revision 1.117 / (download) - annotate - [select for diffs], Tue Jan 16 13:33:12 2024 UTC (4 months, 3 weeks ago) by claudio
Branch: MAIN
Changes since 1.116: +1 -3 lines
Diff to previous 1.116 (colored)

Convert to imsg_get_fd() and remove unused proc_forward_imsg().
OK martijn@

Revision 1.116 / (download) - annotate - [select for diffs], Thu Dec 21 13:54:05 2023 UTC (5 months, 2 weeks ago) by martijn
Branch: MAIN
Changes since 1.115: +1 -5 lines
Diff to previous 1.115 (colored)

mib_init() and MIB() disappeared with mib.c, remove their declarations.
MIBDECL() and MIBEND are only used inside mib.h, so move their definition
in there.

OK tb@

Revision 1.115 / (download) - annotate - [select for diffs], Thu Dec 21 12:43:31 2023 UTC (5 months, 2 weeks ago) by martijn
Branch: MAIN
Changes since 1.114: +9 -11 lines
Diff to previous 1.114 (colored)

Clean up snmpd's header situation.

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

OK tb@

Revision 1.114 / (download) - annotate - [select for diffs], Mon Nov 13 15:05:14 2023 UTC (6 months, 3 weeks ago) by martijn
Branch: MAIN
Changes since 1.113: +3 -2 lines
Diff to previous 1.113 (colored)

Apparently base-gcc doesn't like having OID() inside MIBDECL(). Handroll
the OID() logic into MIBDECL().

Found, tested, and OK jca@
OK tb@

Revision 1.113 / (download) - annotate - [select for diffs], Sun Nov 12 20:14:39 2023 UTC (6 months, 3 weeks ago) by martijn
Branch: MAIN
Changes since 1.112: +1 -42 lines
Diff to previous 1.112 (colored)

Move struct oid from snmpd.h into smi.c and trim a lot of the now unused
fat. This includes all the o_flags member related defines.

if it compiles ship it/OK tb@

Revision 1.112 / (download) - annotate - [select for diffs], Sun Nov 12 20:12:01 2023 UTC (6 months, 3 weeks ago) by martijn
Branch: MAIN
Changes since 1.111: +1 -12 lines
Diff to previous 1.111 (colored)

Remove a bunch of unused smi_ functions and move a couple of definitions
out of snmpd.h, which aren't used outside of smi.c

OK tb@

Revision 1.111 / (download) - annotate - [select for diffs], Sun Nov 12 20:06:53 2023 UTC (6 months, 3 weeks ago) by martijn
Branch: MAIN
Changes since 1.110: +2 -2 lines
Diff to previous 1.110 (colored)

Let MIBDECL() make use of OID(). This gives use bo_n for free and we
won't have to rely on error-prone smi_oidlen.

OK tb@

Revision 1.110 / (download) - annotate - [select for diffs], Sun Nov 12 20:04:35 2023 UTC (6 months, 3 weeks ago) by martijn
Branch: MAIN
Changes since 1.109: +2 -2 lines
Diff to previous 1.109 (colored)

Now that smi.c is basically an oid/name translator, let smi_insert()
create the struct oid and let parse.y supply the arguments.

OK tb@

Revision 1.109 / (download) - annotate - [select for diffs], Sun Nov 12 16:07:34 2023 UTC (6 months, 3 weeks ago) by martijn
Branch: MAIN
Changes since 1.108: +1 -16 lines
Diff to previous 1.108 (colored)

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

OK tb@

Revision 1.108 / (download) - annotate - [select for diffs], Sat Nov 4 09:38:47 2023 UTC (7 months ago) by martijn
Branch: MAIN
Changes since 1.107: +11 -1 lines
Diff to previous 1.107 (colored)

Move SNMPv2-MIB::system from mib.c into the new application_internal.c.
This was the last consumer of mib.c, so send it to the great bitbucket
in the sky.

This move removes the sysORTable, but it was basically non-functioning
anyway and removal of previous entries from the table didn't caused
any fallout that reached my ears.
I hope to add proper sysORTable/agent-capabilities support, which
is compatible with AgentX's {Add,Remove}AgentCaps, soon.

OK tb@

Revision 1.107 / (download) - annotate - [select for diffs], Sat Nov 4 09:22:52 2023 UTC (7 months ago) by martijn
Branch: MAIN
Changes since 1.106: +3 -2 lines
Diff to previous 1.106 (colored)

Introduce application_internal.c. This backend is meant to replace
application_legacy.c, mps.c, and mib.c. This commit just introduces the
backend. The existing MIBs inside mib.c will be copied over in
subsequent commits.

OK tb@

Revision 1.106 / (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.105: +1 -216 lines
Diff to previous 1.105 (colored)

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

OK benno@ sthen@

Revision 1.105 / (download) - annotate - [select for diffs], Thu Sep 1 14:34:17 2022 UTC (21 months, 1 week ago) by martijn
Branch: MAIN
CVS Tags: OPENBSD_7_2_BASE, OPENBSD_7_2
Changes since 1.104: +4 -2 lines
Diff to previous 1.104 (colored)

Add privilege separation to snmpd.

This uses the just imported snmpd_metrics as a new (agentx-based) backend.
Snmpd(8) executes all files in /usr/libexec/snmpd and treats regions
registered by these binaries as authorative, so that no other agentx
backends can overwrite them. The snmpe process is now pledged
"stdio recvfd inet unix".

This removes quite a few entries from the sysORTable, but the current
entries are non-compliant anyway and should be completely revisisted at a
later time.

Reduces the time for a full walk by about a factor of 4, bringing us close
to the original speed before application.c was introduced.

General design discussed with claudio@
Tested by and OK sthen
Release build test and OK tb@

Revision 1.104 / (download) - annotate - [select for diffs], Tue Aug 23 08:56:21 2022 UTC (21 months, 2 weeks ago) by martijn
Branch: MAIN
Changes since 1.103: +19 -1 lines
Diff to previous 1.103 (colored)

(Re)add support for agentx in snmpd
Current omissions in protocol support are notifications,
index (de)allocation, and agent capabilities.

Help testing sthen@
Feedback/tweaks/OK jmatthew@

Revision 1.103 / (download) - annotate - [select for diffs], Thu Jun 30 11:28:36 2022 UTC (23 months, 1 week ago) by martijn
Branch: MAIN
Changes since 1.102: +3 -2 lines
Diff to previous 1.102 (colored)

Introduce a blocklist backend and keyword.

This allows the admin to specify a full region of the OID tree to be
blocked and simply returns NOSUCHOBJECT/ENDOFMIBVIEW.

This deprecates filter-pf-addresses in favour of:
blocklist pfTblAddrTable

OK tb@

Revision 1.102 / (download) - annotate - [select for diffs], Wed Jan 19 10:25:04 2022 UTC (2 years, 4 months ago) by martijn
Branch: MAIN
CVS Tags: OPENBSD_7_1_BASE, OPENBSD_7_1
Changes since 1.101: +2 -4 lines
Diff to previous 1.101 (colored)

Move some smi.c functions to their own header.
These are needed for a new application layer, where a lot of the snmpd.h
stuff just clutter.

OK jmatthew@
tested as part of larger diff by sthen@ and Joel Carnat

Revision 1.101 / (download) - annotate - [select for diffs], Wed Jan 19 10:19:27 2022 UTC (2 years, 4 months ago) by martijn
Branch: MAIN
Changes since 1.100: +2 -23 lines
Diff to previous 1.100 (colored)

Move log.c functions to their own header.
This is needed for a new application layer where, where a lot of the
snmpd.h stuff just clutter.

Requested by benno@
OK jmatthew@
tested as part of larger diff by sthen@ and Joel Carnat

Revision 1.100 / (download) - annotate - [select for diffs], Thu Sep 2 05:41:02 2021 UTC (2 years, 9 months ago) by martijn
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_7_0
Changes since 1.99: +14 -5 lines
Diff to previous 1.99 (colored)

Allow snmpd(8) to send SNMPv3 traps.

OK jmatthew@

Revision 1.99 / (download) - annotate - [select for diffs], Mon Aug 9 18:14:53 2021 UTC (2 years, 9 months ago) by martijn
Branch: MAIN
Changes since 1.98: +6 -3 lines
Diff to previous 1.98 (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.98 / (download) - annotate - [select for diffs], Sun Aug 8 13:41:26 2021 UTC (2 years, 10 months ago) by sthen
Branch: MAIN
Changes since 1.97: +2 -2 lines
Diff to previous 1.97 (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.97 / (download) - annotate - [select for diffs], Sun Jun 20 19:59:42 2021 UTC (2 years, 11 months ago) by martijn
Branch: MAIN
Changes since 1.96: +3 -3 lines
Diff to previous 1.96 (colored)

Change default user auth to hmac-sha256 and enc to aes.
The old defaults are just not sane anymore.

OK sthen@

Revision 1.96 / (download) - annotate - [select for diffs], Sun Jun 20 19:55:48 2021 UTC (2 years, 11 months ago) by martijn
Branch: MAIN
Changes since 1.95: +12 -5 lines
Diff to previous 1.95 (colored)

Tighten default security for snmpd(8). This is done by doing several
things:
- Only allow SNMPv3 by default. SNMPv1 and SNMPv2c can be enabled by
  setting the new snmpv* flags on the "liston on" statements.
- Remove the default community names. They're not secure to use.
- Change the default seclevel to enc.

Initial idea, help from and OK sthen@

Revision 1.95 / (download) - annotate - [select for diffs], Thu May 20 08:53:12 2021 UTC (3 years ago) by martijn
Branch: MAIN
Changes since 1.94: +2 -3 lines
Diff to previous 1.94 (colored)

Rename context to pdutype. This is in line with the naming schema from the
RFCs.

While here remove a duplicate sm_type that snuck in during traphandler
merger and use human readable names in debug log entries from packages.

OK jan@

Revision 1.94 / (download) - annotate - [select for diffs], Fri Feb 5 10:30:45 2021 UTC (3 years, 4 months ago) by martijn
Branch: MAIN
CVS Tags: OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.93: +9 -1 lines
Diff to previous 1.93 (colored)

Introduce a transaction id. This is currently mostly a dummy-variable, but
will later on be needed for when we reintroduce agentx master support.

feedback and OK dlg@, rob@

Revision 1.93 / (download) - annotate - [select for diffs], Thu Jan 28 20:45:14 2021 UTC (3 years, 4 months ago) by martijn
Branch: MAIN
Changes since 1.92: +1 -3 lines
Diff to previous 1.92 (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.92 / (download) - annotate - [select for diffs], Wed Jan 27 07:21:54 2021 UTC (3 years, 4 months ago) by deraadt
Branch: MAIN
Changes since 1.91: +2 -2 lines
Diff to previous 1.91 (colored)

these programs (with common ancestry) had a -fno-common problem related
to privsep_procid.
ok mortimer

Revision 1.91 / (download) - annotate - [select for diffs], Fri Jan 22 06:33:26 2021 UTC (3 years, 4 months ago) by martijn
Branch: MAIN
Changes since 1.90: +14 -8 lines
Diff to previous 1.90 (colored)

Remove the traphandler process, which was nothing more then a sham.
It did nothing more then receive a message over UDP, do some basic ber
and ASN.1 parsing and forward the packet to the parent process. snmpe can
do/does the same thing but with a far more thorough ASN.1 validation.
Because we move trap receiving to snmpe we get trap over tcp for free.

However, to make sure that a normal snmp port doesn't automatically start
handling traps a new set of "listen on" flags are introduced: read, write,
and notify. To enable trap handling either let snmpd listen on port 162
without flags, or add the notify flag. Only a flag without port results in
listening on port 162.

To keep current behaviour copy all UDP-based "listen on" lines without port
and add the notify keyword:
listen on 127.0.0.1 port 666
becomes
listen on 127.0.0.1 port 666
listen on 127.0.0.1 notify

This change also enforces snmpd to honor trap community on receiving a
trap, where previously no community was checked before handling a packet.

OK denis@, rob@

Revision 1.90 / (download) - annotate - [select for diffs], Sun Sep 6 15:51:28 2020 UTC (3 years, 9 months ago) by martijn
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8
Changes since 1.89: +14 -9 lines
Diff to previous 1.89 (colored)

Split "trap receiver" into its own trap_address struct and clean up the
code surrounding this struct and struct address.

No functional change intended, except that trap receiver's source-address
may now be a resolvable hostname.

Tweaks and OK jan@

Revision 1.89 / (download) - annotate - [select for diffs], Sun Aug 23 07:39:57 2020 UTC (3 years, 9 months ago) by martijn
Branch: MAIN
Changes since 1.88: +4 -11 lines
Diff to previous 1.88 (colored)

Merge listen_sock into address, since there's a 1:1 correlation. Save some
overhead and 18LoC.

OK jan@

Revision 1.88 / (download) - annotate - [select for diffs], Sat Aug 8 13:39:57 2020 UTC (3 years, 10 months ago) by martijn
Branch: MAIN
Changes since 1.87: +1 -10 lines
Diff to previous 1.87 (colored)

Greatly simplify snmpe_parsevarbinds.
except for some minor changes in the handling of snmp_intotal{req,set}vars
no functional changes intended.

OK jan@

Revision 1.87 / (download) - annotate - [select for diffs], Tue Jun 30 17:11:49 2020 UTC (3 years, 11 months ago) by martijn
Branch: MAIN
Changes since 1.86: +1 -30 lines
Diff to previous 1.86 (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.86 / (download) - annotate - [select for diffs], Thu Jan 2 10:55:53 2020 UTC (4 years, 5 months ago) by florian
Branch: MAIN
CVS Tags: OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.85: +2 -1 lines
Diff to previous 1.85 (colored)

When many prefixes are stored in pf tables it is not sensible
to export them via snmp.
Introduce option filter-pf-addresses similar to filter-routes which
prevents exporting below the OPENBSD-PF-MIB::pfTblAddrTable oid.
Other pf table statistics are uneffected by this and still available.
With this I can do a bulkwalk starting at pfMIBObjects without hitting
timeouts and without spinning the cpu at 100% for days to export 300k
prefixes.
man page input kn
OK claudio, sthen. martijn is also fine with it going in.

Revision 1.85 / (download) - annotate - [select for diffs], Tue Jun 11 05:36:32 2019 UTC (4 years, 11 months ago) by martijn
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.84: +7 -3 lines
Diff to previous 1.84 (colored)

Implement SHA-2 (RFC7860) support for authentication.

OK claudio@, gerhard@

Revision 1.84 / (download) - annotate - [select for diffs], Tue Jun 11 05:33:01 2019 UTC (4 years, 11 months ago) by martijn
Branch: MAIN
Changes since 1.83: +2 -2 lines
Diff to previous 1.83 (colored)

The digestlength is not always 12 bytes. Make this value variable in
preparation for SHA-2 support.

OK claudio@, gerhard@

Revision 1.83 / (download) - annotate - [select for diffs], Thu May 16 05:00:00 2019 UTC (5 years ago) by martijn
Branch: MAIN
Changes since 1.82: +2 -1 lines
Diff to previous 1.82 (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.82 / (download) - annotate - [select for diffs], Sat May 11 17:46:02 2019 UTC (5 years ago) by rob
Branch: MAIN
Changes since 1.81: +2 -2 lines
Diff to previous 1.81 (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.81 / (download) - annotate - [select for diffs], Tue Jan 8 15:38:36 2019 UTC (5 years, 5 months ago) by bluhm
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.80: +2 -2 lines
Diff to previous 1.80 (colored)

The child processes of snmpd(8) did not detach from the terminal.
Dup /dev/null to the stdio file descriptors in the children.
based on a fix for httpd(8) and relayd(8); from Jan Klemkow

Revision 1.80 / (download) - annotate - [select for diffs], Sun Aug 5 09:33:13 2018 UTC (5 years, 10 months ago) by mestre
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.79: +1 -2 lines
Diff to previous 1.79 (colored)

Remove cpath pledge(2) promise. We decided that not deleting the unix control
sockets cause no harm and this way we close another attack surface by not
allowing the daemon to create/delete any more files.

While here also scramble pledge promises to their canonical form.

OK florian@

Revision 1.79 / (download) - annotate - [select for diffs], Tue Jul 31 11:01:29 2018 UTC (5 years, 10 months ago) by claudio
Branch: MAIN
Changes since 1.78: +2 -2 lines
Diff to previous 1.78 (colored)

Make ber type and encoding a unsigned int instead of unsigned long.
This way the size is the same on all archs and 32bit should be good enough.
OK rob@

Revision 1.78 / (download) - annotate - [select for diffs], Sun Apr 15 11:57:29 2018 UTC (6 years, 1 month ago) by mpf
Branch: MAIN
Changes since 1.77: +7 -2 lines
Diff to previous 1.77 (colored)

Add TCP support to snmpd.

This implements RFC 3430, with the exception of processing multiple
incoming requests in parallel (Section 2.1). This required too much
code and is optional anyway.

Initial review by reyk@, very thorough reviews by jca@. Thanks!

OK jca@, gerhard@

Revision 1.77 / (download) - annotate - [select for diffs], Thu Feb 8 00:21:10 2018 UTC (6 years, 4 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3
Changes since 1.76: +2 -2 lines
Diff to previous 1.76 (colored)

Bump the read sockbuf of the routing socket to 2MB, may help reduce some of
the desync cases. OK benno@

Revision 1.76 / (download) - annotate - [select for diffs], Fri Jul 28 13:17:43 2017 UTC (6 years, 10 months ago) by florian
Branch: MAIN
CVS Tags: OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.75: +3 -3 lines
Diff to previous 1.75 (colored)

Make the engine id is just binary data so make it uint8_t.
clang pointed out that we tried to store 128 in a signed char.
OK gerhard

Revision 1.75 / (download) - annotate - [select for diffs], Fri Apr 21 13:50:23 2017 UTC (7 years, 1 month ago) by jca
Branch: MAIN
Changes since 1.74: +3 -2 lines
Diff to previous 1.74 (colored)

Repair AgentX support.

which I broke when adding support for multiple listen address.  SNMP
data should be sent to the client using the appropriate socket, which we
now store when we receive the query.

Reported & fix tested by Rivo Nurges.

Revision 1.74 / (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_1_BASE, OPENBSD_6_1
Changes since 1.73: +5 -3 lines
Diff to previous 1.73 (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.73 / (download) - annotate - [select for diffs], Fri Nov 18 16:16:39 2016 UTC (7 years, 6 months ago) by jca
Branch: MAIN
Changes since 1.72: +11 -5 lines
Diff to previous 1.72 (colored)

Add support for multiple listening sockets

One can now specify multiple "listen on" statements. The default is to
listen on 0.0.0.0 and ::, which means better handling of dual-stack
setups.  ok sthen@ on a previous version, input and ok reyk@.

Revision 1.72 / (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.71: +9 -1 lines
Diff to previous 1.71 (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.71 / (download) - annotate - [select for diffs], Fri Oct 28 09:07:08 2016 UTC (7 years, 7 months ago) by rzalamena
Branch: MAIN
Changes since 1.70: +27 -10 lines
Diff to previous 1.70 (colored)

Sync snmpd(8) with other daemons proc.c and teach him how to fork+exec.

ok jca@, reyk@

Revision 1.70 / (download) - annotate - [select for diffs], Fri Oct 28 08:01:53 2016 UTC (7 years, 7 months ago) by rzalamena
Branch: MAIN
Changes since 1.69: +3 -1 lines
Diff to previous 1.69 (colored)

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

ok jca@

Revision 1.69 / (download) - annotate - [select for diffs], Mon Oct 3 12:16:41 2016 UTC (7 years, 8 months ago) by dlg
Branch: MAIN
Changes since 1.68: +3 -1 lines
Diff to previous 1.68 (colored)

include sys/tree.h explicitly rather than rely on a random pf header
to do it.

ok deraadt@

Revision 1.68 / (download) - annotate - [select for diffs], Sun Sep 25 14:58:00 2016 UTC (7 years, 8 months ago) by fcambus
Branch: MAIN
Changes since 1.67: +1 -2 lines
Diff to previous 1.67 (colored)

Remove more duplicated includes

OK jca@, deraadt@

Revision 1.67 / (download) - annotate - [select for diffs], Tue Aug 16 18:41:57 2016 UTC (7 years, 9 months ago) by tedu
Branch: MAIN
Changes since 1.66: +5 -1 lines
Diff to previous 1.66 (colored)

stop including sys/param.h for nitems. define locally as needed.
ok natano reyk

Revision 1.66 / (download) - annotate - [select for diffs], Mon Dec 7 12:33:08 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.65: +7 -3 lines
Diff to previous 1.65 (colored)

Sync proc.c, use proc_composev()

Revision 1.65 / (download) - annotate - [select for diffs], Mon Nov 23 19:31:52 2015 UTC (8 years, 6 months ago) by reyk
Branch: MAIN
Changes since 1.64: +1 -8 lines
Diff to previous 1.64 (colored)

Use SOCK_NONBLOCK to replace socket_set_blockmode() and fcntl(..O_NONBLOCK).
(SOCK_CLOEXEC should also be added where it is appropriate, but this is OBnot
done in this commit yet.)

OK claudio@

Revision 1.64 / (download) - annotate - [select for diffs], Sun Nov 22 13:27:13 2015 UTC (8 years, 6 months ago) by reyk
Branch: MAIN
Changes since 1.63: +16 -8 lines
Diff to previous 1.63 (colored)

Update log.c: change fatal() and fatalx() into variadic functions,
include the process name, and replace all calls of fatal*(NULL) with
fatal(__func__) for better debugging.

OK benno@

Revision 1.63 / (download) - annotate - [select for diffs], Sat Nov 21 13:06:22 2015 UTC (8 years, 6 months ago) by reyk
Branch: MAIN
Changes since 1.62: +21 -15 lines
Diff to previous 1.62 (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.62 / (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.61: +3 -2 lines
Diff to previous 1.61 (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.61 / (download) - annotate - [select for diffs], Mon Oct 5 15:29:14 2015 UTC (8 years, 8 months ago) by uebayasi
Branch: MAIN
Changes since 1.60: +2 -1 lines
Diff to previous 1.60 (colored)

Teach snmpd(8) about if_oqdrops.

OK mpi@ dlg@

Revision 1.60 / (download) - annotate - [select for diffs], Thu Jun 11 18:49:09 2015 UTC (9 years ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.59: +4 -4 lines
Diff to previous 1.59 (colored)

Use "compliant" header guards by avoiding the reserved '_' namespace.

Pointed out by Markus Elfring

OK mikeb@ millert@

Revision 1.59 / (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.58: +2 -2 lines
Diff to previous 1.58 (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.58 / (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.57: +41 -21 lines
Diff to previous 1.57 (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.57 / (download) - annotate - [select for diffs], Sun Nov 16 19:07:51 2014 UTC (9 years, 6 months ago) by bluhm
Branch: MAIN
Changes since 1.56: +2 -1 lines
Diff to previous 1.56 (colored)

Convert the logic in yyerror().  Instead of creating a temporary
format string, create a temporary message.
OK doug@

Revision 1.56 / (download) - annotate - [select for diffs], Mon Aug 18 13:13:42 2014 UTC (9 years, 9 months ago) by reyk
Branch: MAIN
Changes since 1.55: +2 -1 lines
Diff to previous 1.55 (colored)

Sync proc.c with httpd.  httpd needs SIGUSR1 but snmpd will ignore it
now instead of terminating the process.

ok blambert@

Revision 1.55 / (download) - annotate - [select for diffs], Wed May 14 09:42:22 2014 UTC (10 years ago) by mikeb
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.54: +13 -1 lines
Diff to previous 1.54 (colored)

Sync ktable code with bgpd to fetch, store and perform lookups in
multiple routing tables.  Currently it doesn't do anything useful
but it's a prerequisite for any future work in this direction.

ok sthen, reyk, blambert

Revision 1.54 / (download) - annotate - [select for diffs], Mon Apr 28 12:03:32 2014 UTC (10 years, 1 month ago) by mikeb
Branch: MAIN
Changes since 1.53: +15 -1 lines
Diff to previous 1.53 (colored)

Add support for exporting ARP table via ipNetToMediaTable OID.
With help from blambert@ and sthen@, tested by sthen@, benno@
and myself;  ok blambert

Revision 1.53 / (download) - annotate - [select for diffs], Mon Apr 28 08:25:05 2014 UTC (10 years, 1 month ago) by blambert
Branch: MAIN
Changes since 1.52: +2 -2 lines
Diff to previous 1.52 (colored)

better proc id name (it handles traps, not alerts) for the
snmp trap handler

Revision 1.52 / (download) - annotate - [select for diffs], Fri Apr 25 06:57:11 2014 UTC (10 years, 1 month ago) by blambert
Branch: MAIN
Changes since 1.51: +27 -2 lines
Diff to previous 1.51 (colored)

Support running user-defined actions on receipt of snmp traps.

testing sthen@
much man page guidance jmc@
ok reyk@

Revision 1.51 / (download) - annotate - [select for diffs], Mon Apr 21 19:47:27 2014 UTC (10 years, 1 month ago) by reyk
Branch: MAIN
Changes since 1.50: +28 -12 lines
Diff to previous 1.50 (colored)

Copy the updated proc.c from relayd to use the same file.  Adjust
snmpd accordingly.

ok sthen@

Revision 1.50 / (download) - annotate - [select for diffs], Mon Apr 14 12:55:10 2014 UTC (10 years, 1 month ago) by blambert
Branch: MAIN
Changes since 1.49: +18 -2 lines
Diff to previous 1.49 (colored)

Make snmpd use the AgentX protcol for accepting trap requests.
AgentX notifications are the only portion implemented right now;
get in the tree to flesh out the remainder.

ok reyk@ benno@

Revision 1.49 / (download) - annotate - [select for diffs], Fri Feb 14 10:38:09 2014 UTC (10 years, 3 months ago) by florian
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.48: +1 -2 lines
Diff to previous 1.48 (colored)

remove unused function that distracts from cleaning up the imsg_flush() mess
OK hennig@, benno@

Revision 1.48 / (download) - annotate - [select for diffs], Thu Nov 21 17:32:13 2013 UTC (10 years, 6 months ago) by mikeb
Branch: MAIN
Changes since 1.47: +21 -1 lines
Diff to previous 1.47 (colored)

split kernel parts of the if.h into a separate header file if_var.h
which allows us to modify ifnet structure in a relatively safe way;
discussed with deraadt, ok mpi

Revision 1.47 / (download) - annotate - [select for diffs], Thu Oct 17 08:42:44 2013 UTC (10 years, 7 months ago) by reyk
Branch: MAIN
Changes since 1.46: +94 -27 lines
Diff to previous 1.46 (colored)

Update snmpd(8) to use the proc.c privsep style from iked and relayd.

ok sthen@ deraadt@

Revision 1.46 / (download) - annotate - [select for diffs], Wed Oct 16 16:05:03 2013 UTC (10 years, 7 months ago) by blambert
Branch: MAIN
Changes since 1.45: +5 -2 lines
Diff to previous 1.45 (colored)

 1) move the creation of 'restricted' communication sockets
    into snmpd.conf
 2) add the ability to specify an alternate 'control' socket location
 3) allow for the creation of multiple 'restricted' sockets (but
    only one control socket, for the time being)

Committing slightly ahead of schedule in order to clear the pipeline
for a few other upcoming changes.

ok reyk@, sthen@

Revision 1.45 / (download) - annotate - [select for diffs], Tue Oct 1 12:41:47 2013 UTC (10 years, 8 months ago) by reyk
Branch: MAIN
Changes since 1.44: +6 -2 lines
Diff to previous 1.44 (colored)

Add initial SNMP client utility to snmpctl(8).
For example, snmpctl snmp walk 127.0.0.1

commit it deraadt@

Revision 1.44 / (download) - annotate - [select for diffs], Thu Sep 26 09:11:30 2013 UTC (10 years, 8 months ago) by reyk
Branch: MAIN
Changes since 1.43: +4 -2 lines
Diff to previous 1.43 (colored)

shuffle some snmpd functions to make them visible in smi.c for snmpctl.

ok gerhard@ blambert@

Revision 1.43 / (download) - annotate - [select for diffs], Fri Mar 29 12:53:41 2013 UTC (11 years, 2 months ago) by gerhard
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.42: +2 -1 lines
Diff to previous 1.42 (colored)

Patch from Ilya Bakulin that allows to put snmpd(8) into read-only mode
so that all "set" requests will be rejected.

ok reyk@

Revision 1.42 / (download) - annotate - [select for diffs], Wed Mar 6 21:42:40 2013 UTC (11 years, 3 months ago) by sthen
Branch: MAIN
Changes since 1.41: +2 -1 lines
Diff to previous 1.41 (colored)

as done in ospf{,6}d/relayd, sync yyerror in various other daemons with
that from bgpd, so that it logs to syslog when daemonized.

Revision 1.41 / (download) - annotate - [select for diffs], Mon Mar 4 14:00:31 2013 UTC (11 years, 3 months ago) by bluhm
Branch: MAIN
Changes since 1.40: +2 -2 lines
Diff to previous 1.40 (colored)

Fix compiler warnings about casts discarding const qualifiers and
comparison between signed and unsigned.  No binary change.
OK reyk@ joel@ gerhard@

Revision 1.40 / (download) - annotate - [select for diffs], Thu Jan 24 09:30:27 2013 UTC (11 years, 4 months ago) by gerhard
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.39: +2 -1 lines
Diff to previous 1.39 (colored)

Even if there's no special seclevel required in snmpd.conf, we have to
validate the user of a received SNMPv3 request. If the configured user
has a certain security level (i.e. authentication and maybe encryption),
the received message must fulfill this security requirements, too.

ok reyk

Revision 1.39 / (download) - annotate - [select for diffs], Mon Oct 1 11:36:55 2012 UTC (11 years, 8 months ago) by reyk
Branch: MAIN
Changes since 1.38: +2 -2 lines
Diff to previous 1.38 (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.38 / (download) - annotate - [select for diffs], Tue Sep 18 08:29:09 2012 UTC (11 years, 8 months ago) by reyk
Branch: MAIN
Changes since 1.37: +4 -4 lines
Diff to previous 1.37 (colored)

knf

Revision 1.37 / (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.36: +2 -2 lines
Diff to previous 1.36 (colored)

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

Revision 1.36 / (download) - annotate - [select for diffs], Mon Sep 17 16:30:35 2012 UTC (11 years, 8 months ago) by reyk
Branch: MAIN
Changes since 1.35: +107 -5 lines
Diff to previous 1.35 (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.35 / (download) - annotate - [select for diffs], Mon May 28 20:55:40 2012 UTC (12 years ago) by joel
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE, OPENBSD_5_2
Changes since 1.34: +3 -3 lines
Diff to previous 1.34 (colored)

Plug a couple more fd leaks. As part of the fix, make all the *init
functions return void.

ok krw@

Revision 1.34 / (download) - annotate - [select for diffs], Sun Apr 8 02:57:40 2012 UTC (12 years, 2 months ago) by deraadt
Branch: MAIN
Changes since 1.33: +2 -1 lines
Diff to previous 1.33 (colored)

add the evtimout rate-limiting code for accept() here too.
eyed a little by joel

Revision 1.33 / (download) - annotate - [select for diffs], Thu Feb 23 03:54:38 2012 UTC (12 years, 3 months ago) by joel
Branch: MAIN
Changes since 1.32: +48 -1 lines
Diff to previous 1.32 (colored)

Bring in PF-MIB to snmpd.

ok krw@, sthen@

Revision 1.32 / (download) - annotate - [select for diffs], Wed Feb 1 18:44:06 2012 UTC (12 years, 4 months ago) by camield
Branch: MAIN
CVS Tags: OPENBSD_5_1_BASE, OPENBSD_5_1
Changes since 1.31: +2 -1 lines
Diff to previous 1.31 (colored)

Variable bindings need instance identifiers, for scalars this is always .0.
At least NetSNMP and HPOV now understand it.

ok joel@

Revision 1.31 / (download) - annotate - [select for diffs], Thu Apr 21 14:55:22 2011 UTC (13 years, 1 month ago) by sthen
Branch: MAIN
CVS Tags: OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.30: +2 -1 lines
Diff to previous 1.30 (colored)

Add a "filter-routes" option; when set, snmpd asks the kernel not to
send route updates. If you aren't interested in examining routing tables
over SNMP (e.g. if you only use it for sensors or interface stats) this
reduces cpu use during heavy route updates. Makes my full-table bgp
routers happier when a major peer bounces.  ok reyk@

Revision 1.30 / (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_4_9_BASE, OPENBSD_4_9
Changes since 1.29: +2 -2 lines
Diff to previous 1.29 (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.29 / (download) - annotate - [select for diffs], Fri Jun 11 10:45:36 2010 UTC (14 years ago) by jsg
Branch: MAIN
CVS Tags: OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.28: +4 -1 lines
Diff to previous 1.28 (colored)

Implement IP-FORWARD-MIB, ipv4 only for now.

ok reyk@ claudio@

Revision 1.28 / (download) - annotate - [select for diffs], Thu Apr 1 14:42:32 2010 UTC (14 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.27: +6 -4 lines
Diff to previous 1.27 (colored)

Track blackhole and reject flags since the MIB knows about them.
Remove an unneeded stack storage as well.
OK jsg@

Revision 1.27 / (download) - annotate - [select for diffs], Wed Mar 31 09:20:23 2010 UTC (14 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.26: +18 -11 lines
Diff to previous 1.26 (colored)

Track interface addresses in a AF independent way. This is needed to support
the AF independent MIBs like RFC4292 in the future. Additionally count number
of routes (also needed by some MIBs) and do not track the state of routes
since the MIB do not require it and it is expensive.
OK jsg@

Revision 1.26 / (download) - annotate - [select for diffs], Mon Mar 29 14:52:49 2010 UTC (14 years, 2 months ago) by claudio
Branch: MAIN
Changes since 1.25: +13 -6 lines
Diff to previous 1.25 (colored)

Sync kroute.c code with bgpd so that snmpd is able to track INET6 addrs as
well. First big sync, the interface address tree still needs to be made
AF independent but that will be done in a second step.
OK jsg@

Revision 1.25 / (download) - annotate - [select for diffs], Sat Jun 6 18:38:01 2009 UTC (15 years ago) by pyr
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7, OPENBSD_4_6_BASE, OPENBSD_4_6
Changes since 1.24: +2 -2 lines
Diff to previous 1.24 (colored)

this one missed the last batch.

Revision 1.24 / (download) - annotate - [select for diffs], Sat Jun 6 05:52:01 2009 UTC (15 years ago) by pyr
Branch: MAIN
Changes since 1.23: +15 -85 lines
Diff to previous 1.23 (colored)

sync snmpd with the common imsg code, making it lib ready as well.
ok eric@

Revision 1.23 / (download) - annotate - [select for diffs], Tue Dec 23 08:06:10 2008 UTC (15 years, 5 months ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.22: +2 -1 lines
Diff to previous 1.22 (colored)

export the livelock counter in a private mib openBSD.5.

discussed with dlg@

Revision 1.22 / (download) - annotate - [select for diffs], Mon Dec 8 11:34:55 2008 UTC (15 years, 6 months ago) by reyk
Branch: MAIN
Changes since 1.21: +7 -1 lines
Diff to previous 1.21 (colored)

report memory and swap in hrStorage, and implement hrProcessor to report
hrProcessorLoad (where load means the percentage of time the system was
not idle during the last minute).  based on HOST-RESOURCES-MIB.

ok dlg@

Revision 1.21 / (download) - annotate - [select for diffs], Fri Sep 26 15:19:55 2008 UTC (15 years, 8 months ago) by reyk
Branch: MAIN
Changes since 1.20: +13 -8 lines
Diff to previous 1.20 (colored)

allow to add an additional restricted control socket for trap sending
only (not even show commands).  this allows to place a socket for
traps in another daemon's chroot.

(based on restricted socket support from bgpd)

Revision 1.20 / (download) - annotate - [select for diffs], Fri Jul 18 12:30:06 2008 UTC (15 years, 10 months ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_4_4_BASE, OPENBSD_4_4
Changes since 1.19: +2 -2 lines
Diff to previous 1.19 (colored)

merge log_host with relayd's version using getnameinfo and rename it
to print_host.

Revision 1.19 / (download) - annotate - [select for diffs], Sun Jun 29 16:00:22 2008 UTC (15 years, 11 months ago) by ragge
Branch: MAIN
Changes since 1.18: +4 -4 lines
Diff to previous 1.18 (colored)

Use C99, not gcc-specific variadics.  Ok miod@.

Revision 1.18 / (download) - annotate - [select for diffs], Thu Feb 7 11:33:26 2008 UTC (16 years, 4 months ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_4_3_BASE, OPENBSD_4_3
Changes since 1.17: +2 -1 lines
Diff to previous 1.17 (colored)

add a imsg which allows to "lock" the control connection, the
restricted connection will reject any commands except snmp traps.

Revision 1.17 / (download) - annotate - [select for diffs], Fri Jan 18 02:09:30 2008 UTC (16 years, 4 months ago) by reyk
Branch: MAIN
Changes since 1.16: +3 -1 lines
Diff to previous 1.16 (colored)

add a snmpctl command to send traps to registered receivers using
snmpd's imsg trap interface.

Revision 1.16 / (download) - annotate - [select for diffs], Thu Jan 17 17:35:06 2008 UTC (16 years, 4 months ago) by reyk
Branch: MAIN
Changes since 1.15: +1 -2 lines
Diff to previous 1.15 (colored)

allow to configure optional per trap receiver communities and to
restrict the receivers to a specified mib.

Revision 1.15 / (download) - annotate - [select for diffs], Wed Jan 16 21:43:19 2008 UTC (16 years, 4 months ago) by reyk
Branch: MAIN
Changes since 1.14: +3 -2 lines
Diff to previous 1.14 (colored)

send a coldStart trap to registered receivers on startup and cleanup
the trap code a little bit.

Revision 1.14 / (download) - annotate - [select for diffs], Wed Jan 16 19:36:06 2008 UTC (16 years, 4 months ago) by reyk
Branch: MAIN
Changes since 1.13: +22 -10 lines
Diff to previous 1.13 (colored)

implementation of the SNMP trap sender interface

Revision 1.13 / (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.12: +2 -2 lines
Diff to previous 1.12 (colored)

bump copyright

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

move trap code to an own file; there will be more

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

start working on an interface to send traps via snmpd.sock.  userland
applications will be able to send imsgs defining the trap to snmpd and
the daemon will do the ASN.1/BER encoding before sending traps to the
registered receivers.  there are two advantages of this approach that
a) the applications do not need to handle any ASN.1/BER encoding and
b) snmpd will provide a central interface to define trap receivers.

discussed with thib and others

Revision 1.10 / (download) - annotate - [select for diffs], Thu Jan 3 15:03:47 2008 UTC (16 years, 5 months ago) by reyk
Branch: MAIN
Changes since 1.9: +2 -1 lines
Diff to previous 1.9 (colored)

handle no more than 2147483647 (0x7fffffff) variable bindings
From RFC3416

Revision 1.9 / (download) - annotate - [select for diffs], Wed Jan 2 20:54:59 2008 UTC (16 years, 5 months ago) by maja
Branch: MAIN
Changes since 1.8: +2 -2 lines
Diff to previous 1.8 (colored)

Make sure that a key belongs to the table before returning a match.
Change smi_odi_cmp to return int as expected by RB-tree. -moj

ok reyk@

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: +14 -4 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: +14 -10 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: +3 -2 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 28 15:32:02 2007 UTC (16 years, 5 months ago) by reyk
Branch: MAIN
Changes since 1.4: +2 -2 lines
Diff to previous 1.4 (colored)

use the snmp camelCase for MIB definitions, this allows to simplify
the code a bit and is mostly a stylistic change.

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

shrink the code by making some ipstat parts table-driven.  at some
point i may want to define a general table-driven interface for mibs.

Revision 1.3 / (download) - annotate - [select for diffs], Fri Dec 7 09:50:51 2007 UTC (16 years, 6 months ago) by reyk
Branch: MAIN
Changes since 1.2: +2 -2 lines
Diff to previous 1.2 (colored)

add a new 'd' format to ber_printf_elements to pass ints instead of
long longs; you have to pass the right type with vargs. this finally
fixes the previous problem on i386.

discussed with claudio

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