snmp_agent_trap.h
Go to the documentation of this file.
1 /**
2  * @file snmp_agent_trap.h
3  * @brief SNMP trap notifications
4  *
5  * @section License
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  *
9  * Copyright (C) 2010-2019 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 1.9.6
29  **/
30 
31 #ifndef _SNMP_AGENT_TRAP_H
32 #define _SNMP_AGENT_TRAP_H
33 
34 //Dependencies
35 #include "core/net.h"
36 #include "snmp/snmp_agent.h"
37 
38 //Trap notification support
39 #ifndef SNMP_AGENT_TRAP_SUPPORT
40  #define SNMP_AGENT_TRAP_SUPPORT ENABLED
41 #elif (SNMP_AGENT_TRAP_SUPPORT != ENABLED && SNMP_AGENT_TRAP_SUPPORT != DISABLED)
42  #error SNMP_AGENT_TRAP_SUPPORT parameter is not valid
43 #endif
44 
45 //C++ guard
46 #ifdef __cplusplus
47 extern "C" {
48 #endif
49 
50 
51 /**
52  * @brief Object descriptor for trap notifications
53  **/
54 
55 typedef struct
56 {
58  size_t oidLen;
60 
61 
62 //SNMP trap related functions
64  const char_t *userName, uint_t genericTrapType, uint_t specificTrapCode,
65  const SnmpTrapObject *objectList, uint_t objectListSize);
66 
68  const char_t *userName, uint_t genericTrapType, uint_t specificTrapCode,
69  const SnmpTrapObject *objectList, uint_t objectListSize);
70 
71 //C++ guard
72 #ifdef __cplusplus
73 }
74 #endif
75 
76 #endif
error_t snmpFormatTrapMessage(SnmpAgentContext *context, SnmpVersion version, const char_t *userName, uint_t genericTrapType, uint_t specificTrapCode, const SnmpTrapObject *objectList, uint_t objectListSize)
Format SNMP Trap message.
uint16_t version
Definition: dtls_misc.h:172
Object descriptor for trap notifications.
error_t snmpFormatTrapPdu(SnmpAgentContext *context, SnmpVersion version, const char_t *userName, uint_t genericTrapType, uint_t specificTrapCode, const SnmpTrapObject *objectList, uint_t objectListSize)
Format Trap-PDU or SNMPv2-Trap-PDU.
SNMP agent (Simple Network Management Protocol)
SnmpVersion
SNMP version identifiers.
Definition: snmp_common.h:136
error_t
Error codes.
Definition: error.h:42
#define SNMP_MAX_OID_SIZE
Definition: snmp_common.h:116
uint8_t oid[1]
Definition: mib_common.h:186
char char_t
Definition: compiler_port.h:43
#define SnmpAgentContext
Definition: snmp_agent.h:36
unsigned int uint_t
Definition: compiler_port.h:45
TCP/IP stack core.