summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/snmpd/application.c4
-rw-r--r--usr.sbin/snmpd/application_agentx.c9
-rw-r--r--usr.sbin/snmpd/application_blocklist.c10
-rw-r--r--usr.sbin/snmpd/application_internal.c10
-rw-r--r--usr.sbin/snmpd/ax.c3
-rw-r--r--usr.sbin/snmpd/ax.h5
-rw-r--r--usr.sbin/snmpd/log.c4
-rw-r--r--usr.sbin/snmpd/parse.y31
-rw-r--r--usr.sbin/snmpd/proc.c6
-rw-r--r--usr.sbin/snmpd/smi.c37
-rw-r--r--usr.sbin/snmpd/smi.h8
-rw-r--r--usr.sbin/snmpd/snmp.h3
-rw-r--r--usr.sbin/snmpd/snmpd.c19
-rw-r--r--usr.sbin/snmpd/snmpd.h20
-rw-r--r--usr.sbin/snmpd/snmpe.c20
-rw-r--r--usr.sbin/snmpd/snmpe.h5
-rw-r--r--usr.sbin/snmpd/trap.c23
-rw-r--r--usr.sbin/snmpd/traphandler.c19
-rw-r--r--usr.sbin/snmpd/usm.c28
-rw-r--r--usr.sbin/snmpd/util.c12
20 files changed, 126 insertions, 150 deletions
diff --git a/usr.sbin/snmpd/application.c b/usr.sbin/snmpd/application.c
index 7941f5c1a7b..973856aadeb 100644
--- a/usr.sbin/snmpd/application.c
+++ b/usr.sbin/snmpd/application.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: application.c,v 1.40 2023/11/16 14:35:25 martijn Exp $ */
+/* $OpenBSD: application.c,v 1.41 2023/12/21 12:43:30 martijn Exp $ */
/*
* Copyright (c) 2021 Martijn van Duren <martijn@openbsd.org>
@@ -17,7 +17,9 @@
*/
#include <sys/queue.h>
+#include <sys/time.h>
#include <sys/tree.h>
+#include <sys/types.h>
#include <assert.h>
#include <errno.h>
diff --git a/usr.sbin/snmpd/application_agentx.c b/usr.sbin/snmpd/application_agentx.c
index 3614ea9e183..44e50438f6a 100644
--- a/usr.sbin/snmpd/application_agentx.c
+++ b/usr.sbin/snmpd/application_agentx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: application_agentx.c,v 1.14 2023/11/06 11:04:41 martijn Exp $ */
+/* $OpenBSD: application_agentx.c,v 1.15 2023/12/21 12:43:30 martijn Exp $ */
/*
* Copyright (c) 2022 Martijn van Duren <martijn@openbsd.org>
*
@@ -18,15 +18,16 @@
#include <sys/queue.h>
#include <sys/socket.h>
#include <sys/stat.h>
-#include <sys/time.h>
-#include <sys/types.h>
+#include <sys/tree.h>
#include <sys/un.h>
+#include <ber.h>
#include <errno.h>
#include <event.h>
#include <inttypes.h>
-#include <stdlib.h>
+#include <stdint.h>
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include <unistd.h>
diff --git a/usr.sbin/snmpd/application_blocklist.c b/usr.sbin/snmpd/application_blocklist.c
index e3bb1b94c07..354908d5068 100644
--- a/usr.sbin/snmpd/application_blocklist.c
+++ b/usr.sbin/snmpd/application_blocklist.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: application_blocklist.c,v 1.1 2022/06/30 11:28:36 martijn Exp $ */
+/* $OpenBSD: application_blocklist.c,v 1.2 2023/12/21 12:43:31 martijn Exp $ */
/*
* Copyright (c) 2022 Martijn van Duren <martijn@openbsd.org>
@@ -16,10 +16,16 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <event.h>
+#include <sys/types.h>
+
+#include <stddef.h>
+
+#include <ber.h>
+#include <stdint.h>
#include <stdlib.h>
#include "application.h"
+#include "log.h"
#include "snmpd.h"
struct appl_varbind *appl_blocklist_response(size_t);
diff --git a/usr.sbin/snmpd/application_internal.c b/usr.sbin/snmpd/application_internal.c
index a9c637b23d0..9d9166cbe54 100644
--- a/usr.sbin/snmpd/application_internal.c
+++ b/usr.sbin/snmpd/application_internal.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: application_internal.c,v 1.10 2023/12/18 09:42:57 martijn Exp $ */
+/* $OpenBSD: application_internal.c,v 1.11 2023/12/21 12:43:31 martijn Exp $ */
/*
* Copyright (c) 2023 Martijn van Duren <martijn@openbsd.org>
@@ -17,17 +17,21 @@
*/
#include <sys/tree.h>
+#include <sys/types.h>
+#include <stddef.h>
+
+#include <ber.h>
#include <errno.h>
-#include <event.h>
+#include <stdint.h>
#include <stdlib.h>
#include <string.h>
-#include <unistd.h>
#include "application.h"
#include "log.h"
#include "mib.h"
#include "smi.h"
+#include "snmp.h"
#include "snmpd.h"
struct appl_internal_object {
diff --git a/usr.sbin/snmpd/ax.c b/usr.sbin/snmpd/ax.c
index a5c4c19306a..4a2509a2f78 100644
--- a/usr.sbin/snmpd/ax.c
+++ b/usr.sbin/snmpd/ax.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ax.c,v 1.3 2023/10/24 08:54:52 martijn Exp $ */
+/* $OpenBSD: ax.c,v 1.4 2023/12/21 12:43:31 martijn Exp $ */
/*
* Copyright (c) 2019 Martijn van Duren <martijn@openbsd.org>
*
@@ -26,7 +26,6 @@
#include <stdint.h>
#include <stdio.h>
#include <string.h>
-#include <strings.h>
#include <unistd.h>
#include "ax.h"
diff --git a/usr.sbin/snmpd/ax.h b/usr.sbin/snmpd/ax.h
index 550197838d7..36006221ab0 100644
--- a/usr.sbin/snmpd/ax.h
+++ b/usr.sbin/snmpd/ax.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ax.h,v 1.2 2023/10/24 08:54:52 martijn Exp $ */
+/* $OpenBSD: ax.h,v 1.3 2023/12/21 12:43:31 martijn Exp $ */
/*
* Copyright (c) 2019 Martijn van Duren <martijn@openbsd.org>
*
@@ -15,6 +15,9 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include <sys/types.h>
+
+#include <endian.h>
#include <stdint.h>
#define AX_PDU_FLAG_INSTANCE_REGISTRATION (1 << 0)
diff --git a/usr.sbin/snmpd/log.c b/usr.sbin/snmpd/log.c
index 6ad48d805f5..2bbae66c886 100644
--- a/usr.sbin/snmpd/log.c
+++ b/usr.sbin/snmpd/log.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: log.c,v 1.16 2017/03/21 12:06:56 bluhm Exp $ */
+/* $OpenBSD: log.c,v 1.17 2023/12/21 12:43:31 martijn Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -16,6 +16,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include <sys/types.h>
+
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
diff --git a/usr.sbin/snmpd/parse.y b/usr.sbin/snmpd/parse.y
index 7d001774e30..ab78c2bde29 100644
--- a/usr.sbin/snmpd/parse.y
+++ b/usr.sbin/snmpd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.85 2023/12/18 16:58:26 martijn Exp $ */
+/* $OpenBSD: parse.y,v 1.86 2023/12/21 12:43:31 martijn Exp $ */
/*
* Copyright (c) 2007, 2008, 2012 Reyk Floeter <reyk@openbsd.org>
@@ -23,40 +23,41 @@
*/
%{
-#include <sys/types.h>
-#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/queue.h>
-#include <sys/tree.h>
+#include <sys/socket.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/un.h>
#include <sys/utsname.h>
-#include <netinet/in.h>
-#include <net/if.h>
-
#include <arpa/inet.h>
+#include <netinet/in.h>
+
#include <openssl/sha.h>
+#include <ber.h>
#include <ctype.h>
-#include <unistd.h>
#include <err.h>
#include <errno.h>
-#include <event.h>
#include <grp.h>
#include <inttypes.h>
#include <limits.h>
-#include <stdint.h>
-#include <stdarg.h>
-#include <stdlib.h>
-#include <stdio.h>
#include <netdb.h>
#include <pwd.h>
-#include <string.h>
+#include <stdarg.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <strings.h>
#include <syslog.h>
+#include <unistd.h>
#include "application.h"
-#include "snmpd.h"
+#include "log.h"
#include "mib.h"
+#include "snmpd.h"
+#include "snmp.h"
TAILQ_HEAD(files, file) files = TAILQ_HEAD_INITIALIZER(files);
static struct file {
diff --git a/usr.sbin/snmpd/proc.c b/usr.sbin/snmpd/proc.c
index fe596ff6437..94a78a9a778 100644
--- a/usr.sbin/snmpd/proc.c
+++ b/usr.sbin/snmpd/proc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: proc.c,v 1.28 2023/02/15 20:44:01 tobhe Exp $ */
+/* $OpenBSD: proc.c,v 1.29 2023/12/21 12:43:31 martijn Exp $ */
/*
* Copyright (c) 2010 - 2016 Reyk Floeter <reyk@openbsd.org>
@@ -17,14 +17,13 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/types.h>
-#include <sys/queue.h>
#include <sys/socket.h>
#include <sys/wait.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
+#include <stdint.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
@@ -34,6 +33,7 @@
#include <event.h>
#include <imsg.h>
+#include "log.h"
#include "snmpd.h"
void proc_exec(struct privsep *, struct privsep_proc *, unsigned int, int,
diff --git a/usr.sbin/snmpd/smi.c b/usr.sbin/snmpd/smi.c
index ceeb8db6b6f..cdd3044c48b 100644
--- a/usr.sbin/snmpd/smi.c
+++ b/usr.sbin/snmpd/smi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: smi.c,v 1.38 2023/11/12 20:14:39 martijn Exp $ */
+/* $OpenBSD: smi.c,v 1.39 2023/12/21 12:43:31 martijn Exp $ */
/*
* Copyright (c) 2007, 2008 Reyk Floeter <reyk@openbsd.org>
@@ -16,37 +16,26 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/queue.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/socket.h>
-#include <sys/un.h>
#include <sys/tree.h>
-#include <sys/sysctl.h>
-
-#include <net/if.h>
-#include <net/if_dl.h>
-#include <net/if_arp.h>
-#include <net/if_media.h>
-#include <net/route.h>
-#include <netinet/in.h>
-#include <netinet/if_ether.h>
+#include <sys/time.h>
+#include <sys/types.h>
+
#include <arpa/inet.h>
-#include <stdlib.h>
-#include <stdio.h>
+#include <ber.h>
#include <errno.h>
-#include <event.h>
-#include <fcntl.h>
-#include <string.h>
-#include <unistd.h>
#include <limits.h>
-#include <pwd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <strings.h>
#include <vis.h>
-#include "snmpd.h"
+#include "log.h"
#include "mib.h"
-#include "application.h"
+#include "smi.h"
+#include "snmp.h"
+#include "snmpd.h"
struct oid {
struct ber_oid o_id;
diff --git a/usr.sbin/snmpd/smi.h b/usr.sbin/snmpd/smi.h
index 980dd7da1ef..c6e31c0cceb 100644
--- a/usr.sbin/snmpd/smi.h
+++ b/usr.sbin/snmpd/smi.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: smi.h,v 1.3 2023/11/08 20:02:52 martijn Exp $ */
+/* $OpenBSD: smi.h,v 1.4 2023/12/21 12:43:31 martijn Exp $ */
/*
* Copyright (c) 2021 Martijn van Duren <martijn@openbsd.org>
@@ -16,8 +16,10 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <ber.h>
-#include <stdint.h>
+#include <sys/types.h>
+
+struct ber_element;
+struct ber_oid;
char *smi_oid2string(struct ber_oid *, char *, size_t, size_t);
u_long smi_getticks(void);
diff --git a/usr.sbin/snmpd/snmp.h b/usr.sbin/snmpd/snmp.h
index 9396545617d..c0a9a0cf4ca 100644
--- a/usr.sbin/snmpd/snmp.h
+++ b/usr.sbin/snmpd/snmp.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: snmp.h,v 1.19 2022/06/30 09:42:19 martijn Exp $ */
+/* $OpenBSD: snmp.h,v 1.20 2023/12/21 12:43:31 martijn Exp $ */
/*
* Copyright (c) 2007, 2008, 2012 Reyk Floeter <reyk@openbsd.org>
@@ -20,7 +20,6 @@
#define SNMPD_SNMP_H
#include <sys/types.h>
-#include <endian.h>
/*
* SNMP IMSG interface
diff --git a/usr.sbin/snmpd/snmpd.c b/usr.sbin/snmpd/snmpd.c
index 6a1f4e5bc97..2f35ede72f3 100644
--- a/usr.sbin/snmpd/snmpd.c
+++ b/usr.sbin/snmpd/snmpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: snmpd.c,v 1.48 2022/10/06 14:41:08 martijn Exp $ */
+/* $OpenBSD: snmpd.c,v 1.49 2023/12/21 12:43:31 martijn Exp $ */
/*
* Copyright (c) 2007, 2008, 2012 Reyk Floeter <reyk@openbsd.org>
@@ -17,29 +17,20 @@
*/
#include <sys/types.h>
-#include <sys/queue.h>
-#include <sys/socket.h>
#include <sys/wait.h>
-#include <sys/tree.h>
-
-#include <net/if.h>
#include <dirent.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <getopt.h>
#include <err.h>
#include <errno.h>
-#include <event.h>
+#include <pwd.h>
#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
#include <syslog.h>
#include <unistd.h>
-#include <fcntl.h>
-#include <pwd.h>
+#include "log.h"
#include "snmpd.h"
-#include "mib.h"
__dead void usage(void);
diff --git a/usr.sbin/snmpd/snmpd.h b/usr.sbin/snmpd/snmpd.h
index 50472036a87..56891e5ef45 100644
--- a/usr.sbin/snmpd/snmpd.h
+++ b/usr.sbin/snmpd/snmpd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: snmpd.h,v 1.114 2023/11/13 15:05:14 martijn Exp $ */
+/* $OpenBSD: snmpd.h,v 1.115 2023/12/21 12:43:31 martijn Exp $ */
/*
* Copyright (c) 2007, 2008, 2012 Reyk Floeter <reyk@openbsd.org>
@@ -20,24 +20,22 @@
#ifndef SNMPD_H
#define SNMPD_H
+#include <sys/queue.h>
+#include <sys/socket.h>
+#include <sys/time.h>
#include <sys/tree.h>
+#include <sys/types.h>
#include <sys/un.h>
-#include <net/if.h>
-#include <net/if_dl.h>
#include <netinet/in.h>
-#include <netinet/if_ether.h>
-#include <netinet/ip.h>
-#include <arpa/inet.h>
-#include <net/pfvar.h>
-#include <net/route.h>
#include <ber.h>
-#include <stdio.h>
+#include <event.h>
+#include <limits.h>
#include <imsg.h>
+#include <stddef.h>
+#include <stdint.h>
-#include "log.h"
-#include "smi.h"
#include "snmp.h"
#ifndef nitems
diff --git a/usr.sbin/snmpd/snmpe.c b/usr.sbin/snmpd/snmpe.c
index 121692985a8..73e25ba32a0 100644
--- a/usr.sbin/snmpd/snmpe.c
+++ b/usr.sbin/snmpd/snmpe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: snmpe.c,v 1.92 2023/11/20 10:32:45 martijn Exp $ */
+/* $OpenBSD: snmpe.c,v 1.93 2023/12/21 12:43:31 martijn Exp $ */
/*
* Copyright (c) 2007, 2008, 2012 Reyk Floeter <reyk@openbsd.org>
@@ -18,27 +18,27 @@
*/
#include <sys/queue.h>
-#include <sys/types.h>
-#include <sys/stat.h>
#include <sys/socket.h>
-#include <sys/un.h>
+#include <sys/time.h>
#include <sys/tree.h>
+#include <sys/types.h>
-#include <net/if.h>
#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <errno.h>
+#include <ber.h>
#include <event.h>
+#include <errno.h>
#include <fcntl.h>
+#include <imsg.h>
#include <locale.h>
+#include <stdlib.h>
+#include <stdio.h>
#include <string.h>
+#include <strings.h>
#include <unistd.h>
-#include <pwd.h>
#include "application.h"
+#include "log.h"
#include "snmpd.h"
#include "snmpe.h"
#include "mib.h"
diff --git a/usr.sbin/snmpd/snmpe.h b/usr.sbin/snmpd/snmpe.h
index 265a7a1a340..af3db3b0aee 100644
--- a/usr.sbin/snmpd/snmpe.h
+++ b/usr.sbin/snmpd/snmpe.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: snmpe.h,v 1.2 2022/01/19 10:36:35 martijn Exp $ */
+/* $OpenBSD: snmpe.h,v 1.3 2023/12/21 12:43:31 martijn Exp $ */
/*
* Copyright (c) 2021 Martijn van Duren <martijn@openbsd.org>
@@ -16,9 +16,12 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include <stdint.h>
+
#include "snmp.h"
struct snmp_message;
+struct ber_element;
void snmpe_send(struct snmp_message *, enum snmp_pdutype, int32_t,
int32_t, uint32_t, struct ber_element *);
diff --git a/usr.sbin/snmpd/trap.c b/usr.sbin/snmpd/trap.c
index 043799a3999..94fe4a7b8d8 100644
--- a/usr.sbin/snmpd/trap.c
+++ b/usr.sbin/snmpd/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.40 2023/12/12 20:18:39 martijn Exp $ */
+/* $OpenBSD: trap.c,v 1.41 2023/12/21 12:43:31 martijn Exp $ */
/*
* Copyright (c) 2008 Reyk Floeter <reyk@openbsd.org>
@@ -17,27 +17,18 @@
*/
#include <sys/queue.h>
-#include <sys/types.h>
-#include <sys/stat.h>
#include <sys/socket.h>
-#include <sys/un.h>
-#include <sys/tree.h>
-
-#include <net/if.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
+#include <ber.h>
+#include <stdint.h>
#include <stdlib.h>
-#include <stdio.h>
-#include <errno.h>
-#include <event.h>
-#include <fcntl.h>
#include <string.h>
-#include <unistd.h>
-#include <pwd.h>
-#include "snmpd.h"
+#include "log.h"
#include "mib.h"
+#include "smi.h"
+#include "snmp.h"
+#include "snmpd.h"
void
trap_init(void)
diff --git a/usr.sbin/snmpd/traphandler.c b/usr.sbin/snmpd/traphandler.c
index c9affe0afad..c22ea136307 100644
--- a/usr.sbin/snmpd/traphandler.c
+++ b/usr.sbin/snmpd/traphandler.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: traphandler.c,v 1.24 2022/12/28 21:30:19 jmc Exp $ */
+/* $OpenBSD: traphandler.c,v 1.25 2023/12/21 12:43:31 martijn Exp $ */
/*
* Copyright (c) 2014 Bret Stephen Lambert <blambert@openbsd.org>
@@ -18,30 +18,25 @@
#include <sys/queue.h>
#include <sys/socket.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/uio.h>
+#include <sys/tree.h>
#include <sys/wait.h>
-#include <net/if.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
#include <ber.h>
#include <errno.h>
-#include <event.h>
-#include <fcntl.h>
#include <imsg.h>
#include <netdb.h>
+#include <pwd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <strings.h>
#include <syslog.h>
#include <unistd.h>
-#include <pwd.h>
+#include "log.h"
+#include "smi.h"
+#include "snmp.h"
#include "snmpd.h"
-#include "mib.h"
int traphandler_priv_recvmsg(struct privsep_proc *, struct imsg *);
int traphandler_fork_handler(struct privsep_proc *, struct imsg *);
diff --git a/usr.sbin/snmpd/usm.c b/usr.sbin/snmpd/usm.c
index 1e37dcb8c0a..21538825470 100644
--- a/usr.sbin/snmpd/usm.c
+++ b/usr.sbin/snmpd/usm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: usm.c,v 1.28 2023/11/08 20:09:18 martijn Exp $ */
+/* $OpenBSD: usm.c,v 1.29 2023/12/21 12:43:31 martijn Exp $ */
/*
* Copyright (c) 2012 GeNUA mbH
@@ -18,30 +18,24 @@
#include <sys/queue.h>
#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/socket.h>
-#include <sys/un.h>
-#include <sys/tree.h>
-#include <net/if.h>
+#include <openssl/evp.h>
+#include <openssl/hmac.h>
-#include <errno.h>
-#include <event.h>
-#include <fcntl.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <signal.h>
#ifdef DEBUG
#include <assert.h>
#endif
-
-#include <openssl/evp.h>
-#include <openssl/hmac.h>
+#include <ber.h>
+#include <endian.h>
+#include <stdlib.h>
+#include <string.h>
+#include <strings.h>
#include "application.h"
-#include "snmpd.h"
+#include "log.h"
#include "mib.h"
+#include "snmp.h"
+#include "snmpd.h"
SLIST_HEAD(, usmuser) usmuserlist;
diff --git a/usr.sbin/snmpd/util.c b/usr.sbin/snmpd/util.c
index d4b970908e5..46f2dda4cb2 100644
--- a/usr.sbin/snmpd/util.c
+++ b/usr.sbin/snmpd/util.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: util.c,v 1.13 2022/10/06 14:41:08 martijn Exp $ */
+/* $OpenBSD: util.c,v 1.14 2023/12/21 12:43:31 martijn Exp $ */
/*
* Copyright (c) 2014 Bret Stephen Lambert <blambert@openbsd.org>
*
@@ -15,21 +15,17 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/types.h>
-#include <sys/queue.h>
#include <sys/socket.h>
-#include <net/if.h>
+#include <netinet/in.h>
-#include <ber.h>
#include <ctype.h>
-#include <stdio.h>
#include <stdlib.h>
+#include <stdint.h>
#include <string.h>
+#include <strings.h>
#include <netdb.h>
-#include <event.h>
-#include "snmp.h"
#include "snmpd.h"
ssize_t