70 #include <amxc/amxc.h>
71 #include <amxc/amxc_macros.h>
77 #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
82 { .name =
"Version", .type = AMXC_VAR_ID_CSTRING },
83 { .name =
"EquipmentID", .type = AMXC_VAR_ID_CSTRING },
84 { .name =
"UsePPTPEthernetUNIasIFtoNonOmciDomain", .type = AMXC_VAR_ID_BOOL }
88 { .
name =
"Version", .type = AMXC_VAR_ID_CSTRING },
89 { .name =
"IsCommitted", .type = AMXC_VAR_ID_BOOL },
90 { .name =
"IsActive", .type = AMXC_VAR_ID_BOOL },
91 { .name =
"IsValid", .type = AMXC_VAR_ID_BOOL }
95 { .
name =
"Enable", .type = AMXC_VAR_ID_BOOL },
96 { .name =
"Status", .type = AMXC_VAR_ID_CSTRING },
97 { .name =
"LastChange", .type = AMXC_VAR_ID_UINT32 },
98 { .name =
"ANIs", .type = AMXC_VAR_ID_CSV_STRING },
99 { .name =
"InterdomainID", .type = AMXC_VAR_ID_CSTRING },
100 { .name =
"InterdomainName", .type = AMXC_VAR_ID_CSTRING },
105 { .name =
"Status", .type = AMXC_VAR_ID_CSTRING },
106 { .name =
"LastChange", .type = AMXC_VAR_ID_UINT32 },
107 { .name =
"PONMode", .type = AMXC_VAR_ID_CSTRING }
111 { .
name =
"Direction", .type = AMXC_VAR_ID_CSTRING },
112 { .name =
"PortType", .type = AMXC_VAR_ID_CSTRING }
116 { .
name =
"Identifier", .type = AMXC_VAR_ID_UINT32 },
117 { .name =
"VendorName", .type = AMXC_VAR_ID_CSTRING },
118 { .name =
"VendorPartNumber", .type = AMXC_VAR_ID_CSTRING },
119 { .name =
"VendorRevision", .type = AMXC_VAR_ID_CSTRING },
120 { .name =
"PONMode", .type = AMXC_VAR_ID_CSTRING },
121 { .name =
"Connector", .type = AMXC_VAR_ID_CSTRING },
122 { .name =
"NominalBitRateDownstream", .type = AMXC_VAR_ID_UINT32 },
123 { .name =
"NominalBitRateUpstream", .type = AMXC_VAR_ID_UINT32 },
124 { .name =
"RxPower", .type = AMXC_VAR_ID_INT32 },
125 { .name =
"TxPower", .type = AMXC_VAR_ID_INT32 },
126 { .name =
"Voltage", .type = AMXC_VAR_ID_UINT32 },
127 { .name =
"Bias", .type = AMXC_VAR_ID_UINT32 },
128 { .name =
"Temperature", .type = AMXC_VAR_ID_INT32 }
132 { .
name =
"ONUState", .type = AMXC_VAR_ID_CSTRING },
133 { .name =
"VendorID", .type = AMXC_VAR_ID_CSTRING },
134 { .name =
"SerialNumber", .type = AMXC_VAR_ID_CSTRING },
135 { .name =
"ONUID", .type = AMXC_VAR_ID_UINT32 }
139 { .
name =
"Password", .type = AMXC_VAR_ID_CSTRING },
140 { .name =
"HexadecimalPassword", .type = AMXC_VAR_ID_BOOL }
144 { .
name =
"SignalFail", .type = AMXC_VAR_ID_UINT32 },
145 { .name =
"SignalDegrade", .type = AMXC_VAR_ID_UINT32 }
149 { .
name =
"LOS", .type = AMXC_VAR_ID_BOOL },
150 { .name =
"LOF", .type = AMXC_VAR_ID_BOOL },
151 { .name =
"SF", .type = AMXC_VAR_ID_BOOL },
152 { .name =
"SD", .type = AMXC_VAR_ID_BOOL },
153 { .name =
"LCDG", .type = AMXC_VAR_ID_BOOL },
154 { .name =
"TF", .type = AMXC_VAR_ID_BOOL },
155 { .name =
"SUF", .type = AMXC_VAR_ID_BOOL },
156 { .name =
"MEM", .type = AMXC_VAR_ID_BOOL },
157 { .name =
"DACT", .type = AMXC_VAR_ID_BOOL },
158 { .name =
"DIS", .type = AMXC_VAR_ID_BOOL },
159 { .name =
"MIS", .type = AMXC_VAR_ID_BOOL },
160 { .name =
"PEE", .type = AMXC_VAR_ID_BOOL },
161 { .name =
"RDI", .type = AMXC_VAR_ID_BOOL },
162 { .name =
"LODS", .type = AMXC_VAR_ID_BOOL },
163 { .name =
"ROGUE", .type = AMXC_VAR_ID_BOOL }
175 .generic_path =
"XPON.ONU",
178 .templates =
"SoftwareImage,EthernetUNI,ANI",
181 .has_rw_enable =
true
185 .name =
"SoftwareImage",
186 .generic_path =
"XPON.ONU.x.SoftwareImage",
193 .has_rw_enable =
false
197 .name =
"EthernetUNI",
198 .generic_path =
"XPON.ONU.x.EthernetUNI",
204 .has_rw_enable =
false
209 .generic_path =
"XPON.ONU.x.ANI",
211 .singletons =
"TC.ONUActivation,TC.PerformanceThresholds,TC.Alarms",
212 .templates =
"TC.GEM.Port,Transceiver",
215 .has_rw_enable =
true
220 .generic_path =
"XPON.ONU.x.ANI.x.TC.GEM.Port",
221 .key_name =
"PortID",
222 .key_max_value = 65534,
227 .has_rw_enable =
false
231 .name =
"Transceiver",
232 .generic_path =
"XPON.ONU.x.ANI.x.Transceiver",
239 .has_rw_enable =
false
243 .name =
"ONUActivation",
244 .generic_path =
"XPON.ONU.x.ANI.x.TC.ONUActivation",
250 .has_rw_enable =
false
254 .name =
"Authentication",
255 .generic_path =
"XPON.ONU.x.ANI.x.TC.Authentication",
261 .has_rw_enable =
false
265 .name =
"PerformanceThresholds",
266 .generic_path =
"XPON.ONU.x.ANI.x.TC.PerformanceThresholds",
272 .has_rw_enable =
false
277 .generic_path =
"XPON.ONU.x.ANI.x.TC.Alarms",
283 .has_rw_enable =
false
301 SAH_TRACEZ_ERROR(
ME,
"OBJECT_INFO[%d].id=%d != %d",
323 when_null(path, exit_no_cleanup);
324 when_null(generic_path, exit_no_cleanup);
327 amxc_llist_init(&list);
330 amxc_string_init(&input, 0);
331 amxc_string_set(&input, path);
333 if(AMXC_STRING_SPLIT_OK != amxc_string_split_to_llist(&input, &list,
'.')) {
334 SAH_TRACEZ_ERROR(
ME,
"Failed to split '%s'", path);
339 amxc_llist_it_t* last_it = amxc_llist_get_last(&list);
340 when_null(last_it, exit);
341 amxc_string_t*
const last_elem = amxc_string_from_llist_it(last_it);
342 if(amxc_string_is_numeric(last_elem)) {
343 amxc_llist_take_last(&list);
344 amxc_string_list_it_free(last_it);
347 amxc_llist_iterate(it, &list) {
348 amxc_string_t* part = amxc_string_from_llist_it(it);
349 if(amxc_string_is_numeric(part)) {
350 amxc_string_set(part,
"x");
354 if(amxc_string_join_llist(generic_path, &list,
'.') != 0) {
355 SAH_TRACEZ_ERROR(
ME,
"Failed to generate generic path from '%s'", path);
361 amxc_llist_clean(&list, amxc_string_list_it_free);
362 amxc_string_clean(&input);
384 amxc_string_t generic_path_str;
385 amxc_string_init(&generic_path_str, 0);
391 const char*
const generic_path = amxc_string_get(&generic_path_str, 0);
392 const size_t generic_path_len = strlen(generic_path);
398 if((generic_path_len == len) &&
399 (strncmp(generic_path,
OBJECT_INFO[i].generic_path, len) == 0)) {
406 amxc_string_clean(&generic_path_str);
415 SAH_TRACEZ_ERROR(
ME,
"Invalid id [%d]",
id);
437 SAH_TRACEZ_ERROR(
ME,
"Invalid id [%d]",
id);
static const param_info_t SOFTWARE_IMAGE_PARAMS[]
static const param_info_t TC_ALARMS_PARAMS[]
static bool dm_convert_to_generic_path(const char *path, amxc_string_t *generic_path)
bool dm_get_object_param_info(object_id_t id, const param_info_t **param_info, uint32_t *size)
static const param_info_t AUTHENTICATION_PARAMS[]
static const param_info_t ANI_PARAMS[]
static const param_info_t TRANSCEIVER_PARAMS[]
static const param_info_t ETHERNET_UNI_PARAMS[]
object_id_t dm_get_object_id(const char *path)
static const param_info_t PERFORMANCE_THRESHOLDS_PARAMS[]
static const param_info_t GEM_PORT_PARAMS[]
static const param_info_t ONU_ACTIVATION_PARAMS[]
const object_info_t OBJECT_INFO[obj_id_nbr]
static const param_info_t ONU_PARAMS[]
const object_info_t * dm_get_object_info(object_id_t id)
enum _xpon_object_id object_id_t
@ obj_id_ani_tc_authentication
@ obj_id_ani_tc_performance_thresholds
@ obj_id_ani_tc_onu_activation
const param_info_t * params