2 *------------------------------------------------------------------
3 * Copyright (c) 2018 Cisco and/or its affiliates.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at:
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *------------------------------------------------------------------
18 #ifndef SRC_VLIBMEMORY_SOCKET_CLIENT_H_
19 #define SRC_VLIBMEMORY_SOCKET_CLIENT_H_
21 #include <vppinfra/file.h>
22 #include <vppinfra/time.h>
23 #include <vlibmemory/memory_shared.h>
28 /* Temporarily disable the connection, so we can keep it around... */
31 clib_socket_t client_socket;
33 u32 socket_buffer_size;
37 int control_pings_outstanding;
40 clib_time_t clib_time;
41 ssvm_private_t memfd_segment;
42 } socket_client_main_t;
44 extern socket_client_main_t socket_client_main;
46 #define SOCKET_CLIENT_DEFAULT_BUFFER_SIZE 4096
48 int vl_socket_client_connect (char *socket_path, char *client_name,
49 u32 socket_buffer_size);
50 void vl_socket_client_disconnect (void);
51 int vl_socket_client_read (int wait);
52 int vl_socket_client_write (void);
53 void vl_socket_client_enable_disable (int enable);
54 void *vl_socket_client_msg_alloc (int nbytes);
55 int vl_socket_client_init_shm (vl_api_shm_elem_config_t * config);
56 clib_error_t *vl_socket_client_recv_fd_msg (int fds[], int n_fds, u32 wait);
58 #endif /* SRC_VLIBMEMORY_SOCKET_CLIENT_H_ */
61 * fd.io coding-style-patch-verification: ON
64 * eval: (c-set-style "gnu")