]> git.proxmox.com Git - mirror_frr.git/blame - zebra/rt.h
zebra: Fix tracepoint changes for lttng
[mirror_frr.git] / zebra / rt.h
CommitLineData
718e3744 1/*
2 * kernel routing table update prototype.
3 * Copyright (C) 1998 Kunihiro Ishiguro
4 *
5 * This file is part of GNU Zebra.
6 *
7 * GNU Zebra is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2, or (at your option) any
10 * later version.
11 *
12 * GNU Zebra is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
896014f4
DL
17 * You should have received a copy of the GNU General Public License along
18 * with this program; see the file COPYING; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
718e3744 20 */
21
22#ifndef _ZEBRA_RT_H
23#define _ZEBRA_RT_H
24
ec1a4283 25#include "prefix.h"
26#include "if.h"
2232a77c 27#include "vlan.h"
13d60d35 28#include "vxlan.h"
5c78b3d0 29#include "zebra/rib.h"
40c7bdb0 30#include "zebra/zebra_ns.h"
31#include "zebra/zebra_mpls.h"
ea1c14f6 32#include "zebra/zebra_dplane.h"
1e885672 33
51e94aa7
EDP
34#ifdef __cplusplus
35extern "C" {
36#endif
37
66cb1845
SW
38#define RKERNEL_ROUTE(type) ((type) == ZEBRA_ROUTE_KERNEL)
39
40#define RSYSTEM_ROUTE(type) \
41 ((RKERNEL_ROUTE(type)) || (type) == ZEBRA_ROUTE_CONNECT)
3cdba47a 42
18f60fe9 43#ifndef HAVE_NETLINK
7cdb1a84 44/*
f820d025
SW
45 * Update or delete a route, nexthop, LSP, pseudowire, or vxlan MAC from the
46 * kernel, using info from a dataplane context.
7cdb1a84 47 */
25779064
MS
48extern enum zebra_dplane_result kernel_route_update(
49 struct zebra_dplane_ctx *ctx);
7cdb1a84 50
f820d025
SW
51extern enum zebra_dplane_result
52kernel_nexthop_update(struct zebra_dplane_ctx *ctx);
53
16c628de
MS
54extern enum zebra_dplane_result kernel_lsp_update(
55 struct zebra_dplane_ctx *ctx);
56
97d8d05a
MS
57enum zebra_dplane_result kernel_pw_update(struct zebra_dplane_ctx *ctx);
58
64168803
MS
59enum zebra_dplane_result kernel_address_update_ctx(
60 struct zebra_dplane_ctx *ctx);
61
036d93c0
MS
62enum zebra_dplane_result kernel_mac_update_ctx(struct zebra_dplane_ctx *ctx);
63
931fa60c
MS
64enum zebra_dplane_result kernel_neigh_update_ctx(struct zebra_dplane_ctx *ctx);
65
18f60fe9
JU
66extern enum zebra_dplane_result
67kernel_pbr_rule_update(struct zebra_dplane_ctx *ctx);
68
97c72633
SW
69extern enum zebra_dplane_result
70kernel_intf_update(struct zebra_dplane_ctx *ctx);
71
39ffa8e8
DS
72extern enum zebra_dplane_result
73kernel_intf_netconf_update(struct zebra_dplane_ctx *ctx);
449a30ed 74extern enum zebra_dplane_result kernel_tc_update(struct zebra_dplane_ctx *ctx);
39ffa8e8 75
18f60fe9
JU
76#endif /* !HAVE_NETLINK */
77
05657ec2
PG
78extern int kernel_neigh_update(int cmd, int ifindex, void *addr, char *lla,
79 int llalen, ns_id_t ns_id, uint8_t family,
80 bool permanent);
7723e8d3
PG
81extern int kernel_neigh_register(vrf_id_t vrf_id, struct zserv *client,
82 bool reg);
e0ae31b8
DS
83extern int kernel_interface_set_master(struct interface *master,
84 struct interface *slave);
4a83e7a0 85
d62a17ae 86extern int mpls_kernel_init(void);
87
34869809
MS
88/* Global init and deinit for platform-/OS-specific things */
89void kernel_router_init(void);
90void kernel_router_terminate(void);
91
594c2878 92extern uint32_t kernel_get_speed(struct interface *ifp, int *error);
43b5cc5e 93extern int kernel_get_ipmr_sg_stats(struct zebra_vrf *zvrf, void *mroute);
2232a77c 94
05f7f5db
DS
95/*
96 * Southbound Initialization routines to get initial starting
97 * state.
98 */
99extern void interface_list(struct zebra_ns *zns);
100extern void kernel_init(struct zebra_ns *zns);
62b8bb7a 101extern void kernel_terminate(struct zebra_ns *zns, bool complete);
05f7f5db
DS
102extern void macfdb_read(struct zebra_ns *zns);
103extern void macfdb_read_for_bridge(struct zebra_ns *zns, struct interface *ifp,
104 struct interface *br_if);
67fb9374
CS
105extern void macfdb_read_specific_mac(struct zebra_ns *zns,
106 struct interface *br_if,
1a3bd37f 107 const struct ethaddr *mac, vlanid_t vid);
05f7f5db
DS
108extern void neigh_read(struct zebra_ns *zns);
109extern void neigh_read_for_vlan(struct zebra_ns *zns, struct interface *ifp);
1a3bd37f 110extern void neigh_read_specific_ip(const struct ipaddr *ip,
67fb9374 111 struct interface *vlan_if);
05f7f5db 112extern void route_read(struct zebra_ns *zns);
506efd37
AK
113extern int kernel_upd_mac_nh(uint32_t nh_id, struct in_addr vtep_ip);
114extern int kernel_del_mac_nh(uint32_t nh_id);
115extern int kernel_upd_mac_nhg(uint32_t nhg_id, uint32_t nh_cnt,
116 struct nh_grp *nh_ids);
117extern int kernel_del_mac_nhg(uint32_t nhg_id);
05f7f5db 118
fef24b03
JU
119/*
120 * Message batching interface.
121 */
122extern void kernel_update_multi(struct dplane_ctx_q *ctx_list);
fef24b03 123
d166308b
MS
124/*
125 * Called by the dplane pthread to read incoming OS messages and dispatch them.
126 */
127int kernel_dplane_read(struct zebra_dplane_info *info);
128
51e94aa7
EDP
129#ifdef __cplusplus
130}
131#endif
132
718e3744 133#endif /* _ZEBRA_RT_H */