FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
ip6_nd_api.c
Go to the documentation of this file.
1 /*
2  *------------------------------------------------------------------
3  * ip_api.c - vnet ip api
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 
20 #include <stddef.h>
21 
22 #include <vnet/ip6-nd/ip6_nd.h>
23 #include <vnet/ip6-nd/ip6_ra.h>
24 
25 #include <vnet/fib/fib_table.h>
26 #include <vnet/ip/ip_types_api.h>
27 
28 #include <vpp/app/version.h>
29 
30 #include <vlibapi/api.h>
31 #include <vlibmemory/api.h>
32 
33 /* define message IDs */
34 #include <vnet/format_fns.h>
35 #include <vnet/ip6-nd/ip6_nd.api_enum.h>
36 #include <vnet/ip6-nd/ip6_nd.api_types.h>
37 
38 /**
39  * Base message ID fot the plugin
40  */
42 #define REPLY_MSG_ID_BASE ip6_nd_base_msg_id
43 
45 
46 static void
48  u32 context,
49  const ip46_address_t * addr, u32 sw_if_index)
50 {
52 
53  mp = vl_msg_api_alloc (sizeof (*mp));
54  clib_memset (mp, 0, sizeof (*mp));
55  mp->_vl_msg_id = ntohs (VL_API_IP6ND_PROXY_DETAILS);
56  mp->context = context;
57  mp->sw_if_index = htonl (sw_if_index);
58 
59  ip6_address_encode (&addr->ip6, mp->ip);
60 
61  vl_api_send_msg (reg, (u8 *) mp);
62 }
63 
65 {
68 
71 {
73 
75  {
76  vec_add1 (ctx->indices, fei);
77  }
78 
79  return (FIB_TABLE_WALK_CONTINUE);
80 }
81 
82 static void
84 {
85  ip6_main_t *im6 = &ip6_main;
86  u32 fib_index;
88  .indices = NULL,
89  };
90  fib_node_index_t *feip;
91  const fib_prefix_t *pfx;
93 
95  if (!reg)
96  return;
97 
98  /* *INDENT-OFF* */
99  pool_foreach_index (fib_index, im6->fibs)
100  {
101  fib_table_walk (fib_index, FIB_PROTOCOL_IP6,
103  }
104  /* *INDENT-ON* */
105 
107 
108  vec_foreach (feip, ctx.indices)
109  {
110  pfx = fib_entry_get_prefix (*feip);
111 
113  mp->context,
114  &pfx->fp_addr,
116  }
117 
118  vec_free (ctx.indices);
119 }
120 
121 static void
124 {
125  vl_api_ip6nd_proxy_enable_disable_reply_t *rmp;
126  int rv = 0;
127 
129 
130  if (mp->is_enable)
131  rv = ip6_nd_proxy_enable_disable (ntohl (mp->sw_if_index), 1);
132  else
133  rv = ip6_nd_proxy_enable_disable (ntohl (mp->sw_if_index), 0);
134 
136  REPLY_MACRO (VL_API_IP6ND_PROXY_ENABLE_DISABLE_REPLY);
137 }
138 
139 static void
141 {
142  vl_api_ip6nd_proxy_add_del_reply_t *rmp;
143  ip6_address_t ip6;
144  int rv = 0;
145 
147 
148  ip6_address_decode (mp->ip, &ip6);
149  if (mp->is_add)
150  rv = ip6_nd_proxy_add (ntohl (mp->sw_if_index), &ip6);
151  else
152  rv = ip6_nd_proxy_del (ntohl (mp->sw_if_index), &ip6);
153 
155  REPLY_MACRO (VL_API_IP6ND_PROXY_ADD_DEL_REPLY);
156 }
157 
158 static void
161 {
162  vl_api_sw_interface_ip6nd_ra_config_reply_t *rmp;
164  int rv = 0;
165  u8 is_no, suppress, managed, other, ll_option, send_unicast, cease,
166  default_router;
167 
168  is_no = mp->is_no == 1;
169  suppress = mp->suppress == 1;
170  managed = mp->managed == 1;
171  other = mp->other == 1;
172  ll_option = mp->ll_option == 1;
173  send_unicast = mp->send_unicast == 1;
174  cease = mp->cease == 1;
175  default_router = mp->default_router == 1;
176 
178 
179  rv = ip6_ra_config (vm, ntohl (mp->sw_if_index),
180  suppress, managed, other,
181  ll_option, send_unicast, cease,
182  default_router, ntohl (mp->lifetime),
183  ntohl (mp->initial_count),
184  ntohl (mp->initial_interval),
185  ntohl (mp->max_interval),
186  ntohl (mp->min_interval), is_no);
187 
189 
190  REPLY_MACRO (VL_API_SW_INTERFACE_IP6ND_RA_CONFIG_REPLY);
191 }
192 
193 static void
196 {
198  vl_api_sw_interface_ip6nd_ra_prefix_reply_t *rmp;
199  fib_prefix_t pfx;
200  int rv = 0;
201  u8 is_no, use_default, no_advertise, off_link, no_autoconfig, no_onlink;
202 
204 
205  ip_prefix_decode (&mp->prefix, &pfx);
206  is_no = mp->is_no == 1;
207  use_default = mp->use_default == 1;
208  no_advertise = mp->no_advertise == 1;
209  off_link = mp->off_link == 1;
210  no_autoconfig = mp->no_autoconfig == 1;
211  no_onlink = mp->no_onlink == 1;
212 
213  rv = ip6_ra_prefix (vm, ntohl (mp->sw_if_index),
214  &pfx.fp_addr.ip6,
215  pfx.fp_len, use_default,
216  ntohl (mp->val_lifetime),
217  ntohl (mp->pref_lifetime), no_advertise,
218  off_link, no_autoconfig, no_onlink, is_no);
219 
221  REPLY_MACRO (VL_API_SW_INTERFACE_IP6ND_RA_PREFIX_REPLY);
222 }
223 
224 static void
227 {
228  vl_api_ip6nd_send_router_solicitation_reply_t *rmp;
231  int rv = 0;
232 
234 
236  REPLY_MACRO (VL_API_IP6ND_SEND_ROUTER_SOLICITATION_REPLY);
237 
238  if (rv != 0)
239  return;
240 
241  params.irt = ntohl (mp->irt);
242  params.mrt = ntohl (mp->mrt);
243  params.mrc = ntohl (mp->mrc);
244  params.mrd = ntohl (mp->mrd);
245 
247  &params);
248 }
249 
250 static void
252 {
253  /* *INDENT-OFF* */
255 
256  pool_foreach (rp, vpe_api_main.ip6_ra_events_registrations)
257  {
258  vl_api_registration_t *vl_reg;
259 
261 
262  if (vl_reg && vl_api_can_send_msg (vl_reg))
263  {
264  vl_api_ip6_ra_prefix_info_t *prefix;
265  vl_api_ip6_ra_event_t *event;
266 
267  u32 event_size = (sizeof (vl_api_ip6_ra_event_t) +
268  vec_len (rap->prefixes) *
269  sizeof (vl_api_ip6_ra_prefix_info_t));
270  event = vl_msg_api_alloc_zero (event_size);
271 
272  event->_vl_msg_id = htons (VL_API_IP6_RA_EVENT + REPLY_MSG_ID_BASE);
273  event->client_index = rp->client_index;
274  event->pid = rp->client_pid;
275  event->sw_if_index = clib_host_to_net_u32 (rap->sw_if_index);
276 
278  event->router_addr);
279 
280  event->current_hop_limit = rap->current_hop_limit;
281  event->flags = rap->flags;
282  event->router_lifetime_in_sec =
283  clib_host_to_net_u16 (rap->router_lifetime_in_sec);
284  event->neighbor_reachable_time_in_msec =
285  clib_host_to_net_u32 (rap->neighbor_reachable_time_in_msec);
286  event->time_in_msec_between_retransmitted_neighbor_solicitations =
288  event->n_prefixes = clib_host_to_net_u32 (vec_len (rap->prefixes));
289 
290  prefix = event->prefixes;
291  // (typeof (prefix)) event->prefixes;
292  u32 j;
293  for (j = 0; j < vec_len (rap->prefixes); j++)
294  {
295  ra_report_prefix_info_t *info = &rap->prefixes[j];
296  ip_prefix_encode(&info->prefix, &prefix->prefix);
297  prefix->flags = info->flags;
298  prefix->valid_time = clib_host_to_net_u32 (info->valid_time);
299  prefix->preferred_time =
300  clib_host_to_net_u32 (info->preferred_time);
301  prefix++;
302  }
303 
304  vl_api_send_msg (vl_reg, (u8 *) event);
305  }
306  }
307  /* *INDENT-ON* */
308 }
309 
310 static void
312 {
314  vl_api_want_ip6_ra_events_reply_t *rmp;
315  int rv = 0, had_reg, have_reg;
316 
317  had_reg = hash_elts (am->ip6_ra_events_registration_hash);
318  uword *p = hash_get (am->ip6_ra_events_registration_hash, mp->client_index);
320  if (p)
321  {
322  if (mp->enable)
323  {
324  clib_warning ("pid %d: already enabled...", ntohl (mp->pid));
325  rv = VNET_API_ERROR_INVALID_REGISTRATION;
326  goto reply;
327  }
328  else
329  {
330  rp = pool_elt_at_index (am->ip6_ra_events_registrations, p[0]);
331  pool_put (am->ip6_ra_events_registrations, rp);
332  hash_unset (am->ip6_ra_events_registration_hash, mp->client_index);
333  goto reply;
334  }
335  }
336  if (mp->enable == 0)
337  {
338  clib_warning ("pid %d: already disabled...", ntohl (mp->pid));
339  rv = VNET_API_ERROR_INVALID_REGISTRATION;
340  goto reply;
341  }
342  pool_get (am->ip6_ra_events_registrations, rp);
343  rp->client_index = mp->client_index;
344  rp->client_pid = ntohl (mp->pid);
345  hash_set (am->ip6_ra_events_registration_hash, rp->client_index,
346  rp - am->ip6_ra_events_registrations);
347 
348 reply:
349  have_reg = hash_elts (am->ip6_ra_events_registration_hash);
350 
351  if (!had_reg && have_reg)
353  else if (had_reg && !have_reg)
355 
356  REPLY_MACRO (VL_API_WANT_IP6_RA_EVENTS_REPLY);
357 }
358 
359 static clib_error_t *
361 {
364  uword *p;
365 
366  p = hash_get (am->ip6_ra_events_registration_hash, client_index);
367 
368  if (p)
369  {
370  rp = pool_elt_at_index (am->ip6_ra_events_registrations, p[0]);
371  pool_put (am->ip6_ra_events_registrations, rp);
372  hash_unset (am->ip6_ra_events_registration_hash, client_index);
373  }
374  return (NULL);
375 }
376 
378 
379 #include <vnet/ip6-nd/ip6_nd.api.c>
380 
381 static clib_error_t *
383 {
384  /* Ask for a correctly-sized block of API message decode slots */
386 
387  return 0;
388 }
389 
391 
392 /*
393  * fd.io coding-style-patch-verification: ON
394  *
395  * Local Variables:
396  * eval: (c-set-style "gnu")
397  * End:
398  */
vl_api_sw_interface_ip6nd_ra_config_t::default_router
u8 default_router
Definition: ip6_nd.api:57
ip6_ra_prefix
int ip6_ra_prefix(vlib_main_t *vm, u32 sw_if_index, ip6_address_t *prefix_addr, u8 prefix_len, u8 use_default, u32 val_lifetime, u32 pref_lifetime, u8 no_advertise, u8 off_link, u8 no_autoconfig, u8 no_onlink, u8 is_no)
Definition: ip6_ra.c:1786
vl_api_sw_interface_ip6nd_ra_prefix_t::no_autoconfig
bool no_autoconfig
Definition: ip6_nd.api:102
VALIDATE_SW_IF_INDEX
#define VALIDATE_SW_IF_INDEX(mp)
Definition: api_helper_macros.h:281
vl_api_client_index_to_registration
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
Definition: api.h:79
icmp6_send_router_solicitation_params_t::mrd
u32 mrd
Definition: ip6_ra.h:43
api.h
vl_api_ip6nd_proxy_enable_disable_t::is_enable
bool is_enable
Definition: ip6_nd.api:120
hash_set
#define hash_set(h, key, value)
Definition: hash.h:255
ntohs
#define ntohs(x)
Definition: af_xdp.bpf.c:29
vl_api_sw_interface_ip6nd_ra_config_t::other
u8 other
Definition: ip6_nd.api:52
ip6_ra_report_t::time_in_msec_between_retransmitted_neighbor_solicitations
u32 time_in_msec_between_retransmitted_neighbor_solicitations
Definition: ip6_ra.h:69
vl_api_ip6nd_proxy_enable_disable_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: ip6_nd.api:119
fib_entry_get_prefix
const fib_prefix_t * fib_entry_get_prefix(fib_node_index_t fib_entry_index)
Definition: fib_entry.c:1728
vl_api_want_ip6_ra_events_t::enable
bool enable
Definition: ip6_nd.api:199
vl_api_sw_interface_ip6nd_ra_config_t::send_unicast
u8 send_unicast
Definition: ip6_nd.api:54
vl_api_send_msg
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
Definition: api.h:35
ip6_ra_report_t::current_hop_limit
u8 current_hop_limit
Definition: ip6_ra.h:65
pool_elt_at_index
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
Definition: pool.h:549
fib_entry_cmp_for_sort
int fib_entry_cmp_for_sort(void *i1, void *i2)
Definition: fib_entry.c:1660
ra_report_prefix_info_t::flags
u8 flags
Definition: ip6_ra.h:56
vpe_api_main_t
Definition: api_helper_macros.h:414
vl_api_ip6nd_proxy_details_t::ip
vl_api_ip6_address_t ip
Definition: ip6_nd.api:148
vl_api_ip6nd_proxy_details_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: ip6_nd.api:147
fib_table.h
ip6_ra_config
int ip6_ra_config(vlib_main_t *vm, u32 sw_if_index, u8 suppress, u8 managed, u8 other, u8 ll_option, u8 send_unicast, u8 cease, u8 use_lifetime, u32 lifetime, u32 initial_count, u32 initial_interval, u32 max_interval, u32 min_interval, u8 is_no)
Definition: ip6_ra.c:1692
hash_elts
static uword hash_elts(void *v)
Definition: hash.h:118
am
app_main_t * am
Definition: application.c:489
fib_prefix_t_::fp_len
u16 fp_len
The mask length.
Definition: fib_types.h:206
ip6_address_decode
void ip6_address_decode(const vl_api_ip6_address_t in, ip6_address_t *out)
Definition: ip_types_api.c:129
pool_put
#define pool_put(P, E)
Free an object E in pool P.
Definition: pool.h:305
vl_api_ip6_ra_event_t
Tell client about a router advertisement event.
Definition: ip6_nd.api:230
vm
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
Definition: nat44_ei.c:3047
api.h
ip6_ra_report_t::router_lifetime_in_sec
u16 router_lifetime_in_sec
Definition: ip6_ra.h:67
icmp6_send_router_solicitation
void icmp6_send_router_solicitation(vlib_main_t *vm, u32 sw_if_index, u8 stop, const icmp6_send_router_solicitation_params_t *params)
Definition: ip6_ra.c:1312
ip6_ra_report_t::flags
u8 flags
Definition: ip6_ra.h:66
fib_table_walk
void fib_table_walk(u32 fib_index, fib_protocol_t proto, fib_table_walk_fn_t fn, void *ctx)
Walk all entries in a FIB table N.B: This is NOT safe to deletes.
Definition: fib_table.c:1244
vl_msg_api_alloc_zero
void * vl_msg_api_alloc_zero(int nbytes)
Definition: memory_shared.c:214
ra_report_prefix_info_t::prefix
fib_prefix_t prefix
Definition: ip6_ra.h:55
vl_api_sw_interface_ip6nd_ra_config_t::is_no
bool is_no
Definition: ip6_nd.api:56
addr
vhost_vring_addr_t addr
Definition: vhost_user.h:130
vl_api_ip6nd_proxy_enable_disable_t_handler
static void vl_api_ip6nd_proxy_enable_disable_t_handler(vl_api_ip6nd_proxy_enable_disable_t *mp)
Definition: ip6_nd_api.c:122
api_ip6nd_proxy_fib_table_walk_ctx_t
struct api_ip6nd_proxy_fib_table_walk_ctx_t_ api_ip6nd_proxy_fib_table_walk_ctx_t
vl_api_sw_interface_ip6nd_ra_config_t
IPv6 router advertisement config request.
Definition: ip6_nd.api:45
vl_api_ip6nd_proxy_dump_t_handler
static void vl_api_ip6nd_proxy_dump_t_handler(vl_api_ip6nd_proxy_dump_t *mp)
Definition: ip6_nd_api.c:83
ip6_ra_report_t::router_address
ip6_address_t router_address
Definition: ip6_ra.h:63
vl_api_sw_interface_ip6nd_ra_config_t::min_interval
u32 min_interval
Definition: ip6_nd.api:59
vl_api_ip6nd_proxy_add_del_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: ip6_nd.api:134
vl_api_sw_interface_ip6nd_ra_config_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: ip6_nd.api:49
hash_unset
#define hash_unset(h, key)
Definition: hash.h:261
ip6_nd_api_init
static clib_error_t * ip6_nd_api_init(vlib_main_t *vm)
Definition: ip6_nd_api.c:382
ip_prefix_encode
void ip_prefix_encode(const fib_prefix_t *in, vl_api_prefix_t *out)
Definition: ip_types_api.c:273
vl_api_sw_interface_ip6nd_ra_config_t::cease
u8 cease
Definition: ip6_nd.api:55
ip6_nd_base_msg_id
static u32 ip6_nd_base_msg_id
Base message ID fot the plugin.
Definition: ip6_nd_api.c:41
ra_report_prefix_info_t
Definition: ip6_ra.h:53
vl_api_sw_interface_ip6nd_ra_prefix_t::no_onlink
bool no_onlink
Definition: ip6_nd.api:103
vl_api_sw_interface_ip6nd_ra_config_t::lifetime
u32 lifetime
Definition: ip6_nd.api:60
vl_api_want_ip6_ra_events_t::pid
u32 pid
Definition: ip6_nd.api:200
vl_api_ip6nd_proxy_dump_t::client_index
u32 client_index
Definition: ip6_nd.api:156
ip6_nd_proxy_add
int ip6_nd_proxy_add(u32 sw_if_index, const ip6_address_t *addr)
Definition: ip6_nd_proxy.c:76
vl_api_ip6nd_proxy_dump_t::context
u32 context
Definition: ip6_nd.api:157
pool_foreach
#define pool_foreach(VAR, POOL)
Iterate through pool.
Definition: pool.h:534
vl_api_want_ip6_ra_events_t::client_index
u32 client_index
Definition: ip6_nd.api:197
vl_api_ip6nd_proxy_add_del_t::is_add
bool is_add
Definition: ip6_nd.api:135
vec_len
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
Definition: vec_bootstrap.h:142
vl_api_ip6nd_send_router_solicitation_t
Start / stop sending router solicitation.
Definition: ip6_nd.api:172
vl_api_ip6nd_proxy_dump_t
IPv6 ND proxy dump request.
Definition: ip6_nd.api:154
vl_api_ip6nd_send_router_solicitation_t::mrd
u32 mrd
Definition: ip6_nd.api:179
vl_api_sw_interface_ip6nd_ra_prefix_t::val_lifetime
u32 val_lifetime
Definition: ip6_nd.api:105
vec_add1
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
Definition: vec.h:606
icmp6_send_router_solicitation_params_t::irt
u32 irt
Definition: ip6_ra.h:40
ip6_address_encode
void ip6_address_encode(const ip6_address_t *in, vl_api_ip6_address_t out)
Definition: ip_types_api.c:123
ip6_ra.h
vl_api_ip6nd_proxy_add_del_t::ip
vl_api_ip6_address_t ip
Definition: ip6_nd.api:136
vl_api_ip6_ra_event_t::router_addr
vl_api_ip6_address_t router_addr
Definition: ip6_nd.api:235
vl_api_ip6nd_send_router_solicitation_t::irt
u32 irt
Definition: ip6_nd.api:176
api_ip6nd_proxy_fib_table_walk
static fib_table_walk_rc_t api_ip6nd_proxy_fib_table_walk(fib_node_index_t fei, void *arg)
Definition: ip6_nd_api.c:70
vl_api_registration_
An API client registration, only in vpp/vlib.
Definition: api_common.h:47
REPLY_MACRO
#define REPLY_MACRO(t)
Definition: api_helper_macros.h:30
hash_get
#define hash_get(h, key)
Definition: hash.h:249
setup_message_id_table
static void setup_message_id_table(api_main_t *am)
Definition: sr_mpls_api.c:174
vpe_client_registration_t::client_pid
u32 client_pid
Definition: api_helper_macros.h:411
vl_api_sw_interface_ip6nd_ra_config_t::max_interval
u32 max_interval
Definition: ip6_nd.api:58
vl_api_sw_interface_ip6nd_ra_prefix_t::off_link
bool off_link
Definition: ip6_nd.api:101
icmp6_send_router_solicitation_params_t
Definition: ip6_ra.h:38
ip_prefix_decode
void ip_prefix_decode(const vl_api_prefix_t *in, fib_prefix_t *out)
Definition: ip_types_api.c:245
fib_node_index_t
u32 fib_node_index_t
A typedef of a node index.
Definition: fib_types.h:29
uword
u64 uword
Definition: types.h:112
vl_api_ip6nd_proxy_details_t::context
u32 context
Definition: ip6_nd.api:146
vl_api_ip6nd_send_router_solicitation_t::stop
bool stop
Definition: ip6_nd.api:181
REPLY_MSG_ID_BASE
#define REPLY_MSG_ID_BASE
Definition: ip6_nd_api.c:42
ip6_nd_proxy_enable_disable
int ip6_nd_proxy_enable_disable(u32 sw_if_index, u8 enable)
Definition: ip6_nd_mirror_proxy.c:32
vl_api_sw_interface_ip6nd_ra_prefix_t::no_advertise
bool no_advertise
Definition: ip6_nd.api:100
vl_api_sw_interface_ip6nd_ra_config_t::initial_count
u32 initial_count
Definition: ip6_nd.api:61
vl_api_ip6nd_proxy_enable_disable_t
IPv6 ND (mirror) proxy.
Definition: ip6_nd.api:115
pool_get
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
Definition: pool.h:255
ip6_ra_report_t::prefixes
ra_report_prefix_info_t * prefixes
Definition: ip6_ra.h:72
ip6_main_t::fibs
struct fib_table_t_ * fibs
Definition: ip6.h:115
vl_api_sw_interface_ip6nd_ra_prefix_t::prefix
vl_api_prefix_t prefix
Definition: ip6_nd.api:98
fib_entry_get_resolving_interface
u32 fib_entry_get_resolving_interface(fib_node_index_t entry_index)
Definition: fib_entry.c:1474
vl_api_sw_interface_ip6nd_ra_prefix_t::is_no
bool is_no
Definition: ip6_nd.api:104
vl_api_ip6nd_send_router_solicitation_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: ip6_nd.api:180
fib_prefix_t_::fp_addr
ip46_address_t fp_addr
The address type is not deriveable from the fp_addr member.
Definition: fib_types.h:225
ip6_ra_handle_report
static void ip6_ra_handle_report(const ip6_ra_report_t *rap)
Definition: ip6_nd_api.c:251
vl_api_ip6nd_proxy_add_del_t_handler
static void vl_api_ip6nd_proxy_add_del_t_handler(vl_api_ip6nd_proxy_add_del_t *mp)
Definition: ip6_nd_api.c:140
BAD_SW_IF_INDEX_LABEL
#define BAD_SW_IF_INDEX_LABEL
Definition: api_helper_macros.h:289
ip6_ra_report_unregister
void ip6_ra_report_unregister(ip6_ra_report_notify_t fn)
Definition: ip6_ra.c:180
ip6_main
ip6_main_t ip6_main
Definition: ip6_forward.c:2785
ra_report_prefix_info_t::preferred_time
u32 preferred_time
Definition: ip6_ra.h:58
vec_free
#define vec_free(V)
Free vector's memory (no header).
Definition: vec.h:395
vl_api_ip6nd_proxy_details_t
IPv6 ND proxy details returned after request.
Definition: ip6_nd.api:144
vl_api_ip6nd_send_router_solicitation_t::mrc
u32 mrc
Definition: ip6_nd.api:178
pool_foreach_index
#define pool_foreach_index(i, v)
Definition: pool.h:572
ip6_ra_report_t
Definition: ip6_ra.h:61
format_fns.h
vl_api_sw_interface_ip6nd_ra_prefix_t::pref_lifetime
u32 pref_lifetime
Definition: ip6_nd.api:106
fib_entry_is_sourced
int fib_entry_is_sourced(fib_node_index_t fib_entry_index, fib_source_t source)
Definition: fib_entry_src.c:139
vl_api_can_send_msg
static int vl_api_can_send_msg(vl_api_registration_t *rp)
Definition: api.h:48
vl_api_sw_interface_ip6nd_ra_config_t::suppress
u8 suppress
Definition: ip6_nd.api:50
u32
unsigned int u32
Definition: types.h:88
VLIB_INIT_FUNCTION
#define VLIB_INIT_FUNCTION(x)
Definition: init.h:172
vl_api_sw_interface_ip6nd_ra_config_t::ll_option
u8 ll_option
Definition: ip6_nd.api:53
FIB_SOURCE_IP6_ND_PROXY
@ FIB_SOURCE_IP6_ND_PROXY
IPv6 Proxy ND.
Definition: fib_source.h:95
ip6
vl_api_ip6_address_t ip6
Definition: one.api:424
fib_table_walk_rc_t
enum fib_table_walk_rc_t_ fib_table_walk_rc_t
return code controlling how a table walk proceeds
FIB_PROTOCOL_IP6
@ FIB_PROTOCOL_IP6
Definition: fib_types.h:37
ctx
long ctx[MAX_CONNS]
Definition: main.c:144
api_helper_macros.h
vec_foreach
#define vec_foreach(var, vec)
Vector iterator.
Definition: vec_bootstrap.h:213
vl_api_want_ip6_ra_events_t
Register for ip6 router advertisement events.
Definition: ip6_nd.api:195
vl_api_sw_interface_ip6nd_ra_prefix_t::use_default
bool use_default
Definition: ip6_nd.api:99
ip6_main_t
Definition: ip6.h:110
vec_sort_with_function
#define vec_sort_with_function(vec, f)
Sort a vector using the supplied element comparison function.
Definition: vec.h:1097
vpe_client_registration_t::client_index
u32 client_index
Definition: api_helper_macros.h:410
ra_report_prefix_info_t::valid_time
u32 valid_time
Definition: ip6_ra.h:57
FIB_TABLE_WALK_CONTINUE
@ FIB_TABLE_WALK_CONTINUE
Continue on to the next entry.
Definition: fib_table.h:916
clib_memset
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
vlib_main_t
Definition: main.h:102
vlib_get_main
static vlib_main_t * vlib_get_main(void)
Definition: global_funcs.h:38
u8
unsigned char u8
Definition: types.h:56
clib_error_t
Definition: clib_error.h:21
vl_api_sw_interface_ip6nd_ra_config_t::managed
u8 managed
Definition: ip6_nd.api:51
vl_api_sw_interface_ip6nd_ra_prefix_t::sw_if_index
vl_api_interface_index_t sw_if_index
Definition: ip6_nd.api:97
icmp6_send_router_solicitation_params_t::mrt
u32 mrt
Definition: ip6_ra.h:41
vlib_init_function_t
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
Definition: init.h:51
icmp6_send_router_solicitation_params_t::mrc
u32 mrc
Definition: ip6_ra.h:42
ip6_ra_report_t::sw_if_index
u32 sw_if_index
Definition: ip6_ra.h:64
ip6_nd_proxy_del
int ip6_nd_proxy_del(u32 sw_if_index, const ip6_address_t *addr)
Definition: ip6_nd_proxy.c:82
clib_warning
#define clib_warning(format, args...)
Definition: error.h:59
context
u32 context
Definition: ip.api:852
ip6_ra_report_register
void ip6_ra_report_register(ip6_ra_report_notify_t fn)
Definition: ip6_ra.c:167
rv
int __clib_unused rv
Definition: application.c:491
ip6_ra_report_t::neighbor_reachable_time_in_msec
u32 neighbor_reachable_time_in_msec
Definition: ip6_ra.h:68
VL_MSG_API_REAPER_FUNCTION
VL_MSG_API_REAPER_FUNCTION(want_ip6_ra_events_reaper)
vl_api_ip6nd_send_router_solicitation_t_handler
static void vl_api_ip6nd_send_router_solicitation_t_handler(vl_api_ip6nd_send_router_solicitation_t *mp)
Definition: ip6_nd_api.c:226
vl_api_want_ip6_ra_events_t_handler
static void vl_api_want_ip6_ra_events_t_handler(vl_api_want_ip6_ra_events_t *mp)
Definition: ip6_nd_api.c:311
send_ip6nd_proxy_details
static void send_ip6nd_proxy_details(vl_api_registration_t *reg, u32 context, const ip46_address_t *addr, u32 sw_if_index)
Definition: ip6_nd_api.c:47
api_ip6nd_proxy_fib_table_walk_ctx_t_::indices
u32 * indices
Definition: ip6_nd_api.c:66
vl_api_sw_interface_ip6nd_ra_config_t_handler
static void vl_api_sw_interface_ip6nd_ra_config_t_handler(vl_api_sw_interface_ip6nd_ra_config_t *mp)
Definition: ip6_nd_api.c:160
vpe_client_registration_t
Definition: api_helper_macros.h:408
sw_if_index
vl_api_interface_index_t sw_if_index
Definition: wireguard.api:34
vl_api_ip6nd_send_router_solicitation_t::mrt
u32 mrt
Definition: ip6_nd.api:177
ip_types_api.h
want_ip6_ra_events_reaper
static clib_error_t * want_ip6_ra_events_reaper(u32 client_index)
Definition: ip6_nd_api.c:360
vl_api_sw_interface_ip6nd_ra_config_t::initial_interval
u32 initial_interval
Definition: ip6_nd.api:62
api_ip6nd_proxy_fib_table_walk_ctx_t_
Definition: ip6_nd_api.c:64
fib_prefix_t_
Aggregate type for a prefix.
Definition: fib_types.h:202
ip6_nd.h
vl_api_sw_interface_ip6nd_ra_prefix_t
IPv6 router advertisement prefix config request.
Definition: ip6_nd.api:93
vl_api_ip6nd_proxy_add_del_t
IPv6 ND proxy config.
Definition: ip6_nd.api:130
vl_api_sw_interface_ip6nd_ra_prefix_t_handler
static void vl_api_sw_interface_ip6nd_ra_prefix_t_handler(vl_api_sw_interface_ip6nd_ra_prefix_t *mp)
Definition: ip6_nd_api.c:195
prefix
vl_api_prefix_t prefix
Definition: ip.api:175
vpe_api_main
vpe_api_main_t vpe_api_main
Definition: interface_api.c:47
vl_msg_api_alloc
void * vl_msg_api_alloc(int nbytes)
Definition: memory_shared.c:199