snmp_agent_inform.h
Go to the documentation of this file.
1 /**
2  * @file snmp_agent_inform.h
3  * @brief SNMP inform notifications
4  *
5  * @section License
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  *
9  * Copyright (C) 2010-2024 Oryx Embedded SARL. All rights reserved.
10  *
11  * This file is part of CycloneTCP Open.
12  *
13  * This program is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public License
15  * as published by the Free Software Foundation; either version 2
16  * of the License, or (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software Foundation,
25  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26  *
27  * @author Oryx Embedded SARL (www.oryx-embedded.com)
28  * @version 2.4.4
29  **/
30 
31 #ifndef _SNMP_AGENT_INFORM_H
32 #define _SNMP_AGENT_INFORM_H
33 
34 //Dependencies
35 #include "core/net.h"
36 #include "snmp/snmp_agent.h"
37 
38 //Inform notification support
39 #ifndef SNMP_AGENT_INFORM_SUPPORT
40  #define SNMP_AGENT_INFORM_SUPPORT DISABLED
41 #elif (SNMP_AGENT_INFORM_SUPPORT != ENABLED && SNMP_AGENT_INFORM_SUPPORT != DISABLED)
42  #error SNMP_AGENT_INFORM_SUPPORT parameter is not valid
43 #endif
44 
45 //Maximum number of retransmissions of inform requests
46 #ifndef SNMP_AGENT_INFORM_MAX_RETRIES
47  #define SNMP_AGENT_INFORM_MAX_RETRIES 5
48 #elif (SNMP_AGENT_INFORM_MAX_RETRIES < 1)
49  #error SNMP_AGENT_INFORM_MAX_RETRIES parameter is not valid
50 #endif
51 
52 //Inform request retransmission timeout
53 #ifndef SNMP_AGENT_INFORM_TIMEOUT
54  #define SNMP_AGENT_INFORM_TIMEOUT 2000
55 #elif (SNMP_AGENT_INFORM_TIMEOUT < 1000)
56  #error SNMP_AGENT_INFORM_TIMEOUT parameter is not valid
57 #endif
58 
59 //C++ guard
60 #ifdef __cplusplus
61 extern "C" {
62 #endif
63 
64 
65 /**
66  * @brief State of the inform sending process
67  **/
68 
69 typedef enum
70 {
77 
78 
79 //SNMP inform related functions
81  SnmpVersion version, const char_t *userName, uint_t genericTrapType,
82  uint_t specificTrapCode, const SnmpTrapObject *objectList,
83  uint_t objectListSize);
84 
86  SnmpVersion version, const char_t *userName, uint_t genericTrapType,
87  uint_t specificTrapCode, const SnmpTrapObject *objectList,
88  uint_t objectListSize);
89 
92 
94 
97 
98 //C++ guard
99 #ifdef __cplusplus
100 }
101 #endif
102 
103 #endif
error_t snmpFormatGetRequestMessage(SnmpAgentContext *context, SnmpVersion version)
Format SNMP GetRequest message.
Object descriptor for trap notifications.
@ SNMP_AGENT_STATE_WAITING_REPORT
uint8_t version
Definition: coap_common.h:177
error_t snmpFormatInformRequestPdu(SnmpAgentContext *context, SnmpVersion version, const char_t *userName, uint_t genericTrapType, uint_t specificTrapCode, const SnmpTrapObject *objectList, uint_t objectListSize)
Format InformRequest-PDU.
SNMP agent (Simple Network Management Protocol)
error_t snmpFormatGetRequestPdu(SnmpAgentContext *context, SnmpVersion version)
Format GetRequest-PDU (engine ID discovery procedure)
SnmpVersion
SNMP version identifiers.
Definition: snmp_common.h:137
@ SNMP_AGENT_STATE_SENDING_INFORM_REQ
error_t
Error codes.
Definition: error.h:43
@ SNMP_AGENT_STATE_WAITING_GET_RESP
SnmpAgentState
State of the inform sending process.
@ SNMP_AGENT_STATE_IDLE
error_t snmpProcessReportPdu(SnmpAgentContext *context)
Process Report-PDU.
char char_t
Definition: compiler_port.h:48
@ SNMP_AGENT_STATE_SENDING_GET_REQ
#define SnmpAgentContext
Definition: snmp_agent.h:36
error_t snmpFormatInformRequestMessage(SnmpAgentContext *context, SnmpVersion version, const char_t *userName, uint_t genericTrapType, uint_t specificTrapCode, const SnmpTrapObject *objectList, uint_t objectListSize)
Format SNMP InformRequest message.
error_t snmpProcessGetResponsePdu(SnmpAgentContext *context)
Process GetResponse-PDU.
unsigned int uint_t
Definition: compiler_port.h:50
TCP/IP stack core.