]>
git.proxmox.com Git - mirror_frr.git/blob - pimd/pim_cmd_common.h
3 * Copyright (C) 2022 Vmware, Inc.
4 * Mobashshera Rasool <mrasool@vmware.com>
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.
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.
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
20 #ifndef PIM_CMD_COMMON_H
21 #define PIM_CMD_COMMON_H
26 /* duplicated from pim_instance.h - needed to avoid dependency mess */
27 struct pim_instance
*pim_get_pim_instance(vrf_id_t vrf_id
);
29 const char *pim_cli_get_vrf_name(struct vty
*vty
);
30 int pim_process_join_prune_cmd(struct vty
*vty
, const char *jpi_str
);
31 int pim_process_no_join_prune_cmd(struct vty
*vty
);
32 int pim_process_spt_switchover_infinity_cmd(struct vty
*vty
);
33 int pim_process_spt_switchover_prefixlist_cmd(struct vty
*vty
,
35 int pim_process_no_spt_switchover_cmd(struct vty
*vty
);
36 int pim_process_pim_packet_cmd(struct vty
*vty
, const char *packet
);
37 int pim_process_no_pim_packet_cmd(struct vty
*vty
);
38 int pim_process_keepalivetimer_cmd(struct vty
*vty
, const char *kat
);
39 int pim_process_no_keepalivetimer_cmd(struct vty
*vty
);
40 int pim_process_rp_kat_cmd(struct vty
*vty
, const char *rpkat
);
41 int pim_process_no_rp_kat_cmd(struct vty
*vty
);
42 int pim_process_register_suppress_cmd(struct vty
*vty
, const char *rst
);
43 int pim_process_no_register_suppress_cmd(struct vty
*vty
);
44 int pim_process_rp_cmd(struct vty
*vty
, const char *rp_str
,
45 const char *group_str
);
46 int pim_process_no_rp_cmd(struct vty
*vty
, const char *rp_str
,
47 const char *group_str
);
48 int pim_process_rp_plist_cmd(struct vty
*vty
, const char *rp_str
,
49 const char *prefix_list
);
50 int pim_process_no_rp_plist_cmd(struct vty
*vty
, const char *rp_str
,
51 const char *prefix_list
);
53 int pim_process_ip_pim_cmd(struct vty
*vty
);
54 int pim_process_no_ip_pim_cmd(struct vty
*vty
);
55 int pim_process_ip_pim_passive_cmd(struct vty
*vty
, bool enable
);
56 int pim_process_ip_pim_drprio_cmd(struct vty
*vty
, const char *drpriority_str
);
57 int pim_process_no_ip_pim_drprio_cmd(struct vty
*vty
);
58 int pim_process_ip_pim_hello_cmd(struct vty
*vty
, const char *hello_str
,
59 const char *hold_str
);
60 int pim_process_no_ip_pim_hello_cmd(struct vty
*vty
);
61 int pim_process_ip_pim_activeactive_cmd(struct vty
*vty
, const char *no
);
62 int pim_process_ip_pim_boundary_oil_cmd(struct vty
*vty
, const char *oil
);
63 int pim_process_no_ip_pim_boundary_oil_cmd(struct vty
*vty
);
64 int pim_process_ip_mroute_cmd(struct vty
*vty
, const char *interface
,
65 const char *group_str
, const char *source_str
);
66 int pim_process_no_ip_mroute_cmd(struct vty
*vty
, const char *interface
,
67 const char *group_str
, const char *src_str
);
68 void json_object_pim_upstream_add(json_object
*json
, struct pim_upstream
*up
);
69 void pim_show_rpf(struct pim_instance
*pim
, struct vty
*vty
, json_object
*json
);
70 void pim_show_neighbors_secondary(struct pim_instance
*pim
, struct vty
*vty
);
71 void pim_show_state(struct pim_instance
*pim
, struct vty
*vty
,
72 const char *src_or_group
, const char *group
,
74 void pim_show_statistics(struct pim_instance
*pim
, struct vty
*vty
,
75 const char *ifname
, bool uj
);
76 void pim_show_upstream(struct pim_instance
*pim
, struct vty
*vty
,
77 pim_sgaddr
*sg
, json_object
*json
);
78 void pim_show_join_desired(struct pim_instance
*pim
, struct vty
*vty
, bool uj
);
79 void pim_show_upstream_rpf(struct pim_instance
*pim
, struct vty
*vty
, bool uj
);
80 void pim_show_rpf_refresh_stats(struct vty
*vty
, struct pim_instance
*pim
,
81 time_t now
, json_object
*json
);
82 bool pim_sgaddr_match(pim_sgaddr item
, pim_sgaddr match
);
83 void json_object_pim_ifp_add(struct json_object
*json
, struct interface
*ifp
);
84 void pim_print_ifp_flags(struct vty
*vty
, struct interface
*ifp
);
85 void json_object_pim_upstream_add(json_object
*json
, struct pim_upstream
*up
);
86 void pim_show_join(struct pim_instance
*pim
, struct vty
*vty
, pim_sgaddr
*sg
,
88 void pim_show_jp_agg_list(struct pim_instance
*pim
, struct vty
*vty
);
89 void pim_show_membership(struct pim_instance
*pim
, struct vty
*vty
, bool uj
);
90 void pim_show_channel(struct pim_instance
*pim
, struct vty
*vty
, bool uj
);
91 void pim_show_interfaces(struct pim_instance
*pim
, struct vty
*vty
, bool mlag
,
93 void pim_show_interfaces_single(struct pim_instance
*pim
, struct vty
*vty
,
94 const char *ifname
, bool mlag
,
96 void ip_pim_ssm_show_group_range(struct pim_instance
*pim
, struct vty
*vty
,
98 void pim_show_nexthop(struct pim_instance
*pim
, struct vty
*vty
);
99 void pim_show_neighbors_single(struct pim_instance
*pim
, struct vty
*vty
,
100 const char *neighbor
, json_object
*json
);
101 void pim_show_neighbors(struct pim_instance
*pim
, struct vty
*vty
,
103 int gm_process_query_max_response_time_cmd(struct vty
*vty
,
104 const char *qmrt_str
);
105 int gm_process_no_query_max_response_time_cmd(struct vty
*vty
);
106 int gm_process_last_member_query_count_cmd(struct vty
*vty
,
107 const char *lmqc_str
);
108 int gm_process_no_last_member_query_count_cmd(struct vty
*vty
);
109 int gm_process_last_member_query_interval_cmd(struct vty
*vty
,
110 const char *lmqi_str
);
111 int gm_process_no_last_member_query_interval_cmd(struct vty
*vty
);
112 int pim_process_ssmpingd_cmd(struct vty
*vty
, enum nb_operation operation
,
113 const char *src_str
);
114 void pim_cmd_show_ip_multicast_helper(struct pim_instance
*pim
,
116 void show_multicast_interfaces(struct pim_instance
*pim
, struct vty
*vty
,
118 void show_mroute(struct pim_instance
*pim
, struct vty
*vty
, pim_sgaddr
*sg
,
119 bool fill
, json_object
*json
);
120 void show_mroute_count(struct pim_instance
*pim
, struct vty
*vty
,
122 void show_mroute_summary(struct pim_instance
*pim
, struct vty
*vty
,
124 int clear_ip_mroute_count_command(struct vty
*vty
, const char *name
);
125 struct vrf
*pim_cmd_lookup(struct vty
*vty
, const char *name
);
126 void clear_mroute(struct pim_instance
*pim
);
127 void clear_pim_statistics(struct pim_instance
*pim
);
128 int pim_debug_pim_cmd(void);
129 int pim_no_debug_pim_cmd(void);
130 int pim_debug_pim_packets_cmd(const char *hello
, const char *joins
,
131 const char *registers
, struct vty
*vty
);
132 int pim_no_debug_pim_packets_cmd(const char *hello
, const char *joins
,
133 const char *registers
, struct vty
*vty
);
134 int pim_show_rpf_helper(const char *vrf
, struct vty
*vty
, bool json
);
135 int pim_show_rpf_vrf_all_helper(struct vty
*vty
, bool json
);
136 int pim_show_rp_helper(const char *vrf
, struct vty
*vty
, const char *group_str
,
137 const struct prefix
*group
, bool json
);
138 int pim_show_rp_vrf_all_helper(struct vty
*vty
, const char *group_str
,
139 const struct prefix
*group
, bool json
);
140 int pim_show_secondary_helper(const char *vrf
, struct vty
*vty
);
141 int pim_show_statistics_helper(const char *vrf
, struct vty
*vty
,
142 const char *word
, bool uj
);
143 int pim_show_upstream_helper(const char *vrf
, struct vty
*vty
, pim_addr s_or_g
,
144 pim_addr g
, bool json
);
145 int pim_show_upstream_vrf_all_helper(struct vty
*vty
, bool json
);
146 int pim_show_upstream_join_desired_helper(const char *vrf
, struct vty
*vty
,
148 int pim_show_upstream_rpf_helper(const char *vrf
, struct vty
*vty
, bool uj
);
149 int pim_show_state_helper(const char *vrf
, struct vty
*vty
,
150 const char *s_or_g_str
, const char *g_str
, bool json
);
151 int pim_show_state_vrf_all_helper(struct vty
*vty
, const char *s_or_g_str
,
152 const char *g_str
, bool json
);
153 int pim_show_multicast_helper(const char *vrf
, struct vty
*vty
);
154 int pim_show_multicast_vrf_all_helper(struct vty
*vty
);
155 int pim_show_multicast_count_helper(const char *vrf
, struct vty
*vty
,
157 int pim_show_multicast_count_vrf_all_helper(struct vty
*vty
, bool json
);
158 int pim_show_mroute_helper(const char *vrf
, struct vty
*vty
, pim_addr s_or_g
,
159 pim_addr g
, bool fill
, bool json
);
160 int pim_show_mroute_vrf_all_helper(struct vty
*vty
, bool fill
, bool json
);
161 int pim_show_mroute_count_helper(const char *vrf
, struct vty
*vty
, bool json
);
162 int pim_show_mroute_count_vrf_all_helper(struct vty
*vty
, bool json
);
163 int pim_show_mroute_summary_helper(const char *vrf
, struct vty
*vty
, bool json
);
164 int pim_show_mroute_summary_vrf_all_helper(struct vty
*vty
, bool json
);
167 * Special Macro to allow us to get the correct pim_instance;
169 #define PIM_DECLVAR_CONTEXT_VRF(vrfptr, pimptr) \
170 VTY_DECLVAR_CONTEXT_VRF(vrfptr); \
171 struct pim_instance *pimptr = vrfptr->info; \
172 MACRO_REQUIRE_SEMICOLON() /* end */
174 #endif /* PIM_CMD_COMMON_H */