]>
Commit | Line | Data |
---|---|---|
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" | |
ec1a4283 | 32 | |
b33803d7 DS |
33 | /* |
34 | * Philosophy Note: | |
35 | * | |
36 | * Flags being SET/UNSET do not belong in the South Bound | |
37 | * Interface. This Setting belongs at the calling level | |
38 | * because we can and will have multiple different interfaces | |
39 | * and we will have potentially multiple different | |
40 | * modules/filters to call. As such Setting/Unsetting | |
41 | * success failure should be handled by the caller. | |
42 | */ | |
43 | ||
0c555cc6 DS |
44 | |
45 | enum southbound_results { | |
46 | SOUTHBOUND_INSTALL_SUCCESS, | |
47 | SOUTHBOUND_INSTALL_FAILURE, | |
48 | SOUTHBOUND_DELETE_SUCCESS, | |
49 | SOUTHBOUND_DELETE_FAILURE, | |
50 | }; | |
51 | ||
52 | /* | |
53 | * Install/delete the specified prefix p from the kernel | |
54 | * | |
55 | * old = NULL, new = pointer - Install new | |
56 | * old = pointer, new = pointer - Route replace Old w/ New | |
57 | * old = pointer, new = NULL, - Route Delete | |
58 | * | |
59 | * Please note not all kernels support route replace | |
60 | * semantics so we will end up with a delete than | |
61 | * a re-add. | |
62 | */ | |
7d974ba3 DS |
63 | extern void kernel_route_rib(struct route_node *rn, struct prefix *p, |
64 | struct prefix *src_p, struct route_entry *old, | |
65 | struct route_entry *new); | |
0c555cc6 DS |
66 | |
67 | /* | |
68 | * So route install/failure may not be immediately known | |
69 | * so let's separate it out and allow the result to | |
70 | * be passed back up. | |
71 | */ | |
996c9314 | 72 | extern void kernel_route_rib_pass_fail(struct route_node *rn, struct prefix *p, |
0c555cc6 DS |
73 | struct route_entry *re, |
74 | enum southbound_results res); | |
d62a17ae | 75 | |
76 | extern int kernel_address_add_ipv4(struct interface *, struct connected *); | |
77 | extern int kernel_address_delete_ipv4(struct interface *, struct connected *); | |
996c9314 LB |
78 | extern int kernel_address_add_ipv6(struct interface *, struct connected *); |
79 | extern int kernel_address_delete_ipv6(struct interface *, struct connected *); | |
80 | extern int kernel_neigh_update(int cmd, int ifindex, uint32_t addr, char *lla, | |
81 | int llalen, ns_id_t ns_id); | |
e0ae31b8 DS |
82 | extern int kernel_interface_set_master(struct interface *master, |
83 | struct interface *slave); | |
4a83e7a0 DS |
84 | |
85 | extern void kernel_add_lsp(zebra_lsp_t *lsp); | |
86 | extern void kernel_upd_lsp(zebra_lsp_t *lsp); | |
87 | extern void kernel_del_lsp(zebra_lsp_t *lsp); | |
88 | ||
89 | /* | |
90 | * Add the ability to pass back up the lsp install/delete | |
91 | * success/failure. | |
92 | * | |
93 | * This functions goal is similiar to kernel_route_rib_pass_fail | |
94 | * in that we are separating out the mechanics for | |
95 | * the install/failure to set/unset flags and to notify | |
96 | * as needed. | |
97 | */ | |
996c9314 | 98 | extern void kernel_lsp_pass_fail(zebra_lsp_t *lsp, enum southbound_results res); |
4a83e7a0 | 99 | |
d62a17ae | 100 | extern int mpls_kernel_init(void); |
101 | ||
dc7b3cae | 102 | extern uint32_t kernel_get_speed(struct interface *ifp); |
43b5cc5e | 103 | extern int kernel_get_ipmr_sg_stats(struct zebra_vrf *zvrf, void *mroute); |
d62a17ae | 104 | extern int kernel_add_vtep(vni_t vni, struct interface *ifp, |
105 | struct in_addr *vtep_ip); | |
106 | extern int kernel_del_vtep(vni_t vni, struct interface *ifp, | |
107 | struct in_addr *vtep_ip); | |
108 | extern int kernel_add_mac(struct interface *ifp, vlanid_t vid, | |
109 | struct ethaddr *mac, struct in_addr vtep_ip, | |
110 | u_char sticky); | |
111 | extern int kernel_del_mac(struct interface *ifp, vlanid_t vid, | |
112 | struct ethaddr *mac, struct in_addr vtep_ip, | |
113 | int local); | |
114 | ||
115 | extern int kernel_add_neigh(struct interface *ifp, struct ipaddr *ip, | |
116 | struct ethaddr *mac); | |
117 | extern int kernel_del_neigh(struct interface *ifp, struct ipaddr *ip); | |
2232a77c | 118 | |
05f7f5db DS |
119 | /* |
120 | * Southbound Initialization routines to get initial starting | |
121 | * state. | |
122 | */ | |
123 | extern void interface_list(struct zebra_ns *zns); | |
124 | extern void kernel_init(struct zebra_ns *zns); | |
125 | extern void kernel_terminate(struct zebra_ns *zns); | |
126 | extern void macfdb_read(struct zebra_ns *zns); | |
127 | extern void macfdb_read_for_bridge(struct zebra_ns *zns, struct interface *ifp, | |
128 | struct interface *br_if); | |
129 | extern void neigh_read(struct zebra_ns *zns); | |
130 | extern void neigh_read_for_vlan(struct zebra_ns *zns, struct interface *ifp); | |
131 | extern void route_read(struct zebra_ns *zns); | |
132 | ||
718e3744 | 133 | #endif /* _ZEBRA_RT_H */ |