Common definitions for MIB modules. More...
#include "core/net.h"
Go to the source code of this file.
Data Structures | |
struct | _MibObject |
MIB object descriptor. More... | |
struct | MibModule |
MIB module. More... | |
Macros | |
#define | MIB_MAX_OID_SIZE 16 |
#define | MibObject struct _MibObject |
Typedefs | |
typedef 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. More... | |
typedef error_t(* | MibGetValue) (const MibObject *object, const uint8_t *oid, size_t oidLen, MibVariant *value, size_t *valueLen) |
Get object value. More... | |
typedef error_t(* | MibGetNext) (const MibObject *object, const uint8_t *oid, size_t oidLen, uint8_t *nextOid, size_t *nextOidLen) |
Get next object. More... | |
typedef error_t(* | MibInit) (void) |
MIB initialization. More... | |
typedef error_t(* | MibLoad) (void *context) |
Load MIB. More... | |
typedef void(* | MibUnload) (void *context) |
Unload MIB. More... | |
typedef void(* | MibLock) (void) |
Lock MIB. More... | |
typedef void(* | MibUnlock) (void) |
Unlock MIB. More... | |
Functions | |
error_t | mibEncodeIndex (uint8_t *oid, size_t maxOidLen, size_t *pos, uint_t index) |
Encode instance identifier (index) More... | |
error_t | mibDecodeIndex (const uint8_t *oid, size_t oidLen, size_t *pos, uint_t *index) |
Decode instance identifier (index) More... | |
error_t | mibEncodeUnsigned32 (uint8_t *oid, size_t maxOidLen, size_t *pos, uint32_t value) |
Encode instance identifier (unsigned 32-bit integer) More... | |
error_t | mibDecodeUnsigned32 (const uint8_t *oid, size_t oidLen, size_t *pos, uint32_t *value) |
Decode instance identifier (unsigned 32-bit integer) More... | |
error_t | mibEncodeString (uint8_t *oid, size_t maxOidLen, size_t *pos, const char_t *string, bool_t implied) |
Encode instance identifier (string) More... | |
error_t | mibDecodeString (const uint8_t *oid, size_t oidLen, size_t *pos, char_t *string, size_t maxStringLen, bool_t implied) |
Decode instance identifier (string) More... | |
error_t | mibEncodeOctetString (uint8_t *oid, size_t maxOidLen, size_t *pos, const uint8_t *data, size_t dataLen, bool_t implied) |
Encode instance identifier (octet string) More... | |
error_t | mibDecodeOctetString (const uint8_t *oid, size_t oidLen, size_t *pos, uint8_t *data, size_t maxDataLen, size_t *dataLen, bool_t implied) |
Decode instance identifier (octet string) More... | |
error_t | mibEncodeObjectIdentifier (uint8_t *oid, size_t maxOidLen, size_t *pos, const uint8_t *objectId, size_t objectIdLen, bool_t implied) |
Encode instance identifier (object identifier) More... | |
error_t | mibDecodeObjectIdentifier (const uint8_t *oid, size_t oidLen, size_t *pos, uint8_t *objectId, size_t maxObjectIdLen, size_t *objectIdLen, bool_t implied) |
Decode instance identifier (object identifier) More... | |
error_t | mibEncodePort (uint8_t *oid, size_t maxOidLen, size_t *pos, uint16_t port) |
Encode instance identifier (port number) More... | |
error_t | mibDecodePort (const uint8_t *oid, size_t oidLen, size_t *pos, uint16_t *port) |
Decode instance identifier (port number) More... | |
error_t | mibEncodeMacAddr (uint8_t *oid, size_t maxOidLen, size_t *pos, const MacAddr *macAddr) |
Encode instance identifier (MAC address) More... | |
error_t | mibDecodeMacAddr (const uint8_t *oid, size_t oidLen, size_t *pos, MacAddr *macAddr) |
Decode instance identifier (MAC address) More... | |
error_t | mibEncodePhysAddr (uint8_t *oid, size_t maxOidLen, size_t *pos, const MacAddr *macAddr) |
Encode instance identifier (physical address) More... | |
error_t | mibDecodePhysAddr (const uint8_t *oid, size_t oidLen, size_t *pos, MacAddr *macAddr) |
Decode instance identifier (physical address) More... | |
error_t | mibEncodeIpv4Addr (uint8_t *oid, size_t maxOidLen, size_t *pos, Ipv4Addr ipAddr) |
Encode instance identifier (IPv4 address) More... | |
error_t | mibDecodeIpv4Addr (const uint8_t *oid, size_t oidLen, size_t *pos, Ipv4Addr *ipAddr) |
Decode instance identifier (IPv4 address) More... | |
error_t | mibEncodeIpv6Addr (uint8_t *oid, size_t maxOidLen, size_t *pos, const Ipv6Addr *ipAddr) |
Encode instance identifier (IPv6 address) More... | |
error_t | mibDecodeIpv6Addr (const uint8_t *oid, size_t oidLen, size_t *pos, Ipv6Addr *ipAddr) |
Decode instance identifier (IPv6 address) More... | |
error_t | mibEncodeIpAddr (uint8_t *oid, size_t maxOidLen, size_t *pos, const IpAddr *ipAddr) |
Encode instance identifier (IP address) More... | |
error_t | mibDecodeIpAddr (const uint8_t *oid, size_t oidLen, size_t *pos, IpAddr *ipAddr) |
Decode instance identifier (IP address) More... | |
int_t | mibCompMacAddr (const MacAddr *macAddr1, const MacAddr *macAddr2) |
Compare MAC addresses. More... | |
int_t | mibCompIpAddr (const IpAddr *ipAddr1, const IpAddr *ipAddr2) |
Compare IP addresses. More... | |
error_t | mibTestAndIncSpinLock (int32_t *spinLock, int32_t value, bool_t commit) |
Test and increment spin lock. More... | |
Variables | |
typedef | __packed_struct |
Variant data type. More... | |
MibVariant | |
Detailed Description
Common definitions for MIB modules.
License
SPDX-License-Identifier: GPL-2.0-or-later
Copyright (C) 2010-2024 Oryx Embedded SARL. All rights reserved.
This file is part of CycloneTCP Open.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- Version
- 2.4.4
Definition in file mib_common.h.
Macro Definition Documentation
◆ MIB_MAX_OID_SIZE
#define MIB_MAX_OID_SIZE 16 |
Definition at line 39 of file mib_common.h.
◆ MibObject
#define MibObject struct _MibObject |
Definition at line 46 of file mib_common.h.
Typedef Documentation
◆ MibGetNext
typedef error_t(* MibGetNext) (const MibObject *object, const uint8_t *oid, size_t oidLen, uint8_t *nextOid, size_t *nextOidLen) |
Get next object.
Definition at line 227 of file mib_common.h.
◆ MibGetValue
typedef error_t(* MibGetValue) (const MibObject *object, const uint8_t *oid, size_t oidLen, MibVariant *value, size_t *valueLen) |
Get object value.
Definition at line 219 of file mib_common.h.
◆ MibInit
typedef error_t(* MibInit) (void) |
MIB initialization.
Definition at line 256 of file mib_common.h.
◆ MibLoad
typedef error_t(* MibLoad) (void *context) |
Load MIB.
Definition at line 263 of file mib_common.h.
◆ MibLock
typedef void(* MibLock) (void) |
Lock MIB.
Definition at line 277 of file mib_common.h.
◆ MibSetValue
typedef 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 at line 211 of file mib_common.h.
◆ MibUnload
typedef void(* MibUnload) (void *context) |
Unload MIB.
Definition at line 270 of file mib_common.h.
◆ MibUnlock
typedef void(* MibUnlock) (void) |
Unlock MIB.
Definition at line 284 of file mib_common.h.
Enumeration Type Documentation
◆ InetAddrType
enum InetAddrType |
Internet address types.
Enumerator | |
---|---|
INET_ADDR_TYPE_UNKNOWN | |
INET_ADDR_TYPE_IPV4 | |
INET_ADDR_TYPE_IPV6 | |
INET_ADDR_TYPE_IPV4Z | |
INET_ADDR_TYPE_IPV6Z | |
INET_ADDR_TYPE_DNS |
Definition at line 130 of file mib_common.h.
◆ InetScopeType
enum InetScopeType |
Internet address scope.
Definition at line 145 of file mib_common.h.
◆ InetVersion
enum InetVersion |
IP protocol version.
Enumerator | |
---|---|
INET_VERSION_UNKNOWN | |
INET_VERSION_IPV4 | |
INET_VERSION_IPV6 |
Definition at line 162 of file mib_common.h.
◆ MibAccess
enum MibAccess |
Access modes.
Enumerator | |
---|---|
MIB_ACCESS_NONE | |
MIB_ACCESS_FOR_NOTIFY | |
MIB_ACCESS_WRITE_ONLY | |
MIB_ACCESS_READ_ONLY | |
MIB_ACCESS_READ_WRITE | |
MIB_ACCESS_READ_CREATE |
Definition at line 74 of file mib_common.h.
◆ MibRowStatus
enum MibRowStatus |
Row status.
Enumerator | |
---|---|
MIB_ROW_STATUS_UNUSED | |
MIB_ROW_STATUS_ACTIVE | |
MIB_ROW_STATUS_NOT_IN_SERVICE | |
MIB_ROW_STATUS_NOT_READY | |
MIB_ROW_STATUS_CREATE_AND_GO | |
MIB_ROW_STATUS_CREATE_AND_WAIT | |
MIB_ROW_STATUS_DESTROY |
Definition at line 100 of file mib_common.h.
◆ MibStorageType
enum MibStorageType |
Storage type.
Enumerator | |
---|---|
MIB_STORAGE_TYPE_OTHER | |
MIB_STORAGE_TYPE_VOLATILE | |
MIB_STORAGE_TYPE_NON_VOLATILE | |
MIB_STORAGE_TYPE_PERMANENT | |
MIB_STORAGE_TYPE_READ_ONLY |
Definition at line 116 of file mib_common.h.
◆ MibTruthValue
enum MibTruthValue |
Truth value.
Enumerator | |
---|---|
MIB_TRUTH_VALUE_TRUE | |
MIB_TRUTH_VALUE_FALSE |
Definition at line 89 of file mib_common.h.
◆ MibType
enum MibType |
MIB object types.
Enumerator | |
---|---|
MIB_TYPE_IP_ADDRESS | |
MIB_TYPE_COUNTER32 | |
MIB_TYPE_GAUGE32 | |
MIB_TYPE_UNSIGNED32 | |
MIB_TYPE_TIME_TICKS | |
MIB_TYPE_OPAQUE | |
MIB_TYPE_COUNTER64 |
Definition at line 58 of file mib_common.h.
Function Documentation
◆ mibCompIpAddr()
Compare IP addresses.
- Parameters
-
[in] ipAddr1 First IP address [in] ipAddr2 Second IP address
- Returns
- Comparison result
Definition at line 968 of file mib_common.c.
◆ mibCompMacAddr()
Compare MAC addresses.
- Parameters
-
[in] macAddr1 First MAC address [in] macAddr2 Second MAC address
- Returns
- Comparison result
Definition at line 954 of file mib_common.c.
◆ mibDecodeIndex()
Decode instance identifier (index)
- Parameters
-
[in] oid Pointer to the object identifier [in] oidLen Length of the OID, in bytes [in,out] pos Offset where to read the instance identifier [out] index Index value
- Returns
- Error code
Definition at line 64 of file mib_common.c.
◆ mibDecodeIpAddr()
Decode instance identifier (IP address)
- Parameters
-
[in] oid Pointer to the object identifier [in] oidLen Length of the OID, in bytes [in,out] pos Offset where to read the instance identifier [out] ipAddr IP address
- Returns
- Error code
Definition at line 886 of file mib_common.c.
◆ mibDecodeIpv4Addr()
Decode instance identifier (IPv4 address)
- Parameters
-
[in] oid Pointer to the object identifier [in] oidLen Length of the OID, in bytes [in,out] pos Offset where to read the instance identifier [out] ipAddr IPv4 address
- Returns
- Error code
Definition at line 698 of file mib_common.c.
◆ mibDecodeIpv6Addr()
Decode instance identifier (IPv6 address)
- Parameters
-
[in] oid Pointer to the object identifier [in] oidLen Length of the OID, in bytes [in,out] pos Offset where to read the instance identifier [out] ipAddr IPv6 address
- Returns
- Error code
Definition at line 770 of file mib_common.c.
◆ mibDecodeMacAddr()
Decode instance identifier (MAC address)
- Parameters
-
[in] oid Pointer to the object identifier [in] oidLen Length of the OID, in bytes [in,out] pos Offset where to read the instance identifier [out] macAddr MAC address
- Returns
- Error code
Definition at line 558 of file mib_common.c.
◆ mibDecodeObjectIdentifier()
error_t mibDecodeObjectIdentifier | ( | const uint8_t * | oid, |
size_t | oidLen, | ||
size_t * | pos, | ||
uint8_t * | objectId, | ||
size_t | maxObjectIdLen, | ||
size_t * | objectIdLen, | ||
bool_t | implied | ||
) |
Decode instance identifier (object identifier)
- Parameters
-
[in] oid Pointer to the object identifier [in] oidLen Length of the OID, in bytes [in,out] pos Offset where to read the instance identifier [out] objectId Buffer where to store the object identifier [in] maxObjectIdLen Maximum number of bytes the buffer can hold [out] objectIdLen Length of the object identifier, in bytes [in] implied Specifies whether the index is preceded by the IMPLIED keyword
- Returns
- Error code
Definition at line 377 of file mib_common.c.
◆ mibDecodeOctetString()
error_t mibDecodeOctetString | ( | const uint8_t * | oid, |
size_t | oidLen, | ||
size_t * | pos, | ||
uint8_t * | data, | ||
size_t | maxDataLen, | ||
size_t * | dataLen, | ||
bool_t | implied | ||
) |
Decode instance identifier (octet string)
- Parameters
-
[in] oid Pointer to the object identifier [in] oidLen Length of the OID, in bytes [in,out] pos Offset where to read the instance identifier [out] data Buffer where to store the octet string [in] maxDataLen Maximum number of bytes the buffer can hold [out] dataLen Length of the octet string, in bytes [in] implied Specifies whether the index is preceded by the IMPLIED keyword
- Returns
- Error code
Definition at line 225 of file mib_common.c.
◆ mibDecodePhysAddr()
Decode instance identifier (physical address)
- Parameters
-
[in] oid Pointer to the object identifier [in] oidLen Length of the OID, in bytes [in,out] pos Offset where to read the instance identifier [out] macAddr MAC address
- Returns
- Error code
Definition at line 625 of file mib_common.c.
◆ mibDecodePort()
error_t mibDecodePort | ( | const uint8_t * | oid, |
size_t | oidLen, | ||
size_t * | pos, | ||
uint16_t * | port | ||
) |
Decode instance identifier (port number)
- Parameters
-
[in] oid Pointer to the object identifier [in] oidLen Length of the OID, in bytes [in,out] pos Offset where to read the instance identifier [out] port Port number
- Returns
- Error code
Definition at line 495 of file mib_common.c.
◆ mibDecodeString()
error_t mibDecodeString | ( | const uint8_t * | oid, |
size_t | oidLen, | ||
size_t * | pos, | ||
char_t * | string, | ||
size_t | maxStringLen, | ||
bool_t | implied | ||
) |
Decode instance identifier (string)
- Parameters
-
[in] oid Pointer to the object identifier [in] oidLen Length of the OID, in bytes [in,out] pos Offset where to read the instance identifier [out] string NULL-terminated string [in] maxStringLen Maximum number of characters the string can hold [in] implied Specifies whether the index is preceded by the IMPLIED keyword
- Returns
- Error code
Definition at line 149 of file mib_common.c.
◆ mibDecodeUnsigned32()
error_t mibDecodeUnsigned32 | ( | const uint8_t * | oid, |
size_t | oidLen, | ||
size_t * | pos, | ||
uint32_t * | value | ||
) |
Decode instance identifier (unsigned 32-bit integer)
- Parameters
-
[in] oid Pointer to the object identifier [in] oidLen Length of the OID, in bytes [in,out] pos Offset where to read the instance identifier [out] value Unsigned 32-bit integer
- Returns
- Error code
Definition at line 111 of file mib_common.c.
◆ mibEncodeIndex()
Encode instance identifier (index)
- Parameters
-
[in] oid Pointer to the object identifier [in] maxOidLen Maximum number of bytes the OID can hold [in,out] pos Offset where to write the instance identifier [in] index Index value
- Returns
- Error code
Definition at line 47 of file mib_common.c.
◆ mibEncodeIpAddr()
Encode instance identifier (IP address)
- Parameters
-
[in] oid Pointer to the object identifier [in] maxOidLen Maximum number of bytes the OID can hold [in,out] pos Offset where to write the instance identifier [in] ipAddr IP address
- Returns
- Error code
Definition at line 808 of file mib_common.c.
◆ mibEncodeIpv4Addr()
Encode instance identifier (IPv4 address)
- Parameters
-
[in] oid Pointer to the object identifier [in] maxOidLen Maximum number of bytes the OID can hold [in,out] pos Offset where to write the instance identifier [in] ipAddr IPv4 address
- Returns
- Error code
Definition at line 664 of file mib_common.c.
◆ mibEncodeIpv6Addr()
error_t mibEncodeIpv6Addr | ( | uint8_t * | oid, |
size_t | maxOidLen, | ||
size_t * | pos, | ||
const Ipv6Addr * | ipAddr | ||
) |
Encode instance identifier (IPv6 address)
- Parameters
-
[in] oid Pointer to the object identifier [in] maxOidLen Maximum number of bytes the OID can hold [in,out] pos Offset where to write the instance identifier [in] ipAddr IPv6 address
- Returns
- Error code
Definition at line 740 of file mib_common.c.
◆ mibEncodeMacAddr()
Encode instance identifier (MAC address)
- Parameters
-
[in] oid Pointer to the object identifier [in] maxOidLen Maximum number of bytes the OID can hold [in,out] pos Offset where to write the instance identifier [in] macAddr MAC address
- Returns
- Error code
Definition at line 528 of file mib_common.c.
◆ mibEncodeObjectIdentifier()
error_t mibEncodeObjectIdentifier | ( | uint8_t * | oid, |
size_t | maxOidLen, | ||
size_t * | pos, | ||
const uint8_t * | objectId, | ||
size_t | objectIdLen, | ||
bool_t | implied | ||
) |
Encode instance identifier (object identifier)
- Parameters
-
[in] oid Pointer to the object identifier [in] maxOidLen Maximum number of bytes the OID can hold [in,out] pos Offset where to write the instance identifier [in] objectId Object identifier to be encoded [in] objectIdLen Length of the object identifier, in bytes [in] implied Specifies whether the index is preceded by the IMPLIED keyword
- Returns
- Error code
Definition at line 297 of file mib_common.c.
◆ mibEncodeOctetString()
error_t mibEncodeOctetString | ( | uint8_t * | oid, |
size_t | maxOidLen, | ||
size_t * | pos, | ||
const uint8_t * | data, | ||
size_t | dataLen, | ||
bool_t | implied | ||
) |
Encode instance identifier (octet string)
- Parameters
-
[in] oid Pointer to the object identifier [in] maxOidLen Maximum number of bytes the OID can hold [in,out] pos Offset where to write the instance identifier [in] data Pointer to the octet string [in] dataLen Length of the octet string, in bytes [in] implied Specifies whether the index is preceded by the IMPLIED keyword
- Returns
- Error code
Definition at line 182 of file mib_common.c.
◆ mibEncodePhysAddr()
error_t mibEncodePhysAddr | ( | uint8_t * | oid, |
size_t | maxOidLen, | ||
size_t * | pos, | ||
const MacAddr * | macAddr | ||
) |
Encode instance identifier (physical address)
- Parameters
-
[in] oid Pointer to the object identifier [in] maxOidLen Maximum number of bytes the OID can hold [in,out] pos Offset where to write the instance identifier [in] macAddr MAC address
- Returns
- Error code
Definition at line 596 of file mib_common.c.
◆ mibEncodePort()
error_t mibEncodePort | ( | uint8_t * | oid, |
size_t | maxOidLen, | ||
size_t * | pos, | ||
uint16_t | port | ||
) |
Encode instance identifier (port number)
- Parameters
-
[in] oid Pointer to the object identifier [in] maxOidLen Maximum number of bytes the OID can hold [in,out] pos Offset where to write the instance identifier [in] port Port number
- Returns
- Error code
Definition at line 478 of file mib_common.c.
◆ mibEncodeString()
error_t mibEncodeString | ( | uint8_t * | oid, |
size_t | maxOidLen, | ||
size_t * | pos, | ||
const char_t * | string, | ||
bool_t | implied | ||
) |
Encode instance identifier (string)
- Parameters
-
[in] oid Pointer to the object identifier [in] maxOidLen Maximum number of bytes the OID can hold [in,out] pos Offset where to write the instance identifier [in] string NULL-terminated string [in] implied Specifies whether the index is preceded by the IMPLIED keyword
- Returns
- Error code
Definition at line 129 of file mib_common.c.
◆ mibEncodeUnsigned32()
error_t mibEncodeUnsigned32 | ( | uint8_t * | oid, |
size_t | maxOidLen, | ||
size_t * | pos, | ||
uint32_t | value | ||
) |
Encode instance identifier (unsigned 32-bit integer)
- Parameters
-
[in] oid Pointer to the object identifier [in] maxOidLen Maximum number of bytes the OID can hold [in,out] pos Offset where to write the instance identifier [in] value Unsigned 32-bit integer
- Returns
- Error code
Definition at line 94 of file mib_common.c.
◆ mibTestAndIncSpinLock()
Test and increment spin lock.
- Parameters
-
[in,out] spinLock Pointer to the spin lock [in] value New value supplied via the management protocol [in] commit This flag indicates the current phase (validation phase or write phase if the validation was successful)
- Returns
- Comparison result
Definition at line 1006 of file mib_common.c.
Variable Documentation
◆ __packed_struct
typedef __packed_struct |
Variant data type.
Definition at line 182 of file mib_common.h.
◆ MibVariant
MibVariant |
Definition at line 196 of file mib_common.h.