FD.io VPP  v16.06
Vector Packet Processing
socksvr_vlib.c
Go to the documentation of this file.
1 /*
2  *------------------------------------------------------------------
3  * socksvr_vlib.c
4  *
5  * Copyright (c) 2009 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 <sys/types.h>
21 #include <sys/socket.h>
22 #include <netinet/in.h>
23 #include <sys/ioctl.h>
24 #include <vppinfra/byte_order.h>
25 
26 #include <fcntl.h>
27 #include <sys/stat.h>
28 
29 #include <vlibsocket/api.h>
30 #include <vlibmemory/api.h>
31 
32 #include <vlibsocket/vl_socket_msg_enum.h> /* enumerate all vlib messages */
33 
34 #define vl_typedefs /* define message structures */
36 #undef vl_typedefs
37 
38 /* instantiate all the print functions we know about */
39 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__)
40 #define vl_printfun
42 #undef vl_printfun
43 
44 /* instantiate all the endian swap functions we know about */
45 #define vl_endianfun
47 #undef vl_endianfun
48 
50 
52 {
55  unix_main_t *um = &unix_main;
56  unix_file_t *f;
57 
58  /*
59  * Must have at least one active client, not counting the
60  * REGISTRATION_TYPE_SOCKET_LISTEN bind/accept socket
61  */
62  if (pool_elts (sm->registration_pool) < 2)
63  return;
64 
65  vlib_cli_output (vm, "TCP socket clients");
66  vlib_cli_output (vm, "%16s %8s", "Name", "Fildesc");
68  ({
69  if (reg->registration_type == REGISTRATION_TYPE_SOCKET_SERVER) {
70  f = pool_elt_at_index (um->file_pool, reg->unix_file_index);
71  vlib_cli_output (vm, "%16s %8d",
72  reg->name, f->file_descriptor);
73  }
74  }));
75 }
76 
77 void
79 {
80  u32 nbytes = 4; /* for the length... */
81  u16 msg_id = ntohs(*(u16 *)elem);
82  u32 msg_length;
83  u32 tmp;
84  api_main_t *am = &api_main;
85 
87 
88  if (msg_id >= vec_len(am->api_trace_cfg)) {
89  clib_warning("id out of range: %d", msg_id);
90  vl_msg_api_free((void *)elem);
91  return;
92  }
93 
94  msg_length = am->api_trace_cfg[msg_id].size;
95  nbytes += msg_length;
96  tmp = clib_host_to_net_u32 (nbytes);
97 
101  + socket_main.registration_pool,
102  (u8 *) &tmp,
103  sizeof(tmp));
105  + unix_main.file_pool,
107  + socket_main.registration_pool,
108  elem, msg_length);
109  vl_msg_api_free((void *)elem);
110 }
111 
113  u8 *elem, u8 *data_vector)
114 {
115  u32 nbytes = 4; /* for the length... */
116  u16 msg_id = ntohs(*(u16 *)elem);
117  u32 msg_length;
118  u32 tmp;
119  api_main_t *am = &api_main;
120 
122 
123  if (msg_id >= vec_len(am->api_trace_cfg)) {
124  clib_warning("id out of range: %d", msg_id);
125  vec_free(data_vector);
126  vl_msg_api_free((void *)elem);
127  return;
128  }
129 
130  msg_length = am->api_trace_cfg[msg_id].size;
131  nbytes += msg_length;
132  nbytes += vec_len(data_vector);
133 
134  /* Length in network byte order */
135  tmp = clib_host_to_net_u32(nbytes);
136 
138  + unix_main.file_pool,
140  + socket_main.registration_pool,
141  (u8 *) &tmp,
142  sizeof(tmp));
144  + unix_main.file_pool,
146  + socket_main.registration_pool,
147  elem, msg_length);
149  + unix_main.file_pool,
151  + socket_main.registration_pool,
152  data_vector, vec_len(data_vector));
153  vl_msg_api_free((void *)elem);
154 }
155 
156 static inline void
158  u8 *elem, u32 msg_length, int free)
159 {
160  u32 nbytes = 4; /* for the length... */
161  u16 msg_id = ntohs(*(u16 *)elem);
162  u32 tmp;
163  api_main_t *am = &api_main;
164 
166 
167  if (msg_id >= vec_len(am->api_trace_cfg)) {
168  clib_warning("id out of range: %d", msg_id);
169  if (free)
170  vl_msg_api_free((void *)elem);
171  return;
172  }
173 
174  nbytes += msg_length;
175 
176  /* Length in network byte order */
177  tmp = clib_host_to_net_u32(nbytes);
178 
180  + unix_main.file_pool,
182  + socket_main.registration_pool,
183  (u8 *) &tmp,
184  sizeof(tmp));
186  + unix_main.file_pool,
188  + socket_main.registration_pool,
189  elem, msg_length);
190  if (free)
191  vl_msg_api_free((void *)elem);
192 }
193 
195  u8 *elem, u32 msg_length)
196 {
197  vl_socket_api_send_with_length_internal(rp,elem,msg_length, 1 /* free */);
198 }
199 
201  u8 *elem, u32 msg_length)
202 {
203  vl_socket_api_send_with_length_internal(rp,elem,msg_length, 0 /* free */);
204 }
205 
207 {
209  if (pool_is_free_index (socket_main.registration_pool, pool_index)) {
210  clib_warning ("main pool index %d already free", pool_index);
211  return;
212  }
213  rp = pool_elt_at_index (socket_main.registration_pool, pool_index);
214 
216  vec_free (rp->name);
218  vec_free (rp->output_vector);
220  pool_put (socket_main.registration_pool, rp);
221 }
222 
223 static inline void
225 {
226  u8 *the_msg = (u8 *)(input_v+sizeof(u32));
227  socket_main.current_uf = uf;
228  socket_main.current_rp = rp;
229  vl_msg_api_socket_handler (the_msg);
230  socket_main.current_uf = 0;
231  socket_main.current_rp = 0;
232 }
233 
235 {
236  unix_main_t * um = &unix_main;
238  int n;
239  i8 *msg_buffer=0;
240  u32 msg_len;
241  u32 save_input_buffer_length = vec_len(socket_main.input_buffer);
242 
243  rp = pool_elt_at_index (socket_main.registration_pool, uf->private_data);
244 
245  n = read (uf->file_descriptor, socket_main.input_buffer,
246  vec_len(socket_main.input_buffer));
247 
248  if (n <= 0 && errno != EAGAIN) {
249  unix_file_del (um, uf);
250 
251  if (!pool_is_free (socket_main.registration_pool, rp)) {
252  u32 index = rp - socket_main.registration_pool;
254  } else {
255  clib_warning("client index %d already free?",
257  }
258  return 0;
259  }
260 
261  _vec_len(socket_main.input_buffer) = n;
262 
263  /*
264  * Look for bugs here. This code is tricky because
265  * data read from a stream socket does honor message
266  * boundaries. In the case of a long message (>4K bytes)
267  * we have to do (at least) 2 reads, etc.
268  */
269  do {
270  if (vec_len(rp->unprocessed_input)) {
271  vec_append(rp->unprocessed_input, socket_main.input_buffer);
272  msg_buffer = rp->unprocessed_input;
273  msg_len = rp->unprocessed_msg_length;
274  } else {
275  msg_buffer = socket_main.input_buffer;
276  msg_len = 0;
277  }
278 
279  if (msg_len == 0) {
280  /* Length may be split across two reads */
281  if (vec_len(msg_buffer) < sizeof (u32))
282  goto save_and_split;
283 
284  /* total length, including msg_len itself, in network byte order */
285  msg_len = clib_net_to_host_u32 (*((u32 *)msg_buffer));
286  }
287 
288  /* Happens if the client sent msg_len == 0 */
289  if (msg_len == 0) {
290  clib_warning ("msg_len == 0");
291  goto turf_it;
292  }
293 
294  /* We don't have the entire message yet. */
295  if (msg_len > vec_len(msg_buffer)) {
296  save_and_split:
297  /*
298  * if we were using the shared input buffer,
299  * save the fragment.
300  */
301  if (msg_buffer == socket_main.input_buffer) {
302  ASSERT(vec_len(rp->unprocessed_input) == 0);
303  vec_validate (rp->unprocessed_input, vec_len (msg_buffer)-1);
304  clib_memcpy (rp->unprocessed_input, msg_buffer, vec_len(msg_buffer));
305  _vec_len (rp->unprocessed_input) = vec_len (msg_buffer);
306  }
307  _vec_len(socket_main.input_buffer) = save_input_buffer_length;
308  rp->unprocessed_msg_length = msg_len;
309  return 0;
310  }
311 
312  socket_process_msg (uf, rp, msg_buffer);
313  if (n > msg_len)
314  vec_delete(msg_buffer, msg_len, 0);
315  else
316  _vec_len(msg_buffer) = 0;
317  n -= msg_len;
318  msg_len = 0;
319  rp->unprocessed_msg_length = 0;
320  } while (n > 0);
321 
322 turf_it:
323  _vec_len(socket_main.input_buffer) = save_input_buffer_length;
324 
325  return 0;
326 }
327 
328 void
331  u8 * buffer,
332  uword buffer_bytes)
333 {
334  unix_main_t * um = &unix_main;
335 
336  vec_add (rp->output_vector, buffer, buffer_bytes);
337  if (vec_len (rp->output_vector) > 0) {
338  int skip_update = 0 != (uf->flags & UNIX_FILE_DATA_AVAILABLE_TO_WRITE);
340  if (! skip_update)
342  }
343 }
344 
345 static void
348  uword n_bytes)
349 {
350  unix_main_t * um = &unix_main;
351 
352  vec_delete (rp->output_vector, n_bytes, 0);
353  if (vec_len (rp->output_vector) <= 0)
354  {
355  int skip_update = 0 == (uf->flags & UNIX_FILE_DATA_AVAILABLE_TO_WRITE);
357  if (! skip_update)
359  }
360 }
361 
362 clib_error_t *
364 {
365  unix_main_t * um = &unix_main;
367  int n;
368 
369  rp = pool_elt_at_index (socket_main.registration_pool, uf->private_data);
370 
371  /* Flush output vector. */
372  n = write (uf->file_descriptor,
373  rp->output_vector, vec_len (rp->output_vector));
374 
375  if (n < 0) {
376 #if DEBUG > 2
377  clib_warning ("write error, close the file...\n");
378 #endif
379  unix_file_del (um, uf);
380 
382  return 0;
383  }
384 
385  else if (n > 0)
386  socket_del_pending_output (uf, rp, n);
387 
388  return 0;
389 }
390 
392 {
394  unix_main_t * um = &unix_main;
395 
396  rp = pool_elt_at_index (socket_main.registration_pool, uf->private_data);
397  unix_file_del (um, uf);
399 
400  return 0;
401 }
402 
403 void socksvr_file_add (unix_main_t *um, int fd)
404 {
406  unix_file_t template = {0};
407 
408  pool_get (socket_main.registration_pool, rp);
409  memset(rp, 0, sizeof(*rp));
410 
411  template.read_function = vl_socket_read_ready;
412  template.write_function = vl_socket_write_ready;
413  template.error_function = vl_socket_error_ready;
414  template.file_descriptor = fd;
415  template.private_data = rp - socket_main.registration_pool;
416 
418  rp->vl_api_registration_pool_index = rp - socket_main.registration_pool;
419  rp->unix_file_index = unix_file_add (um, &template);
420 }
421 
423 {
424  unix_main_t * um = &unix_main;
425  struct sockaddr_in client_addr;
426  int client_fd;
427  int client_len;
428 
429  client_len = sizeof(client_addr);
430 
431  /*
432  * Supposedly acquires the non-blocking attrib from the
433  * server socket.
434  */
435  client_fd = accept (uf->file_descriptor,
436  (struct sockaddr *)&client_addr,
437  (socklen_t *)&client_len);
438 
439  if (client_fd < 0)
440  return clib_error_return_unix (0, "socksvr_accept_ready: accept");
441 
442  socksvr_file_add (um, client_fd);
443  return 0;
444 }
445 
447 {
448  clib_warning ("why am I here?");
449  return 0;
450 }
451 
452 /*
453  * vl_api_sockclnt_create_t_handler
454  */
456 {
457  vl_api_registration_t *regp;
459  int rv = 1;
460 
461  regp = socket_main.current_rp;
462 
464 
465  regp->name = format(0, "%s%c", mp->name, 0);
466 
467  rp = vl_msg_api_alloc(sizeof(*rp));
468  rp->_vl_msg_id = htons(VL_API_SOCKCLNT_CREATE_REPLY);
469  rp->handle = (uword)regp;
471  rp->context = mp->context;
472  rp->response = htonl(rv);
473 
474  vl_msg_api_send (regp, (u8 *)rp);
475 }
476 
477 /*
478  * vl_api_sockclnt_delete_t_handler
479  */
481 {
482  vl_api_registration_t *regp;
484 
485  if (!pool_is_free_index(socket_main.registration_pool, mp->index)) {
486  regp = pool_elt_at_index(socket_main.registration_pool, mp->index);
487 
488  rp = vl_msg_api_alloc(sizeof(*rp));
489  rp->_vl_msg_id = htons(VL_API_SOCKCLNT_DELETE_REPLY);
490  rp->handle = mp->handle;
491  rp->response = htonl(1);
492 
493  vl_msg_api_send (regp, (u8 *)rp);
494 
497 
499  } else {
500  clib_warning("unknown client ID %d", mp->index);
501  }
502 }
503 
504 #define foreach_vlib_api_msg \
505 _(SOCKCLNT_CREATE, sockclnt_create) \
506 _(SOCKCLNT_DELETE, sockclnt_delete)
507 
509 {
510  unix_main_t * um = &unix_main;
511  unix_file_t template = {0};
512  int sockfd;
513  int one = 1;
514  int rv;
515  struct sockaddr_in serv_addr;
517  u16 portno;
518  u32 bind_address;
519 
520 #define _(N,n) \
521  vl_msg_api_set_handlers(VL_API_##N, #n, \
522  vl_api_##n##_t_handler, \
523  vl_noop_handler, \
524  vl_api_##n##_t_endian, \
525  vl_api_##n##_t_print, \
526  sizeof(vl_api_##n##_t), 1);
528 #undef _
529 
530  vec_resize(socket_main.input_buffer, 4096);
531 
532  /* Set up non-blocking server socket on CLIENT_API_SERVER_PORT */
533  sockfd = socket(AF_INET, SOCK_STREAM, 0);
534 
535  if (sockfd < 0) {
536  return clib_error_return_unix (0, "socket");
537  }
538 
539  rv = ioctl (sockfd, FIONBIO, &one);
540  if (rv < 0) {
541  return clib_error_return_unix (0, "FIONBIO");
542  }
543 
544  rv = setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one));
545  if (rv < 0) {
546  return clib_error_return_unix (0, "SO_REUSEADDR");
547  }
548 
549  bzero((char *) &serv_addr, sizeof(serv_addr));
550  serv_addr.sin_family = AF_INET;
551 
552  if (socket_main.bind_address)
553  bind_address = socket_main.bind_address;
554  else
555  bind_address = INADDR_LOOPBACK;
556 
557  if (socket_main.portno)
558  portno = socket_main.portno;
559  else
560  portno = SOCKSVR_DEFAULT_PORT;
561 
562  serv_addr.sin_port = clib_host_to_net_u16 (portno);
563  serv_addr.sin_addr.s_addr = clib_host_to_net_u32(bind_address);
564 
565  if (bind(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) {
566  return clib_error_return_unix (0, "bind");
567  }
568 
569  rv = listen(sockfd,5);
570  if (rv < 0) {
571  return clib_error_return_unix (0, "listen");
572  }
573 
574  pool_get (socket_main.registration_pool, rp);
575  memset(rp, 0, sizeof(*rp));
576 
578 
579  template.read_function = socksvr_accept_ready;
580  template.write_function = socksvr_bogus_write;
581  template.file_descriptor = sockfd;
582  template.private_data = rp - socket_main.registration_pool;
583 
584  rp->unix_file_index = unix_file_add (um, &template);
585  return 0;
586 }
587 
588 static clib_error_t *
590 {
591  unix_main_t * um = &unix_main;
593 
594  /* Defensive driving in case something wipes out early */
595  if (socket_main.registration_pool) {
596  u32 index;
597  pool_foreach (rp, socket_main.registration_pool, ({
598  unix_file_del (um, um->file_pool + rp->unix_file_index);
599  index = rp->vl_api_registration_pool_index;
600  vl_free_socket_registration_index (index);
601  }));
602  }
603 
604  return 0;
605 }
606 
608 
609 static clib_error_t *
611 {
612  int portno;
613 
615  {
616  if (unformat (input, "port %d", &portno)) {
617  socket_main.portno = portno;
618  } else {
619  return clib_error_return (0, "unknown input '%U'",
620  format_unformat_error, input);
621  }
622  }
623  return socksvr_api_init (vm);
624 }
625 
627 
628 /* argument in host byte order */
630 {
631  socket_main.portno = port;
632 }
633 
634 /* argument in host byte order */
635 void socksvr_set_bind_address (u32 bind_address)
636 {
637  socket_main.bind_address = bind_address;
638 }
639 
640 clib_error_t *
642 {
643  return 0;
644 }
645 
u32 unix_file_index
Definition: api.h:54
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
Definition: vec.h:394
unix_file_t * file_pool
Definition: unix.h:85
void dump_socket_clients(vlib_main_t *vm, api_main_t *am)
Definition: socksvr_vlib.c:51
static clib_error_t * socksvr_config(vlib_main_t *vm, unformat_input_t *input)
Definition: socksvr_vlib.c:610
u32 flags
Definition: unix.h:53
uword unformat(unformat_input_t *i, char *fmt,...)
Definition: unformat.c:942
clib_error_t * vl_socket_error_ready(unix_file_t *uf)
Definition: socksvr_vlib.c:391
static clib_error_t * socksvr_bogus_write(unix_file_t *uf)
Definition: socksvr_vlib.c:446
clib_error_t * vl_socket_write_ready(unix_file_t *uf)
Definition: socksvr_vlib.c:363
void vl_socket_add_pending_output(unix_file_t *uf, vl_api_registration_t *rp, u8 *buffer, uword buffer_bytes)
Definition: socksvr_vlib.c:329
vl_api_registration_t * registration_pool
Definition: api.h:36
void vl_socket_api_send_with_data(vl_api_registration_t *rp, u8 *elem, u8 *data_vector)
Definition: socksvr_vlib.c:112
static clib_error_t * socket_exit(vlib_main_t *vm)
Definition: socksvr_vlib.c:589
int size
Definition: api.h:68
#define UNFORMAT_END_OF_INPUT
Definition: format.h:142
vl_api_registration_t * current_rp
Definition: api.h:42
always_inline uword unix_file_add(unix_main_t *um, unix_file_t *template)
Definition: unix.h:131
void socksvr_file_add(unix_main_t *um, int fd)
Definition: socksvr_vlib.c:403
void socksvr_set_port(u16 port)
Definition: socksvr_vlib.c:629
#define SOCKSVR_DEFAULT_PORT
Definition: api.h:54
#define pool_is_free(P, E)
Definition: pool.h:189
socket_main_t socket_main
Definition: socksvr_vlib.c:49
#define pool_get(P, E)
Definition: pool.h:186
static void socket_process_msg(unix_file_t *uf, vl_api_registration_t *rp, i8 *input_v)
Definition: socksvr_vlib.c:224
clib_error_t * vl_socket_read_ready(unix_file_t *uf)
Definition: socksvr_vlib.c:234
trace_cfg_t * api_trace_cfg
Definition: api.h:121
always_inline uword unformat_check_input(unformat_input_t *i)
Definition: format.h:168
#define vec_add(V, E, N)
Add N elements to end of vector V (no header, unspecified alignment)
Definition: vec.h:557
api_main_t api_main
Definition: api.h:162
#define pool_foreach(VAR, POOL, BODY)
Definition: pool.h:328
#define VLIB_INIT_FUNCTION(x)
Definition: init.h:109
void vl_msg_api_free(void *)
char i8
Definition: types.h:45
void vl_free_socket_registration_index(u32 pool_index)
Definition: socksvr_vlib.c:206
always_inline uword pool_elts(void *v)
Definition: pool.h:97
#define clib_warning(format, args...)
Definition: error.h:59
#define vec_resize(V, N)
Resize a vector (no header, unspecified alignment) Add N elements to end of given vector V...
Definition: vec.h:199
void vl_socket_api_send(vl_api_registration_t *rp, u8 *elem)
Definition: socksvr_vlib.c:78
static void socket_del_pending_output(unix_file_t *uf, vl_api_registration_t *rp, uword n_bytes)
Definition: socksvr_vlib.c:346
vl_registration_type_t registration_type
Definition: api.h:38
#define pool_elt_at_index(p, i)
Definition: pool.h:346
u32 file_descriptor
Definition: unix.h:51
uword private_data
Definition: unix.h:58
u32 bind_address
Definition: api.h:30
#define clib_error_return_unix(e, args...)
Definition: error.h:115
#define pool_put(P, E)
Definition: pool.h:200
#define VLIB_CONFIG_FUNCTION(x, n,...)
Definition: init.h:116
u32 unprocessed_msg_length
Definition: api.h:56
unix_file_t * current_uf
Definition: api.h:43
void vl_socket_api_send_with_length_no_free(vl_api_registration_t *rp, u8 *elem, u32 msg_length)
Definition: socksvr_vlib.c:200
static clib_error_t * socksvr_api_init(vlib_main_t *vm)
Definition: socksvr_vlib.c:508
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
Definition: cli.c:538
void * vl_msg_api_alloc(int nbytes)
void socksvr_set_bind_address(u32 bind_address)
Definition: socksvr_vlib.c:635
void vl_api_sockclnt_create_t_handler(vl_api_sockclnt_create_t *mp)
Definition: socksvr_vlib.c:455
#define vec_free(V)
Free vector&#39;s memory (no header).
Definition: vec.h:298
#define foreach_vlib_api_msg
Definition: socksvr_vlib.c:504
#define VLIB_MAIN_LOOP_EXIT_FUNCTION(x)
Definition: init.h:113
clib_error_t * vlibsocket_init(vlib_main_t *vm)
Definition: socksvr_vlib.c:641
#define clib_memcpy(a, b, c)
Definition: string.h:63
u8 * output_vector
Definition: api.h:57
#define pool_is_free_index(P, I)
Definition: pool.h:197
static clib_error_t * socksvr_accept_ready(unix_file_t *uf)
Definition: socksvr_vlib.c:422
int portno
Definition: api.h:27
always_inline void unix_file_del(unix_main_t *um, unix_file_t *f)
Definition: unix.h:141
#define ASSERT(truth)
unsigned int u32
Definition: types.h:88
u8 * format_unformat_error(u8 *s, va_list *va)
Definition: unformat.c:87
#define vec_delete(V, N, M)
Delete N elements starting at element M.
Definition: vec.h:743
u8 * format(u8 *s, char *fmt,...)
Definition: format.c:405
#define vec_append(v1, v2)
Append v2 after v1.
Definition: vec.h:777
i8 * unprocessed_input
Definition: api.h:55
unix_main_t unix_main
Definition: main.c:57
void vl_msg_api_send(vl_api_registration_t *rp, u8 *elem)
Definition: memory_vlib.c:90
void vl_socket_api_send_with_length(vl_api_registration_t *rp, u8 *elem, u32 msg_length)
Definition: socksvr_vlib.c:194
u64 uword
Definition: types.h:112
unsigned short u16
Definition: types.h:57
void vl_msg_api_socket_handler(void *the_msg)
Definition: api_shared.c:539
#define UNIX_FILE_DATA_AVAILABLE_TO_WRITE
Definition: unix.h:54
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
unsigned char u8
Definition: types.h:56
Definition: unix.h:49
u32 vl_api_registration_pool_index
Definition: api.h:41
i8 * input_buffer
Definition: api.h:45
void(* file_update)(unix_file_t *file, unix_file_update_type_t update_type)
Definition: unix.h:90
#define clib_error_return(e, args...)
Definition: error.h:112
struct _unformat_input_t unformat_input_t
static void vl_socket_api_send_with_length_internal(vl_api_registration_t *rp, u8 *elem, u32 msg_length, int free)
Definition: socksvr_vlib.c:157
void vl_api_sockclnt_delete_t_handler(vl_api_sockclnt_delete_t *mp)
Definition: socksvr_vlib.c:480