-/* $OpenBSD: parse.y,v 1.86 2023/12/21 12:43:31 martijn Exp $ */
+/* $OpenBSD: parse.y,v 1.87 2024/02/06 12:39:13 martijn Exp $ */
/*
* Copyright (c) 2007, 2008, 2012 Reyk Floeter <reyk@openbsd.org>
struct snmpd *conf = NULL;
static int errors = 0;
static struct usmuser *user = NULL;
+static int mibparsed = 0;
static struct ber_oid *smi_object;
static uint8_t engineid[SNMPD_MAXENGINEIDLEN];
%token READONLY READWRITE OCTETSTRING INTEGER COMMUNITY TRAP RECEIVER
%token SECLEVEL NONE AUTH ENC USER AUTHKEY ENCKEY ERROR
%token HANDLE DEFAULT SRCADDR TCP UDP BLOCKLIST PORT
+%token MIB DIRECTORY
%token <v.string> STRING
%token <v.number> NUMBER
%type <v.string> usmuser community optcommunity
| grammar main '\n'
| grammar system '\n'
| grammar object '\n'
+ | grammar mib '\n'
| grammar error '\n' { file->errors++; }
;
}
;
+mib : MIB DIRECTORY STRING {
+ mib_parsedir($3);
+ mibparsed = 1;
+ }
+ ;
+
%%
struct keywords {
{ "contact", CONTACT },
{ "default", DEFAULT },
{ "description", DESCR },
+ { "directory", DIRECTORY },
{ "enc", ENC },
{ "enckey", ENCKEY },
{ "engineid", ENGINEID },
{ "listen", LISTEN },
{ "location", LOCATION },
{ "mac", MAC },
+ { "mib", MIB },
{ "mode", MODE },
{ "name", NAME },
{ "none", NONE },
endservent();
+ if (!mibparsed)
+ mib_parsedir("/usr/share/snmp/mibs");
+ mib_resolve();
+
if (uname(&u) == -1)
fatal("uname");
-.\" $OpenBSD: snmpd.conf.5,v 1.63 2023/04/25 13:36:01 op Exp $
+.\" $OpenBSD: snmpd.conf.5,v 1.64 2024/02/06 12:39:13 martijn Exp $
.\"
.\" Copyright (c) 2007, 2008, 2012 Reyk Floeter <reyk@openbsd.org>
.\"
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: April 25 2023 $
+.Dd $Mdocdate: February 6 2024 $
.Dt SNMPD.CONF 5
.Os
.Sh NAME
must be 8 bytes
.Pq or 16 characters in hexadecimal format .
.El
+.It Ic mib directory Ar path
+Specify which directories to recursively search for MIB files.
+Multiple directories can be specified.
+If no directory is specified it defaults to
+.Pa /usr/share/snmp/mibs .
.It Ic read-only community Ar string
Specify the name of the read-only community.
There is no default value.