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  * 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  * @section Description
28  *
29  * The SNMP-COMMUNITY-MIB describes managed objects for mapping between
30  * community strings and version-independent SNMP message parameters. Refer
31  * to RFC 3584 for more details
32  *
33  * @author Oryx Embedded SARL (www.oryx-embedded.com)
34  * @version 2.4.0
35  **/
36 
37 //Switch to the appropriate trace level
38 #define TRACE_LEVEL SNMP_TRACE_LEVEL
39 
40 //Dependencies
41 #include "core/net.h"
42 #include "mibs/mib_common.h"
45 #include "core/crypto.h"
46 #include "encoding/asn1.h"
47 #include "encoding/oid.h"
48 #include "debug.h"
49 
50 //Check TCP/IP stack configuration
51 #if (SNMP_COMMUNITY_MIB_SUPPORT == ENABLED)
52 
53 
54 /**
55  * @brief SNMP COMMUNITY MIB base
56  **/
57 
59 
60 
61 /**
62  * @brief SNMP COMMUNITY MIB objects
63  **/
64 
66 {
67  //snmpCommunityName object (1.3.6.1.6.3.18.1.1.1.2)
68  {
69  "snmpCommunityName",
70  {43, 6, 1, 6, 3, 18, 1, 1, 1, 2},
71  10,
75  NULL,
76  NULL,
77  0,
81  },
82  //snmpCommunitySecurityName object (1.3.6.1.6.3.18.1.1.1.3)
83  {
84  "snmpCommunitySecurityName",
85  {43, 6, 1, 6, 3, 18, 1, 1, 1, 3},
86  10,
90  NULL,
91  NULL,
92  0,
96  },
97  //snmpCommunityContextEngineID object (1.3.6.1.6.3.18.1.1.1.4)
98  {
99  "snmpCommunityContextEngineID",
100  {43, 6, 1, 6, 3, 18, 1, 1, 1, 4},
101  10,
105  NULL,
106  NULL,
107  0,
111  },
112  //snmpCommunityContextName object (1.3.6.1.6.3.18.1.1.1.5)
113  {
114  "snmpCommunityContextName",
115  {43, 6, 1, 6, 3, 18, 1, 1, 1, 5},
116  10,
120  NULL,
121  NULL,
122  0,
126  },
127  //snmpCommunityTransportTag object (1.3.6.1.6.3.18.1.1.1.6)
128  {
129  "snmpCommunityTransportTag",
130  {43, 6, 1, 6, 3, 18, 1, 1, 1, 6},
131  10,
135  NULL,
136  NULL,
137  0,
141  },
142  //snmpCommunityStorageType object (1.3.6.1.6.3.18.1.1.1.7)
143  {
144  "snmpCommunityStorageType",
145  {43, 6, 1, 6, 3, 18, 1, 1, 1, 7},
146  10,
150  NULL,
151  NULL,
152  sizeof(int32_t),
156  },
157  //snmpCommunityStatus object (1.3.6.1.6.3.18.1.1.1.8)
158  {
159  "snmpCommunityStatus",
160  {43, 6, 1, 6, 3, 18, 1, 1, 1, 8},
161  10,
165  NULL,
166  NULL,
167  sizeof(int32_t),
171  },
172 };
173 
174 
175 /**
176  * @brief SNMP COMMUNITY MIB module
177  **/
178 
180 {
181  "SNMP-COMMUNITY-MIB",
182  {43, 6, 1, 6, 3, 18},
183  6,
191 };
192 
193 #endif
ASN.1 (Abstract Syntax Notation One)
@ ASN1_TYPE_OCTET_STRING
Definition: asn1.h:72
@ ASN1_TYPE_INTEGER
Definition: asn1.h:70
#define ASN1_CLASS_UNIVERSAL
Definition: asn1.h:52
General definitions for cryptographic algorithms.
Debugging facilities.
Common definitions for MIB modules.
#define MibObject
Definition: mib_common.h:46
@ MIB_ACCESS_READ_CREATE
Definition: mib_common.h:81
TCP/IP stack core.
OID (Object Identifier)
#define arraysize(a)
Definition: os_port.h:71
error_t snmpCommunityMibInit(void)
SNMP COMMUNITY MIB module initialization.
void snmpCommunityMibUnload(void *context)
Unload SNMP COMMUNITY MIB module.
error_t snmpCommunityMibGetNextCommunityEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, uint8_t *nextOid, size_t *nextOidLen)
Get next snmpCommunityEntry object.
void snmpCommunityMibUnlock(void)
Unlock SNMP COMMUNITY MIB base.
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.
error_t snmpCommunityMibLoad(void *context)
Load SNMP COMMUNITY MIB module.
error_t snmpCommunityMibGetCommunityEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, MibVariant *value, size_t *valueLen)
Get snmpCommunityEntry object value.
void snmpCommunityMibLock(void)
Lock SNMP COMMUNITY MIB base.
SNMP COMMUNITY MIB module implementation.
SnmpCommunityMibBase snmpCommunityMibBase
SNMP COMMUNITY MIB base.
const MibModule snmpCommunityMibModule
SNMP COMMUNITY MIB module.
const MibObject snmpCommunityMibObjects[]
SNMP COMMUNITY MIB objects.
SNMP COMMUNITY MIB module.
MIB module.
Definition: mib_common.h:292
SNMP COMMUNITY MIB base.