mib_common.h File Reference

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...
 

Enumerations

enum  MibType {
  MIB_TYPE_IP_ADDRESS = 0, MIB_TYPE_COUNTER32 = 1, MIB_TYPE_GAUGE32 = 2, MIB_TYPE_UNSIGNED32 = 2,
  MIB_TYPE_TIME_TICKS = 3, MIB_TYPE_OPAQUE = 4, MIB_TYPE_COUNTER64 = 6
}
 MIB object types. More...
 
enum  MibAccess {
  MIB_ACCESS_NONE = 0, MIB_ACCESS_FOR_NOTIFY = 1, MIB_ACCESS_WRITE_ONLY = 2, MIB_ACCESS_READ_ONLY = 3,
  MIB_ACCESS_READ_WRITE = 4, MIB_ACCESS_READ_CREATE = 5
}
 Access modes. More...
 
enum  MibTruthValue { MIB_TRUTH_VALUE_TRUE = 1, MIB_TRUTH_VALUE_FALSE = 2 }
 Truth value. More...
 
enum  MibRowStatus {
  MIB_ROW_STATUS_UNUSED = 0, MIB_ROW_STATUS_ACTIVE = 1, MIB_ROW_STATUS_NOT_IN_SERVICE = 2, MIB_ROW_STATUS_NOT_READY = 3,
  MIB_ROW_STATUS_CREATE_AND_GO = 4, MIB_ROW_STATUS_CREATE_AND_WAIT = 5, MIB_ROW_STATUS_DESTROY = 6
}
 Row status. More...
 
enum  MibStorageType {
  MIB_STORAGE_TYPE_OTHER = 1, MIB_STORAGE_TYPE_VOLATILE = 2, MIB_STORAGE_TYPE_NON_VOLATILE = 3, MIB_STORAGE_TYPE_PERMANENT = 4,
  MIB_STORAGE_TYPE_READ_ONLY = 5
}
 Storage type. More...
 
enum  InetAddrType {
  INET_ADDR_TYPE_UNKNOWN = 0, INET_ADDR_TYPE_IPV4 = 1, INET_ADDR_TYPE_IPV6 = 2, INET_ADDR_TYPE_IPV4Z = 3,
  INET_ADDR_TYPE_IPV6Z = 4, INET_ADDR_TYPE_DNS = 16
}
 Internet address types. More...
 
enum  InetScopeType {
  INET_SCOPE_TYPE_RESERVED = 0, INET_SCOPE_TYPE_INTERFACE_LOCAL = 1, INET_SCOPE_TYPE_LINK_LOCAL = 2, INET_SCOPE_TYPE_SUBNET_LOCAL = 3,
  INET_SCOPE_TYPE_ADMIN_LOCAL = 4, INET_SCOPE_TYPE_SITE_LOCAL = 5, INET_SCOPE_TYPE_ORGANIZATION_LOCAL = 8, INET_SCOPE_TYPE_GLOBAL = 14
}
 Internet address scope. More...
 
enum  InetVersion { INET_VERSION_UNKNOWN = 0, INET_VERSION_IPV4 = 1, INET_VERSION_IPV6 = 2 }
 IP protocol version. 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.

Author
Oryx Embedded SARL (www.oryx-embedded.com)
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

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

Internet address scope.

Enumerator
INET_SCOPE_TYPE_RESERVED 
INET_SCOPE_TYPE_INTERFACE_LOCAL 
INET_SCOPE_TYPE_LINK_LOCAL 
INET_SCOPE_TYPE_SUBNET_LOCAL 
INET_SCOPE_TYPE_ADMIN_LOCAL 
INET_SCOPE_TYPE_SITE_LOCAL 
INET_SCOPE_TYPE_ORGANIZATION_LOCAL 
INET_SCOPE_TYPE_GLOBAL 

Definition at line 145 of file mib_common.h.

◆ 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

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

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

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()

int_t mibCompIpAddr ( const IpAddr ipAddr1,
const IpAddr ipAddr2 
)

Compare IP addresses.

Parameters
[in]ipAddr1First IP address
[in]ipAddr2Second IP address
Returns
Comparison result

Definition at line 968 of file mib_common.c.

◆ mibCompMacAddr()

int_t mibCompMacAddr ( const MacAddr macAddr1,
const MacAddr macAddr2 
)

Compare MAC addresses.

Parameters
[in]macAddr1First MAC address
[in]macAddr2Second MAC address
Returns
Comparison result

Definition at line 954 of file mib_common.c.

◆ mibDecodeIndex()

error_t mibDecodeIndex ( const uint8_t *  oid,
size_t  oidLen,
size_t *  pos,
uint_t index 
)

Decode instance identifier (index)

Parameters
[in]oidPointer to the object identifier
[in]oidLenLength of the OID, in bytes
[in,out]posOffset where to read the instance identifier
[out]indexIndex value
Returns
Error code

Definition at line 64 of file mib_common.c.

◆ mibDecodeIpAddr()

error_t mibDecodeIpAddr ( const uint8_t *  oid,
size_t  oidLen,
size_t *  pos,
IpAddr ipAddr 
)

Decode instance identifier (IP address)

Parameters
[in]oidPointer to the object identifier
[in]oidLenLength of the OID, in bytes
[in,out]posOffset where to read the instance identifier
[out]ipAddrIP address
Returns
Error code

Definition at line 886 of file mib_common.c.

◆ mibDecodeIpv4Addr()

error_t mibDecodeIpv4Addr ( const uint8_t *  oid,
size_t  oidLen,
size_t *  pos,
Ipv4Addr ipAddr 
)

Decode instance identifier (IPv4 address)

Parameters
[in]oidPointer to the object identifier
[in]oidLenLength of the OID, in bytes
[in,out]posOffset where to read the instance identifier
[out]ipAddrIPv4 address
Returns
Error code

Definition at line 698 of file mib_common.c.

◆ mibDecodeIpv6Addr()

error_t mibDecodeIpv6Addr ( const uint8_t *  oid,
size_t  oidLen,
size_t *  pos,
Ipv6Addr ipAddr 
)

Decode instance identifier (IPv6 address)

Parameters
[in]oidPointer to the object identifier
[in]oidLenLength of the OID, in bytes
[in,out]posOffset where to read the instance identifier
[out]ipAddrIPv6 address
Returns
Error code

Definition at line 770 of file mib_common.c.

◆ mibDecodeMacAddr()

error_t mibDecodeMacAddr ( const uint8_t *  oid,
size_t  oidLen,
size_t *  pos,
MacAddr macAddr 
)

Decode instance identifier (MAC address)

Parameters
[in]oidPointer to the object identifier
[in]oidLenLength of the OID, in bytes
[in,out]posOffset where to read the instance identifier
[out]macAddrMAC 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]oidPointer to the object identifier
[in]oidLenLength of the OID, in bytes
[in,out]posOffset where to read the instance identifier
[out]objectIdBuffer where to store the object identifier
[in]maxObjectIdLenMaximum number of bytes the buffer can hold
[out]objectIdLenLength of the object identifier, in bytes
[in]impliedSpecifies 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]oidPointer to the object identifier
[in]oidLenLength of the OID, in bytes
[in,out]posOffset where to read the instance identifier
[out]dataBuffer where to store the octet string
[in]maxDataLenMaximum number of bytes the buffer can hold
[out]dataLenLength of the octet string, in bytes
[in]impliedSpecifies whether the index is preceded by the IMPLIED keyword
Returns
Error code

Definition at line 225 of file mib_common.c.

◆ mibDecodePhysAddr()

error_t mibDecodePhysAddr ( const uint8_t *  oid,
size_t  oidLen,
size_t *  pos,
MacAddr macAddr 
)

Decode instance identifier (physical address)

Parameters
[in]oidPointer to the object identifier
[in]oidLenLength of the OID, in bytes
[in,out]posOffset where to read the instance identifier
[out]macAddrMAC 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]oidPointer to the object identifier
[in]oidLenLength of the OID, in bytes
[in,out]posOffset where to read the instance identifier
[out]portPort 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]oidPointer to the object identifier
[in]oidLenLength of the OID, in bytes
[in,out]posOffset where to read the instance identifier
[out]stringNULL-terminated string
[in]maxStringLenMaximum number of characters the string can hold
[in]impliedSpecifies 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]oidPointer to the object identifier
[in]oidLenLength of the OID, in bytes
[in,out]posOffset where to read the instance identifier
[out]valueUnsigned 32-bit integer
Returns
Error code

Definition at line 111 of file mib_common.c.

◆ mibEncodeIndex()

error_t mibEncodeIndex ( uint8_t *  oid,
size_t  maxOidLen,
size_t *  pos,
uint_t  index 
)

Encode instance identifier (index)

Parameters
[in]oidPointer to the object identifier
[in]maxOidLenMaximum number of bytes the OID can hold
[in,out]posOffset where to write the instance identifier
[in]indexIndex value
Returns
Error code

Definition at line 47 of file mib_common.c.

◆ mibEncodeIpAddr()

error_t mibEncodeIpAddr ( uint8_t *  oid,
size_t  maxOidLen,
size_t *  pos,
const IpAddr ipAddr 
)

Encode instance identifier (IP address)

Parameters
[in]oidPointer to the object identifier
[in]maxOidLenMaximum number of bytes the OID can hold
[in,out]posOffset where to write the instance identifier
[in]ipAddrIP address
Returns
Error code

Definition at line 808 of file mib_common.c.

◆ mibEncodeIpv4Addr()

error_t mibEncodeIpv4Addr ( uint8_t *  oid,
size_t  maxOidLen,
size_t *  pos,
Ipv4Addr  ipAddr 
)

Encode instance identifier (IPv4 address)

Parameters
[in]oidPointer to the object identifier
[in]maxOidLenMaximum number of bytes the OID can hold
[in,out]posOffset where to write the instance identifier
[in]ipAddrIPv4 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]oidPointer to the object identifier
[in]maxOidLenMaximum number of bytes the OID can hold
[in,out]posOffset where to write the instance identifier
[in]ipAddrIPv6 address
Returns
Error code

Definition at line 740 of file mib_common.c.

◆ mibEncodeMacAddr()

error_t mibEncodeMacAddr ( uint8_t *  oid,
size_t  maxOidLen,
size_t *  pos,
const MacAddr macAddr 
)

Encode instance identifier (MAC address)

Parameters
[in]oidPointer to the object identifier
[in]maxOidLenMaximum number of bytes the OID can hold
[in,out]posOffset where to write the instance identifier
[in]macAddrMAC 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]oidPointer to the object identifier
[in]maxOidLenMaximum number of bytes the OID can hold
[in,out]posOffset where to write the instance identifier
[in]objectIdObject identifier to be encoded
[in]objectIdLenLength of the object identifier, in bytes
[in]impliedSpecifies 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]oidPointer to the object identifier
[in]maxOidLenMaximum number of bytes the OID can hold
[in,out]posOffset where to write the instance identifier
[in]dataPointer to the octet string
[in]dataLenLength of the octet string, in bytes
[in]impliedSpecifies 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]oidPointer to the object identifier
[in]maxOidLenMaximum number of bytes the OID can hold
[in,out]posOffset where to write the instance identifier
[in]macAddrMAC 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]oidPointer to the object identifier
[in]maxOidLenMaximum number of bytes the OID can hold
[in,out]posOffset where to write the instance identifier
[in]portPort 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]oidPointer to the object identifier
[in]maxOidLenMaximum number of bytes the OID can hold
[in,out]posOffset where to write the instance identifier
[in]stringNULL-terminated string
[in]impliedSpecifies 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]oidPointer to the object identifier
[in]maxOidLenMaximum number of bytes the OID can hold
[in,out]posOffset where to write the instance identifier
[in]valueUnsigned 32-bit integer
Returns
Error code

Definition at line 94 of file mib_common.c.

◆ mibTestAndIncSpinLock()

error_t mibTestAndIncSpinLock ( int32_t *  spinLock,
int32_t  value,
bool_t  commit 
)

Test and increment spin lock.

Parameters
[in,out]spinLockPointer to the spin lock
[in]valueNew value supplied via the management protocol
[in]commitThis 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
Initial value:
{
__packed_union
{
int32_t integer;
uint8_t octetString[1];
uint8_t oid[1];
uint8_t ipAddr[4];
uint32_t counter32;
uint32_t gauge32;
uint32_t unsigned32;
uint32_t timeTicks;
uint64_t counter64;
}

Variant data type.

Definition at line 182 of file mib_common.h.

◆ MibVariant

MibVariant

Definition at line 196 of file mib_common.h.

uint8_t oid[]
Definition: lldp_tlv.h:300
Ipv4Addr ipAddr
Definition: ipcp.h:105