2 * Static Routing Information header
3 * Copyright (C) 2016 Cumulus Networks
6 * This file is part of Quagga.
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
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.
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
22 #ifndef __ZEBRA_STATIC_H__
23 #define __ZEBRA_STATIC_H__
25 #include "zebra/zebra_mpls.h"
27 /* Static route label information */
28 struct static_nh_label
{
31 mpls_label_t label
[MPLS_MAX_LABELS
];
34 enum static_blackhole_type
{
35 STATIC_BLACKHOLE_DROP
= 0,
36 STATIC_BLACKHOLE_NULL
,
37 STATIC_BLACKHOLE_REJECT
43 STATIC_IPV4_GATEWAY_IFNAME
,
46 STATIC_IPV6_GATEWAY_IFNAME
,
49 /* Static route information. */
51 /* For linked list. */
52 struct static_route
*prev
;
53 struct static_route
*next
;
58 char nh_vrfname
[VRF_NAMSIZ
+ 1];
60 /* Administrative distance. */
66 /* Flag for this static route's type. */
67 zebra_static_types type
;
72 enum static_blackhole_type bh_type
;
76 char ifname
[INTERFACE_NAMSIZ
+ 1];
78 /* Label information */
79 struct static_nh_label snh_label
;
81 /* Table Information */
85 extern void static_install_route(afi_t afi
, safi_t safi
, struct prefix
*p
,
86 struct prefix_ipv6
*src_p
,
87 struct static_route
*si
);
88 extern void static_uninstall_route(afi_t afi
, safi_t safi
, struct prefix
*p
,
89 struct prefix_ipv6
*src_p
,
90 struct static_route
*si
);
92 extern int static_add_route(afi_t
, safi_t safi
, uint8_t type
, struct prefix
*p
,
93 struct prefix_ipv6
*src_p
, union g_addr
*gate
,
95 enum static_blackhole_type bh_type
, route_tag_t tag
,
96 uint8_t distance
, struct zebra_vrf
*zvrf
,
97 struct zebra_vrf
*nh_zvrf
,
98 struct static_nh_label
*snh_label
,
101 extern int static_delete_route(afi_t
, safi_t safi
, uint8_t type
,
102 struct prefix
*p
, struct prefix_ipv6
*src_p
,
103 union g_addr
*gate
, const char *ifname
,
104 route_tag_t tag
, uint8_t distance
,
105 struct zebra_vrf
*zvrf
,
106 struct static_nh_label
*snh_label
,
109 extern void static_ifindex_update(struct interface
*ifp
, bool up
);
111 extern void static_cleanup_vrf_ids(struct zebra_vrf
*zvrf
);
112 extern void static_fixup_vrf_ids(struct zebra_vrf
*zvrf
);