ONLP
Open Network Linux Platform APIs
oids.h
Go to the documentation of this file.
1 /************************************************************
2  * <bsn.cl fy=2014 v=onl>
3  *
4  * Copyright 2014, 2015 Big Switch Networks, Inc.
5  *
6  * Licensed under the Eclipse Public License, Version 1.0 (the
7  * "License"); you may not use this file except in compliance
8  * with the License. You may obtain a copy of the License at
9  *
10  * http://www.eclipse.org/legal/epl-v10.html
11  *
12  * Unless required by applicable law or agreed to in writing,
13  * software distributed under the License is distributed on an
14  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
15  * either express or implied. See the License for the specific
16  * language governing permissions and limitations under the
17  * License.
18  *
19  * </bsn.cl>
20  ********************************************************/
28 #ifndef __ONLP_OID_H__
29 #define __ONLP_OID_H__
30 
31 #include <onlp/onlp_config.h>
32 
33 #include <stdint.h>
34 #include <AIM/aim_pvs.h>
35 #include <IOF/iof.h>
36 #include <BigList/biglist.h>
37 #include <cjson/cJSON.h>
38 
52 typedef uint32_t onlp_oid_t;
53 
55 typedef uint32_t onlp_oid_id_t;
56 
57 /* <auto.start.enum(tag:oid).define> */
59 typedef enum onlp_oid_json_flag_e {
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),
64 
66 typedef enum onlp_oid_status_flag_e {
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),
72 
74 typedef enum onlp_oid_type_e {
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,
84 
86 typedef enum onlp_oid_type_flag_e {
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),
96 /* <auto.end.enum(tag:oid).define> */
97 
101 typedef uint32_t onlp_oid_type_flags_t;
102 
106 typedef uint32_t onlp_oid_status_flags_t;
107 
109 #define ONLP_OID_TYPE_GET(_id) ( ( (_id) >> 24) )
110 
111 #define ONLP_OID_TYPE_CREATE(_type, _id) ( ( (_type) << 24) | (_id))
112 
113 #define ONLP_OID_IS_TYPE(_type,_id) (ONLP_OID_TYPE_GET((_id)) == _type)
114 
115 #define ONLP_OID_ID_GET(_id) (_id & 0xFFFFFF)
116 
117 #define ONLP_OID_TYPE_VALIDATE(_type, _oid) \
118  do { \
119  if(!ONLP_OID_IS_TYPE(_type, _oid)) { \
120  return ONLP_STATUS_E_PARAM; \
121  } \
122 } while(0)
123 
124 #define ONLP_OID_TYPE_VALIDATE_NR(_type, _oid) \
125  do { \
126  if(!ONLP_OID_IS_TYPE(_type, _oid)) { \
127  return; \
128  } \
129  } while(0)
130 
132 #define ONLP_OID_TYPE_VALIDATE_GET_ID(_type, _oid, _id) \
133  do { \
134  ONLP_OID_TYPE_VALIDATE(_type, _oid); \
135  _id = ONLP_OID_ID_GET(_oid); \
136  } while(0)
137 
138 #define ONLP_OID_TYPE_VALIDATE_GET_ID_NR(_type, _oid, _id) \
139  do { \
140  ONLP_OID_TYPE_VALIDATE_NR(_type, _oid); \
141  _id = ONLP_OID_ID_GET(_oid); \
142  }
143 
145 #define ONLP_OID_IS_TYPE_FLAGS(_flags, _id) ((_flags & (1 << ONLP_OID_TYPE_GET(_id))))
146 
148 #define ONLP_OID_IS_TYPE_FLAGSZ(_flags, _id) ((_flags == 0) || ONLP_OID_IS_TYPE_FLAGS(_flags, _id))
149 
151 #define ONLP_CHASSIS_ID_CREATE(_id) ONLP_OID_TYPE_CREATE(ONLP_OID_TYPE_CHASSIS, _id)
152 
153 #define ONLP_THERMAL_ID_CREATE(_id) ONLP_OID_TYPE_CREATE(ONLP_OID_TYPE_THERMAL, _id)
154 
155 #define ONLP_FAN_ID_CREATE(_id) ONLP_OID_TYPE_CREATE(ONLP_OID_TYPE_FAN, _id)
156 
157 #define ONLP_PSU_ID_CREATE(_id) ONLP_OID_TYPE_CREATE(ONLP_OID_TYPE_PSU, _id)
158 
159 #define ONLP_LED_ID_CREATE(_id) ONLP_OID_TYPE_CREATE(ONLP_OID_TYPE_LED, _id)
160 
161 #define ONLP_SFP_ID_CREATE(_id) ONLP_OID_TYPE_CREATE(ONLP_OID_TYPE_SFP, _id)
162 
163 #define ONLP_MODULE_ID_CREATE(_id) ONLP_OID_TYPE_CREATE(ONLP_OID_TYPE_MODULE, _id)
164 
165 #define ONLP_GENERIC_ID_CREATE(_id) ONLP_OID_TYPE_CREATE(ONLP_OID_TYPE_GENERIC, _id)
166 
168 #define ONLP_OID_IS_CHASSIS(_id) ONLP_OID_IS_TYPE(ONLP_OID_TYPE_CHASSIS, _id)
169 
170 #define ONLP_OID_CHASSIS_VALIDATE(_id) ONLP_OID_TYPE_VALIDATE(ONLP_OID_TYPE_CHASSIS, _id)
171 
172 #define ONLP_OID_CHASSIS_VALIDATE_NR(_id) ONLP_OID_TYPE_VALIDATE_NR(ONLP_OID_TYPE_CHASSIS, _id)
173 
175 #define ONLP_OID_IS_THERMAL(_id) ONLP_OID_IS_TYPE(ONLP_OID_TYPE_THERMAL, _id)
176 
177 #define ONLP_OID_THERMAL_VALIDATE(_id) ONLP_OID_TYPE_VALIDATE(ONLP_OID_TYPE_THERMAL, _id)
178 
179 #define ONLP_OID_THERMAL_VALIDATE_NR(_id) ONLP_OID_TYPE_VALIDATE_NR(ONLP_OID_TYPE_THERMAL, _id)
180 
181 #define ONLP_OID_THERMAL_VALIDATE_GET_ID(_oid, _id) ONLP_OID_TYPE_VALIDATE_GET_ID(ONLP_OID_TYPE_THERMAL, _oid, _id)
182 
183 #define ONLP_OID_THERMAL_VALIDATE_GET_ID_NR(_oid, _id) ONLP_OID_TYPE_VALIDATE_GET_ID_NR(ONLP_OID_TYPE_THERMAL, _oid, _id)
184 
186 #define ONLP_OID_IS_FAN(_id) ONLP_OID_IS_TYPE(ONLP_OID_TYPE_FAN, _id)
187 
188 #define ONLP_OID_FAN_VALIDATE(_id) ONLP_OID_TYPE_VALIDATE(ONLP_OID_TYPE_FAN, _id)
189 
190 #define ONLP_OID_FAN_VALIDATE_NR(_id) ONLP_OID_TYPE_VALIDATE_NR(ONLP_OID_TYPE_FAN, _id)
191 
192 #define ONLP_OID_FAN_VALIDATE_GET_ID(_oid, _id) ONLP_OID_TYPE_VALIDATE_GET_ID(ONLP_OID_TYPE_FAN, _oid, _id)
193 
194 #define ONLP_OID_FAN_VALIDATE_GET_ID_NR(_oid, _id) ONLP_OID_TYPE_VALIDATE_GET_ID_NR(ONLP_OID_TYPE_FAN, _oid, _id)
195 
197 #define ONLP_OID_IS_PSU(_id) ONLP_OID_IS_TYPE(ONLP_OID_TYPE_PSU, _id)
198 
199 #define ONLP_OID_PSU_VALIDATE(_id) ONLP_OID_TYPE_VALIDATE(ONLP_OID_TYPE_PSU, _id)
200 
201 #define ONLP_OID_PSU_VALIDATE_NR(_id) ONLP_OID_TYPE_VALIDATE_NR(ONLP_OID_TYPE_PSU, _id)
202 
203 #define ONLP_OID_PSU_VALIDATE_GET_ID(_oid, _id) ONLP_OID_TYPE_VALIDATE_GET_ID(ONLP_OID_TYPE_PSU, _oid, _id)
204 
205 #define ONLP_OID_PSU_VALIDATE_GET_ID_NR(_oid, _id) ONLP_OID_TYPE_VALIDATE_GET_ID_NR(ONLP_OID_TYPE_PSU, _oid, _id)
206 
208 #define ONLP_OID_IS_LED(_id) ONLP_OID_IS_TYPE(ONLP_OID_TYPE_LED, _id)
209 
210 #define ONLP_OID_LED_VALIDATE(_id) ONLP_OID_TYPE_VALIDATE(ONLP_OID_TYPE_LED, _id)
211 
212 #define ONLP_OID_LED_VALIDATE_NR(_id) ONLP_OID_TYPE_VALIDATE_NR(ONLP_OID_TYPE_LED, _id)
213 
214 #define ONLP_OID_LED_VALIDATE_GET_ID(_oid, _id) ONLP_OID_TYPE_VALIDATE_GET_ID(ONLP_OID_TYPE_LED, _oid, _id)
215 
216 #define ONLP_OID_LED_VALIDATE_GET_ID_NR(_oid, _id) ONLP_OID_TYPE_VALIDATE_GET_ID_NR(ONLP_OID_TYPE_LED, _oid, _id)
217 
218 
220 #define ONLP_OID_IS_SFP(_id) ONLP_OID_IS_TYPE(ONLP_OID_TYPE_SFP, _id)
221 
222 #define ONLP_OID_SFP_VALIDATE(_id) ONLP_OID_TYPE_VALIDATE(ONLP_OID_TYPE_SFP, _id)
223 
224 #define ONLP_OID_SFP_VALIDATE_NR(_id) ONLP_OID_TYPE_VALIDATE_NR(ONLP_OID_TYPE_SFP, _id)
225 
226 #define ONLP_OID_SFP_VALIDATE_GET_ID(_oid, _id) ONLP_OID_TYPE_VALIDATE_GET_ID(ONLP_OID_TYPE_SFP, _oid, _id)
227 
228 #define ONLP_OID_SFP_VALIDATE_GET_ID_NR(_oid, _id) ONLP_OID_TYPE_VALIDATE_GET_ID_NR(ONLP_OID_TYPE_SFP, _oid, _id)
229 
231 #define ONLP_OID_IS_MODULE(_id) ONLP_OID_IS_TYPE(ONLP_OID_TYPE_MODULE, _id)
232 
233 #define ONLP_OID_MODULE_VALIDATE(_id) ONLP_OID_TYPE_VALIDATE(ONLP_OID_TYPE_MODULE, _id)
234 
235 #define ONLP_OID_MODULE_VALIDATE_NR(_id) ONLP_OID_TYPE_VALIDATE_NR(ONLP_OID_TYPE_MODULE, _id)
236 
237 #define ONLP_OID_MODULE_VALIDATE_GET_ID(_oid, _id) ONLP_OID_TYPE_VALIDATE_GET_ID(ONLP_OID_TYPE_MODULE, _oid, _id)
238 
239 #define ONLP_OID_MODULE_VALIDATE_GET_ID_NR(_oid, _id) ONLP_OID_TYPE_VALIDATE_GET_ID_NR(ONLP_OID_TYPE_MODULE, _oid, _id)
240 
242 #define ONLP_OID_IS_GENERIC(_id) ONLP_OID_IS_TYPE(ONLP_OID_TYPE_GENERIC, _id)
243 
244 #define ONLP_OID_GENERIC_VALIDATE(_id) ONLP_OID_TYPE_VALIDATE(ONLP_OID_TYPE_GENERIC, _id)
245 
246 #define ONLP_OID_GENERIC_VALIDATE_NR(_id) ONLP_OID_TYPE_VALIDATE_NR(ONLP_OID_TYPE_GENERIC, _id)
247 
248 #define ONLP_OID_GENERIC_VALIDATE_GET_ID(_oid, _id) ONLP_OID_TYPE_VALIDATE_GET_ID(ONLP_OID_TYPE_GENERIC, _oid, _id)
249 
250 #define ONLP_OID_GENERIC_VALIDATE_GET_ID_NR(_oid, _id) ONLP_OID_TYPE_VALIDATE_GET_ID_NR(ONLP_OID_TYPE_GENERIC, _oid, _id)
251 
252 
254 #define ONLP_OID_ID_VALIDATE_RANGE(_id, _min, _max) \
255  ( (_id) >= (_min) && (_id) <= (_max)) ? ONLP_STATUS_OK : ONLP_STATUS_E_INVALID
256 
260 #define ONLP_OID_CHASSIS ONLP_OID_TYPE_CREATE(ONLP_OID_TYPE_CHASSIS, 1)
261 
265 #define ONLP_OID_DESC_SIZE 128
266 
269 
271 #define ONLP_OID_TABLE_SIZE 256
272 
275 
277 #define ONLP_OID_TABLE_SIZE_BYTES (sizeof(onlp_oid_t)*ONLP_OID_TABLE_SIZE)
278 
280 #define ONLP_OID_TABLE_COPY(_dst, _src) memcpy(_dst, _src, ONLP_OID_TABLE_SIZE_BYTES)
281 
283 #define ONLP_OID_TABLE_CLEAR(_table) memset(_table, 0, ONLP_OID_TABLE_SIZE_BYTES)
284 
285 
289 #define ONLP_OID_THERMAL_ENTRY(_id, _desc, _parent_type, _parent_id) \
290  { ONLP_THERMAL_ID_CREATE(_id), _desc, ONLP_OID_TYPE_CREATE(_parent_type, _parent_id) }
291 
292 
296 typedef struct onlp_oid_hdr_s {
305 
308 
310 
311 
318 
325 
326 
330 typedef int (*onlp_oid_iterate_f)(onlp_oid_t oid, void* cookie);
331 
340  onlp_oid_iterate_f itf, void* cookie);
341 
342 
351  uint32_t flags, biglist_t** list);
352 
361  uint32_t flags, biglist_t** list);
362 
367 int onlp_oid_get_all_free(biglist_t* list);
368 
372 #define ONLP_OID_STATUS_FLAGS_GET(_ptr) \
373  (((onlp_oid_hdr_t*)_ptr)->status)
374 
376 #define ONLP_OID_STATUS_FLAGS_CLR(_ptr) \
377  ONLP_OID_STATUS_FLAGS_GET(_ptr) = 0
378 
380 #define ONLP_OID_STATUS_FLAG_GET_VALUE(_ptr, _name) \
381  AIM_FLAG_GET_VALUE(ONLP_OID_STATUS_FLAGS_GET(_ptr), ONLP_OID_STATUS_FLAG_##_name)
382 
384 #define ONLP_OID_STATUS_FLAG_SET_VALUE(_ptr, _name, _value) \
385  AIM_FLAG_SET_VALUE(ONLP_OID_STATUS_FLAGS_GET(_ptr), ONLP_OID_STATUS_FLAG_##_name, _value)
386 
388 #define ONLP_OID_STATUS_FLAG_SET(_ptr, _name) \
389  AIM_FLAG_SET(ONLP_OID_STATUS_FLAGS_GET(_ptr), ONLP_OID_STATUS_FLAG_##_name)
390 
392 #define ONLP_OID_STATUS_FLAG_CLR(_ptr, _name) \
393  AIM_FLAG_CLR(ONLP_OID_STATUS_FLAGS_GET(_ptr), ONLP_OID_STATUS_FLAG_##_name)
394 
396 #define ONLP_OID_STATUS_FLAG_IS_SET(_ptr, _name) \
397  AIM_FLAG_IS_SET(ONLP_OID_STATUS_FLAGS_GET(_ptr), ONLP_OID_STATUS_FLAG_##_name)
398 
400 #define ONLP_OID_STATUS_FLAG_NOT_SET(_ptr, _name) \
401  AIM_FLAG_NOT_SET(ONLP_OID_STATUS_FLAGS_GET(_ptr), ONLP_OID_STATUS_FLAG_##_name)
402 
404 #define ONLP_OID_PRESENT(_ptr) \
405  ONLP_OID_STATUS_FLAG_IS_SET(_ptr, PRESENT)
406 
408 #define ONLP_OID_FAILED(_ptr) \
409  ONLP_OID_STATUS_FLAG_IS_SET(_ptr, FAILED)
410 
417 #define ONLP_OID_TABLE_ITER_EXPR(_table, _oidp, _expr) \
418  for(_oidp = _table; _oidp < (_table+ONLP_OID_TABLE_SIZE); _oidp++) \
419  if( (*_oidp) && (_expr) )
420 
426 #define ONLP_OID_TABLE_ITER(_table, _oidp) ONLP_OID_TABLE_ITER_EXPR(_table, _oidp, 1)
427 
435 #define ONLP_OID_TABLE_ITER_TYPE(_table, _oidp, _type) \
436  ONLP_OID_TABLE_ITER_EXPR(_table, _oidp, ONLP_OID_IS_TYPE(ONLP_OID_TYPE_##_type, *_oidp))
437 
438 
443 
444 
446 int onlp_oid_to_str(onlp_oid_t oid, char* rstr);
447 
449 int onlp_oid_to_user_str(onlp_oid_t oid, char* rstr);
450 
454 int onlp_oid_from_str(char* str, onlp_oid_t* roid);
455 
461 int onlp_oid_table_to_json(onlp_oid_table_t table, cJSON** cjp);
462 
468 int onlp_oid_table_from_json(cJSON* cj, onlp_oid_table_t table);
469 
476 int onlp_oid_hdr_to_json(onlp_oid_hdr_t* hdr, cJSON** cj, uint32_t flags);
477 
483 int onlp_oid_hdr_from_json(cJSON* cj, onlp_oid_hdr_t* hdr);
484 
491 int onlp_oid_info_to_json(onlp_oid_hdr_t* info, cJSON** cj, uint32_t flags);
492 
499 int onlp_oid_to_user_json(onlp_oid_t oid, cJSON** rv, uint32_t flags);
500 
507 int onlp_oid_to_json(onlp_oid_t oid, cJSON** rv, uint32_t flags);
508 
517 int onlp_oid_from_json(cJSON* cj, onlp_oid_hdr_t** hdr, biglist_t** all, uint32_t flags);
518 
523 
524 /******************************************************************************
525  *
526  * Enumeration Support Definitions.
527  *
528  * Please do not add additional code beyond this point.
529  *
530  *****************************************************************************/
531 /* <auto.start.enum(tag:oid).supportheader> */
534 
536 int onlp_oid_json_flag_value(const char* str, onlp_oid_json_flag_t* e, int substr);
537 
540 
543 
545 #define ONLP_OID_JSON_FLAG_VALID(_e) \
546  (onlp_oid_json_flag_valid((_e)))
547 
549 extern aim_map_si_t onlp_oid_json_flag_map[];
551 extern aim_map_si_t onlp_oid_json_flag_desc_map[];
552 
555 
557 int onlp_oid_status_flag_value(const char* str, onlp_oid_status_flag_t* e, int substr);
558 
561 
564 
566 #define ONLP_OID_STATUS_FLAG_VALID(_e) \
567  (onlp_oid_status_flag_valid((_e)))
568 
570 extern aim_map_si_t onlp_oid_status_flag_map[];
572 extern aim_map_si_t onlp_oid_status_flag_desc_map[];
573 
575 const char* onlp_oid_type_name(onlp_oid_type_t e);
576 
578 int onlp_oid_type_value(const char* str, onlp_oid_type_t* e, int substr);
579 
581 const char* onlp_oid_type_desc(onlp_oid_type_t e);
582 
585 
587 #define ONLP_OID_TYPE_VALID(_e) \
588  (onlp_oid_type_valid((_e)))
589 
591 extern aim_map_si_t onlp_oid_type_map[];
593 extern aim_map_si_t onlp_oid_type_desc_map[];
594 
597 
599 int onlp_oid_type_flag_value(const char* str, onlp_oid_type_flag_t* e, int substr);
600 
603 
606 
608 #define ONLP_OID_TYPE_FLAG_VALID(_e) \
609  (onlp_oid_type_flag_valid((_e)))
610 
612 extern aim_map_si_t onlp_oid_type_flag_map[];
614 extern aim_map_si_t onlp_oid_type_flag_desc_map[];
615 /* <auto.end.enum(tag:oid).supportheader> */
616 
617 #endif /* __ONLP_OID_H__ */
618 /* @} */
onlp Configuration Header
int(* onlp_oid_iterate_f)(onlp_oid_t oid, void *cookie)
Definition: oids.h:330
const char * onlp_oid_json_flag_name(onlp_oid_json_flag_t e)
struct onlp_oid_hdr_s onlp_oid_hdr_t
int onlp_oid_status_flag_value(const char *str, onlp_oid_status_flag_t *e, int substr)
onlp_oid_status_flags_t status
Definition: oids.h:307
int onlp_oid_info_get(onlp_oid_t oid, onlp_oid_hdr_t **info)
Get the information structure for a given OID.
aim_map_si_t onlp_oid_json_flag_desc_map[]
onlp_oid_t onlp_oid_table_t[ONLP_OID_TABLE_SIZE]
Definition: oids.h:274
int onlp_oid_info_to_json(onlp_oid_hdr_t *info, cJSON **cj, uint32_t flags)
OID Info Structure -> JSON.
int onlp_oid_type_flag_value(const char *str, onlp_oid_type_flag_t *e, int substr)
const char * onlp_oid_status_flag_desc(onlp_oid_status_flag_t e)
aim_map_si_t onlp_oid_status_flag_map[]
const char * onlp_oid_type_desc(onlp_oid_type_t e)
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.
enum onlp_oid_type_flag_e onlp_oid_type_flag_t
aim_map_si_t onlp_oid_json_flag_map[]
int onlp_oid_from_json(cJSON *cj, onlp_oid_hdr_t **hdr, biglist_t **all, uint32_t flags)
JSON -> OID Information structures.
enum onlp_oid_type_e onlp_oid_type_t
uint32_t onlp_oid_t
Definition: oids.h:52
onlp_oid_status_flag_e
Definition: oids.h:66
int onlp_oid_to_user_json(onlp_oid_t oid, cJSON **rv, uint32_t flags)
OID -> JSON.
int onlp_oid_hdr_get(onlp_oid_t oid, onlp_oid_hdr_t *hdr)
Get the OID header for a given OID.
char onlp_oid_desc_t[ONLP_OID_DESC_SIZE]
Definition: oids.h:268
int onlp_oid_hdr_from_json(cJSON *cj, onlp_oid_hdr_t *hdr)
JSON -> OID Header.
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.
int onlp_oid_type_value(const char *str, onlp_oid_type_t *e, int substr)
int onlp_oid_type_valid(onlp_oid_type_t e)
onlp_oid_type_flag_e
Definition: oids.h:86
aim_map_si_t onlp_oid_type_flag_desc_map[]
int onlp_oid_hdr_to_json(onlp_oid_hdr_t *hdr, cJSON **cj, uint32_t flags)
OID Header -> JSON.
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.
int onlp_oid_from_str(char *str, onlp_oid_t *roid)
String Represenation -> OID.
aim_map_si_t onlp_oid_type_map[]
int onlp_oid_to_str(onlp_oid_t oid, char *rstr)
aim_map_si_t onlp_oid_status_flag_desc_map[]
int onlp_oid_table_from_json(cJSON *cj, onlp_oid_table_t table)
JSON -> OID Table.
uint32_t onlp_oid_id_t
Definition: oids.h:55
onlp_oid_table_t coids
Definition: oids.h:304
int onlp_oid_to_json(onlp_oid_t oid, cJSON **rv, uint32_t flags)
OID -> User JSON.
aim_map_si_t onlp_oid_type_flag_map[]
aim_map_si_t onlp_oid_type_desc_map[]
enum onlp_oid_status_flag_e onlp_oid_status_flag_t
onlp_oid_t id
Definition: oids.h:298
onlp_oid_json_flag_e
Definition: oids.h:59
int onlp_oid_table_to_json(onlp_oid_table_t table, cJSON **cjp)
OID Table -> JSON.
#define ONLP_OID_TABLE_SIZE
Definition: oids.h:271
const char * onlp_oid_json_flag_desc(onlp_oid_json_flag_t e)
const char * onlp_oid_status_flag_name(onlp_oid_status_flag_t e)
const char * onlp_oid_type_flag_name(onlp_oid_type_flag_t e)
uint32_t onlp_oid_status_flags_t
Definition: oids.h:106
int onlp_oid_json_flag_valid(onlp_oid_json_flag_t e)
onlp_oid_type_e
Definition: oids.h:74
#define ONLP_OID_DESC_SIZE
Definition: oids.h:265
int onlp_oid_json_flag_value(const char *str, onlp_oid_json_flag_t *e, int substr)
onlp_oid_desc_t description
Definition: oids.h:300
onlp_oid_t poid
Definition: oids.h:302
int onlp_oid_json_verify(onlp_oid_t oid)
int onlp_oid_type_flag_valid(onlp_oid_type_flag_t e)
uint32_t onlp_oid_type_flags_t
Definition: oids.h:101
int onlp_oid_status_flag_valid(onlp_oid_status_flag_t e)
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()
int onlp_oid_to_user_str(onlp_oid_t oid, char *rstr)
enum onlp_oid_json_flag_e onlp_oid_json_flag_t
Definition: oids.h:296
const char * onlp_oid_type_name(onlp_oid_type_t e)
int onlp_oid_is_present(onlp_oid_t *oid)
Return whether an OID is present or not.
const char * onlp_oid_type_flag_desc(onlp_oid_type_flag_t e)