FD.io VPP  v19.01.3-6-g70449b9b9
Vector Packet Processing
socket_client.h
Go to the documentation of this file.
1 /*
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:
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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  *------------------------------------------------------------------
16  */
17 
18 #ifndef SRC_VLIBMEMORY_SOCKET_CLIENT_H_
19 #define SRC_VLIBMEMORY_SOCKET_CLIENT_H_
20 
21 #include <vppinfra/file.h>
22 #include <vppinfra/time.h>
24 
25 typedef struct
26 {
27  int socket_fd;
28  int socket_enable; /**< Can temporarily disable the connection
29  but still can keep it around... */
30  u32 client_index; /**< Client index allocated by VPP */
31 
33 
39 
40  u8 *name;
44 
46 
47 #define SOCKET_CLIENT_DEFAULT_BUFFER_SIZE 4096
48 
49 int vl_socket_client_connect (char *socket_path, char *client_name,
50  u32 socket_buffer_size);
51 void vl_socket_client_disconnect (void);
52 int vl_socket_client_read (int wait);
53 int vl_socket_client_write (void);
54 void vl_socket_client_enable_disable (int enable);
55 void *vl_socket_client_msg_alloc (int nbytes);
57 clib_error_t *vl_socket_client_recv_fd_msg (int fds[], int n_fds, u32 wait);
58 
59 #endif /* SRC_VLIBMEMORY_SOCKET_CLIENT_H_ */
60 
61 /*
62  * fd.io coding-style-patch-verification: ON
63  *
64  * Local Variables:
65  * eval: (c-set-style "gnu")
66  * End:
67  */
ssvm_private_t memfd_segment
Definition: socket_client.h:42
int vl_socket_client_init_shm(vl_api_shm_elem_config_t *config)
unsigned char u8
Definition: types.h:56
clib_time_t clib_time
Definition: socket_client.h:41
socket_client_main_t socket_client_main
Definition: socket_client.c:44
unsigned int u32
Definition: types.h:88
int vl_socket_client_write(void)
void * vl_socket_client_msg_alloc(int nbytes)
int vl_socket_client_read(int wait)
Definition: socket_client.c:56
clib_socket_t client_socket
Definition: socket_client.h:32
void vl_socket_client_enable_disable(int enable)
struct _socket_t clib_socket_t
u32 client_index
Client index allocated by VPP.
Definition: socket_client.h:30
int socket_enable
Can temporarily disable the connection but still can keep it around...
Definition: socket_client.h:28
int vl_socket_client_connect(char *socket_path, char *client_name, u32 socket_buffer_size)
clib_error_t * vl_socket_client_recv_fd_msg(int fds[], int n_fds, u32 wait)
void vl_socket_client_disconnect(void)