TR181-XPON  1.4.0
TR-181 PON manager.
populate_dm_startup.h File Reference
#include <stdbool.h>

Go to the source code of this file.

Functions

bool pplt_dm_init (void)
 
void pplt_dm_cleanup (void)
 

Detailed Description

Functionality to populate the XPON DM after startup.

The plugin checks the first few minutes after startup for any ONUs to be added to the XPON DM. After that this part of the plugin does not do anything anymore.

Definition in file populate_dm_startup.h.

Function Documentation

◆ 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 amxc_llist_t s_tasks
static amxp_timer_t * s_timer_query_onus
static void task_delete(amxc_llist_it_t *hit)
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
#define ME
Definition: xpon_trace.h:78
Here is the call graph for this function:
Here is the caller graph for this function: