]> git.proxmox.com Git - mirror_frr.git/blame - pbrd/pbr_vrf.h
Merge pull request #4765 from opensourcerouting/defaults-v2
[mirror_frr.git] / pbrd / pbr_vrf.h
CommitLineData
be3b67b5
SW
1/*
2 * VRF library for PBR
3 * Copyright (C) 2019 Cumulus Networks, Inc.
4 * Stephen Worley
5 *
6 * FRR 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
8 * Free Software Foundation; either version 2, or (at your option) any
9 * later version.
10 *
11 * FRR is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
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
19 */
20#ifndef __PBR_VRF_H__
21#define __PBR_VRF_H__
22
23struct pbr_vrf {
24 struct vrf *vrf;
25};
26
27static inline const char *pbr_vrf_name(const struct pbr_vrf *pbr_vrf)
28{
29 return pbr_vrf->vrf->name;
30}
31
32static inline vrf_id_t pbr_vrf_id(const struct pbr_vrf *pbr_vrf)
33{
34 return pbr_vrf->vrf->vrf_id;
35}
36
37extern struct pbr_vrf *pbr_vrf_lookup_by_id(vrf_id_t vrf_id);
38extern struct pbr_vrf *pbr_vrf_lookup_by_name(const char *name);
39extern bool pbr_vrf_is_valid(const struct pbr_vrf *pbr_vrf);
40extern bool pbr_vrf_is_enabled(const struct pbr_vrf *pbr_vrf);
41
42extern void pbr_vrf_init(void);
43#endif