]> git.proxmox.com Git - mirror_frr.git/blob - pimd/pim_nb.c
Merge pull request #7669 from ranjanyash54/2370
[mirror_frr.git] / pimd / pim_nb.c
1 /*
2 * Copyright (C) 2020 VmWare
3 * Sarita Patra
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the Free
7 * Software Foundation; either version 2 of the License, or (at your option)
8 * any later version.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; see the file COPYING; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20 #include <zebra.h>
21
22 #include "northbound.h"
23 #include "libfrr.h"
24 #include "vrf.h"
25 #include "pimd/pim_nb.h"
26
27 /* clang-format off */
28 const struct frr_yang_module_info frr_pim_info = {
29 .name = "frr-pim",
30 .nodes = {
31 {
32 .xpath = "/frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-pim:pim/ecmp",
33 .cbs = {
34 .modify = routing_control_plane_protocols_control_plane_protocol_pim_ecmp_modify,
35 }
36 },
37 {
38 .xpath = "/frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-pim:pim/ecmp-rebalance",
39 .cbs = {
40 .modify = routing_control_plane_protocols_control_plane_protocol_pim_ecmp_rebalance_modify,
41 }
42 },
43 {
44 .xpath = "/frr-pim:pim/join-prune-interval",
45 .cbs = {
46 .modify = pim_join_prune_interval_modify,
47 }
48 },
49 {
50 .xpath = "/frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-pim:pim/keep-alive-timer",
51 .cbs = {
52 .modify = routing_control_plane_protocols_control_plane_protocol_pim_keep_alive_timer_modify,
53 }
54 },
55 {
56 .xpath = "/frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-pim:pim/rp-keep-alive-timer",
57 .cbs = {
58 .modify = routing_control_plane_protocols_control_plane_protocol_pim_rp_keep_alive_timer_modify,
59 }
60 },
61 {
62 .xpath = "/frr-pim:pim/packets",
63 .cbs = {
64 .modify = pim_packets_modify,
65 }
66 },
67 {
68 .xpath = "/frr-pim:pim/register-suppress-time",
69 .cbs = {
70 .modify = pim_register_suppress_time_modify,
71 }
72 },
73 {
74 .xpath = "/frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-pim:pim/address-family",
75 .cbs = {
76 .create = routing_control_plane_protocols_control_plane_protocol_pim_address_family_create,
77 .destroy = routing_control_plane_protocols_control_plane_protocol_pim_address_family_destroy,
78 }
79 },
80 {
81 .xpath = "/frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-pim:pim/address-family/send-v6-secondary",
82 .cbs = {
83 .modify = routing_control_plane_protocols_control_plane_protocol_pim_address_family_send_v6_secondary_modify,
84 .destroy = routing_control_plane_protocols_control_plane_protocol_pim_address_family_send_v6_secondary_destroy,
85 }
86 },
87 {
88 .xpath = "/frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-pim:pim/address-family/spt-switchover",
89 .cbs = {
90 .apply_finish = routing_control_plane_protocols_control_plane_protocol_pim_address_family_spt_switchover_apply_finish,
91 }
92 },
93 {
94 .xpath = "/frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-pim:pim/address-family/spt-switchover/spt-action",
95 .cbs = {
96 .modify = routing_control_plane_protocols_control_plane_protocol_pim_address_family_spt_switchover_spt_action_modify,
97 }
98 },
99 {
100 .xpath = "/frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-pim:pim/address-family/spt-switchover/spt-infinity-prefix-list",
101 .cbs = {
102 .modify = routing_control_plane_protocols_control_plane_protocol_pim_address_family_spt_switchover_spt_infinity_prefix_list_modify,
103 .destroy = routing_control_plane_protocols_control_plane_protocol_pim_address_family_spt_switchover_spt_infinity_prefix_list_destroy,
104 }
105 },
106 {
107 .xpath = "/frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-pim:pim/address-family/ssm-prefix-list",
108 .cbs = {
109 .modify = routing_control_plane_protocols_control_plane_protocol_pim_address_family_ssm_prefix_list_modify,
110 .destroy = routing_control_plane_protocols_control_plane_protocol_pim_address_family_ssm_prefix_list_destroy,
111 }
112 },
113 {
114 .xpath = "/frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-pim:pim/address-family/ssm-pingd-source-ip",
115 .cbs = {
116 .create = routing_control_plane_protocols_control_plane_protocol_pim_address_family_ssm_pingd_source_ip_create,
117 .destroy = routing_control_plane_protocols_control_plane_protocol_pim_address_family_ssm_pingd_source_ip_destroy,
118 }
119 },
120 {
121 .xpath = "/frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-pim:pim/address-family/msdp-mesh-group",
122 .cbs = {
123 .create = routing_control_plane_protocols_control_plane_protocol_pim_address_family_msdp_mesh_group_create,
124 .destroy = routing_control_plane_protocols_control_plane_protocol_pim_address_family_msdp_mesh_group_destroy,
125 }
126 },
127 {
128 .xpath = "/frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-pim:pim/address-family/msdp-mesh-group/mesh-group-name",
129 .cbs = {
130 .modify = routing_control_plane_protocols_control_plane_protocol_pim_address_family_msdp_mesh_group_mesh_group_name_modify,
131 .destroy = routing_control_plane_protocols_control_plane_protocol_pim_address_family_msdp_mesh_group_mesh_group_name_destroy,
132 }
133 },
134 {
135 .xpath = "/frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-pim:pim/address-family/msdp-mesh-group/member-ip",
136 .cbs = {
137 .create = routing_control_plane_protocols_control_plane_protocol_pim_address_family_msdp_mesh_group_member_ip_create,
138 .destroy = routing_control_plane_protocols_control_plane_protocol_pim_address_family_msdp_mesh_group_member_ip_destroy,
139 }
140 },
141 {
142 .xpath = "/frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-pim:pim/address-family/msdp-mesh-group/source-ip",
143 .cbs = {
144 .modify = routing_control_plane_protocols_control_plane_protocol_pim_address_family_msdp_mesh_group_source_ip_modify,
145 .destroy = routing_control_plane_protocols_control_plane_protocol_pim_address_family_msdp_mesh_group_source_ip_destroy,
146 }
147 },
148 {
149 .xpath = "/frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-pim:pim/address-family/msdp-peer",
150 .cbs = {
151 .create = routing_control_plane_protocols_control_plane_protocol_pim_address_family_msdp_peer_create,
152 .destroy = routing_control_plane_protocols_control_plane_protocol_pim_address_family_msdp_peer_destroy,
153 }
154 },
155 {
156 .xpath = "/frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-pim:pim/address-family/msdp-peer/source-ip",
157 .cbs = {
158 .modify = routing_control_plane_protocols_control_plane_protocol_pim_address_family_msdp_peer_source_ip_modify,
159 .destroy = routing_control_plane_protocols_control_plane_protocol_pim_address_family_msdp_peer_source_ip_destroy,
160 }
161 },
162 {
163 .xpath = "/frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-pim:pim/address-family/mlag",
164 .cbs = {
165 .create = routing_control_plane_protocols_control_plane_protocol_pim_address_family_mlag_create,
166 .destroy = routing_control_plane_protocols_control_plane_protocol_pim_address_family_mlag_destroy,
167 .apply_finish = routing_control_plane_protocols_control_plane_protocol_pim_address_family_mlag_apply_finish,
168 }
169 },
170 {
171 .xpath = "/frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-pim:pim/address-family/mlag/peerlink-rif",
172 .cbs = {
173 .modify = routing_control_plane_protocols_control_plane_protocol_pim_address_family_mlag_peerlink_rif_modify,
174 .destroy = routing_control_plane_protocols_control_plane_protocol_pim_address_family_mlag_peerlink_rif_destroy,
175 }
176 },
177 {
178 .xpath = "/frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-pim:pim/address-family/mlag/reg-address",
179 .cbs = {
180 .modify = routing_control_plane_protocols_control_plane_protocol_pim_address_family_mlag_reg_address_modify,
181 .destroy = routing_control_plane_protocols_control_plane_protocol_pim_address_family_mlag_reg_address_destroy,
182 }
183 },
184 {
185 .xpath = "/frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-pim:pim/address-family/mlag/my-role",
186 .cbs = {
187 .modify = routing_control_plane_protocols_control_plane_protocol_pim_address_family_mlag_my_role_modify,
188 }
189 },
190 {
191 .xpath = "/frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-pim:pim/address-family/mlag/peer-state",
192 .cbs = {
193 .modify = routing_control_plane_protocols_control_plane_protocol_pim_address_family_mlag_peer_state_modify,
194 }
195 },
196 {
197 .xpath = "/frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-pim:pim/address-family/register-accept-list",
198 .cbs = {
199 .modify = routing_control_plane_protocols_control_plane_protocol_pim_address_family_register_accept_list_modify,
200 .destroy = routing_control_plane_protocols_control_plane_protocol_pim_address_family_register_accept_list_destroy,
201 }
202 },
203 {
204 .xpath = "/frr-interface:lib/interface/frr-pim:pim",
205 .cbs = {
206 .create = lib_interface_pim_create,
207 .destroy = lib_interface_pim_destroy,
208 }
209 },
210 {
211 .xpath = "/frr-interface:lib/interface/frr-pim:pim/pim-enable",
212 .cbs = {
213 .modify = lib_interface_pim_pim_enable_modify,
214 }
215 },
216 {
217 .xpath = "/frr-interface:lib/interface/frr-pim:pim/dr-priority",
218 .cbs = {
219 .modify = lib_interface_pim_dr_priority_modify,
220 }
221 },
222 {
223 .xpath = "/frr-interface:lib/interface/frr-pim:pim/hello-interval",
224 .cbs = {
225 .modify = lib_interface_pim_hello_interval_modify,
226 }
227 },
228 {
229 .xpath = "/frr-interface:lib/interface/frr-pim:pim/hello-holdtime",
230 .cbs = {
231 .modify = lib_interface_pim_hello_holdtime_modify,
232 .destroy = lib_interface_pim_hello_holdtime_destroy,
233 }
234 },
235 {
236 .xpath = "/frr-interface:lib/interface/frr-pim:pim/bfd",
237 .cbs = {
238 .create = lib_interface_pim_bfd_create,
239 .destroy = lib_interface_pim_bfd_destroy,
240 .apply_finish = lib_interface_pim_bfd_apply_finish,
241 }
242 },
243 {
244 .xpath = "/frr-interface:lib/interface/frr-pim:pim/bfd/min-rx-interval",
245 .cbs = {
246 .modify = lib_interface_pim_bfd_min_rx_interval_modify,
247 }
248 },
249 {
250 .xpath = "/frr-interface:lib/interface/frr-pim:pim/bfd/min-tx-interval",
251 .cbs = {
252 .modify = lib_interface_pim_bfd_min_tx_interval_modify,
253 }
254 },
255 {
256 .xpath = "/frr-interface:lib/interface/frr-pim:pim/bfd/detect_mult",
257 .cbs = {
258 .modify = lib_interface_pim_bfd_detect_mult_modify,
259 }
260 },
261 {
262 .xpath = "/frr-interface:lib/interface/frr-pim:pim/bsm",
263 .cbs = {
264 .modify = lib_interface_pim_bsm_modify,
265 }
266 },
267 {
268 .xpath = "/frr-interface:lib/interface/frr-pim:pim/unicast-bsm",
269 .cbs = {
270 .modify = lib_interface_pim_unicast_bsm_modify,
271 }
272 },
273 {
274 .xpath = "/frr-interface:lib/interface/frr-pim:pim/active-active",
275 .cbs = {
276 .modify = lib_interface_pim_active_active_modify,
277 }
278 },
279 {
280 .xpath = "/frr-interface:lib/interface/frr-pim:pim/address-family",
281 .cbs = {
282 .create = lib_interface_pim_address_family_create,
283 .destroy = lib_interface_pim_address_family_destroy,
284 }
285 },
286 {
287 .xpath = "/frr-interface:lib/interface/frr-pim:pim/address-family/use-source",
288 .cbs = {
289 .modify = lib_interface_pim_address_family_use_source_modify,
290 .destroy = lib_interface_pim_address_family_use_source_destroy,
291 }
292 },
293 {
294 .xpath = "/frr-interface:lib/interface/frr-pim:pim/address-family/multicast-boundary-oil",
295 .cbs = {
296 .modify = lib_interface_pim_address_family_multicast_boundary_oil_modify,
297 .destroy = lib_interface_pim_address_family_multicast_boundary_oil_destroy,
298 }
299 },
300 {
301 .xpath = "/frr-interface:lib/interface/frr-pim:pim/address-family/mroute",
302 .cbs = {
303 .create = lib_interface_pim_address_family_mroute_create,
304 .destroy = lib_interface_pim_address_family_mroute_destroy,
305 }
306 },
307 {
308 .xpath = "/frr-interface:lib/interface/frr-pim:pim/address-family/mroute/oif",
309 .cbs = {
310 .modify = lib_interface_pim_address_family_mroute_oif_modify,
311 .destroy = lib_interface_pim_address_family_mroute_oif_destroy,
312 }
313 },
314 {
315 .xpath = NULL,
316 },
317 }
318 };
319
320 /* clang-format off */
321 const struct frr_yang_module_info frr_pim_rp_info = {
322 .name = "frr-pim-rp",
323 .nodes = {
324 {
325 .xpath = "/frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-pim:pim/address-family/frr-pim-rp:rp/static-rp/rp-list",
326 .cbs = {
327 .create = routing_control_plane_protocols_control_plane_protocol_pim_address_family_rp_static_rp_rp_list_create,
328 .destroy = routing_control_plane_protocols_control_plane_protocol_pim_address_family_rp_static_rp_rp_list_destroy,
329 }
330 },
331 {
332 .xpath = "/frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-pim:pim/address-family/frr-pim-rp:rp/static-rp/rp-list/group-list",
333 .cbs = {
334 .create = routing_control_plane_protocols_control_plane_protocol_pim_address_family_rp_static_rp_rp_list_group_list_create,
335 .destroy = routing_control_plane_protocols_control_plane_protocol_pim_address_family_rp_static_rp_rp_list_group_list_destroy,
336 }
337 },
338 {
339 .xpath = "/frr-routing:routing/control-plane-protocols/control-plane-protocol/frr-pim:pim/address-family/frr-pim-rp:rp/static-rp/rp-list/prefix-list",
340 .cbs = {
341 .modify = routing_control_plane_protocols_control_plane_protocol_pim_address_family_rp_static_rp_rp_list_prefix_list_modify,
342 .destroy = routing_control_plane_protocols_control_plane_protocol_pim_address_family_rp_static_rp_rp_list_prefix_list_destroy,
343 }
344 },
345 {
346 .xpath = NULL,
347 },
348 }
349 };
350
351 /* clang-format off */
352 const struct frr_yang_module_info frr_igmp_info = {
353 .name = "frr-igmp",
354 .nodes = {
355 {
356 .xpath = "/frr-interface:lib/interface/frr-igmp:igmp",
357 .cbs = {
358 .create = lib_interface_igmp_create,
359 .destroy = lib_interface_igmp_destroy,
360 }
361 },
362 {
363 .xpath = "/frr-interface:lib/interface/frr-igmp:igmp/igmp-enable",
364 .cbs = {
365 .modify = lib_interface_igmp_igmp_enable_modify,
366 }
367 },
368 {
369 .xpath = "/frr-interface:lib/interface/frr-igmp:igmp/version",
370 .cbs = {
371 .modify = lib_interface_igmp_version_modify,
372 .destroy = lib_interface_igmp_version_destroy,
373 }
374 },
375 {
376 .xpath = "/frr-interface:lib/interface/frr-igmp:igmp/query-interval",
377 .cbs = {
378 .modify = lib_interface_igmp_query_interval_modify,
379 }
380 },
381 {
382 .xpath = "/frr-interface:lib/interface/frr-igmp:igmp/query-max-response-time",
383 .cbs = {
384 .modify = lib_interface_igmp_query_max_response_time_modify,
385 }
386 },
387 {
388 .xpath = "/frr-interface:lib/interface/frr-igmp:igmp/last-member-query-interval",
389 .cbs = {
390 .modify = lib_interface_igmp_last_member_query_interval_modify,
391 }
392 },
393 {
394 .xpath = "/frr-interface:lib/interface/frr-igmp:igmp/robustness-variable",
395 .cbs = {
396 .modify = lib_interface_igmp_robustness_variable_modify,
397 }
398 },
399 {
400 .xpath = "/frr-interface:lib/interface/frr-igmp:igmp/address-family",
401 .cbs = {
402 .create = lib_interface_igmp_address_family_create,
403 .destroy = lib_interface_igmp_address_family_destroy,
404 }
405 },
406 {
407 .xpath = "/frr-interface:lib/interface/frr-igmp:igmp/address-family/static-group",
408 .cbs = {
409 .create = lib_interface_igmp_address_family_static_group_create,
410 .destroy = lib_interface_igmp_address_family_static_group_destroy,
411 }
412 },
413 {
414 .xpath = NULL,
415 },
416 }
417 };