]> git.proxmox.com Git - mirror_frr.git/blobdiff - lib/northbound.h
Merge pull request #12816 from gpnaveen/stc_rte_err_msg
[mirror_frr.git] / lib / northbound.h
index 7ccab5cad5e5e3ce9d6099fdf966f34fc540f651..152810b3a98221db90a2b10eb0a530fad06d876d 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2018  NetDEF, Inc.
  *                     Renato Westphal
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _FRR_NORTHBOUND_H_
@@ -488,7 +475,8 @@ struct nb_callbacks {
         *    >0 when the CLI command for the dnode2 should be printed first
         *     0 when there is no difference
         */
-       int (*cli_cmp)(struct lyd_node *dnode1, struct lyd_node *dnode2);
+       int (*cli_cmp)(const struct lyd_node *dnode1,
+                      const struct lyd_node *dnode2);
 
        /*
         * Optional callback to show the CLI command associated to the given
@@ -510,7 +498,7 @@ struct nb_callbacks {
         *    nodes, in which case it might be desirable to hide one or more
         *    parts of the command when this parameter is set to false.
         */
-       void (*cli_show)(struct vty *vty, struct lyd_node *dnode,
+       void (*cli_show)(struct vty *vty, const struct lyd_node *dnode,
                         bool show_defaults);
 
        /*
@@ -523,7 +511,7 @@ struct nb_callbacks {
         *    libyang data node that should be shown in the form of a CLI
         *    command.
         */
-       void (*cli_show_end)(struct vty *vty, struct lyd_node *dnode);
+       void (*cli_show_end)(struct vty *vty, const struct lyd_node *dnode);
 };
 
 struct nb_dependency_callbacks {
@@ -634,22 +622,6 @@ struct nb_context {
 
        /* Northbound user (can be NULL). */
        const void *user;
-
-       /* Client-specific data. */
-#if 0
-       union {
-               struct {
-               } cli;
-               struct {
-               } confd;
-               struct {
-               } sysrepo;
-               struct {
-               } grpc;
-               struct {
-               } pcep;
-       } client_data;
-#endif
 };
 
 /* Northbound configuration. */
@@ -678,7 +650,7 @@ struct nb_config_change {
 
 /* Northbound configuration transaction. */
 struct nb_transaction {
-       struct nb_context *context;
+       struct nb_context context;
        char comment[80];
        struct nb_config *config;
        struct nb_config_cbs changes;
@@ -704,6 +676,7 @@ extern struct debug nb_dbg_cbs_state;
 extern struct debug nb_dbg_cbs_rpc;
 extern struct debug nb_dbg_notif;
 extern struct debug nb_dbg_events;
+extern struct debug nb_dbg_libyang;
 
 /* Global running configuration. */
 extern struct nb_config *running_config;
@@ -938,7 +911,7 @@ extern int nb_candidate_validate(struct nb_context *context,
  *      the candidate configuration.
  *    - NB_ERR for other errors.
  */
-extern int nb_candidate_commit_prepare(struct nb_context *context,
+extern int nb_candidate_commit_prepare(struct nb_context context,
                                       struct nb_config *candidate,
                                       const char *comment,
                                       struct nb_transaction **transaction,
@@ -1025,7 +998,7 @@ extern void nb_candidate_commit_apply(struct nb_transaction *transaction,
  *      the candidate configuration.
  *    - NB_ERR for other errors.
  */
-extern int nb_candidate_commit(struct nb_context *context,
+extern int nb_candidate_commit(struct nb_context context,
                               struct nb_config *candidate,
                               bool save_transaction, const char *comment,
                               uint32_t *transaction_id, char *errmsg,