mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-05 10:08:41 +00:00

until now, the assumption was done in bgp flowspec code that the information contained was an ipv4 flowspec prefix. now that it is possible to handle ipv4 or ipv6 flowspec prefixes, that information is stored in prefix_flowspec attribute. Also, some unlocking is done in order to process ipv4 and ipv6 flowspec entries. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
63 lines
2.0 KiB
C
63 lines
2.0 KiB
C
/* BGP Flowspec header for utilities
|
|
* Copyright (C) 2018 6WIND
|
|
*
|
|
* FRRouting 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.
|
|
*
|
|
* FRRouting 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 _FRR_BGP_FLOWSPEC_UTIL_H
|
|
#define _FRR_BGP_FLOWSPEC_UTIL_H
|
|
|
|
#include "zclient.h"
|
|
|
|
#define BGP_FLOWSPEC_STRING_DISPLAY_MAX 512
|
|
|
|
enum bgp_flowspec_util_nlri_t {
|
|
BGP_FLOWSPEC_VALIDATE_ONLY = 0,
|
|
BGP_FLOWSPEC_RETURN_STRING = 1,
|
|
BGP_FLOWSPEC_CONVERT_TO_NON_OPAQUE = 2,
|
|
BGP_FLOWSPEC_RETURN_JSON = 3,
|
|
};
|
|
|
|
|
|
extern int bgp_flowspec_op_decode(enum bgp_flowspec_util_nlri_t type,
|
|
uint8_t *nlri_ptr,
|
|
uint32_t max_len,
|
|
void *result, int *error);
|
|
|
|
extern int bgp_flowspec_ip_address(enum bgp_flowspec_util_nlri_t type,
|
|
uint8_t *nlri_ptr,
|
|
uint32_t max_len,
|
|
void *result, int *error,
|
|
afi_t afi);
|
|
|
|
extern int bgp_flowspec_bitmask_decode(enum bgp_flowspec_util_nlri_t type,
|
|
uint8_t *nlri_ptr,
|
|
uint32_t max_len,
|
|
void *result, int *error);
|
|
|
|
struct bgp_pbr_entry_main;
|
|
extern int bgp_flowspec_match_rules_fill(uint8_t *nlri_content, int len,
|
|
struct bgp_pbr_entry_main *bpem,
|
|
afi_t afi);
|
|
|
|
extern bool bgp_flowspec_contains_prefix(const struct prefix *pfs,
|
|
struct prefix *input,
|
|
int prefix_check);
|
|
|
|
extern bool bgp_flowspec_get_first_nh(struct bgp *bgp, struct bgp_path_info *pi,
|
|
struct prefix *nh, afi_t afi);
|
|
|
|
#endif /* _FRR_BGP_FLOWSPEC_UTIL_H */
|