]> git.proxmox.com Git - mirror_frr.git/blame - zebra/rt.h
*: auto-convert to SPDX License IDs
[mirror_frr.git] / zebra / rt.h
CommitLineData
acddc0ed 1// SPDX-License-Identifier: GPL-2.0-or-later
718e3744 2/*
3 * kernel routing table update prototype.
4 * Copyright (C) 1998 Kunihiro Ishiguro
718e3744 5 */
6
7#ifndef _ZEBRA_RT_H
8#define _ZEBRA_RT_H
9
ec1a4283 10#include "prefix.h"
11#include "if.h"
2232a77c 12#include "vlan.h"
13d60d35 13#include "vxlan.h"
5c78b3d0 14#include "zebra/rib.h"
40c7bdb0 15#include "zebra/zebra_ns.h"
16#include "zebra/zebra_mpls.h"
ea1c14f6 17#include "zebra/zebra_dplane.h"
1e885672 18
51e94aa7
EDP
19#ifdef __cplusplus
20extern "C" {
21#endif
22
68ff69fa
DS
23#define ROUTE_INSTALLATION_METRIC 20
24
66cb1845
SW
25#define RKERNEL_ROUTE(type) ((type) == ZEBRA_ROUTE_KERNEL)
26
27#define RSYSTEM_ROUTE(type) \
28 ((RKERNEL_ROUTE(type)) || (type) == ZEBRA_ROUTE_CONNECT)
3cdba47a 29
18f60fe9 30#ifndef HAVE_NETLINK
7cdb1a84 31/*
f820d025
SW
32 * Update or delete a route, nexthop, LSP, pseudowire, or vxlan MAC from the
33 * kernel, using info from a dataplane context.
7cdb1a84 34 */
25779064
MS
35extern enum zebra_dplane_result kernel_route_update(
36 struct zebra_dplane_ctx *ctx);
7cdb1a84 37
f820d025
SW
38extern enum zebra_dplane_result
39kernel_nexthop_update(struct zebra_dplane_ctx *ctx);
40
16c628de
MS
41extern enum zebra_dplane_result kernel_lsp_update(
42 struct zebra_dplane_ctx *ctx);
43
97d8d05a
MS
44enum zebra_dplane_result kernel_pw_update(struct zebra_dplane_ctx *ctx);
45
64168803
MS
46enum zebra_dplane_result kernel_address_update_ctx(
47 struct zebra_dplane_ctx *ctx);
48
036d93c0
MS
49enum zebra_dplane_result kernel_mac_update_ctx(struct zebra_dplane_ctx *ctx);
50
931fa60c
MS
51enum zebra_dplane_result kernel_neigh_update_ctx(struct zebra_dplane_ctx *ctx);
52
18f60fe9
JU
53extern enum zebra_dplane_result
54kernel_pbr_rule_update(struct zebra_dplane_ctx *ctx);
55
97c72633
SW
56extern enum zebra_dplane_result
57kernel_intf_update(struct zebra_dplane_ctx *ctx);
58
39ffa8e8
DS
59extern enum zebra_dplane_result
60kernel_intf_netconf_update(struct zebra_dplane_ctx *ctx);
449a30ed 61extern enum zebra_dplane_result kernel_tc_update(struct zebra_dplane_ctx *ctx);
39ffa8e8 62
18f60fe9
JU
63#endif /* !HAVE_NETLINK */
64
05657ec2
PG
65extern int kernel_neigh_update(int cmd, int ifindex, void *addr, char *lla,
66 int llalen, ns_id_t ns_id, uint8_t family,
67 bool permanent);
7723e8d3
PG
68extern int kernel_neigh_register(vrf_id_t vrf_id, struct zserv *client,
69 bool reg);
e0ae31b8
DS
70extern int kernel_interface_set_master(struct interface *master,
71 struct interface *slave);
4a83e7a0 72
d62a17ae 73extern int mpls_kernel_init(void);
74
34869809
MS
75/* Global init and deinit for platform-/OS-specific things */
76void kernel_router_init(void);
77void kernel_router_terminate(void);
78
594c2878 79extern uint32_t kernel_get_speed(struct interface *ifp, int *error);
43b5cc5e 80extern int kernel_get_ipmr_sg_stats(struct zebra_vrf *zvrf, void *mroute);
2232a77c 81
05f7f5db
DS
82/*
83 * Southbound Initialization routines to get initial starting
84 * state.
85 */
86extern void interface_list(struct zebra_ns *zns);
87extern void kernel_init(struct zebra_ns *zns);
62b8bb7a 88extern void kernel_terminate(struct zebra_ns *zns, bool complete);
05f7f5db
DS
89extern void macfdb_read(struct zebra_ns *zns);
90extern void macfdb_read_for_bridge(struct zebra_ns *zns, struct interface *ifp,
91 struct interface *br_if);
67fb9374
CS
92extern void macfdb_read_specific_mac(struct zebra_ns *zns,
93 struct interface *br_if,
1a3bd37f 94 const struct ethaddr *mac, vlanid_t vid);
05f7f5db
DS
95extern void neigh_read(struct zebra_ns *zns);
96extern void neigh_read_for_vlan(struct zebra_ns *zns, struct interface *ifp);
1a3bd37f 97extern void neigh_read_specific_ip(const struct ipaddr *ip,
67fb9374 98 struct interface *vlan_if);
05f7f5db 99extern void route_read(struct zebra_ns *zns);
506efd37
AK
100extern int kernel_upd_mac_nh(uint32_t nh_id, struct in_addr vtep_ip);
101extern int kernel_del_mac_nh(uint32_t nh_id);
102extern int kernel_upd_mac_nhg(uint32_t nhg_id, uint32_t nh_cnt,
103 struct nh_grp *nh_ids);
104extern int kernel_del_mac_nhg(uint32_t nhg_id);
05f7f5db 105
fef24b03
JU
106/*
107 * Message batching interface.
108 */
ac96497c 109extern void kernel_update_multi(struct dplane_ctx_list_head *ctx_list);
fef24b03 110
d166308b
MS
111/*
112 * Called by the dplane pthread to read incoming OS messages and dispatch them.
113 */
114int kernel_dplane_read(struct zebra_dplane_info *info);
115
51e94aa7
EDP
116#ifdef __cplusplus
117}
118#endif
119
718e3744 120#endif /* _ZEBRA_RT_H */