]> git.proxmox.com Git - mirror_frr.git/blame - bgpd/bgp_flowspec.h
Merge pull request #10399 from g-balaji1/pimv6-sock
[mirror_frr.git] / bgpd / bgp_flowspec.h
CommitLineData
7c40bf39 1/* BGP Flowspec header for packet handling
2 * Copyright (C) 2018 6WIND
3 *
4 * FRRouting is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2, or (at your option) any
7 * later version.
8 *
9 * FRRouting is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program; see the file COPYING; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
19#ifndef _FRR_BGP_FLOWSPEC_H
20#define _FRR_BGP_FLOWSPEC_H
21
d33fc23b
PG
22#define NLRI_STRING_FORMAT_LARGE 0
23#define NLRI_STRING_FORMAT_DEBUG 1
24#define NLRI_STRING_FORMAT_MIN 2
25#define NLRI_STRING_FORMAT_JSON 3
26#define NLRI_STRING_FORMAT_JSON_SIMPLE 4
dba3c1d3
PG
27
28#define BGP_FLOWSPEC_NLRI_STRING_MAX 512
29
7c40bf39 30extern int bgp_nlri_parse_flowspec(struct peer *peer, struct attr *attr,
31 struct bgp_nlri *packet, int withdraw);
32
33extern void bgp_flowspec_vty_init(void);
34
dba3c1d3
PG
35extern int bgp_show_table_flowspec(struct vty *vty, struct bgp *bgp, afi_t afi,
36 struct bgp_table *table,
088f1098
DS
37 enum bgp_show_type type, void *output_arg,
38 bool use_json, int is_last,
dba3c1d3
PG
39 unsigned long *output_cum,
40 unsigned long *total_cum);
41
42extern void bgp_fs_nlri_get_string(unsigned char *nlri_content, size_t len,
d33fc23b 43 char *return_string, int format,
1840384b
PG
44 json_object *json_path,
45 afi_t afi);
dba3c1d3 46
bd494ec5 47extern void route_vty_out_flowspec(struct vty *vty, const struct prefix *p,
9b6d8fcf 48 struct bgp_path_info *path, int display,
4b7e6066 49 json_object *json_paths);
4762c213
PG
50extern int bgp_fs_config_write_pbr(struct vty *vty, struct bgp *bgp,
51 afi_t afi, safi_t safi);
52
088f1098
DS
53extern int bgp_flowspec_display_match_per_ip(afi_t afi, struct bgp_table *rib,
54 struct prefix *match,
55 int prefix_check, struct vty *vty,
56 bool use_json,
57 json_object *json_paths);
63a0b7a9 58
7c40bf39 59#endif /* _FRR_BGP_FLOWSPEC_H */