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