]>
git.proxmox.com Git - mirror_frr.git/blob - zebra/rt.h
2 * kernel routing table update prototype.
3 * Copyright (C) 1998 Kunihiro Ishiguro
5 * This file is part of GNU Zebra.
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
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.
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
29 #include "zebra/rib.h"
30 #include "zebra/zebra_ns.h"
31 #include "zebra/zebra_mpls.h"
32 #include "zebra/zebra_dplane.h"
38 #define ROUTE_INSTALLATION_METRIC 20
40 #define RKERNEL_ROUTE(type) ((type) == ZEBRA_ROUTE_KERNEL)
42 #define RSYSTEM_ROUTE(type) \
43 ((RKERNEL_ROUTE(type)) || (type) == ZEBRA_ROUTE_CONNECT)
47 * Update or delete a route, nexthop, LSP, pseudowire, or vxlan MAC from the
48 * kernel, using info from a dataplane context.
50 extern enum zebra_dplane_result
kernel_route_update(
51 struct zebra_dplane_ctx
*ctx
);
53 extern enum zebra_dplane_result
54 kernel_nexthop_update(struct zebra_dplane_ctx
*ctx
);
56 extern enum zebra_dplane_result
kernel_lsp_update(
57 struct zebra_dplane_ctx
*ctx
);
59 enum zebra_dplane_result
kernel_pw_update(struct zebra_dplane_ctx
*ctx
);
61 enum zebra_dplane_result
kernel_address_update_ctx(
62 struct zebra_dplane_ctx
*ctx
);
64 enum zebra_dplane_result
kernel_mac_update_ctx(struct zebra_dplane_ctx
*ctx
);
66 enum zebra_dplane_result
kernel_neigh_update_ctx(struct zebra_dplane_ctx
*ctx
);
68 extern enum zebra_dplane_result
69 kernel_pbr_rule_update(struct zebra_dplane_ctx
*ctx
);
71 extern enum zebra_dplane_result
72 kernel_intf_update(struct zebra_dplane_ctx
*ctx
);
74 extern enum zebra_dplane_result
75 kernel_intf_netconf_update(struct zebra_dplane_ctx
*ctx
);
76 extern enum zebra_dplane_result
kernel_tc_update(struct zebra_dplane_ctx
*ctx
);
78 #endif /* !HAVE_NETLINK */
80 extern int kernel_neigh_update(int cmd
, int ifindex
, void *addr
, char *lla
,
81 int llalen
, ns_id_t ns_id
, uint8_t family
,
83 extern int kernel_neigh_register(vrf_id_t vrf_id
, struct zserv
*client
,
85 extern int kernel_interface_set_master(struct interface
*master
,
86 struct interface
*slave
);
88 extern int mpls_kernel_init(void);
90 /* Global init and deinit for platform-/OS-specific things */
91 void kernel_router_init(void);
92 void kernel_router_terminate(void);
94 extern uint32_t kernel_get_speed(struct interface
*ifp
, int *error
);
95 extern int kernel_get_ipmr_sg_stats(struct zebra_vrf
*zvrf
, void *mroute
);
98 * Southbound Initialization routines to get initial starting
101 extern void interface_list(struct zebra_ns
*zns
);
102 extern void kernel_init(struct zebra_ns
*zns
);
103 extern void kernel_terminate(struct zebra_ns
*zns
, bool complete
);
104 extern void macfdb_read(struct zebra_ns
*zns
);
105 extern void macfdb_read_for_bridge(struct zebra_ns
*zns
, struct interface
*ifp
,
106 struct interface
*br_if
);
107 extern void macfdb_read_specific_mac(struct zebra_ns
*zns
,
108 struct interface
*br_if
,
109 const struct ethaddr
*mac
, vlanid_t vid
);
110 extern void neigh_read(struct zebra_ns
*zns
);
111 extern void neigh_read_for_vlan(struct zebra_ns
*zns
, struct interface
*ifp
);
112 extern void neigh_read_specific_ip(const struct ipaddr
*ip
,
113 struct interface
*vlan_if
);
114 extern void route_read(struct zebra_ns
*zns
);
115 extern int kernel_upd_mac_nh(uint32_t nh_id
, struct in_addr vtep_ip
);
116 extern int kernel_del_mac_nh(uint32_t nh_id
);
117 extern int kernel_upd_mac_nhg(uint32_t nhg_id
, uint32_t nh_cnt
,
118 struct nh_grp
*nh_ids
);
119 extern int kernel_del_mac_nhg(uint32_t nhg_id
);
122 * Message batching interface.
124 extern void kernel_update_multi(struct dplane_ctx_list_head
*ctx_list
);
127 * Called by the dplane pthread to read incoming OS messages and dispatch them.
129 int kernel_dplane_read(struct zebra_dplane_info
*info
);
135 #endif /* _ZEBRA_RT_H */