]> git.proxmox.com Git - mirror_frr.git/blob - bgpd/bgp_flowspec.h
Merge pull request #1998 from qlyoung/fix-vrf-keyword-walkup
[mirror_frr.git] / bgpd / bgp_flowspec.h
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
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
27
28 #define BGP_FLOWSPEC_NLRI_STRING_MAX 512
29
30 extern int bgp_nlri_parse_flowspec(struct peer *peer, struct attr *attr,
31 struct bgp_nlri *packet, int withdraw);
32
33 extern void bgp_flowspec_vty_init(void);
34
35 extern int bgp_show_table_flowspec(struct vty *vty, struct bgp *bgp, afi_t afi,
36 struct bgp_table *table,
37 enum bgp_show_type type,
38 void *output_arg, uint8_t use_json,
39 int is_last,
40 unsigned long *output_cum,
41 unsigned long *total_cum);
42
43 extern void bgp_fs_nlri_get_string(unsigned char *nlri_content, size_t len,
44 char *return_string, int format,
45 json_object *json_path);
46
47 extern void route_vty_out_flowspec(struct vty *vty, struct prefix *p,
48 struct bgp_info *binfo,
49 int display, json_object *json_paths);
50 #endif /* _FRR_BGP_FLOWSPEC_H */