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"
33 static void bfd_session_get_key(bool mhop
, const struct lyd_node
*dnode
,
36 const char *ifname
= NULL
, *vrfname
= NULL
;
37 struct sockaddr_any psa
, lsa
;
39 /* Required destination parameter. */
40 strtosa(yang_dnode_get_string(dnode
, "./dest-addr"), &psa
);
42 /* Get optional source address. */
43 memset(&lsa
, 0, sizeof(lsa
));
44 if (yang_dnode_exists(dnode
, "./source-addr"))
45 strtosa(yang_dnode_get_string(dnode
, "./source-addr"), &lsa
);
47 /* Get optional interface and vrf names. */
48 if (yang_dnode_exists(dnode
, "./interface"))
49 ifname
= yang_dnode_get_string(dnode
, "./interface");
50 if (yang_dnode_exists(dnode
, "./vrf"))
51 vrfname
= yang_dnode_get_string(dnode
, "./vrf");
53 /* Generate the corresponding key. */
54 gen_bfd_key(bk
, &psa
, &lsa
, mhop
, ifname
, vrfname
);
57 static int bfd_session_create(enum nb_event event
, const struct lyd_node
*dnode
,
58 union nb_resource
*resource
, bool mhop
)
60 struct bfd_session
*bs
;
68 * When `dest-addr` is IPv6 and link-local we must
69 * require interface name, otherwise we can't figure
70 * which interface to use to send the packets.
72 yang_dnode_get_prefix(&p
, dnode
, "./dest-addr");
75 * To support old FRR versions we must allow empty
76 * interface to be specified, however that should
77 * change in the future.
79 if (yang_dnode_exists(dnode
, "./interface"))
80 ifname
= yang_dnode_get_string(dnode
, "./interface");
84 if (p
.family
== AF_INET6
85 && IN6_IS_ADDR_LINKLOCAL(&p
.u
.prefix6
)
86 && strlen(ifname
) == 0) {
87 zlog_warn("%s: when using link-local you must specify "
88 "an interface.", __func__
);
89 return NB_ERR_VALIDATION
;
94 bfd_session_get_key(mhop
, dnode
, &bk
);
95 bs
= bfd_key_lookup(bk
);
97 /* This session was already configured by another daemon. */
99 /* Now it is configured also by CLI. */
100 BFD_SET_FLAG(bs
->flags
, BFD_SESS_FLAG_CONFIG
);
107 bs
= bfd_session_new();
109 return NB_ERR_RESOURCE
;
111 /* Fill the session key. */
112 bfd_session_get_key(mhop
, dnode
, &bs
->key
);
114 /* Set configuration flags. */
116 BFD_SET_FLAG(bs
->flags
, BFD_SESS_FLAG_CONFIG
);
118 BFD_SET_FLAG(bs
->flags
, BFD_SESS_FLAG_MH
);
119 if (bs
->key
.family
== AF_INET6
)
120 BFD_SET_FLAG(bs
->flags
, BFD_SESS_FLAG_IPV6
);
128 /* Only attempt to registrate if freshly allocated. */
129 if (bs
->discrs
.my_discr
== 0 && bs_registrate(bs
) == NULL
)
130 return NB_ERR_RESOURCE
;
132 nb_running_set_entry(dnode
, bs
);
137 if (bs
->refcount
<= 1)
138 bfd_session_free(resource
->ptr
);
145 static int bfd_session_destroy(enum nb_event event
,
146 const struct lyd_node
*dnode
, bool mhop
)
148 struct bfd_session
*bs
;
153 bfd_session_get_key(mhop
, dnode
, &bk
);
154 if (bfd_key_lookup(bk
) == NULL
)
155 return NB_ERR_INCONSISTENCY
;
163 bs
= nb_running_unset_entry(dnode
);
164 /* CLI is not using this session anymore. */
165 if (BFD_CHECK_FLAG(bs
->flags
, BFD_SESS_FLAG_CONFIG
) == 0)
168 BFD_UNSET_FLAG(bs
->flags
, BFD_SESS_FLAG_CONFIG
);
170 /* There are still daemons using it. */
171 if (bs
->refcount
> 0)
174 bfd_session_free(bs
);
186 * XPath: /frr-bfdd:bfdd/bfd
188 static int bfdd_bfd_create(enum nb_event event
,
189 const struct lyd_node
*dnode
190 __attribute__((__unused__
)),
191 union nb_resource
*resource
192 __attribute__((__unused__
)))
198 static int bfdd_bfd_destroy(enum nb_event event
, const struct lyd_node
*dnode
)
210 bfd_sessions_remove_manual();
222 * XPath: /frr-bfdd:bfdd/bfd/sessions/single-hop
224 static int bfdd_bfd_sessions_single_hop_create(enum nb_event event
,
225 const struct lyd_node
*dnode
,
226 union nb_resource
*resource
)
228 return bfd_session_create(event
, dnode
, resource
, false);
231 static int bfdd_bfd_sessions_single_hop_destroy(enum nb_event event
,
232 const struct lyd_node
*dnode
)
234 return bfd_session_destroy(event
, dnode
, false);
238 bfdd_bfd_sessions_single_hop_get_next(const void *parent_list_entry
239 __attribute__((__unused__
)),
240 const void *list_entry
)
242 return bfd_session_next(list_entry
, false);
245 static int bfdd_bfd_sessions_single_hop_get_keys(const void *list_entry
,
246 struct yang_list_keys
*keys
)
248 const struct bfd_session
*bs
= list_entry
;
249 char dstbuf
[INET6_ADDRSTRLEN
];
251 inet_ntop(bs
->key
.family
, &bs
->key
.peer
, dstbuf
, sizeof(dstbuf
));
254 strlcpy(keys
->key
[0], dstbuf
, sizeof(keys
->key
[0]));
255 strlcpy(keys
->key
[1], bs
->key
.ifname
, sizeof(keys
->key
[1]));
256 strlcpy(keys
->key
[2], bs
->key
.vrfname
, sizeof(keys
->key
[2]));
262 bfdd_bfd_sessions_single_hop_lookup_entry(const void *parent_list_entry
263 __attribute__((__unused__
)),
264 const struct yang_list_keys
*keys
)
266 const char *dest_addr
= keys
->key
[0];
267 const char *ifname
= keys
->key
[1];
268 const char *vrf
= keys
->key
[2];
269 struct sockaddr_any psa
, lsa
;
272 strtosa(dest_addr
, &psa
);
273 memset(&lsa
, 0, sizeof(lsa
));
274 gen_bfd_key(&bk
, &psa
, &lsa
, false, ifname
, vrf
);
276 return bfd_key_lookup(bk
);
280 * XPath: /frr-bfdd:bfdd/bfd/sessions/single-hop/source-addr
282 static int bfdd_bfd_sessions_single_hop_source_addr_modify(
283 enum nb_event event
__attribute__((__unused__
)),
284 const struct lyd_node
*dnode
__attribute__((__unused__
)),
285 union nb_resource
*resource
__attribute__((__unused__
)))
290 static int bfdd_bfd_sessions_single_hop_source_addr_destroy(
291 enum nb_event event
__attribute__((__unused__
)),
292 const struct lyd_node
*dnode
__attribute__((__unused__
)))
298 * XPath: /frr-bfdd:bfdd/bfd/sessions/single-hop/detection-multiplier
300 static int bfdd_bfd_sessions_single_hop_detection_multiplier_modify(
301 enum nb_event event
, const struct lyd_node
*dnode
,
302 union nb_resource
*resource
__attribute__((__unused__
)))
304 uint8_t detection_multiplier
= yang_dnode_get_uint8(dnode
, NULL
);
305 struct bfd_session
*bs
;
316 bs
= nb_running_get_entry(dnode
, NULL
, true);
317 bs
->detect_mult
= detection_multiplier
;
329 * XPath: /frr-bfdd:bfdd/bfd/sessions/single-hop/desired-transmission-interval
331 static int bfdd_bfd_sessions_single_hop_desired_transmission_interval_modify(
332 enum nb_event event
, const struct lyd_node
*dnode
,
333 union nb_resource
*resource
__attribute__((__unused__
)))
335 uint32_t tx_interval
= yang_dnode_get_uint32(dnode
, NULL
);
336 struct bfd_session
*bs
;
340 if (tx_interval
< 10000 || tx_interval
> 60000000)
341 return NB_ERR_VALIDATION
;
349 bs
= nb_running_get_entry(dnode
, NULL
, true);
350 if (tx_interval
== bs
->timers
.desired_min_tx
)
353 bs
->timers
.desired_min_tx
= tx_interval
;
366 * XPath: /frr-bfdd:bfdd/bfd/sessions/single-hop/required-receive-interval
368 static int bfdd_bfd_sessions_single_hop_required_receive_interval_modify(
369 enum nb_event event
, const struct lyd_node
*dnode
,
370 union nb_resource
*resource
__attribute__((__unused__
)))
372 uint32_t rx_interval
= yang_dnode_get_uint32(dnode
, NULL
);
373 struct bfd_session
*bs
;
377 if (rx_interval
< 10000 || rx_interval
> 60000000)
378 return NB_ERR_VALIDATION
;
386 bs
= nb_running_get_entry(dnode
, NULL
, true);
387 if (rx_interval
== bs
->timers
.required_min_rx
)
390 bs
->timers
.required_min_rx
= rx_interval
;
403 * XPath: /frr-bfdd:bfdd/bfd/sessions/single-hop/administrative-down
405 static int bfdd_bfd_sessions_single_hop_administrative_down_modify(
406 enum nb_event event
, const struct lyd_node
*dnode
,
407 union nb_resource
*resource
__attribute__((__unused__
)))
409 bool shutdown
= yang_dnode_get_bool(dnode
, NULL
);
410 struct bfd_session
*bs
;
424 bs
= nb_running_get_entry(dnode
, NULL
, true);
426 if (shutdown
== false) {
427 if (!BFD_CHECK_FLAG(bs
->flags
, BFD_SESS_FLAG_SHUTDOWN
))
430 BFD_UNSET_FLAG(bs
->flags
, BFD_SESS_FLAG_SHUTDOWN
);
432 /* Change and notify state change. */
433 bs
->ses_state
= PTM_BFD_DOWN
;
434 control_notify(bs
, bs
->ses_state
);
436 /* Enable all timers. */
437 bfd_recvtimer_update(bs
);
438 bfd_xmttimer_update(bs
, bs
->xmt_TO
);
439 if (BFD_CHECK_FLAG(bs
->flags
, BFD_SESS_FLAG_ECHO
)) {
440 bfd_echo_recvtimer_update(bs
);
441 bfd_echo_xmttimer_update(bs
, bs
->echo_xmt_TO
);
444 if (BFD_CHECK_FLAG(bs
->flags
, BFD_SESS_FLAG_SHUTDOWN
))
447 BFD_SET_FLAG(bs
->flags
, BFD_SESS_FLAG_SHUTDOWN
);
449 /* Disable all events. */
450 bfd_recvtimer_delete(bs
);
451 bfd_echo_recvtimer_delete(bs
);
452 bfd_xmttimer_delete(bs
);
453 bfd_echo_xmttimer_delete(bs
);
455 /* Change and notify state change. */
456 bs
->ses_state
= PTM_BFD_ADM_DOWN
;
457 control_notify(bs
, bs
->ses_state
);
466 * XPath: /frr-bfdd:bfdd/bfd/sessions/single-hop/echo-mode
468 static int bfdd_bfd_sessions_single_hop_echo_mode_modify(
469 enum nb_event event
, const struct lyd_node
*dnode
,
470 union nb_resource
*resource
__attribute__((__unused__
)))
472 bool echo
= yang_dnode_get_bool(dnode
, NULL
);
473 struct bfd_session
*bs
;
487 bs
= nb_running_get_entry(dnode
, NULL
, true);
490 if (!BFD_CHECK_FLAG(bs
->flags
, BFD_SESS_FLAG_ECHO
))
493 BFD_UNSET_FLAG(bs
->flags
, BFD_SESS_FLAG_ECHO
);
494 ptm_bfd_echo_stop(bs
);
496 if (BFD_CHECK_FLAG(bs
->flags
, BFD_SESS_FLAG_ECHO
))
499 BFD_SET_FLAG(bs
->flags
, BFD_SESS_FLAG_ECHO
);
500 /* Apply setting immediately. */
501 if (!BFD_CHECK_FLAG(bs
->flags
, BFD_SESS_FLAG_SHUTDOWN
))
502 bs_echo_timer_handler(bs
);
510 * /frr-bfdd:bfdd/bfd/sessions/single-hop/desired-echo-transmission-interval
513 bfdd_bfd_sessions_single_hop_desired_echo_transmission_interval_modify(
514 enum nb_event event
, const struct lyd_node
*dnode
,
515 union nb_resource
*resource
__attribute__((__unused__
)))
517 uint32_t echo_interval
= yang_dnode_get_uint32(dnode
, NULL
);
518 struct bfd_session
*bs
;
522 if (echo_interval
< 10000 || echo_interval
> 60000000)
523 return NB_ERR_VALIDATION
;
531 bs
= nb_running_get_entry(dnode
, NULL
, true);
532 if (echo_interval
== bs
->timers
.required_min_echo
)
535 bs
->timers
.required_min_echo
= echo_interval
;
547 * XPath: /frr-bfdd:bfdd/bfd/sessions/single-hop/stats/local-discriminator
549 static struct yang_data
*
550 bfdd_bfd_sessions_single_hop_stats_local_discriminator_get_elem(
551 const char *xpath
, const void *list_entry
)
553 const struct bfd_session
*bs
= list_entry
;
555 return yang_data_new_uint32(xpath
, bs
->discrs
.my_discr
);
559 * XPath: /frr-bfdd:bfdd/bfd/sessions/single-hop/stats/local-state
561 static struct yang_data
*
562 bfdd_bfd_sessions_single_hop_stats_local_state_get_elem(const char *xpath
,
563 const void *list_entry
)
565 const struct bfd_session
*bs
= list_entry
;
567 return yang_data_new_enum(xpath
, bs
->ses_state
);
571 * XPath: /frr-bfdd:bfdd/bfd/sessions/single-hop/stats/local-diagnostic
573 static struct yang_data
*
574 bfdd_bfd_sessions_single_hop_stats_local_diagnostic_get_elem(
575 const char *xpath
, const void *list_entry
)
577 const struct bfd_session
*bs
= list_entry
;
579 return yang_data_new_enum(xpath
, bs
->local_diag
);
583 * XPath: /frr-bfdd:bfdd/bfd/sessions/single-hop/stats/local-multiplier
585 static struct yang_data
*
586 bfdd_bfd_sessions_single_hop_stats_local_multiplier_get_elem(
587 const char *xpath
, const void *list_entry
)
589 const struct bfd_session
*bs
= list_entry
;
591 return yang_data_new_int8(xpath
, bs
->detect_mult
);
595 * XPath: /frr-bfdd:bfdd/bfd/sessions/single-hop/stats/remote-discriminator
597 static struct yang_data
*
598 bfdd_bfd_sessions_single_hop_stats_remote_discriminator_get_elem(
599 const char *xpath
, const void *list_entry
)
601 const struct bfd_session
*bs
= list_entry
;
603 if (bs
->discrs
.remote_discr
== 0)
606 return yang_data_new_uint32(xpath
, bs
->discrs
.remote_discr
);
610 * XPath: /frr-bfdd:bfdd/bfd/sessions/single-hop/stats/remote-state
612 static struct yang_data
*
613 bfdd_bfd_sessions_single_hop_stats_remote_state_get_elem(const char *xpath
,
614 const void *list_entry
)
616 const struct bfd_session
*bs
= list_entry
;
618 return yang_data_new_enum(xpath
, bs
->ses_state
);
622 * XPath: /frr-bfdd:bfdd/bfd/sessions/single-hop/stats/remote-diagnostic
624 static struct yang_data
*
625 bfdd_bfd_sessions_single_hop_stats_remote_diagnostic_get_elem(
626 const char *xpath
, const void *list_entry
)
628 const struct bfd_session
*bs
= list_entry
;
630 return yang_data_new_enum(xpath
, bs
->remote_diag
);
634 * XPath: /frr-bfdd:bfdd/bfd/sessions/single-hop/stats/remote-multiplier
636 static struct yang_data
*
637 bfdd_bfd_sessions_single_hop_stats_remote_multiplier_get_elem(
638 const char *xpath
, const void *list_entry
)
640 const struct bfd_session
*bs
= list_entry
;
642 return yang_data_new_int8(xpath
, bs
->remote_detect_mult
);
647 * /frr-bfdd:bfdd/bfd/sessions/single-hop/stats/negotiated-transmission-interval
649 static struct yang_data
*
650 bfdd_bfd_sessions_single_hop_stats_negotiated_transmission_interval_get_elem(
651 const char *xpath
, const void *list_entry
)
653 const struct bfd_session
*bs
= list_entry
;
655 return yang_data_new_uint32(xpath
, bs
->remote_timers
.desired_min_tx
);
660 * /frr-bfdd:bfdd/bfd/sessions/single-hop/stats/negotiated-receive-interval
662 static struct yang_data
*
663 bfdd_bfd_sessions_single_hop_stats_negotiated_receive_interval_get_elem(
664 const char *xpath
, const void *list_entry
)
666 const struct bfd_session
*bs
= list_entry
;
668 return yang_data_new_uint32(xpath
, bs
->remote_timers
.required_min_rx
);
672 * XPath: /frr-bfdd:bfdd/bfd/sessions/single-hop/stats/detection-mode
674 static struct yang_data
*
675 bfdd_bfd_sessions_single_hop_stats_detection_mode_get_elem(
676 const char *xpath
, const void *list_entry
)
678 const struct bfd_session
*bs
= list_entry
;
684 * 2. Async without echo
685 * 3. Demand with echo
686 * 4. Demand without echo
688 * TODO: support demand mode.
690 if (BFD_CHECK_FLAG(bs
->flags
, BFD_SESS_FLAG_ECHO
))
695 return yang_data_new_enum(xpath
, detection_mode
);
699 * XPath: /frr-bfdd:bfdd/bfd/sessions/single-hop/stats/last-down-time
701 static struct yang_data
*
702 bfdd_bfd_sessions_single_hop_stats_last_down_time_get_elem(
703 const char *xpath
__attribute__((__unused__
)),
704 const void *list_entry
__attribute__((__unused__
)))
707 * TODO: implement me.
709 * No yang support for time elements yet.
715 * XPath: /frr-bfdd:bfdd/bfd/sessions/single-hop/stats/last-up-time
717 static struct yang_data
*
718 bfdd_bfd_sessions_single_hop_stats_last_up_time_get_elem(
719 const char *xpath
__attribute__((__unused__
)),
720 const void *list_entry
__attribute__((__unused__
)))
723 * TODO: implement me.
725 * No yang support for time elements yet.
731 * XPath: /frr-bfdd:bfdd/bfd/sessions/single-hop/stats/session-down-count
733 static struct yang_data
*
734 bfdd_bfd_sessions_single_hop_stats_session_down_count_get_elem(
735 const char *xpath
, const void *list_entry
)
737 const struct bfd_session
*bs
= list_entry
;
739 return yang_data_new_uint64(xpath
, bs
->stats
.session_down
);
743 * XPath: /frr-bfdd:bfdd/bfd/sessions/single-hop/stats/session-up-count
745 static struct yang_data
*
746 bfdd_bfd_sessions_single_hop_stats_session_up_count_get_elem(
747 const char *xpath
, const void *list_entry
)
749 const struct bfd_session
*bs
= list_entry
;
751 return yang_data_new_uint64(xpath
, bs
->stats
.session_up
);
756 * /frr-bfdd:bfdd/bfd/sessions/single-hop/stats/control-packet-input-count
758 static struct yang_data
*
759 bfdd_bfd_sessions_single_hop_stats_control_packet_input_count_get_elem(
760 const char *xpath
, const void *list_entry
)
762 const struct bfd_session
*bs
= list_entry
;
764 return yang_data_new_uint64(xpath
, bs
->stats
.rx_ctrl_pkt
);
769 * /frr-bfdd:bfdd/bfd/sessions/single-hop/stats/control-packet-output-count
771 static struct yang_data
*
772 bfdd_bfd_sessions_single_hop_stats_control_packet_output_count_get_elem(
773 const char *xpath
, const void *list_entry
)
775 const struct bfd_session
*bs
= list_entry
;
777 return yang_data_new_uint64(xpath
, bs
->stats
.tx_ctrl_pkt
);
782 * /frr-bfdd:bfdd/bfd/sessions/single-hop/stats/negotiated-echo-transmission-interval
784 static struct yang_data
*
785 bfdd_bfd_sessions_single_hop_stats_negotiated_echo_transmission_interval_get_elem(
786 const char *xpath
, const void *list_entry
)
788 const struct bfd_session
*bs
= list_entry
;
790 return yang_data_new_uint32(xpath
, bs
->remote_timers
.required_min_echo
);
794 * XPath: /frr-bfdd:bfdd/bfd/sessions/single-hop/stats/echo-packet-input-count
796 static struct yang_data
*
797 bfdd_bfd_sessions_single_hop_stats_echo_packet_input_count_get_elem(
798 const char *xpath
, const void *list_entry
)
800 const struct bfd_session
*bs
= list_entry
;
802 return yang_data_new_uint64(xpath
, bs
->stats
.rx_echo_pkt
);
806 * XPath: /frr-bfdd:bfdd/bfd/sessions/single-hop/stats/echo-packet-output-count
808 static struct yang_data
*
809 bfdd_bfd_sessions_single_hop_stats_echo_packet_output_count_get_elem(
810 const char *xpath
, const void *list_entry
)
812 const struct bfd_session
*bs
= list_entry
;
814 return yang_data_new_uint64(xpath
, bs
->stats
.tx_echo_pkt
);
818 * XPath: /frr-bfdd:bfdd/bfd/sessions/multi-hop
820 static int bfdd_bfd_sessions_multi_hop_create(enum nb_event event
,
821 const struct lyd_node
*dnode
,
822 union nb_resource
*resource
)
824 return bfd_session_create(event
, dnode
, resource
, true);
827 static int bfdd_bfd_sessions_multi_hop_destroy(enum nb_event event
,
828 const struct lyd_node
*dnode
)
830 return bfd_session_destroy(event
, dnode
, true);
834 bfdd_bfd_sessions_multi_hop_get_next(const void *parent_list_entry
835 __attribute__((__unused__
)),
836 const void *list_entry
)
838 return bfd_session_next(list_entry
, true);
841 static int bfdd_bfd_sessions_multi_hop_get_keys(const void *list_entry
,
842 struct yang_list_keys
*keys
)
844 const struct bfd_session
*bs
= list_entry
;
845 char dstbuf
[INET6_ADDRSTRLEN
], srcbuf
[INET6_ADDRSTRLEN
];
847 inet_ntop(bs
->key
.family
, &bs
->key
.peer
, dstbuf
, sizeof(dstbuf
));
848 inet_ntop(bs
->key
.family
, &bs
->key
.local
, srcbuf
, sizeof(srcbuf
));
851 strlcpy(keys
->key
[0], srcbuf
, sizeof(keys
->key
[0]));
852 strlcpy(keys
->key
[1], dstbuf
, sizeof(keys
->key
[1]));
853 strlcpy(keys
->key
[2], bs
->key
.ifname
, sizeof(keys
->key
[2]));
854 strlcpy(keys
->key
[3], bs
->key
.vrfname
, sizeof(keys
->key
[3]));
860 bfdd_bfd_sessions_multi_hop_lookup_entry(const void *parent_list_entry
861 __attribute__((__unused__
)),
862 const struct yang_list_keys
*keys
)
864 const char *source_addr
= keys
->key
[0];
865 const char *dest_addr
= keys
->key
[1];
866 const char *ifname
= keys
->key
[2];
867 const char *vrf
= keys
->key
[3];
868 struct sockaddr_any psa
, lsa
;
871 strtosa(dest_addr
, &psa
);
872 strtosa(source_addr
, &lsa
);
873 gen_bfd_key(&bk
, &psa
, &lsa
, true, ifname
, vrf
);
875 return bfd_key_lookup(bk
);
878 /* clang-format off */
879 const struct frr_yang_module_info frr_bfdd_info
= {
883 .xpath
= "/frr-bfdd:bfdd/bfd",
885 .create
= bfdd_bfd_create
,
886 .destroy
= bfdd_bfd_destroy
,
887 .cli_show
= bfd_cli_show_header
,
888 .cli_show_end
= bfd_cli_show_header_end
,
892 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/single-hop",
894 .create
= bfdd_bfd_sessions_single_hop_create
,
895 .destroy
= bfdd_bfd_sessions_single_hop_destroy
,
896 .get_next
= bfdd_bfd_sessions_single_hop_get_next
,
897 .get_keys
= bfdd_bfd_sessions_single_hop_get_keys
,
898 .lookup_entry
= bfdd_bfd_sessions_single_hop_lookup_entry
,
899 .cli_show
= bfd_cli_show_single_hop_peer
,
900 .cli_show_end
= bfd_cli_show_peer_end
,
904 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/single-hop/source-addr",
906 .modify
= bfdd_bfd_sessions_single_hop_source_addr_modify
,
907 .destroy
= bfdd_bfd_sessions_single_hop_source_addr_destroy
,
911 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/single-hop/detection-multiplier",
913 .modify
= bfdd_bfd_sessions_single_hop_detection_multiplier_modify
,
914 .cli_show
= bfd_cli_show_mult
,
918 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/single-hop/desired-transmission-interval",
920 .modify
= bfdd_bfd_sessions_single_hop_desired_transmission_interval_modify
,
921 .cli_show
= bfd_cli_show_tx
,
925 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/single-hop/required-receive-interval",
927 .modify
= bfdd_bfd_sessions_single_hop_required_receive_interval_modify
,
928 .cli_show
= bfd_cli_show_rx
,
932 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/single-hop/administrative-down",
934 .modify
= bfdd_bfd_sessions_single_hop_administrative_down_modify
,
935 .cli_show
= bfd_cli_show_shutdown
,
939 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/single-hop/echo-mode",
941 .modify
= bfdd_bfd_sessions_single_hop_echo_mode_modify
,
942 .cli_show
= bfd_cli_show_echo
,
946 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/single-hop/desired-echo-transmission-interval",
948 .modify
= bfdd_bfd_sessions_single_hop_desired_echo_transmission_interval_modify
,
949 .cli_show
= bfd_cli_show_echo_interval
,
953 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/single-hop/stats/local-discriminator",
955 .get_elem
= bfdd_bfd_sessions_single_hop_stats_local_discriminator_get_elem
,
959 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/single-hop/stats/local-state",
961 .get_elem
= bfdd_bfd_sessions_single_hop_stats_local_state_get_elem
,
965 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/single-hop/stats/local-diagnostic",
967 .get_elem
= bfdd_bfd_sessions_single_hop_stats_local_diagnostic_get_elem
,
971 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/single-hop/stats/local-multiplier",
973 .get_elem
= bfdd_bfd_sessions_single_hop_stats_local_multiplier_get_elem
,
977 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/single-hop/stats/remote-discriminator",
979 .get_elem
= bfdd_bfd_sessions_single_hop_stats_remote_discriminator_get_elem
,
983 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/single-hop/stats/remote-state",
985 .get_elem
= bfdd_bfd_sessions_single_hop_stats_remote_state_get_elem
,
989 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/single-hop/stats/remote-diagnostic",
991 .get_elem
= bfdd_bfd_sessions_single_hop_stats_remote_diagnostic_get_elem
,
995 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/single-hop/stats/remote-multiplier",
997 .get_elem
= bfdd_bfd_sessions_single_hop_stats_remote_multiplier_get_elem
,
1001 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/single-hop/stats/negotiated-transmission-interval",
1003 .get_elem
= bfdd_bfd_sessions_single_hop_stats_negotiated_transmission_interval_get_elem
,
1007 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/single-hop/stats/negotiated-receive-interval",
1009 .get_elem
= bfdd_bfd_sessions_single_hop_stats_negotiated_receive_interval_get_elem
,
1013 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/single-hop/stats/detection-mode",
1015 .get_elem
= bfdd_bfd_sessions_single_hop_stats_detection_mode_get_elem
,
1019 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/single-hop/stats/last-down-time",
1021 .get_elem
= bfdd_bfd_sessions_single_hop_stats_last_down_time_get_elem
,
1025 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/single-hop/stats/last-up-time",
1027 .get_elem
= bfdd_bfd_sessions_single_hop_stats_last_up_time_get_elem
,
1031 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/single-hop/stats/session-down-count",
1033 .get_elem
= bfdd_bfd_sessions_single_hop_stats_session_down_count_get_elem
,
1037 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/single-hop/stats/session-up-count",
1039 .get_elem
= bfdd_bfd_sessions_single_hop_stats_session_up_count_get_elem
,
1043 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/single-hop/stats/control-packet-input-count",
1045 .get_elem
= bfdd_bfd_sessions_single_hop_stats_control_packet_input_count_get_elem
,
1049 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/single-hop/stats/control-packet-output-count",
1051 .get_elem
= bfdd_bfd_sessions_single_hop_stats_control_packet_output_count_get_elem
,
1055 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/single-hop/stats/negotiated-echo-transmission-interval",
1057 .get_elem
= bfdd_bfd_sessions_single_hop_stats_negotiated_echo_transmission_interval_get_elem
,
1061 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/single-hop/stats/echo-packet-input-count",
1063 .get_elem
= bfdd_bfd_sessions_single_hop_stats_echo_packet_input_count_get_elem
,
1067 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/single-hop/stats/echo-packet-output-count",
1069 .get_elem
= bfdd_bfd_sessions_single_hop_stats_echo_packet_output_count_get_elem
,
1073 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/multi-hop",
1075 .create
= bfdd_bfd_sessions_multi_hop_create
,
1076 .destroy
= bfdd_bfd_sessions_multi_hop_destroy
,
1077 .get_next
= bfdd_bfd_sessions_multi_hop_get_next
,
1078 .get_keys
= bfdd_bfd_sessions_multi_hop_get_keys
,
1079 .lookup_entry
= bfdd_bfd_sessions_multi_hop_lookup_entry
,
1080 .cli_show
= bfd_cli_show_multi_hop_peer
,
1081 .cli_show_end
= bfd_cli_show_peer_end
,
1085 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/multi-hop/detection-multiplier",
1087 .modify
= bfdd_bfd_sessions_single_hop_detection_multiplier_modify
,
1088 .cli_show
= bfd_cli_show_mult
,
1092 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/multi-hop/desired-transmission-interval",
1094 .modify
= bfdd_bfd_sessions_single_hop_desired_transmission_interval_modify
,
1095 .cli_show
= bfd_cli_show_tx
,
1099 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/multi-hop/required-receive-interval",
1101 .modify
= bfdd_bfd_sessions_single_hop_required_receive_interval_modify
,
1102 .cli_show
= bfd_cli_show_rx
,
1106 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/multi-hop/administrative-down",
1108 .modify
= bfdd_bfd_sessions_single_hop_administrative_down_modify
,
1109 .cli_show
= bfd_cli_show_shutdown
,
1113 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/multi-hop/stats/local-discriminator",
1115 .get_elem
= bfdd_bfd_sessions_single_hop_stats_local_discriminator_get_elem
,
1119 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/multi-hop/stats/local-state",
1121 .get_elem
= bfdd_bfd_sessions_single_hop_stats_local_state_get_elem
,
1125 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/multi-hop/stats/local-diagnostic",
1127 .get_elem
= bfdd_bfd_sessions_single_hop_stats_local_diagnostic_get_elem
,
1131 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/multi-hop/stats/local-multiplier",
1133 .get_elem
= bfdd_bfd_sessions_single_hop_stats_local_multiplier_get_elem
,
1137 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/multi-hop/stats/remote-discriminator",
1139 .get_elem
= bfdd_bfd_sessions_single_hop_stats_remote_discriminator_get_elem
,
1143 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/multi-hop/stats/remote-state",
1145 .get_elem
= bfdd_bfd_sessions_single_hop_stats_remote_state_get_elem
,
1149 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/multi-hop/stats/remote-diagnostic",
1151 .get_elem
= bfdd_bfd_sessions_single_hop_stats_remote_diagnostic_get_elem
,
1155 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/multi-hop/stats/remote-multiplier",
1157 .get_elem
= bfdd_bfd_sessions_single_hop_stats_remote_multiplier_get_elem
,
1161 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/multi-hop/stats/negotiated-transmission-interval",
1163 .get_elem
= bfdd_bfd_sessions_single_hop_stats_negotiated_transmission_interval_get_elem
,
1167 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/multi-hop/stats/negotiated-receive-interval",
1169 .get_elem
= bfdd_bfd_sessions_single_hop_stats_negotiated_receive_interval_get_elem
,
1173 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/multi-hop/stats/detection-mode",
1175 .get_elem
= bfdd_bfd_sessions_single_hop_stats_detection_mode_get_elem
,
1179 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/multi-hop/stats/last-down-time",
1181 .get_elem
= bfdd_bfd_sessions_single_hop_stats_last_down_time_get_elem
,
1185 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/multi-hop/stats/last-up-time",
1187 .get_elem
= bfdd_bfd_sessions_single_hop_stats_last_up_time_get_elem
,
1191 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/multi-hop/stats/session-down-count",
1193 .get_elem
= bfdd_bfd_sessions_single_hop_stats_session_down_count_get_elem
,
1197 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/multi-hop/stats/session-up-count",
1199 .get_elem
= bfdd_bfd_sessions_single_hop_stats_session_up_count_get_elem
,
1203 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/multi-hop/stats/control-packet-input-count",
1205 .get_elem
= bfdd_bfd_sessions_single_hop_stats_control_packet_input_count_get_elem
,
1209 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/multi-hop/stats/control-packet-output-count",
1211 .get_elem
= bfdd_bfd_sessions_single_hop_stats_control_packet_output_count_get_elem
,
1215 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/multi-hop/stats/negotiated-echo-transmission-interval",
1217 .get_elem
= bfdd_bfd_sessions_single_hop_stats_negotiated_echo_transmission_interval_get_elem
,
1221 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/multi-hop/stats/echo-packet-input-count",
1223 .get_elem
= bfdd_bfd_sessions_single_hop_stats_echo_packet_input_count_get_elem
,
1227 .xpath
= "/frr-bfdd:bfdd/bfd/sessions/multi-hop/stats/echo-packet-output-count",
1229 .get_elem
= bfdd_bfd_sessions_single_hop_stats_echo_packet_output_count_get_elem
,