snmp_usm_mib_module.c
Go to the documentation of this file.
1 /**
2  * @file snmp_usm_mib_module.c
3  * @brief SNMP USM 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-USM-MIB describes managed objects for remotely monitoring and
28  * managing the configuration parameters for the User-Based Security Model.
29  * Refer to RFC 3414 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"
42 #include "mibs/snmp_usm_mib_impl.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_USM_MIB_SUPPORT == ENABLED)
50 
51 
52 /**
53  * @brief SNMP USM MIB base
54  **/
55 
57 
58 
59 /**
60  * @brief SNMP USM MIB objects
61  **/
62 
64 {
65  //usmStatsUnsupportedSecLevels object (1.3.6.1.6.3.15.1.1.1)
66  {
67  "usmStatsUnsupportedSecLevels",
68  {43, 6, 1, 6, 3, 15, 1, 1, 1},
69  9,
74  NULL,
75  sizeof(uint32_t),
76  NULL,
77  NULL,
78  NULL
79  },
80  //usmStatsNotInTimeWindows object (1.3.6.1.6.3.15.1.1.2)
81  {
82  "usmStatsNotInTimeWindows",
83  {43, 6, 1, 6, 3, 15, 1, 1, 2},
84  9,
89  NULL,
90  sizeof(uint32_t),
91  NULL,
92  NULL,
93  NULL
94  },
95  //usmStatsUnknownUserNames object (1.3.6.1.6.3.15.1.1.3)
96  {
97  "usmStatsUnknownUserNames",
98  {43, 6, 1, 6, 3, 15, 1, 1, 3},
99  9,
104  NULL,
105  sizeof(uint32_t),
106  NULL,
107  NULL,
108  NULL
109  },
110  //usmStatsUnknownEngineIDs object (1.3.6.1.6.3.15.1.1.4)
111  {
112  "usmStatsUnknownEngineIDs",
113  {43, 6, 1, 6, 3, 15, 1, 1, 4},
114  9,
119  NULL,
120  sizeof(uint32_t),
121  NULL,
122  NULL,
123  NULL
124  },
125  //usmStatsWrongDigests object (1.3.6.1.6.3.15.1.1.5)
126  {
127  "usmStatsWrongDigests",
128  {43, 6, 1, 6, 3, 15, 1, 1, 5},
129  9,
134  NULL,
135  sizeof(uint32_t),
136  NULL,
137  NULL,
138  NULL
139  },
140  //usmStatsDecryptionErrors object (1.3.6.1.6.3.15.1.1.6)
141  {
142  "usmStatsDecryptionErrors",
143  {43, 6, 1, 6, 3, 15, 1, 1, 6},
144  9,
149  NULL,
150  sizeof(uint32_t),
151  NULL,
152  NULL,
153  NULL
154  },
155  //usmUserSpinLock object (1.3.6.1.6.3.15.1.2.1)
156  {
157  "usmUserSpinLock",
158  {43, 6, 1, 6, 3, 15, 1, 2, 1},
159  9,
163  NULL,
164  NULL,
165  sizeof(int32_t),
168  NULL
169  },
170  //usmUserSecurityName object (1.3.6.1.6.3.15.1.2.2.1.3)
171  {
172  "usmUserSecurityName",
173  {43, 6, 1, 6, 3, 15, 1, 2, 2, 1, 3},
174  11,
178  NULL,
179  NULL,
180  0,
181  NULL,
184  },
185  //usmUserCloneFrom object (1.3.6.1.6.3.15.1.2.2.1.4)
186  {
187  "usmUserCloneFrom",
188  {43, 6, 1, 6, 3, 15, 1, 2, 2, 1, 4},
189  11,
193  NULL,
194  NULL,
195  0,
199  },
200  //usmUserAuthProtocol object (1.3.6.1.6.3.15.1.2.2.1.5)
201  {
202  "usmUserAuthProtocol",
203  {43, 6, 1, 6, 3, 15, 1, 2, 2, 1, 5},
204  11,
208  NULL,
209  NULL,
210  0,
214  },
215  //usmUserAuthKeyChange object (1.3.6.1.6.3.15.1.2.2.1.6)
216  {
217  "usmUserAuthKeyChange",
218  {43, 6, 1, 6, 3, 15, 1, 2, 2, 1, 6},
219  11,
223  NULL,
224  NULL,
225  0,
229  },
230  //usmUserOwnAuthKeyChange object (1.3.6.1.6.3.15.1.2.2.1.7)
231  {
232  "usmUserOwnAuthKeyChange",
233  {43, 6, 1, 6, 3, 15, 1, 2, 2, 1, 7},
234  11,
238  NULL,
239  NULL,
240  0,
244  },
245  //usmUserPrivProtocol object (1.3.6.1.6.3.15.1.2.2.1.8)
246  {
247  "usmUserPrivProtocol",
248  {43, 6, 1, 6, 3, 15, 1, 2, 2, 1, 8},
249  11,
253  NULL,
254  NULL,
255  0,
259  },
260  //usmUserPrivKeyChange object (1.3.6.1.6.3.15.1.2.2.1.9)
261  {
262  "usmUserPrivKeyChange",
263  {43, 6, 1, 6, 3, 15, 1, 2, 2, 1, 9},
264  11,
268  NULL,
269  NULL,
270  0,
274  },
275  //usmUserOwnPrivKeyChange object (1.3.6.1.6.3.15.1.2.2.1.10)
276  {
277  "usmUserOwnPrivKeyChange",
278  {43, 6, 1, 6, 3, 15, 1, 2, 2, 1, 10},
279  11,
283  NULL,
284  NULL,
285  0,
289  },
290  //usmUserPublic object (1.3.6.1.6.3.15.1.2.2.1.11)
291  {
292  "usmUserPublic",
293  {43, 6, 1, 6, 3, 15, 1, 2, 2, 1, 11},
294  11,
298  NULL,
299  NULL,
300  0,
304  },
305  //usmUserStorageType object (1.3.6.1.6.3.15.1.2.2.1.12)
306  {
307  "usmUserStorageType",
308  {43, 6, 1, 6, 3, 15, 1, 2, 2, 1, 12},
309  11,
313  NULL,
314  NULL,
315  sizeof(int32_t),
319  },
320  //usmUserStatus object (1.3.6.1.6.3.15.1.2.2.1.13)
321  {
322  "usmUserStatus",
323  {43, 6, 1, 6, 3, 15, 1, 2, 2, 1, 13},
324  11,
328  NULL,
329  NULL,
330  sizeof(int32_t),
334  }
335 };
336 
337 
338 /**
339  * @brief SNMP USM MIB module
340  **/
341 
343 {
344  "SNMP-USM-MIB",
345  {43, 6, 1, 6, 3, 15},
346  6,
354 };
355 
356 #endif
SNMP USM MIB module implementation.
const MibObject snmpUsmMibObjects[]
SNMP USM MIB objects.
uint32_t usmStatsNotInTimeWindows
SnmpUsmMibBase snmpUsmMibBase
SNMP USM MIB base.
TCP/IP stack core.
Debugging facilities.
#define MibObject
Definition: mib_common.h:44
General definitions for cryptographic algorithms.
void snmpUsmMibUnlock(void)
Unlock SNMP USM MIB base.
uint32_t usmStatsUnsupportedSecLevels
error_t snmpUsmMibInit(void)
SNMP USM MIB module initialization.
uint32_t usmStatsUnknownUserNames
OID (Object Identifier)
error_t snmpUsmMibSetUserSpinLock(const MibObject *object, const uint8_t *oid, size_t oidLen, const MibVariant *value, size_t valueLen, bool_t commit)
Set usmUserSpinLock object value.
#define arraysize(a)
Definition: os_port.h:68
const MibModule snmpUsmMibModule
SNMP USM MIB module.
ASN.1 (Abstract Syntax Notation One)
#define ASN1_CLASS_APPLICATION
Definition: asn1.h:46
error_t snmpUsmMibGetUserEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, MibVariant *value, size_t *valueLen)
Get usmUserEntry object value.
void snmpUsmMibLock(void)
Lock SNMP USM MIB base.
SNMP USM MIB module.
SNMP USM MIB base.
error_t snmpUsmMibGetUserSpinLock(const MibObject *object, const uint8_t *oid, size_t oidLen, MibVariant *value, size_t *valueLen)
Get usmUserSpinLock object value.
uint32_t usmStatsDecryptionErrors
void snmpUsmMibUnload(void *context)
Unload SNMP USM MIB module.
uint32_t usmStatsWrongDigests
error_t snmpUsmMibGetNextUserEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, uint8_t *nextOid, size_t *nextOidLen)
Get next usmUserEntry object.
Common definitions for MIB modules.
error_t snmpUsmMibSetUserEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, const MibVariant *value, size_t valueLen, bool_t commit)
Set usmUserEntry object value.
#define ASN1_CLASS_UNIVERSAL
Definition: asn1.h:45
MIB module.
Definition: mib_common.h:285
error_t snmpUsmMibLoad(void *context)
Load SNMP USM MIB module.
uint32_t usmStatsUnknownEngineIDs