Example readme
This commit is contained in:
parent
2d9e4666eb
commit
4fb3838021
1 changed files with 3 additions and 4 deletions
|
|
@ -71,8 +71,7 @@ Clixon implements Yang RPC operations by an extension mechanism. The
|
||||||
extension mechanism enables you to add application-specific
|
extension mechanism enables you to add application-specific
|
||||||
operations. It works by adding user-defined callbacks for added
|
operations. It works by adding user-defined callbacks for added
|
||||||
netconf operations. It is possible to use the extension mechanism
|
netconf operations. It is possible to use the extension mechanism
|
||||||
independent of the yang rpc construct, but it is recommended to use
|
independent of the yang rpc construct, but it is recommended. The example includes an example:
|
||||||
that, and the example includes such an example:
|
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
```
|
```
|
||||||
|
|
@ -91,7 +90,7 @@ The example works by creating a netconf rpc call and sending it to the backend:
|
||||||
</rpc>
|
</rpc>
|
||||||
```
|
```
|
||||||
|
|
||||||
The backend in turn registers a callback (fib_route()) which handles the RPC.
|
In the backend, a callback is registered (fib_route()) which handles the RPC.
|
||||||
```
|
```
|
||||||
static int
|
static int
|
||||||
fib_route(clicon_handle h,
|
fib_route(clicon_handle h,
|
||||||
|
|
@ -122,7 +121,7 @@ To return state data, you need to write a backend state data callback
|
||||||
with the name "plugin_statedata" where you return an XML tree with
|
with the name "plugin_statedata" where you return an XML tree with
|
||||||
state. This is then merged with config data by the system.
|
state. This is then merged with config data by the system.
|
||||||
|
|
||||||
pA static example of returning state data is in the example. Note that
|
A static example of returning state data is in the example. Note that
|
||||||
a real example would poll or get the interface counters via a system
|
a real example would poll or get the interface counters via a system
|
||||||
call, as well as use the "xpath" argument to identify the requested
|
call, as well as use the "xpath" argument to identify the requested
|
||||||
state data.
|
state data.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue