2 * Copyright (C) 2018 NetDEF, Inc.
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)
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
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
23 #include "lib_errors.h"
28 #include "northbound.h"
31 #include <sysrepo/values.h>
32 #include <sysrepo/xpath.h>
34 DEFINE_MTYPE_STATIC(LIB
, SYSREPO
, "Sysrepo module")
36 static struct thread_master
*master
;
37 static struct list
*sysrepo_threads
;
38 static sr_session_ctx_t
*session
;
39 static sr_conn_ctx_t
*connection
;
40 static struct nb_transaction
*transaction
;
42 static int frr_sr_read_cb(struct thread
*thread
);
43 static int frr_sr_write_cb(struct thread
*thread
);
44 static int frr_sr_finish(void);
46 /* Convert FRR YANG data value to sysrepo YANG data value. */
47 static int yang_data_frr2sr(struct yang_data
*frr_data
, sr_val_t
*sr_data
)
49 struct nb_node
*nb_node
;
50 const struct lys_node
*snode
;
51 struct lys_node_container
*scontainer
;
52 struct lys_node_leaf
*sleaf
;
53 struct lys_node_leaflist
*sleaflist
;
56 sr_val_set_xpath(sr_data
, frr_data
->xpath
);
58 nb_node
= nb_node_find(frr_data
->xpath
);
60 flog_warn(EC_LIB_YANG_UNKNOWN_DATA_PATH
,
61 "%s: unknown data path: %s", __func__
,
66 snode
= nb_node
->snode
;
67 switch (snode
->nodetype
) {
69 scontainer
= (struct lys_node_container
*)snode
;
70 if (!scontainer
->presence
)
72 sr_data
->type
= SR_CONTAINER_PRESENCE_T
;
75 sr_data
->type
= SR_LIST_T
;
78 sleaf
= (struct lys_node_leaf
*)snode
;
79 type
= sleaf
->type
.base
;
82 sleaflist
= (struct lys_node_leaflist
*)snode
;
83 type
= sleaflist
->type
.base
;
91 sr_val_set_str_data(sr_data
, SR_BINARY_T
, frr_data
->value
);
94 sr_val_set_str_data(sr_data
, SR_BITS_T
, frr_data
->value
);
97 sr_data
->type
= SR_BOOL_T
;
98 sr_data
->data
.bool_val
= yang_str2bool(frr_data
->value
);
101 sr_data
->type
= SR_DECIMAL64_T
;
102 sr_data
->data
.decimal64_val
=
103 yang_str2dec64(frr_data
->xpath
, frr_data
->value
);
106 sr_data
->type
= SR_LEAF_EMPTY_T
;
109 sr_val_set_str_data(sr_data
, SR_ENUM_T
, frr_data
->value
);
112 sr_val_set_str_data(sr_data
, SR_IDENTITYREF_T
, frr_data
->value
);
115 sr_val_set_str_data(sr_data
, SR_INSTANCEID_T
, frr_data
->value
);
118 sr_data
->type
= SR_INT8_T
;
119 sr_data
->data
.int8_val
= yang_str2int8(frr_data
->value
);
122 sr_data
->type
= SR_INT16_T
;
123 sr_data
->data
.int16_val
= yang_str2int16(frr_data
->value
);
126 sr_data
->type
= SR_INT32_T
;
127 sr_data
->data
.int32_val
= yang_str2int32(frr_data
->value
);
130 sr_data
->type
= SR_INT64_T
;
131 sr_data
->data
.int64_val
= yang_str2int64(frr_data
->value
);
134 sr_val_set_str_data(sr_data
, SR_STRING_T
, frr_data
->value
);
137 sr_data
->type
= SR_UINT8_T
;
138 sr_data
->data
.uint8_val
= yang_str2uint8(frr_data
->value
);
141 sr_data
->type
= SR_UINT16_T
;
142 sr_data
->data
.uint16_val
= yang_str2uint16(frr_data
->value
);
145 sr_data
->type
= SR_UINT32_T
;
146 sr_data
->data
.uint32_val
= yang_str2uint32(frr_data
->value
);
149 sr_data
->type
= SR_UINT64_T
;
150 sr_data
->data
.uint64_val
= yang_str2uint64(frr_data
->value
);
159 static int frr_sr_process_change(struct nb_config
*candidate
,
160 sr_change_oper_t sr_op
, sr_val_t
*sr_old_val
,
161 sr_val_t
*sr_new_val
)
163 struct nb_node
*nb_node
;
164 enum nb_operation nb_op
;
167 char value_str
[YANG_VALUE_MAXLEN
];
168 struct yang_data
*data
;
171 sr_data
= sr_new_val
? sr_new_val
: sr_old_val
;
174 xpath
= sr_data
->xpath
;
176 /* Non-presence container - nothing to do. */
177 if (sr_data
->type
== SR_CONTAINER_T
)
180 nb_node
= nb_node_find(xpath
);
182 flog_warn(EC_LIB_YANG_UNKNOWN_DATA_PATH
,
183 "%s: unknown data path: %s", __func__
, xpath
);
187 /* Map operation values. */
191 if (nb_operation_is_valid(NB_OP_CREATE
, nb_node
->snode
))
192 nb_op
= NB_OP_CREATE
;
193 else if (nb_operation_is_valid(NB_OP_MODIFY
, nb_node
->snode
)) {
194 nb_op
= NB_OP_MODIFY
;
196 /* Ignore list keys modifications. */
201 * When a list is deleted or one of its keys is changed, we are
202 * notified about the removal of all of its leafs, even the ones
203 * that are non-optional. We need to ignore these notifications.
205 if (!nb_operation_is_valid(NB_OP_DELETE
, nb_node
->snode
))
208 nb_op
= NB_OP_DELETE
;
214 flog_err(EC_LIB_DEVELOPMENT
,
215 "%s: unexpected operation %u [xpath %s]", __func__
,
220 sr_val_to_buff(sr_data
, value_str
, sizeof(value_str
));
221 data
= yang_data_new(xpath
, value_str
);
223 ret
= nb_candidate_edit(candidate
, nb_node
, nb_op
, xpath
, NULL
, data
);
224 yang_data_free(data
);
227 EC_LIB_NB_CANDIDATE_EDIT_ERROR
,
228 "%s: failed to edit candidate configuration: operation [%s] xpath [%s]",
229 __func__
, nb_operation_name(nb_op
), xpath
);
236 static int frr_sr_config_change_cb_verify(sr_session_ctx_t
*session
,
237 const char *module_name
,
240 sr_change_iter_t
*it
;
242 sr_change_oper_t sr_op
;
243 sr_val_t
*sr_old_val
, *sr_new_val
;
244 char xpath
[XPATH_MAXLEN
];
245 struct nb_config
*candidate
;
247 snprintf(xpath
, sizeof(xpath
), "/%s:*", module_name
);
248 ret
= sr_get_changes_iter(session
, xpath
, &it
);
249 if (ret
!= SR_ERR_OK
) {
250 flog_err(EC_LIB_LIBSYSREPO
,
251 "%s: sr_get_changes_iter() failed for xpath %s",
256 candidate
= nb_config_dup(running_config
);
258 while ((ret
= sr_get_change_next(session
, it
, &sr_op
, &sr_old_val
,
261 ret
= frr_sr_process_change(candidate
, sr_op
, sr_old_val
,
263 sr_free_val(sr_old_val
);
264 sr_free_val(sr_new_val
);
269 sr_free_change_iter(it
);
270 if (ret
!= NB_OK
&& ret
!= SR_ERR_NOT_FOUND
) {
271 nb_config_free(candidate
);
272 return SR_ERR_INTERNAL
;
276 if (startup_config
) {
278 * sysrepod sends the entire startup configuration using a
279 * single event (SR_EV_ENABLED). This means we need to perform
280 * the full two-phase commit protocol in one go here.
282 ret
= nb_candidate_commit(candidate
, NB_CLIENT_SYSREPO
, true,
286 * Validate the configuration changes and allocate all resources
287 * required to apply them.
289 ret
= nb_candidate_commit_prepare(candidate
, NB_CLIENT_SYSREPO
,
293 /* Map northbound return code to sysrepo return code. */
297 case NB_ERR_NO_CHANGES
:
298 nb_config_free(candidate
);
301 return SR_ERR_LOCKED
;
302 case NB_ERR_RESOURCE
:
305 return SR_ERR_VALIDATION_FAILED
;
309 static int frr_sr_config_change_cb_apply(sr_session_ctx_t
*session
,
310 const char *module_name
)
312 /* Apply the transaction. */
314 struct nb_config
*candidate
= transaction
->config
;
316 nb_candidate_commit_apply(transaction
, true, NULL
);
317 nb_config_free(candidate
);
323 static int frr_sr_config_change_cb_abort(sr_session_ctx_t
*session
,
324 const char *module_name
)
326 /* Abort the transaction. */
328 struct nb_config
*candidate
= transaction
->config
;
330 nb_candidate_commit_abort(transaction
);
331 nb_config_free(candidate
);
337 /* Callback for changes in the running configuration. */
338 static int frr_sr_config_change_cb(sr_session_ctx_t
*session
,
339 const char *module_name
,
340 sr_notif_event_t sr_ev
, void *private_ctx
)
344 return frr_sr_config_change_cb_verify(session
, module_name
,
347 return frr_sr_config_change_cb_verify(session
, module_name
,
350 return frr_sr_config_change_cb_apply(session
, module_name
);
352 return frr_sr_config_change_cb_abort(session
, module_name
);
354 flog_err(EC_LIB_LIBSYSREPO
, "%s: unknown sysrepo event: %u",
356 return SR_ERR_INTERNAL
;
360 static int frr_sr_state_data_iter_cb(const struct lys_node
*snode
,
361 struct yang_translator
*translator
,
362 struct yang_data
*data
, void *arg
)
364 struct list
*elements
= arg
;
366 listnode_add(elements
, data
);
371 /* Callback for state retrieval. */
372 static int frr_sr_state_cb(const char *xpath
, sr_val_t
**values
,
373 size_t *values_cnt
, uint64_t request_id
,
376 struct list
*elements
;
377 struct yang_data
*data
;
378 struct listnode
*node
;
380 int ret
, count
, i
= 0;
382 elements
= yang_data_list_new();
383 if (nb_oper_data_iterate(xpath
, NULL
, NB_OPER_DATA_ITER_NORECURSE
,
384 frr_sr_state_data_iter_cb
, elements
)
386 flog_warn(EC_LIB_NB_OPERATIONAL_DATA
,
387 "%s: failed to obtain operational data [xpath %s]",
392 if (list_isempty(elements
))
395 count
= listcount(elements
);
396 ret
= sr_new_values(count
, &v
);
397 if (ret
!= SR_ERR_OK
) {
398 flog_err(EC_LIB_LIBSYSREPO
, "%s: sr_new_values(): %s", __func__
,
403 for (ALL_LIST_ELEMENTS_RO(elements
, node
, data
)) {
404 if (yang_data_frr2sr(data
, &v
[i
++]) != 0) {
405 flog_err(EC_LIB_SYSREPO_DATA_CONVERT
,
406 "%s: failed to convert data to sysrepo format",
414 list_delete(&elements
);
419 list_delete(&elements
);
426 static int frr_sr_config_rpc_cb(const char *xpath
, const sr_val_t
*sr_input
,
427 const size_t input_cnt
, sr_val_t
**sr_output
,
428 size_t *sr_output_cnt
, void *private_ctx
)
430 struct nb_node
*nb_node
;
433 struct yang_data
*data
;
434 size_t cb_output_cnt
;
437 nb_node
= nb_node_find(xpath
);
439 flog_warn(EC_LIB_YANG_UNKNOWN_DATA_PATH
,
440 "%s: unknown data path: %s", __func__
, xpath
);
441 return SR_ERR_INTERNAL
;
444 input
= yang_data_list_new();
445 output
= yang_data_list_new();
448 for (size_t i
= 0; i
< input_cnt
; i
++) {
449 char value_str
[YANG_VALUE_MAXLEN
];
451 sr_val_to_buff(&sr_input
[i
], value_str
, sizeof(value_str
));
453 data
= yang_data_new(xpath
, value_str
);
454 listnode_add(input
, data
);
457 /* Execute callback registered for this XPath. */
458 if (nb_node
->cbs
.rpc(xpath
, input
, output
) != NB_OK
) {
459 flog_warn(EC_LIB_NB_CB_RPC
, "%s: rpc callback failed: %s",
461 ret
= SR_ERR_OPERATION_FAILED
;
465 /* Process output. */
466 if (listcount(output
) > 0) {
467 sr_val_t
*values
= NULL
;
468 struct listnode
*node
;
471 cb_output_cnt
= listcount(output
);
472 ret
= sr_new_values(cb_output_cnt
, &values
);
473 if (ret
!= SR_ERR_OK
) {
474 flog_err(EC_LIB_LIBSYSREPO
, "%s: sr_new_values(): %s",
475 __func__
, sr_strerror(ret
));
479 for (ALL_LIST_ELEMENTS_RO(output
, node
, data
)) {
480 if (yang_data_frr2sr(data
, &values
[i
++]) != 0) {
482 EC_LIB_SYSREPO_DATA_CONVERT
,
483 "%s: failed to convert data to Sysrepo format",
485 ret
= SR_ERR_INTERNAL
;
486 sr_free_values(values
, cb_output_cnt
);
492 *sr_output_cnt
= cb_output_cnt
;
496 /* Release memory. */
498 list_delete(&output
);
503 static int frr_sr_notification_send(const char *xpath
, struct list
*arguments
)
505 sr_val_t
*values
= NULL
;
506 size_t values_cnt
= 0;
509 if (arguments
&& listcount(arguments
) > 0) {
510 struct yang_data
*data
;
511 struct listnode
*node
;
514 values_cnt
= listcount(arguments
);
515 ret
= sr_new_values(values_cnt
, &values
);
516 if (ret
!= SR_ERR_OK
) {
517 flog_err(EC_LIB_LIBSYSREPO
, "%s: sr_new_values(): %s",
518 __func__
, sr_strerror(ret
));
522 for (ALL_LIST_ELEMENTS_RO(arguments
, node
, data
)) {
523 if (yang_data_frr2sr(data
, &values
[i
++]) != 0) {
525 EC_LIB_SYSREPO_DATA_CONVERT
,
526 "%s: failed to convert data to sysrepo format",
528 sr_free_values(values
, values_cnt
);
534 ret
= sr_event_notif_send(session
, xpath
, values
, values_cnt
,
535 SR_EV_NOTIF_DEFAULT
);
536 if (ret
!= SR_ERR_OK
) {
537 flog_err(EC_LIB_LIBSYSREPO
,
538 "%s: sr_event_notif_send() failed for xpath %s",
546 /* Code to integrate the sysrepo client into FRR main event loop. */
547 struct sysrepo_thread
{
548 struct thread
*thread
;
553 static struct sysrepo_thread
*frr_sr_fd_lookup(sr_fd_event_t event
, int fd
)
555 struct sysrepo_thread
*sr_thread
;
556 struct listnode
*node
;
558 for (ALL_LIST_ELEMENTS_RO(sysrepo_threads
, node
, sr_thread
)) {
559 if (sr_thread
->event
== event
&& sr_thread
->fd
== fd
)
566 static void frr_sr_fd_add(int event
, int fd
)
568 struct sysrepo_thread
*sr_thread
;
570 if (frr_sr_fd_lookup(event
, fd
) != NULL
)
573 sr_thread
= XCALLOC(MTYPE_SYSREPO
, sizeof(*sr_thread
));
574 sr_thread
->event
= event
;
576 listnode_add(sysrepo_threads
, sr_thread
);
579 case SR_FD_INPUT_READY
:
580 thread_add_read(master
, frr_sr_read_cb
, NULL
, fd
,
583 case SR_FD_OUTPUT_READY
:
584 thread_add_write(master
, frr_sr_write_cb
, NULL
, fd
,
592 static void frr_sr_fd_free(struct sysrepo_thread
*sr_thread
)
594 THREAD_OFF(sr_thread
->thread
);
595 XFREE(MTYPE_SYSREPO
, sr_thread
);
598 static void frr_sr_fd_del(int event
, int fd
)
600 struct sysrepo_thread
*sr_thread
;
602 sr_thread
= frr_sr_fd_lookup(event
, fd
);
606 listnode_delete(sysrepo_threads
, sr_thread
);
607 frr_sr_fd_free(sr_thread
);
610 static void frr_sr_fd_update(sr_fd_change_t
*fd_change_set
,
611 size_t fd_change_set_cnt
)
613 for (size_t i
= 0; i
< fd_change_set_cnt
; i
++) {
614 int fd
= fd_change_set
[i
].fd
;
615 int event
= fd_change_set
[i
].events
;
617 if (event
!= SR_FD_INPUT_READY
&& event
!= SR_FD_OUTPUT_READY
)
620 switch (fd_change_set
[i
].action
) {
621 case SR_FD_START_WATCHING
:
622 frr_sr_fd_add(event
, fd
);
624 case SR_FD_STOP_WATCHING
:
625 frr_sr_fd_del(event
, fd
);
633 static int frr_sr_read_cb(struct thread
*thread
)
635 int fd
= THREAD_FD(thread
);
636 sr_fd_change_t
*fd_change_set
= NULL
;
637 size_t fd_change_set_cnt
= 0;
640 ret
= sr_fd_event_process(fd
, SR_FD_INPUT_READY
, &fd_change_set
,
642 if (ret
!= SR_ERR_OK
) {
643 flog_err(EC_LIB_LIBSYSREPO
, "%s: sr_fd_event_process(): %s",
644 __func__
, sr_strerror(ret
));
649 thread_add_read(master
, frr_sr_read_cb
, NULL
, fd
, &thread
);
651 frr_sr_fd_update(fd_change_set
, fd_change_set_cnt
);
657 static int frr_sr_write_cb(struct thread
*thread
)
659 int fd
= THREAD_FD(thread
);
660 sr_fd_change_t
*fd_change_set
= NULL
;
661 size_t fd_change_set_cnt
= 0;
664 ret
= sr_fd_event_process(fd
, SR_FD_OUTPUT_READY
, &fd_change_set
,
666 if (ret
!= SR_ERR_OK
) {
667 flog_err(EC_LIB_LIBSYSREPO
, "%s: sr_fd_event_process(): %s",
668 __func__
, sr_strerror(ret
));
672 frr_sr_fd_update(fd_change_set
, fd_change_set_cnt
);
678 static void frr_sr_subscribe_config(struct yang_module
*module
)
682 ret
= sr_module_change_subscribe(
683 session
, module
->name
, frr_sr_config_change_cb
, NULL
, 0,
684 SR_SUBSCR_DEFAULT
| SR_SUBSCR_EV_ENABLED
,
685 &module
->sr_subscription
);
686 if (ret
!= SR_ERR_OK
)
687 flog_err(EC_LIB_LIBSYSREPO
, "sr_module_change_subscribe(): %s",
691 static int frr_sr_subscribe_state(const struct lys_node
*snode
, void *arg
)
693 struct yang_module
*module
= arg
;
694 struct nb_node
*nb_node
;
697 if (!CHECK_FLAG(snode
->flags
, LYS_CONFIG_R
))
698 return YANG_ITER_CONTINUE
;
699 /* We only need to subscribe to the root of the state subtrees. */
700 if (snode
->parent
&& CHECK_FLAG(snode
->parent
->flags
, LYS_CONFIG_R
))
701 return YANG_ITER_CONTINUE
;
703 nb_node
= snode
->priv
;
704 if (debug_northbound
)
705 zlog_debug("%s: providing data to '%s'", __func__
,
708 ret
= sr_dp_get_items_subscribe(
709 session
, nb_node
->xpath
, frr_sr_state_cb
, NULL
,
710 SR_SUBSCR_CTX_REUSE
, &module
->sr_subscription
);
711 if (ret
!= SR_ERR_OK
)
712 flog_err(EC_LIB_LIBSYSREPO
, "sr_dp_get_items_subscribe(): %s",
715 return YANG_ITER_CONTINUE
;
718 static int frr_sr_subscribe_rpc(const struct lys_node
*snode
, void *arg
)
720 struct yang_module
*module
= arg
;
721 struct nb_node
*nb_node
;
724 if (snode
->nodetype
!= LYS_RPC
)
725 return YANG_ITER_CONTINUE
;
727 nb_node
= snode
->priv
;
728 if (debug_northbound
)
729 zlog_debug("%s: providing RPC to '%s'", __func__
,
732 ret
= sr_rpc_subscribe(session
, nb_node
->xpath
, frr_sr_config_rpc_cb
,
733 NULL
, SR_SUBSCR_CTX_REUSE
,
734 &module
->sr_subscription
);
735 if (ret
!= SR_ERR_OK
)
736 flog_err(EC_LIB_LIBSYSREPO
, "sr_rpc_subscribe(): %s",
739 return YANG_ITER_CONTINUE
;
742 static int frr_sr_subscribe_action(const struct lys_node
*snode
, void *arg
)
744 struct yang_module
*module
= arg
;
745 struct nb_node
*nb_node
;
748 if (snode
->nodetype
!= LYS_ACTION
)
749 return YANG_ITER_CONTINUE
;
751 nb_node
= snode
->priv
;
752 if (debug_northbound
)
753 zlog_debug("%s: providing action to '%s'", __func__
,
756 ret
= sr_action_subscribe(session
, nb_node
->xpath
, frr_sr_config_rpc_cb
,
757 NULL
, SR_SUBSCR_CTX_REUSE
,
758 &module
->sr_subscription
);
759 if (ret
!= SR_ERR_OK
)
760 flog_err(EC_LIB_LIBSYSREPO
, "sr_action_subscribe(): %s",
763 return YANG_ITER_CONTINUE
;
766 /* FRR's Sysrepo initialization. */
767 static int frr_sr_init(const char *program_name
)
769 struct yang_module
*module
;
772 sysrepo_threads
= list_new();
774 ret
= sr_fd_watcher_init(&sysrepo_fd
, NULL
);
775 if (ret
!= SR_ERR_OK
) {
776 flog_err(EC_LIB_SYSREPO_INIT
, "%s: sr_fd_watcher_init(): %s",
777 __func__
, sr_strerror(ret
));
781 /* Connect to Sysrepo. */
782 ret
= sr_connect(program_name
, SR_CONN_DEFAULT
, &connection
);
783 if (ret
!= SR_ERR_OK
) {
784 flog_err(EC_LIB_SYSREPO_INIT
, "%s: sr_connect(): %s", __func__
,
790 ret
= sr_session_start(connection
, SR_DS_RUNNING
, SR_SESS_DEFAULT
,
792 if (ret
!= SR_ERR_OK
) {
793 flog_err(EC_LIB_SYSREPO_INIT
, "%s: sr_session_start(): %s",
794 __func__
, sr_strerror(ret
));
798 /* Perform subscriptions. */
799 RB_FOREACH (module
, yang_modules
, &yang_modules
) {
800 frr_sr_subscribe_config(module
);
801 yang_snodes_iterate_module(module
->info
, frr_sr_subscribe_state
,
803 yang_snodes_iterate_module(module
->info
, frr_sr_subscribe_rpc
,
805 yang_snodes_iterate_module(module
->info
,
806 frr_sr_subscribe_action
, 0, module
);
809 hook_register(nb_notification_send
, frr_sr_notification_send
);
811 frr_sr_fd_add(SR_FD_INPUT_READY
, sysrepo_fd
);
821 static int frr_sr_finish(void)
823 struct yang_module
*module
;
825 RB_FOREACH (module
, yang_modules
, &yang_modules
) {
826 if (!module
->sr_subscription
)
828 sr_unsubscribe(session
, module
->sr_subscription
);
832 sr_session_stop(session
);
834 sr_disconnect(connection
);
836 sysrepo_threads
->del
= (void (*)(void *))frr_sr_fd_free
;
837 list_delete(&sysrepo_threads
);
838 sr_fd_watcher_cleanup();
843 static int frr_sr_module_late_init(struct thread_master
*tm
)
847 if (frr_sr_init(frr_get_progname()) < 0) {
848 flog_err(EC_LIB_SYSREPO_INIT
,
849 "failed to initialize the Sysrepo module");
853 hook_register(frr_fini
, frr_sr_finish
);
858 static int frr_sr_module_init(void)
860 hook_register(frr_late_init
, frr_sr_module_late_init
);
865 FRR_MODULE_SETUP(.name
= "frr_sysrepo", .version
= FRR_VERSION
,
866 .description
= "FRR sysrepo integration module",
867 .init
= frr_sr_module_init
, )