mirror_frr/ripd/rip_cli.h
Renato Westphal 23b23d8c27 ripd: retrofit the 'distance source' commands to the new northbound model
The "distance (1-255) A.B.C.D/M [WORD]" command was modeled using a
YANG list, which makes it a little bit more complicated to convert to
the new northbound model.

The rip_distance_set() and rip_distance_unset() functions were removed
since they set/unset multiple configuration options at the same time. The
northbound callbacks need to set/unset configuration options individually.

When a distance list is created, use yang_dnode_set_entry() to store
a pointer in the configuration node, and retrieve this pointer in the
other callbacks using yang_dnode_get_entry().

The 'rip_distance' structure was moved to ripd.h so that it can be used
in the rip_northbound.c file.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-10-27 16:16:12 -02:00

40 lines
1.6 KiB
C

/*
* Copyright (C) 1997, 1998, 1999 Kunihiro Ishiguro <kunihiro@zebra.org>
* Copyright (C) 2018 NetDEF, Inc.
* Renato Westphal
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; see the file COPYING; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _FRR_RIP_CLI_H_
#define _FRR_RIP_CLI_H_
extern void cli_show_router_rip(struct vty *vty, struct lyd_node *dnode,
bool show_defaults);
extern void cli_show_rip_allow_ecmp(struct vty *vty, struct lyd_node *dnode,
bool show_defaults);
extern void cli_show_rip_default_information_originate(struct vty *vty,
struct lyd_node *dnode,
bool show_defaults);
extern void cli_show_rip_default_metric(struct vty *vty, struct lyd_node *dnode,
bool show_defaults);
extern void cli_show_rip_distance(struct vty *vty, struct lyd_node *dnode,
bool show_defaults);
extern void cli_show_rip_distance_source(struct vty *vty,
struct lyd_node *dnode,
bool show_defaults);
#endif /* _FRR_RIP_CLI_H_ */