TR181-XPON  1.4.0
TR-181 PON manager.
populate_dm_startup.c File Reference
#include "populate_dm_startup.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <amxc/amxc_macros.h>
#include <amxc/amxc.h>
#include <amxp/amxp_timer.h>
#include "data_model.h"
#include "dm_info.h"
#include "pon_ctrl.h"
#include "xpon_mgr_constants.h"
#include "xpon_trace.h"

Go to the source code of this file.

Data Structures

struct  _task
 

Macros

#define QUERY_ONUS_INTERVAL_MS   10000
 
#define QUERY_ONUS_NR_TIMES   30
 

Typedefs

typedef enum _task_type task_type_t
 
typedef struct _task task_t
 

Enumerations

enum  _task_type { task_none , task_query_indexes , task_query_content , task_type_nr }
 

Functions

static const char * task_type_to_string (task_type_t type)
 
static void task_init (task_t *const task, const char *const path, uint32_t index, task_type_t type)
 
static void task_clean (task_t *const task)
 
static task_ttask_create (const char *const path, uint32_t index, task_type_t type)
 
static void task_delete (amxc_llist_it_t *hit)
 
static bool check_return_values (int rc, const amxc_var_t *const ret, const char *func, const char *const path, uint32_t index)
 
static void query_children (const char *const path, uint32_t index, object_id_t id, bool templates)
 
static void query_content (const task_t *task)
 
static void query_indexes (const task_t *task)
 
static void schedule_remaining_tasks (void)
 
static void handle_task (UNUSED amxp_timer_t *timer, UNUSED void *priv)
 
static void query_onu_instances (amxp_timer_t *timer, UNUSED void *priv)
 
bool pplt_dm_init (void)
 
void pplt_dm_cleanup (void)
 

Variables

static amxp_timer_t * s_timer_query_onus = NULL
 
static uint32_t s_cntr_query_onus = 0
 
static amxc_llist_t s_tasks = { 0 }
 
static amxp_timer_t * s_timer_handle_tasks = NULL
 
static bool s_onu_initialised [MAX_NR_OF_ONUS] = { 0 }
 

Macro Definition Documentation

◆ QUERY_ONUS_INTERVAL_MS

#define QUERY_ONUS_INTERVAL_MS   10000

Query ONU instances every 10 s during the first 5 minutes after startup.

30 intervals of 10 s corresponds to 5 minutes.

Definition at line 104 of file populate_dm_startup.c.

◆ QUERY_ONUS_NR_TIMES

#define QUERY_ONUS_NR_TIMES   30

Definition at line 105 of file populate_dm_startup.c.

Typedef Documentation

◆ task_t

typedef struct _task task_t

A task to help in populating the XPON DM after startup.

  • path object path, e.g. "XPON.ONU"
  • index index instance for a template object. 0 if not applicable.
  • type task type. See task_type_t.
  • it to put a task in the list 's_tasks'

If 'path' refers to a template object, then:

  • 'index' is 0 (not applicable) if 'type' is 'task_query_indexes': the task will query the instances of the template object. The task is not for a specific instance of the template object.
  • 'index' is an actual instance index if type is 'task_query_content'.

◆ task_type_t

typedef enum _task_type task_type_t

Task type.

When populating the XPON DM at startup, the plugin schedules 2 types of tasks:

  • tasks to find out which instances it should create for a template object, e.g., for an object such as "XPON.ONU". They have 'task_query_indexes' as type.
  • tasks to query the values to be assigned to the params of the object. They have 'task_query_content' as type.

Enumeration Type Documentation

◆ _task_type

enum _task_type

Task type.

When populating the XPON DM at startup, the plugin schedules 2 types of tasks:

  • tasks to find out which instances it should create for a template object, e.g., for an object such as "XPON.ONU". They have 'task_query_indexes' as type.
  • tasks to query the values to be assigned to the params of the object. They have 'task_query_content' as type.
Enumerator
task_none 
task_query_indexes 
task_query_content 
task_type_nr 

Definition at line 119 of file populate_dm_startup.c.

119  {
120  task_none,
124 } task_type_t;
enum _task_type task_type_t
@ task_query_content
@ task_type_nr
@ task_query_indexes
@ task_none

Function Documentation

◆ check_return_values()

static bool check_return_values ( int  rc,
const amxc_var_t *const  ret,
const char *  func,
const char *const  path,
uint32_t  index 
)
static

Do basic checks on the return values of a call towards the vendor module.

Parameters
[in]rcreturn code of the call towards the vendor module.
[in]retresult returned by vendor module
[in]funcname of the function called in the vendor module. For logging only.
[in]pathobject path for which function was called. This can refer to a singleton or template object. For logging only.
[in]indexif function was called for an instance, this parameter is the instance index. It must be 0 if the function was called for a singleton. For logging only.

The function returns false if:

  • rc is not 0
  • ret is not an htable
Returns
true if function call towards the vendor module is ok according to the 1st checks done by this function, else false

Definition at line 225 of file populate_dm_startup.c.

229  {
230  bool rv = false;
231 
232  amxc_string_t buf; /* for logging only */
233  amxc_string_init(&buf, 0);
234 
235  if(index) {
236  amxc_string_setf(&buf, "%s(%s.%d)", func, path, index);
237  } else {
238  amxc_string_setf(&buf, "%s(%s)", func, path);
239  }
240  const char* const fc = amxc_string_get(&buf, 0); /*function call */
241 
242  if(rc) {
243  SAH_TRACEZ_ERROR(ME, "%s failed: rc=%d", fc, rc);
244  goto exit;
245  }
246 
247  const uint32_t type = amxc_var_type_of(ret);
248  if(type != AMXC_VAR_ID_HTABLE) {
249  SAH_TRACEZ_ERROR(ME, "%s: type of 'ret'= %d != htable", fc, type);
250  goto exit;
251  }
252  rv = true;
253 exit:
254  amxc_string_clean(&buf);
255  return rv;
256 }
#define ME
Definition: xpon_trace.h:78
Here is the caller graph for this function:

◆ handle_task()

static void handle_task ( UNUSED amxp_timer_t *  timer,
UNUSED void *  priv 
)
static

Handle the 1st task from s_tasks, remove it from the list, and delete it.

Subsequently reschedule the timer if there are remaining tasks.

Definition at line 536 of file populate_dm_startup.c.

536  {
537 
538  if(amxc_llist_is_empty(&s_tasks)) {
539  SAH_TRACEZ_WARNING(ME, "No tasks");
540  return;
541  }
542 
543  amxc_llist_it_t* const it = amxc_llist_get_first(&s_tasks);
544 
545  const task_t* const task = amxc_container_of(it, task_t, it);
546 
547  switch(task->type) {
548  case task_query_indexes:
549  query_indexes(task);
550  break;
551  case task_query_content:
552  query_content(task);
553  break;
554  default:
555  SAH_TRACEZ_WARNING(ME, "Unknown task type: %d", task->type);
556  break;
557  }
558  /* Remove the 1st task from the list and delete it */
559  amxc_llist_it_clean(it, task_delete);
560 
562 }
static void schedule_remaining_tasks(void)
static void query_content(const task_t *task)
static amxc_llist_t s_tasks
static void query_indexes(const task_t *task)
static void task_delete(amxc_llist_it_t *hit)
task_type_t type
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pplt_dm_cleanup()

void pplt_dm_cleanup ( void  )

Clean up the part responsible for populating the XPON DM at startup.

The plugin must call this function once when stopping.

Definition at line 648 of file populate_dm_startup.c.

648  {
649  amxc_llist_clean(&s_tasks, task_delete);
650  amxp_timer_delete(&s_timer_handle_tasks);
651  amxp_timer_delete(&s_timer_query_onus);
652 }
static amxp_timer_t * s_timer_handle_tasks
static amxp_timer_t * s_timer_query_onus
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pplt_dm_init()

bool pplt_dm_init ( void  )

Initialize the part responsible for populating the XPON DM at startup.

To start the whole process of the populating the XPON DM, the function schedules a task to query the instances of XPON.ONU every 10 s. (The plugin will stop the timer when it has found MAX_NR_OF_ONUS ONUs, or when 5 minutes have passed since startup.)

The plugin must call this function once at startup.

Definition at line 619 of file populate_dm_startup.c.

619  {
620  bool rv = false;
621 
622  amxc_llist_init(&s_tasks);
623 
624  if(amxp_timer_new(&s_timer_handle_tasks, handle_task, NULL)) {
625  SAH_TRACEZ_ERROR(ME, "Failed to create timer to handle tasks");
626  goto exit;
627  }
628 
629  if(amxp_timer_new(&s_timer_query_onus, query_onu_instances, NULL)) {
630  SAH_TRACEZ_ERROR(ME, "Failed to create timer to query ONUs");
631  goto exit;
632  }
633  amxp_timer_set_interval(s_timer_query_onus, QUERY_ONUS_INTERVAL_MS);
634 
635  /* Start querying the DM on the southbound IF */
636  amxp_timer_start(s_timer_query_onus, SHORT_TIMEOUT_MS);
637 
638  rv = true;
639 exit:
640  return rv;
641 }
static void handle_task(UNUSED amxp_timer_t *timer, UNUSED void *priv)
static void query_onu_instances(amxp_timer_t *timer, UNUSED void *priv)
#define QUERY_ONUS_INTERVAL_MS
#define SHORT_TIMEOUT_MS
Here is the call graph for this function:
Here is the caller graph for this function:

◆ query_children()

static void query_children ( const char *const  path,
uint32_t  index,
object_id_t  id,
bool  templates 
)
static

Query the children of an object.

Parameters
[in]pathobject path of a singleton or template object
[in]indexinstance index for a template object. 0 (not applicable) for a singleton.
[in]idobject ID (caller normally derived it from path)
[in]templatestrue if the function should query the children which are template objects, false if it should query the children which are singleton objects.

The function appends a task to 's_tasks' for each child. It does not do any updates to the XPON DM.

For a child which is a singleton, it adds a task of type 'task_query_content'. For a child which is a template, it adds a task of type 'task_query_indexes'.

Example: An instance of "XPON.ONU.x.ANI" has children which are singletons, and children which are templates:

  • singletons: TC.ONUActivation,TC.PerformanceThresholds,TC.Alarms
  • templates: TC.GEM.Port,Transceiver If this function is called for such an instance, e.g., for the instance with path = "XPON.ONU.1.ANI" and index = 1, then this function adds following tasks to 's_tasks':
  • 3 tasks of type 'task_query_content', for TC.ONUActivation, TC.PerformanceThresholds and TC.Alarms respectively.
  • 2 tasks of type 'task_query_indexes', for TC.GEM.Port and Transceiver respectively.

Definition at line 288 of file populate_dm_startup.c.

289  {
290 
291  const object_info_t* const info = dm_get_object_info(id);
292  when_null(info, exit_no_cleanup);
293 
294  const char* const children_char = templates ? info->templates : info->singletons;
295  if(NULL == children_char) {
296  /* Nothing to do */
297  return;
298  }
299 
300  amxc_llist_t children;
301  amxc_llist_init(&children);
302 
303  amxc_string_t str;
304  amxc_string_init(&str, 0);
305  amxc_string_set(&str, children_char);
306 
307  if(AMXC_STRING_SPLIT_OK != amxc_string_split_to_llist(&str, &children, ',')) {
308  SAH_TRACEZ_ERROR(ME, "Failed to split '%s'", children_char);
309  goto exit;
310  }
311 
312  char child_path[256];
313 
314  amxc_llist_iterate(it, &children) {
315  const amxc_string_t* const child = amxc_string_from_llist_it(it);
316  const char* const child_cstr = amxc_string_get(child, 0);
317  if(index) {
318  snprintf(child_path, 256, "%s.%d.%s", path, index, child_cstr);
319  } else {
320  snprintf(child_path, 256, "%s.%s", path, child_cstr);
321  }
322  SAH_TRACEZ_DEBUG(ME, "Schedule query %s of %s",
323  templates ? "indexes" : "content", child_path);
324 
325  task_create(child_path, /*index=*/ 0,
326  templates ? task_query_indexes : task_query_content);
327  }
328 
329 exit:
330  amxc_llist_clean(&children, amxc_string_list_it_free);
331  amxc_string_clean(&str);
332 exit_no_cleanup:
333  return;
334 }
const object_info_t * dm_get_object_info(object_id_t id)
Definition: dm_info.c:410
static task_t * task_create(const char *const path, uint32_t index, task_type_t type)
const char * singletons
Definition: dm_info.h:128
const char * templates
Definition: dm_info.h:129
#define SAH_TRACEZ_DEBUG(zone, format,...)
Definition: xpon_trace.h:115
Here is the call graph for this function:
Here is the caller graph for this function:

◆ query_content()

static void query_content ( const task_t task)
static

Ask vendor module for object content, update DM and add tasks to query children.

Parameters
[in]taskhas info about the object to query. If the field 'index' is 0, the task queries a singleton object, else it queries the instance with that index of a template object.

The object content consists of the values to be assigned to the params of the object.

The function calls the function get_object_content() in the pon_ctrl namespace of the vendor module. It adds the instance to the XPON DM if it queried the instance of a template object, or it updates the object if it queried a singleton object.

The function subsequently adds tasks to 's_tasks' to handle the children of the object. It adds a task of type 'task_query_content' for each child which is a singleton, and it adds a task of type 'task_query_indexes' for each child which is a template.

Definition at line 356 of file populate_dm_startup.c.

356  {
357 
358  const char* path = amxc_string_get(&task->path, 0);
359  if(!path) {
360  SAH_TRACEZ_ERROR(ME, "Failed to get path");
361  return;
362  }
363  SAH_TRACEZ_DEBUG(ME, "path='%s' index=%d", path, task->index);
364 
365  amxc_var_t ret;
366  amxc_var_init(&ret);
367 
368  const int rc = pon_ctrl_get_object_content(path, task->index, &ret);
369 
370  if(!check_return_values(rc, &ret, "get_object_content", path, task->index)) {
371  goto exit;
372  }
373  if(amxc_var_add_key(cstring_t, &ret, "path", path) == NULL) {
374  SAH_TRACEZ_ERROR(ME, "Failed to add 'path' to 'ret'");
375  goto exit;
376  }
377  if(task->index) {
378  if(amxc_var_add_key(uint32_t, &ret, "index", task->index) == NULL) {
379  SAH_TRACEZ_ERROR(ME, "Failed to add 'index' to 'ret'");
380  goto exit;
381  }
383  SAH_TRACEZ_ERROR(ME, "Failed to create %s.%d", path, task->index);
384  goto exit;
385  }
386  } else {
387  if(dm_change_object(&ret)) {
388  SAH_TRACEZ_ERROR(ME, "Failed to update %s", path);
389  /* Do not jump to 'exit'. Still attempt to update any sub-objects. */
390  }
391  }
392 
393  const object_id_t id = dm_get_object_id(path);
394  if(obj_id_unknown == id) {
395  SAH_TRACEZ_DEBUG(ME, "%s has no sub-objects", path);
396  goto exit;
397  }
398 
399  query_children(path, task->index, id, false);
400  query_children(path, task->index, id, true);
401 
402  if(obj_id_onu == id) {
403  if((task->index != 0) && (task->index <= MAX_NR_OF_ONUS)) {
404  SAH_TRACEZ_INFO(ME, "XPON.ONU.%d is initialised", task->index);
405  s_onu_initialised[task->index - 1] = 1;
406  } else {
407  SAH_TRACEZ_ERROR(ME, "XPON.ONU: invalid index: %d: not in [1, %d]",
408  task->index, MAX_NR_OF_ONUS);
409  }
410  }
411 
412 exit:
413  amxc_var_clean(&ret);
414 }
int dm_change_object(const amxc_var_t *const args)
Definition: data_model.c:821
int dm_add_or_change_instance_impl(const amxc_var_t *const args)
Definition: data_model.c:922
object_id_t dm_get_object_id(const char *path)
Definition: dm_info.c:380
enum _xpon_object_id object_id_t
@ obj_id_onu
Definition: dm_info.h:80
@ obj_id_unknown
Definition: dm_info.h:91
int pon_ctrl_get_object_content(const char *const path, uint32_t index, amxc_var_t *ret)
Definition: pon_ctrl.c:216
static bool check_return_values(int rc, const amxc_var_t *const ret, const char *func, const char *const path, uint32_t index)
static bool s_onu_initialised[MAX_NR_OF_ONUS]
static void query_children(const char *const path, uint32_t index, object_id_t id, bool templates)
uint32_t index
amxc_string_t path
Here is the call graph for this function:
Here is the caller graph for this function:

◆ query_indexes()

static void query_indexes ( const task_t task)
static

Ask the vendor module which instances it should create for a template object.

Parameters
[in]taskhas info about the template object

The function calls the function get_list_of_instances() in the pon_ctrl namespace of the vendor module. It appends a task of type task_query_content to 's_tasks' for each instance which does not yet exist in the XPON DM.

The function does not change anything in the XPON DM.

If the get_list_of_instances() call fails, the function logs an error and immediately returns an error. It does not retry.

Example: if task->path is XPON.ONU, it asks the vendor module if there are any instances for this object. If the vendor module returns the indexes 1 and 2, XPON.ONU.1 already exists and XPON.ONU.2 not, the function appends a task to 's_tasks' to query the content of XPON.ONU.2.

Check instance exists.

For an XPON.ONU instance also check if it's already initialised.

Definition at line 436 of file populate_dm_startup.c.

436  {
437 
438  const char* const path = amxc_string_get(&task->path, 0);
439  if(!path) {
440  SAH_TRACEZ_ERROR(ME, "Failed to get path");
441  return;
442  }
443  SAH_TRACEZ_DEBUG(ME, "path='%s' index=%d", path, task->index);
444 
445  amxc_var_t ret;
446  amxc_var_init(&ret);
447 
448  amxc_string_t indexes_str;
449  amxc_string_init(&indexes_str, 0);
450 
451  amxc_llist_t indexes_list;
452  amxc_llist_init(&indexes_list);
453 
454  const int rc = pon_ctrl_get_list_of_instances(path, &ret);
455 
456  if(!check_return_values(rc, &ret, "get_list_of_instances", path, task->index)) {
457  goto exit;
458  }
459 
460  const amxc_htable_t* const htable = amxc_var_constcast(amxc_htable_t, &ret);
461  if(!amxc_htable_contains(htable, "indexes")) {
462  SAH_TRACEZ_ERROR(ME, "htable 'ret' does not contain 'indexes'");
463  goto exit;
464  }
465 
466  const char* const indexes = GET_CHAR(&ret, "indexes");
467  if(0 == strlen(indexes)) {
468  SAH_TRACEZ_DEBUG(ME, "path='%s' index=%d: no instances", path, task->index);
469  goto exit;
470  }
471  SAH_TRACEZ_DEBUG(ME, "indexes='%s'", indexes);
472 
473  amxc_string_set(&indexes_str, indexes);
474 
475  if(AMXC_STRING_SPLIT_OK != amxc_string_split_to_llist(&indexes_str, &indexes_list, ',')) {
476  SAH_TRACEZ_ERROR(ME, "Failed to split '%s'", indexes);
477  goto exit;
478  }
479 
480  amxc_llist_iterate(it, &indexes_list) {
481  const amxc_string_t* const index_str = amxc_string_from_llist_it(it);
482  const char* const index_cstr = amxc_string_get(index_str, 0);
483  if(!amxc_string_is_numeric(index_str)) {
484  SAH_TRACEZ_ERROR(ME, "'%s' is not numeric", index_cstr);
485  continue;
486  }
487  const uint32_t index = atoi(index_cstr);
488 
494  SAH_TRACEZ_DEBUG(ME, "check instance already exists path=%s, index=%d", path, index);
495  if(strcmp(path, "XPON.ONU") == 0) {
496  if((0 == index) || (index > MAX_NR_OF_ONUS)) {
497  SAH_TRACEZ_ERROR(ME, "Invalid index: %d: not in [1, %d]", index, MAX_NR_OF_ONUS);
498  continue;
499  }
500 
501  if(dm_does_instance_exist(path, index) && s_onu_initialised[index - 1]) {
502  SAH_TRACEZ_DEBUG(ME, "%s.%d already exists", path, index);
503  continue;
504  }
505  } else {
506  if(dm_does_instance_exist(path, index)) {
507  SAH_TRACEZ_DEBUG(ME, "%s.%d already exists", path, index);
508  continue;
509  }
510 
511  }
512 
513  SAH_TRACEZ_DEBUG(ME, "Schedule query content of %s.%d", path, index);
514 
515  task_create(path, index, task_query_content);
516  }
517 
518 exit:
519  amxc_llist_clean(&indexes_list, amxc_string_list_it_free);
520  amxc_string_clean(&indexes_str);
521  amxc_var_clean(&ret);
522 }
bool dm_does_instance_exist(const char *path, uint32_t index)
Definition: data_model.c:1141
int pon_ctrl_get_list_of_instances(const char *const path, amxc_var_t *ret)
Definition: pon_ctrl.c:187
Here is the call graph for this function:
Here is the caller graph for this function:

◆ query_onu_instances()

static void query_onu_instances ( amxp_timer_t *  timer,
UNUSED void *  priv 
)
static

Ask vendor module for instances of XPON.ONU.

Parameters
[in,out]timertimer to query the instances of XPON.ONU every 10 s

The function stops the timer if the number of instances of XPON.ONU is MAX_NR_OF_ONUS, or if 5 minutes passed since startup.

Otherwise the function calls query_indexes() for XPON.ONU.

Definition at line 574 of file populate_dm_startup.c.

574  {
575 
576  task_t task;
577  task_init(&task, "XPON.ONU", /*index=*/ 0, task_query_indexes);
578 
579  SAH_TRACEZ_DEBUG(ME, "s_cntr_query_onus=%d", s_cntr_query_onus);
580 
581  /* Check if all the ONU instances are initialised */
582  bool all_onus_initialised = true;
583  for(int i = 0; i < MAX_NR_OF_ONUS; i++) {
584  if(!s_onu_initialised[i]) {
585  all_onus_initialised = false;
586  break;
587  }
588  }
589  if(all_onus_initialised) {
590  SAH_TRACEZ_INFO(ME, "All %d ONUs found and initialised", MAX_NR_OF_ONUS);
591  amxp_timer_stop(timer);
592  goto exit;
593  }
594 
597  SAH_TRACEZ_DEBUG(ME, "Stop querying ONU instances");
598  amxp_timer_stop(timer);
599  goto exit;
600  }
601 
602  query_indexes(&task);
604 
605 exit:
606  task_clean(&task);
607 }
static void task_init(task_t *const task, const char *const path, uint32_t index, task_type_t type)
static void task_clean(task_t *const task)
static uint32_t s_cntr_query_onus
#define QUERY_ONUS_NR_TIMES
Here is the call graph for this function:
Here is the caller graph for this function:

◆ schedule_remaining_tasks()

static void schedule_remaining_tasks ( void  )
static

Definition at line 524 of file populate_dm_startup.c.

524  {
525 
526  if(!amxc_llist_is_empty(&s_tasks)) {
527  amxp_timer_start(s_timer_handle_tasks, SHORT_TIMEOUT_MS);
528  }
529 }
Here is the caller graph for this function:

◆ task_clean()

static void task_clean ( task_t *const  task)
static

Definition at line 164 of file populate_dm_startup.c.

164  {
165  amxc_string_clean(&task->path);
166 }
Here is the caller graph for this function:

◆ task_create()

static task_t* task_create ( const char *const  path,
uint32_t  index,
task_type_t  type 
)
static

Create task and append it to 's_tasks'.

If it fails to create the task or to append the task to 's_tasks', the function is a no-op.

Returns
task created on success, else NULL

Definition at line 176 of file populate_dm_startup.c.

176  {
177 
178  task_t* task = (task_t*) calloc(1, sizeof(task_t));
179  when_null_trace(task, exit, ERROR, "Failed to allocate memory for task_t");
180 
181  task_init(task, path, index, type);
182 
183  if(amxc_llist_append(&s_tasks, &task->it)) {
184  SAH_TRACEZ_ERROR(ME, "Failed to append task to 's_tasks'");
185  SAH_TRACEZ_ERROR(ME, " path='%s' index=%d type=%s", path, index,
186  task_type_to_string(type));
187  task_clean(task);
188  free(task);
189  task = NULL;
190  }
191 
192 exit:
193  return task;
194 }
static const char * task_type_to_string(task_type_t type)
amxc_llist_it_t it
Here is the call graph for this function:
Here is the caller graph for this function:

◆ task_delete()

static void task_delete ( amxc_llist_it_t *  hit)
static

Definition at line 196 of file populate_dm_startup.c.

196  {
197  task_t* task = amxc_container_of(hit, task_t, it);
198  const char* path = amxc_string_get(&task->path, 0);
199  SAH_TRACEZ_DEBUG(ME, "path='%s' index=%d type=%s", path, task->index,
200  task_type_to_string(task->type));
201  task_clean(task);
202  free(task);
203 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ task_init()

static void task_init ( task_t *const  task,
const char *const  path,
uint32_t  index,
task_type_t  type 
)
static

Definition at line 156 of file populate_dm_startup.c.

157  {
158  amxc_string_init(&task->path, 0);
159  amxc_string_set(&task->path, path);
160  task->index = index;
161  task->type = type;
162 }
Here is the caller graph for this function:

◆ task_type_to_string()

static const char* task_type_to_string ( task_type_t  type)
static

Definition at line 147 of file populate_dm_startup.c.

147  {
148  switch(type) {
149  case task_query_indexes: return "query_indexes";
150  case task_query_content: return "query_content";
151  default: break;
152  }
153  return "none";
154 }
Here is the caller graph for this function:

Variable Documentation

◆ s_cntr_query_onus

uint32_t s_cntr_query_onus = 0
static

Counts the number of times the plugin has queried for the existence of ONUs since startup.

Definition at line 89 of file populate_dm_startup.c.

◆ s_onu_initialised

bool s_onu_initialised[MAX_NR_OF_ONUS] = { 0 }
static

Definition at line 96 of file populate_dm_startup.c.

◆ s_tasks

amxc_llist_t s_tasks = { 0 }
static

Definition at line 92 of file populate_dm_startup.c.

◆ s_timer_handle_tasks

amxp_timer_t* s_timer_handle_tasks = NULL
static

Definition at line 94 of file populate_dm_startup.c.

◆ s_timer_query_onus

amxp_timer_t* s_timer_query_onus = NULL
static

Definition at line 84 of file populate_dm_startup.c.