From: martijn Date: Thu, 21 Dec 2023 12:43:30 +0000 (+0000) Subject: Clean up snmpd's header situation. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=a9292d2a63fa67dc6b2075a718b776ad5d932d51;p=openbsd Clean up snmpd's header situation. With the help of tb@ and include-what-you-use. OK tb@ --- 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 @@ -17,7 +17,9 @@ */ #include +#include #include +#include #include #include 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 * @@ -18,15 +18,16 @@ #include #include #include -#include -#include +#include #include +#include #include #include #include -#include +#include #include +#include #include #include 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 @@ -16,10 +16,16 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include +#include + +#include + +#include +#include #include #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 @@ -17,17 +17,21 @@ */ #include +#include +#include + +#include #include -#include +#include #include #include -#include #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 * @@ -26,7 +26,6 @@ #include #include #include -#include #include #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 * @@ -15,6 +15,9 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include + +#include #include #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 @@ -16,6 +16,8 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include + #include #include #include 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 @@ -23,40 +23,41 @@ */ %{ -#include -#include #include #include -#include +#include +#include +#include +#include #include -#include -#include - #include +#include + #include +#include #include -#include #include #include -#include #include #include #include -#include -#include -#include -#include #include #include -#include +#include +#include +#include +#include #include +#include #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 @@ -17,14 +17,13 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include -#include #include #include #include #include #include +#include #include #include #include @@ -34,6 +33,7 @@ #include #include +#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 @@ -16,37 +16,26 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include -#include -#include -#include -#include #include -#include - -#include -#include -#include -#include -#include -#include -#include +#include +#include + #include -#include -#include +#include #include -#include -#include -#include -#include #include -#include +#include +#include +#include +#include #include -#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 @@ -16,8 +16,10 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include -#include +#include + +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 @@ -20,7 +20,6 @@ #define SNMPD_SNMP_H #include -#include /* * 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 @@ -17,29 +17,20 @@ */ #include -#include -#include #include -#include - -#include #include -#include -#include -#include -#include #include #include -#include +#include #include +#include +#include #include #include -#include -#include +#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 @@ -20,24 +20,22 @@ #ifndef SNMPD_H #define SNMPD_H +#include +#include +#include #include +#include #include -#include -#include #include -#include -#include -#include -#include -#include #include -#include +#include +#include #include +#include +#include -#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 @@ -18,27 +18,27 @@ */ #include -#include -#include #include -#include +#include #include +#include -#include #include -#include -#include -#include -#include +#include #include +#include #include +#include #include +#include +#include #include +#include #include -#include #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 @@ -16,9 +16,12 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include + #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 @@ -17,27 +17,18 @@ */ #include -#include -#include #include -#include -#include - -#include -#include -#include +#include +#include #include -#include -#include -#include -#include #include -#include -#include -#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 @@ -18,30 +18,25 @@ #include #include -#include -#include -#include +#include #include -#include -#include -#include - #include #include -#include -#include #include #include +#include #include #include #include +#include #include #include -#include +#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 #include -#include -#include -#include -#include -#include +#include +#include -#include -#include -#include -#include -#include -#include -#include #ifdef DEBUG #include #endif - -#include -#include +#include +#include +#include +#include +#include #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 * @@ -15,21 +15,17 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include -#include #include -#include +#include -#include #include -#include #include +#include #include +#include #include -#include -#include "snmp.h" #include "snmpd.h" ssize_t