3 * ip6_neighboor.h: ip6 neighbor structures
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:
10 * http://www.apache.org/licenses/LICENSE-2.0
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.
22 #include <vnet/fib/fib_types.h>
24 /* advertised prefix option */
27 /* basic advertised information */
31 int adv_autonomous_flag;
32 u32 adv_valid_lifetime_in_secs;
33 u32 adv_pref_lifetime_in_secs;
35 /* advertised values are computed from these times if decrementing */
36 f64 valid_lifetime_expires;
37 f64 pref_lifetime_expires;
39 /* local information */
41 int deprecated_prefix_flag;
42 int decrement_lifetime_flag;
44 #define MIN_ADV_VALID_LIFETIME 7203 /* seconds */
45 #define DEF_ADV_VALID_LIFETIME 2592000
46 #define DEF_ADV_PREF_LIFETIME 604800
48 /* extensions are added here, mobile, DNS etc.. */
57 } icmp6_send_router_solicitation_params_t;
59 typedef struct ip6_ra_t_
61 /* advertised config information, zero means unspecified */
65 u16 adv_router_lifetime_in_sec;
66 u32 adv_neighbor_reachable_time_in_msec;
67 u32 adv_time_in_msec_between_retransmitted_neighbor_solicitations;
72 /* local information */
74 int send_radv; /* radv on/off on this interface - set by config */
75 int cease_radv; /* we are ceasing to send - set byf config */
77 int adv_link_layer_address;
79 int failed_device_check;
83 ip6_radv_prefix_t *adv_prefixes_pool;
85 /* Hash table mapping address to index in interface advertised prefix pool.
87 mhash_t address_to_prefix_index;
89 f64 max_radv_interval;
90 f64 min_radv_interval;
91 f64 min_delay_between_radv;
92 f64 max_delay_between_radv;
93 f64 max_rtr_default_lifetime;
96 f64 last_multicast_time;
97 f64 next_multicast_time;
99 u32 initial_adverts_count;
100 f64 initial_adverts_interval;
101 u32 initial_adverts_sent;
104 u32 n_advertisements_sent;
105 u32 n_solicitations_rcvd;
106 u32 n_solicitations_dropped;
108 /* router solicitations sending state */
109 u8 keep_sending_rs; /* when true then next fields are valid */
110 icmp6_send_router_solicitation_params_t params;
115 vlib_buffer_t *buffer;
121 extern ip6_ra_t *ip6_ra_get_itf (u32 sw_if_index);
123 extern int ip6_ra_config (vlib_main_t * vm, u32 sw_if_index,
124 u8 suppress, u8 managed, u8 other,
125 u8 ll_option, u8 send_unicast, u8 cease,
126 u8 use_lifetime, u32 lifetime,
127 u32 initial_count, u32 initial_interval,
128 u32 max_interval, u32 min_interval, u8 is_no);
130 extern int ip6_ra_prefix (vlib_main_t * vm, u32 sw_if_index,
131 ip6_address_t * prefix_addr, u8 prefix_len,
132 u8 use_default, u32 val_lifetime,
133 u32 pref_lifetime, u8 no_advertise,
134 u8 off_link, u8 no_autoconfig,
135 u8 no_onlink, u8 is_no);
137 typedef walk_rc_t (*ip6_ra_itf_walk_fn_t) (u32 sw_if_index, void *ctx);
139 extern void ip6_ra_itf_walk (ip6_ra_itf_walk_fn_t fn, void *ctx);
141 extern void icmp6_send_router_solicitation (vlib_main_t * vm,
145 icmp6_send_router_solicitation_params_t
154 } ra_report_prefix_info_t;
158 ip6_address_t router_address;
160 u8 current_hop_limit;
162 u16 router_lifetime_in_sec;
163 u32 neighbor_reachable_time_in_msec;
164 u32 time_in_msec_between_retransmitted_neighbor_solicitations;
167 ra_report_prefix_info_t *prefixes;
171 typedef void (*ip6_ra_report_notify_t) (const ip6_ra_report_t * rap);
173 extern void ip6_ra_report_register (ip6_ra_report_notify_t fn);
174 extern void ip6_ra_report_unregister (ip6_ra_report_notify_t fn);
175 extern void ip6_ra_update_secondary_radv_info (ip6_address_t * address,
177 u32 primary_sw_if_index,
180 extern u8 ip6_ra_adv_enabled (u32 sw_if_index);
181 #endif /* included_ip6_neighbor_h */
184 * fd.io coding-style-patch-verification: ON
187 * eval: (c-set-style "gnu")