parser data REFACTOR split NETCONF notification and reply parsing
Because there is never a situation when either of
these messages could be parsed directly, the transport
protocol metadata must first be handled. Also, the
old API did not allow for direct notification
parsing, always only both a reply and notification.
diff --git a/tools/lint/cmd_data.c b/tools/lint/cmd_data.c
index 2029ff1..919c45e 100644
--- a/tools/lint/cmd_data.c
+++ b/tools/lint/cmd_data.c
@@ -232,11 +232,11 @@
} else if (!strcasecmp(optarg, "edit")) {
options_parse |= LYD_PARSE_ONLY;
} else if (!strcasecmp(optarg, "rpc") || !strcasecmp(optarg, "action")) {
- data_type = LYD_TYPE_YANG_RPC;
+ data_type = LYD_TYPE_RPC_YANG;
} else if (!strcasecmp(optarg, "reply") || !strcasecmp(optarg, "rpcreply")) {
- data_type = LYD_TYPE_YANG_REPLY;
+ data_type = LYD_TYPE_REPLY_YANG;
} else if (!strcasecmp(optarg, "notif") || !strcasecmp(optarg, "notification")) {
- data_type = LYD_TYPE_YANG_NOTIF;
+ data_type = LYD_TYPE_NOTIF_YANG;
} else if (!strcasecmp(optarg, "data")) {
/* default option */
} else {
diff --git a/tools/lint/common.c b/tools/lint/common.c
index db8c1f8..db9036c 100644
--- a/tools/lint/common.c
+++ b/tools/lint/common.c
@@ -457,12 +457,12 @@
for (uint32_t u = 0; u < inputs->count; ++u) {
struct cmdline_file *input_f = (struct cmdline_file *)inputs->objs[u];
switch (data_type) {
- case LYD_TYPE_YANG_DATA:
+ case LYD_TYPE_DATA_YANG:
ret = lyd_parse_data(ctx, NULL, input_f->in, input_f->format, options_parse, options_validate, &tree);
break;
- case LYD_TYPE_YANG_RPC:
- case LYD_TYPE_YANG_REPLY:
- case LYD_TYPE_YANG_NOTIF:
+ case LYD_TYPE_RPC_YANG:
+ case LYD_TYPE_REPLY_YANG:
+ case LYD_TYPE_NOTIF_YANG:
ret = lyd_parse_op(ctx, NULL, input_f->in, input_f->format, data_type, &tree, NULL);
break;
default:
diff --git a/tools/lint/main_ni.c b/tools/lint/main_ni.c
index e1cb12f..cbf0d0f 100644
--- a/tools/lint/main_ni.c
+++ b/tools/lint/main_ni.c
@@ -538,11 +538,11 @@
} else if (!strcasecmp(optarg, "edit")) {
c->data_parse_options |= LYD_PARSE_ONLY;
} else if (!strcasecmp(optarg, "rpc") || !strcasecmp(optarg, "action")) {
- c->data_type = LYD_TYPE_YANG_RPC;
+ c->data_type = LYD_TYPE_RPC_YANG;
} else if (!strcasecmp(optarg, "reply") || !strcasecmp(optarg, "rpcreply")) {
- c->data_type = LYD_TYPE_YANG_REPLY;
+ c->data_type = LYD_TYPE_REPLY_YANG;
} else if (!strcasecmp(optarg, "notif") || !strcasecmp(optarg, "notification")) {
- c->data_type = LYD_TYPE_YANG_NOTIF;
+ c->data_type = LYD_TYPE_NOTIF_YANG;
} else if (!strcasecmp(optarg, "data")) {
/* default option */
} else {