snmp_community_mib_module.c
Go to the documentation of this file.
1 /**
2  * @file snmp_community_mib_module.c
3  * @brief SNMP COMMUNITY MIB module
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  * @section Description
26  *
27  * The SNMP-COMMUNITY-MIB describes managed objects for mapping between
28  * community strings and version-independent SNMP message parameters. Refer
29  * to RFC 3584 for more details
30  *
31  * @author Oryx Embedded SARL (www.oryx-embedded.com)
32  * @version 1.9.0
33  **/
34 
35 //Switch to the appropriate trace level
36 #define TRACE_LEVEL SNMP_TRACE_LEVEL
37 
38 //Dependencies
39 #include "core/net.h"
40 #include "mibs/mib_common.h"
43 #include "core/crypto.h"
44 #include "encoding/asn1.h"
45 #include "encoding/oid.h"
46 #include "debug.h"
47 
48 //Check TCP/IP stack configuration
49 #if (SNMP_COMMUNITY_MIB_SUPPORT == ENABLED)
50 
51 
52 /**
53  * @brief SNMP COMMUNITY MIB base
54  **/
55 
57 
58 
59 /**
60  * @brief SNMP COMMUNITY MIB objects
61  **/
62 
64 {
65  //snmpCommunityName object (1.3.6.1.6.3.18.1.1.1.2)
66  {
67  "snmpCommunityName",
68  {43, 6, 1, 6, 3, 18, 1, 1, 1, 2},
69  10,
73  NULL,
74  NULL,
75  0,
79  },
80  //snmpCommunitySecurityName object (1.3.6.1.6.3.18.1.1.1.3)
81  {
82  "snmpCommunitySecurityName",
83  {43, 6, 1, 6, 3, 18, 1, 1, 1, 3},
84  10,
88  NULL,
89  NULL,
90  0,
94  },
95  //snmpCommunityContextEngineID object (1.3.6.1.6.3.18.1.1.1.4)
96  {
97  "snmpCommunityContextEngineID",
98  {43, 6, 1, 6, 3, 18, 1, 1, 1, 4},
99  10,
103  NULL,
104  NULL,
105  0,
109  },
110  //snmpCommunityContextName object (1.3.6.1.6.3.18.1.1.1.5)
111  {
112  "snmpCommunityContextName",
113  {43, 6, 1, 6, 3, 18, 1, 1, 1, 5},
114  10,
118  NULL,
119  NULL,
120  0,
124  },
125  //snmpCommunityTransportTag object (1.3.6.1.6.3.18.1.1.1.6)
126  {
127  "snmpCommunityTransportTag",
128  {43, 6, 1, 6, 3, 18, 1, 1, 1, 6},
129  10,
133  NULL,
134  NULL,
135  0,
139  },
140  //snmpCommunityStorageType object (1.3.6.1.6.3.18.1.1.1.7)
141  {
142  "snmpCommunityStorageType",
143  {43, 6, 1, 6, 3, 18, 1, 1, 1, 7},
144  10,
148  NULL,
149  NULL,
150  sizeof(int32_t),
154  },
155  //snmpCommunityStatus object (1.3.6.1.6.3.18.1.1.1.8)
156  {
157  "snmpCommunityStatus",
158  {43, 6, 1, 6, 3, 18, 1, 1, 1, 8},
159  10,
163  NULL,
164  NULL,
165  sizeof(int32_t),
169  },
170 };
171 
172 
173 /**
174  * @brief SNMP COMMUNITY MIB module
175  **/
176 
178 {
179  "SNMP-COMMUNITY-MIB",
180  {43, 6, 1, 6, 3, 18},
181  6,
189 };
190 
191 #endif
TCP/IP stack core.
Debugging facilities.
#define MibObject
Definition: mib_common.h:44
General definitions for cryptographic algorithms.
error_t snmpCommunityMibLoad(void *context)
Load SNMP COMMUNITY MIB module.
const MibModule snmpCommunityMibModule
SNMP COMMUNITY MIB module.
OID (Object Identifier)
#define arraysize(a)
Definition: os_port.h:68
error_t snmpCommunityMibSetCommunityEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, const MibVariant *value, size_t valueLen, bool_t commit)
Set snmpCommunityEntry object value.
SNMP COMMUNITY MIB base.
ASN.1 (Abstract Syntax Notation One)
error_t snmpCommunityMibGetCommunityEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, MibVariant *value, size_t *valueLen)
Get snmpCommunityEntry object value.
SNMP COMMUNITY MIB module.
SNMP COMMUNITY MIB module implementation.
const MibObject snmpCommunityMibObjects[]
SNMP COMMUNITY MIB objects.
void snmpCommunityMibLock(void)
Lock SNMP COMMUNITY MIB base.
error_t snmpCommunityMibGetNextCommunityEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, uint8_t *nextOid, size_t *nextOidLen)
Get next snmpCommunityEntry object.
Common definitions for MIB modules.
void snmpCommunityMibUnlock(void)
Unlock SNMP COMMUNITY MIB base.
#define ASN1_CLASS_UNIVERSAL
Definition: asn1.h:45
MIB module.
Definition: mib_common.h:285
SnmpCommunityMibBase snmpCommunityMibBase
SNMP COMMUNITY MIB base.
void snmpCommunityMibUnload(void *context)
Unload SNMP COMMUNITY MIB module.
error_t snmpCommunityMibInit(void)
SNMP COMMUNITY MIB module initialization.