Commit Graph

5 Commits

Author SHA1 Message Date
Renato Westphal
a1b5f469e7 lib: introduce function that loads all FRR native YANG modules
In some cases it will be necessary to load all FRR native modules.
Examples:
* vtysh needs to load all YANG modules so that it can manipulate data
  from all daemons.
* The gen_northbound_callbacks tool will need to load all YANG modules
  since augmentations from one module can have an effect in the required
  northbound callbacks of other modules.

The new yang_module_load_all() function provides this functionality.

As a side note, the "frr_native_modules" will need to be updated every
time we add a new YANG module to FRR.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-11-26 17:36:34 -02:00
Renato Westphal
5e02643a64 lib: make it possible to create YANG data nodes containing state data
By default the data nodes created by yang_dnode_new() could contain
only configuration data (LYD_OPT_CONFIG). Add a 'config_only' option
to yang_dnode_new() so that it can create data nodes containing both
configuration and state data.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-11-26 17:35:58 -02:00
Renato Westphal
80243aef05 lib: don't fetch schema information when creating yang_data structures
Prefetching the schema node when creating yang_data structures is
expensive, and in most cases we don't need that information. In that case,
fetch the schema information only when necessary to improve performance
when fetching operational data.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-11-26 17:35:58 -02:00
David Lamparter
3a11599cdc yang: embed models into binaries
This bakes our YANG models straight into the library/daemons, so they
don't need to be loaded from /usr/share/yang.  This makes the
installation quite a bit more robust, as well as gets us halfway to
running uninstalled.  (The other half is baking in the extension type
module.)

The /usr/share/yang directory is still searched as a fallback, as well
as for the experimental YANG model translator.  This is likely to stay
as is for the time being.

Signed-off-by: David Lamparter <equinox@diac24.net>
2018-11-19 23:45:24 +01:00
Renato Westphal
1c2facd12d lib: introduce new northbound API
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-10-27 16:16:12 -02:00