freebsd-dev/contrib/bsnmp
Gleb Smirnoff 0cf0d912b7 The first part of check_priv() function, that attempts to obtain creds
from the control message, actually never worked. This means check_priv()
didn't work for local dgram sockets.

The SCM_CREDS control messages is received only in two cases:

1) If we did setsockopt(LOCAL_CREDS) on our socket, and in this case
   the message is struct sockcred.
2) If sender did supplied SCM_CREDS control message in his sendmsg()
   syscall. In this case the message is struct cmsgcred.

We can't rely on 2), so we will use 1) for dgram sockets. For stream
sockets it is more reliable to obtain accept-time credentials, since
SCM_CREDS control message is attached only on first read. Thus:

o Do setsockopt(LOCAL_CREDS) on local dgram sockets.
o Split check_priv() into check_priv_stream() and check_priv_dgram(),
  and call them from recv_stream() and recv_dgram() respectively.
o Don't provide space for SCM_CREDS control message in recv_stream().
o Provide space for SCM_CREDS control message in recv_dgram(), but there
  is no need to initialize anything in it.
o In recv_dgram() do not blindly expect that first message is SCM_CREDS,
  instead use correct search cycle through control messages.
2012-09-08 07:12:00 +00:00
..
gensnmpdef mdoc: consistently spell our email addresses <foo@FreeBSD.org> 2010-05-24 06:26:38 +00:00
gensnmptree mdoc: consistently spell our email addresses <foo@FreeBSD.org> 2010-05-24 06:26:38 +00:00
lib Remove end of line whitespace. 2012-06-17 11:36:28 +00:00
snmp_mibII Count both IPv4 and IPv6 TCP connections in tcpCurrEstab 2012-06-06 18:00:38 +00:00
snmp_ntp Virgin import of bsnmpd 1.12 2006-02-27 16:16:18 +00:00
snmp_target Minor mdoc fixes. 2012-06-17 11:33:55 +00:00
snmp_usm Remove end of line whitespace. 2012-06-17 11:36:28 +00:00
snmp_vacm Minor mdoc fixes. 2012-06-17 11:33:55 +00:00
snmpd The first part of check_priv() function, that attempts to obtain creds 2012-09-08 07:12:00 +00:00
FREEBSD-upgrade Update the upgrade instructions to account for the fact, that 2004-01-26 10:28:31 +00:00
FREEBSD-Xlist Don't import tree.h from the distribution - we have our own one in sys. 2006-03-13 09:30:26 +00:00
NEWS Vendor patch: add support for the BITS construct and enumerations in both 2006-05-30 07:46:52 +00:00
oid-list Bring the list of OIDs up-to-date to prevent conflicts. 2011-02-03 15:19:18 +00:00
README Virgin import of bsnmpd 1.5a 2004-01-23 10:44:47 +00:00
TODO Virgin import of bsnmpd 1.12 2006-02-27 16:16:18 +00:00
VERSION Virgin import of bsnmpd 1.12 2006-02-27 16:16:18 +00:00

Fri Dec  5 15:01:16 CET 2003

This is a mini-SNMP daemon. The basic daemon implements the system group
and a number of private extensions to manage the UDP transport mapping,
communities, trap destinations and loadable modules. In this form it can
be used to provide remote access to arbitrary data that can be described in
the form as required by the SMI. The daemon speaks both SNMPv1 and SNMPv2c.

One basic loadable module is provided together with the daemon:

- snmp_mibII provides the information groups for ip, tcp, and udp.

Installation
------------

As usual by doing:

	configure [--with-libbegemot[=path]]
	make
	make install

This does not install a configuration file. The standard location for the
configuration is /etc/snmpd.config, but can be overwritten on the command
line. An example configuration file is provided. Use --with-libbegemot
to use libbegemot instead of libisc.

Running
-------

	snmpd [-m name[=value]] [-p pid-file] [-c config-file] [-d] [-l prefix]
	      [-D debug-flags] [-I path]

	-m	defines a configuration macro. If no value is given it
		is set to the empty string.

	-p	specify the file where to store the PID. Default is
		/var/run/{prefix}.pid.

	-c	specify the configuration file. Default is /etc/{prefix}.config.

	-d	don't go into daemon mode.

	-l	specify the prefix. This is used for the default config and
		pid file names and for the syslog. Default is "snmpd".

	-D	specify debug flags:

		d	dump all PDUs.

		e	debug event library.

	-I	specify the include path for system configuration files.
		Default is /etc:/usr/etc:/usr/local/etc.

The directory snmpd contains a snmpd.sh script, which can be copied to
/usr/local/etc/rc.d to automatically start and stop the daemon. snmpd.config
is an example config script.

Bug reports:
-----------

Please report bugs to harti@freebsd.org.

Happy hacking,
harti