From 51521b16c8af298237f47bffc99c83c26ffb5982 Mon Sep 17 00:00:00 2001 From: Martijn van Duren Date: Fri, 5 Feb 2021 10:30:46 +0000 Subject: Introduce a transaction id. This is currently mostly a dummy-variable, but will later on be needed for when we reintroduce agentx master support. feedback and OK dlg@, rob@ --- usr.sbin/snmpd/snmpd.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'usr.sbin/snmpd/snmpd.h') diff --git a/usr.sbin/snmpd/snmpd.h b/usr.sbin/snmpd/snmpd.h index c490ed2fd46..40f08748d4b 100644 --- a/usr.sbin/snmpd/snmpd.h +++ b/usr.sbin/snmpd/snmpd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: snmpd.h,v 1.93 2021/01/28 20:45:14 martijn Exp $ */ +/* $OpenBSD: snmpd.h,v 1.94 2021/02/05 10:30:45 martijn Exp $ */ /* * Copyright (c) 2007, 2008, 2012 Reyk Floeter @@ -399,6 +399,8 @@ struct snmp_message { u_int8_t sm_data[READ_BUF_SIZE]; size_t sm_datalen; + uint32_t sm_transactionid; + u_int sm_version; /* V1, V2c */ @@ -436,7 +438,11 @@ struct snmp_message { struct ber_element *sm_varbind; struct ber_element *sm_varbindresp; + + RB_ENTRY(snmp_message) sm_entry; }; +RB_HEAD(snmp_messages, snmp_message); +extern struct snmp_messages snmp_messages; /* Defined in SNMPv2-MIB.txt (RFC 3418) */ struct snmp_stats { @@ -642,6 +648,8 @@ struct kif_arp *karp_getaddr(struct sockaddr *, u_short, int); void snmpe(struct privsep *, struct privsep_proc *); void snmpe_shutdown(void); void snmpe_dispatchmsg(struct snmp_message *); +int snmp_messagecmp(struct snmp_message *, struct snmp_message *); +RB_PROTOTYPE(snmp_messages, snmp_message, sm_entry, snmp_messagecmp) /* trap.c */ void trap_init(void); -- cgit v1.2.3