summaryrefslogtreecommitdiff
path: root/usr.sbin/snmpd/snmpd.h
diff options
context:
space:
mode:
authorMartijn van Duren <martijn@cvs.openbsd.org>2020-09-06 15:51:29 +0000
committerMartijn van Duren <martijn@cvs.openbsd.org>2020-09-06 15:51:29 +0000
commit800ad640f1dffde8728ff1758c3941557044b2ea (patch)
tree032009003fe8db4445d023523c8a3f2df1bd32c1 /usr.sbin/snmpd/snmpd.h
parentdc90664c9b6887ef734c06ef3ffb8695a77b50df (diff)
Split "trap receiver" into its own trap_address struct and clean up the
code surrounding this struct and struct address. No functional change intended, except that trap receiver's source-address may now be a resolvable hostname. Tweaks and OK jan@
Diffstat (limited to 'usr.sbin/snmpd/snmpd.h')
-rw-r--r--usr.sbin/snmpd/snmpd.h23
1 files changed, 14 insertions, 9 deletions
diff --git a/usr.sbin/snmpd/snmpd.h b/usr.sbin/snmpd/snmpd.h
index 1782f0fc9af..7d7212e9ffc 100644
--- a/usr.sbin/snmpd/snmpd.h
+++ b/usr.sbin/snmpd/snmpd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: snmpd.h,v 1.89 2020/08/23 07:39:57 martijn Exp $ */
+/* $OpenBSD: snmpd.h,v 1.90 2020/09/06 15:51:28 martijn Exp $ */
/*
* Copyright (c) 2007, 2008, 2012 Reyk Floeter <reyk@openbsd.org>
@@ -48,8 +48,8 @@
#define CONF_FILE "/etc/snmpd.conf"
#define SNMPD_SOCKET "/var/run/snmpd.sock"
#define SNMPD_USER "_snmpd"
-#define SNMPD_PORT 161
-#define SNMPD_TRAPPORT 162
+#define SNMPD_PORT "161"
+#define SNMPD_TRAPPORT "162"
#define SNMPD_MAXSTRLEN 484
#define SNMPD_MAXCOMMUNITYLEN SNMPD_MAXSTRLEN
@@ -481,19 +481,24 @@ struct snmp_stats {
struct address {
struct sockaddr_storage ss;
in_port_t port;
- int ipproto;
+ int type;
int fd;
struct event ev;
struct event evt;
TAILQ_ENTRY(address) entry;
+};
+TAILQ_HEAD(addresslist, address);
- /* For SNMP trap receivers etc. */
+struct trap_address {
+ struct sockaddr_storage ss;
+ struct sockaddr_storage ss_local;
char *sa_community;
struct ber_oid *sa_oid;
- struct address *sa_srcaddr;
+
+ TAILQ_ENTRY(trap_address) entry;
};
-TAILQ_HEAD(addresslist, address);
+TAILQ_HEAD(trap_addresslist, trap_address);
enum usmauth {
AUTH_NONE = 0,
@@ -551,7 +556,7 @@ struct snmpd {
struct snmp_stats sc_stats;
- struct addresslist sc_trapreceivers;
+ struct trap_addresslist sc_trapreceivers;
int sc_ncpu;
int64_t *sc_cpustates;
@@ -706,7 +711,7 @@ char *smi_print_element(struct ber_element *);
void timer_init(void);
/* snmpd.c */
-int snmpd_socket_af(struct sockaddr_storage *, in_port_t, int);
+int snmpd_socket_af(struct sockaddr_storage *, int);
u_long snmpd_engine_time(void);
char *tohexstr(u_int8_t *, int);