]> git.proxmox.com Git - mirror_frr.git/blame - zebra/zebra_static.h
lib: drop off "masters" list on master_free()
[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 */
26struct static_nh_label
27{
28 u_int8_t num_labels;
29 u_int8_t reserved[3];
30 mpls_label_t label[2];
31};
32
4b2792b5
DS
33typedef enum {
34 STATIC_IFINDEX,
35 STATIC_IPV4_GATEWAY,
36 STATIC_BLACKHOLE,
37 STATIC_IPV6_GATEWAY,
38 STATIC_IPV6_GATEWAY_IFINDEX,
39} zebra_static_types;
40
28f6dde8
DS
41/* Static route information. */
42struct static_route
43{
44 /* For linked list. */
45 struct static_route *prev;
46 struct static_route *next;
47
48 /* VRF identifier. */
49 vrf_id_t vrf_id;
50
51 /* Administrative distance. */
52 u_char distance;
53
54 /* Tag */
dc9ffce8 55 route_tag_t tag;
28f6dde8
DS
56
57 /* Flag for this static route's type. */
4b2792b5 58 zebra_static_types type;
28f6dde8
DS
59
60 /*
61 * Nexthop value.
62 *
63 * Under IPv4 addr and ifindex are
64 * used independentyly.
65 * STATIC_IPV4_GATEWAY uses addr
66 * STATIC_IFINDEX uses ifindex
67 */
68 union g_addr addr;
69 ifindex_t ifindex;
70
71 char ifname[INTERFACE_NAMSIZ + 1];
72
73 /* bit flags */
74 u_char flags;
75/*
76 see ZEBRA_FLAG_REJECT
77 ZEBRA_FLAG_BLACKHOLE
78 */
a22f3f5d 79
80 /* Label information */
81 struct static_nh_label snh_label;
28f6dde8
DS
82};
83
84extern void
c423229b
CF
85static_install_route (afi_t afi, safi_t safi, struct prefix *p,
86 struct prefix_ipv6 *src_p, struct static_route *si);
28f6dde8 87extern void
c423229b
CF
88static_uninstall_route (afi_t afi, safi_t safi, struct prefix *p,
89 struct prefix_ipv6 *src_p, struct static_route *si);
28f6dde8
DS
90
91extern int
3a3d00f1 92static_add_route (afi_t, safi_t safi, u_char type, struct prefix *p,
c423229b 93 struct prefix_ipv6 *src_p,
3a3d00f1 94 union g_addr *gate, ifindex_t ifindex,
dc9ffce8 95 const char *ifname, u_char flags, route_tag_t tag,
a22f3f5d 96 u_char distance, struct zebra_vrf *zvrf,
97 struct static_nh_label *snh_label);
28f6dde8
DS
98
99extern int
c7cfcb75 100static_delete_route (afi_t, safi_t safi, u_char type, struct prefix *p,
c423229b 101 struct prefix_ipv6 *src_p,
dc9ffce8 102 union g_addr *gate, ifindex_t ifindex, route_tag_t tag,
a22f3f5d 103 u_char distance, struct zebra_vrf *zvrf,
104 struct static_nh_label *snh_label);
28f6dde8 105
41675b4c
RW
106int
107zebra_static_ipv4 (struct vty *vty, safi_t safi, int add_cmd,
108 const char *dest_str, const char *mask_str,
109 const char *gate_str, const char *flag_str,
110 const char *tag_str, const char *distance_str,
111 const char *vrf_id_str, const char *label_str);
112
113int
114static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str,
c423229b 115 const char *src_str,
41675b4c
RW
116 const char *gate_str, const char *ifname,
117 const char *flag_str, const char *tag_str,
118 const char *distance_str, const char *vrf_id_str,
119 const char *label_str);
28f6dde8 120
28f6dde8 121#endif