]> git.proxmox.com Git - mirror_frr.git/blob - pimd/pim_cmd_common.h
Merge pull request #12205 from proelbtn/fix-ipv4-vpn-nexthop-over-ipv6-peer
[mirror_frr.git] / pimd / pim_cmd_common.h
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
22
23 struct pim_upstream;
24 struct pim_instance;
25
26 const char *pim_cli_get_vrf_name(struct vty *vty);
27 int pim_process_join_prune_cmd(struct vty *vty, const char *jpi_str);
28 int pim_process_no_join_prune_cmd(struct vty *vty);
29 int pim_process_spt_switchover_infinity_cmd(struct vty *vty);
30 int pim_process_spt_switchover_prefixlist_cmd(struct vty *vty,
31 const char *plist);
32 int pim_process_no_spt_switchover_cmd(struct vty *vty);
33 int pim_process_pim_packet_cmd(struct vty *vty, const char *packet);
34 int pim_process_no_pim_packet_cmd(struct vty *vty);
35 int pim_process_keepalivetimer_cmd(struct vty *vty, const char *kat);
36 int pim_process_no_keepalivetimer_cmd(struct vty *vty);
37 int pim_process_rp_kat_cmd(struct vty *vty, const char *rpkat);
38 int pim_process_no_rp_kat_cmd(struct vty *vty);
39 int pim_process_register_suppress_cmd(struct vty *vty, const char *rst);
40 int pim_process_no_register_suppress_cmd(struct vty *vty);
41 int pim_process_rp_cmd(struct vty *vty, const char *rp_str,
42 const char *group_str);
43 int pim_process_no_rp_cmd(struct vty *vty, const char *rp_str,
44 const char *group_str);
45 int pim_process_rp_plist_cmd(struct vty *vty, const char *rp_str,
46 const char *prefix_list);
47 int pim_process_no_rp_plist_cmd(struct vty *vty, const char *rp_str,
48 const char *prefix_list);
49
50 int pim_process_ip_pim_cmd(struct vty *vty);
51 int pim_process_no_ip_pim_cmd(struct vty *vty);
52 int pim_process_ip_pim_passive_cmd(struct vty *vty, bool enable);
53 int pim_process_ip_pim_drprio_cmd(struct vty *vty, const char *drpriority_str);
54 int pim_process_no_ip_pim_drprio_cmd(struct vty *vty);
55 int pim_process_ip_pim_hello_cmd(struct vty *vty, const char *hello_str,
56 const char *hold_str);
57 int pim_process_no_ip_pim_hello_cmd(struct vty *vty);
58 int pim_process_ip_pim_activeactive_cmd(struct vty *vty, const char *no);
59 int pim_process_ip_pim_boundary_oil_cmd(struct vty *vty, const char *oil);
60 int pim_process_no_ip_pim_boundary_oil_cmd(struct vty *vty);
61 int pim_process_ip_mroute_cmd(struct vty *vty, const char *interface,
62 const char *group_str, const char *source_str);
63 int pim_process_no_ip_mroute_cmd(struct vty *vty, const char *interface,
64 const char *group_str, const char *src_str);
65 int pim_process_bsm_cmd(struct vty *vty);
66 int pim_process_no_bsm_cmd(struct vty *vty);
67 int pim_process_unicast_bsm_cmd(struct vty *vty);
68 int pim_process_no_unicast_bsm_cmd(struct vty *vty);
69 void json_object_pim_upstream_add(json_object *json, struct pim_upstream *up);
70 void pim_show_rpf(struct pim_instance *pim, struct vty *vty, json_object *json);
71 void pim_show_neighbors_secondary(struct pim_instance *pim, struct vty *vty);
72 void pim_show_state(struct pim_instance *pim, struct vty *vty,
73 const char *src_or_group, const char *group,
74 json_object *json);
75 void pim_show_statistics(struct pim_instance *pim, struct vty *vty,
76 const char *ifname, bool uj);
77 void pim_show_upstream(struct pim_instance *pim, struct vty *vty,
78 pim_sgaddr *sg, json_object *json);
79 void pim_show_join_desired(struct pim_instance *pim, struct vty *vty, bool uj);
80 void pim_show_upstream_rpf(struct pim_instance *pim, struct vty *vty, bool uj);
81 void pim_show_rpf_refresh_stats(struct vty *vty, struct pim_instance *pim,
82 time_t now, json_object *json);
83 bool pim_sgaddr_match(pim_sgaddr item, pim_sgaddr match);
84 void json_object_pim_ifp_add(struct json_object *json, struct interface *ifp);
85 void pim_print_ifp_flags(struct vty *vty, struct interface *ifp);
86 void json_object_pim_upstream_add(json_object *json, struct pim_upstream *up);
87 int pim_show_join_cmd_helper(const char *vrf, struct vty *vty, pim_addr s_or_g,
88 pim_addr g, const char *json);
89 int pim_show_join_vrf_all_cmd_helper(struct vty *vty, const char *json);
90 void pim_show_join(struct pim_instance *pim, struct vty *vty, pim_sgaddr *sg,
91 json_object *json);
92 int pim_show_jp_agg_list_cmd_helper(const char *vrf, struct vty *vty);
93 void pim_show_jp_agg_list(struct pim_instance *pim, struct vty *vty);
94 int pim_show_membership_cmd_helper(const char *vrf, struct vty *vty, bool uj);
95 void pim_show_membership(struct pim_instance *pim, struct vty *vty, bool uj);
96 void pim_show_channel(struct pim_instance *pim, struct vty *vty, bool uj);
97 int pim_show_channel_cmd_helper(const char *vrf, struct vty *vty, bool uj);
98 int pim_show_interface_cmd_helper(const char *vrf, struct vty *vty, bool uj,
99 bool mlag, const char *interface);
100 int pim_show_interface_vrf_all_cmd_helper(struct vty *vty, bool uj, bool mlag,
101 const char *interface);
102 void pim_show_interfaces(struct pim_instance *pim, struct vty *vty, bool mlag,
103 json_object *json);
104 void pim_show_interfaces_single(struct pim_instance *pim, struct vty *vty,
105 const char *ifname, bool mlag,
106 json_object *json);
107 void ip_pim_ssm_show_group_range(struct pim_instance *pim, struct vty *vty,
108 bool uj);
109 int pim_show_nexthop_lookup_cmd_helper(const char *vrf, struct vty *vty,
110 pim_addr source, pim_addr group);
111 int pim_show_nexthop_cmd_helper(const char *vrf, struct vty *vty, bool uj);
112 void pim_show_nexthop(struct pim_instance *pim, struct vty *vty, bool uj);
113 int pim_show_neighbors_cmd_helper(const char *vrf, struct vty *vty,
114 const char *json, const char *interface);
115 int pim_show_neighbors_vrf_all_cmd_helper(struct vty *vty, const char *json,
116 const char *interface);
117 void pim_show_neighbors_single(struct pim_instance *pim, struct vty *vty,
118 const char *neighbor, json_object *json);
119 void pim_show_neighbors(struct pim_instance *pim, struct vty *vty,
120 json_object *json);
121 int pim_show_group_rp_mappings_info_helper(const char *vrf, struct vty *vty,
122 bool uj);
123 int pim_show_bsm_db_helper(const char *vrf, struct vty *vty, bool uj);
124 int gm_process_query_max_response_time_cmd(struct vty *vty,
125 const char *qmrt_str);
126 int gm_process_no_query_max_response_time_cmd(struct vty *vty);
127 int gm_process_last_member_query_count_cmd(struct vty *vty,
128 const char *lmqc_str);
129 int gm_process_no_last_member_query_count_cmd(struct vty *vty);
130 int gm_process_last_member_query_interval_cmd(struct vty *vty,
131 const char *lmqi_str);
132 int gm_process_no_last_member_query_interval_cmd(struct vty *vty);
133 int pim_process_ssmpingd_cmd(struct vty *vty, enum nb_operation operation,
134 const char *src_str);
135 void pim_cmd_show_ip_multicast_helper(struct pim_instance *pim,
136 struct vty *vty);
137 void show_multicast_interfaces(struct pim_instance *pim, struct vty *vty,
138 json_object *json);
139 void show_mroute(struct pim_instance *pim, struct vty *vty, pim_sgaddr *sg,
140 bool fill, json_object *json);
141 void show_mroute_count(struct pim_instance *pim, struct vty *vty,
142 json_object *json);
143 void show_mroute_summary(struct pim_instance *pim, struct vty *vty,
144 json_object *json);
145 int clear_ip_mroute_count_command(struct vty *vty, const char *name);
146 struct vrf *pim_cmd_lookup(struct vty *vty, const char *name);
147 void clear_mroute(struct pim_instance *pim);
148 void clear_pim_statistics(struct pim_instance *pim);
149 int clear_pim_interface_traffic(const char *vrf, struct vty *vty);
150 int pim_debug_pim_cmd(void);
151 int pim_no_debug_pim_cmd(void);
152 int pim_debug_pim_packets_cmd(const char *hello, const char *joins,
153 const char *registers, struct vty *vty);
154 int pim_no_debug_pim_packets_cmd(const char *hello, const char *joins,
155 const char *registers, struct vty *vty);
156 int pim_show_rpf_helper(const char *vrf, struct vty *vty, bool json);
157 int pim_show_rpf_vrf_all_helper(struct vty *vty, bool json);
158 int pim_show_rp_helper(const char *vrf, struct vty *vty, const char *group_str,
159 const struct prefix *group, bool json);
160 int pim_show_rp_vrf_all_helper(struct vty *vty, const char *group_str,
161 const struct prefix *group, bool json);
162 int pim_show_secondary_helper(const char *vrf, struct vty *vty);
163 int pim_show_statistics_helper(const char *vrf, struct vty *vty,
164 const char *word, bool uj);
165 int pim_show_upstream_helper(const char *vrf, struct vty *vty, pim_addr s_or_g,
166 pim_addr g, bool json);
167 int pim_show_upstream_vrf_all_helper(struct vty *vty, bool json);
168 int pim_show_upstream_join_desired_helper(const char *vrf, struct vty *vty,
169 bool uj);
170 int pim_show_upstream_rpf_helper(const char *vrf, struct vty *vty, bool uj);
171 int pim_show_state_helper(const char *vrf, struct vty *vty,
172 const char *s_or_g_str, const char *g_str, bool json);
173 int pim_show_state_vrf_all_helper(struct vty *vty, const char *s_or_g_str,
174 const char *g_str, bool json);
175 int pim_show_multicast_helper(const char *vrf, struct vty *vty);
176 int pim_show_multicast_vrf_all_helper(struct vty *vty);
177 int pim_show_multicast_count_helper(const char *vrf, struct vty *vty,
178 bool json);
179 int pim_show_multicast_count_vrf_all_helper(struct vty *vty, bool json);
180 int pim_show_mroute_helper(const char *vrf, struct vty *vty, pim_addr s_or_g,
181 pim_addr g, bool fill, bool json);
182 int pim_show_mroute_vrf_all_helper(struct vty *vty, bool fill, bool json);
183 int pim_show_mroute_count_helper(const char *vrf, struct vty *vty, bool json);
184 int pim_show_mroute_count_vrf_all_helper(struct vty *vty, bool json);
185 int pim_show_mroute_summary_helper(const char *vrf, struct vty *vty, bool json);
186 int pim_show_mroute_summary_vrf_all_helper(struct vty *vty, bool json);
187
188 void pim_show_interface_traffic_single(struct pim_instance *pim,
189 struct vty *vty, const char *ifname,
190 bool uj);
191 void pim_show_interface_traffic(struct pim_instance *pim, struct vty *vty,
192 bool uj);
193 int pim_show_interface_traffic_helper(const char *vrf, const char *if_name,
194 struct vty *vty, bool uj);
195 void clear_pim_interfaces(struct pim_instance *pim);
196 void pim_show_bsr(struct pim_instance *pim, struct vty *vty, bool uj);
197 int pim_show_bsr_helper(const char *vrf, struct vty *vty, bool uj);
198 /*
199 * Special Macro to allow us to get the correct pim_instance;
200 */
201 #define PIM_DECLVAR_CONTEXT_VRF(vrfptr, pimptr) \
202 VTY_DECLVAR_CONTEXT_VRF(vrfptr); \
203 struct pim_instance *pimptr = vrfptr->info; \
204 MACRO_REQUIRE_SEMICOLON() /* end */
205
206 #endif /* PIM_CMD_COMMON_H */