Radek Krejci | f0e1ba5 | 2020-05-22 15:14:35 +0200 | [diff] [blame] | 1 | /** |
| 2 | * @file parser_internal.h |
| 3 | * @author Radek Krejci <rkrejci@cesnet.cz> |
| 4 | * @brief Internal structures and functions for libyang parsers |
| 5 | * |
| 6 | * Copyright (c) 2020 CESNET, z.s.p.o. |
| 7 | * |
| 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 |
| 13 | */ |
| 14 | |
| 15 | #ifndef LY_PARSER_INTERNAL_H_ |
| 16 | #define LY_PARSER_INTERNAL_H_ |
| 17 | |
Michal Vasko | e066574 | 2021-02-11 11:08:44 +0100 | [diff] [blame] | 18 | #include "parser_data.h" |
Michal Vasko | c8a230d | 2020-08-14 12:17:10 +0200 | [diff] [blame] | 19 | #include "plugins_types.h" |
Radek Krejci | f0e1ba5 | 2020-05-22 15:14:35 +0200 | [diff] [blame] | 20 | #include "tree_schema_internal.h" |
| 21 | |
Radek Krejci | 1798aae | 2020-07-14 13:26:06 +0200 | [diff] [blame] | 22 | struct lyd_ctx; |
Michal Vasko | afac782 | 2020-10-20 14:22:26 +0200 | [diff] [blame] | 23 | struct ly_in; |
Michal Vasko | c8a230d | 2020-08-14 12:17:10 +0200 | [diff] [blame] | 24 | |
Radek Krejci | 1798aae | 2020-07-14 13:26:06 +0200 | [diff] [blame] | 25 | /** |
| 26 | * @brief Callback for lyd_ctx to free the structure |
| 27 | * |
| 28 | * @param[in] ctx Data parser context to free. |
| 29 | */ |
| 30 | typedef void (*lyd_ctx_free_clb)(struct lyd_ctx *ctx); |
| 31 | |
| 32 | /** |
Michal Vasko | e066574 | 2021-02-11 11:08:44 +0100 | [diff] [blame] | 33 | * @brief Internal data parser flags. |
| 34 | */ |
| 35 | #define LYD_INTOPT_RPC 0x01 /**< RPC request is being parsed. */ |
| 36 | #define LYD_INTOPT_ACTION 0x02 /**< Action request is being parsed. */ |
| 37 | #define LYD_INTOPT_REPLY 0x04 /**< RPC/action reply is being parsed. */ |
| 38 | #define LYD_INTOPT_NOTIF 0x08 /**< Notification is being parsed. */ |
| 39 | #define LYD_INTOPT_WITH_SIBLINGS 0x10 /**< Parse the whole input with any siblings. */ |
| 40 | #define LYD_INTOPT_NO_SIBLINGS 0x20 /**< If there are any siblings, return an error. */ |
| 41 | |
| 42 | /** |
Radek Krejci | 1798aae | 2020-07-14 13:26:06 +0200 | [diff] [blame] | 43 | * @brief Internal (common) context for YANG data parsers. |
Radek Krejci | 4f2e3e5 | 2021-03-30 14:20:28 +0200 | [diff] [blame] | 44 | * |
| 45 | * Covers ::lyd_xml_ctx, ::lyd_json_ctx and lyd_lyb_ctx. |
Radek Krejci | 1798aae | 2020-07-14 13:26:06 +0200 | [diff] [blame] | 46 | */ |
| 47 | struct lyd_ctx { |
Radek Krejci | f16e254 | 2021-02-17 15:39:23 +0100 | [diff] [blame] | 48 | const struct lysc_ext_instance *ext; /**< extension instance possibly changing document root context of the data being parsed */ |
Michal Vasko | e066574 | 2021-02-11 11:08:44 +0100 | [diff] [blame] | 49 | uint32_t parse_opts; /**< various @ref dataparseroptions. */ |
| 50 | uint32_t val_opts; /**< various @ref datavalidationoptions. */ |
| 51 | uint32_t int_opts; /**< internal parser options */ |
Radek Krejci | 1798aae | 2020-07-14 13:26:06 +0200 | [diff] [blame] | 52 | uint32_t path_len; /**< used bytes in the path buffer */ |
| 53 | #define LYD_PARSER_BUFSIZE 4078 |
| 54 | char path[LYD_PARSER_BUFSIZE]; /**< buffer for the generated path */ |
Michal Vasko | c43c8ab | 2021-03-05 13:32:44 +0100 | [diff] [blame] | 55 | struct ly_set node_when; /**< set of nodes with "when" conditions */ |
Radek Krejci | 4f2e3e5 | 2021-03-30 14:20:28 +0200 | [diff] [blame] | 56 | struct ly_set node_exts; /**< set of nodes and extensions connected with a plugin providing own validation callback */ |
Michal Vasko | 3271138 | 2020-12-03 14:14:31 +0100 | [diff] [blame] | 57 | struct ly_set node_types; /**< set of nodes validated with LY_EINCOMPLETE result */ |
| 58 | struct ly_set meta_types; /**< set of metadata validated with LY_EINCOMPLETE result */ |
Radek Krejci | 1798aae | 2020-07-14 13:26:06 +0200 | [diff] [blame] | 59 | struct lyd_node *op_node; /**< if an RPC/action/notification is being parsed, store the pointer to it */ |
| 60 | |
| 61 | /* callbacks */ |
Radek Krejci | 0bff0b1 | 2020-08-15 18:37:50 +0200 | [diff] [blame] | 62 | lyd_ctx_free_clb free; /**< destructor */ |
Radek Krejci | 1798aae | 2020-07-14 13:26:06 +0200 | [diff] [blame] | 63 | |
| 64 | struct { |
Radek Krejci | 0bff0b1 | 2020-08-15 18:37:50 +0200 | [diff] [blame] | 65 | const struct ly_ctx *ctx; /**< libyang context */ |
| 66 | uint64_t line; /**< current line */ |
| 67 | struct ly_in *in; /**< input structure */ |
| 68 | } *data_ctx; /**< generic pointer supposed to map to and access (common part of) XML/JSON/... parser contexts */ |
Radek Krejci | 1798aae | 2020-07-14 13:26:06 +0200 | [diff] [blame] | 69 | }; |
| 70 | |
Radek Krejci | 7931b19 | 2020-06-25 17:05:03 +0200 | [diff] [blame] | 71 | /** |
Radek Krejci | 1798aae | 2020-07-14 13:26:06 +0200 | [diff] [blame] | 72 | * @brief Common part of the lyd_ctx_free_t callbacks. |
| 73 | */ |
| 74 | void lyd_ctx_free(struct lyd_ctx *); |
| 75 | |
| 76 | /** |
Radek Krejci | f0e1ba5 | 2020-05-22 15:14:35 +0200 | [diff] [blame] | 77 | * @brief Parse submodule from YANG data. |
| 78 | * @param[in,out] ctx Parser context. |
| 79 | * @param[in] ly_ctx Context of YANG schemas. |
| 80 | * @param[in] main_ctx Parser context of main module. |
Michal Vasko | 63f3d84 | 2020-07-08 10:10:14 +0200 | [diff] [blame] | 81 | * @param[in] in Input structure. |
Radek Krejci | f0e1ba5 | 2020-05-22 15:14:35 +0200 | [diff] [blame] | 82 | * @param[out] submod Pointer to the parsed submodule structure. |
| 83 | * @return LY_ERR value - LY_SUCCESS, LY_EINVAL or LY_EVALID. |
| 84 | */ |
| 85 | LY_ERR yang_parse_submodule(struct lys_yang_parser_ctx **context, struct ly_ctx *ly_ctx, struct lys_parser_ctx *main_ctx, |
Radek Krejci | 0f96988 | 2020-08-21 16:56:47 +0200 | [diff] [blame] | 86 | struct ly_in *in, struct lysp_submodule **submod); |
Radek Krejci | f0e1ba5 | 2020-05-22 15:14:35 +0200 | [diff] [blame] | 87 | |
| 88 | /** |
| 89 | * @brief Parse module from YANG data. |
| 90 | * @param[in] ctx Parser context. |
Michal Vasko | 63f3d84 | 2020-07-08 10:10:14 +0200 | [diff] [blame] | 91 | * @param[in] in Input structure. |
| 92 | * @param[in,out] mod Prepared module structure where the parsed information, including the parsed |
Radek Krejci | f0e1ba5 | 2020-05-22 15:14:35 +0200 | [diff] [blame] | 93 | * module structure, will be filled in. |
Michal Vasko | 405cc9e | 2020-12-01 12:01:27 +0100 | [diff] [blame] | 94 | * @param[in,out] unres Global unres structure. |
| 95 | * @return LY_ERR values. |
Radek Krejci | f0e1ba5 | 2020-05-22 15:14:35 +0200 | [diff] [blame] | 96 | */ |
Michal Vasko | 405cc9e | 2020-12-01 12:01:27 +0100 | [diff] [blame] | 97 | LY_ERR yang_parse_module(struct lys_yang_parser_ctx **context, struct ly_in *in, struct lys_module *mod, |
| 98 | struct lys_glob_unres *unres); |
Radek Krejci | f0e1ba5 | 2020-05-22 15:14:35 +0200 | [diff] [blame] | 99 | |
| 100 | /** |
| 101 | * @brief Parse module from YIN data. |
| 102 | * |
| 103 | * @param[in,out] yin_ctx Context created during parsing, is used to finalize lysp_model after it's completly parsed. |
Michal Vasko | 63f3d84 | 2020-07-08 10:10:14 +0200 | [diff] [blame] | 104 | * @param[in] in Input structure. |
Radek Krejci | f0e1ba5 | 2020-05-22 15:14:35 +0200 | [diff] [blame] | 105 | * @param[in,out] mod Prepared module structure where the parsed information, including the parsed |
| 106 | * module structure, will be filled in. |
Michal Vasko | 405cc9e | 2020-12-01 12:01:27 +0100 | [diff] [blame] | 107 | * @param[in,out] unres Global unres structure. |
Radek Krejci | f0e1ba5 | 2020-05-22 15:14:35 +0200 | [diff] [blame] | 108 | * @return LY_ERR values. |
| 109 | */ |
Michal Vasko | 405cc9e | 2020-12-01 12:01:27 +0100 | [diff] [blame] | 110 | LY_ERR yin_parse_module(struct lys_yin_parser_ctx **yin_ctx, struct ly_in *in, struct lys_module *mod, |
| 111 | struct lys_glob_unres *unres); |
Radek Krejci | f0e1ba5 | 2020-05-22 15:14:35 +0200 | [diff] [blame] | 112 | |
| 113 | /** |
| 114 | * @brief Parse submodule from YIN data. |
| 115 | * |
| 116 | * @param[in,out] yin_ctx Context created during parsing, is used to finalize lysp_model after it's completly parsed. |
| 117 | * @param[in] ctx Libyang context. |
| 118 | * @param[in] main_ctx Parser context of main module. |
Michal Vasko | 63f3d84 | 2020-07-08 10:10:14 +0200 | [diff] [blame] | 119 | * @param[in] in Input structure. |
Radek Krejci | f0e1ba5 | 2020-05-22 15:14:35 +0200 | [diff] [blame] | 120 | * @param[in,out] submod Submodule structure where the parsed information, will be filled in. |
| 121 | * @return LY_ERR values. |
| 122 | */ |
| 123 | LY_ERR yin_parse_submodule(struct lys_yin_parser_ctx **yin_ctx, struct ly_ctx *ctx, struct lys_parser_ctx *main_ctx, |
Radek Krejci | 0f96988 | 2020-08-21 16:56:47 +0200 | [diff] [blame] | 124 | struct ly_in *in, struct lysp_submodule **submod); |
Radek Krejci | f0e1ba5 | 2020-05-22 15:14:35 +0200 | [diff] [blame] | 125 | |
Radek Krejci | 1798aae | 2020-07-14 13:26:06 +0200 | [diff] [blame] | 126 | /** |
Michal Vasko | e066574 | 2021-02-11 11:08:44 +0100 | [diff] [blame] | 127 | * @brief Parse XML string as a YANG data tree. |
Michal Vasko | afac782 | 2020-10-20 14:22:26 +0200 | [diff] [blame] | 128 | * |
Michal Vasko | e066574 | 2021-02-11 11:08:44 +0100 | [diff] [blame] | 129 | * @param[in] ctx libyang context. |
Radek Krejci | f16e254 | 2021-02-17 15:39:23 +0100 | [diff] [blame] | 130 | * @param[in] ext Optional extenion instance to parse data following the schema tree specified in the extension instance |
Michal Vasko | e066574 | 2021-02-11 11:08:44 +0100 | [diff] [blame] | 131 | * @param[in] parent Parent to connect the parsed nodes to, if any. |
| 132 | * @param[in,out] first_p Pointer to the first top-level parsed node, used only if @p parent is NULL. |
Michal Vasko | afac782 | 2020-10-20 14:22:26 +0200 | [diff] [blame] | 133 | * @param[in] in Input structure. |
Michal Vasko | e066574 | 2021-02-11 11:08:44 +0100 | [diff] [blame] | 134 | * @param[in] parse_opts Options for parser, see @ref dataparseroptions. |
| 135 | * @param[in] val_opts Options for the validation phase, see @ref datavalidationoptions. |
| 136 | * @param[in] data_type Expected data type of the data. |
Michal Vasko | 299d5d1 | 2021-02-16 16:36:37 +0100 | [diff] [blame] | 137 | * @param[out] envp Individual parsed envelopes tree, returned only by specific @p data_type and possibly even if |
| 138 | * an error occurs later. |
Michal Vasko | e066574 | 2021-02-11 11:08:44 +0100 | [diff] [blame] | 139 | * @param[out] parsed Set to add all the parsed siblings into. |
Michal Vasko | afac782 | 2020-10-20 14:22:26 +0200 | [diff] [blame] | 140 | * @param[out] lydctx_p Data parser context to finish validation. |
| 141 | * @return LY_ERR value. |
| 142 | */ |
Radek Krejci | f16e254 | 2021-02-17 15:39:23 +0100 | [diff] [blame] | 143 | LY_ERR lyd_parse_xml(const struct ly_ctx *ctx, const struct lysc_ext_instance *ext, struct lyd_node *parent, |
| 144 | struct lyd_node **first_p, struct ly_in *in, uint32_t parse_opts, uint32_t val_opts, enum lyd_type data_type, |
| 145 | struct lyd_node **envp, struct ly_set *parsed, struct lyd_ctx **lydctx_p); |
Michal Vasko | afac782 | 2020-10-20 14:22:26 +0200 | [diff] [blame] | 146 | |
| 147 | /** |
Michal Vasko | e066574 | 2021-02-11 11:08:44 +0100 | [diff] [blame] | 148 | * @brief Parse JSON string as a YANG data tree. |
Michal Vasko | afac782 | 2020-10-20 14:22:26 +0200 | [diff] [blame] | 149 | * |
Michal Vasko | afac782 | 2020-10-20 14:22:26 +0200 | [diff] [blame] | 150 | * @param[in] ctx libyang context. |
Radek Krejci | f16e254 | 2021-02-17 15:39:23 +0100 | [diff] [blame] | 151 | * @param[in] ext Optional extenion instance to parse data following the schema tree specified in the extension instance |
Michal Vasko | e066574 | 2021-02-11 11:08:44 +0100 | [diff] [blame] | 152 | * @param[in] parent Parent to connect the parsed nodes to, if any. |
| 153 | * @param[in,out] first_p Pointer to the first top-level parsed node, used only if @p parent is NULL. |
Michal Vasko | afac782 | 2020-10-20 14:22:26 +0200 | [diff] [blame] | 154 | * @param[in] in Input structure. |
Michal Vasko | e066574 | 2021-02-11 11:08:44 +0100 | [diff] [blame] | 155 | * @param[in] parse_opts Options for parser, see @ref dataparseroptions. |
| 156 | * @param[in] val_opts Options for the validation phase, see @ref datavalidationoptions. |
| 157 | * @param[in] data_type Expected data type of the data. |
| 158 | * @param[out] parsed Set to add all the parsed siblings into. |
Michal Vasko | afac782 | 2020-10-20 14:22:26 +0200 | [diff] [blame] | 159 | * @param[out] lydctx_p Data parser context to finish validation. |
| 160 | * @return LY_ERR value. |
| 161 | */ |
Radek Krejci | f16e254 | 2021-02-17 15:39:23 +0100 | [diff] [blame] | 162 | LY_ERR lyd_parse_json(const struct ly_ctx *ctx, const struct lysc_ext_instance *ext, struct lyd_node *parent, |
| 163 | struct lyd_node **first_p, struct ly_in *in, uint32_t parse_opts, uint32_t val_opts, enum lyd_type data_type, |
| 164 | struct ly_set *parsed, struct lyd_ctx **lydctx_p); |
Michal Vasko | afac782 | 2020-10-20 14:22:26 +0200 | [diff] [blame] | 165 | |
| 166 | /** |
Michal Vasko | e066574 | 2021-02-11 11:08:44 +0100 | [diff] [blame] | 167 | * @brief Parse binary LYB data as a YANG data tree. |
Michal Vasko | afac782 | 2020-10-20 14:22:26 +0200 | [diff] [blame] | 168 | * |
Michal Vasko | afac782 | 2020-10-20 14:22:26 +0200 | [diff] [blame] | 169 | * @param[in] ctx libyang context. |
Radek Krejci | f16e254 | 2021-02-17 15:39:23 +0100 | [diff] [blame] | 170 | * @param[in] ext Optional extenion instance to parse data following the schema tree specified in the extension instance |
Michal Vasko | e066574 | 2021-02-11 11:08:44 +0100 | [diff] [blame] | 171 | * @param[in] parent Parent to connect the parsed nodes to, if any. |
| 172 | * @param[in,out] first_p Pointer to the first top-level parsed node, used only if @p parent is NULL. |
Michal Vasko | afac782 | 2020-10-20 14:22:26 +0200 | [diff] [blame] | 173 | * @param[in] in Input structure. |
Michal Vasko | e066574 | 2021-02-11 11:08:44 +0100 | [diff] [blame] | 174 | * @param[in] parse_opts Options for parser, see @ref dataparseroptions. |
| 175 | * @param[in] val_opts Options for the validation phase, see @ref datavalidationoptions. |
| 176 | * @param[in] data_type Expected data type of the data. |
| 177 | * @param[out] parsed Set to add all the parsed siblings into. |
Michal Vasko | afac782 | 2020-10-20 14:22:26 +0200 | [diff] [blame] | 178 | * @param[out] lydctx_p Data parser context to finish validation. |
| 179 | * @return LY_ERR value. |
| 180 | */ |
Radek Krejci | f16e254 | 2021-02-17 15:39:23 +0100 | [diff] [blame] | 181 | LY_ERR lyd_parse_lyb(const struct ly_ctx *ctx, const struct lysc_ext_instance *ext, struct lyd_node *parent, |
| 182 | struct lyd_node **first_p, struct ly_in *in, uint32_t parse_opts, uint32_t val_opts, enum lyd_type data_type, |
| 183 | struct ly_set *parsed, struct lyd_ctx **lydctx_p); |
Michal Vasko | afac782 | 2020-10-20 14:22:26 +0200 | [diff] [blame] | 184 | |
| 185 | /** |
Michal Vasko | e066574 | 2021-02-11 11:08:44 +0100 | [diff] [blame] | 186 | * @brief Search all the parents for an operation node, check validity based on internal parser flags. |
Michal Vasko | afac782 | 2020-10-20 14:22:26 +0200 | [diff] [blame] | 187 | * |
Michal Vasko | e066574 | 2021-02-11 11:08:44 +0100 | [diff] [blame] | 188 | * @param[in] parent Parent to connect the parsed nodes to. |
| 189 | * @param[in] int_opt Internal parser options. |
| 190 | * @param[out] op Found operation, if any. |
Michal Vasko | afac782 | 2020-10-20 14:22:26 +0200 | [diff] [blame] | 191 | * @return LY_ERR value. |
| 192 | */ |
Michal Vasko | e066574 | 2021-02-11 11:08:44 +0100 | [diff] [blame] | 193 | LY_ERR lyd_parser_find_operation(const struct lyd_node *parent, uint32_t int_opts, struct lyd_node **op); |
Michal Vasko | afac782 | 2020-10-20 14:22:26 +0200 | [diff] [blame] | 194 | |
| 195 | /** |
Radek Krejci | 1798aae | 2020-07-14 13:26:06 +0200 | [diff] [blame] | 196 | * @brief Check that a data node representing the @p snode is suitable based on options. |
| 197 | * |
| 198 | * @param[in] lydctx Common data parsers context. |
| 199 | * @param[in] snode Schema node to check. |
| 200 | * @return LY_SUCCESS or LY_EVALID |
| 201 | */ |
| 202 | LY_ERR lyd_parser_check_schema(struct lyd_ctx *lydctx, const struct lysc_node *snode); |
| 203 | |
| 204 | /** |
Radek Krejci | 8678fa4 | 2020-08-18 16:07:28 +0200 | [diff] [blame] | 205 | * @brief Wrapper around ::lyd_create_term() for data parsers. |
Radek Krejci | 1798aae | 2020-07-14 13:26:06 +0200 | [diff] [blame] | 206 | * |
| 207 | * @param[in] lydctx Data parser context. |
Michal Vasko | feca4fb | 2020-10-05 08:58:40 +0200 | [diff] [blame] | 208 | * @param[in] hints Data parser's hint for the value's type. |
Radek Krejci | 1798aae | 2020-07-14 13:26:06 +0200 | [diff] [blame] | 209 | */ |
| 210 | LY_ERR lyd_parser_create_term(struct lyd_ctx *lydctx, const struct lysc_node *schema, const char *value, size_t value_len, |
Michal Vasko | feca4fb | 2020-10-05 08:58:40 +0200 | [diff] [blame] | 211 | ly_bool *dynamic, LY_PREFIX_FORMAT format, void *prefix_data, uint32_t hints, struct lyd_node **node); |
Radek Krejci | 1798aae | 2020-07-14 13:26:06 +0200 | [diff] [blame] | 212 | |
| 213 | /** |
Radek Krejci | 8678fa4 | 2020-08-18 16:07:28 +0200 | [diff] [blame] | 214 | * @brief Wrapper around ::lyd_create_meta() for data parsers. |
Radek Krejci | 1798aae | 2020-07-14 13:26:06 +0200 | [diff] [blame] | 215 | * |
| 216 | * @param[in] lydctx Data parser context. |
Michal Vasko | b68571a | 2020-11-06 17:18:41 +0100 | [diff] [blame] | 217 | * @param[in] parent Parent of the created meta. Must be set if @p meta is NULL. |
| 218 | * @param[in,out] meta First existing meta to connect to or empty pointer to set. Must be set if @p parent is NULL. |
| 219 | * @param[in] mod Module of the created metadata. |
| 220 | * @param[in] name Metadata name. |
| 221 | * @param[in] name_len Length of @p name. |
| 222 | * @param[in] value Metadata value. |
| 223 | * @param[in] value_len Length of @p value. |
| 224 | * @param[in,out] dynamic Whether the @p value is dynamically allocated, is adjusted once the value is assigned. |
| 225 | * @param[in] format Prefix format. |
| 226 | * @param[in] prefix_data Prefix format data (see ::ly_resolve_prefix()). |
Michal Vasko | feca4fb | 2020-10-05 08:58:40 +0200 | [diff] [blame] | 227 | * @param[in] hints [Value hint](@ref lydvalhints) from the parser regarding the value type. |
Michal Vasko | b68571a | 2020-11-06 17:18:41 +0100 | [diff] [blame] | 228 | * @return LY_ERR value. |
Radek Krejci | 1798aae | 2020-07-14 13:26:06 +0200 | [diff] [blame] | 229 | */ |
Michal Vasko | c8a230d | 2020-08-14 12:17:10 +0200 | [diff] [blame] | 230 | LY_ERR lyd_parser_create_meta(struct lyd_ctx *lydctx, struct lyd_node *parent, struct lyd_meta **meta, |
Radek Krejci | 0f96988 | 2020-08-21 16:56:47 +0200 | [diff] [blame] | 231 | const struct lys_module *mod, const char *name, size_t name_len, const char *value, |
Michal Vasko | feca4fb | 2020-10-05 08:58:40 +0200 | [diff] [blame] | 232 | size_t value_len, ly_bool *dynamic, LY_PREFIX_FORMAT format, void *prefix_data, uint32_t hints); |
Radek Krejci | 1798aae | 2020-07-14 13:26:06 +0200 | [diff] [blame] | 233 | |
Radek Krejci | f0e1ba5 | 2020-05-22 15:14:35 +0200 | [diff] [blame] | 234 | #endif /* LY_PARSER_INTERNAL_H_ */ |