2 * BFD daemon northbound implementation.
4 * Copyright (C) 2019 Network Device Education Foundation, Inc. ("NetDEF")
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
26 #include "lib/northbound.h"
30 /* clang-format off */
31 const struct frr_yang_module_info frr_bfdd_info
= {
35 .xpath
= "/frr-bfdd:bfdd/bfd",
37 .create
= bfdd_bfd_create
,
38 .destroy
= bfdd_bfd_destroy
,
39 .cli_show
= bfd_cli_show_header
,
40 .cli_show_end
= bfd_cli_show_header_end
,
44 .xpath
= "/frr-bfdd:bfdd/bfd/profile",
46 .create
= bfdd_bfd_profile_create
,
47 .destroy
= bfdd_bfd_profile_destroy
,
48 .cli_show
= bfd_cli_show_profile
,
49 .cli_show_end
= bfd_cli_show_peer_end
,
53 .xpath
= "/frr-bfdd:bfdd/bfd/profile/detection-multiplier",
55 .modify
= bfdd_bfd_profile_detection_multiplier_modify
,
56 .cli_show
= bfd_cli_show_mult
,
60 .xpath
= "/frr-bfdd:bfdd/bfd/profile/desired-transmission-interval",
62 .modify
= bfdd_bfd_profile_desired_transmission_interval_modify
,
63 .cli_show
= bfd_cli_show_tx
,
67 .xpath
= "/frr-bfdd:bfdd/bfd/profile/required-receive-interval",
69 .modify
= bfdd_bfd_profile_required_receive_interval_modify
,
70 .cli_show
= bfd_cli_show_rx
,
74 .xpath
= "/frr-bfdd:bfdd/bfd/profile/administrative-down",
76 .modify
= bfdd_bfd_profile_administrative_down_modify
,
77 .cli_show
= bfd_cli_show_shutdown
,
81 .xpath
= "/frr-bfdd:bfdd/bfd/profile/passive-mode",
83 .modify
= bfdd_bfd_profile_passive_mode_modify
,
84 .cli_show
= bfd_cli_show_passive
,
88 .xpath
= "/frr-bfdd:bfdd/bfd/profile/minimum-ttl",
90 .modify
= bfdd_bfd_profile_minimum_ttl_modify
,
91 .destroy
= bfdd_bfd_profile_minimum_ttl_destroy
,
92 .cli_show
= bfd_cli_show_minimum_ttl
,
96 .xpath
= "/frr-bfdd:bfdd/bfd/profile/echo-mode",
98 .modify
= bfdd_bfd_profile_echo_mode_modify
,
99 .cli_show
= bfd_cli_show_echo
,
103 .xpath
= "/frr-bfdd:bfdd/bfd/profile/desired-echo-transmission-interval",
105 .modify
= bfdd_bfd_profile_desired_echo_transmission_interval_modify
,
106 .cli_show
= bfd_cli_show_desired_echo_transmission_interval
,
110 .xpath
= "/frr-bfdd:bfdd/bfd/profile/required-echo-receive-interval",
112 .modify
= bfdd_bfd_profile_required_echo_receive_interval_modify
,
113 .cli_show
= bfd_cli_show_required_echo_receive_interval
,
117 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/single-hop",
119 .create
= bfdd_bfd_sessions_single_hop_create
,
120 .destroy
= bfdd_bfd_sessions_single_hop_destroy
,
121 .get_next
= bfdd_bfd_sessions_single_hop_get_next
,
122 .get_keys
= bfdd_bfd_sessions_single_hop_get_keys
,
123 .lookup_entry
= bfdd_bfd_sessions_single_hop_lookup_entry
,
124 .cli_show
= bfd_cli_show_single_hop_peer
,
125 .cli_show_end
= bfd_cli_show_peer_end
,
129 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/single-hop/source-addr",
131 .modify
= bfdd_bfd_sessions_single_hop_source_addr_modify
,
132 .destroy
= bfdd_bfd_sessions_single_hop_source_addr_destroy
,
136 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/single-hop/profile",
138 .modify
= bfdd_bfd_sessions_single_hop_profile_modify
,
139 .destroy
= bfdd_bfd_sessions_single_hop_profile_destroy
,
140 .cli_show
= bfd_cli_peer_profile_show
,
144 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/single-hop/detection-multiplier",
146 .modify
= bfdd_bfd_sessions_single_hop_detection_multiplier_modify
,
147 .cli_show
= bfd_cli_show_mult
,
151 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/single-hop/desired-transmission-interval",
153 .modify
= bfdd_bfd_sessions_single_hop_desired_transmission_interval_modify
,
154 .cli_show
= bfd_cli_show_tx
,
158 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/single-hop/required-receive-interval",
160 .modify
= bfdd_bfd_sessions_single_hop_required_receive_interval_modify
,
161 .cli_show
= bfd_cli_show_rx
,
165 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/single-hop/administrative-down",
167 .modify
= bfdd_bfd_sessions_single_hop_administrative_down_modify
,
168 .cli_show
= bfd_cli_show_shutdown
,
172 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/single-hop/passive-mode",
174 .modify
= bfdd_bfd_sessions_single_hop_passive_mode_modify
,
175 .cli_show
= bfd_cli_show_passive
,
179 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/single-hop/echo-mode",
181 .modify
= bfdd_bfd_sessions_single_hop_echo_mode_modify
,
182 .cli_show
= bfd_cli_show_echo
,
186 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/single-hop/desired-echo-transmission-interval",
188 .modify
= bfdd_bfd_sessions_single_hop_desired_echo_transmission_interval_modify
,
189 .cli_show
= bfd_cli_show_desired_echo_transmission_interval
,
193 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/single-hop/required-echo-receive-interval",
195 .modify
= bfdd_bfd_sessions_single_hop_required_echo_receive_interval_modify
,
196 .cli_show
= bfd_cli_show_required_echo_receive_interval
,
200 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/single-hop/stats/local-discriminator",
202 .get_elem
= bfdd_bfd_sessions_single_hop_stats_local_discriminator_get_elem
,
206 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/single-hop/stats/local-state",
208 .get_elem
= bfdd_bfd_sessions_single_hop_stats_local_state_get_elem
,
212 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/single-hop/stats/local-diagnostic",
214 .get_elem
= bfdd_bfd_sessions_single_hop_stats_local_diagnostic_get_elem
,
218 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/single-hop/stats/local-multiplier",
220 .get_elem
= bfdd_bfd_sessions_single_hop_stats_local_multiplier_get_elem
,
224 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/single-hop/stats/remote-discriminator",
226 .get_elem
= bfdd_bfd_sessions_single_hop_stats_remote_discriminator_get_elem
,
230 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/single-hop/stats/remote-state",
232 .get_elem
= bfdd_bfd_sessions_single_hop_stats_remote_state_get_elem
,
236 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/single-hop/stats/remote-diagnostic",
238 .get_elem
= bfdd_bfd_sessions_single_hop_stats_remote_diagnostic_get_elem
,
242 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/single-hop/stats/remote-multiplier",
244 .get_elem
= bfdd_bfd_sessions_single_hop_stats_remote_multiplier_get_elem
,
248 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/single-hop/stats/negotiated-transmission-interval",
250 .get_elem
= bfdd_bfd_sessions_single_hop_stats_negotiated_transmission_interval_get_elem
,
254 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/single-hop/stats/negotiated-receive-interval",
256 .get_elem
= bfdd_bfd_sessions_single_hop_stats_negotiated_receive_interval_get_elem
,
260 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/single-hop/stats/detection-mode",
262 .get_elem
= bfdd_bfd_sessions_single_hop_stats_detection_mode_get_elem
,
266 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/single-hop/stats/last-down-time",
268 .get_elem
= bfdd_bfd_sessions_single_hop_stats_last_down_time_get_elem
,
272 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/single-hop/stats/last-up-time",
274 .get_elem
= bfdd_bfd_sessions_single_hop_stats_last_up_time_get_elem
,
278 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/single-hop/stats/session-down-count",
280 .get_elem
= bfdd_bfd_sessions_single_hop_stats_session_down_count_get_elem
,
284 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/single-hop/stats/session-up-count",
286 .get_elem
= bfdd_bfd_sessions_single_hop_stats_session_up_count_get_elem
,
290 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/single-hop/stats/control-packet-input-count",
292 .get_elem
= bfdd_bfd_sessions_single_hop_stats_control_packet_input_count_get_elem
,
296 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/single-hop/stats/control-packet-output-count",
298 .get_elem
= bfdd_bfd_sessions_single_hop_stats_control_packet_output_count_get_elem
,
302 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/single-hop/stats/negotiated-echo-transmission-interval",
304 .get_elem
= bfdd_bfd_sessions_single_hop_stats_negotiated_echo_transmission_interval_get_elem
,
308 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/single-hop/stats/echo-packet-input-count",
310 .get_elem
= bfdd_bfd_sessions_single_hop_stats_echo_packet_input_count_get_elem
,
314 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/single-hop/stats/echo-packet-output-count",
316 .get_elem
= bfdd_bfd_sessions_single_hop_stats_echo_packet_output_count_get_elem
,
320 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/multi-hop",
322 .create
= bfdd_bfd_sessions_multi_hop_create
,
323 .destroy
= bfdd_bfd_sessions_multi_hop_destroy
,
324 .get_next
= bfdd_bfd_sessions_multi_hop_get_next
,
325 .get_keys
= bfdd_bfd_sessions_multi_hop_get_keys
,
326 .lookup_entry
= bfdd_bfd_sessions_multi_hop_lookup_entry
,
327 .cli_show
= bfd_cli_show_multi_hop_peer
,
328 .cli_show_end
= bfd_cli_show_peer_end
,
332 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/multi-hop/profile",
334 .modify
= bfdd_bfd_sessions_single_hop_profile_modify
,
335 .destroy
= bfdd_bfd_sessions_single_hop_profile_destroy
,
336 .cli_show
= bfd_cli_peer_profile_show
,
340 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/multi-hop/detection-multiplier",
342 .modify
= bfdd_bfd_sessions_single_hop_detection_multiplier_modify
,
343 .cli_show
= bfd_cli_show_mult
,
347 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/multi-hop/desired-transmission-interval",
349 .modify
= bfdd_bfd_sessions_single_hop_desired_transmission_interval_modify
,
350 .cli_show
= bfd_cli_show_tx
,
354 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/multi-hop/required-receive-interval",
356 .modify
= bfdd_bfd_sessions_single_hop_required_receive_interval_modify
,
357 .cli_show
= bfd_cli_show_rx
,
361 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/multi-hop/administrative-down",
363 .modify
= bfdd_bfd_sessions_single_hop_administrative_down_modify
,
364 .cli_show
= bfd_cli_show_shutdown
,
368 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/multi-hop/passive-mode",
370 .modify
= bfdd_bfd_sessions_single_hop_passive_mode_modify
,
371 .cli_show
= bfd_cli_show_passive
,
375 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/multi-hop/minimum-ttl",
377 .modify
= bfdd_bfd_sessions_multi_hop_minimum_ttl_modify
,
378 .destroy
= bfdd_bfd_sessions_multi_hop_minimum_ttl_destroy
,
379 .cli_show
= bfd_cli_show_minimum_ttl
,
383 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/multi-hop/stats/local-discriminator",
385 .get_elem
= bfdd_bfd_sessions_single_hop_stats_local_discriminator_get_elem
,
389 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/multi-hop/stats/local-state",
391 .get_elem
= bfdd_bfd_sessions_single_hop_stats_local_state_get_elem
,
395 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/multi-hop/stats/local-diagnostic",
397 .get_elem
= bfdd_bfd_sessions_single_hop_stats_local_diagnostic_get_elem
,
401 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/multi-hop/stats/local-multiplier",
403 .get_elem
= bfdd_bfd_sessions_single_hop_stats_local_multiplier_get_elem
,
407 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/multi-hop/stats/remote-discriminator",
409 .get_elem
= bfdd_bfd_sessions_single_hop_stats_remote_discriminator_get_elem
,
413 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/multi-hop/stats/remote-state",
415 .get_elem
= bfdd_bfd_sessions_single_hop_stats_remote_state_get_elem
,
419 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/multi-hop/stats/remote-diagnostic",
421 .get_elem
= bfdd_bfd_sessions_single_hop_stats_remote_diagnostic_get_elem
,
425 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/multi-hop/stats/remote-multiplier",
427 .get_elem
= bfdd_bfd_sessions_single_hop_stats_remote_multiplier_get_elem
,
431 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/multi-hop/stats/negotiated-transmission-interval",
433 .get_elem
= bfdd_bfd_sessions_single_hop_stats_negotiated_transmission_interval_get_elem
,
437 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/multi-hop/stats/negotiated-receive-interval",
439 .get_elem
= bfdd_bfd_sessions_single_hop_stats_negotiated_receive_interval_get_elem
,
443 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/multi-hop/stats/detection-mode",
445 .get_elem
= bfdd_bfd_sessions_single_hop_stats_detection_mode_get_elem
,
449 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/multi-hop/stats/last-down-time",
451 .get_elem
= bfdd_bfd_sessions_single_hop_stats_last_down_time_get_elem
,
455 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/multi-hop/stats/last-up-time",
457 .get_elem
= bfdd_bfd_sessions_single_hop_stats_last_up_time_get_elem
,
461 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/multi-hop/stats/session-down-count",
463 .get_elem
= bfdd_bfd_sessions_single_hop_stats_session_down_count_get_elem
,
467 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/multi-hop/stats/session-up-count",
469 .get_elem
= bfdd_bfd_sessions_single_hop_stats_session_up_count_get_elem
,
473 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/multi-hop/stats/control-packet-input-count",
475 .get_elem
= bfdd_bfd_sessions_single_hop_stats_control_packet_input_count_get_elem
,
479 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/multi-hop/stats/control-packet-output-count",
481 .get_elem
= bfdd_bfd_sessions_single_hop_stats_control_packet_output_count_get_elem
,
485 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/multi-hop/stats/negotiated-echo-transmission-interval",
487 .get_elem
= bfdd_bfd_sessions_single_hop_stats_negotiated_echo_transmission_interval_get_elem
,
491 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/multi-hop/stats/echo-packet-input-count",
493 .get_elem
= bfdd_bfd_sessions_single_hop_stats_echo_packet_input_count_get_elem
,
497 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/multi-hop/stats/echo-packet-output-count",
499 .get_elem
= bfdd_bfd_sessions_single_hop_stats_echo_packet_output_count_get_elem
,