Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bgpd: support for policy-routing context used with flowspec
BGP flowspec will be able to inject or remove policy-routing contexts, thanks to some protocols like flowspec. This commit adds some the APIS necessary to create/delete policy routing contexts that will be injected then into zebra. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
- Loading branch information
1 parent
3971233
commit bbe6ffd
Showing
3 changed files
with
127 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* BGP pbr | ||
* Copyright (C) 6WIND | ||
* | ||
* FRR is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License as published by the | ||
* Free Software Foundation; either version 2, or (at your option) any | ||
* later version. | ||
* | ||
* FRR is distributed in the hope that it will be useful, but | ||
* WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License along | ||
* with this program; see the file COPYING; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
*/ | ||
|
||
#include "zebra.h" | ||
#include "prefix.h" | ||
#include "zclient.h" | ||
|
||
#include "bgpd/bgp_pbr.h" | ||
|
||
|
||
struct bgp_pbr_action *bgp_pbr_action_rule_lookup(uint32_t unique) | ||
{ | ||
return NULL; | ||
} | ||
|
||
struct bgp_pbr_match *bgp_pbr_match_ipset_lookup(vrf_id_t vrf_id, | ||
uint32_t unique) | ||
{ | ||
return NULL; | ||
} | ||
|
||
struct bgp_pbr_match_entry *bgp_pbr_match_ipset_entry_lookup(vrf_id_t vrf_id, | ||
char *ipset_name, | ||
uint32_t unique) | ||
{ | ||
return NULL; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
/* | ||
* BGP pbr | ||
* Copyright (C) 6WIND | ||
* | ||
* FRR is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License as published by the | ||
* Free Software Foundation; either version 2, or (at your option) any | ||
* later version. | ||
* | ||
* FRR is distributed in the hope that it will be useful, but | ||
* WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License along | ||
* with this program; see the file COPYING; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
*/ | ||
#ifndef __BGP_PBR_H__ | ||
#define __BGP_PBR_H__ | ||
|
||
#include "nexthop.h" | ||
#include "zclient.h" | ||
|
||
struct bgp_pbr_match { | ||
char ipset_name[ZEBRA_IPSET_NAME_SIZE]; | ||
|
||
/* mapped on enum ipset_type | ||
*/ | ||
uint32_t type; | ||
|
||
uint32_t unique; | ||
|
||
bool installed; | ||
}; | ||
|
||
struct bgp_pbr_match_entry { | ||
struct bgp_pbr_match *backpointer; | ||
|
||
uint32_t unique; | ||
|
||
struct prefix src; | ||
struct prefix dst; | ||
|
||
bool installed; | ||
bool install_in_progress; | ||
}; | ||
|
||
struct bgp_pbr_action { | ||
|
||
/* | ||
* The Unique identifier of this specific pbrms | ||
*/ | ||
uint32_t unique; | ||
|
||
uint32_t fwmark; | ||
|
||
uint32_t table_id; | ||
|
||
/* | ||
* nexthop information, or drop information | ||
* contains src vrf_id and nh contains dest vrf_id | ||
*/ | ||
vrf_id_t vrf_id; | ||
struct nexthop nh; | ||
|
||
bool installed; | ||
bool install_in_progress; | ||
|
||
struct bgp_pbr_match *match; | ||
}; | ||
|
||
extern struct bgp_pbr_action *bgp_pbr_action_rule_lookup(uint32_t unique); | ||
|
||
extern struct bgp_pbr_match *bgp_pbr_match_ipset_lookup(vrf_id_t vrf_id, | ||
uint32_t unique); | ||
|
||
extern struct bgp_pbr_match_entry *bgp_pbr_match_ipset_entry_lookup( | ||
vrf_id_t vrf_id, char *name, | ||
uint32_t unique); | ||
#endif /* __BGP_PBR_H__ */ |