cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
361
Views
0
Helpful
0
Replies

Append a list through the generated .c file

badreddine1359
Level 1
Level 1

Hi,

I am using the OpenYuma netconf server-client.

I have wrote a model I successfully edited, read, execute data through editing the genrated c file.
My question is I have a list in my Yang file, and i want to know how to append this list in the c file.
this is my list :
container onus {
list interfaces {
key "MAC";
leaf MAC {
type string;
}
}
}
And this is the c file part of edit this list :
FUNCTION u_tapi_onus_interfaces_edit
*

Edit database object callback
Path: /onus/interfaces
Add object instrumentation in COMMIT phase.
INPUTS:

see agt/agt_cb.h for details

k_ parameters are ancestor list key values.

RETURNS:

error status

********************************************************************/
status_t u_tapi_onus_interfaces_edit (
ses_cb_t *scb,
rpc_msg_t *msg,
agt_cbtyp_t cbtyp,
op_editop_t editop,
val_value_t *newval,
val_value_t *curval,
const xmlChar *k_onus_interfaces_MAC)
{
status_t res = NO_ERR;

if (LOGDEBUG) {
log_debug("\nEnter u_tapi_onus_interfaces_edit callback for %s phase",
agt_cbtype_name(cbtyp));
}

switch (cbtyp) {
case AGT_CB_VALIDATE:
/* description-stmt validation here /
break;
case AGT_CB_APPLY:
/
database manipulation done here /
break;
case AGT_CB_COMMIT:
/
device instrumentation done here /
switch (editop) {
case OP_EDITOP_LOAD:
break;
case OP_EDITOP_MERGE:
break;
case OP_EDITOP_REPLACE:
break;
case OP_EDITOP_CREATE:
break;
case OP_EDITOP_DELETE:
break;
default:
res = SET_ERROR(ERR_INTERNAL_VAL);
}
break;
case AGT_CB_ROLLBACK:
/
undo device instrumentation here */
break;
default:
res = SET_ERROR(ERR_INTERNAL_VAL);
}
return res;

} /* u_tapi_onus_interfaces_edit */

let's say I want to append the list of interfaces when a certain condition is satisfied through the generated c file, how should I do it ?

Thanks in advance !

0 Replies 0