Common definitions for MIB modules. More...
Go to the source code of this file.
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... | |
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.c.
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.