Dave Barach | b5e8a77 | 2016-12-06 12:04:42 -0500 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2016 Cisco and/or its affiliates. |
| 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | * you may not use this file except in compliance with the License. |
| 5 | * You may obtain a copy of the License at: |
| 6 | * |
| 7 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | * |
| 9 | * Unless required by applicable law or agreed to in writing, software |
| 10 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | * See the License for the specific language governing permissions and |
| 13 | * limitations under the License. |
| 14 | */ |
| 15 | |
| 16 | #ifndef __FIB_API_H__ |
| 17 | #define __FIB_API_H__ |
| 18 | |
Neale Ranns | 8145842 | 2018-03-12 06:59:36 -0700 | [diff] [blame] | 19 | #include <vnet/fib/fib_types.h> |
Dave Barach | b5e8a77 | 2016-12-06 12:04:42 -0500 | [diff] [blame] | 20 | |
| 21 | int |
| 22 | add_del_route_check (fib_protocol_t table_proto, |
| 23 | u32 table_id, |
| 24 | u32 next_hop_sw_if_index, |
Neale Ranns | da78f95 | 2017-05-24 09:15:43 -0700 | [diff] [blame] | 25 | dpo_proto_t next_hop_table_proto, |
Dave Barach | b5e8a77 | 2016-12-06 12:04:42 -0500 | [diff] [blame] | 26 | u32 next_hop_table_id, |
Neale Ranns | 0f26c5a | 2017-03-01 15:12:11 -0800 | [diff] [blame] | 27 | u8 is_rpf_id, |
Dave Barach | b5e8a77 | 2016-12-06 12:04:42 -0500 | [diff] [blame] | 28 | u32 * fib_index, u32 * next_hop_fib_index); |
| 29 | |
| 30 | int |
| 31 | add_del_route_t_handler (u8 is_multipath, |
| 32 | u8 is_add, |
| 33 | u8 is_drop, |
| 34 | u8 is_unreach, |
| 35 | u8 is_prohibit, |
| 36 | u8 is_local, |
Neale Ranns | 0f26c5a | 2017-03-01 15:12:11 -0800 | [diff] [blame] | 37 | u8 is_multicast, |
Dave Barach | b5e8a77 | 2016-12-06 12:04:42 -0500 | [diff] [blame] | 38 | u8 is_classify, |
| 39 | u32 classify_table_index, |
| 40 | u8 is_resolve_host, |
| 41 | u8 is_resolve_attached, |
Neale Ranns | 0f26c5a | 2017-03-01 15:12:11 -0800 | [diff] [blame] | 42 | u8 is_interface_rx, |
| 43 | u8 is_rpf_id, |
Neale Ranns | f068c3e | 2018-01-03 04:18:48 -0800 | [diff] [blame] | 44 | u8 is_dvr, |
Neale Ranns | 054c03a | 2017-10-13 05:15:07 -0700 | [diff] [blame] | 45 | u8 is_source_lookup, |
Neale Ranns | 810086d | 2017-11-05 16:26:46 -0800 | [diff] [blame] | 46 | u8 is_udp_encap, |
Dave Barach | b5e8a77 | 2016-12-06 12:04:42 -0500 | [diff] [blame] | 47 | u32 fib_index, |
| 48 | const fib_prefix_t * prefix, |
Neale Ranns | da78f95 | 2017-05-24 09:15:43 -0700 | [diff] [blame] | 49 | dpo_proto_t next_hop_proto, |
Dave Barach | b5e8a77 | 2016-12-06 12:04:42 -0500 | [diff] [blame] | 50 | const ip46_address_t * next_hop, |
Neale Ranns | 810086d | 2017-11-05 16:26:46 -0800 | [diff] [blame] | 51 | u32 next_hop_id, |
Dave Barach | b5e8a77 | 2016-12-06 12:04:42 -0500 | [diff] [blame] | 52 | u32 next_hop_sw_if_index, |
| 53 | u8 next_hop_fib_index, |
Neale Ranns | 57b5860 | 2017-07-15 07:37:25 -0700 | [diff] [blame] | 54 | u16 next_hop_weight, |
| 55 | u16 next_hop_preference, |
Dave Barach | b5e8a77 | 2016-12-06 12:04:42 -0500 | [diff] [blame] | 56 | mpls_label_t next_hop_via_label, |
Neale Ranns | 31ed744 | 2018-02-23 05:29:09 -0800 | [diff] [blame] | 57 | fib_mpls_label_t * next_hop_out_label_stack); |
Dave Barach | b5e8a77 | 2016-12-06 12:04:42 -0500 | [diff] [blame] | 58 | |
Neale Ranns | 8145842 | 2018-03-12 06:59:36 -0700 | [diff] [blame] | 59 | struct _vl_api_fib_path; |
| 60 | |
| 61 | extern void fib_api_path_encode (const fib_route_path_encode_t * api_rpath, |
| 62 | struct _vl_api_fib_path *out); |
Dave Barach | b5e8a77 | 2016-12-06 12:04:42 -0500 | [diff] [blame] | 63 | |
Neale Ranns | 2303cb1 | 2018-02-21 04:57:17 -0800 | [diff] [blame] | 64 | void |
| 65 | fib_prefix_to_api (const fib_prefix_t *pfx, |
| 66 | u8 address[16], |
| 67 | u8 *length, |
| 68 | u8 *is_ip6); |
| 69 | |
| 70 | |
| 71 | struct _vl_api_fib_path; |
| 72 | |
| 73 | extern int fib_path_api_parse(const struct _vl_api_fib_path *in, |
| 74 | fib_route_path_t *out); |
| 75 | |
Neale Ranns | d1e68ab | 2018-10-01 01:42:13 -0700 | [diff] [blame] | 76 | extern fib_protocol_t fib_proto_from_api_address_family (int af); |
| 77 | extern int fib_proto_to_api_address_family (fib_protocol_t fproto); |
| 78 | |
Dave Barach | b5e8a77 | 2016-12-06 12:04:42 -0500 | [diff] [blame] | 79 | #endif /* __FIB_API_H__ */ |