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  * 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-VACM-MIB describes managed objects for remotely managing the
30  * configuration parameters for the View-based Access Control Model. Refer
31  * to RFC 3415 for more
32  * details
33  *
34  * @author Oryx Embedded SARL (www.oryx-embedded.com)
35  * @version 2.4.0
36  **/
37 
38 //Switch to the appropriate trace level
39 #define TRACE_LEVEL SNMP_TRACE_LEVEL
40 
41 //Dependencies
42 #include "core/net.h"
43 #include "mibs/mib_common.h"
46 #include "core/crypto.h"
47 #include "encoding/asn1.h"
48 #include "encoding/oid.h"
49 #include "debug.h"
50 
51 //Check TCP/IP stack configuration
52 #if (SNMP_VACM_MIB_SUPPORT == ENABLED)
53 
54 
55 /**
56  * @brief SNMP VACM MIB base
57  **/
58 
60 
61 
62 /**
63  * @brief SNMP VACM MIB objects
64  **/
65 
67 {
68  //vacmContextName object (1.3.6.1.6.3.16.1.1.1.1)
69  {
70  "vacmContextName",
71  {43, 6, 1, 6, 3, 16, 1, 1, 1, 1},
72  10,
76  NULL,
77  NULL,
78  0,
79  NULL,
82  },
83  //vacmGroupName object (1.3.6.1.6.3.16.1.2.1.3)
84  {
85  "vacmGroupName",
86  {43, 6, 1, 6, 3, 16, 1, 2, 1, 3},
87  10,
91  NULL,
92  NULL,
93  0,
97  },
98  //vacmSecurityToGroupStorageType object (1.3.6.1.6.3.16.1.2.1.4)
99  {
100  "vacmSecurityToGroupStorageType",
101  {43, 6, 1, 6, 3, 16, 1, 2, 1, 4},
102  10,
106  NULL,
107  NULL,
108  sizeof(int32_t),
112  },
113  //vacmSecurityToGroupStatus object (1.3.6.1.6.3.16.1.2.1.5)
114  {
115  "vacmSecurityToGroupStatus",
116  {43, 6, 1, 6, 3, 16, 1, 2, 1, 5},
117  10,
121  NULL,
122  NULL,
123  sizeof(int32_t),
127  },
128  //vacmAccessContextMatch object (1.3.6.1.6.3.16.1.4.1.4)
129  {
130  "vacmAccessContextMatch",
131  {43, 6, 1, 6, 3, 16, 1, 4, 1, 4},
132  10,
136  NULL,
137  NULL,
138  sizeof(int32_t),
142  },
143  //vacmAccessReadViewName object (1.3.6.1.6.3.16.1.4.1.5)
144  {
145  "vacmAccessReadViewName",
146  {43, 6, 1, 6, 3, 16, 1, 4, 1, 5},
147  10,
151  NULL,
152  NULL,
153  0,
157  },
158  //vacmAccessWriteViewName object (1.3.6.1.6.3.16.1.4.1.6)
159  {
160  "vacmAccessWriteViewName",
161  {43, 6, 1, 6, 3, 16, 1, 4, 1, 6},
162  10,
166  NULL,
167  NULL,
168  0,
172  },
173  //vacmAccessNotifyViewName object (1.3.6.1.6.3.16.1.4.1.7)
174  {
175  "vacmAccessNotifyViewName",
176  {43, 6, 1, 6, 3, 16, 1, 4, 1, 7},
177  10,
181  NULL,
182  NULL,
183  0,
187  },
188  //vacmAccessStorageType object (1.3.6.1.6.3.16.1.4.1.8)
189  {
190  "vacmAccessStorageType",
191  {43, 6, 1, 6, 3, 16, 1, 4, 1, 8},
192  10,
196  NULL,
197  NULL,
198  sizeof(int32_t),
202  },
203  //vacmAccessStatus object (1.3.6.1.6.3.16.1.4.1.9)
204  {
205  "vacmAccessStatus",
206  {43, 6, 1, 6, 3, 16, 1, 4, 1, 9},
207  10,
211  NULL,
212  NULL,
213  sizeof(int32_t),
217  },
218  //vacmViewSpinLock object (1.3.6.1.6.3.16.1.5.1)
219  {
220  "vacmViewSpinLock",
221  {43, 6, 1, 6, 3, 16, 1, 5, 1},
222  9,
226  NULL,
227  NULL,
228  sizeof(int32_t),
231  NULL
232  },
233  //vacmViewTreeFamilyMask object (1.3.6.1.6.3.16.1.5.2.1.3)
234  {
235  "vacmViewTreeFamilyMask",
236  {43, 6, 1, 6, 3, 16, 1, 5, 2, 1, 3},
237  11,
241  NULL,
242  NULL,
243  0,
247  },
248  //vacmViewTreeFamilyType object (1.3.6.1.6.3.16.1.5.2.1.4)
249  {
250  "vacmViewTreeFamilyType",
251  {43, 6, 1, 6, 3, 16, 1, 5, 2, 1, 4},
252  11,
256  NULL,
257  NULL,
258  sizeof(int32_t),
262  },
263  //vacmViewTreeFamilyStorageType object (1.3.6.1.6.3.16.1.5.2.1.5)
264  {
265  "vacmViewTreeFamilyStorageType",
266  {43, 6, 1, 6, 3, 16, 1, 5, 2, 1, 5},
267  11,
271  NULL,
272  NULL,
273  sizeof(int32_t),
277  },
278  //vacmViewTreeFamilyStatus object (1.3.6.1.6.3.16.1.5.2.1.6)
279  {
280  "vacmViewTreeFamilyStatus",
281  {43, 6, 1, 6, 3, 16, 1, 5, 2, 1, 6},
282  11,
286  NULL,
287  NULL,
288  sizeof(int32_t),
292  }
293 };
294 
295 
296 /**
297  * @brief SNMP VACM MIB module
298  **/
299 
301 {
302  "SNMP-VACM-MIB",
303  {43, 6, 1, 6, 3, 16},
304  6,
312 };
313 
314 #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_ONLY
Definition: mib_common.h:79
@ MIB_ACCESS_READ_CREATE
Definition: mib_common.h:81
@ MIB_ACCESS_READ_WRITE
Definition: mib_common.h:80
TCP/IP stack core.
OID (Object Identifier)
#define arraysize(a)
Definition: os_port.h:71
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.
error_t snmpVacmMibLoad(void *context)
Load SNMP VACM MIB module.
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.
void snmpVacmMibLock(void)
Lock SNMP VACM MIB base.
error_t snmpVacmMibGetSecurityToGroupEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, MibVariant *value, size_t *valueLen)
Get vacmSecurityToGroupEntry object value.
void snmpVacmMibUnlock(void)
Unlock SNMP VACM MIB base.
error_t snmpVacmMibInit(void)
SNMP VACM MIB module initialization.
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 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 snmpVacmMibGetNextSecurityToGroupEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, uint8_t *nextOid, size_t *nextOidLen)
Get next vacmSecurityToGroupEntry object.
error_t snmpVacmMibGetContextEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, MibVariant *value, size_t *valueLen)
Get vacmContextEntry object value.
error_t snmpVacmMibGetNextContextEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, uint8_t *nextOid, size_t *nextOidLen)
Get next vacmContextEntry object.
void snmpVacmMibUnload(void *context)
Unload SNMP VACM MIB module.
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 snmpVacmMibGetAccessEntry(const MibObject *object, const uint8_t *oid, size_t oidLen, MibVariant *value, size_t *valueLen)
Get vacmAccessEntry 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.
SNMP VACM MIB module implementation.
const MibObject snmpVacmMibObjects[]
SNMP VACM MIB objects.
SnmpVacmMibBase snmpVacmMibBase
SNMP VACM MIB base.
const MibModule snmpVacmMibModule
SNMP VACM MIB module.
SNMP VACM MIB module.
MIB module.
Definition: mib_common.h:292
SNMP VACM MIB base.