TR181-XPON  1.4.0
TR-181 PON manager.
onu_priv.h File Reference
#include <stdbool.h>
#include <amxc/amxc.h>
#include <amxp/amxp.h>
#include <amxd/amxd_object.h>

Go to the source code of this file.

Data Structures

struct  _onu_priv
 

Typedefs

typedef struct _onu_priv onu_priv_t
 

Functions

void onu_priv_attach_private_data (amxd_object_t *const object)
 
void onu_priv_delete_private_data (onu_priv_t *priv)
 

Detailed Description

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

tr181-xpon attaches private data to an ONU object to track if it already checked if the ONU is enabled according to the persistency data.

Definition in file onu_priv.h.

Typedef Documentation

◆ onu_priv_t

typedef struct _onu_priv onu_priv_t

Struct with dummy field.

tr181-xpon is only interested if private data is attached to an ONU instance. The actual content is don't care.

Function Documentation

◆ onu_priv_attach_private_data()

void onu_priv_attach_private_data ( amxd_object_t *const  object)

Attach private data to the ONU instance.

Parameters
[in]objectthe ONU instance

Definition at line 77 of file onu_priv.c.

77  {
78  when_null_trace(object, exit, ERROR, "object is NULL");
79  when_not_null_trace(object->priv, exit, ERROR, "object has already priv data");
80 
81  onu_priv_t* const priv = calloc(1, sizeof(onu_priv_t));
82  when_null_trace(priv, exit, ERROR, "Failed to create onu_priv_t");
83  object->priv = priv;
84 
85 exit:
86  return;
87 }
Here is the caller graph for this function:

◆ onu_priv_delete_private_data()

void onu_priv_delete_private_data ( onu_priv_t priv)

Definition at line 89 of file onu_priv.c.

89  {
90  if(priv) {
91  free(priv);
92  }
93 }
Here is the caller graph for this function: