]>
Commit | Line | Data |
---|---|---|
acddc0ed | 1 | // SPDX-License-Identifier: GPL-2.0-or-later |
034cdee9 PG |
2 | /* BGP Flowspec header for utilities |
3 | * Copyright (C) 2018 6WIND | |
034cdee9 PG |
4 | */ |
5 | ||
6 | #ifndef _FRR_BGP_FLOWSPEC_UTIL_H | |
7 | #define _FRR_BGP_FLOWSPEC_UTIL_H | |
8 | ||
9 | #include "zclient.h" | |
10 | ||
11 | #define BGP_FLOWSPEC_STRING_DISPLAY_MAX 512 | |
12 | ||
13 | enum bgp_flowspec_util_nlri_t { | |
14 | BGP_FLOWSPEC_VALIDATE_ONLY = 0, | |
15 | BGP_FLOWSPEC_RETURN_STRING = 1, | |
d33fc23b PG |
16 | BGP_FLOWSPEC_CONVERT_TO_NON_OPAQUE = 2, |
17 | BGP_FLOWSPEC_RETURN_JSON = 3, | |
034cdee9 PG |
18 | }; |
19 | ||
20 | ||
21 | extern int bgp_flowspec_op_decode(enum bgp_flowspec_util_nlri_t type, | |
22 | uint8_t *nlri_ptr, | |
23 | uint32_t max_len, | |
24 | void *result, int *error); | |
25 | ||
26 | extern int bgp_flowspec_ip_address(enum bgp_flowspec_util_nlri_t type, | |
27 | uint8_t *nlri_ptr, | |
28 | uint32_t max_len, | |
1840384b | 29 | void *result, int *error, |
9cec4121 | 30 | afi_t afi, uint8_t *ipv6_offset); |
034cdee9 | 31 | |
588ec356 | 32 | extern int bgp_flowspec_bitmask_decode(enum bgp_flowspec_util_nlri_t type, |
034cdee9 PG |
33 | uint8_t *nlri_ptr, |
34 | uint32_t max_len, | |
35 | void *result, int *error); | |
36 | ||
47555ee9 PG |
37 | struct bgp_pbr_entry_main; |
38 | extern int bgp_flowspec_match_rules_fill(uint8_t *nlri_content, int len, | |
1840384b PG |
39 | struct bgp_pbr_entry_main *bpem, |
40 | afi_t afi); | |
034cdee9 | 41 | |
bd494ec5 | 42 | extern bool bgp_flowspec_contains_prefix(const struct prefix *pfs, |
63a0b7a9 PG |
43 | struct prefix *input, |
44 | int prefix_check); | |
45 | ||
3dc339cd | 46 | extern bool bgp_flowspec_get_first_nh(struct bgp *bgp, struct bgp_path_info *pi, |
1840384b | 47 | struct prefix *nh, afi_t afi); |
0378bcaa | 48 | |
034cdee9 | 49 | #endif /* _FRR_BGP_FLOWSPEC_UTIL_H */ |