]> git.proxmox.com Git - mirror_frr.git/blame - lib/northbound_cli.h
ripd: fix display of the "distance" command
[mirror_frr.git] / lib / northbound_cli.h
CommitLineData
1c2facd1
RW
1/*
2 * Copyright (C) 2018 NetDEF, Inc.
3 * Renato Westphal
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the Free
7 * Software Foundation; either version 2 of the License, or (at your option)
8 * any later version.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; see the file COPYING; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20#ifndef _FRR_NORTHBOUND_CLI_H_
21#define _FRR_NORTHBOUND_CLI_H_
22
23#include "northbound.h"
24
25struct cli_config_change {
26 /*
27 * XPath (absolute or relative) of the configuration option being
28 * edited.
29 */
30 char xpath[XPATH_MAXLEN];
31
32 /*
33 * Operation to apply (either NB_OP_CREATE, NB_OP_MODIFY or
34 * NB_OP_DELETE).
35 */
36 enum nb_operation operation;
37
38 /*
39 * New value of the configuration option. Should be NULL for typeless
40 * YANG data (e.g. presence-containers). For convenience, NULL can also
41 * be used to restore a leaf to its default value.
42 */
43 const char *value;
44};
45
46/* Possible formats in which a configuration can be displayed. */
47enum nb_cfg_format {
48 NB_CFG_FMT_CMDS = 0,
49 NB_CFG_FMT_JSON,
50 NB_CFG_FMT_XML,
51};
52
53extern struct nb_config *vty_shared_candidate_config;
54
55/* Prototypes. */
56extern int nb_cli_cfg_change(struct vty *vty, char *xpath_list,
57 struct cli_config_change changes[], size_t size);
58extern int nb_cli_rpc(const char *xpath, struct list *input,
59 struct list *output);
60extern void nb_cli_show_dnode_cmds(struct vty *vty, struct lyd_node *dnode,
61 bool show_defaults);
62extern void nb_cli_install_default(int node);
63extern void nb_cli_init(void);
64extern void nb_cli_terminate(void);
65
66#endif /* _FRR_NORTHBOUND_CLI_H_ */