OpenBSD CVS

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


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.108, Sat Nov 4 09:38:47 2023 UTC (7 months ago) by martijn
Branch: MAIN
CVS Tags: HEAD
Changes since 1.107: +1 -1 lines
FILE REMOVED

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:30:28 2023 UTC (7 months ago) by martijn
Branch: MAIN
Changes since 1.106: +1 -77 lines
Diff to previous 1.106 (colored)

Move SNMPv2-SMI::snmpV2 from mib.c into the new application_internal.c

OK tb@

Revision 1.106 / (download) - annotate - [select for diffs], Sat Nov 4 09:28:04 2023 UTC (7 months ago) by martijn
Branch: MAIN
Changes since 1.105: +1 -109 lines
Diff to previous 1.105 (colored)

Move SNMPv2-MIB::snmp from mib.c into the new application_internal.c

OK tb@

Revision 1.105 / (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.104: +5 -3550 lines
Diff to previous 1.104 (colored)

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

OK benno@ sthen@

Revision 1.104 / (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.103: +3 -1 lines
Diff to previous 1.103 (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.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: +1 -7 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 Sep 1 15:54:40 2021 UTC (2 years, 9 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0
Changes since 1.101: +3 -2 lines
Diff to previous 1.101 (colored)

A couple commands don't need sys/param.h, but they do need sys/signal.h

Revision 1.101 / (download) - annotate - [select for diffs], Sun Sep 6 16:12:23 2020 UTC (3 years, 9 months ago) by jan
Branch: MAIN
CVS Tags: OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8
Changes since 1.100: +14 -16 lines
Diff to previous 1.100 (colored)

replace duplicated sizeofa marco with predefined nitems

OK martijn@

Revision 1.100 / (download) - annotate - [select for diffs], Wed Jul 1 16:41:43 2020 UTC (3 years, 11 months ago) by martijn
Branch: MAIN
Changes since 1.99: +8 -2 lines
Diff to previous 1.99 (colored)

Allow hrStorageSize and hrStorageUsed to cope with sizes larger then
INT32_MAX by increasing the hrStorageAllocationUnits value until they fit.

Original patch from Johan Huldtgren (johan+openbsd-tech <at> huldtgren <dot> com)
OK sthen@

Revision 1.99 / (download) - annotate - [select for diffs], Fri May 15 00:56:03 2020 UTC (4 years ago) by cheloha
Branch: MAIN
Changes since 1.98: +2 -2 lines
Diff to previous 1.98 (colored)

pf(4): use CLOCK_BOOTTIME to get time_uptime(9) in userspace

In pf(4), the pf_status.since timestamp is set with time_uptime(9).
This is a low-res snapshot of nanouptime(9).  nanouptime(9) is used to
implement CLOCK_BOOTTIME for clock_gettime(2).  It is not used to
implement CLOCK_UPTIME, though.  The names are misleading.

Switch to CLOCK_BOOTTIME in places in userspace where we use
pf_status.since so we are working with the right clock.

Technically CLOCK_MONOTONIC is equivalent, but we shouldn't use that
here.  CLOCK_MONOTONIC is not necessarily the "time since boot": the
standard says its absolute value is meaningless.

ok patrick@ bluhm@

Revision 1.98 / (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.97: +7 -1 lines
Diff to previous 1.97 (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.96.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.96: +398 -398 lines
Diff to previous 1.96 (colored) next main 1.97 (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.97 / (download) - annotate - [select for diffs], Thu Oct 24 12:39:27 2019 UTC (4 years, 7 months ago) by tb
Branch: MAIN
Changes since 1.96: +398 -398 lines
Diff to previous 1.96 (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.96 / (download) - annotate - [select for diffs], Tue Aug 13 12:52:41 2019 UTC (4 years, 9 months ago) by sthen
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE
Branch point for: OPENBSD_6_6
Changes since 1.95: +2 -13 lines
Diff to previous 1.95 (colored)

snmpd was using ifq_len for ifOutQLen, apart from being the wrong variable
for this MIB in the first place, this has now been removed in ifq changes.
Since the MIB is marked as deprecated anyway, simply return 0. ok claudio@

Revision 1.95 / (download) - annotate - [select for diffs], Tue Aug 13 12:46:19 2019 UTC (4 years, 9 months ago) by claudio
Branch: MAIN
Changes since 1.94: +2 -10 lines
Diff to previous 1.94 (colored)

Report if_iqdrops (input queue drops) as ifInDiscards. This is pretty
much what this counter is for. For sure better than net.inet.ip.ifq.drops
which no longer exists.
Found by and OK martijn@ and OK sthen@

Revision 1.94 / (download) - annotate - [select for diffs], Fri Jun 28 13:32:51 2019 UTC (4 years, 11 months ago) by deraadt
Branch: MAIN
Changes since 1.93: +7 -7 lines
Diff to previous 1.93 (colored)

When system calls indicate an error they return -1, not some arbitrary
value < 0.  errno is only updated in this case.  Change all (most?)
callers of syscalls to follow this better, and let's see if this strictness
helps us in the future.

Revision 1.93 / (download) - annotate - [select for diffs], Thu May 2 14:04:10 2019 UTC (5 years, 1 month ago) by gerhard
Branch: MAIN
Changes since 1.92: +3 -1 lines
Diff to previous 1.92 (colored)

Index 0 is out of range for hrStorageIndex.

ok reyk@

Revision 1.92 / (download) - annotate - [select for diffs], Mon Dec 10 13:35:54 2018 UTC (5 years, 5 months ago) by landry
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.91: +4 -3 lines
Diff to previous 1.91 (colored)

Add a velocity sensor type (displayed as m/s)

Change distance sensor type to be displayed as meters with 3 decimals
instead of millimeters.

ok mpi@ kettenis@

Revision 1.91 / (download) - annotate - [select for diffs], Fri Aug 31 05:20:36 2018 UTC (5 years, 9 months ago) by jsg
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.90: +2 -2 lines
Diff to previous 1.90 (colored)

fix fd leak in an error path
ok mpi@

Revision 1.90 / (download) - annotate - [select for diffs], Thu Aug 30 12:25:40 2018 UTC (5 years, 9 months ago) by jsg
Branch: MAIN
Changes since 1.89: +1 -2 lines
Diff to previous 1.89 (colored)

fix double free in mib_carpgroupget() error path
ok claudio@ miko@

Revision 1.89 / (download) - annotate - [select for diffs], Mon Jun 4 18:05:18 2018 UTC (6 years ago) by gerhard
Branch: MAIN
Changes since 1.88: +4 -2 lines
Diff to previous 1.88 (colored)

Fix file descriptor leak.

Patch submitted by Nan Xiao, ok tb@ sthen@ millert@ deraadt@ jca@

Revision 1.88 / (download) - annotate - [select for diffs], Wed May 30 18:17:20 2018 UTC (6 years ago) by sthen
Branch: MAIN
Changes since 1.87: +103 -1 lines
Diff to previous 1.87 (colored)

Use new SIOCGIFGLIST to provide carpGroupTable, showing "demote" values
for interface groups on the system. From Jan Klemkow.

Revision 1.87 / (download) - annotate - [select for diffs], Fri May 25 08:23:15 2018 UTC (6 years ago) by gerhard
Branch: MAIN
Changes since 1.86: +48 -16 lines
Diff to previous 1.86 (colored)

Use a cache for process information to speed up snmp walks.

ok jca@ claudio@

Revision 1.86 / (download) - annotate - [select for diffs], Wed May 9 13:56:46 2018 UTC (6 years, 1 month ago) by sthen
Branch: MAIN
Changes since 1.85: +6 -2 lines
Diff to previous 1.85 (colored)

As required by IF-MIB, cap ifSpeed at UINT32_MAX; the value is a GAUGE32 so
values above this can't be represented and ifHighSpeed must be used instead.
Problem reported by Arnaud BRAND, ok mpi

Revision 1.85 / (download) - annotate - [select for diffs], Mon Dec 18 05:51:53 2017 UTC (6 years, 5 months ago) by cheloha
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3
Changes since 1.84: +6 -11 lines
Diff to previous 1.84 (colored)

Add the CLOCK_BOOTTIME clockid for use with clock_gettime(2)
and put it to use in userspace in lieu of the kern.boottime
sysctl.

Its absolute value is the time that has elapsed since the
system booted, i.e., the system uptime.

Use in top(1), w(1), and snmpd(8) eliminates a race with
settimeofday(2), adjtime(2), etc. inherent to deriving the
system uptime via the kern.boottime sysctl.

Product of a great deal of discussion/revision with jca@, tb@,
and guenther@.

ok tb@ jca@ guenther@ dlg@ mlarkin@ tom@

Revision 1.84 / (download) - annotate - [select for diffs], Thu Jun 1 14:38:28 2017 UTC (7 years ago) by patrick
Branch: MAIN
CVS Tags: OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.83: +5 -6 lines
Diff to previous 1.83 (colored)

Return time_uptime as value for when pf was enabled instead of
time_second.  Since time_second changes depending on the wall-
clock time, time_second is not a reliable source for the status.
We can even end up with a negative time delta.  Thus, use the
monotonically growing time_uptime and export it to userland.

ok bluhm@ mikeb@

Revision 1.83 / (download) - annotate - [select for diffs], Tue Jan 31 21:31:04 2017 UTC (7 years, 4 months ago) by sthen
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.82: +2 -2 lines
Diff to previous 1.82 (colored)

Don't include a literal "%" in the value for humidity sensorValue in
OPENBSD-SENSORS-MIB, % is the unit for this value and is already present
in sensorUnits, and it's harder for NMS to parse "100.00%" as a number.
From Joel Knight.

Revision 1.82 / (download) - annotate - [select for diffs], Fri Jan 20 09:11:18 2017 UTC (7 years, 4 months ago) by claudio
Branch: MAIN
Changes since 1.81: +2 -1 lines
Diff to previous 1.81 (colored)

Because of pfsync this needs ip_ipsp.h. Missed in the pfsockaddr_union cleanup.
Found by krw@

Revision 1.81 / (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.80: +11 -13 lines
Diff to previous 1.80 (colored)

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

ok jca@

Revision 1.80 / (download) - annotate - [select for diffs], Tue Nov 17 12:30:23 2015 UTC (8 years, 6 months ago) by gerhard
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.79: +5 -2 lines
Diff to previous 1.79 (colored)

Sensors marked as invalid should be excluded by snmpd(8) from the sensors
MIB just as sysctl(8) excludes them from the 'hw.sensors' tree.

OK mikeb@, stehn@

Revision 1.79 / (download) - annotate - [select for diffs], Thu Oct 8 08:29:21 2015 UTC (8 years, 8 months ago) by sthen
Branch: MAIN
Changes since 1.78: +2 -1 lines
Diff to previous 1.78 (colored)

add comment, suggested by reyk

Revision 1.78 / (download) - annotate - [select for diffs], Thu Oct 8 07:26:34 2015 UTC (8 years, 8 months ago) by sthen
Branch: MAIN
Changes since 1.77: +2 -2 lines
Diff to previous 1.77 (colored)

use correct return value for IP-MIB::ipForwarding, tweak/ok uebayasi@

Revision 1.77 / (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.76: +2 -2 lines
Diff to previous 1.76 (colored)

Teach snmpd(8) about if_oqdrops.

OK mpi@ dlg@

Revision 1.76 / (download) - annotate - [select for diffs], Wed Jun 10 10:03:59 2015 UTC (9 years ago) by mikeb
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.75: +4 -2 lines
Diff to previous 1.75 (colored)

Export new pf "no-route" error counter

OK sthen, blambert for the SNMP part

Revision 1.75 / (download) - annotate - [select for diffs], Wed Jan 21 21:50:33 2015 UTC (9 years, 4 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.74: +5 -5 lines
Diff to previous 1.74 (colored)

Include <netinet/in.h> before <net/pfvar.h>.  In a future change when
ports is ready, <net/pfvar.h> will stop including a pile of balony.

Revision 1.74 / (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.73: +2 -3 lines
Diff to previous 1.73 (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.73 / (download) - annotate - [select for diffs], Tue Nov 18 20:54:29 2014 UTC (9 years, 6 months ago) by krw
Branch: MAIN
Changes since 1.72: +1 -2 lines
Diff to previous 1.72 (colored)

Nuke more obvious #include duplications.

ok deraadt@ millert@ tedu@

Revision 1.72 / (download) - annotate - [select for diffs], Sat Oct 25 03:23:49 2014 UTC (9 years, 7 months ago) by lteo
Branch: MAIN
Changes since 1.71: +1 -2 lines
Diff to previous 1.71 (colored)

Remove unnecessary netinet/in_systm.h include.

ok millert@

Revision 1.71 / (download) - annotate - [select for diffs], Fri Jul 4 05:58:31 2014 UTC (9 years, 11 months ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.70: +1 -2 lines
Diff to previous 1.70 (colored)

Track whether a process is a zombie or not yet fully built via flags
PS_{ZOMBIE,EMBRYO} on the process instead of peeking into the process's
thread data.  This eliminates the need for the thread-level SDEAD state.

Change kvm_getprocs() (both the sysctl() and kvm backends) to report the
"most active" scheduler state for the process's threads.

tweaks kettenis@
feedback and ok matthew@

Revision 1.70 / (download) - annotate - [select for diffs], Mon Jun 23 03:46:17 2014 UTC (9 years, 11 months ago) by guenther
Branch: MAIN
Changes since 1.69: +6 -6 lines
Diff to previous 1.69 (colored)

The second level of the CTL_NET sysctl is a PF_*, not an AF_*

inconsistent usage in route(8) noted by Gregor Best (gbe (at) ring0.de)

Revision 1.69 / (download) - annotate - [select for diffs], Wed May 7 01:23:52 2014 UTC (10 years, 1 month ago) by tedu
Branch: MAIN
Changes since 1.68: +2 -3 lines
Diff to previous 1.68 (colored)

use calloc. from peter malone

Revision 1.68 / (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.67: +155 -5 lines
Diff to previous 1.67 (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.67 / (download) - annotate - [select for diffs], Tue Apr 8 14:04:11 2014 UTC (10 years, 2 months ago) by mpi
Branch: MAIN
Changes since 1.66: +2 -7 lines
Diff to previous 1.66 (colored)

Use VM_UVMEXP instead of VM_METER for memory usages and directly
include <sys/vmmeter.h> where it is needed instead of relying on
it being included by <uvm/uvm_extern.h>.

miod@ likes it, ok guenther@

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

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

commit it deraadt@

Revision 1.65 / (download) - annotate - [select for diffs], Sat Sep 7 04:31:52 2013 UTC (10 years, 9 months ago) by joel
Branch: MAIN
Changes since 1.64: +45 -1 lines
Diff to previous 1.64 (colored)

Sync PF-MIB and snmpd up with the pf(4) table byte/packet counters for
'match' rules

ok sten ryek

Revision 1.64 / (download) - annotate - [select for diffs], Mon Mar 11 19:49:37 2013 UTC (11 years, 3 months ago) by sthen
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.63: +4 -2 lines
Diff to previous 1.63 (colored)

Report new PF "translation" counter, indicating that address translation
has failed due to no free ports in the configured range. ok mikeb@

Revision 1.63 / (download) - annotate - [select for diffs], Tue Dec 18 21:28:45 2012 UTC (11 years, 5 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.62: +2 -1 lines
Diff to previous 1.62 (colored)

We no longer use struct eproc for kinfo_proc in sysctl.h so there
is no direct need for sys/proc.h or sys/resource.h.  Some consumers
of kinfo_proc need these for the proc flags and rlimit defines like
RLIM_INF so add the appropriate includes to them.
OK deraadt@ sthen@

Revision 1.62 / (download) - annotate - [select for diffs], Thu Nov 29 13:16:30 2012 UTC (11 years, 6 months ago) by mikeb
Branch: MAIN
Changes since 1.61: +11 -11 lines
Diff to previous 1.61 (colored)

export ipintrq drops as ifInDiscards; ok reyk

Revision 1.61 / (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.60: +18 -7 lines
Diff to previous 1.60 (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.60 / (download) - annotate - [select for diffs], Thu Sep 20 20:11:58 2012 UTC (11 years, 8 months ago) by yuo
Branch: MAIN
Changes since 1.59: +8 -2 lines
Diff to previous 1.59 (colored)

add more sensor types to sensor framework.
 - Pressure (10^-3 Pa)
 - distance (10^-6 m)
 - acceleration (10^-6 m/s^2)

ok deraadt@ reyk@

Revision 1.59 / (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.58: +31 -30 lines
Diff to previous 1.58 (colored)

knf

Revision 1.58 / (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.57: +2 -2 lines
Diff to previous 1.57 (colored)

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

Revision 1.57 / (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.56: +78 -2 lines
Diff to previous 1.56 (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.56 / (download) - annotate - [select for diffs], Sun Jul 8 11:24:43 2012 UTC (11 years, 11 months ago) by blambert
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE, OPENBSD_5_2
Changes since 1.55: +2 -2 lines
Diff to previous 1.55 (colored)

a -> an in a comment

ok phessler@

Revision 1.55 / (download) - annotate - [select for diffs], Tue Jun 19 18:43:27 2012 UTC (11 years, 11 months ago) by matthew
Branch: MAIN
Changes since 1.54: +4 -3 lines
Diff to previous 1.54 (colored)

Use calloc() instead of malloc() for allocating the disk stats.

Requested by deraadt.

Revision 1.54 / (download) - annotate - [select for diffs], Thu Jun 14 17:31:32 2012 UTC (11 years, 11 months ago) by matthew
Branch: MAIN
Changes since 1.53: +98 -1 lines
Diff to previous 1.53 (colored)

Add support for UCD-DISKIO-MIB.

ok sthen

Revision 1.53 / (download) - annotate - [select for diffs], Sat May 26 14:45:55 2012 UTC (12 years ago) by joel
Branch: MAIN
Changes since 1.52: +14 -13 lines
Diff to previous 1.52 (colored)

Plug some leaks when certain error conditions are met.
From Gerhard Roth via tech@

ok krw@ sthen@

Revision 1.52 / (download) - annotate - [select for diffs], Tue Mar 20 03:01:26 2012 UTC (12 years, 2 months ago) by joel
Branch: MAIN
Changes since 1.51: +104 -1 lines
Diff to previous 1.51 (colored)

New OIDs hrSystemUptime, hrSystemDate, hrSystemProcesses and
hrSystemMaxProcesses.

ok sthen@

Revision 1.51 / (download) - annotate - [select for diffs], Mon Feb 27 16:45:16 2012 UTC (12 years, 3 months ago) by sthen
Branch: MAIN
Changes since 1.50: +2 -1 lines
Diff to previous 1.50 (colored)

Use correct Counter32 type for following MIBs. They only return dummy data
but we should use the correct type anyway.

BRIDGE-MIB::dot1dBasePortDelayExceededDiscards
BRIDGE-MIB::dot1dBasePortMtuExceededDiscards

OK joel@

Revision 1.50 / (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.49: +1005 -1 lines
Diff to previous 1.49 (colored)

Bring in PF-MIB to snmpd.

ok krw@, sthen@

Revision 1.49 / (download) - annotate - [select for diffs], Tue Jan 31 18:00:46 2012 UTC (12 years, 4 months ago) by joel
Branch: MAIN
CVS Tags: OPENBSD_5_1_BASE, OPENBSD_5_1
Changes since 1.48: +233 -4 lines
Diff to previous 1.48 (colored)

Add the OPENBSD-CARP-MIB to snmpd


ok camield@, "start committing" deraadt@

Revision 1.48 / (download) - annotate - [select for diffs], Mon Jan 30 22:04:28 2012 UTC (12 years, 4 months ago) by joel
Branch: MAIN
Changes since 1.47: +9 -2 lines
Diff to previous 1.47 (colored)

If a kernel sensor doesn't have a description, come up with something
useful rather than leaving that field empty.


ok sthen@ deraadt@

Revision 1.47 / (download) - annotate - [select for diffs], Fri Sep 16 20:52:48 2011 UTC (12 years, 8 months ago) by yuo
Branch: MAIN
Changes since 1.46: +3 -2 lines
Diff to previous 1.46 (colored)

reorder SENSOR_* in switch() and add missing cases.

ok deraadt@

Revision 1.46 / (download) - annotate - [select for diffs], Fri Sep 16 15:44:31 2011 UTC (12 years, 8 months ago) by yuo
Branch: MAIN
Changes since 1.45: +2 -2 lines
Diff to previous 1.45 (colored)

apply following changes to sensor framework:
- change accuracy of SENSOR_FREQ from Hz to muHz
- add SENSOR_VOLTS_AC entry to userland programs

ok deraadt@

Revision 1.45 / (download) - annotate - [select for diffs], Mon Jul 4 04:34:14 2011 UTC (12 years, 11 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.44: +6 -6 lines
Diff to previous 1.44 (colored)

LINK_STATE_IS_UP() cleanup userland part. There is no need to special
case carp(4) interfaces anymore. LINK_STATE_IS_UP() almost always does
the right job.
OK deraadt@ henning@

This needs a -current kernel or link state may be not reported correctly.

Revision 1.44 / (download) - annotate - [select for diffs], Sun Apr 10 03:20:59 2011 UTC (13 years, 2 months ago) by guenther
Branch: MAIN
Changes since 1.43: +11 -11 lines
Diff to previous 1.43 (colored)

Switch back from KERN_PROC2/kinfo_proc2 to KERN_PROC/kinfo_proc now
that we've got name we want for the API we want

"ZAP!" deraadt@

Revision 1.43 / (download) - annotate - [select for diffs], Fri Oct 15 11:56:13 2010 UTC (13 years, 7 months ago) by sthen
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9
Changes since 1.42: +3 -2 lines
Diff to previous 1.42 (colored)

return numeric 0 rather than attempting to return a null string,
fixes a segfault when walking memiftable.

seems sane to phessler, ok dlg@

Revision 1.42 / (download) - annotate - [select for diffs], Thu Sep 23 10:49:55 2010 UTC (13 years, 8 months ago) by dlg
Branch: MAIN
Changes since 1.41: +2 -3 lines
Diff to previous 1.41 (colored)

tweak the mclgeti algorithm to behave better under load.

instead of letting hardware rings grow on every interrupt, restrict
it so it can only grow once per softclock tick. we can only punish
the rings on softclock ticks, so it make sense to only grow on
softclock tick boundaries too.

the rings are now punished after >1 lost softclock tick rather than
>2. mclgeti is now more aggressive at detecting livelock.

the rings get punished by an 8th, rather than by half.

we now allow the rings to be punished again even if the system is
already considered in livelock.

without this diff a livelocked system will have its rx ring sizes
scale up and down very rapidly, while holding the rings low for too
long. this affected throughput significantly.

discussed and tested heavily at j2k10. there are still some games
with softnet we can play, but this is a good first step.

"put it in" and ok deraadt@
ok claudio@ krw@ henning@ mcbride@

if we find out that it sucks we can pull it out again later. till then
we'll run with it and see how it goes.

Revision 1.41 / (download) - annotate - [select for diffs], Mon Sep 20 16:29:51 2010 UTC (13 years, 8 months ago) by sthen
Branch: MAIN
Changes since 1.40: +2 -2 lines
Diff to previous 1.40 (colored)

fix-up the sysORTable by using the same name (sensorsMIBObjects) as used
in the MIB, rather than a different spelling (sensorMIBObjects).

ok martinh@

Revision 1.40 / (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.39: +247 -1 lines
Diff to previous 1.39 (colored)

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

ok reyk@ claudio@

Revision 1.39 / (download) - annotate - [select for diffs], Tue Apr 27 15:37:13 2010 UTC (14 years, 1 month ago) by jsg
Branch: MAIN
Changes since 1.38: +11 -9 lines
Diff to previous 1.38 (colored)

Correct sensor logic so we don't get stuck in a loop.
ok deraadt@

Revision 1.38 / (download) - annotate - [select for diffs], Tue Apr 20 20:49:36 2010 UTC (14 years, 1 month ago) by deraadt
Branch: MAIN
Changes since 1.37: +13 -9 lines
Diff to previous 1.37 (colored)

Get rid of MAXSENSORDEVICES.  Gaps in sensordev lists are now handled
by returning ENXIO instead of ENOENT, to essentially indicate hotplug
sensor that has gone away.  Accessing beyond the end of the sensordev
list still returns ENOENT, so that you can see there are no further devices.
ok kettenis oga

Revision 1.37 / (download) - annotate - [select for diffs], Tue Apr 20 19:44:07 2010 UTC (14 years, 1 month ago) by oga
Branch: MAIN
Changes since 1.36: +2 -1 lines
Diff to previous 1.36 (colored)

Add "frequency" type for sensors. (and teach userland how to print that
type).  Measured in Hz.

ok deraadt@

Revision 1.36 / (download) - annotate - [select for diffs], Thu Apr 15 04:57:29 2010 UTC (14 years, 1 month ago) by yuo
Branch: MAIN
Changes since 1.35: +2 -1 lines
Diff to previous 1.35 (colored)

add SENSOR_HUMIDITY to sensor framework to handle humidity values

ok kettenis@ xsa@ sobrado@ krw@ deraadt@

Revision 1.35 / (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.34: +25 -14 lines
Diff to previous 1.34 (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.34 / (download) - annotate - [select for diffs], Mon Jan 11 11:15:03 2010 UTC (14 years, 5 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.33: +5 -4 lines
Diff to previous 1.33 (colored)

Do not use after free kif->if_index; discovered with claudio
ok dlg

Revision 1.33 / (download) - annotate - [select for diffs], Mon Jan 11 06:38:41 2010 UTC (14 years, 5 months ago) by deraadt
Branch: MAIN
Changes since 1.32: +2 -2 lines
Diff to previous 1.32 (colored)

use calloc() instead of multiplying for malloc(); ok reyk

Revision 1.32 / (download) - annotate - [select for diffs], Wed Dec 16 22:17:53 2009 UTC (14 years, 5 months ago) by deraadt
Branch: MAIN
Changes since 1.31: +4 -4 lines
Diff to previous 1.31 (colored)

knf and unused variables

Revision 1.31 / (download) - annotate - [select for diffs], Fri Aug 14 19:44:14 2009 UTC (14 years, 9 months ago) by cnst
Branch: MAIN
Changes since 1.30: +2 -1 lines
Diff to previous 1.30 (colored)

SENSOR_WATTS;  ok reyk deraadt

Revision 1.30 / (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_6_BASE, OPENBSD_4_6, OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.29: +40 -1 lines
Diff to previous 1.29 (colored)

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

discussed with dlg@

Revision 1.29 / (download) - annotate - [select for diffs], Fri Dec 19 14:02:20 2008 UTC (15 years, 5 months ago) by reyk
Branch: MAIN
Changes since 1.28: +4 -4 lines
Diff to previous 1.28 (colored)

fix IF-MIB element and implementation ifInUnknownErrors -> ifInUnknownProtos

Revision 1.28 / (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.27: +199 -18 lines
Diff to previous 1.27 (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.27 / (download) - annotate - [select for diffs], Tue Mar 18 16:57:58 2008 UTC (16 years, 2 months ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_4_4_BASE, OPENBSD_4_4
Changes since 1.26: +14 -17 lines
Diff to previous 1.26 (colored)

remove ber_add_astring and make it the default behaviour in
ber_add_string, ber_add_nstring, and ber_add_bitstring to allocate and
copy the provided buffer instead of just attaching it to the ber
element.  this may add some overhead but fixes and avoids some bugs
with static buffers and simplifies the ber api again.

From Matthew at Dempsky dot org
With input from claudio@

Revision 1.26 / (download) - annotate - [select for diffs], Mon Mar 17 14:47:20 2008 UTC (16 years, 2 months ago) by reyk
Branch: MAIN
Changes since 1.25: +8 -30 lines
Diff to previous 1.25 (colored)

convert more strings to use the new ber_add_astring() function which
simplifies the code.

Revision 1.25 / (download) - annotate - [select for diffs], Mon Mar 17 14:40:15 2008 UTC (16 years, 2 months ago) by reyk
Branch: MAIN
Changes since 1.24: +3 -2 lines
Diff to previous 1.24 (colored)

another sizeofa instead of sizeof fix

Revision 1.24 / (download) - annotate - [select for diffs], Mon Mar 17 13:56:17 2008 UTC (16 years, 2 months ago) by reyk
Branch: MAIN
Changes since 1.23: +2 -2 lines
Diff to previous 1.23 (colored)

fix incorrect use of sizeof() where there sizeofa() macro should be used

ok dlg@

Revision 1.23 / (download) - annotate - [select for diffs], Sun Mar 16 00:35:05 2008 UTC (16 years, 2 months ago) by dlg
Branch: MAIN
Changes since 1.22: +203 -1 lines
Diff to previous 1.22 (colored)

implement the hrSWRun portion of the HOST-RESOURCES mib. you can see whats
running now, which is another thing my nms at work likes.

ok reyk@

Revision 1.22 / (download) - annotate - [select for diffs], Sat Mar 15 23:50:54 2008 UTC (16 years, 2 months ago) by dlg
Branch: MAIN
Changes since 1.21: +11 -18 lines
Diff to previous 1.21 (colored)

provide sizeofa for counting the number of elements in an array. use it for
passing the length of the mib in all these sysctl calls.

ok reyk@

Revision 1.21 / (download) - annotate - [select for diffs], Sat Mar 15 00:56:08 2008 UTC (16 years, 2 months ago) by dlg
Branch: MAIN
Changes since 1.20: +2 -2 lines
Diff to previous 1.20 (colored)

move zerodotzero up so more stuff can use it

this is an ok bit of a bigger diff that reyk wanted split up

Revision 1.20 / (download) - annotate - [select for diffs], Mon Mar 10 11:02:32 2008 UTC (16 years, 3 months ago) by dlg
Branch: MAIN
Changes since 1.19: +97 -0 lines
Diff to previous 1.19 (colored)

provide a partial implementation of the HOST-RESOURCES-MIB. this implements
the hrStorage part, which is enough to see how much space is used on your
filesystems. makes my nms happy.

ok reyk@

Revision 1.19 / (download) - annotate - [select for diffs], Wed Jan 30 10:12:45 2008 UTC (16 years, 4 months ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_4_3_BASE, OPENBSD_4_3
Changes since 1.18: +2 -2 lines
Diff to previous 1.18 (colored)

spacing

Revision 1.18 / (download) - annotate - [select for diffs], Fri Jan 18 18:38:35 2008 UTC (16 years, 4 months ago) by reyk
Branch: MAIN
Changes since 1.17: +61 -2 lines
Diff to previous 1.17 (colored)

implement very basic support of the BRIDGE-MIB which is enough to get
recognized as a network device by some NMS.

Revision 1.17 / (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.16: +2 -2 lines
Diff to previous 1.16 (colored)

bump copyright

Revision 1.16 / (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.15: +100 -7 lines
Diff to previous 1.15 (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.15 / (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.14: +12 -12 lines
Diff to previous 1.14 (colored)

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

Revision 1.14 / (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.13: +17 -102 lines
Diff to previous 1.13 (colored)

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

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

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

Revision 1.12 / (download) - annotate - [select for diffs], Sat Dec 15 06:26:59 2007 UTC (16 years, 5 months ago) by reyk
Branch: MAIN
Changes since 1.11: +6 -8 lines
Diff to previous 1.11 (colored)

fix the sensors mib to match the new OpenBSD PEN

Revision 1.11 / (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.10: +67 -190 lines
Diff to previous 1.10 (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.10 / (download) - annotate - [select for diffs], Sat Dec 15 03:02:59 2007 UTC (16 years, 5 months ago) by reyk
Branch: MAIN
Changes since 1.9: +13 -13 lines
Diff to previous 1.9 (colored)

ips_odropped is ipOutDiscards not ipInDiscards

Revision 1.9 / (download) - annotate - [select for diffs], Sat Dec 15 02:53:22 2007 UTC (16 years, 5 months ago) by gilles
Branch: MAIN
Changes since 1.8: +4 -1 lines
Diff to previous 1.8 (colored)

add support for ipReasmTimeout

ok (and thanks to) reyk@

Revision 1.8 / (download) - annotate - [select for diffs], Sat Dec 15 02:37:58 2007 UTC (16 years, 5 months ago) by reyk
Branch: MAIN
Changes since 1.7: +48 -86 lines
Diff to previous 1.7 (colored)

implement one function to call the ipstat sysctl needed in a number of
places instead of repeating the code.

inspired by an idea from gilles@

Revision 1.7 / (download) - annotate - [select for diffs], Sat Dec 15 02:20:03 2007 UTC (16 years, 5 months ago) by reyk
Branch: MAIN
Changes since 1.6: +16 -19 lines
Diff to previous 1.6 (colored)

more sysctl style changes for older code

Revision 1.6 / (download) - annotate - [select for diffs], Sat Dec 15 02:14:30 2007 UTC (16 years, 5 months ago) by reyk
Branch: MAIN
Changes since 1.5: +90 -192 lines
Diff to previous 1.5 (colored)

change the style of the sysctl mib setup

Revision 1.5 / (download) - annotate - [select for diffs], Sat Dec 15 02:02:45 2007 UTC (16 years, 5 months ago) by gilles
Branch: MAIN
Changes since 1.4: +443 -19 lines
Diff to previous 1.4 (colored)

now that ip statistics are available through sysctl, make snmpd's IP-MIB
	aware of them

ok reyk@

Revision 1.4 / (download) - annotate - [select for diffs], Mon Dec 10 23:23:21 2007 UTC (16 years, 6 months ago) by gilles
Branch: MAIN
Changes since 1.3: +75 -1 lines
Diff to previous 1.3 (colored)

add ip_mib table as well as support for retrieving ipForwarding and
	ipDefaultTTL

ok reyk@

Revision 1.3 / (download) - annotate - [select for diffs], Thu Dec 6 09:08:05 2007 UTC (16 years, 6 months ago) by reyk
Branch: MAIN
Changes since 1.2: +15 -4 lines
Diff to previous 1.2 (colored)

do not re-use static char buffers, allocate them; this avoids some
strange effects in GETBULK mode. (this should go into ber.c).

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: +218 -8 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.