Difference between revisions of "Sweetcomb/NewModel"

From fd.io
Jump to: navigation, search
m (Implementing a new YANG model in Sweetcomb)
m (Developp scvpp helper functions)
Line 10: Line 10:
 
All interaction with VAPI must be made in scvpp source code.
 
All interaction with VAPI must be made in scvpp source code.
 
Please, leverage as much as possible existing maccros such as:
 
Please, leverage as much as possible existing maccros such as:
* VAPI_RETVAL_CB
+
* '''VAPI_CALL''' : Wait until all messages have been received from VAPI
* VAPI_COPY_CB
+
* '''VAPI_RETVAL_CB''' : Return retval field of payload from VAPI reply message
* VAPI_CALL
+
* '''VAPI_COPY_CB''' : Perform a copy of a single VAPI reply message because VAPI frees its message after some time
 +
* '''VAPI_DUMP_LIST_CB''' : Put multiple received message from VAPI into a stack datastructure and return pointer to stack head.
  
 
== Developp and add callbacks ==
 
== Developp and add callbacks ==

Revision as of 13:52, 28 March 2019

Implementing a new YANG model in Sweetcomb

Adding YANG model file to sweetcomb

Download the YANG model file to appropriate sweetcomb location under plugin subdirectory. Your Yang model must be named <model>@<revision>.yang

Developp scvpp helper functions

All interaction with VAPI must be made in scvpp source code. Please, leverage as much as possible existing maccros such as:

  • VAPI_CALL : Wait until all messages have been received from VAPI
  • VAPI_RETVAL_CB : Return retval field of payload from VAPI reply message
  • VAPI_COPY_CB : Perform a copy of a single VAPI reply message because VAPI frees its message after some time
  • VAPI_DUMP_LIST_CB : Put multiple received message from VAPI into a stack datastructure and return pointer to stack head.

Developp and add callbacks

A yang model can be represented as a tree and its elements accessed using XPATH syntax. You need to know which XPATH you want to support in your YANG model.

//TODO: xpath_t structure, new file, register_model