blob: a7ee036e72ce49eaa77aef0006fe7ecede2df26a [file] [log] [blame]
Radek Krejcie9f13b12020-11-09 17:42:04 +01001/**
2 * @file cmd_data.c
3 * @author Michal Vasko <mvasko@cesnet.cz>
4 * @author Radek Krejci <rkrejci@cesnet.cz>
aPieceka83b8e02023-06-07 15:25:16 +02005 * @author Adam Piecek <piecek@cesnet.cz>
Radek Krejcie9f13b12020-11-09 17:42:04 +01006 * @brief 'data' command of the libyang's yanglint tool.
7 *
aPieceka83b8e02023-06-07 15:25:16 +02008 * Copyright (c) 2015-2023 CESNET, z.s.p.o.
Radek Krejcie9f13b12020-11-09 17:42:04 +01009 *
10 * This source code is licensed under BSD 3-Clause License (the "License").
11 * You may not use this file except in compliance with the License.
12 * You may obtain a copy of the License at
13 *
14 * https://opensource.org/licenses/BSD-3-Clause
15 */
16
17#define _GNU_SOURCE
18
19#include "cmd.h"
20
aPieceka83b8e02023-06-07 15:25:16 +020021#include <assert.h>
Radek Krejcie9f13b12020-11-09 17:42:04 +010022#include <errno.h>
23#include <getopt.h>
24#include <stdint.h>
25#include <stdio.h>
26#include <string.h>
27#include <strings.h>
28
29#include "libyang.h"
30
31#include "common.h"
aPieceka83b8e02023-06-07 15:25:16 +020032#include "yl_opt.h"
Radek Krejcie9f13b12020-11-09 17:42:04 +010033
aPiecekb073f6a2023-04-28 15:23:25 +020034static void
35cmd_data_help_header(void)
Radek Krejcie9f13b12020-11-09 17:42:04 +010036{
Michal Vaskod3b10542021-02-03 11:31:16 +010037 printf("Usage: data [-emn] [-t TYPE]\n"
38 " [-F FORMAT] [-f FORMAT] [-d DEFAULTS] [-o OUTFILE] <data1> ...\n"
39 " data [-n] -t (rpc | notif | reply) [-O FILE]\n"
40 " [-F FORMAT] [-f FORMAT] [-d DEFAULTS] [-o OUTFILE] <data1> ...\n"
41 " data [-en] [-t TYPE] [-F FORMAT] -x XPATH [-o OUTFILE] <data1> ...\n"
aPiecekb073f6a2023-04-28 15:23:25 +020042 " Parse, validate and optionally print data instances\n");
43}
Radek Krejcie9f13b12020-11-09 17:42:04 +010044
aPiecekb073f6a2023-04-28 15:23:25 +020045static void
46cmd_data_help_type(void)
47{
48 printf(" -t TYPE, --type=TYPE\n"
Radek Krejcie9f13b12020-11-09 17:42:04 +010049 " Specify data tree type in the input data file(s):\n"
50 " data - Complete datastore with status data (default type).\n"
51 " config - Configuration datastore (without status data).\n"
52 " get - Result of the NETCONF <get> operation.\n"
53 " getconfig - Result of the NETCONF <get-config> operation.\n"
54 " edit - Content of the NETCONF <edit-config> operation.\n"
55 " rpc - Content of the NETCONF <rpc> message, defined as YANG's\n"
56 " RPC/Action input statement.\n"
aPiecek860e34f2023-04-28 10:01:32 +020057 " nc-rpc - Similar to 'rpc' but expect and check also the NETCONF\n"
58 " envelopes <rpc> or <action>.\n"
Radek Krejci6784a4e2020-12-09 14:23:05 +010059 " reply - Reply to the RPC/Action. Note that the reply data are\n"
60 " expected inside a container representing the original\n"
61 " RPC/Action. This is necessary to identify appropriate\n"
62 " data definitions in the schema module.\n"
aPiecek079bcde2023-05-05 11:48:25 +020063 " nc-reply - Similar to 'reply' but expect and check also the NETCONF\n"
64 " envelope <rpc-reply> with output data nodes as direct\n"
65 " descendants. The original RPC/action invocation is expected\n"
66 " in a separate parameter '-R' and is parsed as 'nc-rpc'.\n"
Radek Krejcie9f13b12020-11-09 17:42:04 +010067 " notif - Notification instance (content of the <notification>\n"
aPiecek6d2c1e72023-04-28 15:54:48 +020068 " element without <eventTime>).\n"
69 " nc-notif - Similar to 'notif' but expect and check also the NETCONF\n"
70 " envelope <notification> with element <eventTime> and its\n"
71 " sibling as the actual notification.\n");
aPiecekb073f6a2023-04-28 15:23:25 +020072}
Radek Krejcie9f13b12020-11-09 17:42:04 +010073
aPiecekb073f6a2023-04-28 15:23:25 +020074static void
75cmd_data_help_format(void)
76{
77 printf(" -f FORMAT, --format=FORMAT\n"
78 " Print the data in one of the following formats:\n"
79 " xml, json, lyb\n"
80 " Note that the LYB format requires the -o option specified.\n");
81}
82
83static void
84cmd_data_help_in_format(void)
85{
86 printf(" -F FORMAT, --in-format=FORMAT\n"
87 " Load the data in one of the following formats:\n"
88 " xml, json, lyb\n"
89 " If input format not specified, it is detected from the file extension.\n");
90}
91
92static void
93cmd_data_help_default(void)
94{
95 printf(" -d MODE, --default=MODE\n"
96 " Print data with default values, according to the MODE\n"
97 " (to print attributes, ietf-netconf-with-defaults model\n"
98 " must be loaded):\n"
99 " all - Add missing default nodes.\n"
100 " all-tagged - Add missing default nodes and mark all the default\n"
101 " nodes with the attribute.\n"
102 " trim - Remove all nodes with a default value.\n"
103 " implicit-tagged - Add missing nodes and mark them with the attribute.\n");
104}
105
106static void
107cmd_data_help_xpath(void)
108{
109 printf(" -x XPATH, --xpath=XPATH\n"
aPiecek41955272023-05-10 16:10:17 +0200110 " Evaluate XPATH expression and print the nodes satisfying the\n"
aPiecekb073f6a2023-04-28 15:23:25 +0200111 " expression. The output format is specific and the option cannot\n"
112 " be combined with the -f and -d options. Also all the data\n"
113 " inputs are merged into a single data tree where the expression\n"
114 " is evaluated, so the -m option is always set implicitly.\n");
115}
116
117void
118cmd_data_help(void)
119{
120 cmd_data_help_header();
121 printf("\n");
122 cmd_data_help_type();
123 printf(" -e, --present Validate only with the schema modules whose data actually\n"
Radek Krejcie9f13b12020-11-09 17:42:04 +0100124 " exist in the provided input data files. Takes effect only\n"
125 " with the 'data' or 'config' TYPEs. Used to avoid requiring\n"
126 " mandatory nodes from modules which data are not present in the\n"
127 " provided input data files.\n"
128 " -m, --merge Merge input data files into a single tree and validate at\n"
129 " once.The option has effect only for 'data' and 'config' TYPEs.\n"
130 " In case of using -x option, the data are always merged.\n"
Michal Vaskoc431a0a2021-01-25 14:31:58 +0100131 " -n, --not-strict\n"
132 " Do not require strict data parsing (silently skip unknown data),\n"
aPiecekb073f6a2023-04-28 15:23:25 +0200133 " has no effect for schemas.\n"
Radek Krejcie9f13b12020-11-09 17:42:04 +0100134 " -O FILE, --operational=FILE\n"
135 " Provide optional data to extend validation of the 'rpc',\n"
136 " 'reply' or 'notif' TYPEs. The FILE is supposed to contain\n"
aPieceka40764b2023-04-27 15:34:56 +0200137 " the operational datastore referenced from the operation.\n"
138 " In case of a nested notification or action, its parent\n"
aPiecek079bcde2023-05-05 11:48:25 +0200139 " existence is also checked in these operational data.\n"
140 " -R FILE, --reply-rpc=FILE\n"
141 " Provide source RPC for parsing of the 'nc-reply' TYPE. The FILE\n"
142 " is supposed to contain the source 'nc-rpc' operation of the reply.\n");
aPiecekb073f6a2023-04-28 15:23:25 +0200143 cmd_data_help_format();
144 cmd_data_help_in_format();
145 printf(" -o OUTFILE, --output=OUTFILE\n"
146 " Write the output to OUTFILE instead of stdout.\n");
147 cmd_data_help_xpath();
148 printf("\n");
Radek Krejcie9f13b12020-11-09 17:42:04 +0100149}
150
aPieceka83b8e02023-06-07 15:25:16 +0200151int
152cmd_data_opt(struct yl_opt *yo, const char *cmdline, char ***posv, int *posc)
Radek Krejcie9f13b12020-11-09 17:42:04 +0100153{
aPieceka83b8e02023-06-07 15:25:16 +0200154 int rc = 0, argc = 0;
Radek Krejcie9f13b12020-11-09 17:42:04 +0100155 int opt, opt_index;
156 struct option options[] = {
Michal Vasko667ce6b2021-01-25 15:00:27 +0100157 {"defaults", required_argument, NULL, 'd'},
158 {"present", no_argument, NULL, 'e'},
159 {"format", required_argument, NULL, 'f'},
Michal Vaskod3b10542021-02-03 11:31:16 +0100160 {"in-format", required_argument, NULL, 'F'},
Michal Vasko667ce6b2021-01-25 15:00:27 +0100161 {"help", no_argument, NULL, 'h'},
162 {"merge", no_argument, NULL, 'm'},
163 {"output", required_argument, NULL, 'o'},
Radek Krejcie9f13b12020-11-09 17:42:04 +0100164 {"operational", required_argument, NULL, 'O'},
aPiecek079bcde2023-05-05 11:48:25 +0200165 {"reply-rpc", required_argument, NULL, 'R'},
Michal Vasko667ce6b2021-01-25 15:00:27 +0100166 {"not-strict", no_argument, NULL, 'n'},
167 {"type", required_argument, NULL, 't'},
168 {"xpath", required_argument, NULL, 'x'},
Radek Krejcie9f13b12020-11-09 17:42:04 +0100169 {NULL, 0, NULL, 0}
170 };
171
Radek Krejcie9f13b12020-11-09 17:42:04 +0100172 uint8_t data_type_set = 0;
Radek Krejcie9f13b12020-11-09 17:42:04 +0100173
aPieceka83b8e02023-06-07 15:25:16 +0200174 yo->data_parse_options = YL_DEFAULT_DATA_PARSE_OPTIONS;
175 yo->data_validate_options = YL_DEFAULT_DATA_VALIDATE_OPTIONS;
176
177 if ((rc = parse_cmdline(cmdline, &argc, &yo->argv))) {
178 return rc;
Radek Krejcie9f13b12020-11-09 17:42:04 +0100179 }
180
aPieceka83b8e02023-06-07 15:25:16 +0200181 while ((opt = getopt_long(argc, yo->argv, commands[CMD_DATA].optstring, options, &opt_index)) != -1) {
Radek Krejcie9f13b12020-11-09 17:42:04 +0100182 switch (opt) {
183 case 'd': /* --default */
aPiecek20cc2fe2023-06-09 09:32:28 +0200184 if (yo_opt_update_data_default(optarg, yo)) {
Radek Krejcie9f13b12020-11-09 17:42:04 +0100185 YLMSG_E("Unknown default mode %s\n", optarg);
aPiecekb073f6a2023-04-28 15:23:25 +0200186 cmd_data_help_default();
aPieceka83b8e02023-06-07 15:25:16 +0200187 return 1;
Radek Krejcie9f13b12020-11-09 17:42:04 +0100188 }
189 break;
190 case 'f': /* --format */
aPiecek113e0f02023-06-09 08:47:48 +0200191 if (yl_opt_update_data_out_format(optarg, yo)) {
aPiecekb073f6a2023-04-28 15:23:25 +0200192 cmd_data_help_format();
aPieceka83b8e02023-06-07 15:25:16 +0200193 return 1;
Radek Krejcie9f13b12020-11-09 17:42:04 +0100194 }
195 break;
Michal Vaskod3b10542021-02-03 11:31:16 +0100196 case 'F': /* --in-format */
197 if (!strcasecmp(optarg, "xml")) {
aPieceka83b8e02023-06-07 15:25:16 +0200198 yo->data_in_format = LYD_XML;
Michal Vaskod3b10542021-02-03 11:31:16 +0100199 } else if (!strcasecmp(optarg, "json")) {
aPieceka83b8e02023-06-07 15:25:16 +0200200 yo->data_in_format = LYD_JSON;
Michal Vaskod3b10542021-02-03 11:31:16 +0100201 } else if (!strcasecmp(optarg, "lyb")) {
aPieceka83b8e02023-06-07 15:25:16 +0200202 yo->data_in_format = LYD_LYB;
Michal Vaskod3b10542021-02-03 11:31:16 +0100203 } else {
204 YLMSG_E("Unknown input format %s\n", optarg);
aPiecekb073f6a2023-04-28 15:23:25 +0200205 cmd_data_help_in_format();
aPieceka83b8e02023-06-07 15:25:16 +0200206 return 1;
Michal Vaskod3b10542021-02-03 11:31:16 +0100207 }
208 break;
Radek Krejcie9f13b12020-11-09 17:42:04 +0100209 case 'o': /* --output */
aPieceka83b8e02023-06-07 15:25:16 +0200210 if (yo->out) {
Radek Krejcie9f13b12020-11-09 17:42:04 +0100211 YLMSG_E("Only a single output can be specified.\n");
aPieceka83b8e02023-06-07 15:25:16 +0200212 return 1;
Radek Krejcie9f13b12020-11-09 17:42:04 +0100213 } else {
aPieceka83b8e02023-06-07 15:25:16 +0200214 if (ly_out_new_filepath(optarg, &yo->out)) {
Radek Krejcie9f13b12020-11-09 17:42:04 +0100215 YLMSG_E("Unable open output file %s (%s)\n", optarg, strerror(errno));
aPieceka83b8e02023-06-07 15:25:16 +0200216 return 1;
Radek Krejcie9f13b12020-11-09 17:42:04 +0100217 }
218 }
219 break;
aPieceka83b8e02023-06-07 15:25:16 +0200220 case 'O': /* --operational */
221 if (yo->data_operational.path) {
Radek Krejcie9f13b12020-11-09 17:42:04 +0100222 YLMSG_E("The operational datastore (-O) cannot be set multiple times.\n");
aPieceka83b8e02023-06-07 15:25:16 +0200223 return 1;
Radek Krejcie9f13b12020-11-09 17:42:04 +0100224 }
aPieceka83b8e02023-06-07 15:25:16 +0200225 yo->data_operational.path = optarg;
Radek Krejcie9f13b12020-11-09 17:42:04 +0100226 break;
aPieceka83b8e02023-06-07 15:25:16 +0200227 case 'R': /* --reply-rpc */
228 if (yo->reply_rpc.path) {
aPiecek079bcde2023-05-05 11:48:25 +0200229 YLMSG_E("The PRC of the reply (-R) cannot be set multiple times.\n");
aPieceka83b8e02023-06-07 15:25:16 +0200230 return 1;
aPiecek079bcde2023-05-05 11:48:25 +0200231 }
aPieceka83b8e02023-06-07 15:25:16 +0200232 yo->reply_rpc.path = optarg;
aPiecek079bcde2023-05-05 11:48:25 +0200233 break;
Radek Krejcie9f13b12020-11-09 17:42:04 +0100234 case 'e': /* --present */
aPieceka83b8e02023-06-07 15:25:16 +0200235 yo->data_validate_options |= LYD_VALIDATE_PRESENT;
Radek Krejcie9f13b12020-11-09 17:42:04 +0100236 break;
237 case 'm': /* --merge */
aPieceka83b8e02023-06-07 15:25:16 +0200238 yo->data_merge = 1;
Radek Krejcie9f13b12020-11-09 17:42:04 +0100239 break;
Michal Vasko667ce6b2021-01-25 15:00:27 +0100240 case 'n': /* --not-strict */
aPieceka83b8e02023-06-07 15:25:16 +0200241 yo->data_parse_options &= ~LYD_PARSE_STRICT;
Radek Krejcie9f13b12020-11-09 17:42:04 +0100242 break;
243 case 't': /* --type */
244 if (data_type_set) {
245 YLMSG_E("The data type (-t) cannot be set multiple times.\n");
aPieceka83b8e02023-06-07 15:25:16 +0200246 return 1;
Radek Krejcie9f13b12020-11-09 17:42:04 +0100247 }
248
aPiecek3167f382023-06-09 09:23:10 +0200249 if (yl_opt_update_data_type(optarg, yo)) {
Radek Krejcie9f13b12020-11-09 17:42:04 +0100250 YLMSG_E("Unknown data tree type %s.\n", optarg);
aPiecekb073f6a2023-04-28 15:23:25 +0200251 cmd_data_help_type();
aPieceka83b8e02023-06-07 15:25:16 +0200252 return 1;
Radek Krejcie9f13b12020-11-09 17:42:04 +0100253 }
254
255 data_type_set = 1;
256 break;
257
258 case 'x': /* --xpath */
aPieceka83b8e02023-06-07 15:25:16 +0200259 if (ly_set_add(&yo->data_xpath, optarg, 0, NULL)) {
Radek Krejcie9f13b12020-11-09 17:42:04 +0100260 YLMSG_E("Storing XPath \"%s\" failed.\n", optarg);
aPieceka83b8e02023-06-07 15:25:16 +0200261 return 1;
Radek Krejcie9f13b12020-11-09 17:42:04 +0100262 }
263 break;
264
265 case 'h': /* --help */
266 cmd_data_help();
aPieceka83b8e02023-06-07 15:25:16 +0200267 return 1;
Radek Krejcie9f13b12020-11-09 17:42:04 +0100268 default:
269 YLMSG_E("Unknown option.\n");
aPieceka83b8e02023-06-07 15:25:16 +0200270 return 1;
Radek Krejcie9f13b12020-11-09 17:42:04 +0100271 }
272 }
273
aPieceka83b8e02023-06-07 15:25:16 +0200274 *posv = &yo->argv[optind];
275 *posc = argc - optind;
276
277 return rc;
278}
279
280int
281cmd_data_dep(struct yl_opt *yo, int posc)
282{
283 if (yo->interactive && !posc) {
Radek Krejcie9f13b12020-11-09 17:42:04 +0100284 YLMSG_E("Missing the data file to process.\n");
aPieceka83b8e02023-06-07 15:25:16 +0200285 return 1;
Radek Krejcie9f13b12020-11-09 17:42:04 +0100286 }
287
aPieceka83b8e02023-06-07 15:25:16 +0200288 if (yo->data_merge) {
289 if (yo->data_type || (yo->data_parse_options & LYD_PARSE_ONLY)) {
Radek Krejcie9f13b12020-11-09 17:42:04 +0100290 /* switch off the option, incompatible input data type */
aPiecek3d46fa92023-05-10 08:30:39 +0200291 YLMSG_W("The --merge option has effect only for 'data' and 'config' TYPEs\n");
aPieceka83b8e02023-06-07 15:25:16 +0200292 yo->data_merge = 0;
Radek Krejcie9f13b12020-11-09 17:42:04 +0100293 } else {
294 /* postpone validation after the merge of all the input data */
aPieceka83b8e02023-06-07 15:25:16 +0200295 yo->data_parse_options |= LYD_PARSE_ONLY;
Radek Krejcie9f13b12020-11-09 17:42:04 +0100296 }
aPieceka83b8e02023-06-07 15:25:16 +0200297 } else if (yo->data_xpath.count) {
298 yo->data_merge = 1;
Radek Krejcie9f13b12020-11-09 17:42:04 +0100299 }
300
aPiecekbc39de12023-06-08 08:10:29 +0200301 if (yo->data_xpath.count && (yo->schema_out_format || yo->data_out_format)) {
Radek Krejcie9f13b12020-11-09 17:42:04 +0100302 YLMSG_E("The --format option cannot be combined with --xpath option.\n");
aPieceka83b8e02023-06-07 15:25:16 +0200303 if (yo->interactive) {
304 cmd_data_help_xpath();
305 }
306 return 1;
Radek Krejcie9f13b12020-11-09 17:42:04 +0100307 }
aPieceka83b8e02023-06-07 15:25:16 +0200308 if (yo->data_xpath.count && (yo->data_print_options & LYD_PRINT_WD_MASK)) {
aPiecek72a24c92023-04-12 15:03:05 +0200309 YLMSG_E("The --default option cannot be combined with --xpath option.\n");
aPieceka83b8e02023-06-07 15:25:16 +0200310 if (yo->interactive) {
311 cmd_data_help_xpath();
312 }
313 return 1;
aPiecek72a24c92023-04-12 15:03:05 +0200314 }
Radek Krejcie9f13b12020-11-09 17:42:04 +0100315
aPieceka83b8e02023-06-07 15:25:16 +0200316 if (yo->data_operational.path && !yo->data_type) {
aPiecekbc39de12023-06-08 08:10:29 +0200317 YLMSG_W("Operational datastore takes effect only with RPCs/Actions/Replies/Notification input data types.\n");
aPieceka83b8e02023-06-07 15:25:16 +0200318 yo->data_operational.path = NULL;
Radek Krejcie9f13b12020-11-09 17:42:04 +0100319 }
320
aPieceka83b8e02023-06-07 15:25:16 +0200321 if (yo->reply_rpc.path && (yo->data_type != LYD_TYPE_REPLY_NETCONF)) {
aPiecek079bcde2023-05-05 11:48:25 +0200322 YLMSG_W("Source RPC is needed only for NETCONF Reply input data type.\n");
aPieceka83b8e02023-06-07 15:25:16 +0200323 yo->data_operational.path = NULL;
324 } else if (!yo->reply_rpc.path && (yo->data_type == LYD_TYPE_REPLY_NETCONF)) {
aPiecek079bcde2023-05-05 11:48:25 +0200325 YLMSG_E("Missing source RPC (-R) for NETCONF Reply input data type.\n");
aPieceka83b8e02023-06-07 15:25:16 +0200326 return 1;
aPiecek079bcde2023-05-05 11:48:25 +0200327 }
328
aPieceka83b8e02023-06-07 15:25:16 +0200329 if (!yo->out && (yo->data_out_format == LYD_LYB)) {
aPieceka4723482023-05-11 14:31:02 +0200330 YLMSG_E("The LYB format requires the -o option specified.\n");
aPieceka83b8e02023-06-07 15:25:16 +0200331 return 1;
Radek Krejcie9f13b12020-11-09 17:42:04 +0100332 }
333
334 /* default output stream */
aPieceka83b8e02023-06-07 15:25:16 +0200335 if (!yo->out) {
336 if (ly_out_new_file(stdout, &yo->out)) {
Radek Krejcie9f13b12020-11-09 17:42:04 +0100337 YLMSG_E("Unable to set stdout as output.\n");
aPieceka83b8e02023-06-07 15:25:16 +0200338 return 1;
339 }
340 yo->out_stdout = 1;
341 }
342
343 /* process the operational and/or reply RPC content if any */
344 if (yo->data_operational.path) {
345 if (get_input(yo->data_operational.path, NULL, &yo->data_operational.format, &yo->data_operational.in)) {
346 return -1;
347 }
348 }
349 if (yo->reply_rpc.path) {
350 if (get_input(yo->reply_rpc.path, NULL, &yo->reply_rpc.format, &yo->reply_rpc.in)) {
351 return -1;
Radek Krejcie9f13b12020-11-09 17:42:04 +0100352 }
353 }
354
aPieceka83b8e02023-06-07 15:25:16 +0200355 return 0;
356}
357
358int
359cmd_data_exec(struct ly_ctx **ctx, struct yl_opt *yo, const char *posv)
360{
361 (void) ctx;
362 struct ly_in *in;
363 LYD_FORMAT format_data;
364
365 assert(posv);
366
367 format_data = yo->data_in_format;
368
369 /* process input data files provided as standalone command line arguments */
370 if (get_input(posv, NULL, &format_data, &in)) {
371 return 1;
Radek Krejcie9f13b12020-11-09 17:42:04 +0100372 }
373
aPieceka83b8e02023-06-07 15:25:16 +0200374 if (!fill_cmdline_file(&yo->data_inputs, in, posv, format_data)) {
375 ly_in_free(in, 1);
376 return 1;
377 }
378
379 return 0;
380}
381
382int
383cmd_data_fin(struct ly_ctx *ctx, struct yl_opt *yo)
384{
385 /* parse, validate and print data */
386 if (process_data(ctx, yo->data_type, yo->data_merge, yo->data_out_format, yo->out, yo->data_parse_options,
387 yo->data_validate_options, yo->data_print_options, &yo->data_operational, &yo->reply_rpc,
388 &yo->data_inputs, &yo->data_xpath)) {
389 return 1;
390 }
391
392 return 0;
Radek Krejcie9f13b12020-11-09 17:42:04 +0100393}