Sweetcomb/NewModel
From fd.io
Contents
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
Now, you should read Sweetcomb/Sysrepo