]> git.proxmox.com Git - mirror_frr.git/blob - zebra/zebra_static.h
Merge branch 'master' of https://github.com/dwalton76/frr into bgpd-draft-ietf-grow...
[mirror_frr.git] / zebra / zebra_static.h
1 /*
2 * Static Routing Information header
3 * Copyright (C) 2016 Cumulus Networks
4 * Donald Sharp
5 *
6 * This file is part of Quagga.
7 *
8 * Quagga is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2, or (at your option) any
11 * later version.
12 *
13 * Quagga is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; see the file COPYING; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 */
22 #ifndef __ZEBRA_STATIC_H__
23 #define __ZEBRA_STATIC_H__
24
25 #include "zebra/zebra_mpls.h"
26
27 /* Static route label information */
28 struct static_nh_label {
29 u_int8_t num_labels;
30 u_int8_t reserved[3];
31 mpls_label_t label[MPLS_MAX_LABELS];
32 };
33
34 typedef enum {
35 STATIC_IFNAME,
36 STATIC_IPV4_GATEWAY,
37 STATIC_IPV4_GATEWAY_IFNAME,
38 STATIC_BLACKHOLE,
39 STATIC_IPV6_GATEWAY,
40 STATIC_IPV6_GATEWAY_IFNAME,
41 } zebra_static_types;
42
43 /* Static route information. */
44 struct static_route {
45 /* For linked list. */
46 struct static_route *prev;
47 struct static_route *next;
48
49 /* VRF identifier. */
50 vrf_id_t vrf_id;
51
52 /* Administrative distance. */
53 u_char distance;
54
55 /* Tag */
56 route_tag_t tag;
57
58 /* Flag for this static route's type. */
59 zebra_static_types type;
60
61 /*
62 * Nexthop value.
63 */
64 union g_addr addr;
65 ifindex_t ifindex;
66
67 char ifname[INTERFACE_NAMSIZ + 1];
68
69 /* bit flags */
70 u_char flags;
71 /*
72 see ZEBRA_FLAG_REJECT
73 ZEBRA_FLAG_BLACKHOLE
74 */
75
76 /* Label information */
77 struct static_nh_label snh_label;
78 };
79
80 extern void static_install_route(afi_t afi, safi_t safi, struct prefix *p,
81 struct prefix_ipv6 *src_p,
82 struct static_route *si);
83 extern void static_uninstall_route(afi_t afi, safi_t safi, struct prefix *p,
84 struct prefix_ipv6 *src_p,
85 struct static_route *si);
86
87 extern int static_add_route(afi_t, safi_t safi, u_char type, struct prefix *p,
88 struct prefix_ipv6 *src_p, union g_addr *gate,
89 const char *ifname, u_char flags,
90 route_tag_t tag, u_char distance,
91 struct zebra_vrf *zvrf,
92 struct static_nh_label *snh_label);
93
94 extern int static_delete_route(afi_t, safi_t safi, u_char type,
95 struct prefix *p, struct prefix_ipv6 *src_p,
96 union g_addr *gate, const char *ifname,
97 route_tag_t tag, u_char distance,
98 struct zebra_vrf *zvrf,
99 struct static_nh_label *snh_label);
100
101 extern void static_ifindex_update(struct interface *ifp, bool up);
102
103 #endif