snmp_mib_impl.h
Go to the documentation of this file.
1 /**
2  * @file snmp_mib_impl.h
3  * @brief SNMP MIB module implementation
4  *
5  * @section License
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  *
9  * Copyright (C) 2010-2019 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  * @author Oryx Embedded SARL (www.oryx-embedded.com)
28  * @version 1.9.6
29  **/
30 
31 #ifndef _SNMP_MIB_IMPL_H
32 #define _SNMP_MIB_IMPL_H
33 
34 //Dependencies
35 #include "mibs/mib_common.h"
36 
37 //C++ guard
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 
42 //SNMP MIB related functions
43 error_t snmpMibInit(void);
44 error_t snmpMibLoad(void *context);
45 void snmpMibUnload(void *context);
46 void snmpMibLock(void);
47 void snmpMibUnlock(void);
48 
49 error_t snmpMibGetSysDescr(const MibObject *object, const uint8_t *oid,
50  size_t oidLen, MibVariant *value, size_t *valueLen);
51 
52 error_t snmpMibGetSysObjectID(const MibObject *object, const uint8_t *oid,
53  size_t oidLen, MibVariant *value, size_t *valueLen);
54 
55 error_t snmpMibGetSysUpTime(const MibObject *object, const uint8_t *oid,
56  size_t oidLen, MibVariant *value, size_t *valueLen);
57 
58 error_t snmpMibSetSysContact(const MibObject *object, const uint8_t *oid,
59  size_t oidLen, const MibVariant *value, size_t valueLen, bool_t commit);
60 
61 error_t snmpMibGetSysContact(const MibObject *object, const uint8_t *oid,
62  size_t oidLen, MibVariant *value, size_t *valueLen);
63 
64 error_t snmpMibSetSysName(const MibObject *object, const uint8_t *oid,
65  size_t oidLen, const MibVariant *value, size_t valueLen, bool_t commit);
66 
67 error_t snmpMibGetSysName(const MibObject *object, const uint8_t *oid,
68  size_t oidLen, MibVariant *value, size_t *valueLen);
69 
70 error_t snmpMibSetSysLocation(const MibObject *object, const uint8_t *oid,
71  size_t oidLen, const MibVariant *value, size_t valueLen, bool_t commit);
72 
73 error_t snmpMibGetSysLocation(const MibObject *object, const uint8_t *oid,
74  size_t oidLen, MibVariant *value, size_t *valueLen);
75 
76 error_t snmpMibGetSysOREntry(const MibObject *object, const uint8_t *oid,
77  size_t oidLen, MibVariant *value, size_t *valueLen);
78 
79 error_t snmpMibGetNextSysOREntry(const MibObject *object, const uint8_t *oid,
80  size_t oidLen, uint8_t *nextOid, size_t *nextOidLen);
81 
82 error_t snmpv2MibGetSnmpTrapOID(const MibObject *object, const uint8_t *oid,
83  size_t oidLen, MibVariant *value, size_t *valueLen);
84 
85 error_t snmpv2MibGetSnmpTrapEnterprise(const MibObject *object, const uint8_t *oid,
86  size_t oidLen, MibVariant *value, size_t *valueLen);
87 
88 error_t snmpMibSetSnmpSetSerialNo(const MibObject *object, const uint8_t *oid,
89  size_t oidLen, const MibVariant *value, size_t valueLen, bool_t commit);
90 
91 error_t snmpMibGetSnmpSetSerialNo(const MibObject *object, const uint8_t *oid,
92  size_t oidLen, MibVariant *value, size_t *valueLen);
93 
94 //C++ guard
95 #ifdef __cplusplus
96 }
97 #endif
98 
99 #endif
void snmpMibUnload(void *context)
Unload SNMP MIB module.
int bool_t
Definition: compiler_port.h:49
error_t snmpMibGetSysDescr(const MibObject *object, const uint8_t *oid, size_t oidLen, MibVariant *value, size_t *valueLen)
error_t snmpMibGetSysUpTime(const MibObject *object, const uint8_t *oid, size_t oidLen, MibVariant *value, size_t *valueLen)
Get sysUpTime object value.
error_t snmpMibLoad(void *context)
Load SNMP MIB module.
error_t snmpv2MibGetSnmpTrapOID(const MibObject *object, const uint8_t *oid, size_t oidLen, MibVariant *value, size_t *valueLen)
Get snmpTrapOID object value.
__start_packed struct @205 MibVariant
Variant data type.
error_t snmpMibInit(void)
SNMP MIB module initialization.
Definition: snmp_mib_impl.c:54
error_t snmpMibSetSysLocation(const MibObject *object, const uint8_t *oid, size_t oidLen, const MibVariant *value, size_t valueLen, bool_t commit)
error_t snmpMibSetSysName(const MibObject *object, const uint8_t *oid, size_t oidLen, const MibVariant *value, size_t valueLen, bool_t commit)
error_t
Error codes.
Definition: error.h:42
error_t snmpMibGetNextSysOREntry(const MibObject *object, const uint8_t *oid, size_t oidLen, uint8_t *nextOid, size_t *nextOidLen)
Get next sysOREntry object.
void snmpMibUnlock(void)
Unlock SNMP MIB base.
error_t snmpMibGetSysOREntry(const MibObject *object, const uint8_t *oid, size_t oidLen, MibVariant *value, size_t *valueLen)
Get sysOREntry object value.
uint8_t oid[1]
Definition: mib_common.h:186
error_t snmpMibGetSysLocation(const MibObject *object, const uint8_t *oid, size_t oidLen, MibVariant *value, size_t *valueLen)
error_t snmpMibGetSysName(const MibObject *object, const uint8_t *oid, size_t oidLen, MibVariant *value, size_t *valueLen)
Common definitions for MIB modules.
error_t snmpMibGetSysContact(const MibObject *object, const uint8_t *oid, size_t oidLen, MibVariant *value, size_t *valueLen)
#define MibObject
Definition: mib_common.h:46
error_t snmpMibGetSysObjectID(const MibObject *object, const uint8_t *oid, size_t oidLen, MibVariant *value, size_t *valueLen)
error_t snmpMibSetSnmpSetSerialNo(const MibObject *object, const uint8_t *oid, size_t oidLen, const MibVariant *value, size_t valueLen, bool_t commit)
Set snmpSetSerialNo object value.
void snmpMibLock(void)
Lock SNMP MIB base.
error_t snmpMibGetSnmpSetSerialNo(const MibObject *object, const uint8_t *oid, size_t oidLen, MibVariant *value, size_t *valueLen)
Get snmpSetSerialNo object value.
error_t snmpv2MibGetSnmpTrapEnterprise(const MibObject *object, const uint8_t *oid, size_t oidLen, MibVariant *value, size_t *valueLen)
Get snmpTrapEnterprise object value.
uint8_t value[]
Definition: dtls_misc.h:150
error_t snmpMibSetSysContact(const MibObject *object, const uint8_t *oid, size_t oidLen, const MibVariant *value, size_t valueLen, bool_t commit)