snmp_vacm_mib_module.c
Go to the documentation of this file.
1 /**
2  * @file snmp_vacm_mib_module.c
3  * @brief SNMP VACM 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-VACM-MIB describes managed objects for remotely managing the
28  * configuration parameters for the View-based Access Control Model. Refer
29  * to RFC 3415 for more
30  * details
31  *
32  * @author Oryx Embedded SARL (www.oryx-embedded.com)
33  * @version 1.9.0
34  **/
35 
36 //Switch to the appropriate trace level
37 #define TRACE_LEVEL SNMP_TRACE_LEVEL
38 
39 //Dependencies
40 #include "core/net.h"
41 #include "mibs/mib_common.h"
44 #include "core/crypto.h"
45 #include "encoding/asn1.h"
46 #include "encoding/oid.h"
47 #include "debug.h"
48 
49 //Check TCP/IP stack configuration
50 #if (SNMP_VACM_MIB_SUPPORT == ENABLED)
51 
52 
53 /**
54  * @brief SNMP VACM MIB base
55  **/
56 
58 
59 
60 /**
61  * @brief SNMP VACM MIB objects
62  **/
63 
65 {
66  //vacmContextName object (1.3.6.1.6.3.16.1.1.1.1)
67  {
68  "vacmContextName",
69  {43, 6, 1, 6, 3, 16, 1, 1, 1, 1},
70  10,
74  NULL,
75  NULL,
76  0,
77  NULL,
80  },
81  //vacmGroupName object (1.3.6.1.6.3.16.1.2.1.3)
82  {
83  "vacmGroupName",
84  {43, 6, 1, 6, 3, 16, 1, 2, 1, 3},
85  10,
89  NULL,
90  NULL,
91  0,
95  },
96  //vacmSecurityToGroupStorageType object (1.3.6.1.6.3.16.1.2.1.4)
97  {
98  "vacmSecurityToGroupStorageType",
99  {43, 6, 1, 6, 3, 16, 1, 2, 1, 4},
100  10,
104  NULL,
105  NULL,
106  sizeof(int32_t),
110  },
111  //vacmSecurityToGroupStatus object (1.3.6.1.6.3.16.1.2.1.5)
112  {
113  "vacmSecurityToGroupStatus",
114  {43, 6, 1, 6, 3, 16, 1, 2, 1, 5},
115  10,
119  NULL,
120  NULL,
121  sizeof(int32_t),
125  },
126  //vacmAccessContextMatch object (1.3.6.1.6.3.16.1.4.1.4)
127  {
128  "vacmAccessContextMatch",
129  {43, 6, 1, 6, 3, 16, 1, 4, 1, 4},
130  10,
134  NULL,
135  NULL,
136  sizeof(int32_t),
140  },
141  //vacmAccessReadViewName object (1.3.6.1.6.3.16.1.4.1.5)
142  {
143  "vacmAccessReadViewName",
144  {43, 6, 1, 6, 3, 16, 1, 4, 1, 5},
145  10,
149  NULL,
150  NULL,
151  0,
155  },
156  //vacmAccessWriteViewName object (1.3.6.1.6.3.16.1.4.1.6)
157  {
158  "vacmAccessWriteViewName",
159  {43, 6, 1, 6, 3, 16, 1, 4, 1, 6},
160  10,
164  NULL,
165  NULL,
166  0,
170  },
171  //vacmAccessNotifyViewName object (1.3.6.1.6.3.16.1.4.1.7)
172  {
173  "vacmAccessNotifyViewName",
174  {43, 6, 1, 6, 3, 16, 1, 4, 1, 7},
175  10,
179  NULL,
180  NULL,
181  0,
185  },
186  //vacmAccessStorageType object (1.3.6.1.6.3.16.1.4.1.8)
187  {
188  "vacmAccessStorageType",
189  {43, 6, 1, 6, 3, 16, 1, 4, 1, 8},
190  10,
194  NULL,
195  NULL,
196  sizeof(int32_t),
200  },
201  //vacmAccessStatus object (1.3.6.1.6.3.16.1.4.1.9)
202  {
203  "vacmAccessStatus",
204  {43, 6, 1, 6, 3, 16, 1, 4, 1, 9},
205  10,
209  NULL,
210  NULL,
211  sizeof(int32_t),
215  },
216  //vacmViewSpinLock object (1.3.6.1.6.3.16.1.5.1)
217  {
218  "vacmViewSpinLock",
219  {43, 6, 1, 6, 3, 16, 1, 5, 1},
220  9,
224  NULL,
225  NULL,
226  sizeof(int32_t),
229  NULL
230  },
231  //vacmViewTreeFamilyMask object (1.3.6.1.6.3.16.1.5.2.1.3)
232  {
233  "vacmViewTreeFamilyMask",
234  {43, 6, 1, 6, 3, 16, 1, 5, 2, 1, 3},
235  11,
239  NULL,
240  NULL,
241  0,
245  },
246  //vacmViewTreeFamilyType object (1.3.6.1.6.3.16.1.5.2.1.4)
247  {
248  "vacmViewTreeFamilyType",
249  {43, 6, 1, 6, 3, 16, 1, 5, 2, 1, 4},
250  11,
254  NULL,
255  NULL,
256  sizeof(int32_t),
260  },
261  //vacmViewTreeFamilyStorageType object (1.3.6.1.6.3.16.1.5.2.1.5)
262  {
263  "vacmViewTreeFamilyStorageType",
264  {43, 6, 1, 6, 3, 16, 1, 5, 2, 1, 5},
265  11,
269  NULL,
270  NULL,
271  sizeof(int32_t),
275  },
276  //vacmViewTreeFamilyStatus object (1.3.6.1.6.3.16.1.5.2.1.6)
277  {
278  "vacmViewTreeFamilyStatus",
279  {43, 6, 1, 6, 3, 16, 1, 5, 2, 1, 6},
280  11,
284  NULL,
285  NULL,
286  sizeof(int32_t),
290  }
291 };
292 
293 
294 /**
295  * @brief SNMP VACM MIB module
296  **/
297 
299 {
300  "SNMP-VACM-MIB",
301  {43, 6, 1, 6, 3, 16},
302  6,
310 };
311 
312 #endif
error_t snmpVacmMibGetAccessEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, MibVariant *value, size_t *valueLen)
Get vacmAccessEntry object value.
SNMP VACM MIB module implementation.
const MibModule snmpVacmMibModule
SNMP VACM MIB module.
error_t snmpVacmMibGetNextAccessEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, uint8_t *nextOid, size_t *nextOidLen)
Get next vacmAccessEntry object.
error_t snmpVacmMibSetViewSpinLock(const MibObject *object, const uint8_t *oid, size_t oidLen, const MibVariant *value, size_t valueLen, bool_t commit)
Set vacmViewSpinLock object value.
error_t snmpVacmMibGetViewSpinLock(const MibObject *object, const uint8_t *oid, size_t oidLen, MibVariant *value, size_t *valueLen)
Get vacmViewSpinLock object value.
error_t snmpVacmMibGetNextViewTreeFamilyEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, uint8_t *nextOid, size_t *nextOidLen)
Get next vacmViewTreeFamilyEntry object.
TCP/IP stack core.
Debugging facilities.
#define MibObject
Definition: mib_common.h:44
General definitions for cryptographic algorithms.
error_t snmpVacmMibSetAccessEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, const MibVariant *value, size_t valueLen, bool_t commit)
Set vacmAccessEntry object value.
error_t snmpVacmMibGetViewTreeFamilyEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, MibVariant *value, size_t *valueLen)
Get vacmViewTreeFamilyEntry object value.
error_t snmpVacmMibSetViewTreeFamilyEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, const MibVariant *value, size_t valueLen, bool_t commit)
Set vacmViewTreeFamilyEntry object value.
SnmpVacmMibBase snmpVacmMibBase
SNMP VACM MIB base.
SNMP VACM MIB base.
OID (Object Identifier)
SNMP VACM MIB module.
#define arraysize(a)
Definition: os_port.h:68
void snmpVacmMibUnload(void *context)
Unload SNMP VACM MIB module.
ASN.1 (Abstract Syntax Notation One)
error_t snmpVacmMibGetNextContextEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, uint8_t *nextOid, size_t *nextOidLen)
Get next vacmContextEntry object.
void snmpVacmMibLock(void)
Lock SNMP VACM MIB base.
error_t snmpVacmMibLoad(void *context)
Load SNMP VACM MIB module.
error_t snmpVacmMibGetSecurityToGroupEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, MibVariant *value, size_t *valueLen)
Get vacmSecurityToGroupEntry object value.
error_t snmpVacmMibInit(void)
SNMP VACM MIB module initialization.
error_t snmpVacmMibSetSecurityToGroupEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, const MibVariant *value, size_t valueLen, bool_t commit)
Set vacmSecurityToGroupEntry object value.
error_t snmpVacmMibGetContextEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, MibVariant *value, size_t *valueLen)
Get vacmContextEntry object value.
Common definitions for MIB modules.
#define ASN1_CLASS_UNIVERSAL
Definition: asn1.h:45
MIB module.
Definition: mib_common.h:285
void snmpVacmMibUnlock(void)
Unlock SNMP VACM MIB base.
const MibObject snmpVacmMibObjects[]
SNMP VACM MIB objects.
error_t snmpVacmMibGetNextSecurityToGroupEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, uint8_t *nextOid, size_t *nextOidLen)
Get next vacmSecurityToGroupEntry object.