]> git.proxmox.com Git - mirror_frr.git/blame - zebra/zebra_static.h
Merge branch 'stable/3.0' into tmp-3.0-master-merge
[mirror_frr.git] / zebra / zebra_static.h
CommitLineData
28f6dde8
DS
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 *
896014f4
DL
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
28f6dde8
DS
21 */
22#ifndef __ZEBRA_STATIC_H__
23#define __ZEBRA_STATIC_H__
24
a22f3f5d 25/* Static route label information */
d62a17ae 26struct static_nh_label {
27 u_int8_t num_labels;
28 u_int8_t reserved[3];
29 mpls_label_t label[2];
a22f3f5d 30};
31
4b2792b5 32typedef enum {
23443030 33 STATIC_IFNAME,
d62a17ae 34 STATIC_IPV4_GATEWAY,
23443030 35 STATIC_IPV4_GATEWAY_IFNAME,
d62a17ae 36 STATIC_BLACKHOLE,
37 STATIC_IPV6_GATEWAY,
23443030 38 STATIC_IPV6_GATEWAY_IFNAME,
4b2792b5
DS
39} zebra_static_types;
40
28f6dde8 41/* Static route information. */
d62a17ae 42struct static_route {
43 /* For linked list. */
44 struct static_route *prev;
45 struct static_route *next;
46
47 /* VRF identifier. */
48 vrf_id_t vrf_id;
49
50 /* Administrative distance. */
51 u_char distance;
52
53 /* Tag */
54 route_tag_t tag;
55
56 /* Flag for this static route's type. */
57 zebra_static_types type;
58
59 /*
60 * Nexthop value.
d62a17ae 61 */
62 union g_addr addr;
63 ifindex_t ifindex;
64
65 char ifname[INTERFACE_NAMSIZ + 1];
66
67 /* bit flags */
68 u_char flags;
69 /*
70 see ZEBRA_FLAG_REJECT
71 ZEBRA_FLAG_BLACKHOLE
72 */
73
74 /* Label information */
75 struct static_nh_label snh_label;
28f6dde8
DS
76};
77
d62a17ae 78extern void static_install_route(afi_t afi, safi_t safi, struct prefix *p,
79 struct prefix_ipv6 *src_p,
80 struct static_route *si);
81extern void static_uninstall_route(afi_t afi, safi_t safi, struct prefix *p,
82 struct prefix_ipv6 *src_p,
83 struct static_route *si);
84
85extern int static_add_route(afi_t, safi_t safi, u_char type, struct prefix *p,
86 struct prefix_ipv6 *src_p, union g_addr *gate,
c3c04063 87 const char *ifname, u_char flags,
d62a17ae 88 route_tag_t tag, u_char distance,
89 struct zebra_vrf *zvrf,
90 struct static_nh_label *snh_label);
91
92extern int static_delete_route(afi_t, safi_t safi, u_char type,
93 struct prefix *p, struct prefix_ipv6 *src_p,
c3c04063 94 union g_addr *gate, const char *ifname,
d62a17ae 95 route_tag_t tag, u_char distance,
96 struct zebra_vrf *zvrf,
97 struct static_nh_label *snh_label);
98
c3c04063
DL
99extern void static_ifindex_update(struct interface *ifp, bool up);
100
28f6dde8 101#endif