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

struct {
   char_t   type
 
   uint32_t   dataStart
 
   uint32_t   dataLength
 
   uint8_t   nameLength
 
   char_t   name []
 
   uint8_t   tokenLen: 4
 
   uint8_t   type: 2
 
   uint8_t   version: 2
 
   uint8_t   code
 
   uint16_t   mid
 
   uint8_t   token []
 
   union {
      uint8_t   b [6]
 
      uint16_t   w [3]
 
   } 
 
   uint16_t   srcPort
 
   uint16_t   destPort
 
   uint32_t   seqNum
 
   uint32_t   ackNum
 
   uint8_t   reserved1: 4
 
   uint8_t   dataOffset: 4
 
   uint8_t   flags: 6
 
   uint8_t   reserved2: 2
 
   uint16_t   window
 
   uint16_t   checksum
 
   uint16_t   urgentPointer
 
   uint8_t   options []
 
   uint16_t   length
 
   uint8_t   data []
 
   uint8_t   op
 
   uint8_t   htype
 
   uint8_t   hlen
 
   uint8_t   hops
 
   uint32_t   xid
 
   uint16_t   secs
 
   uint16_t   flags
 
   Ipv4Addr   ciaddr
 
   Ipv4Addr   yiaddr
 
   Ipv4Addr   siaddr
 
   Ipv4Addr   giaddr
 
   MacAddr   chaddr
 
   uint8_t   unused [10]
 
   uint8_t   sname [64]
 
   uint8_t   file [128]
 
   uint32_t   magicCookie
 
   uint16_t   type
 
   uint16_t   hardwareType
 
   uint32_t   time
 
   MacAddr   linkLayerAddr
 
   uint16_t   id
 
   uint8_t   rd: 1
 
   uint8_t   tc: 1
 
   uint8_t   aa: 1
 
   uint8_t   opcode: 4
 
   uint8_t   qr: 1
 
   uint8_t   rcode: 4
 
   uint8_t   z: 3
 
   uint8_t   ra: 1
 
   uint16_t   qdcount
 
   uint16_t   ancount
 
   uint16_t   nscount
 
   uint16_t   arcount
 
   uint8_t   questions []
 
   uint16_t   controlWord
 
   uint16_t   byteCount
 
   uint8_t   bLength
 
   uint8_t   bDescriptorType
 
   uint16_t   bcdUsb
 
   uint8_t   bDeviceClass
 
   uint8_t   bDeviceSubClass
 
   uint8_t   bDeviceProtocol
 
   uint8_t   bMaxPacketSize0
 
   uint16_t   idVendor
 
   uint16_t   idProduct
 
   uint16_t   bcdDevice
 
   uint8_t   iManufacturer
 
   uint8_t   iProduct
 
   uint8_t   iSerialNumber
 
   uint8_t   bNumConfigurations
 
   uint8_t   maxRespTime
 
   Ipv4Addr   groupAddr
 
   uint16_t   hrd
 
   uint16_t   pro
 
   uint8_t   hln
 
   uint8_t   pln
 
   uint16_t   op
 
   MacAddr   sha
 
   Ipv4Addr   spa
 
   MacAddr   tha
 
   Ipv4Addr   tpa
 
   uint8_t   length
 
   uint8_t   value []
 
   uint16_t   first
 
   uint16_t   last
 
   uint16_t   next
 
   union {
      uint8_t   b [16]
 
      uint16_t   w [8]
 
      uint32_t   dw [4]
 
   } 
 
   uint16_t   maxRespDelay
 
   uint16_t   reserved
 
   Ipv6Addr   multicastAddr
 
   uint32_t   reserved
 
   uint16_t   pvid
 
   uint8_t   autoNegSupportStatus
 
   uint16_t   pmdAutoNegAdvCap
 
   uint16_t   operationalMauType
 
   uint16_t   capabilities
 
   uint8_t   deviceType
 
   uint8_t   lengthH: 1
 
   uint8_t   lengthL
 
   uint8_t   t: 1
 
   uint8_t   c: 1
 
   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
 
   } 
 
   uint16_t   transactionId
 
   uint16_t   protocolId
 
   uint8_t   unitId
 
   uint8_t   pdu []
 
   uint8_t   retain: 1
 
   uint8_t   qos: 2
 
   uint8_t   dup: 1
 
   union {
      uint8_t   all
 
      struct {
         uint8_t   topicIdType: 2
 
         uint8_t   cleanSession: 1
 
         uint8_t   will: 1
 
         uint8_t   retain: 1
 
         uint8_t   qos: 2
 
         uint8_t   dup: 1
 
      } 
 
   } 
 
   uint8_t   b: 1
 
   uint8_t   identifier
 
   uint8_t   valueSize
 
   Ipv4Addr   srcIpAddr
 
   Ipv4Addr   destIpAddr
 
   Eui64   interfaceId
 
   uint16_t   mru
 
   uint8_t   peerIdLength
 
   uint8_t   peerId []
 
   uint32_t   seconds
 
   uint32_t   fraction
 
   uint16_t   opcode
 
   char_t   filename []
 
   uint8_t   reserved: 3
 
   uint8_t   fin: 1
 
   uint8_t   payloadLen: 7
 
   uint8_t   mask: 1
 
   uint8_t   extPayloadLen []
 
   uint32_t   length
 
   uint8_t   payload []
 
   uint8_t   protocolVersionId
 
   uint8_t   bpduType
 
   StpBridgeId   rootId
 
   uint32_t   rootPathCost
 
   StpBridgeId   bridgeId
 
   uint16_t   portId
 
   uint16_t   messageAge
 
   uint16_t   maxAge
 
   uint16_t   helloTime
 
   uint16_t   forwardDelay
 
   uint8_t   version1Length
 
   uint16_t   priority
 
   MacAddr   addr
 
MibVariant
 Variant data type. More...
 
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...
 

Detailed Description

Common definitions for MIB modules.

License

SPDX-License-Identifier: GPL-2.0-or-later

Copyright (C) 2010-2023 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.2.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 223 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 215 of file mib_common.h.

◆ MibInit

typedef error_t(* MibInit) (void)

MIB initialization.

Definition at line 252 of file mib_common.h.

◆ MibLoad

typedef error_t(* MibLoad) (void *context)

Load MIB.

Definition at line 259 of file mib_common.h.

◆ MibLock

typedef void(* MibLock) (void)

Lock MIB.

Definition at line 273 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 207 of file mib_common.h.

◆ MibUnload

typedef void(* MibUnload) (void *context)

Unload MIB.

Definition at line 266 of file mib_common.h.

◆ MibUnlock

typedef void(* MibUnlock) (void)

Unlock MIB.

Definition at line 280 of file mib_common.h.

◆ MibVariant

typedef { ... } MibVariant

Variant data type.

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

◆ counter32

uint32_t counter32

Definition at line 188 of file mib_common.h.

◆ counter64

uint64_t counter64

Definition at line 192 of file mib_common.h.

◆ gauge32

uint32_t gauge32

Definition at line 189 of file mib_common.h.

◆ integer

int32_t integer

Definition at line 184 of file mib_common.h.

◆ ipAddr

uint8_t ipAddr[4]

Definition at line 187 of file mib_common.h.

◆ octetString

uint8_t octetString[1]

Definition at line 185 of file mib_common.h.

◆ oid

uint8_t oid[1]

Definition at line 186 of file mib_common.h.

◆ timeTicks

uint32_t timeTicks

Definition at line 191 of file mib_common.h.

◆ unsigned32

uint32_t unsigned32

Definition at line 190 of file mib_common.h.