2023-02-08 13:17:09 +01:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2017-01-23 03:45:30 +01:00
|
|
|
/* BGP Flowspec header for packet handling
|
|
|
|
* Copyright (C) 2018 6WIND
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _FRR_BGP_FLOWSPEC_H
|
|
|
|
#define _FRR_BGP_FLOWSPEC_H
|
|
|
|
|
2018-03-07 18:54:09 +01:00
|
|
|
#define NLRI_STRING_FORMAT_LARGE 0
|
|
|
|
#define NLRI_STRING_FORMAT_DEBUG 1
|
|
|
|
#define NLRI_STRING_FORMAT_MIN 2
|
|
|
|
#define NLRI_STRING_FORMAT_JSON 3
|
|
|
|
#define NLRI_STRING_FORMAT_JSON_SIMPLE 4
|
2018-02-19 17:17:41 +01:00
|
|
|
|
|
|
|
#define BGP_FLOWSPEC_NLRI_STRING_MAX 512
|
|
|
|
|
2017-01-23 03:45:30 +01:00
|
|
|
extern int bgp_nlri_parse_flowspec(struct peer *peer, struct attr *attr,
|
2023-04-05 21:25:57 +02:00
|
|
|
struct bgp_nlri *packet, bool withdraw);
|
2017-01-23 03:45:30 +01:00
|
|
|
|
|
|
|
extern void bgp_flowspec_vty_init(void);
|
|
|
|
|
2018-02-19 17:17:41 +01:00
|
|
|
extern int bgp_show_table_flowspec(struct vty *vty, struct bgp *bgp, afi_t afi,
|
|
|
|
struct bgp_table *table,
|
2018-09-04 19:39:04 +02:00
|
|
|
enum bgp_show_type type, void *output_arg,
|
|
|
|
bool use_json, int is_last,
|
2018-02-19 17:17:41 +01:00
|
|
|
unsigned long *output_cum,
|
|
|
|
unsigned long *total_cum);
|
|
|
|
|
|
|
|
extern void bgp_fs_nlri_get_string(unsigned char *nlri_content, size_t len,
|
2018-03-07 18:54:09 +01:00
|
|
|
char *return_string, int format,
|
2019-10-14 18:02:22 +02:00
|
|
|
json_object *json_path,
|
|
|
|
afi_t afi);
|
2018-02-19 17:17:41 +01:00
|
|
|
|
2020-03-22 19:50:46 +01:00
|
|
|
extern void route_vty_out_flowspec(struct vty *vty, const struct prefix *p,
|
2018-10-03 00:34:03 +02:00
|
|
|
struct bgp_path_info *path, int display,
|
2018-10-02 22:41:30 +02:00
|
|
|
json_object *json_paths);
|
2018-04-25 18:29:35 +02:00
|
|
|
extern int bgp_fs_config_write_pbr(struct vty *vty, struct bgp *bgp,
|
|
|
|
afi_t afi, safi_t safi);
|
|
|
|
|
2018-09-04 19:39:04 +02:00
|
|
|
extern int bgp_flowspec_display_match_per_ip(afi_t afi, struct bgp_table *rib,
|
|
|
|
struct prefix *match,
|
|
|
|
int prefix_check, struct vty *vty,
|
|
|
|
bool use_json,
|
|
|
|
json_object *json_paths);
|
2018-07-02 17:25:32 +02:00
|
|
|
|
2017-01-23 03:45:30 +01:00
|
|
|
#endif /* _FRR_BGP_FLOWSPEC_H */
|