]> git.proxmox.com Git - mirror_frr.git/blob - bgpd/bgp_flowspec_util.h
Merge pull request #1978 from qlyoung/fix-debug-all-vtysh-node
[mirror_frr.git] / bgpd / bgp_flowspec_util.h
1 /* BGP Flowspec header for utilities
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_UTIL_H
20 #define _FRR_BGP_FLOWSPEC_UTIL_H
21
22 #include "zclient.h"
23
24 #define BGP_FLOWSPEC_STRING_DISPLAY_MAX 512
25
26 enum bgp_flowspec_util_nlri_t {
27 BGP_FLOWSPEC_VALIDATE_ONLY = 0,
28 BGP_FLOWSPEC_RETURN_STRING = 1,
29 BGP_FLOWSPEC_CONVERT_TO_NON_OPAQUE = 2,
30 BGP_FLOWSPEC_RETURN_JSON = 3,
31 };
32
33
34 extern int bgp_flowspec_op_decode(enum bgp_flowspec_util_nlri_t type,
35 uint8_t *nlri_ptr,
36 uint32_t max_len,
37 void *result, int *error);
38
39 extern int bgp_flowspec_ip_address(enum bgp_flowspec_util_nlri_t type,
40 uint8_t *nlri_ptr,
41 uint32_t max_len,
42 void *result, int *error);
43
44 extern int bgp_flowspec_tcpflags_decode(enum bgp_flowspec_util_nlri_t type,
45 uint8_t *nlri_ptr,
46 uint32_t max_len,
47 void *result, int *error);
48
49 extern int bgp_flowspec_fragment_type_decode(enum bgp_flowspec_util_nlri_t type,
50 uint8_t *nlri_ptr,
51 uint32_t max_len,
52 void *result, int *error);
53
54 extern struct bgp_node *bgp_flowspec_get_match_per_ip(afi_t afi,
55 struct bgp_table *rib,
56 struct prefix *match,
57 int prefix_check);
58 #endif /* _FRR_BGP_FLOWSPEC_UTIL_H */