38#ifndef MIB_MAX_OID_SIZE
39 #define MIB_MAX_OID_SIZE 16
40#elif (MIB_MAX_OID_SIZE < 1)
41 #error MIB_MAX_OID_SIZE parameter is not valid
46#define MibObject struct _MibObject
60 MIB_TYPE_IP_ADDRESS = 0,
61 MIB_TYPE_COUNTER32 = 1,
63 MIB_TYPE_UNSIGNED32 = 2,
64 MIB_TYPE_TIME_TICKS = 3,
66 MIB_TYPE_COUNTER64 = 6
77 MIB_ACCESS_FOR_NOTIFY = 1,
78 MIB_ACCESS_WRITE_ONLY = 2,
79 MIB_ACCESS_READ_ONLY = 3,
80 MIB_ACCESS_READ_WRITE = 4,
81 MIB_ACCESS_READ_CREATE = 5,
91 MIB_TRUTH_VALUE_TRUE = 1,
92 MIB_TRUTH_VALUE_FALSE = 2
102 MIB_ROW_STATUS_UNUSED = 0,
103 MIB_ROW_STATUS_ACTIVE = 1,
104 MIB_ROW_STATUS_NOT_IN_SERVICE = 2,
105 MIB_ROW_STATUS_NOT_READY = 3,
106 MIB_ROW_STATUS_CREATE_AND_GO = 4,
107 MIB_ROW_STATUS_CREATE_AND_WAIT = 5,
108 MIB_ROW_STATUS_DESTROY = 6
118 MIB_STORAGE_TYPE_OTHER = 1,
119 MIB_STORAGE_TYPE_VOLATILE = 2,
120 MIB_STORAGE_TYPE_NON_VOLATILE = 3,
121 MIB_STORAGE_TYPE_PERMANENT = 4,
122 MIB_STORAGE_TYPE_READ_ONLY = 5,
132 INET_ADDR_TYPE_UNKNOWN = 0,
133 INET_ADDR_TYPE_IPV4 = 1,
134 INET_ADDR_TYPE_IPV6 = 2,
135 INET_ADDR_TYPE_IPV4Z = 3,
136 INET_ADDR_TYPE_IPV6Z = 4,
137 INET_ADDR_TYPE_DNS = 16
147 INET_SCOPE_TYPE_RESERVED = 0,
148 INET_SCOPE_TYPE_INTERFACE_LOCAL = 1,
149 INET_SCOPE_TYPE_LINK_LOCAL = 2,
150 INET_SCOPE_TYPE_SUBNET_LOCAL = 3,
151 INET_SCOPE_TYPE_ADMIN_LOCAL = 4,
152 INET_SCOPE_TYPE_SITE_LOCAL = 5,
153 INET_SCOPE_TYPE_ORGANIZATION_LOCAL = 8,
154 INET_SCOPE_TYPE_GLOBAL = 14
164 INET_VERSION_UNKNOWN = 0,
165 INET_VERSION_IPV4 = 1,
166 INET_VERSION_IPV6 = 2
171#if defined(__CWCC__) || defined(_WIN32)
172 #pragma pack(push, 1)
185 uint8_t octetString[1];
198#if defined(__CWCC__) || defined(_WIN32)
208 size_t oidLen,
const MibVariant *value,
size_t valueLen, bool_t commit);
216 size_t oidLen, MibVariant *value,
size_t *valueLen);
224 size_t oidLen, uint8_t *nextOid,
size_t *nextOidLen);
234 uint8_t oid[MIB_MAX_OID_SIZE];
290 uint8_t oid[MIB_MAX_OID_SIZE];
292 const MibObject *objects;
303error_t mibEncodeIndex(uint8_t *oid,
size_t maxOidLen,
size_t *pos,
306error_t mibDecodeIndex(
const uint8_t *oid,
size_t oidLen,
size_t *pos,
309error_t mibEncodeUnsigned32(uint8_t *oid,
size_t maxOidLen,
size_t *pos,
312error_t mibDecodeUnsigned32(
const uint8_t *oid,
size_t oidLen,
size_t *pos,
315error_t mibEncodeString(uint8_t *oid,
size_t maxOidLen,
size_t *pos,
316 const char_t *
string, bool_t implied);
318error_t mibDecodeString(
const uint8_t *oid,
size_t oidLen,
size_t *pos,
319 char_t *
string,
size_t maxStringLen, bool_t implied);
321error_t mibEncodeOctetString(uint8_t *oid,
size_t maxOidLen,
size_t *pos,
322 const uint8_t *data,
size_t dataLen, bool_t implied);
324error_t mibDecodeOctetString(
const uint8_t *oid,
size_t oidLen,
size_t *pos,
325 uint8_t *data,
size_t maxDataLen,
size_t *dataLen, bool_t implied);
327error_t mibEncodeObjectIdentifier(uint8_t *oid,
size_t maxOidLen,
size_t *pos,
328 const uint8_t *objectId,
size_t objectIdLen, bool_t implied);
330error_t mibDecodeObjectIdentifier(
const uint8_t *oid,
size_t oidLen,
size_t *pos,
331 uint8_t *objectId,
size_t maxObjectIdLen,
size_t *objectIdLen, bool_t implied);
333error_t mibEncodePort(uint8_t *oid,
size_t maxOidLen,
size_t *pos,
336error_t mibDecodePort(
const uint8_t *oid,
size_t oidLen,
size_t *pos,
339error_t mibEncodeMacAddr(uint8_t *oid,
size_t maxOidLen,
size_t *pos,
340 const MacAddr *macAddr);
342error_t mibDecodeMacAddr(
const uint8_t *oid,
size_t oidLen,
size_t *pos,
345error_t mibEncodePhysAddr(uint8_t *oid,
size_t maxOidLen,
size_t *pos,
346 const MacAddr *macAddr);
348error_t mibDecodePhysAddr(
const uint8_t *oid,
size_t oidLen,
size_t *pos,
351error_t mibEncodeIpv4Addr(uint8_t *oid,
size_t maxOidLen,
size_t *pos,
354error_t mibDecodeIpv4Addr(
const uint8_t *oid,
size_t oidLen,
size_t *pos,
357error_t mibEncodeIpv6Addr(uint8_t *oid,
size_t maxOidLen,
size_t *pos,
358 const Ipv6Addr *ipAddr);
360error_t mibDecodeIpv6Addr(
const uint8_t *oid,
size_t oidLen,
size_t *pos,
363error_t mibEncodeIpAddr(uint8_t *oid,
size_t maxOidLen,
size_t *pos,
366error_t mibDecodeIpAddr(
const uint8_t *oid,
size_t oidLen,
size_t *pos,
369int_t mibCompMacAddr(
const MacAddr *macAddr1,
const MacAddr *macAddr2);
370int_t mibCompIpAddr(
const IpAddr *ipAddr1,
const IpAddr *ipAddr2);
372error_t mibTestAndIncSpinLock(int32_t *spinLock, int32_t value, bool_t commit);
error_t
Error codes.
Definition error.h:43
uint32_t Ipv4Addr
IPv4 network address.
Definition ipv4.h:267
error_t(* MibGetNext)(const MibObject *object, const uint8_t *oid, size_t oidLen, uint8_t *nextOid, size_t *nextOidLen)
Get next object.
Definition mib_common.h:223
MibTruthValue
Truth value.
Definition mib_common.h:90
MibRowStatus
Row status.
Definition mib_common.h:101
InetVersion
IP protocol version.
Definition mib_common.h:163
error_t(* MibSetValue)(const MibObject *object, const uint8_t *oid, size_t oidLen, const MibVariant *value, size_t valueLen, bool_t commit)
Set object value.
Definition mib_common.h:207
MibStorageType
Storage type.
Definition mib_common.h:117
void(* MibLock)(void)
Lock MIB.
Definition mib_common.h:273
MibAccess
Access modes.
Definition mib_common.h:75
MibType
MIB object types.
Definition mib_common.h:59
void(* MibUnload)(void *context)
Unload MIB.
Definition mib_common.h:266
error_t(* MibLoad)(void *context)
Load MIB.
Definition mib_common.h:259
error_t(* MibGetValue)(const MibObject *object, const uint8_t *oid, size_t oidLen, MibVariant *value, size_t *valueLen)
Get object value.
Definition mib_common.h:215
typedef __packed_struct
Variant data type.
Definition mib_common.h:181
void(* MibUnlock)(void)
Unlock MIB.
Definition mib_common.h:280
InetScopeType
Internet address scope.
Definition mib_common.h:146
InetAddrType
Internet address types.
Definition mib_common.h:131
error_t(* MibInit)(void)
MIB initialization.
Definition mib_common.h:252
IP network address.
Definition ip.h:72
MIB module.
Definition mib_common.h:288
MIB object descriptor.
Definition mib_common.h:232