summaryrefslogtreecommitdiff
path: root/lib/yang.c
diff options
context:
space:
mode:
authorLou Berger <lberger@labn.net>2019-05-07 11:07:56 -0400
committerGitHub <noreply@github.com>2019-05-07 11:07:56 -0400
commit8905677dac9be27e4e3a8a670796bbf5f6705038 (patch)
tree736ae8dfbb5420fd185f4964dd85df608e95efc5 /lib/yang.c
parent158c16db543abc853dacdb69ef15b87b3c8a832e (diff)
parentfd6aeabaeded22f8031af4136240c81dd8639af7 (diff)
Merge pull request #4271 from opensourcerouting/libyang-compat-7.0
[7.0] lib, yang: disable libyang custom user types temporarily
Diffstat (limited to 'lib/yang.c')
-rw-r--r--lib/yang.c45
1 files changed, 0 insertions, 45 deletions
diff --git a/lib/yang.c b/lib/yang.c
index 1d8e82eb28..96d23b461a 100644
--- a/lib/yang.c
+++ b/lib/yang.c
@@ -641,14 +641,6 @@ static void ly_log_cb(LY_LOG_LEVEL level, const char *msg, const char *path)
zlog(priority, "libyang: %s", msg);
}
-#if CONFDATE > 20190401
-CPP_NOTICE("lib/yang: time to remove non-LIBYANG_EXT_BUILTIN support")
-#endif
-
-#ifdef LIBYANG_EXT_BUILTIN
-extern struct lytype_plugin_list frr_user_types[];
-#endif
-
struct ly_ctx *yang_ctx_new_setup(void)
{
struct ly_ctx *ctx;
@@ -674,31 +666,10 @@ struct ly_ctx *yang_ctx_new_setup(void)
void yang_init(void)
{
-#ifndef LIBYANG_EXT_BUILTIN
-CPP_NOTICE("lib/yang: deprecated libyang <0.16.74 extension loading in use!")
- static char ly_plugin_dir[PATH_MAX];
- const char *const *ly_loaded_plugins;
- const char *ly_plugin;
- bool found_ly_frr_types = false;
-
- /* Tell libyang where to find its plugins. */
- snprintf(ly_plugin_dir, sizeof(ly_plugin_dir), "%s=%s",
- "LIBYANG_USER_TYPES_PLUGINS_DIR", LIBYANG_PLUGINS_PATH);
- putenv(ly_plugin_dir);
-#endif
-
/* Initialize libyang global parameters that affect all containers. */
ly_set_log_clb(ly_log_cb, 1);
ly_log_options(LY_LOLOG | LY_LOSTORE);
-#ifdef LIBYANG_EXT_BUILTIN
- if (ly_register_types(frr_user_types, "frr_user_types")) {
- flog_err(EC_LIB_LIBYANG_PLUGIN_LOAD,
- "ly_register_types() failed");
- exit(1);
- }
-#endif
-
/* Initialize libyang container for native models. */
ly_native_ctx = yang_ctx_new_setup();
if (!ly_native_ctx) {
@@ -707,22 +678,6 @@ CPP_NOTICE("lib/yang: deprecated libyang <0.16.74 extension loading in use!")
}
ly_ctx_set_priv_dup_clb(ly_native_ctx, ly_dup_cb);
-#ifndef LIBYANG_EXT_BUILTIN
- /* Detect if the required libyang plugin(s) were loaded successfully. */
- ly_loaded_plugins = ly_get_loaded_plugins();
- for (size_t i = 0; (ly_plugin = ly_loaded_plugins[i]); i++) {
- if (strmatch(ly_plugin, "frr_user_types")) {
- found_ly_frr_types = true;
- break;
- }
- }
- if (!found_ly_frr_types) {
- flog_err(EC_LIB_LIBYANG_PLUGIN_LOAD,
- "%s: failed to load frr_user_types.so", __func__);
- exit(1);
- }
-#endif
-
yang_translator_init();
}