ONLP
Open Network Linux Platform APIs
Macros | Functions

Macros

#define ONLP_ATTRIBUTE_EQUALS(_a, _b)   (!strcmp(_a, _b))
 Attribute comparitor.
 

Functions

int onlp_attribute_sw_init (void)
 Initialize the attribute subsystem. More...
 
int onlp_attribute_hw_init (uint32_t flags)
 Hardware initialization of the attribute subsystem. More...
 
int onlp_attribute_sw_denit (void)
 Deinitialize the attribute subsystem. More...
 
int onlp_attribute_supported (onlp_oid_t oid, const char *attribute)
 Determine whether the OID supports the given attribute. More...
 
int onlp_attribute_set (onlp_oid_t oid, const char *attribute, void *value)
 Set an attribute on the given OID. More...
 
int onlp_attribute_get (onlp_oid_t oid, const char *attribute, void **value)
 Get an attribute from the given OID. More...
 
int onlp_attribute_free (onlp_oid_t oid, const char *attribute, void *value)
 Free an attribute value returned from onlp_attribute_get(). More...
 
int onlp_attribute_onie_info_get (onlp_oid_t oid, onlp_onie_info_t **rp)
 Request the ONIE attribute. More...
 
int onlp_attribute_onie_info_free (onlp_oid_t oid, onlp_onie_info_t *p)
 Free an ONIE attribute pointer. More...
 
int onlp_attribute_onie_info_get_json (onlp_oid_t oid, cJSON **rp)
 Request the ONIE attribute in JSON. More...
 
int onlp_attribute_onie_info_show (onlp_oid_t oid, aim_pvs_t *pvs)
 Show the ONIE attribute. More...
 
int onlp_attribute_onie_info_show_json (onlp_oid_t oid, aim_pvs_t *pvs)
 Show the ONIE attribute (JSON) More...
 
int onlp_attribute_asset_info_get (onlp_oid_t oid, onlp_asset_info_t **rp)
 Determine if the ONIE attribute is supported. More...
 
int onlp_attribute_asset_info_free (onlp_oid_t oid, onlp_asset_info_t *p)
 Free an asset attribute pointer. More...
 
int onlp_attribute_asset_info_get_json (onlp_oid_t oid, cJSON **rp)
 Request the asset attribute in JSON. More...
 
int onlp_attribute_asset_info_show (onlp_oid_t oid, aim_pvs_t *pvs)
 Show the asset attribute. More...
 
int onlp_attribute_asset_info_show_json (onlp_oid_t oid, aim_pvs_t *pvs)
 Show the asset attribute (JSON). More...
 

Detailed Description

Function Documentation

◆ onlp_attribute_asset_info_free()

int onlp_attribute_asset_info_free ( onlp_oid_t  oid,
onlp_asset_info_t p 
)

Free an asset attribute pointer.

Parameters
oidThe target oid.
pThe asset attribute pointer.

◆ onlp_attribute_asset_info_get()

int onlp_attribute_asset_info_get ( onlp_oid_t  oid,
onlp_asset_info_t **  rp 
)

Determine if the ONIE attribute is supported.

Parameters
oidThe target OID.
Note
Retu Request the asset attribute.
Parameters
oidThe target oid.
[out]rpReceives the Asset information structure pointer.
Note
Setting rp to NULL will determine if the attribute is supported.

◆ onlp_attribute_asset_info_get_json()

int onlp_attribute_asset_info_get_json ( onlp_oid_t  oid,
cJSON **  rp 
)

Request the asset attribute in JSON.

Parameters
oidThe target oid.
[out]rpReceives the cJSON object.
Note
The cJSON object should be freed after use using cJSON_Delete()

◆ onlp_attribute_asset_info_show()

int onlp_attribute_asset_info_show ( onlp_oid_t  oid,
aim_pvs_t *  pvs 
)

Show the asset attribute.

Parameters
oidThe target oid.
pvsThe output pvs.
Note
The output format is YAML in human-readable format.

◆ onlp_attribute_asset_info_show_json()

int onlp_attribute_asset_info_show_json ( onlp_oid_t  oid,
aim_pvs_t *  pvs 
)

Show the asset attribute (JSON).

Parameters
oidThe target oid.
pvsThe output pvs.

◆ onlp_attribute_free()

int onlp_attribute_free ( onlp_oid_t  oid,
const char *  attribute,
void *  value 
)

Free an attribute value returned from onlp_attribute_get().

Parameters
oidThe OID.
attributeThe attribute.
valueThe value.

◆ onlp_attribute_get()

int onlp_attribute_get ( onlp_oid_t  oid,
const char *  attribute,
void **  value 
)

Get an attribute from the given OID.

Parameters
oidThe OID.
attributeThe attribute to retrieve.
[out]valueReceives the attribute's value.

◆ onlp_attribute_hw_init()

int onlp_attribute_hw_init ( uint32_t  flags)

Hardware initialization of the attribute subsystem.

Parameters
flagsThe initialization flags.
Note
This function will be called once at system startup by the ONLP core. You should not call it.

◆ onlp_attribute_onie_info_free()

int onlp_attribute_onie_info_free ( onlp_oid_t  oid,
onlp_onie_info_t *  p 
)

Free an ONIE attribute pointer.

Parameters
oidThe target OID.
pThe ONIE attribute pointer.

◆ onlp_attribute_onie_info_get()

int onlp_attribute_onie_info_get ( onlp_oid_t  oid,
onlp_onie_info_t **  rp 
)

Request the ONIE attribute.

Parameters
oidThe target OID.
[out]rpReceives the ONIE information structure pointer.
Note
Setting rp to NULL will determine if the ONIE attribute is supported.

◆ onlp_attribute_onie_info_get_json()

int onlp_attribute_onie_info_get_json ( onlp_oid_t  oid,
cJSON **  rp 
)

Request the ONIE attribute in JSON.

Parameters
oidThe target OID.
[out]rpReceives the cJSON object.
Note
The cJSON object should be freed after use using cJSON_Delete().

◆ onlp_attribute_onie_info_show()

int onlp_attribute_onie_info_show ( onlp_oid_t  oid,
aim_pvs_t *  pvs 
)

Show the ONIE attribute.

Parameters
oidThe target OID.
pvsThe output pvs.
Note
The output is YAML in human-readble format.

◆ onlp_attribute_onie_info_show_json()

int onlp_attribute_onie_info_show_json ( onlp_oid_t  oid,
aim_pvs_t *  pvs 
)

Show the ONIE attribute (JSON)

Parameters
oidThe target OID.
pvsThe output pvs.

◆ onlp_attribute_set()

int onlp_attribute_set ( onlp_oid_t  oid,
const char *  attribute,
void *  value 
)

Set an attribute on the given OID.

Parameters
oidThe OID.
attributeThe attribute name.
valueA pointer to the value.

◆ onlp_attribute_supported()

int onlp_attribute_supported ( onlp_oid_t  oid,
const char *  attribute 
)

Determine whether the OID supports the given attribute.

Parameters
oidThe OID.
attributeThe attribute name.

◆ onlp_attribute_sw_denit()

int onlp_attribute_sw_denit ( void  )

Deinitialize the attribute subsystem.

Note
The primary purpose of this API is to properly deallocate any resources used by the module in order faciliate detection of real resouce leaks.

◆ onlp_attribute_sw_init()

int onlp_attribute_sw_init ( void  )

Initialize the attribute subsystem.

Note
This function can only perform software module initialization. It cannot affect the state of the hardware.