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