1cbe25aabSNeale Ranns/*
2cbe25aabSNeale Ranns *
3cbe25aabSNeale Ranns * ip6_neighboor.h: ip6 neighbor structures
4cbe25aabSNeale Ranns *
5cbe25aabSNeale Ranns * Copyright (c) 2016 Cisco and/or its affiliates.
6cbe25aabSNeale Ranns * Licensed under the Apache License, Version 2.0 (the "License");
7cbe25aabSNeale Ranns * you may not use this file except in compliance with the License.
8cbe25aabSNeale Ranns * You may obtain a copy of the License at:
9cbe25aabSNeale Ranns *
10cbe25aabSNeale Ranns *     http://www.apache.org/licenses/LICENSE-2.0
11cbe25aabSNeale Ranns *
12cbe25aabSNeale Ranns * Unless required by applicable law or agreed to in writing, software
13cbe25aabSNeale Ranns * distributed under the License is distributed on an "AS IS" BASIS,
14cbe25aabSNeale Ranns * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15cbe25aabSNeale Ranns * See the License for the specific language governing permissions and
16cbe25aabSNeale Ranns * limitations under the License.
17cbe25aabSNeale Ranns */
18cbe25aabSNeale Ranns
19cbe25aabSNeale Ranns#ifndef __IP6_RA_H__
20cbe25aabSNeale Ranns#define __IP6_RA_H__
21cbe25aabSNeale Ranns
22cbe25aabSNeale Ranns#include <vnet/fib/fib_types.h>
23cbe25aabSNeale Ranns
24cbe25aabSNeale Rannsextern int ip6_ra_config (vlib_main_t * vm, u32 sw_if_index,
25cbe25aabSNeale Ranns			  u8 suppress, u8 managed, u8 other,
26cbe25aabSNeale Ranns			  u8 ll_option, u8 send_unicast, u8 cease,
27cbe25aabSNeale Ranns			  u8 use_lifetime, u32 lifetime,
28cbe25aabSNeale Ranns			  u32 initial_count, u32 initial_interval,
29cbe25aabSNeale Ranns			  u32 max_interval, u32 min_interval, u8 is_no);
30cbe25aabSNeale Ranns
31cbe25aabSNeale Rannsextern int ip6_ra_prefix (vlib_main_t * vm, u32 sw_if_index,
32cbe25aabSNeale Ranns			  ip6_address_t * prefix_addr, u8 prefix_len,
33cbe25aabSNeale Ranns			  u8 use_default, u32 val_lifetime,
34cbe25aabSNeale Ranns			  u32 pref_lifetime, u8 no_advertise,
35cbe25aabSNeale Ranns			  u8 off_link, u8 no_autoconfig,
36cbe25aabSNeale Ranns			  u8 no_onlink, u8 is_no);
37cbe25aabSNeale Ranns
38cbe25aabSNeale Rannstypedef struct
39cbe25aabSNeale Ranns{
40cbe25aabSNeale Ranns  u32 irt;
41cbe25aabSNeale Ranns  u32 mrt;
42cbe25aabSNeale Ranns  u32 mrc;
43cbe25aabSNeale Ranns  u32 mrd;
44cbe25aabSNeale Ranns} icmp6_send_router_solicitation_params_t;
45cbe25aabSNeale Ranns
46cbe25aabSNeale Rannsextern void icmp6_send_router_solicitation (vlib_main_t * vm,
47cbe25aabSNeale Ranns					    u32 sw_if_index,
48cbe25aabSNeale Ranns					    u8 stop,
49cbe25aabSNeale Ranns					    const
50cbe25aabSNeale Ranns					    icmp6_send_router_solicitation_params_t
51cbe25aabSNeale Ranns					    * params);
52cbe25aabSNeale Ranns
53cbe25aabSNeale Rannstypedef struct
54cbe25aabSNeale Ranns{
55cbe25aabSNeale Ranns  fib_prefix_t prefix;
56cbe25aabSNeale Ranns  u8 flags;
57cbe25aabSNeale Ranns  u32 valid_time;
58cbe25aabSNeale Ranns  u32 preferred_time;
59cbe25aabSNeale Ranns} ra_report_prefix_info_t;
60cbe25aabSNeale Ranns
61cbe25aabSNeale Rannstypedef struct
62cbe25aabSNeale Ranns{
63cbe25aabSNeale Ranns  ip6_address_t router_address;
64cbe25aabSNeale Ranns  u32 sw_if_index;
65cbe25aabSNeale Ranns  u8 current_hop_limit;
66cbe25aabSNeale Ranns  u8 flags;
67cbe25aabSNeale Ranns  u16 router_lifetime_in_sec;
68cbe25aabSNeale Ranns  u32 neighbor_reachable_time_in_msec;
69cbe25aabSNeale Ranns  u32 time_in_msec_between_retransmitted_neighbor_solicitations;
70cbe25aabSNeale Ranns  u8 slla[6];
71cbe25aabSNeale Ranns  u32 mtu;
72cbe25aabSNeale Ranns  ra_report_prefix_info_t *prefixes;
73cbe25aabSNeale Ranns} ip6_ra_report_t;
74cbe25aabSNeale Ranns
75cbe25aabSNeale Ranns
76cbe25aabSNeale Rannstypedef void (*ip6_ra_report_notify_t) (const ip6_ra_report_t * rap);
77cbe25aabSNeale Ranns
78cbe25aabSNeale Rannsextern void ip6_ra_report_register (ip6_ra_report_notify_t fn);
79cbe25aabSNeale Rannsextern void ip6_ra_report_unregister (ip6_ra_report_notify_t fn);
80d1586962SDave Barachextern void ip6_ra_update_secondary_radv_info (ip6_address_t * address,
81d1586962SDave Barach					       u8 prefix_len,
82d1586962SDave Barach					       u32 primary_sw_if_index,
83d1586962SDave Barach					       u32 valid_time,
84d1586962SDave Barach					       u32 preferred_time);
85cbe25aabSNeale Ranns
86cbe25aabSNeale Ranns#endif /* included_ip6_neighbor_h */
87cbe25aabSNeale Ranns
88cbe25aabSNeale Ranns/*
89cbe25aabSNeale Ranns * fd.io coding-style-patch-verification: ON
90cbe25aabSNeale Ranns *
91cbe25aabSNeale Ranns * Local Variables:
92cbe25aabSNeale Ranns * eval: (c-set-style "gnu")
93cbe25aabSNeale Ranns * End:
94cbe25aabSNeale Ranns */
95