TR181-XPON  1.4.0
TR-181 PON manager.
object_intf_priv.h File Reference
#include <stdint.h>
#include <amxc/amxc.h>

Go to the source code of this file.

Data Structures

struct  _object_intf_priv
 

Typedefs

typedef struct _object_intf_priv object_intf_priv_t
 

Functions

void oipriv_attach_private_data (const amxc_var_t *const data)
 
void oipriv_delete_private_data (object_intf_priv_t *priv)
 
void oipriv_update_last_change (const amxc_var_t *const data)
 

Detailed Description

Functions related to the private data attached to an interface object.

tr181-xpon attaches private data to the interface objects EthernetUNI and ANI to implement their LastChange parameter.

Definition in file object_intf_priv.h.

Typedef Documentation

◆ object_intf_priv_t

Type of private data attached to an interface object.

@last_change: timestamp indicating when Status changed the last time. Expressed in seconds since startup.

Function Documentation

◆ oipriv_attach_private_data()

void oipriv_attach_private_data ( const amxc_var_t *const  data)

Attach private data to interface object referred by data.

Parameters
[in]dataevent data. It has the path and the index of the instance just added.

tr181-xpon calls this function if an EthernetUNI or ANI instance is added to attach private data to the instance.

Definition at line 106 of file object_intf_priv.c.

106  {
107 
108  const char* const path = GETP_CHAR(data, "path");
109  const uint32_t index = GET_UINT32(data, "index");
110  SAH_TRACEZ_DEBUG(ME, "path='%s' index=%d", path, index);
111 
112  amxd_dm_t* const dm = xpon_mngr_get_dm();
113  const amxd_object_t* const obj = amxd_dm_signal_get_object(dm, data);
114  amxd_object_t* const inst = amxd_object_get_instance(obj, NULL, index);
115  when_null_trace(inst, exit, ERROR, "Failed to get instance");
116  object_intf_priv_t* const priv = create_priv();
117  when_null_trace(priv, exit, ERROR, "Failed to create object_intf_priv_t");
118  inst->priv = priv;
119 
120 exit:
121  return;
122 }
amxd_dm_t *PRIVATE xpon_mngr_get_dm(void)
static object_intf_priv_t * create_priv(void)
on event dm
#define SAH_TRACEZ_DEBUG(zone, format,...)
Definition: xpon_trace.h:115
#define ME
Definition: xpon_trace.h:78
Here is the call graph for this function:
Here is the caller graph for this function:

◆ oipriv_delete_private_data()

void oipriv_delete_private_data ( object_intf_priv_t priv)

Definition at line 124 of file object_intf_priv.c.

124  {
125  if(priv) {
126  free(priv);
127  }
128 }
Here is the caller graph for this function:

◆ oipriv_update_last_change()

void oipriv_update_last_change ( const amxc_var_t *const  data)

Update the last_change field in the private data of an interface object.

Parameters
[in]dataevent data. It has the path of the interface object for which this function must update the last_change field.

tr181-xpon calls this function if the Status parameter of an interface object is changed.

Definition at line 139 of file object_intf_priv.c.

139  {
140 
141  const char* const path = GETP_CHAR(data, "path");
142  SAH_TRACEZ_DEBUG(ME, "path='%s'", path);
143 
144  amxd_dm_t* const dm = xpon_mngr_get_dm();
145  const amxd_object_t* const obj = amxd_dm_signal_get_object(dm, data);
146  when_null_trace(obj->priv, exit, ERROR, "object %s has no private data", path);
147 
148  object_intf_priv_t* const priv = (object_intf_priv_t* const) obj->priv;
150 
151 exit:
152  return;
153 }
uint32_t time_get_system_uptime(void)
Definition: utils_time.c:75
Here is the call graph for this function:
Here is the caller graph for this function: