Pavel Kotucek | 3e046ea | 2016-12-05 08:27:37 +0100 | [diff] [blame] | 1 | /* |
| 2 | * |
| 3 | * ip6_neighboor.h: ip6 neighbor structures |
| 4 | * |
| 5 | * Copyright (c) 2016 Cisco and/or its affiliates. |
| 6 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | * you may not use this file except in compliance with the License. |
| 8 | * You may obtain a copy of the License at: |
| 9 | * |
| 10 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | * |
| 12 | * Unless required by applicable law or agreed to in writing, software |
| 13 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | * See the License for the specific language governing permissions and |
| 16 | * limitations under the License. |
| 17 | */ |
| 18 | |
| 19 | #ifndef included_ip6_neighbor_h |
| 20 | #define included_ip6_neighbor_h |
| 21 | |
| 22 | #include <vnet/fib/fib_types.h> |
| 23 | |
Dave Barach | d7cb1b5 | 2016-12-09 09:52:16 -0500 | [diff] [blame] | 24 | typedef struct |
| 25 | { |
Pavel Kotucek | 3e046ea | 2016-12-05 08:27:37 +0100 | [diff] [blame] | 26 | ip6_address_t ip6_address; |
| 27 | u32 sw_if_index; |
| 28 | u32 pad; |
| 29 | } ip6_neighbor_key_t; |
| 30 | |
Neale Ranns | b3b2de7 | 2017-03-08 05:17:22 -0800 | [diff] [blame] | 31 | typedef enum ip6_neighbor_flags_t_ |
| 32 | { |
| 33 | IP6_NEIGHBOR_FLAG_STATIC = (1 << 0), |
| 34 | IP6_NEIGHBOR_FLAG_DYNAMIC = (1 << 1), |
| 35 | IP6_NEIGHBOR_FLAG_NO_FIB_ENTRY = (1 << 2), |
| 36 | } __attribute__ ((packed)) ip6_neighbor_flags_t; |
| 37 | |
Dave Barach | d7cb1b5 | 2016-12-09 09:52:16 -0500 | [diff] [blame] | 38 | typedef struct |
| 39 | { |
Pavel Kotucek | 3e046ea | 2016-12-05 08:27:37 +0100 | [diff] [blame] | 40 | ip6_neighbor_key_t key; |
| 41 | u8 link_layer_address[8]; |
Neale Ranns | b3b2de7 | 2017-03-08 05:17:22 -0800 | [diff] [blame] | 42 | ip6_neighbor_flags_t flags; |
Pavel Kotucek | 3e046ea | 2016-12-05 08:27:37 +0100 | [diff] [blame] | 43 | u64 cpu_time_last_updated; |
| 44 | fib_node_index_t fib_entry_index; |
| 45 | } ip6_neighbor_t; |
| 46 | |
Neale Ranns | 3f844d0 | 2017-02-18 00:03:54 -0800 | [diff] [blame] | 47 | extern ip6_neighbor_t *ip6_neighbors_entries (u32 sw_if_index); |
| 48 | |
| 49 | extern int ip6_neighbor_ra_config (vlib_main_t * vm, u32 sw_if_index, |
| 50 | u8 suppress, u8 managed, u8 other, |
| 51 | u8 ll_option, u8 send_unicast, u8 cease, |
| 52 | u8 use_lifetime, u32 lifetime, |
| 53 | u32 initial_count, u32 initial_interval, |
| 54 | u32 max_interval, u32 min_interval, |
| 55 | u8 is_no); |
| 56 | |
| 57 | extern int ip6_neighbor_ra_prefix (vlib_main_t * vm, u32 sw_if_index, |
| 58 | ip6_address_t * prefix_addr, u8 prefix_len, |
| 59 | u8 use_default, u32 val_lifetime, |
| 60 | u32 pref_lifetime, u8 no_advertise, |
| 61 | u8 off_link, u8 no_autoconfig, |
| 62 | u8 no_onlink, u8 is_no); |
| 63 | |
| 64 | extern clib_error_t *ip6_set_neighbor_limit (u32 neighbor_limit); |
| 65 | |
| 66 | extern void vnet_register_ip6_neighbor_resolution_event (vnet_main_t * vnm, |
| 67 | void *address_arg, |
| 68 | uword node_index, |
| 69 | uword type_opaque, |
| 70 | uword data); |
| 71 | |
| 72 | extern int vnet_set_ip6_ethernet_neighbor (vlib_main_t * vm, |
| 73 | u32 sw_if_index, |
| 74 | ip6_address_t * a, |
| 75 | u8 * link_layer_address, |
| 76 | uword n_bytes_link_layer_address, |
Neale Ranns | b3b2de7 | 2017-03-08 05:17:22 -0800 | [diff] [blame] | 77 | int is_static, |
| 78 | int is_no_fib_entry); |
Neale Ranns | 3f844d0 | 2017-02-18 00:03:54 -0800 | [diff] [blame] | 79 | |
| 80 | extern int vnet_unset_ip6_ethernet_neighbor (vlib_main_t * vm, |
| 81 | u32 sw_if_index, |
| 82 | ip6_address_t * a, |
| 83 | u8 * link_layer_address, |
| 84 | uword |
| 85 | n_bytes_link_layer_address); |
| 86 | |
| 87 | extern int ip6_neighbor_proxy_add_del (u32 sw_if_index, |
| 88 | ip6_address_t * addr, u8 is_add); |
Pavel Kotucek | 3e046ea | 2016-12-05 08:27:37 +0100 | [diff] [blame] | 89 | |
Pavel Kotucek | 9f5a2b6 | 2017-06-14 13:56:55 +0200 | [diff] [blame] | 90 | u32 ip6_neighbor_sw_interface_add_del (vnet_main_t * vnm, u32 sw_if_index, |
| 91 | u32 is_add); |
Eyal Bari | c125ecc | 2017-09-20 11:29:17 +0300 | [diff] [blame] | 92 | typedef struct |
| 93 | { |
| 94 | u32 sw_if_index; |
| 95 | ip6_address_t ip6; |
| 96 | u8 mac[6]; |
| 97 | } wc_nd_report_t; |
| 98 | |
| 99 | void wc_nd_set_publisher_node (uword node_index, uword event_type); |
Pavel Kotucek | 9f5a2b6 | 2017-06-14 13:56:55 +0200 | [diff] [blame] | 100 | |
Dave Barach | d7cb1b5 | 2016-12-09 09:52:16 -0500 | [diff] [blame] | 101 | #endif /* included_ip6_neighbor_h */ |
| 102 | |
| 103 | /* |
| 104 | * fd.io coding-style-patch-verification: ON |
| 105 | * |
| 106 | * Local Variables: |
| 107 | * eval: (c-set-style "gnu") |
| 108 | * End: |
| 109 | */ |