summaryrefslogtreecommitdiffstats
path: root/lib/yang.h
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2018-11-03 00:51:43 +0100
committerRenato Westphal <renato@opensourcerouting.org>2018-11-26 20:35:58 +0100
commit80243aef050c1f882a169b402ff5c50fed63b451 (patch)
tree13886bad2557f36b3e19a40fd7b5d105727faecb /lib/yang.h
parentlib: use prefixconstptr instead of const prefixptr (diff)
downloadfrr-80243aef050c1f882a169b402ff5c50fed63b451.tar.xz
frr-80243aef050c1f882a169b402ff5c50fed63b451.zip
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>
Diffstat (limited to 'lib/yang.h')
-rw-r--r--lib/yang.h18
1 files changed, 2 insertions, 16 deletions
diff --git a/lib/yang.h b/lib/yang.h
index b0348e320..ab605441a 100644
--- a/lib/yang.h
+++ b/lib/yang.h
@@ -69,12 +69,6 @@ struct yang_data {
/* XPath identifier of the data element. */
char xpath[XPATH_MAXLEN];
- /*
- * Schema information (necessary to interpret certain values like
- * enums).
- */
- const struct lys_node *snode;
-
/* Value encoded as a raw string. */
char *value;
};
@@ -83,16 +77,8 @@ struct yang_list_keys {
/* Number os keys (max: LIST_MAXKEYS). */
uint8_t num;
- struct {
- /*
- * Schema information (necessary to interpret certain values
- * like enums).
- */
- struct lys_node *snode;
-
- /* Value encoded as a raw string. */
- char value[LIST_MAXKEYLEN];
- } key[LIST_MAXKEYS];
+ /* Value encoded as a raw string. */
+ char key[LIST_MAXKEYS][LIST_MAXKEYLEN];
};
enum yang_path_type {