]> git.proxmox.com Git - mirror_frr.git/blame - pimd/pim_cmd_common.h
pim6d: fix "show ipv6 mld interface" command
[mirror_frr.git] / pimd / pim_cmd_common.h
CommitLineData
26cd3d66
MR
1/*
2 * PIM for IPv6 FRR
3 * Copyright (C) 2022 Vmware, Inc.
4 * Mobashshera Rasool <mrasool@vmware.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; see the file COPYING; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20#ifndef PIM_CMD_COMMON_H
21#define PIM_CMD_COMMON_H
2328b7ef 22
993e3d8e
DL
23struct pim_upstream;
24struct pim_instance;
25
2328b7ef 26const char *pim_cli_get_vrf_name(struct vty *vty);
c73113ea
MR
27int pim_process_join_prune_cmd(struct vty *vty, const char *jpi_str);
28int pim_process_no_join_prune_cmd(struct vty *vty);
fb991ce9
MR
29int pim_process_spt_switchover_infinity_cmd(struct vty *vty);
30int pim_process_spt_switchover_prefixlist_cmd(struct vty *vty,
31 const char *plist);
32int pim_process_no_spt_switchover_cmd(struct vty *vty);
0da72f1f
MR
33int pim_process_pim_packet_cmd(struct vty *vty, const char *packet);
34int pim_process_no_pim_packet_cmd(struct vty *vty);
28e32366
MR
35int pim_process_keepalivetimer_cmd(struct vty *vty, const char *kat);
36int pim_process_no_keepalivetimer_cmd(struct vty *vty);
2322b991
MR
37int pim_process_rp_kat_cmd(struct vty *vty, const char *rpkat);
38int pim_process_no_rp_kat_cmd(struct vty *vty);
18ca7de5
MR
39int pim_process_register_suppress_cmd(struct vty *vty, const char *rst);
40int pim_process_no_register_suppress_cmd(struct vty *vty);
13ddf7cf
MR
41int pim_process_rp_cmd(struct vty *vty, const char *rp_str,
42 const char *group_str);
43int pim_process_no_rp_cmd(struct vty *vty, const char *rp_str,
44 const char *group_str);
f39f3497
MR
45int pim_process_rp_plist_cmd(struct vty *vty, const char *rp_str,
46 const char *prefix_list);
47int pim_process_no_rp_plist_cmd(struct vty *vty, const char *rp_str,
48 const char *prefix_list);
c73113ea 49
a1caf7a8 50int pim_process_ip_pim_cmd(struct vty *vty);
51int pim_process_no_ip_pim_cmd(struct vty *vty);
9726536d 52int pim_process_ip_pim_passive_cmd(struct vty *vty, bool enable);
bb387611 53int pim_process_ip_pim_drprio_cmd(struct vty *vty, const char *drpriority_str);
54int pim_process_no_ip_pim_drprio_cmd(struct vty *vty);
e6aab613 55int pim_process_ip_pim_hello_cmd(struct vty *vty, const char *hello_str,
56 const char *hold_str);
57int pim_process_no_ip_pim_hello_cmd(struct vty *vty);
7e01b641 58int pim_process_ip_pim_activeactive_cmd(struct vty *vty, const char *no);
52c52d78 59int pim_process_ip_pim_boundary_oil_cmd(struct vty *vty, const char *oil);
60int pim_process_no_ip_pim_boundary_oil_cmd(struct vty *vty);
63ee25c0 61int pim_process_ip_mroute_cmd(struct vty *vty, const char *interface,
62 const char *group_str, const char *source_str);
63int pim_process_no_ip_mroute_cmd(struct vty *vty, const char *interface,
64 const char *group_str, const char *src_str);
45e26aa0 65void json_object_pim_upstream_add(json_object *json, struct pim_upstream *up);
1aa8de46 66void pim_show_rpf(struct pim_instance *pim, struct vty *vty, json_object *json);
45e26aa0
A
67void pim_show_neighbors_secondary(struct pim_instance *pim, struct vty *vty);
68void pim_show_state(struct pim_instance *pim, struct vty *vty,
2d85c671
A
69 const char *src_or_group, const char *group,
70 json_object *json);
45e26aa0
A
71void pim_show_statistics(struct pim_instance *pim, struct vty *vty,
72 const char *ifname, bool uj);
73void pim_show_upstream(struct pim_instance *pim, struct vty *vty,
95023bd7 74 pim_sgaddr *sg, json_object *json);
45e26aa0
A
75void pim_show_join_desired(struct pim_instance *pim, struct vty *vty, bool uj);
76void pim_show_upstream_rpf(struct pim_instance *pim, struct vty *vty, bool uj);
1aa8de46
A
77void pim_show_rpf_refresh_stats(struct vty *vty, struct pim_instance *pim,
78 time_t now, json_object *json);
95023bd7 79bool pim_sgaddr_match(pim_sgaddr item, pim_sgaddr match);
e2b601e8
SG
80void json_object_pim_ifp_add(struct json_object *json, struct interface *ifp);
81void pim_print_ifp_flags(struct vty *vty, struct interface *ifp);
82void json_object_pim_upstream_add(json_object *json, struct pim_upstream *up);
94c691ba
SG
83int pim_show_join_cmd_helper(const char *vrf, struct vty *vty, pim_addr s_or_g,
84 pim_addr g, const char *json);
85int pim_show_join_vrf_all_cmd_helper(struct vty *vty, const char *json);
e2b601e8 86void pim_show_join(struct pim_instance *pim, struct vty *vty, pim_sgaddr *sg,
24de75a2 87 json_object *json);
3ca40823 88int pim_show_jp_agg_list_cmd_helper(const char *vrf, struct vty *vty);
e2b601e8 89void pim_show_jp_agg_list(struct pim_instance *pim, struct vty *vty);
bec5bdbe 90int pim_show_membership_cmd_helper(const char *vrf, struct vty *vty, bool uj);
e2b601e8
SG
91void pim_show_membership(struct pim_instance *pim, struct vty *vty, bool uj);
92void pim_show_channel(struct pim_instance *pim, struct vty *vty, bool uj);
b6bf3377 93int pim_show_channel_cmd_helper(const char *vrf, struct vty *vty, bool uj);
8282b988
SG
94int pim_show_interface_cmd_helper(const char *vrf, struct vty *vty, bool uj,
95 bool mlag, const char *interface);
342ba5f3
SG
96int pim_show_interface_vrf_all_cmd_helper(struct vty *vty, bool uj, bool mlag,
97 const char *interface);
e2b601e8 98void pim_show_interfaces(struct pim_instance *pim, struct vty *vty, bool mlag,
44f99d22 99 json_object *json);
e2b601e8 100void pim_show_interfaces_single(struct pim_instance *pim, struct vty *vty,
44f99d22
SG
101 const char *ifname, bool mlag,
102 json_object *json);
e2b601e8
SG
103void ip_pim_ssm_show_group_range(struct pim_instance *pim, struct vty *vty,
104 bool uj);
fe7eaf40
SG
105int pim_show_nexthop_lookup_cmd_helper(const char *vrf, struct vty *vty,
106 pim_addr source, pim_addr group);
fc19632f
SG
107int pim_show_nexthop_cmd_helper(const char *vrf, struct vty *vty, bool uj);
108void pim_show_nexthop(struct pim_instance *pim, struct vty *vty, bool uj);
154aa4fc
SG
109int pim_show_neighbors_cmd_helper(const char *vrf, struct vty *vty,
110 const char *json, const char *interface);
78b0e690
SG
111int pim_show_neighbors_vrf_all_cmd_helper(struct vty *vty, const char *json,
112 const char *interface);
e2b601e8 113void pim_show_neighbors_single(struct pim_instance *pim, struct vty *vty,
1295dbeb
SG
114 const char *neighbor, json_object *json);
115void pim_show_neighbors(struct pim_instance *pim, struct vty *vty,
116 json_object *json);
c8b3d45d
SG
117int gm_process_query_max_response_time_cmd(struct vty *vty,
118 const char *qmrt_str);
119int gm_process_no_query_max_response_time_cmd(struct vty *vty);
c889adcb
SG
120int gm_process_last_member_query_count_cmd(struct vty *vty,
121 const char *lmqc_str);
122int gm_process_no_last_member_query_count_cmd(struct vty *vty);
e7ec758d
SG
123int gm_process_last_member_query_interval_cmd(struct vty *vty,
124 const char *lmqi_str);
125int gm_process_no_last_member_query_interval_cmd(struct vty *vty);
a8caf78d
BG
126int pim_process_ssmpingd_cmd(struct vty *vty, enum nb_operation operation,
127 const char *src_str);
be126d91 128void pim_cmd_show_ip_multicast_helper(struct pim_instance *pim,
ca3b5906 129 struct vty *vty);
be126d91 130void show_multicast_interfaces(struct pim_instance *pim, struct vty *vty,
3e55b3b5 131 json_object *json);
50ba39bf
A
132void show_mroute(struct pim_instance *pim, struct vty *vty, pim_sgaddr *sg,
133 bool fill, json_object *json);
3b767e4b 134void show_mroute_count(struct pim_instance *pim, struct vty *vty,
c41a9dcf 135 json_object *json);
3b767e4b 136void show_mroute_summary(struct pim_instance *pim, struct vty *vty,
74e8197b 137 json_object *json);
4e65109c 138int clear_ip_mroute_count_command(struct vty *vty, const char *name);
fe0c6838 139struct vrf *pim_cmd_lookup(struct vty *vty, const char *name);
58d57120
SG
140void clear_mroute(struct pim_instance *pim);
141void clear_pim_statistics(struct pim_instance *pim);
8656814d 142int clear_pim_interface_traffic(const char *vrf, struct vty *vty);
bf385e26
SG
143int pim_debug_pim_cmd(void);
144int pim_no_debug_pim_cmd(void);
60940ee2
SG
145int pim_debug_pim_packets_cmd(const char *hello, const char *joins,
146 const char *registers, struct vty *vty);
147int pim_no_debug_pim_packets_cmd(const char *hello, const char *joins,
148 const char *registers, struct vty *vty);
6d1bd8c2
A
149int pim_show_rpf_helper(const char *vrf, struct vty *vty, bool json);
150int pim_show_rpf_vrf_all_helper(struct vty *vty, bool json);
e21c4e90
A
151int pim_show_rp_helper(const char *vrf, struct vty *vty, const char *group_str,
152 const struct prefix *group, bool json);
153int pim_show_rp_vrf_all_helper(struct vty *vty, const char *group_str,
154 const struct prefix *group, bool json);
5e52c8d5 155int pim_show_secondary_helper(const char *vrf, struct vty *vty);
19296b58
A
156int pim_show_statistics_helper(const char *vrf, struct vty *vty,
157 const char *word, bool uj);
9aa0569d
A
158int pim_show_upstream_helper(const char *vrf, struct vty *vty, pim_addr s_or_g,
159 pim_addr g, bool json);
160int pim_show_upstream_vrf_all_helper(struct vty *vty, bool json);
622da92f
A
161int pim_show_upstream_join_desired_helper(const char *vrf, struct vty *vty,
162 bool uj);
c6309708 163int pim_show_upstream_rpf_helper(const char *vrf, struct vty *vty, bool uj);
e7c01c67
A
164int pim_show_state_helper(const char *vrf, struct vty *vty,
165 const char *s_or_g_str, const char *g_str, bool json);
166int pim_show_state_vrf_all_helper(struct vty *vty, const char *s_or_g_str,
167 const char *g_str, bool json);
8e15c9aa
A
168int pim_show_multicast_helper(const char *vrf, struct vty *vty);
169int pim_show_multicast_vrf_all_helper(struct vty *vty);
334d2f8c
A
170int pim_show_multicast_count_helper(const char *vrf, struct vty *vty,
171 bool json);
172int pim_show_multicast_count_vrf_all_helper(struct vty *vty, bool json);
4f1f8ff9
A
173int pim_show_mroute_helper(const char *vrf, struct vty *vty, pim_addr s_or_g,
174 pim_addr g, bool fill, bool json);
175int pim_show_mroute_vrf_all_helper(struct vty *vty, bool fill, bool json);
1c1077c2
A
176int pim_show_mroute_count_helper(const char *vrf, struct vty *vty, bool json);
177int pim_show_mroute_count_vrf_all_helper(struct vty *vty, bool json);
789d0ec4
A
178int pim_show_mroute_summary_helper(const char *vrf, struct vty *vty, bool json);
179int pim_show_mroute_summary_vrf_all_helper(struct vty *vty, bool json);
a1caf7a8 180
36cec27c
MR
181void pim_show_interface_traffic_single(struct pim_instance *pim,
182 struct vty *vty, const char *ifname,
183 bool uj);
184void pim_show_interface_traffic(struct pim_instance *pim, struct vty *vty,
185 bool uj);
52770b79
MR
186int pim_show_interface_traffic_helper(const char *vrf, const char *if_name,
187 struct vty *vty, bool uj);
23db4cbd 188void clear_pim_interfaces(struct pim_instance *pim);
25e1db42
SG
189/*
190 * Special Macro to allow us to get the correct pim_instance;
191 */
0cbed951
DL
192#define PIM_DECLVAR_CONTEXT_VRF(vrfptr, pimptr) \
193 VTY_DECLVAR_CONTEXT_VRF(vrfptr); \
194 struct pim_instance *pimptr = vrfptr->info; \
195 MACRO_REQUIRE_SEMICOLON() /* end */
196
26cd3d66 197#endif /* PIM_CMD_COMMON_H */