FD.io VPP  v16.09
Vector Packet Processing
interface.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015 Cisco and/or its affiliates.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at:
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 /*
16  * srp_interface.c: srp interfaces
17  *
18  * Copyright (c) 2008 Eliot Dresselhaus
19  *
20  * Permission is hereby granted, free of charge, to any person obtaining
21  * a copy of this software and associated documentation files (the
22  * "Software"), to deal in the Software without restriction, including
23  * without limitation the rights to use, copy, modify, merge, publish,
24  * distribute, sublicense, and/or sell copies of the Software, and to
25  * permit persons to whom the Software is furnished to do so, subject to
26  * the following conditions:
27  *
28  * The above copyright notice and this permission notice shall be
29  * included in all copies or substantial portions of the Software.
30  *
31  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
32  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
33  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
34  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
35  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
36  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
37  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
38  */
39 
40 #include <vnet/vnet.h>
41 #include <vnet/pg/pg.h>
42 #include <vnet/srp/srp.h>
43 
45  u32 sw_if_index,
46  u32 l3_type,
47  void * dst_address,
48  void * rewrite,
49  uword max_rewrite_bytes)
50 {
51  vnet_hw_interface_t * hw = vnet_get_sup_hw_interface (vnm, sw_if_index);
52  srp_main_t * sm = &srp_main;
53  srp_and_ethernet_header_t * h = rewrite;
54  u16 type;
55  uword n_bytes = sizeof (h[0]);
56 
57  if (n_bytes > max_rewrite_bytes)
58  return 0;
59 
60  switch (l3_type) {
61 #define _(a,b) case VNET_L3_PACKET_TYPE_##a: type = ETHERNET_TYPE_##b; break
62  _ (IP4, IP4);
63  _ (IP6, IP6);
64  _ (MPLS_UNICAST, MPLS_UNICAST);
65  _ (MPLS_MULTICAST, MPLS_MULTICAST);
66  _ (ARP, ARP);
67 #undef _
68  default:
69  return 0;
70  }
71 
73  if (dst_address)
74  clib_memcpy (h->ethernet.dst_address, dst_address, sizeof (h->ethernet.dst_address));
75  else
76  memset (h->ethernet.dst_address, ~0, sizeof (h->ethernet.dst_address)); /* broadcast */
77 
78  h->ethernet.type = clib_host_to_net_u16 (type);
79 
80  h->srp.as_u16 = 0;
81  h->srp.mode = SRP_MODE_data;
82  h->srp.ttl = sm->default_data_ttl;
84 
85  return n_bytes;
86 }
87 
88 static void srp_register_interface_helper (u32 * hw_if_indices_by_side, u32 redistribute);
89 
90 void serialize_srp_main (serialize_main_t * m, va_list * va)
91 {
92  srp_main_t * sm = &srp_main;
93  srp_interface_t * si;
94 
95  serialize_integer (m, pool_elts (sm->interface_pool), sizeof (u32));
96  pool_foreach (si, sm->interface_pool, ({
97  serialize_integer (m, si->rings[SRP_RING_OUTER].hw_if_index, sizeof (u32));
98  serialize_integer (m, si->rings[SRP_RING_INNER].hw_if_index, sizeof (u32));
99  }));
100 }
101 
102 void unserialize_srp_main (serialize_main_t * m, va_list * va)
103 {
104  u32 i, n_ifs, hw_if_indices[SRP_N_RING];
105 
106  unserialize_integer (m, &n_ifs, sizeof (u32));
107  for (i = 0; i < n_ifs; i++)
108  {
109  unserialize_integer (m, &hw_if_indices[SRP_RING_OUTER], sizeof (u32));
110  unserialize_integer (m, &hw_if_indices[SRP_RING_INNER], sizeof (u32));
111  srp_register_interface_helper (hw_if_indices, /* redistribute */ 0);
112  }
113 }
114 
116 {
117  u32 * hw_if_indices = va_arg (*va, u32 *);
118  serialize_integer (m, hw_if_indices[SRP_SIDE_A], sizeof (hw_if_indices[SRP_SIDE_A]));
119  serialize_integer (m, hw_if_indices[SRP_SIDE_B], sizeof (hw_if_indices[SRP_SIDE_B]));
120 }
121 
123 {
124  CLIB_UNUSED (mc_main_t * mcm) = va_arg (*va, mc_main_t *);
125  u32 hw_if_indices[SRP_N_SIDE];
126  srp_main_t * sm = &srp_main;
127  uword * p;
128 
129  unserialize_integer (m, &hw_if_indices[SRP_SIDE_A], sizeof (hw_if_indices[SRP_SIDE_A]));
130  unserialize_integer (m, &hw_if_indices[SRP_SIDE_B], sizeof (hw_if_indices[SRP_SIDE_B]));
131 
133  hw_if_indices[0]);
134  if (p)
135  {
140  hw_if_indices[0]);
141  }
142  else
143  srp_register_interface_helper (hw_if_indices, /* redistribute */ 0);
144 }
145 
146 MC_SERIALIZE_MSG (srp_register_interface_msg, static) = {
147  .name = "vnet_srp_register_interface",
150 };
151 
152 static void srp_register_interface_helper (u32 * hw_if_indices_by_side, u32 redistribute)
153 {
154  vnet_main_t * vnm = vnet_get_main();
155  srp_main_t * sm = &srp_main;
156  vlib_main_t * vm = sm->vlib_main;
157  srp_interface_t * si;
159  uword s, * p;
160 
161  if (vm->mc_main && redistribute)
162  {
164  mc_serialize (vm->mc_main, &srp_register_interface_msg, hw_if_indices_by_side);
167  hw_if_indices_by_side[0],
170  }
171 
172  /* Check if interface has already been registered. */
173  p = hash_get (sm->interface_index_by_hw_if_index, hw_if_indices_by_side[0]);
174  if (p)
175  {
176  si = pool_elt_at_index (sm->interface_pool, p[0]);
177  }
178  else
179  {
180  pool_get (sm->interface_pool, si);
181  memset (si, 0, sizeof (si[0]));
182  }
183  for (s = 0; s < SRP_N_SIDE; s++)
184  {
185  hws[s] = vnet_get_hw_interface (vnm, hw_if_indices_by_side[s]);
186  si->rings[s].ring = s;
187  si->rings[s].hw_if_index = hw_if_indices_by_side[s];
188  si->rings[s].sw_if_index = hws[s]->sw_if_index;
189  hash_set (sm->interface_index_by_hw_if_index, hw_if_indices_by_side[s], si - sm->interface_pool);
190  }
191 
192  /* Inherit MAC address from outer ring. */
194  vec_len (hws[SRP_RING_OUTER]->hw_address));
195 
196  /* Default time to wait to restore signal. */
198  si->config.ips_tx_interval = 1;
199 }
200 
201 void srp_register_interface (u32 * hw_if_indices_by_side)
202 {
203  srp_register_interface_helper (hw_if_indices_by_side, /* redistribute */ 1);
204 }
205 
207 {
209  si->hw_wrap_function = f;
210 }
211 
213 {
215  si->hw_enable_function = f;
216 }
217 
218 void srp_interface_enable_ips (u32 hw_if_index)
219 {
220  srp_main_t * sm = &srp_main;
222 
223  si->ips_process_enable = 1;
224 
225  vlib_node_set_state (sm->vlib_main, srp_ips_process_node.index, VLIB_NODE_STATE_POLLING);
226 }
227 
228 static uword
229 srp_is_valid_class_for_interface (vnet_main_t * vnm, u32 hw_if_index, u32 hw_class_index)
230 {
232 
233  if (! si)
234  return 0;
235 
236  /* Both sides must be admin down. */
238  return 0;
240  return 0;
241 
242  return 1;
243 }
244 
245 static void
247  u32 old_hw_class_index, u32 new_hw_class_index)
248 {
249  srp_main_t * sm = &srp_main;
252  vnet_device_class_t * dc;
253  u32 r, to_srp;
254 
255  if (!si) {
256  clib_warning ("srp interface no set si = 0");
257  return;
258  }
259 
260  to_srp = new_hw_class_index == srp_hw_interface_class.index;
261 
262  /* Changing class on either outer or inner rings implies changing the class
263  of the other. */
264  for (r = 0; r < SRP_N_RING; r++)
265  {
266  srp_interface_ring_t * ir = &si->rings[r];
267 
268  hi = vnet_get_hw_interface (vnm, ir->hw_if_index);
269  dc = vnet_get_device_class (vnm, hi->dev_class_index);
270 
271  /* hw_if_index itself will be handled by caller. */
272  if (ir->hw_if_index != hw_if_index)
273  {
275  new_hw_class_index,
276  to_srp ? si - sm->interface_pool : ~0);
277 
278  if (dc->hw_class_change)
279  dc->hw_class_change (vnm, ir->hw_if_index, new_hw_class_index);
280  }
281  else
282  hi->hw_instance = to_srp ? si - sm->interface_pool : ~0;
283  }
284 
285  if (si->hw_enable_function)
286  si->hw_enable_function (si, /* enable */ to_srp);
287 }
288 
290  .name = "SRP",
291  .format_address = format_ethernet_address,
292  .format_header = format_srp_header_with_length,
293  .format_device = format_srp_device,
294  .unformat_hw_address = unformat_ethernet_address,
295  .unformat_header = unformat_srp_header,
296  .set_rewrite = srp_set_rewrite,
297  .is_valid_class_for_interface = srp_is_valid_class_for_interface,
298  .hw_class_change = srp_interface_hw_class_change,
299 };
300 
302 {
303  srp_interface_t * si = va_arg (*va, srp_interface_t *);
304  srp_main_t * sm = &srp_main;
305 
306  ASSERT (! pool_is_free (sm->interface_pool, si));
307  serialize_integer (m, si - sm->interface_pool, sizeof (u32));
310 }
311 
313 {
314  CLIB_UNUSED (mc_main_t * mcm) = va_arg (*va, mc_main_t *);
315  srp_main_t * sm = &srp_main;
316  srp_interface_t * si;
317  u32 si_index;
318 
319  unserialize_integer (m, &si_index, sizeof (u32));
320  si = pool_elt_at_index (sm->interface_pool, si_index);
323 }
324 
325 MC_SERIALIZE_MSG (srp_interface_config_msg, static) = {
326  .name = "vnet_srp_interface_config",
329 };
330 
332 {
334  ASSERT (si != 0);
335  c[0] = si->config;
336 }
337 
339 {
340  srp_main_t * sm = &srp_main;
341  vlib_main_t * vm = sm->vlib_main;
343  ASSERT (si != 0);
344  if (memcmp (&si->config, &c[0], sizeof (c[0])))
345  {
346  si->config = c[0];
347  if (vm->mc_main)
348  mc_serialize (vm->mc_main, &srp_interface_config_msg, si);
349  }
350 }
351 
352 #if DEBUG > 0
353 
354 #define VNET_SIMULATED_SRP_TX_NEXT_SRP_INPUT VNET_INTERFACE_TX_N_NEXT
355 
356 /* Echo packets back to srp input. */
357 static uword
358 simulated_srp_interface_tx (vlib_main_t * vm,
359  vlib_node_runtime_t * node,
360  vlib_frame_t * frame)
361 {
362  u32 n_left_from, n_left_to_next, n_copy, * from, * to_next;
363  u32 next_index = VNET_SIMULATED_SRP_TX_NEXT_SRP_INPUT;
364  u32 i;
365  vlib_buffer_t * b;
366 
367  n_left_from = frame->n_vectors;
368  from = vlib_frame_args (frame);
369 
370  while (n_left_from > 0)
371  {
372  vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next);
373 
374  n_copy = clib_min (n_left_from, n_left_to_next);
375 
376  clib_memcpy (to_next, from, n_copy * sizeof (from[0]));
377  n_left_to_next -= n_copy;
378  n_left_from -= n_copy;
379  for (i = 0; i < n_copy; i++)
380  {
381  b = vlib_get_buffer (vm, from[i]);
382  /* TX interface will be fake eth; copy to RX for benefit of srp-input. */
383  b->sw_if_index[VLIB_RX] = b->sw_if_index[VLIB_TX];
384  }
385 
386  vlib_put_next_frame (vm, node, next_index, n_left_to_next);
387  }
388 
389  return n_left_from;
390 }
391 
392 static u8 * format_simulated_srp_name (u8 * s, va_list * args)
393 {
394  u32 dev_instance = va_arg (*args, u32);
395  return format (s, "fake-srp%d", dev_instance);
396 }
397 
398 VNET_DEVICE_CLASS (srp_simulated_device_class,static) = {
399  .name = "Simulated srp",
400  .format_device_name = format_simulated_srp_name,
401  .tx_function = simulated_srp_interface_tx,
402 };
403 
404 static clib_error_t *
405 create_simulated_srp_interfaces (vlib_main_t * vm,
406  unformat_input_t * input,
407  vlib_cli_command_t * cmd)
408 {
409  vnet_main_t * vnm = vnet_get_main();
410  u8 address[6];
411  u32 hw_if_index;
413  static u32 instance;
414 
415  if (! unformat_user (input, unformat_ethernet_address, &address))
416  {
417  memset (address, 0, sizeof (address));
418  address[0] = 0xde;
419  address[1] = 0xad;
420  address[5] = instance;
421  }
422 
423  hw_if_index = vnet_register_interface (vnm,
424  srp_simulated_device_class.index,
425  instance++,
426  srp_hw_interface_class.index, 0);
427 
428  hi = vnet_get_hw_interface (vnm, hw_if_index);
429 
431 
432  hi->min_packet_bytes = 40 + 16;
433 
434  /* Standard default ethernet MTU. */
436 
437  vec_free (hi->hw_address);
438  vec_add (hi->hw_address, address, sizeof (address));
439 
440  {
441  uword slot;
442 
444  (vm, hi->tx_node_index,
445  "srp-input",
446  VNET_SIMULATED_SRP_TX_NEXT_SRP_INPUT);
447  ASSERT (slot == VNET_SIMULATED_SRP_TX_NEXT_SRP_INPUT);
448  }
449 
450  return /* no error */ 0;
451 }
452 
453 static VLIB_CLI_COMMAND (create_simulated_srp_interface_command) = {
454  .path = "srp create-interfaces",
455  .short_help = "Create simulated srp interface",
456  .function = create_simulated_srp_interfaces,
457 };
458 #endif
static void serialize_srp_interface_config_msg(serialize_main_t *m, va_list *va)
Definition: interface.c:301
void vlib_put_next_frame(vlib_main_t *vm, vlib_node_runtime_t *r, u32 next_index, u32 n_vectors_left)
Release pointer to next frame vector data.
Definition: main.c:457
vmrglw vmrglh hi
#define hash_set(h, key, value)
Definition: hash.h:254
sll srl srl sll sra u16x4 i
Definition: vector_sse2.h:343
#define clib_min(x, y)
Definition: clib.h:326
#define CLIB_UNUSED(x)
Definition: clib.h:79
static void vlib_signal_one_time_waiting_process(vlib_main_t *vm, vlib_one_time_waiting_process_t *p)
Definition: node_funcs.h:959
static uword srp_set_rewrite(vnet_main_t *vnm, u32 sw_if_index, u32 l3_type, void *dst_address, void *rewrite, uword max_rewrite_bytes)
Definition: interface.c:44
u8 * format_srp_device(u8 *s, va_list *args)
Definition: node.c:544
#define hash_unset(h, key)
Definition: hash.h:260
bad routing header type(not 4)") sr_error (NO_MORE_SEGMENTS
static vnet_hw_interface_t * vnet_get_sup_hw_interface(vnet_main_t *vnm, u32 sw_if_index)
static void unserialize_srp_register_interface_msg(serialize_main_t *m, va_list *va)
Definition: interface.c:122
srp_main_t srp_main
Definition: srp.h:172
uword unformat_srp_header(unformat_input_t *input, va_list *args)
Definition: format.c:111
u8 src_address[6]
Definition: packet.h:54
static vnet_hw_interface_t * vnet_get_hw_interface(vnet_main_t *vnm, u32 hw_if_index)
MC_SERIALIZE_MSG(vnet_sw_interface_set_flags_msg, static)
void( srp_hw_wrap_function_t)(u32 hw_if_index, u32 wrap_enable)
Definition: srp.h:94
static void srp_header_compute_parity(srp_header_t *h)
Definition: packet.h:89
#define pool_is_free(P, E)
Use free bitmap to query whether given element is free.
Definition: pool.h:203
void srp_interface_enable_ips(u32 hw_if_index)
Definition: interface.c:218
struct _vnet_device_class vnet_device_class_t
#define mc_serialize(mc, msg, args...)
Definition: mc.h:651
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
Definition: pool.h:200
Definition: srp.h:68
void srp_interface_get_interface_config(u32 hw_if_index, srp_interface_config_t *c)
Definition: interface.c:331
mc_main_t * mc_main
Definition: main.h:133
u8 my_address[6]
Definition: srp.h:110
ethernet_header_t ethernet
Definition: packet.h:97
#define vec_add(V, E, N)
Add N elements to end of vector V (no header, unspecified alignment)
Definition: vec.h:559
srp_interface_t * interface_pool
Definition: srp.h:129
static void unserialize_srp_interface_config_msg(serialize_main_t *m, va_list *va)
Definition: interface.c:312
vnet_main_t * vnet_get_main(void)
Definition: misc.c:45
u8 * format_ethernet_address(u8 *s, va_list *args)
Definition: format.c:44
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
Definition: pool.h:348
Definition: srp.h:66
static vnet_device_class_t * vnet_get_device_class(vnet_main_t *vnm, u32 dev_class_index)
u8 dst_address[6]
Definition: packet.h:53
void srp_register_interface(u32 *hw_if_indices_by_side)
Definition: interface.c:201
u32 default_data_ttl
Definition: srp.h:134
static uword srp_is_valid_class_for_interface(vnet_main_t *vnm, u32 hw_if_index, u32 hw_class_index)
Definition: interface.c:229
static void srp_setup_node(vlib_main_t *vm, u32 node_index)
Definition: srp.h:193
srp_header_t srp
Definition: packet.h:96
#define clib_warning(format, args...)
Definition: error.h:59
static srp_interface_t * srp_get_interface_from_vnet_hw_interface(u32 hw_if_index)
Definition: srp.h:175
uword unformat_user(unformat_input_t *input, unformat_function_t *func,...)
Definition: unformat.c:977
static void srp_register_interface_helper(u32 *hw_if_indices_by_side, u32 redistribute)
Definition: interface.c:152
u32 vnet_register_interface(vnet_main_t *vnm, u32 dev_class_index, u32 dev_instance, u32 hw_class_index, u32 hw_instance)
Definition: interface.c:650
static void srp_interface_hw_class_change(vnet_main_t *vnm, u32 hw_if_index, u32 old_hw_class_index, u32 new_hw_class_index)
Definition: interface.c:246
void serialize_srp_main(serialize_main_t *m, va_list *va)
Definition: interface.c:90
#define hash_get(h, key)
Definition: hash.h:248
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
Definition: pool.h:369
void srp_interface_set_hw_enable_function(u32 hw_if_index, srp_hw_enable_function_t *f)
Definition: interface.c:212
srp_interface_ring_t rings[SRP_N_RING]
Definition: srp.h:115
vlib_one_time_waiting_process_t * srp_register_interface_waiting_process_pool
Definition: srp.h:136
#define pool_put(P, E)
Free an object E in pool P.
Definition: pool.h:214
vnet_hw_interface_class_t srp_hw_interface_class
srp_hw_wrap_function_t * hw_wrap_function
Definition: srp.h:120
#define vlib_get_next_frame(vm, node, next_index, vectors, n_vectors_left)
Get pointer to next frame vector data by (vlib_node_runtime_t, next_index).
Definition: node_funcs.h:348
serialize_function_t unserialize_f64
Definition: serialize.h:358
uword * interface_index_by_hw_if_index
Definition: srp.h:131
f64 wait_to_restore_idle_delay
Definition: srp.h:99
VNET_HW_INTERFACE_CLASS(ethernet_hw_interface_class)
clib_error_t * serialize(serialize_main_t *m,...)
Definition: serialize.c:671
svmdb_client_t * c
u16 n_vectors
Definition: node.h:344
#define vec_free(V)
Free vector&#39;s memory (no header).
Definition: vec.h:300
#define clib_memcpy(a, b, c)
Definition: string.h:63
vlib_node_registration_t srp_ips_process_node
Definition: node.c:911
static void unserialize_integer(serialize_main_t *m, void *x, u32 n_bytes)
Definition: serialize.h:201
static void serialize_integer(serialize_main_t *m, u64 x, u32 n_bytes)
Definition: serialize.h:185
void vnet_hw_interface_init_for_class(vnet_main_t *vnm, u32 hw_if_index, u32 hw_class_index, u32 hw_instance)
Definition: interface.c:913
void srp_interface_set_interface_config(u32 hw_if_index, srp_interface_config_t *c)
Definition: interface.c:338
void srp_interface_set_hw_wrap_function(u32 hw_if_index, srp_hw_wrap_function_t *f)
Definition: interface.c:206
srp_hw_enable_function_t * hw_enable_function
Definition: srp.h:122
Definition: srp.h:69
Definition: mc.h:522
u32 max_l3_packet_bytes[VLIB_N_RX_TX]
Definition: interface.h:345
uword unformat_ethernet_address(unformat_input_t *input, va_list *args)
Definition: format.c:206
#define ASSERT(truth)
unsigned int u32
Definition: types.h:88
u8 * format(u8 *s, char *fmt,...)
Definition: format.c:418
static void * vlib_frame_args(vlib_frame_t *f)
Get pointer to frame scalar data.
Definition: node_funcs.h:268
clib_error_t * unserialize(serialize_main_t *m,...)
Definition: serialize.c:683
static void vlib_node_set_state(vlib_main_t *vm, u32 node_index, vlib_node_state_t new_state)
Set node dispatch state.
Definition: node_funcs.h:144
Definition: srp.h:67
static uword vnet_sw_interface_is_admin_up(vnet_main_t *vnm, u32 sw_if_index)
u64 uword
Definition: types.h:112
Definition: defs.h:47
u8 ips_process_enable
Definition: srp.h:113
unsigned short u16
Definition: types.h:57
uword * srp_register_interface_waiting_process_pool_index_by_hw_if_index
Definition: srp.h:138
VLIB_CLI_COMMAND(set_interface_ip_source_and_port_range_check_command, static)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
unsigned char u8
Definition: types.h:56
Definition: lisp_types.h:24
u16 as_u16
Definition: packet.h:68
void unserialize_srp_main(serialize_main_t *m, va_list *va)
Definition: interface.c:102
static void serialize_srp_register_interface_msg(serialize_main_t *m, va_list *va)
Definition: interface.c:115
void( srp_hw_enable_function_t)(struct srp_interface_t *si, u32 wrap_enable)
Definition: srp.h:95
VNET_DEVICE_CLASS(ethernet_simulated_device_class)
struct _unformat_input_t unformat_input_t
uword vlib_node_add_named_next_with_slot(vlib_main_t *vm, uword node, char *name, uword slot)
Definition: node.c:213
Definition: lisp_types.h:25
srp_interface_config_t config
Definition: srp.h:118
struct vlib_main_t * vlib_main
Definition: mc.h:576
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
Definition: buffer_funcs.h:69
u8 * format_srp_header_with_length(u8 *s, va_list *args)
Definition: format.c:63
srp_ring_type_t ring
Definition: srp.h:73
Definition: defs.h:46
serialize_function_t serialize_f64
Definition: serialize.h:358
static void vlib_current_process_wait_for_one_time_event(vlib_main_t *vm, vlib_one_time_waiting_process_t *p)
Definition: node_funcs.h:978
vlib_main_t * vlib_main
Definition: srp.h:126
static uword pool_elts(void *v)
Number of active elements in a pool.
Definition: pool.h:109