FD.io VPP
v18.07.1-19-g511ce25
Vector Packet Processing
Main Page
Related Pages
Modules
Namespaces
Data Structures
Source
Files
Symbols
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
>
23
#include <
vlibmemory/memory_shared.h
>
24
25
typedef
struct
26
{
27
int
socket_fd
;
28
/* Temporarily disable the connection, so we can keep it around... */
29
int
socket_enable
;
30
31
clib_socket_t
client_socket
;
32
33
u32
socket_buffer_size
;
34
u8
*
socket_tx_buffer
;
35
u8
*
socket_rx_buffer
;
36
u32
socket_tx_nbytes
;
37
int
control_pings_outstanding
;
38
39
u8
*
name
;
40
clib_time_t
clib_time
;
41
ssvm_private_t
memfd_segment
;
42
}
socket_client_main_t
;
43
44
extern
socket_client_main_t
socket_client_main
;
45
46
#define SOCKET_CLIENT_DEFAULT_BUFFER_SIZE 4096
47
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
*fd_to_recv,
u32
wait);
57
58
#endif
/* SRC_VLIBMEMORY_SOCKET_CLIENT_H_ */
59
60
/*
61
* fd.io coding-style-patch-verification: ON
62
*
63
* Local Variables:
64
* eval: (c-set-style "gnu")
65
* End:
66
*/
socket_client_main_t::socket_rx_buffer
u8 * socket_rx_buffer
Definition:
socket_client.h:35
socket_client_main_t::name
u8 * name
Definition:
socket_client.h:39
socket_client_main_t::memfd_segment
ssvm_private_t memfd_segment
Definition:
socket_client.h:41
time.h
vl_api_shm_elem_config_
Definition:
memory_shared.h:51
socket_client_main_t::socket_fd
int socket_fd
Definition:
socket_client.h:27
socket_client_main_t::control_pings_outstanding
int control_pings_outstanding
Definition:
socket_client.h:37
vl_socket_client_init_shm
int vl_socket_client_init_shm(vl_api_shm_elem_config_t *config)
Definition:
socket_client.c:379
u8
unsigned char u8
Definition:
types.h:56
file.h
socket_client_main_t::clib_time
clib_time_t clib_time
Definition:
socket_client.h:40
socket_client_main
socket_client_main_t socket_client_main
Definition:
socket_client.c:44
u32
unsigned int u32
Definition:
types.h:88
vl_socket_client_write
int vl_socket_client_write(void)
Definition:
socket_client.c:122
vl_socket_client_msg_alloc
void * vl_socket_client_msg_alloc(int nbytes)
Definition:
socket_client.c:151
vl_socket_client_read
int vl_socket_client_read(int wait)
Definition:
socket_client.c:56
socket_client_main_t::socket_tx_buffer
u8 * socket_tx_buffer
Definition:
socket_client.h:34
socket_client_main_t::client_socket
clib_socket_t client_socket
Definition:
socket_client.h:31
vl_socket_client_enable_disable
void vl_socket_client_enable_disable(int enable)
Definition:
socket_client.c:173
memory_shared.h
socket_client_main_t::socket_tx_nbytes
u32 socket_tx_nbytes
Definition:
socket_client.h:36
socket_client_main_t
Definition:
socket_client.h:25
clib_time_t
Definition:
time.h:43
clib_socket_t
struct _socket_t clib_socket_t
socket_client_main_t::socket_buffer_size
u32 socket_buffer_size
Definition:
socket_client.h:33
clib_error_t
Definition:
clib_error.h:21
vl_socket_client_recv_fd_msg
clib_error_t * vl_socket_client_recv_fd_msg(int *fd_to_recv, u32 wait)
Definition:
socket_client.c:412
socket_client_main_t::socket_enable
int socket_enable
Definition:
socket_client.h:29
ssvm_private_t
Definition:
ssvm.h:81
vl_socket_client_connect
int vl_socket_client_connect(char *socket_path, char *client_name, u32 socket_buffer_size)
Definition:
socket_client.c:325
vl_socket_client_disconnect
void vl_socket_client_disconnect(void)
Definition:
socket_client.c:158
src
vlibmemory
socket_client.h
Generated on Fri May 24 2019 10:25:48 for FD.io VPP by
1.8.11