Pavol Vican | 021488a | 2016-01-25 23:56:12 +0100 | [diff] [blame] | 1 | /** |
| 2 | * @file parser_yang.h |
| 3 | * @author Pavol Vican |
| 4 | * @brief Parsers for libyang |
| 5 | * |
| 6 | * Copyright (c) 2015 CESNET, z.s.p.o. |
| 7 | * |
Pavol Vican | 9a3a721 | 2016-03-23 10:04:00 +0100 | [diff] [blame^] | 8 | * This source code is licensed under BSD 3-Clause License (the "License"). |
| 9 | * You may not use this file except in compliance with the License. |
| 10 | * You may obtain a copy of the License at |
| 11 | * |
| 12 | * https://opensource.org/licenses/BSD-3-Clause |
Pavol Vican | 021488a | 2016-01-25 23:56:12 +0100 | [diff] [blame] | 13 | */ |
| 14 | |
| 15 | #ifndef LY_PARSER_YANG_H_ |
| 16 | #define LY_PARSER_YANG_H_ |
| 17 | |
Pavol Vican | bf80547 | 2016-01-26 14:24:56 +0100 | [diff] [blame] | 18 | #include <stdlib.h> |
Pavol Vican | 6eb14e8 | 2016-02-03 12:27:13 +0100 | [diff] [blame] | 19 | #include <string.h> |
Pavol Vican | bf80547 | 2016-01-26 14:24:56 +0100 | [diff] [blame] | 20 | |
Pavol Vican | 021488a | 2016-01-25 23:56:12 +0100 | [diff] [blame] | 21 | #include "tree_schema.h" |
| 22 | #include "resolve.h" |
Pavol Vican | bf80547 | 2016-01-26 14:24:56 +0100 | [diff] [blame] | 23 | #include "common.h" |
Pavol Vican | 6eb14e8 | 2016-02-03 12:27:13 +0100 | [diff] [blame] | 24 | #include "context.h" |
Pavol Vican | 021488a | 2016-01-25 23:56:12 +0100 | [diff] [blame] | 25 | |
Pavol Vican | 1eeb199 | 2016-02-09 11:10:45 +0100 | [diff] [blame] | 26 | #define LY_ARRAY_SIZE 32 |
| 27 | #define LY_READ_ALL 1 |
| 28 | #define LY_READ_ONLY_SIZE 0 |
Pavol Vican | be057c0 | 2016-02-11 19:08:08 +0100 | [diff] [blame] | 29 | #define LYS_SYSTEMORDERED 0x40 |
| 30 | #define LYS_ORDERED_MASK 0xC0 |
Pavol Vican | 339d4ad | 2016-02-12 12:49:22 +0100 | [diff] [blame] | 31 | #define LYS_MIN_ELEMENTS 0x01 |
| 32 | #define LYS_MAX_ELEMENTS 0x02 |
Pavol Vican | 52ed67d | 2016-03-02 17:46:15 +0100 | [diff] [blame] | 33 | #define LYS_RPC_INPUT 0x01 |
| 34 | #define LYS_RPC_OUTPUT 0x02 |
Pavol Vican | 5de3349 | 2016-02-22 14:03:24 +0100 | [diff] [blame] | 35 | #define LYS_DATADEF 0x04 |
Pavol Vican | 73e7c99 | 2016-02-24 12:18:05 +0100 | [diff] [blame] | 36 | #define LYS_TYPE_DEF 0x08 |
Pavol Vican | 1ff0e22 | 2016-02-26 12:27:01 +0100 | [diff] [blame] | 37 | #define LYS_TYPE_BASE 0x40 |
Pavol Vican | 1eeb199 | 2016-02-09 11:10:45 +0100 | [diff] [blame] | 38 | |
| 39 | struct lys_node_array{ |
| 40 | uint8_t if_features; |
| 41 | uint8_t must; |
| 42 | uint8_t unique; |
| 43 | uint8_t tpdf; |
Pavol Vican | a55cbb4 | 2016-03-21 20:15:26 +0100 | [diff] [blame] | 44 | union { |
| 45 | uint8_t uni; |
| 46 | uint8_t flags; |
| 47 | }; |
| 48 | union { |
| 49 | uint8_t enm; |
| 50 | uint8_t pattern; |
| 51 | uint8_t bit; |
| 52 | uint8_t deviate; |
| 53 | }; |
Pavol Vican | 1eeb199 | 2016-02-09 11:10:45 +0100 | [diff] [blame] | 54 | uint16_t refine; |
| 55 | uint16_t augment; |
| 56 | |
| 57 | }; |
| 58 | |
| 59 | struct lys_array_size { |
| 60 | uint8_t rev; |
| 61 | uint8_t imp; |
| 62 | uint8_t inc; |
| 63 | uint32_t ident; |
| 64 | uint8_t features; |
| 65 | uint8_t augment; |
| 66 | uint8_t deviation; |
Pavol Vican | 0df02b0 | 2016-03-01 10:28:50 +0100 | [diff] [blame] | 67 | uint8_t tpdf; |
Pavol Vican | e1354e9 | 2016-02-09 14:02:09 +0100 | [diff] [blame] | 68 | uint32_t size; |
Pavol Vican | 1eeb199 | 2016-02-09 11:10:45 +0100 | [diff] [blame] | 69 | uint32_t next; |
| 70 | struct lys_node_array *node; |
| 71 | }; |
Pavol Vican | 021488a | 2016-01-25 23:56:12 +0100 | [diff] [blame] | 72 | |
Pavol Vican | 1f06ba8 | 2016-02-10 17:39:50 +0100 | [diff] [blame] | 73 | struct type_choice { |
| 74 | char *s; |
| 75 | struct lys_node_choice *ptr_choice; |
| 76 | }; |
| 77 | |
Pavol Vican | 339d4ad | 2016-02-12 12:49:22 +0100 | [diff] [blame] | 78 | struct type_leaflist { |
| 79 | struct lys_node_leaflist *ptr_leaflist; |
| 80 | uint8_t flag; |
| 81 | }; |
| 82 | |
Pavol Vican | 5de3349 | 2016-02-22 14:03:24 +0100 | [diff] [blame] | 83 | struct type_list { |
| 84 | struct lys_node_list *ptr_list; |
| 85 | uint8_t flag; |
Pavol Vican | 5de3349 | 2016-02-22 14:03:24 +0100 | [diff] [blame] | 86 | }; |
| 87 | |
Pavol Vican | 73e7c99 | 2016-02-24 12:18:05 +0100 | [diff] [blame] | 88 | struct type_leaf { |
| 89 | struct lys_node_leaf *ptr_leaf; |
| 90 | uint8_t flag; |
| 91 | }; |
| 92 | |
Pavol Vican | 0df02b0 | 2016-03-01 10:28:50 +0100 | [diff] [blame] | 93 | struct type_tpdf { |
| 94 | struct lys_tpdf *ptr_tpdf; |
Pavol Vican | 0df02b0 | 2016-03-01 10:28:50 +0100 | [diff] [blame] | 95 | uint8_t flag; |
| 96 | }; |
| 97 | |
Pavol Vican | 92fa0dc | 2016-03-02 14:20:39 +0100 | [diff] [blame] | 98 | struct type_augment { |
| 99 | struct lys_node_augment *ptr_augment; |
| 100 | uint8_t flag; |
| 101 | }; |
| 102 | |
Pavol Vican | 52ed67d | 2016-03-02 17:46:15 +0100 | [diff] [blame] | 103 | struct type_rpc { |
| 104 | struct lys_node_rpc *ptr_rpc; |
| 105 | uint8_t flag; |
| 106 | }; |
| 107 | |
Pavol Vican | 531a913 | 2016-03-03 10:10:09 +0100 | [diff] [blame] | 108 | struct type_inout { |
| 109 | struct lys_node_rpc_inout *ptr_inout; |
| 110 | uint8_t flag; |
| 111 | }; |
| 112 | |
Pavol Vican | 220e5a1 | 2016-03-03 14:19:43 +0100 | [diff] [blame] | 113 | struct type_deviation { |
| 114 | struct lys_deviation *deviation; |
| 115 | struct lys_node *target; |
| 116 | struct lys_deviate *deviate; |
Pavol Vican | 85f1202 | 2016-03-05 16:30:35 +0100 | [diff] [blame] | 117 | struct lys_restr **trg_must; |
| 118 | uint8_t *trg_must_size; |
Pavol Vican | 220e5a1 | 2016-03-03 14:19:43 +0100 | [diff] [blame] | 119 | }; |
| 120 | |
Pavol Vican | 4fb66c9 | 2016-03-17 10:32:27 +0100 | [diff] [blame] | 121 | struct type_uses { |
| 122 | struct lys_node_uses *ptr_uses; |
| 123 | int config_inherit; |
| 124 | }; |
| 125 | |
Pavol Vican | 73e7c99 | 2016-02-24 12:18:05 +0100 | [diff] [blame] | 126 | struct yang_type { |
| 127 | char flags; /**< this is used to distinguish lyxml_elem * from a YANG temporary parsing structure */ |
| 128 | char *name; |
Pavol Vican | 73e7c99 | 2016-02-24 12:18:05 +0100 | [diff] [blame] | 129 | struct lys_type *type; |
Pavol Vican | 73e7c99 | 2016-02-24 12:18:05 +0100 | [diff] [blame] | 130 | }; |
| 131 | |
Pavol Vican | 0adf01d | 2016-03-22 12:29:33 +0100 | [diff] [blame] | 132 | int yang_read_common(struct lys_module *module,char *value, int type); |
Pavol Vican | 021488a | 2016-01-25 23:56:12 +0100 | [diff] [blame] | 133 | |
Pavol Vican | 0adf01d | 2016-03-22 12:29:33 +0100 | [diff] [blame] | 134 | int yang_read_prefix(struct lys_module *module, void *save, char *value,int type); |
Pavol Vican | bf80547 | 2016-01-26 14:24:56 +0100 | [diff] [blame] | 135 | |
Pavol Vican | 6eb14e8 | 2016-02-03 12:27:13 +0100 | [diff] [blame] | 136 | /** |
| 137 | * @brief Get free member of array |
| 138 | * |
| 139 | * @param[in/out] ptr Pointer to the array. |
| 140 | * @param[in/out] act_size Pointer to the current size of array. |
| 141 | * @param[in] type Type of array. |
| 142 | * @param[in] sizeof_struct |
| 143 | * @return first free member of array, NULL on error. |
| 144 | */ |
| 145 | void *yang_elem_of_array(void **ptr, uint8_t *act_size, int type, int sizeof_struct); |
| 146 | |
Pavol Vican | 1eeb199 | 2016-02-09 11:10:45 +0100 | [diff] [blame] | 147 | /** |
| 148 | * @brief Add node to the array |
| 149 | * |
| 150 | * @param[in/out] node Pointer to the array. |
| 151 | * @param[in/out] size Pointer to the current size of array. |
| 152 | * @return 1 on success, 0 on error. |
| 153 | */ |
Pavol Vican | a182796 | 2016-02-29 15:39:42 +0100 | [diff] [blame] | 154 | int yang_add_elem(struct lys_node_array **node, uint32_t *size); |
Pavol Vican | 1eeb199 | 2016-02-09 11:10:45 +0100 | [diff] [blame] | 155 | |
Pavol Vican | 0adf01d | 2016-03-22 12:29:33 +0100 | [diff] [blame] | 156 | int yang_fill_import(struct lys_module *module, struct lys_import *imp, char *value); |
Pavol Vican | 6eb14e8 | 2016-02-03 12:27:13 +0100 | [diff] [blame] | 157 | |
Pavol Vican | 0adf01d | 2016-03-22 12:29:33 +0100 | [diff] [blame] | 158 | int yang_read_description(struct lys_module *module, void *node, char *value, char *where); |
Pavol Vican | 1ca072c | 2016-02-03 13:03:56 +0100 | [diff] [blame] | 159 | |
Pavol Vican | 0adf01d | 2016-03-22 12:29:33 +0100 | [diff] [blame] | 160 | int yang_read_reference(struct lys_module *module, void *node, char *value, char *where); |
Pavol Vican | 1ca072c | 2016-02-03 13:03:56 +0100 | [diff] [blame] | 161 | |
Pavol Vican | bedff69 | 2016-02-03 14:29:17 +0100 | [diff] [blame] | 162 | void *yang_read_revision(struct lys_module *module, char *value); |
| 163 | |
Pavol Vican | 0adf01d | 2016-03-22 12:29:33 +0100 | [diff] [blame] | 164 | void *yang_read_feature(struct lys_module *module, char *value); |
Pavol Vican | bedff69 | 2016-02-03 14:29:17 +0100 | [diff] [blame] | 165 | |
Pavol Vican | 0adf01d | 2016-03-22 12:29:33 +0100 | [diff] [blame] | 166 | int yang_read_if_feature(struct lys_module *module, void *ptr, char *value, struct unres_schema *unres, int type); |
Pavol Vican | e1354e9 | 2016-02-09 14:02:09 +0100 | [diff] [blame] | 167 | |
Pavol Vican | bbdef53 | 2016-02-09 14:52:12 +0100 | [diff] [blame] | 168 | void *yang_read_identity(struct lys_module *module, char *value); |
| 169 | |
Pavol Vican | 0adf01d | 2016-03-22 12:29:33 +0100 | [diff] [blame] | 170 | int yang_read_base(struct lys_module *module, struct lys_ident *ident, char *value, struct unres_schema *unres); |
Pavol Vican | bbdef53 | 2016-02-09 14:52:12 +0100 | [diff] [blame] | 171 | |
Pavol Vican | 0adf01d | 2016-03-22 12:29:33 +0100 | [diff] [blame] | 172 | void *yang_read_must(struct lys_module *module, struct lys_node *node, char *value, int type); |
Pavol Vican | f37eeaa | 2016-02-09 20:54:06 +0100 | [diff] [blame] | 173 | |
Pavol Vican | 0adf01d | 2016-03-22 12:29:33 +0100 | [diff] [blame] | 174 | int yang_read_message(struct lys_module *module,struct lys_restr *save,char *value, char *what, int message); |
Pavol Vican | f37eeaa | 2016-02-09 20:54:06 +0100 | [diff] [blame] | 175 | |
Pavol Vican | 0adf01d | 2016-03-22 12:29:33 +0100 | [diff] [blame] | 176 | int yang_read_presence(struct lys_module *module, struct lys_node_container *cont, char *value); |
Pavol Vican | b568711 | 2016-02-09 22:35:59 +0100 | [diff] [blame] | 177 | |
Pavol Vican | 0adf01d | 2016-03-22 12:29:33 +0100 | [diff] [blame] | 178 | int yang_read_config(void *node, int value, int type); |
Pavol Vican | b568711 | 2016-02-09 22:35:59 +0100 | [diff] [blame] | 179 | |
Pavol Vican | 4fb66c9 | 2016-03-17 10:32:27 +0100 | [diff] [blame] | 180 | void store_flags(struct lys_node *node, uint8_t flags, int config_inherit); |
| 181 | |
Pavol Vican | 0adf01d | 2016-03-22 12:29:33 +0100 | [diff] [blame] | 182 | void *yang_read_when(struct lys_module *module, struct lys_node *node, int type, char *value); |
Pavol Vican | 235dbd4 | 2016-02-10 10:34:19 +0100 | [diff] [blame] | 183 | |
Pavol Vican | 7cadfe7 | 2016-02-11 12:33:34 +0100 | [diff] [blame] | 184 | /** |
| 185 | * @brief Allocate memory for node and add to the tree |
| 186 | * |
| 187 | * @param[in/out] node Pointer to the array. |
| 188 | * @param[in] parent Pointer to the parent. |
| 189 | * @param[in] value Name of node |
| 190 | * @param[in] nodetype Type of node |
| 191 | * @param[in] sizeof_struct Size of struct |
| 192 | * @return Pointer to the node, NULL on error. |
| 193 | */ |
| 194 | void * yang_read_node(struct lys_module *module, struct lys_node *parent, char *value, int nodetype, int sizeof_struct); |
Pavol Vican | 12f53c3 | 2016-02-11 11:40:00 +0100 | [diff] [blame] | 195 | |
Pavol Vican | 0adf01d | 2016-03-22 12:29:33 +0100 | [diff] [blame] | 196 | int yang_read_default(struct lys_module *module, void *node, char *value, int type); |
Pavol Vican | 096c6db | 2016-02-11 15:08:10 +0100 | [diff] [blame] | 197 | |
Pavol Vican | 0adf01d | 2016-03-22 12:29:33 +0100 | [diff] [blame] | 198 | int yang_read_units(struct lys_module *module, void *node, char *value, int type); |
Pavol Vican | 096c6db | 2016-02-11 15:08:10 +0100 | [diff] [blame] | 199 | |
Pavol Vican | 0adf01d | 2016-03-22 12:29:33 +0100 | [diff] [blame] | 200 | int yang_read_key(struct lys_module *module, struct lys_node_list *list, struct unres_schema *unres); |
Pavol Vican | 5de3349 | 2016-02-22 14:03:24 +0100 | [diff] [blame] | 201 | |
| 202 | int yang_read_unique(struct lys_module *module, struct lys_node_list *list, struct unres_schema *unres); |
| 203 | |
Pavol Vican | 0adf01d | 2016-03-22 12:29:33 +0100 | [diff] [blame] | 204 | void *yang_read_type(struct lys_module *module, void *parent, char *value, int type); |
Pavol Vican | 73e7c99 | 2016-02-24 12:18:05 +0100 | [diff] [blame] | 205 | |
Pavol Vican | 0adf01d | 2016-03-22 12:29:33 +0100 | [diff] [blame] | 206 | void *yang_read_length(struct lys_module *module, struct yang_type *typ, char *value); |
Pavol Vican | 73e7c99 | 2016-02-24 12:18:05 +0100 | [diff] [blame] | 207 | |
| 208 | int yang_check_type(struct lys_module *module, struct lys_node *parent, struct yang_type *typ, struct unres_schema *unres); |
| 209 | |
Pavol Vican | 0adf01d | 2016-03-22 12:29:33 +0100 | [diff] [blame] | 210 | void *yang_read_pattern(struct lys_module *module, struct yang_type *typ, char *value); |
Pavol Vican | 1c203db | 2016-02-24 14:05:23 +0100 | [diff] [blame] | 211 | |
Pavol Vican | 0adf01d | 2016-03-22 12:29:33 +0100 | [diff] [blame] | 212 | void *yang_read_range(struct lys_module *module, struct yang_type *typ, char *value); |
Pavol Vican | aff5c80 | 2016-02-24 15:56:45 +0100 | [diff] [blame] | 213 | |
Pavol Vican | 0adf01d | 2016-03-22 12:29:33 +0100 | [diff] [blame] | 214 | int yang_read_fraction(struct yang_type *typ, uint32_t value); |
Pavol Vican | 07ea68d | 2016-02-25 12:01:37 +0100 | [diff] [blame] | 215 | |
Pavol Vican | 0adf01d | 2016-03-22 12:29:33 +0100 | [diff] [blame] | 216 | void *yang_read_enum(struct lys_module *module, struct yang_type *typ, char *value); |
Pavol Vican | 79a763d | 2016-02-25 15:41:27 +0100 | [diff] [blame] | 217 | |
Pavol Vican | 0adf01d | 2016-03-22 12:29:33 +0100 | [diff] [blame] | 218 | int yang_check_enum(struct yang_type *typ, struct lys_type_enum *enm, int64_t *value, int assign); |
Pavol Vican | 79a763d | 2016-02-25 15:41:27 +0100 | [diff] [blame] | 219 | |
Pavol Vican | 0adf01d | 2016-03-22 12:29:33 +0100 | [diff] [blame] | 220 | void *yang_read_bit(struct lys_module *module, struct yang_type *typ, char *value); |
Pavol Vican | 9887c68 | 2016-02-29 11:32:01 +0100 | [diff] [blame] | 221 | |
Pavol Vican | 0adf01d | 2016-03-22 12:29:33 +0100 | [diff] [blame] | 222 | int yang_check_bit(struct yang_type *typ, struct lys_type_bit *bit, int64_t *value, int assign); |
Pavol Vican | 9887c68 | 2016-02-29 11:32:01 +0100 | [diff] [blame] | 223 | |
Pavol Vican | 0adf01d | 2016-03-22 12:29:33 +0100 | [diff] [blame] | 224 | void *yang_read_typedef(struct lys_module *module, struct lys_node *parent, char *value); |
Pavol Vican | 0df02b0 | 2016-03-01 10:28:50 +0100 | [diff] [blame] | 225 | |
Pavol Vican | 0adf01d | 2016-03-22 12:29:33 +0100 | [diff] [blame] | 226 | void *yang_read_refine(struct lys_module *module, struct lys_node_uses *uses, char *value); |
Pavol Vican | 1003ead | 2016-03-02 12:24:52 +0100 | [diff] [blame] | 227 | |
Pavol Vican | 0adf01d | 2016-03-22 12:29:33 +0100 | [diff] [blame] | 228 | void *yang_read_augment(struct lys_module *module, struct lys_node *parent, char *value); |
Pavol Vican | 92fa0dc | 2016-03-02 14:20:39 +0100 | [diff] [blame] | 229 | |
Pavol Vican | 0adf01d | 2016-03-22 12:29:33 +0100 | [diff] [blame] | 230 | void *yang_read_deviation(struct lys_module *module, char *value); |
Pavol Vican | 220e5a1 | 2016-03-03 14:19:43 +0100 | [diff] [blame] | 231 | |
Pavol Vican | 0adf01d | 2016-03-22 12:29:33 +0100 | [diff] [blame] | 232 | int yang_read_deviate_unsupported(struct type_deviation *dev); |
Pavol Vican | 4c90c64 | 2016-03-03 15:06:47 +0100 | [diff] [blame] | 233 | |
Pavol Vican | 0adf01d | 2016-03-22 12:29:33 +0100 | [diff] [blame] | 234 | int yang_read_deviate(struct type_deviation *dev, LYS_DEVIATE_TYPE mod); |
Pavol Vican | 85f1202 | 2016-03-05 16:30:35 +0100 | [diff] [blame] | 235 | |
Pavol Vican | 0adf01d | 2016-03-22 12:29:33 +0100 | [diff] [blame] | 236 | int yang_read_deviate_units(struct ly_ctx *ctx, struct type_deviation *dev, char *value); |
Pavol Vican | 85f1202 | 2016-03-05 16:30:35 +0100 | [diff] [blame] | 237 | |
Pavol Vican | 974377b | 2016-03-23 00:38:53 +0100 | [diff] [blame] | 238 | int yang_read_deviate_must(struct type_deviation *dev, uint8_t c_must); |
Pavol Vican | 85f1202 | 2016-03-05 16:30:35 +0100 | [diff] [blame] | 239 | |
Pavol Vican | 0adf01d | 2016-03-22 12:29:33 +0100 | [diff] [blame] | 240 | int yang_fill_unique(struct lys_module *module, struct lys_node_list *list, struct lys_unique *unique, char *value, struct unres_schema *unres); |
Pavol Vican | 85f1202 | 2016-03-05 16:30:35 +0100 | [diff] [blame] | 241 | |
Pavol Vican | 974377b | 2016-03-23 00:38:53 +0100 | [diff] [blame] | 242 | int yang_read_deviate_unique(struct type_deviation *dev, uint8_t c_uniq); |
Pavol Vican | 85f1202 | 2016-03-05 16:30:35 +0100 | [diff] [blame] | 243 | |
Pavol Vican | 0adf01d | 2016-03-22 12:29:33 +0100 | [diff] [blame] | 244 | int yang_read_deviate_default(struct ly_ctx *ctx, struct type_deviation *dev, char *value); |
Pavol Vican | 85f1202 | 2016-03-05 16:30:35 +0100 | [diff] [blame] | 245 | |
Pavol Vican | 0adf01d | 2016-03-22 12:29:33 +0100 | [diff] [blame] | 246 | int yang_read_deviate_config(struct type_deviation *dev, uint8_t value); |
Pavol Vican | 85f1202 | 2016-03-05 16:30:35 +0100 | [diff] [blame] | 247 | |
Pavol Vican | 0adf01d | 2016-03-22 12:29:33 +0100 | [diff] [blame] | 248 | int yang_read_deviate_mandatory(struct type_deviation *dev, uint8_t value); |
Pavol Vican | 85f1202 | 2016-03-05 16:30:35 +0100 | [diff] [blame] | 249 | |
| 250 | /* |
| 251 | * type: 0 - min, 1 - max |
| 252 | */ |
Pavol Vican | 0adf01d | 2016-03-22 12:29:33 +0100 | [diff] [blame] | 253 | int yang_read_deviate_minmax(struct type_deviation *dev, uint32_t value, int type); |
Pavol Vican | 85f1202 | 2016-03-05 16:30:35 +0100 | [diff] [blame] | 254 | |
Pavol Vican | 0adf01d | 2016-03-22 12:29:33 +0100 | [diff] [blame] | 255 | int yang_check_deviate_must(struct ly_ctx *ctx, struct type_deviation *dev); |
Pavol Vican | c1f5a50 | 2016-03-06 16:51:26 +0100 | [diff] [blame] | 256 | |
Pavol Vican | 0adf01d | 2016-03-22 12:29:33 +0100 | [diff] [blame] | 257 | int yang_check_deviate_unique(struct lys_module *module, struct type_deviation *dev, char *value); |
Pavol Vican | c1f5a50 | 2016-03-06 16:51:26 +0100 | [diff] [blame] | 258 | |
Pavol Vican | 0adf01d | 2016-03-22 12:29:33 +0100 | [diff] [blame] | 259 | int yang_check_deviation(struct lys_module *module, struct type_deviation *dev, struct unres_schema *unres); |
Pavol Vican | c1f5a50 | 2016-03-06 16:51:26 +0100 | [diff] [blame] | 260 | |
Pavol Vican | 9b89dda | 2016-03-09 15:36:55 +0100 | [diff] [blame] | 261 | int yang_fill_include(struct lys_module *module, struct lys_submodule *submodule, char *value, |
Pavol Vican | 0adf01d | 2016-03-22 12:29:33 +0100 | [diff] [blame] | 262 | char *rev, int inc_size, struct unres_schema *unres); |
Pavol Vican | 9b89dda | 2016-03-09 15:36:55 +0100 | [diff] [blame] | 263 | |
Pavol Vican | 0adf01d | 2016-03-22 12:29:33 +0100 | [diff] [blame] | 264 | int yang_use_extension(struct lys_module *module, struct lys_node *data_node, void *actual, char *value); |
Pavol Vican | f4717e6 | 2016-03-16 11:30:01 +0100 | [diff] [blame] | 265 | |
Pavol Vican | 0adf01d | 2016-03-22 12:29:33 +0100 | [diff] [blame] | 266 | int yang_check_flags(uint8_t *flags, uint8_t mask, char *what, char *where, int value); |
Pavol Vican | 4fb66c9 | 2016-03-17 10:32:27 +0100 | [diff] [blame] | 267 | |
Pavol Vican | 974377b | 2016-03-23 00:38:53 +0100 | [diff] [blame] | 268 | int yang_parse_mem(struct lys_module *module, struct lys_submodule *submodule, struct unres_schema *unres, const char *data, unsigned int size_data); |
Pavol Vican | 8e7110b | 2016-03-22 17:00:26 +0100 | [diff] [blame] | 269 | |
Pavol Vican | 974377b | 2016-03-23 00:38:53 +0100 | [diff] [blame] | 270 | struct lys_module *yang_read_module(struct ly_ctx *ctx, const char* data, unsigned int size, const char *revision, int implement); |
Pavol Vican | 8e7110b | 2016-03-22 17:00:26 +0100 | [diff] [blame] | 271 | |
Pavol Vican | 974377b | 2016-03-23 00:38:53 +0100 | [diff] [blame] | 272 | struct lys_submodule *yang_read_submodule(struct lys_module *module, const char *data, unsigned int size, struct unres_schema *unres); |
Pavol Vican | 8e7110b | 2016-03-22 17:00:26 +0100 | [diff] [blame] | 273 | |
Pavol Vican | 021488a | 2016-01-25 23:56:12 +0100 | [diff] [blame] | 274 | #endif /* LY_PARSER_YANG_H_ */ |