ONLP
Open Network Linux Platform APIs
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables

Data Structures

struct  onlp_oid_hdr_s
 

Macros

#define ONLP_OID_TYPE_GET(_id)   ( ( (_id) >> 24) )
 
#define ONLP_OID_TYPE_CREATE(_type, _id)   ( ( (_type) << 24) | (_id))
 
#define ONLP_OID_IS_TYPE(_type, _id)   (ONLP_OID_TYPE_GET((_id)) == _type)
 
#define ONLP_OID_ID_GET(_id)   (_id & 0xFFFFFF)
 
#define ONLP_OID_TYPE_VALIDATE(_type, _oid)
 
#define ONLP_OID_TYPE_VALIDATE_NR(_type, _oid)
 
#define ONLP_OID_TYPE_VALIDATE_GET_ID(_type, _oid, _id)
 
#define ONLP_OID_TYPE_VALIDATE_GET_ID_NR(_type, _oid, _id)
 
#define ONLP_OID_IS_TYPE_FLAGS(_flags, _id)   ((_flags & (1 << ONLP_OID_TYPE_GET(_id))))
 
#define ONLP_OID_IS_TYPE_FLAGSZ(_flags, _id)   ((_flags == 0) || ONLP_OID_IS_TYPE_FLAGS(_flags, _id))
 
#define ONLP_CHASSIS_ID_CREATE(_id)   ONLP_OID_TYPE_CREATE(ONLP_OID_TYPE_CHASSIS, _id)
 
#define ONLP_THERMAL_ID_CREATE(_id)   ONLP_OID_TYPE_CREATE(ONLP_OID_TYPE_THERMAL, _id)
 
#define ONLP_FAN_ID_CREATE(_id)   ONLP_OID_TYPE_CREATE(ONLP_OID_TYPE_FAN, _id)
 
#define ONLP_PSU_ID_CREATE(_id)   ONLP_OID_TYPE_CREATE(ONLP_OID_TYPE_PSU, _id)
 
#define ONLP_LED_ID_CREATE(_id)   ONLP_OID_TYPE_CREATE(ONLP_OID_TYPE_LED, _id)
 
#define ONLP_SFP_ID_CREATE(_id)   ONLP_OID_TYPE_CREATE(ONLP_OID_TYPE_SFP, _id)
 
#define ONLP_MODULE_ID_CREATE(_id)   ONLP_OID_TYPE_CREATE(ONLP_OID_TYPE_MODULE, _id)
 
#define ONLP_GENERIC_ID_CREATE(_id)   ONLP_OID_TYPE_CREATE(ONLP_OID_TYPE_GENERIC, _id)
 
#define ONLP_OID_IS_CHASSIS(_id)   ONLP_OID_IS_TYPE(ONLP_OID_TYPE_CHASSIS, _id)
 
#define ONLP_OID_CHASSIS_VALIDATE(_id)   ONLP_OID_TYPE_VALIDATE(ONLP_OID_TYPE_CHASSIS, _id)
 
#define ONLP_OID_CHASSIS_VALIDATE_NR(_id)   ONLP_OID_TYPE_VALIDATE_NR(ONLP_OID_TYPE_CHASSIS, _id)
 
#define ONLP_OID_IS_THERMAL(_id)   ONLP_OID_IS_TYPE(ONLP_OID_TYPE_THERMAL, _id)
 
#define ONLP_OID_THERMAL_VALIDATE(_id)   ONLP_OID_TYPE_VALIDATE(ONLP_OID_TYPE_THERMAL, _id)
 
#define ONLP_OID_THERMAL_VALIDATE_NR(_id)   ONLP_OID_TYPE_VALIDATE_NR(ONLP_OID_TYPE_THERMAL, _id)
 
#define ONLP_OID_THERMAL_VALIDATE_GET_ID(_oid, _id)   ONLP_OID_TYPE_VALIDATE_GET_ID(ONLP_OID_TYPE_THERMAL, _oid, _id)
 
#define ONLP_OID_THERMAL_VALIDATE_GET_ID_NR(_oid, _id)   ONLP_OID_TYPE_VALIDATE_GET_ID_NR(ONLP_OID_TYPE_THERMAL, _oid, _id)
 
#define ONLP_OID_IS_FAN(_id)   ONLP_OID_IS_TYPE(ONLP_OID_TYPE_FAN, _id)
 
#define ONLP_OID_FAN_VALIDATE(_id)   ONLP_OID_TYPE_VALIDATE(ONLP_OID_TYPE_FAN, _id)
 
#define ONLP_OID_FAN_VALIDATE_NR(_id)   ONLP_OID_TYPE_VALIDATE_NR(ONLP_OID_TYPE_FAN, _id)
 
#define ONLP_OID_FAN_VALIDATE_GET_ID(_oid, _id)   ONLP_OID_TYPE_VALIDATE_GET_ID(ONLP_OID_TYPE_FAN, _oid, _id)
 
#define ONLP_OID_FAN_VALIDATE_GET_ID_NR(_oid, _id)   ONLP_OID_TYPE_VALIDATE_GET_ID_NR(ONLP_OID_TYPE_FAN, _oid, _id)
 
#define ONLP_OID_IS_PSU(_id)   ONLP_OID_IS_TYPE(ONLP_OID_TYPE_PSU, _id)
 
#define ONLP_OID_PSU_VALIDATE(_id)   ONLP_OID_TYPE_VALIDATE(ONLP_OID_TYPE_PSU, _id)
 
#define ONLP_OID_PSU_VALIDATE_NR(_id)   ONLP_OID_TYPE_VALIDATE_NR(ONLP_OID_TYPE_PSU, _id)
 
#define ONLP_OID_PSU_VALIDATE_GET_ID(_oid, _id)   ONLP_OID_TYPE_VALIDATE_GET_ID(ONLP_OID_TYPE_PSU, _oid, _id)
 
#define ONLP_OID_PSU_VALIDATE_GET_ID_NR(_oid, _id)   ONLP_OID_TYPE_VALIDATE_GET_ID_NR(ONLP_OID_TYPE_PSU, _oid, _id)
 
#define ONLP_OID_IS_LED(_id)   ONLP_OID_IS_TYPE(ONLP_OID_TYPE_LED, _id)
 
#define ONLP_OID_LED_VALIDATE(_id)   ONLP_OID_TYPE_VALIDATE(ONLP_OID_TYPE_LED, _id)
 
#define ONLP_OID_LED_VALIDATE_NR(_id)   ONLP_OID_TYPE_VALIDATE_NR(ONLP_OID_TYPE_LED, _id)
 
#define ONLP_OID_LED_VALIDATE_GET_ID(_oid, _id)   ONLP_OID_TYPE_VALIDATE_GET_ID(ONLP_OID_TYPE_LED, _oid, _id)
 
#define ONLP_OID_LED_VALIDATE_GET_ID_NR(_oid, _id)   ONLP_OID_TYPE_VALIDATE_GET_ID_NR(ONLP_OID_TYPE_LED, _oid, _id)
 
#define ONLP_OID_IS_SFP(_id)   ONLP_OID_IS_TYPE(ONLP_OID_TYPE_SFP, _id)
 
#define ONLP_OID_SFP_VALIDATE(_id)   ONLP_OID_TYPE_VALIDATE(ONLP_OID_TYPE_SFP, _id)
 
#define ONLP_OID_SFP_VALIDATE_NR(_id)   ONLP_OID_TYPE_VALIDATE_NR(ONLP_OID_TYPE_SFP, _id)
 
#define ONLP_OID_SFP_VALIDATE_GET_ID(_oid, _id)   ONLP_OID_TYPE_VALIDATE_GET_ID(ONLP_OID_TYPE_SFP, _oid, _id)
 
#define ONLP_OID_SFP_VALIDATE_GET_ID_NR(_oid, _id)   ONLP_OID_TYPE_VALIDATE_GET_ID_NR(ONLP_OID_TYPE_SFP, _oid, _id)
 
#define ONLP_OID_IS_MODULE(_id)   ONLP_OID_IS_TYPE(ONLP_OID_TYPE_MODULE, _id)
 
#define ONLP_OID_MODULE_VALIDATE(_id)   ONLP_OID_TYPE_VALIDATE(ONLP_OID_TYPE_MODULE, _id)
 
#define ONLP_OID_MODULE_VALIDATE_NR(_id)   ONLP_OID_TYPE_VALIDATE_NR(ONLP_OID_TYPE_MODULE, _id)
 
#define ONLP_OID_MODULE_VALIDATE_GET_ID(_oid, _id)   ONLP_OID_TYPE_VALIDATE_GET_ID(ONLP_OID_TYPE_MODULE, _oid, _id)
 
#define ONLP_OID_MODULE_VALIDATE_GET_ID_NR(_oid, _id)   ONLP_OID_TYPE_VALIDATE_GET_ID_NR(ONLP_OID_TYPE_MODULE, _oid, _id)
 
#define ONLP_OID_IS_GENERIC(_id)   ONLP_OID_IS_TYPE(ONLP_OID_TYPE_GENERIC, _id)
 
#define ONLP_OID_GENERIC_VALIDATE(_id)   ONLP_OID_TYPE_VALIDATE(ONLP_OID_TYPE_GENERIC, _id)
 
#define ONLP_OID_GENERIC_VALIDATE_NR(_id)   ONLP_OID_TYPE_VALIDATE_NR(ONLP_OID_TYPE_GENERIC, _id)
 
#define ONLP_OID_GENERIC_VALIDATE_GET_ID(_oid, _id)   ONLP_OID_TYPE_VALIDATE_GET_ID(ONLP_OID_TYPE_GENERIC, _oid, _id)
 
#define ONLP_OID_GENERIC_VALIDATE_GET_ID_NR(_oid, _id)   ONLP_OID_TYPE_VALIDATE_GET_ID_NR(ONLP_OID_TYPE_GENERIC, _oid, _id)
 
#define ONLP_OID_ID_VALIDATE_RANGE(_id, _min, _max)   ( (_id) >= (_min) && (_id) <= (_max)) ? ONLP_STATUS_OK : ONLP_STATUS_E_INVALID
 
#define ONLP_OID_CHASSIS   ONLP_OID_TYPE_CREATE(ONLP_OID_TYPE_CHASSIS, 1)
 
#define ONLP_OID_DESC_SIZE   128
 
#define ONLP_OID_TABLE_SIZE   256
 
#define ONLP_OID_TABLE_SIZE_BYTES   (sizeof(onlp_oid_t)*ONLP_OID_TABLE_SIZE)
 
#define ONLP_OID_TABLE_COPY(_dst, _src)   memcpy(_dst, _src, ONLP_OID_TABLE_SIZE_BYTES)
 
#define ONLP_OID_TABLE_CLEAR(_table)   memset(_table, 0, ONLP_OID_TABLE_SIZE_BYTES)
 
#define ONLP_OID_THERMAL_ENTRY(_id, _desc, _parent_type, _parent_id)   { ONLP_THERMAL_ID_CREATE(_id), _desc, ONLP_OID_TYPE_CREATE(_parent_type, _parent_id) }
 
#define ONLP_OID_STATUS_FLAGS_GET(_ptr)   (((onlp_oid_hdr_t*)_ptr)->status)
 
#define ONLP_OID_STATUS_FLAGS_CLR(_ptr)   ONLP_OID_STATUS_FLAGS_GET(_ptr) = 0
 
#define ONLP_OID_STATUS_FLAG_GET_VALUE(_ptr, _name)   AIM_FLAG_GET_VALUE(ONLP_OID_STATUS_FLAGS_GET(_ptr), ONLP_OID_STATUS_FLAG_##_name)
 
#define ONLP_OID_STATUS_FLAG_SET_VALUE(_ptr, _name, _value)   AIM_FLAG_SET_VALUE(ONLP_OID_STATUS_FLAGS_GET(_ptr), ONLP_OID_STATUS_FLAG_##_name, _value)
 
#define ONLP_OID_STATUS_FLAG_SET(_ptr, _name)   AIM_FLAG_SET(ONLP_OID_STATUS_FLAGS_GET(_ptr), ONLP_OID_STATUS_FLAG_##_name)
 
#define ONLP_OID_STATUS_FLAG_CLR(_ptr, _name)   AIM_FLAG_CLR(ONLP_OID_STATUS_FLAGS_GET(_ptr), ONLP_OID_STATUS_FLAG_##_name)
 
#define ONLP_OID_STATUS_FLAG_IS_SET(_ptr, _name)   AIM_FLAG_IS_SET(ONLP_OID_STATUS_FLAGS_GET(_ptr), ONLP_OID_STATUS_FLAG_##_name)
 
#define ONLP_OID_STATUS_FLAG_NOT_SET(_ptr, _name)   AIM_FLAG_NOT_SET(ONLP_OID_STATUS_FLAGS_GET(_ptr), ONLP_OID_STATUS_FLAG_##_name)
 
#define ONLP_OID_PRESENT(_ptr)   ONLP_OID_STATUS_FLAG_IS_SET(_ptr, PRESENT)
 
#define ONLP_OID_FAILED(_ptr)   ONLP_OID_STATUS_FLAG_IS_SET(_ptr, FAILED)
 
#define ONLP_OID_TABLE_ITER_EXPR(_table, _oidp, _expr)
 Iterate over all OIDS in the given table that match the given expression. More...
 
#define ONLP_OID_TABLE_ITER(_table, _oidp)   ONLP_OID_TABLE_ITER_EXPR(_table, _oidp, 1)
 Iterate over all OIDs in the given table. More...
 
#define ONLP_OID_TABLE_ITER_TYPE(_table, _oidp, _type)   ONLP_OID_TABLE_ITER_EXPR(_table, _oidp, ONLP_OID_IS_TYPE(ONLP_OID_TYPE_##_type, *_oidp))
 Iterate over all OIDs in the given table of the given type. More...
 
#define ONLP_OID_JSON_FLAG_VALID(_e)   (onlp_oid_json_flag_valid((_e)))
 
#define ONLP_OID_STATUS_FLAG_VALID(_e)   (onlp_oid_status_flag_valid((_e)))
 
#define ONLP_OID_TYPE_VALID(_e)   (onlp_oid_type_valid((_e)))
 
#define ONLP_OID_TYPE_FLAG_VALID(_e)   (onlp_oid_type_flag_valid((_e)))
 

Typedefs

typedef uint32_t onlp_oid_t
 
typedef uint32_t onlp_oid_id_t
 
typedef enum onlp_oid_json_flag_e onlp_oid_json_flag_t
 
typedef enum onlp_oid_status_flag_e onlp_oid_status_flag_t
 
typedef enum onlp_oid_type_e onlp_oid_type_t
 
typedef enum onlp_oid_type_flag_e onlp_oid_type_flag_t
 
typedef uint32_t onlp_oid_type_flags_t
 
typedef uint32_t onlp_oid_status_flags_t
 
typedef char onlp_oid_desc_t[ONLP_OID_DESC_SIZE]
 
typedef onlp_oid_t onlp_oid_table_t[ONLP_OID_TABLE_SIZE]
 
typedef struct onlp_oid_hdr_s onlp_oid_hdr_t
 
typedef int(* onlp_oid_iterate_f) (onlp_oid_t oid, void *cookie)
 

Enumerations

enum  onlp_oid_json_flag_e {
  ONLP_OID_JSON_FLAG_RECURSIVE = (1 << 0),
  ONLP_OID_JSON_FLAG_UNSUPPORTED_FIELDS = (1 << 1),
  ONLP_OID_JSON_FLAG_TO_USER_JSON = (1 << 2)
}
 
enum  onlp_oid_status_flag_e {
  ONLP_OID_STATUS_FLAG_PRESENT = (1 << 0),
  ONLP_OID_STATUS_FLAG_FAILED = (1 << 1),
  ONLP_OID_STATUS_FLAG_OPERATIONAL = (1 << 2),
  ONLP_OID_STATUS_FLAG_UNPLUGGED = (1 << 3)
}
 
enum  onlp_oid_type_e {
  ONLP_OID_TYPE_CHASSIS = 1,
  ONLP_OID_TYPE_MODULE = 2,
  ONLP_OID_TYPE_THERMAL = 3,
  ONLP_OID_TYPE_FAN = 4,
  ONLP_OID_TYPE_PSU = 5,
  ONLP_OID_TYPE_LED = 6,
  ONLP_OID_TYPE_SFP = 7,
  ONLP_OID_TYPE_GENERIC = 8
}
 
enum  onlp_oid_type_flag_e {
  ONLP_OID_TYPE_FLAG_CHASSIS = (1 << 1),
  ONLP_OID_TYPE_FLAG_MODULE = (1 << 2),
  ONLP_OID_TYPE_FLAG_THERMAL = (1 << 3),
  ONLP_OID_TYPE_FLAG_FAN = (1 << 4),
  ONLP_OID_TYPE_FLAG_PSU = (1 << 5),
  ONLP_OID_TYPE_FLAG_LED = (1 << 6),
  ONLP_OID_TYPE_FLAG_SFP = (1 << 7),
  ONLP_OID_TYPE_FLAG_GENERIC = (1 << 8)
}
 

Functions

int onlp_oid_hdr_get (onlp_oid_t oid, onlp_oid_hdr_t *hdr)
 Get the OID header for a given OID. More...
 
int onlp_oid_info_get (onlp_oid_t oid, onlp_oid_hdr_t **info)
 Get the information structure for a given OID. More...
 
int onlp_oid_iterate (onlp_oid_t root, onlp_oid_type_flags_t types, onlp_oid_iterate_f itf, void *cookie)
 Iterate over all platform OIDs. More...
 
int onlp_oid_info_get_all (onlp_oid_t root, onlp_oid_type_flags_t types, uint32_t flags, biglist_t **list)
 Iterate over all given OID types and return their info structures. More...
 
int onlp_oid_hdr_get_all (onlp_oid_t root, onlp_oid_type_flags_t types, uint32_t flags, biglist_t **list)
 Iterate over all given OID types and return their hdr structures. More...
 
int onlp_oid_get_all_free (biglist_t *list)
 Free a list returned by onlp_oid_info_get_all() or onlp_oid_hdr_get_all() More...
 
int onlp_oid_is_present (onlp_oid_t *oid)
 Return whether an OID is present or not.
 
int onlp_oid_to_str (onlp_oid_t oid, char *rstr)
 
int onlp_oid_to_user_str (onlp_oid_t oid, char *rstr)
 
int onlp_oid_from_str (char *str, onlp_oid_t *roid)
 String Represenation -> OID.
 
int onlp_oid_table_to_json (onlp_oid_table_t table, cJSON **cjp)
 OID Table -> JSON. More...
 
int onlp_oid_table_from_json (cJSON *cj, onlp_oid_table_t table)
 JSON -> OID Table. More...
 
int onlp_oid_hdr_to_json (onlp_oid_hdr_t *hdr, cJSON **cj, uint32_t flags)
 OID Header -> JSON. More...
 
int onlp_oid_hdr_from_json (cJSON *cj, onlp_oid_hdr_t *hdr)
 JSON -> OID Header. More...
 
int onlp_oid_info_to_json (onlp_oid_hdr_t *info, cJSON **cj, uint32_t flags)
 OID Info Structure -> JSON. More...
 
int onlp_oid_to_user_json (onlp_oid_t oid, cJSON **rv, uint32_t flags)
 OID -> JSON. More...
 
int onlp_oid_to_json (onlp_oid_t oid, cJSON **rv, uint32_t flags)
 OID -> User JSON. More...
 
int onlp_oid_from_json (cJSON *cj, onlp_oid_hdr_t **hdr, biglist_t **all, uint32_t flags)
 JSON -> OID Information structures. More...
 
int onlp_oid_json_verify (onlp_oid_t oid)
 
const char * onlp_oid_json_flag_name (onlp_oid_json_flag_t e)
 
int onlp_oid_json_flag_value (const char *str, onlp_oid_json_flag_t *e, int substr)
 
const char * onlp_oid_json_flag_desc (onlp_oid_json_flag_t e)
 
int onlp_oid_json_flag_valid (onlp_oid_json_flag_t e)
 
const char * onlp_oid_status_flag_name (onlp_oid_status_flag_t e)
 
int onlp_oid_status_flag_value (const char *str, onlp_oid_status_flag_t *e, int substr)
 
const char * onlp_oid_status_flag_desc (onlp_oid_status_flag_t e)
 
int onlp_oid_status_flag_valid (onlp_oid_status_flag_t e)
 
const char * onlp_oid_type_name (onlp_oid_type_t e)
 
int onlp_oid_type_value (const char *str, onlp_oid_type_t *e, int substr)
 
const char * onlp_oid_type_desc (onlp_oid_type_t e)
 
int onlp_oid_type_valid (onlp_oid_type_t e)
 
const char * onlp_oid_type_flag_name (onlp_oid_type_flag_t e)
 
int onlp_oid_type_flag_value (const char *str, onlp_oid_type_flag_t *e, int substr)
 
const char * onlp_oid_type_flag_desc (onlp_oid_type_flag_t e)
 
int onlp_oid_type_flag_valid (onlp_oid_type_flag_t e)
 

Variables

aim_map_si_t onlp_oid_json_flag_map []
 
aim_map_si_t onlp_oid_json_flag_desc_map []
 
aim_map_si_t onlp_oid_status_flag_map []
 
aim_map_si_t onlp_oid_status_flag_desc_map []
 
aim_map_si_t onlp_oid_type_map []
 
aim_map_si_t onlp_oid_type_desc_map []
 
aim_map_si_t onlp_oid_type_flag_map []
 
aim_map_si_t onlp_oid_type_flag_desc_map []
 

Detailed Description

Macro Definition Documentation

◆ ONLP_CHASSIS_ID_CREATE

#define ONLP_CHASSIS_ID_CREATE (   _id)    ONLP_OID_TYPE_CREATE(ONLP_OID_TYPE_CHASSIS, _id)

Create a Chassis OID

◆ ONLP_FAN_ID_CREATE

#define ONLP_FAN_ID_CREATE (   _id)    ONLP_OID_TYPE_CREATE(ONLP_OID_TYPE_FAN, _id)

Create a Fan OID

◆ ONLP_GENERIC_ID_CREATE

#define ONLP_GENERIC_ID_CREATE (   _id)    ONLP_OID_TYPE_CREATE(ONLP_OID_TYPE_GENERIC, _id)

Create a Generic OID

◆ ONLP_LED_ID_CREATE

#define ONLP_LED_ID_CREATE (   _id)    ONLP_OID_TYPE_CREATE(ONLP_OID_TYPE_LED, _id)

Create an LED OID

◆ ONLP_MODULE_ID_CREATE

#define ONLP_MODULE_ID_CREATE (   _id)    ONLP_OID_TYPE_CREATE(ONLP_OID_TYPE_MODULE, _id)

Create a Module OID

◆ ONLP_OID_CHASSIS

#define ONLP_OID_CHASSIS   ONLP_OID_TYPE_CREATE(ONLP_OID_TYPE_CHASSIS, 1)

There is only one Chassis OID. This value should be used.

◆ ONLP_OID_CHASSIS_VALIDATE

#define ONLP_OID_CHASSIS_VALIDATE (   _id)    ONLP_OID_TYPE_VALIDATE(ONLP_OID_TYPE_CHASSIS, _id)

Validate that the given OID is a Chassis

◆ ONLP_OID_CHASSIS_VALIDATE_NR

#define ONLP_OID_CHASSIS_VALIDATE_NR (   _id)    ONLP_OID_TYPE_VALIDATE_NR(ONLP_OID_TYPE_CHASSIS, _id)

Validate that the given OID is a Chassis

◆ ONLP_OID_DESC_SIZE

#define ONLP_OID_DESC_SIZE   128

All OIDs have user-level description strings:

◆ ONLP_OID_FAILED

#define ONLP_OID_FAILED (   _ptr)    ONLP_OID_STATUS_FLAG_IS_SET(_ptr, FAILED)

Shortcut - OID has failed.

◆ ONLP_OID_FAN_VALIDATE

#define ONLP_OID_FAN_VALIDATE (   _id)    ONLP_OID_TYPE_VALIDATE(ONLP_OID_TYPE_FAN, _id)

Validate that the given OID is a Fan

◆ ONLP_OID_FAN_VALIDATE_GET_ID

#define ONLP_OID_FAN_VALIDATE_GET_ID (   _oid,
  _id 
)    ONLP_OID_TYPE_VALIDATE_GET_ID(ONLP_OID_TYPE_FAN, _oid, _id)

Validate and retrieve a Fan ID

◆ ONLP_OID_FAN_VALIDATE_GET_ID_NR

#define ONLP_OID_FAN_VALIDATE_GET_ID_NR (   _oid,
  _id 
)    ONLP_OID_TYPE_VALIDATE_GET_ID_NR(ONLP_OID_TYPE_FAN, _oid, _id)

Validate and retrieve a Fan ID

◆ ONLP_OID_FAN_VALIDATE_NR

#define ONLP_OID_FAN_VALIDATE_NR (   _id)    ONLP_OID_TYPE_VALIDATE_NR(ONLP_OID_TYPE_FAN, _id)

Validate that the given OID is a Fan

◆ ONLP_OID_GENERIC_VALIDATE

#define ONLP_OID_GENERIC_VALIDATE (   _id)    ONLP_OID_TYPE_VALIDATE(ONLP_OID_TYPE_GENERIC, _id)

Validate that the given OID is a Generic

◆ ONLP_OID_GENERIC_VALIDATE_GET_ID

#define ONLP_OID_GENERIC_VALIDATE_GET_ID (   _oid,
  _id 
)    ONLP_OID_TYPE_VALIDATE_GET_ID(ONLP_OID_TYPE_GENERIC, _oid, _id)

Validate and retrieve a Generic ID

◆ ONLP_OID_GENERIC_VALIDATE_GET_ID_NR

#define ONLP_OID_GENERIC_VALIDATE_GET_ID_NR (   _oid,
  _id 
)    ONLP_OID_TYPE_VALIDATE_GET_ID_NR(ONLP_OID_TYPE_GENERIC, _oid, _id)

Validate and retrieve a Generic ID

◆ ONLP_OID_GENERIC_VALIDATE_NR

#define ONLP_OID_GENERIC_VALIDATE_NR (   _id)    ONLP_OID_TYPE_VALIDATE_NR(ONLP_OID_TYPE_GENERIC, _id)

Validate that the given OID is a Generic

◆ ONLP_OID_ID_GET

#define ONLP_OID_ID_GET (   _id)    (_id & 0xFFFFFF)

Get the ID from an OID

◆ ONLP_OID_ID_VALIDATE_RANGE

#define ONLP_OID_ID_VALIDATE_RANGE (   _id,
  _min,
  _max 
)    ( (_id) >= (_min) && (_id) <= (_max)) ? ONLP_STATUS_OK : ONLP_STATUS_E_INVALID

Validate an ID is within a given range.

◆ ONLP_OID_IS_CHASSIS

#define ONLP_OID_IS_CHASSIS (   _id)    ONLP_OID_IS_TYPE(ONLP_OID_TYPE_CHASSIS, _id)

Is the given OID a Chassis ?

◆ ONLP_OID_IS_FAN

#define ONLP_OID_IS_FAN (   _id)    ONLP_OID_IS_TYPE(ONLP_OID_TYPE_FAN, _id)

Is the given OID a Fan?

◆ ONLP_OID_IS_GENERIC

#define ONLP_OID_IS_GENERIC (   _id)    ONLP_OID_IS_TYPE(ONLP_OID_TYPE_GENERIC, _id)

Is the given OID a Generic?

◆ ONLP_OID_IS_LED

#define ONLP_OID_IS_LED (   _id)    ONLP_OID_IS_TYPE(ONLP_OID_TYPE_LED, _id)

Is the given OID an LED?

◆ ONLP_OID_IS_MODULE

#define ONLP_OID_IS_MODULE (   _id)    ONLP_OID_IS_TYPE(ONLP_OID_TYPE_MODULE, _id)

Is the given OID a Module?

◆ ONLP_OID_IS_PSU

#define ONLP_OID_IS_PSU (   _id)    ONLP_OID_IS_TYPE(ONLP_OID_TYPE_PSU, _id)

Is the given OID a PSU?

◆ ONLP_OID_IS_SFP

#define ONLP_OID_IS_SFP (   _id)    ONLP_OID_IS_TYPE(ONLP_OID_TYPE_SFP, _id)

Is the given OID an SFP?

◆ ONLP_OID_IS_THERMAL

#define ONLP_OID_IS_THERMAL (   _id)    ONLP_OID_IS_TYPE(ONLP_OID_TYPE_THERMAL, _id)

Is the given OID a Thermal?

◆ ONLP_OID_IS_TYPE

#define ONLP_OID_IS_TYPE (   _type,
  _id 
)    (ONLP_OID_TYPE_GET((_id)) == _type)

Determine if an OID is of the given type

◆ ONLP_OID_IS_TYPE_FLAGS

#define ONLP_OID_IS_TYPE_FLAGS (   _flags,
  _id 
)    ((_flags & (1 << ONLP_OID_TYPE_GET(_id))))

Is the OID type present in the flag bitmap?

◆ ONLP_OID_IS_TYPE_FLAGSZ

#define ONLP_OID_IS_TYPE_FLAGSZ (   _flags,
  _id 
)    ((_flags == 0) || ONLP_OID_IS_TYPE_FLAGS(_flags, _id))

Is the OID type present in the flag bitmap or are the flags zero?

◆ ONLP_OID_JSON_FLAG_VALID

#define ONLP_OID_JSON_FLAG_VALID (   _e)    (onlp_oid_json_flag_valid((_e)))

validator

◆ ONLP_OID_LED_VALIDATE

#define ONLP_OID_LED_VALIDATE (   _id)    ONLP_OID_TYPE_VALIDATE(ONLP_OID_TYPE_LED, _id)

Validate that the given OID is an LED

◆ ONLP_OID_LED_VALIDATE_GET_ID

#define ONLP_OID_LED_VALIDATE_GET_ID (   _oid,
  _id 
)    ONLP_OID_TYPE_VALIDATE_GET_ID(ONLP_OID_TYPE_LED, _oid, _id)

Validate and retrieve an LED ID

◆ ONLP_OID_LED_VALIDATE_GET_ID_NR

#define ONLP_OID_LED_VALIDATE_GET_ID_NR (   _oid,
  _id 
)    ONLP_OID_TYPE_VALIDATE_GET_ID_NR(ONLP_OID_TYPE_LED, _oid, _id)

Validate and retrieve an LED ID

◆ ONLP_OID_LED_VALIDATE_NR

#define ONLP_OID_LED_VALIDATE_NR (   _id)    ONLP_OID_TYPE_VALIDATE_NR(ONLP_OID_TYPE_LED, _id)

Validate that the given OID is an LED

◆ ONLP_OID_MODULE_VALIDATE

#define ONLP_OID_MODULE_VALIDATE (   _id)    ONLP_OID_TYPE_VALIDATE(ONLP_OID_TYPE_MODULE, _id)

Validate that the given OID is a Module

◆ ONLP_OID_MODULE_VALIDATE_GET_ID

#define ONLP_OID_MODULE_VALIDATE_GET_ID (   _oid,
  _id 
)    ONLP_OID_TYPE_VALIDATE_GET_ID(ONLP_OID_TYPE_MODULE, _oid, _id)

Validate and retrieve a Module ID

◆ ONLP_OID_MODULE_VALIDATE_GET_ID_NR

#define ONLP_OID_MODULE_VALIDATE_GET_ID_NR (   _oid,
  _id 
)    ONLP_OID_TYPE_VALIDATE_GET_ID_NR(ONLP_OID_TYPE_MODULE, _oid, _id)

Validate and retrieve a Module ID

◆ ONLP_OID_MODULE_VALIDATE_NR

#define ONLP_OID_MODULE_VALIDATE_NR (   _id)    ONLP_OID_TYPE_VALIDATE_NR(ONLP_OID_TYPE_MODULE, _id)

Validate that the given OID is a Module

◆ ONLP_OID_PRESENT

#define ONLP_OID_PRESENT (   _ptr)    ONLP_OID_STATUS_FLAG_IS_SET(_ptr, PRESENT)

Shortcut - OID is present.

◆ ONLP_OID_PSU_VALIDATE

#define ONLP_OID_PSU_VALIDATE (   _id)    ONLP_OID_TYPE_VALIDATE(ONLP_OID_TYPE_PSU, _id)

Validate that the given OID is a PSU

◆ ONLP_OID_PSU_VALIDATE_GET_ID

#define ONLP_OID_PSU_VALIDATE_GET_ID (   _oid,
  _id 
)    ONLP_OID_TYPE_VALIDATE_GET_ID(ONLP_OID_TYPE_PSU, _oid, _id)

Validate and retrieve a PSU ID

◆ ONLP_OID_PSU_VALIDATE_GET_ID_NR

#define ONLP_OID_PSU_VALIDATE_GET_ID_NR (   _oid,
  _id 
)    ONLP_OID_TYPE_VALIDATE_GET_ID_NR(ONLP_OID_TYPE_PSU, _oid, _id)

Validate and retrieve a PSU ID

◆ ONLP_OID_PSU_VALIDATE_NR

#define ONLP_OID_PSU_VALIDATE_NR (   _id)    ONLP_OID_TYPE_VALIDATE_NR(ONLP_OID_TYPE_PSU, _id)

Validate that the given OID is a PSU

◆ ONLP_OID_SFP_VALIDATE

#define ONLP_OID_SFP_VALIDATE (   _id)    ONLP_OID_TYPE_VALIDATE(ONLP_OID_TYPE_SFP, _id)

Validate that the given OID is an SFP

◆ ONLP_OID_SFP_VALIDATE_GET_ID

#define ONLP_OID_SFP_VALIDATE_GET_ID (   _oid,
  _id 
)    ONLP_OID_TYPE_VALIDATE_GET_ID(ONLP_OID_TYPE_SFP, _oid, _id)

Validate and retrieve a SFP ID

◆ ONLP_OID_SFP_VALIDATE_GET_ID_NR

#define ONLP_OID_SFP_VALIDATE_GET_ID_NR (   _oid,
  _id 
)    ONLP_OID_TYPE_VALIDATE_GET_ID_NR(ONLP_OID_TYPE_SFP, _oid, _id)

Validate and retrieve a SFP ID

◆ ONLP_OID_SFP_VALIDATE_NR

#define ONLP_OID_SFP_VALIDATE_NR (   _id)    ONLP_OID_TYPE_VALIDATE_NR(ONLP_OID_TYPE_SFP, _id)

Validate that the given OID is an SFP

◆ ONLP_OID_STATUS_FLAG_CLR

#define ONLP_OID_STATUS_FLAG_CLR (   _ptr,
  _name 
)    AIM_FLAG_CLR(ONLP_OID_STATUS_FLAGS_GET(_ptr), ONLP_OID_STATUS_FLAG_##_name)

Clear a given flag.

◆ ONLP_OID_STATUS_FLAG_GET_VALUE

#define ONLP_OID_STATUS_FLAG_GET_VALUE (   _ptr,
  _name 
)    AIM_FLAG_GET_VALUE(ONLP_OID_STATUS_FLAGS_GET(_ptr), ONLP_OID_STATUS_FLAG_##_name)

Get the value of a given flag.

◆ ONLP_OID_STATUS_FLAG_IS_SET

#define ONLP_OID_STATUS_FLAG_IS_SET (   _ptr,
  _name 
)    AIM_FLAG_IS_SET(ONLP_OID_STATUS_FLAGS_GET(_ptr), ONLP_OID_STATUS_FLAG_##_name)

Determine if a flag is set.

◆ ONLP_OID_STATUS_FLAG_NOT_SET

#define ONLP_OID_STATUS_FLAG_NOT_SET (   _ptr,
  _name 
)    AIM_FLAG_NOT_SET(ONLP_OID_STATUS_FLAGS_GET(_ptr), ONLP_OID_STATUS_FLAG_##_name)

Determine if a flag is cleared.

◆ ONLP_OID_STATUS_FLAG_SET

#define ONLP_OID_STATUS_FLAG_SET (   _ptr,
  _name 
)    AIM_FLAG_SET(ONLP_OID_STATUS_FLAGS_GET(_ptr), ONLP_OID_STATUS_FLAG_##_name)

Set a given flag.

◆ ONLP_OID_STATUS_FLAG_SET_VALUE

#define ONLP_OID_STATUS_FLAG_SET_VALUE (   _ptr,
  _name,
  _value 
)    AIM_FLAG_SET_VALUE(ONLP_OID_STATUS_FLAGS_GET(_ptr), ONLP_OID_STATUS_FLAG_##_name, _value)

Set the value of a given flag.

◆ ONLP_OID_STATUS_FLAG_VALID

#define ONLP_OID_STATUS_FLAG_VALID (   _e)    (onlp_oid_status_flag_valid((_e)))

validator

◆ ONLP_OID_STATUS_FLAGS_CLR

#define ONLP_OID_STATUS_FLAGS_CLR (   _ptr)    ONLP_OID_STATUS_FLAGS_GET(_ptr) = 0

Clear all status flags

◆ ONLP_OID_STATUS_FLAGS_GET

#define ONLP_OID_STATUS_FLAGS_GET (   _ptr)    (((onlp_oid_hdr_t*)_ptr)->status)

Manipulating OID Status Flags

◆ ONLP_OID_TABLE_CLEAR

#define ONLP_OID_TABLE_CLEAR (   _table)    memset(_table, 0, ONLP_OID_TABLE_SIZE_BYTES)

Clear an OID table.

◆ ONLP_OID_TABLE_COPY

#define ONLP_OID_TABLE_COPY (   _dst,
  _src 
)    memcpy(_dst, _src, ONLP_OID_TABLE_SIZE_BYTES)

Copy an OID table.

◆ ONLP_OID_TABLE_ITER

#define ONLP_OID_TABLE_ITER (   _table,
  _oidp 
)    ONLP_OID_TABLE_ITER_EXPR(_table, _oidp, 1)

Iterate over all OIDs in the given table.

Parameters
_tableThe OID table
_oidpOID pointer iterator

◆ ONLP_OID_TABLE_ITER_EXPR

#define ONLP_OID_TABLE_ITER_EXPR (   _table,
  _oidp,
  _expr 
)
Value:
for(_oidp = _table; _oidp < (_table+ONLP_OID_TABLE_SIZE); _oidp++) \
if( (*_oidp) && (_expr) )
#define ONLP_OID_TABLE_SIZE
Definition: oids.h:271

Iterate over all OIDS in the given table that match the given expression.

Parameters
_tableThe OID table
_oidpOID pointer iterator
_exprOID Expression which must be true

◆ ONLP_OID_TABLE_ITER_TYPE

#define ONLP_OID_TABLE_ITER_TYPE (   _table,
  _oidp,
  _type 
)    ONLP_OID_TABLE_ITER_EXPR(_table, _oidp, ONLP_OID_IS_TYPE(ONLP_OID_TYPE_##_type, *_oidp))

Iterate over all OIDs in the given table of the given type.

Parameters
_tableThe OID table
_oidpOID pointer iteration.
_typeThe OID Type

◆ ONLP_OID_TABLE_SIZE

#define ONLP_OID_TABLE_SIZE   256

The maximum OID child table size

◆ ONLP_OID_TABLE_SIZE_BYTES

#define ONLP_OID_TABLE_SIZE_BYTES   (sizeof(onlp_oid_t)*ONLP_OID_TABLE_SIZE)

The size of the current OID table

◆ ONLP_OID_THERMAL_ENTRY

#define ONLP_OID_THERMAL_ENTRY (   _id,
  _desc,
  _parent_type,
  _parent_id 
)    { ONLP_THERMAL_ID_CREATE(_id), _desc, ONLP_OID_TYPE_CREATE(_parent_type, _parent_id) }

This macro can be used to construct your OID hdr tables

◆ ONLP_OID_THERMAL_VALIDATE

#define ONLP_OID_THERMAL_VALIDATE (   _id)    ONLP_OID_TYPE_VALIDATE(ONLP_OID_TYPE_THERMAL, _id)

Validate that the given OID is a Thermal

◆ ONLP_OID_THERMAL_VALIDATE_GET_ID

#define ONLP_OID_THERMAL_VALIDATE_GET_ID (   _oid,
  _id 
)    ONLP_OID_TYPE_VALIDATE_GET_ID(ONLP_OID_TYPE_THERMAL, _oid, _id)

Validate and retrieve a Thermal ID

◆ ONLP_OID_THERMAL_VALIDATE_GET_ID_NR

#define ONLP_OID_THERMAL_VALIDATE_GET_ID_NR (   _oid,
  _id 
)    ONLP_OID_TYPE_VALIDATE_GET_ID_NR(ONLP_OID_TYPE_THERMAL, _oid, _id)

Validate and retrieve a Thermal ID

◆ ONLP_OID_THERMAL_VALIDATE_NR

#define ONLP_OID_THERMAL_VALIDATE_NR (   _id)    ONLP_OID_TYPE_VALIDATE_NR(ONLP_OID_TYPE_THERMAL, _id)

Validate that the given OID is a Thermal

◆ ONLP_OID_TYPE_CREATE

#define ONLP_OID_TYPE_CREATE (   _type,
  _id 
)    ( ( (_type) << 24) | (_id))

Create an OID of the given type

◆ ONLP_OID_TYPE_FLAG_VALID

#define ONLP_OID_TYPE_FLAG_VALID (   _e)    (onlp_oid_type_flag_valid((_e)))

validator

◆ ONLP_OID_TYPE_GET

#define ONLP_OID_TYPE_GET (   _id)    ( ( (_id) >> 24) )

Get the type from an OID

◆ ONLP_OID_TYPE_VALID

#define ONLP_OID_TYPE_VALID (   _e)    (onlp_oid_type_valid((_e)))

validator

◆ ONLP_OID_TYPE_VALIDATE

#define ONLP_OID_TYPE_VALIDATE (   _type,
  _oid 
)
Value:
do { \
if(!ONLP_OID_IS_TYPE(_type, _oid)) { \
return ONLP_STATUS_E_PARAM; \
} \
} while(0)
#define ONLP_OID_IS_TYPE(_type, _id)
Definition: oids.h:113

Return an error if the given OID is not of the given type

◆ ONLP_OID_TYPE_VALIDATE_GET_ID

#define ONLP_OID_TYPE_VALIDATE_GET_ID (   _type,
  _oid,
  _id 
)
Value:
do { \
ONLP_OID_TYPE_VALIDATE(_type, _oid); \
_id = ONLP_OID_ID_GET(_oid); \
} while(0)
#define ONLP_OID_ID_GET(_id)
Definition: oids.h:115

Validate that the given OID is of the given type and retreive the ID

◆ ONLP_OID_TYPE_VALIDATE_GET_ID_NR

#define ONLP_OID_TYPE_VALIDATE_GET_ID_NR (   _type,
  _oid,
  _id 
)
Value:
do { \
ONLP_OID_TYPE_VALIDATE_NR(_type, _oid); \
_id = ONLP_OID_ID_GET(_oid); \
}
#define ONLP_OID_ID_GET(_id)
Definition: oids.h:115

Validate that the given OID is of the given type and retreive the ID

◆ ONLP_OID_TYPE_VALIDATE_NR

#define ONLP_OID_TYPE_VALIDATE_NR (   _type,
  _oid 
)
Value:
do { \
if(!ONLP_OID_IS_TYPE(_type, _oid)) { \
return; \
} \
} while(0)
#define ONLP_OID_IS_TYPE(_type, _id)
Definition: oids.h:113

Return if the given OID is not of the given type

◆ ONLP_PSU_ID_CREATE

#define ONLP_PSU_ID_CREATE (   _id)    ONLP_OID_TYPE_CREATE(ONLP_OID_TYPE_PSU, _id)

Create a PSU OID

◆ ONLP_SFP_ID_CREATE

#define ONLP_SFP_ID_CREATE (   _id)    ONLP_OID_TYPE_CREATE(ONLP_OID_TYPE_SFP, _id)

Create an SFP OID

◆ ONLP_THERMAL_ID_CREATE

#define ONLP_THERMAL_ID_CREATE (   _id)    ONLP_OID_TYPE_CREATE(ONLP_OID_TYPE_THERMAL, _id)

Create a Thermal OID

Typedef Documentation

◆ onlp_oid_desc_t

typedef char onlp_oid_desc_t[ONLP_OID_DESC_SIZE]

OID description array.

◆ onlp_oid_hdr_t

All OID objects contain this header as the first member.

◆ onlp_oid_id_t

typedef uint32_t onlp_oid_id_t

The object id value

◆ onlp_oid_iterate_f

typedef int(* onlp_oid_iterate_f) (onlp_oid_t oid, void *cookie)

Iterator

◆ onlp_oid_json_flag_t

onlp_oid_json_flag

◆ onlp_oid_status_flag_t

onlp_oid_status_flag

◆ onlp_oid_status_flags_t

typedef uint32_t onlp_oid_status_flags_t

Represents a set of oid_status_flags;

◆ onlp_oid_t

typedef uint32_t onlp_oid_t

System peripherals are identified by a 32bit OID.

The First byte is the object-class identifier: Thermal sensor object Fan object PSU object LED object MODULE object etc.. The remaining bytes are the object id.

◆ onlp_oid_table_t

typedef onlp_oid_t onlp_oid_table_t[ONLP_OID_TABLE_SIZE]

A table of OIDs

◆ onlp_oid_type_flag_t

onlp_oid_type_flag

◆ onlp_oid_type_flags_t

typedef uint32_t onlp_oid_type_flags_t

Represents a set of oid_type_flags.

◆ onlp_oid_type_t

onlp_oid_type

Enumeration Type Documentation

◆ onlp_oid_json_flag_e

onlp_oid_json_flag

59  {
60  ONLP_OID_JSON_FLAG_RECURSIVE = (1 << 0),
61  ONLP_OID_JSON_FLAG_UNSUPPORTED_FIELDS = (1 << 1),
62  ONLP_OID_JSON_FLAG_TO_USER_JSON = (1 << 2),
enum onlp_oid_json_flag_e onlp_oid_json_flag_t

◆ onlp_oid_status_flag_e

onlp_oid_status_flag

66  {
67  ONLP_OID_STATUS_FLAG_PRESENT = (1 << 0),
68  ONLP_OID_STATUS_FLAG_FAILED = (1 << 1),
69  ONLP_OID_STATUS_FLAG_OPERATIONAL = (1 << 2),
70  ONLP_OID_STATUS_FLAG_UNPLUGGED = (1 << 3),
enum onlp_oid_status_flag_e onlp_oid_status_flag_t

◆ onlp_oid_type_e

onlp_oid_type

74  {
75  ONLP_OID_TYPE_CHASSIS = 1,
76  ONLP_OID_TYPE_MODULE = 2,
77  ONLP_OID_TYPE_THERMAL = 3,
78  ONLP_OID_TYPE_FAN = 4,
79  ONLP_OID_TYPE_PSU = 5,
80  ONLP_OID_TYPE_LED = 6,
81  ONLP_OID_TYPE_SFP = 7,
82  ONLP_OID_TYPE_GENERIC = 8,
enum onlp_oid_type_e onlp_oid_type_t

◆ onlp_oid_type_flag_e

onlp_oid_type_flag

86  {
87  ONLP_OID_TYPE_FLAG_CHASSIS = (1 << 1),
88  ONLP_OID_TYPE_FLAG_MODULE = (1 << 2),
89  ONLP_OID_TYPE_FLAG_THERMAL = (1 << 3),
90  ONLP_OID_TYPE_FLAG_FAN = (1 << 4),
91  ONLP_OID_TYPE_FLAG_PSU = (1 << 5),
92  ONLP_OID_TYPE_FLAG_LED = (1 << 6),
93  ONLP_OID_TYPE_FLAG_SFP = (1 << 7),
94  ONLP_OID_TYPE_FLAG_GENERIC = (1 << 8),
enum onlp_oid_type_flag_e onlp_oid_type_flag_t

Function Documentation

◆ onlp_oid_from_json()

int onlp_oid_from_json ( cJSON *  cj,
onlp_oid_hdr_t **  hdr,
biglist_t **  all,
uint32_t  flags 
)

JSON -> OID Information structures.

Parameters
cjThe source JSON structure.
[out]hdrReceives the information structure.
[out]allReceives a list of all structures if not NULL and the JSON contains multiple objects.
flagsThe JSON flags.

◆ onlp_oid_get_all_free()

int onlp_oid_get_all_free ( biglist_t *  list)

Free a list returned by onlp_oid_info_get_all() or onlp_oid_hdr_get_all()

Parameters
listThe list to free.

◆ onlp_oid_hdr_from_json()

int onlp_oid_hdr_from_json ( cJSON *  cj,
onlp_oid_hdr_t hdr 
)

JSON -> OID Header.

Parameters
cjThe source json
[out]hdrreceives the header.

◆ onlp_oid_hdr_get()

int onlp_oid_hdr_get ( onlp_oid_t  oid,
onlp_oid_hdr_t hdr 
)

Get the OID header for a given OID.

Parameters
oidThe oid
[out]hdrReceives the header

◆ onlp_oid_hdr_get_all()

int onlp_oid_hdr_get_all ( onlp_oid_t  root,
onlp_oid_type_flags_t  types,
uint32_t  flags,
biglist_t **  list 
)

Iterate over all given OID types and return their hdr structures.

Parameters
rootThe root OID.
typesThe OID types filter (optional)
flagsThe iterator flags.
[out]listReceives a list of all hdr structures.

◆ onlp_oid_hdr_to_json()

int onlp_oid_hdr_to_json ( onlp_oid_hdr_t hdr,
cJSON **  cj,
uint32_t  flags 
)

OID Header -> JSON.

Parameters
hdrThe header
[out]cjReceives the JSON representation.
flagsThe JSON conversion flags.

◆ onlp_oid_info_get()

int onlp_oid_info_get ( onlp_oid_t  oid,
onlp_oid_hdr_t **  info 
)

Get the information structure for a given OID.

Parameters
oidThe oid
[out]infoReceives a pointer to the information structure.

◆ onlp_oid_info_get_all()

int onlp_oid_info_get_all ( onlp_oid_t  root,
onlp_oid_type_flags_t  types,
uint32_t  flags,
biglist_t **  list 
)

Iterate over all given OID types and return their info structures.

Parameters
rootThe root OID.
typesThe OID types filter (optional)
flagsThe iterator flags.
[out]listReceives a list of all info structures.

◆ onlp_oid_info_to_json()

int onlp_oid_info_to_json ( onlp_oid_hdr_t info,
cJSON **  cj,
uint32_t  flags 
)

OID Info Structure -> JSON.

Parameters
infoThe pointer to the OID's info structure.
[out]cjReceives the JSON representation.
flagsThe JSON conversion flags.

◆ onlp_oid_iterate()

int onlp_oid_iterate ( onlp_oid_t  root,
onlp_oid_type_flags_t  types,
onlp_oid_iterate_f  itf,
void *  cookie 
)

Iterate over all platform OIDs.

Parameters
rootThe root OID.
typesThe OID types filter (optional)
itfThe iterator function.
cookieThe cookie.

◆ onlp_oid_json_flag_desc()

const char* onlp_oid_json_flag_desc ( onlp_oid_json_flag_t  e)

Enum descriptions.

◆ onlp_oid_json_flag_name()

const char* onlp_oid_json_flag_name ( onlp_oid_json_flag_t  e)

Enum names.

◆ onlp_oid_json_flag_valid()

int onlp_oid_json_flag_valid ( onlp_oid_json_flag_t  e)

Enum validator.

◆ onlp_oid_json_flag_value()

int onlp_oid_json_flag_value ( const char *  str,
onlp_oid_json_flag_t e,
int  substr 
)

Enum values.

◆ onlp_oid_json_verify()

int onlp_oid_json_verify ( onlp_oid_t  oid)

Verify OID <-> JSON conversions for the given OID (testing).

◆ onlp_oid_status_flag_desc()

const char* onlp_oid_status_flag_desc ( onlp_oid_status_flag_t  e)

Enum descriptions.

◆ onlp_oid_status_flag_name()

const char* onlp_oid_status_flag_name ( onlp_oid_status_flag_t  e)

Enum names.

◆ onlp_oid_status_flag_valid()

int onlp_oid_status_flag_valid ( onlp_oid_status_flag_t  e)

Enum validator.

◆ onlp_oid_status_flag_value()

int onlp_oid_status_flag_value ( const char *  str,
onlp_oid_status_flag_t e,
int  substr 
)

Enum values.

◆ onlp_oid_table_from_json()

int onlp_oid_table_from_json ( cJSON *  cj,
onlp_oid_table_t  table 
)

JSON -> OID Table.

Parameters
cjThe CJSON array object.
[out]tableThe table to populate.

◆ onlp_oid_table_to_json()

int onlp_oid_table_to_json ( onlp_oid_table_t  table,
cJSON **  cjp 
)

OID Table -> JSON.

Parameters
tableThe table.
[out]cjpReceives the JSON array object.

◆ onlp_oid_to_json()

int onlp_oid_to_json ( onlp_oid_t  oid,
cJSON **  rv,
uint32_t  flags 
)

OID -> User JSON.

Parameters
oidThe OID.
[out]rvReceives the JSON structure.
flagsThe format flags.

◆ onlp_oid_to_str()

int onlp_oid_to_str ( onlp_oid_t  oid,
char *  rstr 
)

OID -> String Representation

◆ onlp_oid_to_user_json()

int onlp_oid_to_user_json ( onlp_oid_t  oid,
cJSON **  rv,
uint32_t  flags 
)

OID -> JSON.

Parameters
oidThe OID.
[out]rvReceives the JSON structure.
flagsThe format flags.

◆ onlp_oid_to_user_str()

int onlp_oid_to_user_str ( onlp_oid_t  oid,
char *  rstr 
)

OID -> User representation.

◆ onlp_oid_type_desc()

const char* onlp_oid_type_desc ( onlp_oid_type_t  e)

Enum descriptions.

◆ onlp_oid_type_flag_desc()

const char* onlp_oid_type_flag_desc ( onlp_oid_type_flag_t  e)

Enum descriptions.

◆ onlp_oid_type_flag_name()

const char* onlp_oid_type_flag_name ( onlp_oid_type_flag_t  e)

Enum names.

◆ onlp_oid_type_flag_valid()

int onlp_oid_type_flag_valid ( onlp_oid_type_flag_t  e)

Enum validator.

◆ onlp_oid_type_flag_value()

int onlp_oid_type_flag_value ( const char *  str,
onlp_oid_type_flag_t e,
int  substr 
)

Enum values.

◆ onlp_oid_type_name()

const char* onlp_oid_type_name ( onlp_oid_type_t  e)

Enum names.

◆ onlp_oid_type_valid()

int onlp_oid_type_valid ( onlp_oid_type_t  e)

Enum validator.

◆ onlp_oid_type_value()

int onlp_oid_type_value ( const char *  str,
onlp_oid_type_t e,
int  substr 
)

Enum values.

Variable Documentation

◆ onlp_oid_json_flag_desc_map

aim_map_si_t onlp_oid_json_flag_desc_map[]

onlp_oid_json_flag_desc_map table.

◆ onlp_oid_json_flag_map

aim_map_si_t onlp_oid_json_flag_map[]

onlp_oid_json_flag_map table.

◆ onlp_oid_status_flag_desc_map

aim_map_si_t onlp_oid_status_flag_desc_map[]

onlp_oid_status_flag_desc_map table.

◆ onlp_oid_status_flag_map

aim_map_si_t onlp_oid_status_flag_map[]

onlp_oid_status_flag_map table.

◆ onlp_oid_type_desc_map

aim_map_si_t onlp_oid_type_desc_map[]

onlp_oid_type_desc_map table.

◆ onlp_oid_type_flag_desc_map

aim_map_si_t onlp_oid_type_flag_desc_map[]

onlp_oid_type_flag_desc_map table.

◆ onlp_oid_type_flag_map

aim_map_si_t onlp_oid_type_flag_map[]

onlp_oid_type_flag_map table.

◆ onlp_oid_type_map

aim_map_si_t onlp_oid_type_map[]

onlp_oid_type_map table.