2023-02-08 13:17:09 +01:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2022-02-10 09:14:41 +01:00
|
|
|
/*
|
|
|
|
* PIM for IPv6 FRR
|
|
|
|
* Copyright (C) 2022 Vmware, Inc.
|
|
|
|
* Mobashshera Rasool <mrasool@vmware.com>
|
|
|
|
*/
|
|
|
|
#ifndef PIM_CMD_COMMON_H
|
|
|
|
#define PIM_CMD_COMMON_H
|
2022-02-25 09:59:14 +01:00
|
|
|
|
2022-05-06 12:36:51 +02:00
|
|
|
struct pim_upstream;
|
|
|
|
struct pim_instance;
|
|
|
|
|
2022-02-25 09:59:14 +01:00
|
|
|
const char *pim_cli_get_vrf_name(struct vty *vty);
|
2022-01-19 09:06:41 +01:00
|
|
|
int pim_process_join_prune_cmd(struct vty *vty, const char *jpi_str);
|
|
|
|
int pim_process_no_join_prune_cmd(struct vty *vty);
|
2022-01-19 10:35:35 +01:00
|
|
|
int pim_process_spt_switchover_infinity_cmd(struct vty *vty);
|
|
|
|
int pim_process_spt_switchover_prefixlist_cmd(struct vty *vty,
|
|
|
|
const char *plist);
|
|
|
|
int pim_process_no_spt_switchover_cmd(struct vty *vty);
|
2022-01-19 14:21:20 +01:00
|
|
|
int pim_process_pim_packet_cmd(struct vty *vty, const char *packet);
|
|
|
|
int pim_process_no_pim_packet_cmd(struct vty *vty);
|
2022-01-19 14:27:24 +01:00
|
|
|
int pim_process_keepalivetimer_cmd(struct vty *vty, const char *kat);
|
|
|
|
int pim_process_no_keepalivetimer_cmd(struct vty *vty);
|
2022-01-19 14:36:05 +01:00
|
|
|
int pim_process_rp_kat_cmd(struct vty *vty, const char *rpkat);
|
|
|
|
int pim_process_no_rp_kat_cmd(struct vty *vty);
|
2022-01-19 14:50:02 +01:00
|
|
|
int pim_process_register_suppress_cmd(struct vty *vty, const char *rst);
|
|
|
|
int pim_process_no_register_suppress_cmd(struct vty *vty);
|
2022-03-07 07:02:10 +01:00
|
|
|
int pim_process_rp_cmd(struct vty *vty, const char *rp_str,
|
|
|
|
const char *group_str);
|
|
|
|
int pim_process_no_rp_cmd(struct vty *vty, const char *rp_str,
|
|
|
|
const char *group_str);
|
2022-03-07 08:18:47 +01:00
|
|
|
int pim_process_rp_plist_cmd(struct vty *vty, const char *rp_str,
|
|
|
|
const char *prefix_list);
|
|
|
|
int pim_process_no_rp_plist_cmd(struct vty *vty, const char *rp_str,
|
|
|
|
const char *prefix_list);
|
2022-01-19 09:06:41 +01:00
|
|
|
|
2022-03-01 03:12:22 +01:00
|
|
|
int pim_process_ip_pim_cmd(struct vty *vty);
|
|
|
|
int pim_process_no_ip_pim_cmd(struct vty *vty);
|
2022-05-04 15:05:43 +02:00
|
|
|
int pim_process_ip_pim_passive_cmd(struct vty *vty, bool enable);
|
2022-03-01 03:16:32 +01:00
|
|
|
int pim_process_ip_pim_drprio_cmd(struct vty *vty, const char *drpriority_str);
|
|
|
|
int pim_process_no_ip_pim_drprio_cmd(struct vty *vty);
|
2022-03-01 03:18:42 +01:00
|
|
|
int pim_process_ip_pim_hello_cmd(struct vty *vty, const char *hello_str,
|
|
|
|
const char *hold_str);
|
|
|
|
int pim_process_no_ip_pim_hello_cmd(struct vty *vty);
|
2022-03-01 03:22:19 +01:00
|
|
|
int pim_process_ip_pim_activeactive_cmd(struct vty *vty, const char *no);
|
2022-03-01 03:27:52 +01:00
|
|
|
int pim_process_ip_pim_boundary_oil_cmd(struct vty *vty, const char *oil);
|
|
|
|
int pim_process_no_ip_pim_boundary_oil_cmd(struct vty *vty);
|
2022-03-01 03:30:14 +01:00
|
|
|
int pim_process_ip_mroute_cmd(struct vty *vty, const char *interface,
|
|
|
|
const char *group_str, const char *source_str);
|
|
|
|
int pim_process_no_ip_mroute_cmd(struct vty *vty, const char *interface,
|
|
|
|
const char *group_str, const char *src_str);
|
2022-07-12 12:45:14 +02:00
|
|
|
int pim_process_bsm_cmd(struct vty *vty);
|
|
|
|
int pim_process_no_bsm_cmd(struct vty *vty);
|
2022-07-12 12:49:48 +02:00
|
|
|
int pim_process_unicast_bsm_cmd(struct vty *vty);
|
|
|
|
int pim_process_no_unicast_bsm_cmd(struct vty *vty);
|
2022-02-08 18:15:06 +01:00
|
|
|
void json_object_pim_upstream_add(json_object *json, struct pim_upstream *up);
|
2022-03-04 08:56:19 +01:00
|
|
|
void pim_show_rpf(struct pim_instance *pim, struct vty *vty, json_object *json);
|
2022-02-08 18:15:06 +01:00
|
|
|
void pim_show_neighbors_secondary(struct pim_instance *pim, struct vty *vty);
|
|
|
|
void pim_show_state(struct pim_instance *pim, struct vty *vty,
|
2022-02-15 11:19:39 +01:00
|
|
|
const char *src_or_group, const char *group,
|
|
|
|
json_object *json);
|
2022-02-08 18:15:06 +01:00
|
|
|
void pim_show_statistics(struct pim_instance *pim, struct vty *vty,
|
|
|
|
const char *ifname, bool uj);
|
|
|
|
void pim_show_upstream(struct pim_instance *pim, struct vty *vty,
|
2022-02-11 06:15:31 +01:00
|
|
|
pim_sgaddr *sg, json_object *json);
|
2022-02-08 18:15:06 +01:00
|
|
|
void pim_show_join_desired(struct pim_instance *pim, struct vty *vty, bool uj);
|
|
|
|
void pim_show_upstream_rpf(struct pim_instance *pim, struct vty *vty, bool uj);
|
2022-03-04 08:56:19 +01:00
|
|
|
void pim_show_rpf_refresh_stats(struct vty *vty, struct pim_instance *pim,
|
|
|
|
time_t now, json_object *json);
|
2022-02-11 06:15:31 +01:00
|
|
|
bool pim_sgaddr_match(pim_sgaddr item, pim_sgaddr match);
|
2022-02-08 18:14:26 +01:00
|
|
|
void json_object_pim_ifp_add(struct json_object *json, struct interface *ifp);
|
|
|
|
void pim_print_ifp_flags(struct vty *vty, struct interface *ifp);
|
|
|
|
void json_object_pim_upstream_add(json_object *json, struct pim_upstream *up);
|
2022-06-10 07:43:52 +02:00
|
|
|
int pim_show_join_cmd_helper(const char *vrf, struct vty *vty, pim_addr s_or_g,
|
|
|
|
pim_addr g, const char *json);
|
|
|
|
int pim_show_join_vrf_all_cmd_helper(struct vty *vty, const char *json);
|
2022-02-08 18:14:26 +01:00
|
|
|
void pim_show_join(struct pim_instance *pim, struct vty *vty, pim_sgaddr *sg,
|
2022-03-02 05:50:22 +01:00
|
|
|
json_object *json);
|
2022-06-09 09:15:11 +02:00
|
|
|
int pim_show_jp_agg_list_cmd_helper(const char *vrf, struct vty *vty);
|
2022-02-08 18:14:26 +01:00
|
|
|
void pim_show_jp_agg_list(struct pim_instance *pim, struct vty *vty);
|
2022-06-09 09:31:33 +02:00
|
|
|
int pim_show_membership_cmd_helper(const char *vrf, struct vty *vty, bool uj);
|
2022-02-08 18:14:26 +01:00
|
|
|
void pim_show_membership(struct pim_instance *pim, struct vty *vty, bool uj);
|
|
|
|
void pim_show_channel(struct pim_instance *pim, struct vty *vty, bool uj);
|
2022-06-02 06:54:44 +02:00
|
|
|
int pim_show_channel_cmd_helper(const char *vrf, struct vty *vty, bool uj);
|
2022-06-09 08:10:22 +02:00
|
|
|
int pim_show_interface_cmd_helper(const char *vrf, struct vty *vty, bool uj,
|
|
|
|
bool mlag, const char *interface);
|
2022-06-09 08:56:17 +02:00
|
|
|
int pim_show_interface_vrf_all_cmd_helper(struct vty *vty, bool uj, bool mlag,
|
|
|
|
const char *interface);
|
2022-02-08 18:14:26 +01:00
|
|
|
void pim_show_interfaces(struct pim_instance *pim, struct vty *vty, bool mlag,
|
2022-02-28 11:28:14 +01:00
|
|
|
json_object *json);
|
2022-02-08 18:14:26 +01:00
|
|
|
void pim_show_interfaces_single(struct pim_instance *pim, struct vty *vty,
|
2022-02-28 11:28:14 +01:00
|
|
|
const char *ifname, bool mlag,
|
|
|
|
json_object *json);
|
2022-02-08 18:14:26 +01:00
|
|
|
void ip_pim_ssm_show_group_range(struct pim_instance *pim, struct vty *vty,
|
|
|
|
bool uj);
|
2022-06-09 13:22:42 +02:00
|
|
|
int pim_show_nexthop_lookup_cmd_helper(const char *vrf, struct vty *vty,
|
|
|
|
pim_addr source, pim_addr group);
|
2022-06-13 10:49:03 +02:00
|
|
|
int pim_show_nexthop_cmd_helper(const char *vrf, struct vty *vty, bool uj);
|
|
|
|
void pim_show_nexthop(struct pim_instance *pim, struct vty *vty, bool uj);
|
2022-06-09 10:34:06 +02:00
|
|
|
int pim_show_neighbors_cmd_helper(const char *vrf, struct vty *vty,
|
|
|
|
const char *json, const char *interface);
|
2022-06-09 11:36:08 +02:00
|
|
|
int pim_show_neighbors_vrf_all_cmd_helper(struct vty *vty, const char *json,
|
|
|
|
const char *interface);
|
2022-02-08 18:14:26 +01:00
|
|
|
void pim_show_neighbors_single(struct pim_instance *pim, struct vty *vty,
|
2022-03-02 10:22:13 +01:00
|
|
|
const char *neighbor, json_object *json);
|
|
|
|
void pim_show_neighbors(struct pim_instance *pim, struct vty *vty,
|
|
|
|
json_object *json);
|
2022-07-12 16:15:07 +02:00
|
|
|
int pim_show_group_rp_mappings_info_helper(const char *vrf, struct vty *vty,
|
|
|
|
bool uj);
|
2022-07-12 15:39:56 +02:00
|
|
|
int pim_show_bsm_db_helper(const char *vrf, struct vty *vty, bool uj);
|
2022-01-18 16:16:51 +01:00
|
|
|
int gm_process_query_max_response_time_cmd(struct vty *vty,
|
|
|
|
const char *qmrt_str);
|
|
|
|
int gm_process_no_query_max_response_time_cmd(struct vty *vty);
|
2022-01-18 16:24:11 +01:00
|
|
|
int gm_process_last_member_query_count_cmd(struct vty *vty,
|
|
|
|
const char *lmqc_str);
|
|
|
|
int gm_process_no_last_member_query_count_cmd(struct vty *vty);
|
2022-01-18 16:31:56 +01:00
|
|
|
int gm_process_last_member_query_interval_cmd(struct vty *vty,
|
|
|
|
const char *lmqi_str);
|
|
|
|
int gm_process_no_last_member_query_interval_cmd(struct vty *vty);
|
2022-04-04 15:01:50 +02:00
|
|
|
int pim_process_ssmpingd_cmd(struct vty *vty, enum nb_operation operation,
|
|
|
|
const char *src_str);
|
2022-04-07 12:35:22 +02:00
|
|
|
void pim_cmd_show_ip_multicast_helper(struct pim_instance *pim,
|
2022-04-14 08:30:28 +02:00
|
|
|
struct vty *vty);
|
2022-04-07 12:35:22 +02:00
|
|
|
void show_multicast_interfaces(struct pim_instance *pim, struct vty *vty,
|
2022-04-14 09:07:41 +02:00
|
|
|
json_object *json);
|
2022-04-08 08:52:28 +02:00
|
|
|
void show_mroute(struct pim_instance *pim, struct vty *vty, pim_sgaddr *sg,
|
|
|
|
bool fill, json_object *json);
|
2022-04-08 07:42:03 +02:00
|
|
|
void show_mroute_count(struct pim_instance *pim, struct vty *vty,
|
2022-04-08 09:20:53 +02:00
|
|
|
json_object *json);
|
2022-04-08 07:42:03 +02:00
|
|
|
void show_mroute_summary(struct pim_instance *pim, struct vty *vty,
|
2022-04-08 09:34:02 +02:00
|
|
|
json_object *json);
|
2022-04-13 17:31:45 +02:00
|
|
|
int clear_ip_mroute_count_command(struct vty *vty, const char *name);
|
2022-04-27 17:07:53 +02:00
|
|
|
struct vrf *pim_cmd_lookup(struct vty *vty, const char *name);
|
2022-04-12 13:36:35 +02:00
|
|
|
void clear_mroute(struct pim_instance *pim);
|
|
|
|
void clear_pim_statistics(struct pim_instance *pim);
|
2022-07-18 15:08:19 +02:00
|
|
|
int clear_pim_interface_traffic(const char *vrf, struct vty *vty);
|
2022-03-24 09:41:15 +01:00
|
|
|
int pim_debug_pim_cmd(void);
|
|
|
|
int pim_no_debug_pim_cmd(void);
|
2022-03-28 07:15:36 +02:00
|
|
|
int pim_debug_pim_packets_cmd(const char *hello, const char *joins,
|
|
|
|
const char *registers, struct vty *vty);
|
|
|
|
int pim_no_debug_pim_packets_cmd(const char *hello, const char *joins,
|
|
|
|
const char *registers, struct vty *vty);
|
2022-06-09 07:49:16 +02:00
|
|
|
int pim_show_rpf_helper(const char *vrf, struct vty *vty, bool json);
|
|
|
|
int pim_show_rpf_vrf_all_helper(struct vty *vty, bool json);
|
2022-06-09 09:49:38 +02:00
|
|
|
int pim_show_rp_helper(const char *vrf, struct vty *vty, const char *group_str,
|
|
|
|
const struct prefix *group, bool json);
|
|
|
|
int pim_show_rp_vrf_all_helper(struct vty *vty, const char *group_str,
|
|
|
|
const struct prefix *group, bool json);
|
2022-06-09 10:33:01 +02:00
|
|
|
int pim_show_secondary_helper(const char *vrf, struct vty *vty);
|
2022-06-09 10:59:58 +02:00
|
|
|
int pim_show_statistics_helper(const char *vrf, struct vty *vty,
|
|
|
|
const char *word, bool uj);
|
2022-06-09 11:40:21 +02:00
|
|
|
int pim_show_upstream_helper(const char *vrf, struct vty *vty, pim_addr s_or_g,
|
|
|
|
pim_addr g, bool json);
|
|
|
|
int pim_show_upstream_vrf_all_helper(struct vty *vty, bool json);
|
2022-06-09 11:57:49 +02:00
|
|
|
int pim_show_upstream_join_desired_helper(const char *vrf, struct vty *vty,
|
|
|
|
bool uj);
|
2022-06-09 12:10:21 +02:00
|
|
|
int pim_show_upstream_rpf_helper(const char *vrf, struct vty *vty, bool uj);
|
2022-06-09 12:29:02 +02:00
|
|
|
int pim_show_state_helper(const char *vrf, struct vty *vty,
|
|
|
|
const char *s_or_g_str, const char *g_str, bool json);
|
|
|
|
int pim_show_state_vrf_all_helper(struct vty *vty, const char *s_or_g_str,
|
|
|
|
const char *g_str, bool json);
|
2022-06-09 12:51:41 +02:00
|
|
|
int pim_show_multicast_helper(const char *vrf, struct vty *vty);
|
|
|
|
int pim_show_multicast_vrf_all_helper(struct vty *vty);
|
2022-06-09 13:04:14 +02:00
|
|
|
int pim_show_multicast_count_helper(const char *vrf, struct vty *vty,
|
|
|
|
bool json);
|
|
|
|
int pim_show_multicast_count_vrf_all_helper(struct vty *vty, bool json);
|
2022-06-09 13:27:20 +02:00
|
|
|
int pim_show_mroute_helper(const char *vrf, struct vty *vty, pim_addr s_or_g,
|
|
|
|
pim_addr g, bool fill, bool json);
|
|
|
|
int pim_show_mroute_vrf_all_helper(struct vty *vty, bool fill, bool json);
|
2022-06-09 13:43:28 +02:00
|
|
|
int pim_show_mroute_count_helper(const char *vrf, struct vty *vty, bool json);
|
|
|
|
int pim_show_mroute_count_vrf_all_helper(struct vty *vty, bool json);
|
2022-06-09 13:53:12 +02:00
|
|
|
int pim_show_mroute_summary_helper(const char *vrf, struct vty *vty, bool json);
|
|
|
|
int pim_show_mroute_summary_vrf_all_helper(struct vty *vty, bool json);
|
2022-03-01 03:12:22 +01:00
|
|
|
|
2022-05-27 07:11:12 +02:00
|
|
|
void pim_show_interface_traffic_single(struct pim_instance *pim,
|
|
|
|
struct vty *vty, const char *ifname,
|
|
|
|
bool uj);
|
|
|
|
void pim_show_interface_traffic(struct pim_instance *pim, struct vty *vty,
|
|
|
|
bool uj);
|
2022-06-01 17:58:33 +02:00
|
|
|
int pim_show_interface_traffic_helper(const char *vrf, const char *if_name,
|
|
|
|
struct vty *vty, bool uj);
|
2022-07-19 08:44:47 +02:00
|
|
|
void clear_pim_interfaces(struct pim_instance *pim);
|
2022-07-12 13:16:17 +02:00
|
|
|
void pim_show_bsr(struct pim_instance *pim, struct vty *vty, bool uj);
|
|
|
|
int pim_show_bsr_helper(const char *vrf, struct vty *vty, bool uj);
|
2024-06-12 18:26:48 +02:00
|
|
|
int pim_router_config_write(struct vty *vty);
|
|
|
|
|
2022-03-02 15:40:19 +01:00
|
|
|
/*
|
|
|
|
* Special Macro to allow us to get the correct pim_instance;
|
|
|
|
*/
|
2022-04-28 11:06:20 +02:00
|
|
|
#define PIM_DECLVAR_CONTEXT_VRF(vrfptr, pimptr) \
|
|
|
|
VTY_DECLVAR_CONTEXT_VRF(vrfptr); \
|
|
|
|
struct pim_instance *pimptr = vrfptr->info; \
|
|
|
|
MACRO_REQUIRE_SEMICOLON() /* end */
|
|
|
|
|
2022-02-10 09:14:41 +01:00
|
|
|
#endif /* PIM_CMD_COMMON_H */
|