2 * STATICd - static routes header
3 * Copyright (C) 2018 Cumulus Networks, Inc.
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the Free
8 * Software Foundation; either version 2 of the License, or (at your option)
11 * This program is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 * You should have received a copy of the GNU General Public License along
17 * with this program; see the file COPYING; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 #ifndef __STATIC_ROUTES_H__
21 #define __STATIC_ROUTES_H__
25 /* Static route label information */
26 struct static_nh_label
{
29 mpls_label_t label
[MPLS_MAX_LABELS
];
32 enum static_blackhole_type
{
33 STATIC_BLACKHOLE_DROP
= 0,
34 STATIC_BLACKHOLE_NULL
,
35 STATIC_BLACKHOLE_REJECT
41 STATIC_IPV4_GATEWAY_IFNAME
,
44 STATIC_IPV6_GATEWAY_IFNAME
,
47 /* Static route information. */
49 /* For linked list. */
50 struct static_route
*prev
;
51 struct static_route
*next
;
56 char nh_vrfname
[VRF_NAMSIZ
+ 1];
58 /* Administrative distance. */
64 /* Flag for this static route's type. */
70 enum static_blackhole_type bh_type
;
76 char ifname
[INTERFACE_NAMSIZ
+ 1];
78 /* Label information */
79 struct static_nh_label snh_label
;
84 * Whether to pretend the nexthop is directly attached to the specified
85 * link. Only meaningful when both a gateway address and interface name
91 extern bool mpls_enabled
;
93 extern struct zebra_privs_t static_privs
;
95 void static_fixup_vrf_ids(struct static_vrf
*svrf
);
97 extern int static_add_route(afi_t afi
, safi_t safi
, uint8_t type
,
98 struct prefix
*p
, struct prefix_ipv6
*src_p
,
99 union g_addr
*gate
, const char *ifname
,
100 enum static_blackhole_type bh_type
, route_tag_t tag
,
101 uint8_t distance
, struct static_vrf
*svrf
,
102 struct static_vrf
*nh_svrf
,
103 struct static_nh_label
*snh_label
,
104 uint32_t table_id
, bool onlink
);
106 extern int static_delete_route(afi_t afi
, safi_t safi
, uint8_t type
,
107 struct prefix
*p
, struct prefix_ipv6
*src_p
,
108 union g_addr
*gate
, const char *ifname
,
109 route_tag_t tag
, uint8_t distance
,
110 struct static_vrf
*svrf
,
111 struct static_nh_label
*snh_label
,
114 extern void static_cleanup_vrf_ids(struct static_vrf
*disable_svrf
);
116 extern void static_install_intf_nh(struct interface
*ifp
);
118 extern void static_ifindex_update(struct interface
*ifp
, bool up
);