FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
ip_neighbor_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 
24 #include <vnet/ip/ip_types_api.h>
26 
27 #include <vlibapi/api.h>
28 #include <vlibmemory/api.h>
29 
30 #include <vnet/ip-neighbor/ip_neighbor.api_enum.h>
31 #include <vnet/ip-neighbor/ip_neighbor.api_types.h>
32 
34 #define REPLY_MSG_ID_BASE msg_id_base
35 
37 
38 #include <vnet/format_fns.h>
39 
40 static vl_api_ip_neighbor_flags_t
42 {
43  vl_api_ip_neighbor_flags_t v = IP_API_NEIGHBOR_FLAG_NONE;
44 
45  if (f & IP_NEIGHBOR_FLAG_STATIC)
47  if (f & IP_NEIGHBOR_FLAG_NO_FIB_ENTRY)
49 
50  return (v);
51 }
52 
53 static void
54 ip_neighbor_encode (vl_api_ip_neighbor_t * api, const ip_neighbor_t * ipn)
55 {
56  api->sw_if_index = htonl (ipn->ipn_key->ipnk_sw_if_index);
57  api->flags = ip_neighbor_flags_encode (ipn->ipn_flags);
58 
59  ip_address_encode2 (&ipn->ipn_key->ipnk_ip, &api->ip_address);
60  mac_address_encode (&ipn->ipn_mac, api->mac_address);
61 }
62 
63 void
65 {
67  ip_neighbor_t *ipn;
68 
69  ipn = &ipne->ipne_nbr;
70 
71  if (NULL == ipn)
72  /* Client can cancel, die, etc. */
73  return;
74 
75  /* Customer(s) requesting event for this neighbor */
77  if (!reg)
78  return;
79 
80  if (vl_api_can_send_msg (reg))
81  {
82  if (1 == ipne->ipne_watch.ipw_api_version)
83  {
85 
86  mp = vl_msg_api_alloc (sizeof (*mp));
87  clib_memset (mp, 0, sizeof (*mp));
88  mp->_vl_msg_id =
89  ntohs (VL_API_IP_NEIGHBOR_EVENT + REPLY_MSG_ID_BASE);
91  mp->pid = ipne->ipne_watch.ipw_pid;
92 
93  ip_neighbor_encode (&mp->neighbor, ipn);
94 
95  vl_api_send_msg (reg, (u8 *) mp);
96  }
97  else if (2 == ipne->ipne_watch.ipw_api_version)
98  {
100 
101  mp = vl_msg_api_alloc (sizeof (*mp));
102  clib_memset (mp, 0, sizeof (*mp));
103  mp->_vl_msg_id =
104  ntohs (VL_API_IP_NEIGHBOR_EVENT_V2 + REPLY_MSG_ID_BASE);
105  mp->client_index = ipne->ipne_watch.ipw_client;
106  mp->pid = ipne->ipne_watch.ipw_pid;
107  mp->flags = clib_host_to_net_u32 (ipne->ipne_flags);
108 
109  ip_neighbor_encode (&mp->neighbor, ipn);
110 
111  vl_api_send_msg (reg, (u8 *) mp);
112  }
113  }
114  else
115  {
116  static f64 last_time;
117  /*
118  * Throttle syslog msgs.
119  * It's pretty tempting to just revoke the registration...
120  */
121  if (vlib_time_now (vlib_get_main ()) > last_time + 10.0)
122  {
123  clib_warning ("neighbor event for %U to pid %d: queue stuffed!",
125  ipne->ipne_watch.ipw_pid);
126  last_time = vlib_time_now (vlib_get_main ());
127  }
128  }
129 
130  ip_neighbor_free (ipn);
131 }
132 
134 {
138 
139 static walk_rc_t
141 {
144  ip_neighbor_t *ipn;
145 
146  ipn = ip_neighbor_get (ipni);
147  mp = vl_msg_api_alloc (sizeof (*mp));
148  clib_memset (mp, 0, sizeof (*mp));
149  mp->_vl_msg_id = ntohs (VL_API_IP_NEIGHBOR_DETAILS + REPLY_MSG_ID_BASE);
150  mp->context = ctx->context;
151  mp->age =
153  ipn->ipn_time_last_updated));
154  ip_neighbor_encode (&mp->neighbor, ipn);
155 
156  vl_api_send_msg (ctx->reg, (u8 *) mp);
157 
158  return (WALK_CONTINUE);
159 }
160 
161 static void
163 {
166  int rv;
167 
169  if (!reg)
170  return;
171 
172  u32 sw_if_index = ntohl (mp->sw_if_index);
173 
174  rv = ip_address_family_decode (mp->af, &af);
175 
176  if (rv)
177  return;
178 
180  .reg = reg,
181  .context = mp->context,
182  };
183 
184  // walk all neighbours on all interfaces
186 }
187 
188 static ip_neighbor_flags_t
189 ip_neighbor_flags_decode (vl_api_ip_neighbor_flags_t v)
190 {
192 
194  f |= IP_NEIGHBOR_FLAG_STATIC;
196  f |= IP_NEIGHBOR_FLAG_NO_FIB_ENTRY;
197 
198  return (f);
199 }
200 
201 static void
203  vlib_main_t * vm)
204 {
207  u32 stats_index = ~0;
210  int rv;
211 
213 
215  ip_address_decode2 (&mp->neighbor.ip_address, &ip);
216  mac_address_decode (mp->neighbor.mac_address, &mac);
217 
218  /* must be static or dynamic, default to dynamic */
219  if (!(flags & IP_NEIGHBOR_FLAG_STATIC) &&
220  !(flags & IP_NEIGHBOR_FLAG_DYNAMIC))
221  flags |= IP_NEIGHBOR_FLAG_DYNAMIC;
222 
223  /*
224  * there's no validation here of the ND/ARP entry being added.
225  * The expectation is that the FIB will ensure that nothing bad
226  * will come of adding bogus entries.
227  */
228  if (mp->is_add)
229  rv = ip_neighbor_add (&ip, &mac,
230  ntohl (mp->neighbor.sw_if_index),
231  flags, &stats_index);
232  else
233  rv = ip_neighbor_del (&ip, ntohl (mp->neighbor.sw_if_index));
234 
236 
237  /* *INDENT-OFF* */
238  REPLY_MACRO2 (VL_API_IP_NEIGHBOR_ADD_DEL_REPLY,
239  ({
240  rmp->stats_index = htonl (stats_index);
241  }));
242  /* *INDENT-ON* */
243 }
244 
245 static void
247  mp)
248 {
249  vl_api_want_ip_neighbor_events_reply_t *rmp;
251  int rv = 0;
252 
253  if (mp->sw_if_index != ~0)
255  ip_address_decode2 (&mp->ip, &ip);
256 
257  ip_neighbor_watcher_t watch = {
258  .ipw_client = mp->client_index,
259  .ipw_pid = mp->pid,
260  .ipw_api_version = 1,
261  };
262 
263  if (mp->enable)
264  ip_neighbor_watch (&ip, ntohl (mp->sw_if_index), &watch);
265  else
266  ip_neighbor_unwatch (&ip, ntohl (mp->sw_if_index), &watch);
267 
269  REPLY_MACRO (VL_API_WANT_IP_NEIGHBOR_EVENTS_REPLY);
270 }
271 
272 static void
275 {
276  vl_api_want_ip_neighbor_events_reply_t *rmp;
278  int rv = 0;
279 
280  if (mp->sw_if_index != ~0)
282  ip_address_decode2 (&mp->ip, &ip);
283 
284  ip_neighbor_watcher_t watch = {
285  .ipw_client = mp->client_index,
286  .ipw_pid = mp->pid,
287  .ipw_api_version = 2,
288  };
289 
290  if (mp->enable)
291  ip_neighbor_watch (&ip, ntohl (mp->sw_if_index), &watch);
292  else
293  ip_neighbor_unwatch (&ip, ntohl (mp->sw_if_index), &watch);
294 
296  REPLY_MACRO (VL_API_WANT_IP_NEIGHBOR_EVENTS_V2_REPLY);
297 }
298 
299 static void
301 {
302  vl_api_ip_neighbor_config_reply_t *rmp;
304  int rv;
305 
306  rv = ip_address_family_decode (mp->af, &af);
307 
308  if (!rv)
309  rv = ip_neighbor_config (af,
310  ntohl (mp->max_number),
311  ntohl (mp->max_age), mp->recycle);
312 
313  REPLY_MACRO (VL_API_IP_NEIGHBOR_CONFIG_REPLY);
314 }
315 
316 static void
318  * mp)
319 {
320  vl_api_ip_neighbor_replace_begin_reply_t *rmp;
321  int rv = 0;
322 
325 
326  REPLY_MACRO (VL_API_IP_NEIGHBOR_REPLACE_BEGIN_REPLY);
327 }
328 
329 static void
331  mp)
332 {
333  vl_api_ip_neighbor_replace_end_reply_t *rmp;
334  int rv = 0;
335 
338 
339  REPLY_MACRO (VL_API_IP_NEIGHBOR_REPLACE_END_REPLY);
340 }
341 
342 static void
344 {
345  vl_api_ip_neighbor_flush_reply_t *rmp;
347  int rv;
348 
349  if (mp->sw_if_index != ~0)
351 
352  rv = ip_address_family_decode (mp->af, &af);
353 
354  if (!rv)
355  ip_neighbor_del_all (af, ntohl (mp->sw_if_index));
356 
358  REPLY_MACRO (VL_API_IP_NEIGHBOR_FLUSH_REPLY);
359 }
360 
361 #define vl_msg_name_crc_list
362 #include <vnet/ip-neighbor/ip_neighbor.api.h>
363 #undef vl_msg_name_crc_list
364 
365 #include <vnet/ip-neighbor/ip_neighbor.api.c>
366 
367 static clib_error_t *
369 {
370  /* Ask for a correctly-sized block of API message decode slots */
372 
373  return 0;
374 }
375 
377 
378 /*
379  * fd.io coding-style-patch-verification: ON
380  *
381  * Local Variables:
382  * eval: (c-set-style "gnu")
383  * End:
384  */
VLIB_API_INIT_FUNCTION
VLIB_API_INIT_FUNCTION(ip_neighbor_api_init)
ip_neighbor_t_
A representation of an IP neighbour/peer.
Definition: ip_neighbor_types.h:59
stats_index
u32 stats_index
Definition: ip.api:145
vl_api_ip_neighbor_dump_t::client_index
u32 client_index
Definition: ip_neighbor.api:90
ip_address
Definition: ip_types.h:79
send_ip_neighbor_details
static walk_rc_t send_ip_neighbor_details(index_t ipni, void *arg)
Definition: ip_neighbor_api.c:140
ip_neighbor_free
void ip_neighbor_free(ip_neighbor_t *ipn)
Definition: ip_neighbor_types.c:30
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
api.h
ip_neighbor_dump_ctx_t_
Definition: ip_neighbor_api.c:133
mac
vl_api_mac_address_t mac
Definition: l2.api:559
ip_neighbor_handle_event
void ip_neighbor_handle_event(ip_neighbor_event_t *ipne)
From the watcher to the API to publish a new neighbor.
Definition: ip_neighbor_api.c:64
ntohs
#define ntohs(x)
Definition: af_xdp.bpf.c:29
vl_api_ip_neighbor_dump_t::af
vl_api_address_family_t af
Definition: ip_neighbor.api:93
vl_api_ip_neighbor_details_t
IP neighbors dump response.
Definition: ip_neighbor.api:101
WALK_CONTINUE
@ WALK_CONTINUE
Definition: interface_funcs.h:174
REPLY_MACRO2
#define REPLY_MACRO2(t, body)
Definition: api_helper_macros.h:65
ip_neighbor_watcher_t_::ipw_api_version
int ipw_api_version
Definition: ip_neighbor_types.h:44
vl_api_want_ip_neighbor_events_t::enable
bool enable
Definition: ip_neighbor.api:195
vl_api_ip_neighbor_config_t::max_age
u32 max_age
Definition: ip_neighbor.api:125
vl_api_send_msg
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
Definition: api.h:35
f
vlib_frame_t * f
Definition: interface_output.c:1080
ip_neighbor_config
int ip_neighbor_config(ip_address_family_t af, u32 limit, u32 age, bool recycle)
Definition: ip_neighbor.c:1687
clib_host_to_net_f64
static f64 clib_host_to_net_f64(f64 x)
Definition: byte_order.h:178
vl_api_ip_neighbor_details_t::context
u32 context
Definition: ip_neighbor.api:102
vl_api_ip_neighbor_config_t
Enable/disable periodic IP neighbor scan.
Definition: ip_neighbor.api:119
ip_neighbor_get
ip_neighbor_t * ip_neighbor_get(index_t ipni)
Definition: ip_neighbor.c:89
IP_API_NEIGHBOR_FLAG_NONE
@ IP_API_NEIGHBOR_FLAG_NONE
Definition: ip_neighbor.api:37
vl_api_ip_neighbor_flush_t_handler
static void vl_api_ip_neighbor_flush_t_handler(vl_api_ip_neighbor_flush_t *mp)
Definition: ip_neighbor_api.c:343
vl_api_ip_neighbor_flush_t::sw_if_index
vl_api_interface_index_t sw_if_index[default=0xffffffff]
Definition: ip_neighbor.api:179
ip_neighbor_event_t_
Definition: ip_neighbor_types.h:111
vl_api_want_ip_neighbor_events_v2_t::pid
u32 pid
Definition: ip_neighbor.api:234
ip_neighbor_watcher_t_
Definition: ip_neighbor_types.h:40
vl_api_ip_neighbor_add_del_reply_t::stats_index
u32 stats_index
Definition: ip_neighbor.api:79
vl_api_want_ip_neighbor_events_v2_t_handler
static void vl_api_want_ip_neighbor_events_v2_t_handler(vl_api_want_ip_neighbor_events_v2_t *mp)
Definition: ip_neighbor_api.c:274
u16
unsigned short u16
Definition: types.h:57
vl_api_ip_neighbor_replace_begin_t_handler
static void vl_api_ip_neighbor_replace_begin_t_handler(vl_api_ip_neighbor_replace_begin_t *mp)
Definition: ip_neighbor_api.c:317
vl_api_ip_neighbor_event_t::pid
u32 pid
Definition: ip_neighbor.api:211
vm
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
Definition: nat44_ei.c:3047
api.h
AF_IP4
@ AF_IP4
Definition: ip_types.h:23
vl_api_want_ip_neighbor_events_v2_t::client_index
u32 client_index
Definition: ip_neighbor.api:231
vl_api_ip_neighbor_details_t::age
f64 age
Definition: ip_neighbor.api:103
ip_neighbor_api_init
static clib_error_t * ip_neighbor_api_init(vlib_main_t *vm)
Definition: ip_neighbor_api.c:368
vl_api_ip_neighbor_flush_t
IP neighbor flush request - removes all neighbours.
Definition: ip_neighbor.api:174
ip_neighbor_unwatch
void ip_neighbor_unwatch(const ip_address_t *ip, u32 sw_if_index, const ip_neighbor_watcher_t *watch)
Definition: ip_neighbor_watch.c:147
ip_neighbor_flags_encode
static vl_api_ip_neighbor_flags_t ip_neighbor_flags_encode(ip_neighbor_flags_t f)
Definition: ip_neighbor_api.c:41
api
import vnet interface_types api
Definition: sample.api:20
vl_api_ip_neighbor_event_v2_t::neighbor
vl_api_ip_neighbor_t neighbor
Definition: ip_neighbor.api:259
ip_address_encode2
void ip_address_encode2(const ip_address_t *in, vl_api_address_t *out)
Definition: ip_types_api.c:242
vl_api_ip_neighbor_add_del_reply_t
IP neighbor add / del reply.
Definition: ip_neighbor.api:75
ip_neighbor_t_::ipn_flags
ip_neighbor_flags_t ipn_flags
Falgs for this object.
Definition: ip_neighbor_types.h:74
setup_message_id_table
static void setup_message_id_table(api_main_t *am)
Definition: bfd_api.c:451
ip_neighbor_watcher_t_::ipw_client
u32 ipw_client
Definition: ip_neighbor_types.h:43
vl_api_ip_neighbor_add_del_t::neighbor
vl_api_ip_neighbor_t neighbor
Definition: ip_neighbor.api:67
vl_api_ip_neighbor_event_v2_t
Tell client about an IP4 ARP resolution event or MAC/IP info from ARP requests in L2 BDs.
Definition: ip_neighbor.api:254
ip_address_family_decode
int ip_address_family_decode(vl_api_address_family_t af, ip_address_family_t *out)
Conversion functions to/from (decode/encode) API types to VPP internal types.
Definition: ip_types_api.c:34
IP_API_NEIGHBOR_FLAG_STATIC
@ IP_API_NEIGHBOR_FLAG_STATIC
Definition: ip_neighbor.api:38
vl_api_ip_neighbor_replace_end_t
IP neighbour replace end.
Definition: ip_neighbor.api:160
vl_api_ip_neighbor_add_del_t::is_add
bool is_add
Definition: ip_neighbor.api:66
ip_neighbor_t_::ipn_key
ip_neighbor_key_t * ipn_key
The idempotent key.
Definition: ip_neighbor_types.h:64
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
vl_api_ip_neighbor_config_t::max_number
u32 max_number
Definition: ip_neighbor.api:124
vl_api_want_ip_neighbor_events_v2_t::ip
vl_api_address_t ip
Definition: ip_neighbor.api:235
index_t
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
Definition: dpo.h:43
format_ip_address
u8 * format_ip_address(u8 *s, va_list *args)
Definition: ip_types.c:21
ip_neighbor_add
int ip_neighbor_add(const ip_address_t *ip, const mac_address_t *mac, u32 sw_if_index, ip_neighbor_flags_t flags, u32 *stats_index)
Definition: ip_neighbor.c:477
ip_neighbor_key_t_::ipnk_ip
ip_address_t ipnk_ip
Definition: ip_neighbor_types.h:51
ip_neighbor_walk
void ip_neighbor_walk(ip_address_family_t af, u32 sw_if_index, ip_neighbor_walk_cb_t cb, void *ctx)
Definition: ip_neighbor.c:1041
ip_neighbor_dump_ctx_t_::reg
vl_api_registration_t * reg
Definition: ip_neighbor_api.c:135
vl_api_ip_neighbor_add_del_t
IP neighbor add / del request.
Definition: ip_neighbor.api:61
f64
double f64
Definition: types.h:142
ip_address_initializer
#define ip_address_initializer
Definition: ip_types.h:88
vl_api_ip_neighbor_event_v2_t::client_index
u32 client_index
Definition: ip_neighbor.api:256
ip_neighbor_watch.h
ip_neighbor_t_::ipn_time_last_updated
f64 ipn_time_last_updated
Aging related data.
Definition: ip_neighbor_types.h:81
vl_api_ip_neighbor_event_v2_t::flags
vl_api_ip_neighbor_event_flags_t flags
Definition: ip_neighbor.api:258
ip_neighbor_del
int ip_neighbor_del(const ip_address_t *ip, u32 sw_if_index)
Definition: ip_neighbor.c:574
REPLY_MSG_ID_BASE
#define REPLY_MSG_ID_BASE
Definition: ip_neighbor_api.c:34
ip_address_decode2
void ip_address_decode2(const vl_api_address_t *in, ip_address_t *out)
Definition: ip_types_api.c:192
BAD_SW_IF_INDEX_LABEL
#define BAD_SW_IF_INDEX_LABEL
Definition: api_helper_macros.h:289
ip_neighbor_del_all
void ip_neighbor_del_all(ip_address_family_t af, u32 sw_if_index)
Definition: ip_neighbor.c:616
vl_api_want_ip_neighbor_events_t
Register for IP neighbour events creation.
Definition: ip_neighbor.api:190
vl_api_want_ip_neighbor_events_t::pid
u32 pid
Definition: ip_neighbor.api:196
vl_api_ip_neighbor_replace_begin_t
IP neighbour replace begin.
Definition: ip_neighbor.api:147
IP_NEIGHBOR_FLAG_NONE
@ IP_NEIGHBOR_FLAG_NONE
Definition: ip_neighbor_types.h:34
ip_neighbor.h
ip_neighbor_watcher_t_::ipw_pid
u32 ipw_pid
Definition: ip_neighbor_types.h:42
mac_address_encode
void mac_address_encode(const mac_address_t *in, u8 *out)
Definition: ethernet_types_api.c:40
format_fns.h
msg_id_base
static u16 msg_id_base
Definition: ip_neighbor_api.c:33
ip_neighbor_flags_t
enum ip_neighbor_flags_t_ ip_neighbor_flags_t
ip_neighbor_watch
void ip_neighbor_watch(const ip_address_t *ip, u32 sw_if_index, const ip_neighbor_watcher_t *watch)
Definition: ip_neighbor_watch.c:118
vl_api_can_send_msg
static int vl_api_can_send_msg(vl_api_registration_t *rp)
Definition: api.h:48
ip_neighbor_dump_ctx_t
struct ip_neighbor_dump_ctx_t_ ip_neighbor_dump_ctx_t
vl_api_ip_neighbor_event_v2_t::pid
u32 pid
Definition: ip_neighbor.api:257
u32
unsigned int u32
Definition: types.h:88
ip_neighbor_dump_ctx_t_::context
u32 context
Definition: ip_neighbor_api.c:136
ethernet_types_api.h
ctx
long ctx[MAX_CONNS]
Definition: main.c:144
api_helper_macros.h
ip_neighbor_sweep
void ip_neighbor_sweep(ip_address_family_t af)
Definition: ip_neighbor.c:1267
mac_address_decode
void mac_address_decode(const u8 *in, mac_address_t *out)
Conversion functions to/from (decode/encode) API types to VPP internal types.
Definition: ethernet_types_api.c:34
AF_IP6
@ AF_IP6
Definition: ip_types.h:24
vl_api_ip_neighbor_event_t::neighbor
vl_api_ip_neighbor_t neighbor
Definition: ip_neighbor.api:212
vl_api_ip_neighbor_flush_t::af
vl_api_address_family_t af
Definition: ip_neighbor.api:178
vl_api_want_ip_neighbor_events_t_handler
static void vl_api_want_ip_neighbor_events_t_handler(vl_api_want_ip_neighbor_events_t *mp)
Definition: ip_neighbor_api.c:246
mac_address_t_
Definition: mac_address.h:21
vl_api_ip_neighbor_replace_end_t_handler
static void vl_api_ip_neighbor_replace_end_t_handler(vl_api_ip_neighbor_replace_end_t *mp)
Definition: ip_neighbor_api.c:330
clib_memset
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
vlib_main_t
Definition: main.h:102
vl_api_want_ip_neighbor_events_v2_t::sw_if_index
vl_api_interface_index_t sw_if_index[default=0xffffffff]
Definition: ip_neighbor.api:236
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
ip
vl_api_address_t ip
Definition: l2.api:558
ip_neighbor_mark
void ip_neighbor_mark(ip_address_family_t af)
Definition: ip_neighbor.c:1240
vl_api_ip_neighbor_dump_t_handler
static void vl_api_ip_neighbor_dump_t_handler(vl_api_ip_neighbor_dump_t *mp)
Definition: ip_neighbor_api.c:162
ip_neighbor_key_t_::ipnk_sw_if_index
u32 ipnk_sw_if_index
Definition: ip_neighbor_types.h:53
vl_api_want_ip_neighbor_events_t::sw_if_index
vl_api_interface_index_t sw_if_index[default=0xffffffff]
Definition: ip_neighbor.api:198
clib_warning
#define clib_warning(format, args...)
Definition: error.h:59
ip_neighbor_event_t_::ipne_flags
ip_neighbor_event_flags_t ipne_flags
Definition: ip_neighbor_types.h:114
vl_api_ip_neighbor_config_t::recycle
bool recycle
Definition: ip_neighbor.api:126
rv
int __clib_unused rv
Definition: application.c:491
vl_api_ip_neighbor_dump_t::sw_if_index
vl_api_interface_index_t sw_if_index[default=0xffffffff]
Definition: ip_neighbor.api:92
vlib_time_now
static f64 vlib_time_now(vlib_main_t *vm)
Definition: main.h:325
ip_neighbor_encode
static void ip_neighbor_encode(vl_api_ip_neighbor_t *api, const ip_neighbor_t *ipn)
Definition: ip_neighbor_api.c:54
ip_neighbor_flags_decode
static ip_neighbor_flags_t ip_neighbor_flags_decode(vl_api_ip_neighbor_flags_t v)
Definition: ip_neighbor_api.c:189
vl_api_ip_neighbor_add_del_t_handler
static void vl_api_ip_neighbor_add_del_t_handler(vl_api_ip_neighbor_add_del_t *mp, vlib_main_t *vm)
Definition: ip_neighbor_api.c:202
vl_api_ip_neighbor_event_t
Tell client about an IP4 ARP resolution event or MAC/IP info from ARP requests in L2 BDs.
Definition: ip_neighbor.api:207
vl_api_want_ip_neighbor_events_t::ip
vl_api_address_t ip
Definition: ip_neighbor.api:197
vl_api_want_ip_neighbor_events_v2_t
Register for IP neighbour events (creation or deletion)
Definition: ip_neighbor.api:229
ip_neighbor_event_t_::ipne_watch
ip_neighbor_watcher_t ipne_watch
Definition: ip_neighbor_types.h:113
sw_if_index
vl_api_interface_index_t sw_if_index
Definition: wireguard.api:34
vl_api_ip_neighbor_event_t::client_index
u32 client_index
Definition: ip_neighbor.api:210
vl_api_ip_neighbor_config_t_handler
static void vl_api_ip_neighbor_config_t_handler(vl_api_ip_neighbor_config_t *mp)
Definition: ip_neighbor_api.c:300
vl_api_ip_neighbor_dump_t::context
u32 context
Definition: ip_neighbor.api:91
ip_types_api.h
ip_neighbor_t_::ipn_mac
mac_address_t ipn_mac
The learned MAC address of the neighbour.
Definition: ip_neighbor_types.h:69
walk_rc_t
enum walk_rc_t_ walk_rc_t
Walk return code.
vl_api_ip_neighbor_details_t::neighbor
vl_api_ip_neighbor_t neighbor
Definition: ip_neighbor.api:104
IP_API_NEIGHBOR_FLAG_NO_FIB_ENTRY
@ IP_API_NEIGHBOR_FLAG_NO_FIB_ENTRY
Definition: ip_neighbor.api:39
vl_api_want_ip_neighbor_events_t::client_index
u32 client_index
Definition: ip_neighbor.api:193
vl_api_ip_neighbor_dump_t
Dump IP neighbors.
Definition: ip_neighbor.api:88
ip_address_family_t
enum ip_address_family_t_ ip_address_family_t
vl_msg_api_alloc
void * vl_msg_api_alloc(int nbytes)
Definition: memory_shared.c:199
vl_api_ip_neighbor_config_t::af
vl_api_address_family_t af
Definition: ip_neighbor.api:123
flags
vl_api_wireguard_peer_flags_t flags
Definition: wireguard.api:105
ip_neighbor_event_t_::ipne_nbr
ip_neighbor_t ipne_nbr
Definition: ip_neighbor_types.h:115
vl_api_want_ip_neighbor_events_v2_t::enable
bool enable
Definition: ip_neighbor.api:233