Proxy ND (RFC4389 - or a sub-set thereof). This allows the 'emulation' of bridging...
[vpp.git] / src / vnet / ip / ip6_neighbor.h
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
24 typedef struct
25 {
26   ip6_address_t ip6_address;
27   u32 sw_if_index;
28   u32 pad;
29 } ip6_neighbor_key_t;
30
31 typedef struct
32 {
33   ip6_neighbor_key_t key;
34   u8 link_layer_address[8];
35   u16 flags;
36 #define IP6_NEIGHBOR_FLAG_STATIC (1 << 0)
37 #define IP6_NEIGHBOR_FLAG_DYNAMIC  (2 << 0)
38   u64 cpu_time_last_updated;
39   fib_node_index_t fib_entry_index;
40 } ip6_neighbor_t;
41
42 extern ip6_neighbor_t *ip6_neighbors_entries (u32 sw_if_index);
43
44 extern int ip6_neighbor_ra_config (vlib_main_t * vm, u32 sw_if_index,
45                                    u8 suppress, u8 managed, u8 other,
46                                    u8 ll_option, u8 send_unicast, u8 cease,
47                                    u8 use_lifetime, u32 lifetime,
48                                    u32 initial_count, u32 initial_interval,
49                                    u32 max_interval, u32 min_interval,
50                                    u8 is_no);
51
52 extern int ip6_neighbor_ra_prefix (vlib_main_t * vm, u32 sw_if_index,
53                                    ip6_address_t * prefix_addr, u8 prefix_len,
54                                    u8 use_default, u32 val_lifetime,
55                                    u32 pref_lifetime, u8 no_advertise,
56                                    u8 off_link, u8 no_autoconfig,
57                                    u8 no_onlink, u8 is_no);
58
59 extern clib_error_t *ip6_set_neighbor_limit (u32 neighbor_limit);
60
61 extern void vnet_register_ip6_neighbor_resolution_event (vnet_main_t * vnm,
62                                                          void *address_arg,
63                                                          uword node_index,
64                                                          uword type_opaque,
65                                                          uword data);
66
67 extern int vnet_set_ip6_ethernet_neighbor (vlib_main_t * vm,
68                                            u32 sw_if_index,
69                                            ip6_address_t * a,
70                                            u8 * link_layer_address,
71                                            uword n_bytes_link_layer_address,
72                                            int is_static);
73
74 extern int vnet_unset_ip6_ethernet_neighbor (vlib_main_t * vm,
75                                              u32 sw_if_index,
76                                              ip6_address_t * a,
77                                              u8 * link_layer_address,
78                                              uword
79                                              n_bytes_link_layer_address);
80
81 extern int ip6_neighbor_proxy_add_del (u32 sw_if_index,
82                                        ip6_address_t * addr, u8 is_add);
83
84 #endif /* included_ip6_neighbor_h */
85
86 /*
87  * fd.io coding-style-patch-verification: ON
88  *
89  * Local Variables:
90  * eval: (c-set-style "gnu")
91  * End:
92  */