2 * Zebra dataplane layer api interfaces.
3 * Copyright (c) 2018 Volta Networks, Inc.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
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
20 #ifndef _ZEBRA_DPLANE_H
21 #define _ZEBRA_DPLANE_H 1
27 #include "nexthop_group.h"
31 * API between the zebra dataplane system and the main zebra processing
35 /* Key netlink info from zebra ns */
36 struct zebra_dplane_info
{
39 #if defined(HAVE_NETLINK)
45 /* Utility to fill in zns info from main zns struct */
47 zebra_dplane_info_from_zns(struct zebra_dplane_info
*zns_info
,
48 const struct zebra_ns
*zns
, bool is_cmd
)
50 zns_info
->ns_id
= zns
->ns_id
;
52 #if defined(HAVE_NETLINK)
53 zns_info
->is_cmd
= is_cmd
;
55 zns_info
->nl_pid
= zns
->netlink_cmd
.snl
.nl_pid
;
57 zns_info
->nl_pid
= zns
->netlink
.snl
.nl_pid
;
63 * Enqueue a route install or update for the dataplane.
67 * Enqueue a route removal for the dataplane.
71 * Result codes used when returning status back to the main zebra context.
77 * Flags being SET/UNSET do not belong in the South Bound
78 * Interface. This Setting belongs at the calling level
79 * because we can and will have multiple different interfaces
80 * and we will have potentially multiple different
81 * modules/filters to call. As such Setting/Unsetting
82 * success failure should be handled by the caller.
84 enum zebra_dplane_status
{
85 ZEBRA_DPLANE_STATUS_NONE
= 0,
86 ZEBRA_DPLANE_INSTALL_SUCCESS
,
87 ZEBRA_DPLANE_INSTALL_FAILURE
,
88 ZEBRA_DPLANE_DELETE_SUCCESS
,
89 ZEBRA_DPLANE_DELETE_FAILURE
,
93 enum zebra_dplane_result
{
94 ZEBRA_DPLANE_REQUEST_QUEUED
,
95 ZEBRA_DPLANE_REQUEST_SUCCESS
,
96 ZEBRA_DPLANE_REQUEST_FAILURE
,
99 #endif /* _ZEBRA_DPLANE_H */