]> git.proxmox.com Git - mirror_frr.git/blob - zebra/rt.h
Merge pull request #3052 from donaldsharp/dplane_2
[mirror_frr.git] / zebra / rt.h
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 *
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
20 */
21
22 #ifndef _ZEBRA_RT_H
23 #define _ZEBRA_RT_H
24
25 #include "prefix.h"
26 #include "if.h"
27 #include "vlan.h"
28 #include "vxlan.h"
29 #include "zebra/rib.h"
30 #include "zebra/zebra_ns.h"
31 #include "zebra/zebra_mpls.h"
32 #include "zebra/zebra_dplane.h"
33
34 /*
35 * Install/delete the specified prefix p from the kernel
36 *
37 * old = NULL, new = pointer - Install new
38 * old = pointer, new = pointer - Route replace Old w/ New
39 * old = pointer, new = NULL, - Route Delete
40 *
41 * Please note not all kernels support route replace
42 * semantics so we will end up with a delete than
43 * a re-add.
44 */
45 extern enum zebra_dplane_result kernel_route_rib(struct route_node *rn,
46 const struct prefix *p,
47 const struct prefix *src_p,
48 struct route_entry *old,
49 struct route_entry *new);
50
51 /*
52 * So route install/failure may not be immediately known
53 * so let's separate it out and allow the result to
54 * be passed back up.
55 */
56 extern void kernel_route_rib_pass_fail(struct route_node *rn,
57 const struct prefix *p,
58 struct route_entry *re,
59 enum zebra_dplane_status res);
60
61 extern int kernel_address_add_ipv4(struct interface *, struct connected *);
62 extern int kernel_address_delete_ipv4(struct interface *, struct connected *);
63 extern int kernel_address_add_ipv6(struct interface *, struct connected *);
64 extern int kernel_address_delete_ipv6(struct interface *, struct connected *);
65 extern int kernel_neigh_update(int cmd, int ifindex, uint32_t addr, char *lla,
66 int llalen, ns_id_t ns_id);
67 extern int kernel_interface_set_master(struct interface *master,
68 struct interface *slave);
69
70 extern enum zebra_dplane_result kernel_add_lsp(zebra_lsp_t *lsp);
71 extern enum zebra_dplane_result kernel_upd_lsp(zebra_lsp_t *lsp);
72 extern enum zebra_dplane_result kernel_del_lsp(zebra_lsp_t *lsp);
73
74 /*
75 * Add the ability to pass back up the lsp install/delete
76 * success/failure.
77 *
78 * This functions goal is similiar to kernel_route_rib_pass_fail
79 * in that we are separating out the mechanics for
80 * the install/failure to set/unset flags and to notify
81 * as needed.
82 */
83 extern void kernel_lsp_pass_fail(zebra_lsp_t *lsp, enum zebra_dplane_status res);
84
85 extern int mpls_kernel_init(void);
86
87 extern uint32_t kernel_get_speed(struct interface *ifp);
88 extern int kernel_get_ipmr_sg_stats(struct zebra_vrf *zvrf, void *mroute);
89 extern int kernel_add_vtep(vni_t vni, struct interface *ifp,
90 struct in_addr *vtep_ip);
91 extern int kernel_del_vtep(vni_t vni, struct interface *ifp,
92 struct in_addr *vtep_ip);
93 extern int kernel_add_mac(struct interface *ifp, vlanid_t vid,
94 struct ethaddr *mac, struct in_addr vtep_ip,
95 bool sticky);
96 extern int kernel_del_mac(struct interface *ifp, vlanid_t vid,
97 struct ethaddr *mac, struct in_addr vtep_ip);
98
99 extern int kernel_add_neigh(struct interface *ifp, struct ipaddr *ip,
100 struct ethaddr *mac, uint8_t flags);
101 extern int kernel_del_neigh(struct interface *ifp, struct ipaddr *ip);
102
103 /*
104 * Southbound Initialization routines to get initial starting
105 * state.
106 */
107 extern void interface_list(struct zebra_ns *zns);
108 extern void kernel_init(struct zebra_ns *zns);
109 extern void kernel_terminate(struct zebra_ns *zns);
110 extern void macfdb_read(struct zebra_ns *zns);
111 extern void macfdb_read_for_bridge(struct zebra_ns *zns, struct interface *ifp,
112 struct interface *br_if);
113 extern void neigh_read(struct zebra_ns *zns);
114 extern void neigh_read_for_vlan(struct zebra_ns *zns, struct interface *ifp);
115 extern void route_read(struct zebra_ns *zns);
116
117 #endif /* _ZEBRA_RT_H */