<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Append a list through the generated .c file in Tools</title>
    <link>https://community.cisco.com/t5/tools/append-a-list-through-the-generated-c-file/m-p/3872433#M2271</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am using the OpenYuma netconf server-client.&lt;/P&gt;&lt;P&gt;I have wrote a model I successfully edited, read, execute data through editing the genrated c file.&lt;BR /&gt;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.&lt;BR /&gt;this is my list :&lt;BR /&gt;container onus {&lt;BR /&gt;list interfaces {&lt;BR /&gt;key "MAC";&lt;BR /&gt;leaf MAC {&lt;BR /&gt;type string;&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;And this is the c file part of edit this list :&lt;BR /&gt;FUNCTION u_tapi_onus_interfaces_edit&lt;BR /&gt;*&lt;/P&gt;&lt;PRE&gt;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&lt;/PRE&gt;&lt;P&gt;********************************************************************/&lt;BR /&gt;status_t u_tapi_onus_interfaces_edit (&lt;BR /&gt;ses_cb_t *scb,&lt;BR /&gt;rpc_msg_t *msg,&lt;BR /&gt;agt_cbtyp_t cbtyp,&lt;BR /&gt;op_editop_t editop,&lt;BR /&gt;val_value_t *newval,&lt;BR /&gt;val_value_t *curval,&lt;BR /&gt;const xmlChar *k_onus_interfaces_MAC)&lt;BR /&gt;{&lt;BR /&gt;status_t res = NO_ERR;&lt;/P&gt;&lt;P&gt;if (LOGDEBUG) {&lt;BR /&gt;log_debug("\nEnter u_tapi_onus_interfaces_edit callback for %s phase",&lt;BR /&gt;agt_cbtype_name(cbtyp));&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;switch (cbtyp) {&lt;BR /&gt;case AGT_CB_VALIDATE:&lt;BR /&gt;/* description-stmt validation here &lt;EM&gt;/&lt;BR /&gt;break;&lt;BR /&gt;case AGT_CB_APPLY:&lt;BR /&gt;/&lt;/EM&gt; database manipulation done here &lt;EM&gt;/&lt;BR /&gt;break;&lt;BR /&gt;case AGT_CB_COMMIT:&lt;BR /&gt;/&lt;/EM&gt; device instrumentation done here &lt;EM&gt;/&lt;BR /&gt;switch (editop) {&lt;BR /&gt;case OP_EDITOP_LOAD:&lt;BR /&gt;break;&lt;BR /&gt;case OP_EDITOP_MERGE:&lt;BR /&gt;break;&lt;BR /&gt;case OP_EDITOP_REPLACE:&lt;BR /&gt;break;&lt;BR /&gt;case OP_EDITOP_CREATE:&lt;BR /&gt;break;&lt;BR /&gt;case OP_EDITOP_DELETE:&lt;BR /&gt;break;&lt;BR /&gt;default:&lt;BR /&gt;res = SET_ERROR(ERR_INTERNAL_VAL);&lt;BR /&gt;}&lt;BR /&gt;break;&lt;BR /&gt;case AGT_CB_ROLLBACK:&lt;BR /&gt;/&lt;/EM&gt; undo device instrumentation here */&lt;BR /&gt;break;&lt;BR /&gt;default:&lt;BR /&gt;res = SET_ERROR(ERR_INTERNAL_VAL);&lt;BR /&gt;}&lt;BR /&gt;return res;&lt;/P&gt;&lt;P&gt;} /* u_tapi_onus_interfaces_edit */&lt;/P&gt;&lt;P&gt;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 ?&lt;/P&gt;&lt;P&gt;Thanks in advance !&lt;/P&gt;</description>
    <pubDate>Thu, 13 Jun 2019 13:22:55 GMT</pubDate>
    <dc:creator>badreddine1359</dc:creator>
    <dc:date>2019-06-13T13:22:55Z</dc:date>
    <item>
      <title>Append a list through the generated .c file</title>
      <link>https://community.cisco.com/t5/tools/append-a-list-through-the-generated-c-file/m-p/3872433#M2271</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am using the OpenYuma netconf server-client.&lt;/P&gt;&lt;P&gt;I have wrote a model I successfully edited, read, execute data through editing the genrated c file.&lt;BR /&gt;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.&lt;BR /&gt;this is my list :&lt;BR /&gt;container onus {&lt;BR /&gt;list interfaces {&lt;BR /&gt;key "MAC";&lt;BR /&gt;leaf MAC {&lt;BR /&gt;type string;&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;And this is the c file part of edit this list :&lt;BR /&gt;FUNCTION u_tapi_onus_interfaces_edit&lt;BR /&gt;*&lt;/P&gt;&lt;PRE&gt;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&lt;/PRE&gt;&lt;P&gt;********************************************************************/&lt;BR /&gt;status_t u_tapi_onus_interfaces_edit (&lt;BR /&gt;ses_cb_t *scb,&lt;BR /&gt;rpc_msg_t *msg,&lt;BR /&gt;agt_cbtyp_t cbtyp,&lt;BR /&gt;op_editop_t editop,&lt;BR /&gt;val_value_t *newval,&lt;BR /&gt;val_value_t *curval,&lt;BR /&gt;const xmlChar *k_onus_interfaces_MAC)&lt;BR /&gt;{&lt;BR /&gt;status_t res = NO_ERR;&lt;/P&gt;&lt;P&gt;if (LOGDEBUG) {&lt;BR /&gt;log_debug("\nEnter u_tapi_onus_interfaces_edit callback for %s phase",&lt;BR /&gt;agt_cbtype_name(cbtyp));&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;switch (cbtyp) {&lt;BR /&gt;case AGT_CB_VALIDATE:&lt;BR /&gt;/* description-stmt validation here &lt;EM&gt;/&lt;BR /&gt;break;&lt;BR /&gt;case AGT_CB_APPLY:&lt;BR /&gt;/&lt;/EM&gt; database manipulation done here &lt;EM&gt;/&lt;BR /&gt;break;&lt;BR /&gt;case AGT_CB_COMMIT:&lt;BR /&gt;/&lt;/EM&gt; device instrumentation done here &lt;EM&gt;/&lt;BR /&gt;switch (editop) {&lt;BR /&gt;case OP_EDITOP_LOAD:&lt;BR /&gt;break;&lt;BR /&gt;case OP_EDITOP_MERGE:&lt;BR /&gt;break;&lt;BR /&gt;case OP_EDITOP_REPLACE:&lt;BR /&gt;break;&lt;BR /&gt;case OP_EDITOP_CREATE:&lt;BR /&gt;break;&lt;BR /&gt;case OP_EDITOP_DELETE:&lt;BR /&gt;break;&lt;BR /&gt;default:&lt;BR /&gt;res = SET_ERROR(ERR_INTERNAL_VAL);&lt;BR /&gt;}&lt;BR /&gt;break;&lt;BR /&gt;case AGT_CB_ROLLBACK:&lt;BR /&gt;/&lt;/EM&gt; undo device instrumentation here */&lt;BR /&gt;break;&lt;BR /&gt;default:&lt;BR /&gt;res = SET_ERROR(ERR_INTERNAL_VAL);&lt;BR /&gt;}&lt;BR /&gt;return res;&lt;/P&gt;&lt;P&gt;} /* u_tapi_onus_interfaces_edit */&lt;/P&gt;&lt;P&gt;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 ?&lt;/P&gt;&lt;P&gt;Thanks in advance !&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2019 13:22:55 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/append-a-list-through-the-generated-c-file/m-p/3872433#M2271</guid>
      <dc:creator>badreddine1359</dc:creator>
      <dc:date>2019-06-13T13:22:55Z</dc:date>
    </item>
  </channel>
</rss>

