FD.io VPP
v18.01.2-1-g9b554f3
Vector Packet Processing
Main Page
Related Pages
Modules
Namespaces
Data Structures
Source
Files
Symbols
socket.h
Go to the documentation of this file.
1
/*
2
*------------------------------------------------------------------
3
* Copyright (c) 2017 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 _SOCKET_H_
19
#define _SOCKET_H
20
21
#include <
memif_private.h
>
22
23
/* interface identification errors (disconnect messages)*/
24
#define MEMIF_VER_ERR "incompatible version"
25
#define MEMIF_ID_ERR "unmatched interface id"
26
#define MEMIF_SLAVE_ERR "cannot connect to salve"
27
#define MEMIF_CONN_ERR "already connected"
28
#define MEMIF_MODE_ERR "mode mismatch"
29
#define MEMIF_SECRET_ERR "incorrect secret"
30
#define MEMIF_NOSECRET_ERR "secret required"
31
32
/* socket.c */
33
34
int
memif_conn_fd_read_ready
(
memif_connection_t
*
c
);
35
36
int
memif_conn_fd_write_ready
(
memif_connection_t
*
c
);
37
38
int
memif_conn_fd_error
(
memif_connection_t
*
c
);
39
40
int
memif_conn_fd_accept_ready
(
memif_socket_t
* ms);
41
42
int
memif_read_ready
(
int
fd);
43
44
int
memif_msg_send_disconnect
(
int
fd, uint8_t * err_string,
45
uint32_t err_code);
46
47
/* when compiling unit tests, compile functions without static keyword
48
and declare functions in header file */
49
#ifdef MEMIF_UNIT_TEST
50
#define static_fn
51
52
int
memif_msg_send
(
int
fd,
memif_msg_t
* msg,
int
afd);
53
54
int
memif_msg_enq_ack
(
memif_connection_t
*
c
);
55
56
int
memif_msg_send_hello
(
int
fd);
57
58
int
memif_msg_enq_init
(
memif_connection_t
*
c
);
59
60
int
memif_msg_enq_add_region
(
memif_connection_t
*
c
, uint8_t region);
61
62
int
memif_msg_enq_add_ring
(
memif_connection_t
*
c
, uint8_t index,
63
uint8_t dir);
64
65
int
memif_msg_receive_hello
(
memif_connection_t
*
c
,
memif_msg_t
* msg);
66
67
int
memif_msg_receive_init
(
memif_socket_t
* ms,
int
fd,
memif_msg_t
* msg);
68
69
int
memif_msg_receive_add_region
(
memif_connection_t
*
c
,
memif_msg_t
* msg,
70
int
fd);
71
72
int
memif_msg_receive_add_ring
(
memif_connection_t
*
c
,
memif_msg_t
* msg,
73
int
fd);
74
75
int
memif_msg_enq_connect
(
memif_connection_t
*
c
);
76
77
int
memif_msg_enq_connected
(
memif_connection_t
*
c
);
78
79
int
memif_msg_receive_connect
(
memif_connection_t
*
c
,
memif_msg_t
* msg);
80
81
int
memif_msg_receive_connected
(
memif_connection_t
*
c
,
memif_msg_t
* msg);
82
83
int
memif_msg_receive_disconnect
(
memif_connection_t
*
c
,
memif_msg_t
* msg);
84
85
#else
86
#define static_fn static
87
#endif
/* MEMIF_UNIT_TEST */
88
89
#endif
/* _SOCKET_H_ */
memif_msg_receive_disconnect
static_fn int memif_msg_receive_disconnect(memif_connection_t *c, memif_msg_t *msg)
Definition:
socket.c:619
memif_read_ready
int memif_read_ready(int fd)
Definition:
socket.c:876
memif_msg_t
Definition:
memif.h:124
memif_socket_t
Definition:
memif_private.h:170
memif_msg_send
static_fn int memif_msg_send(int fd, memif_msg_t *msg, int afd)
Definition:
socket.c:38
memif_connection_t
Definition:
main.c:72
memif_conn_fd_error
int memif_conn_fd_error(memif_connection_t *c)
Definition:
socket.c:792
memif_msg_receive_connect
static_fn int memif_msg_receive_connect(memif_connection_t *c, memif_msg_t *msg)
Definition:
socket.c:558
memif_msg_send_disconnect
int memif_msg_send_disconnect(int fd, uint8_t *err_string, uint32_t err_code)
Definition:
socket.c:315
memif_msg_receive_init
static_fn int memif_msg_receive_init(memif_socket_t *ms, int fd, memif_msg_t *msg)
Definition:
socket.c:360
memif_conn_fd_read_ready
int memif_conn_fd_read_ready(memif_connection_t *c)
Definition:
socket.c:802
memif_msg_enq_connected
static_fn int memif_msg_enq_connected(memif_connection_t *c)
Definition:
socket.c:279
memif_msg_enq_init
static_fn int memif_msg_enq_init(memif_connection_t *c)
Definition:
socket.c:122
memif_msg_enq_ack
static_fn int memif_msg_enq_ack(memif_connection_t *c)
Definition:
socket.c:71
memif_msg_send_hello
static_fn int memif_msg_send_hello(int fd)
Definition:
socket.c:100
c
svmdb_client_t * c
Definition:
vpp_get_metrics.c:49
memif_conn_fd_write_ready
int memif_conn_fd_write_ready(memif_connection_t *c)
Definition:
socket.c:815
memif_msg_enq_add_region
static_fn int memif_msg_enq_add_region(memif_connection_t *c, uint8_t region_index)
Definition:
socket.c:163
memif_private.h
memif_msg_receive_add_ring
static_fn int memif_msg_receive_add_ring(memif_connection_t *c, memif_msg_t *msg, int fd)
Definition:
socket.c:503
memif_msg_receive_add_region
static_fn int memif_msg_receive_add_region(memif_connection_t *c, memif_msg_t *msg, int fd)
Definition:
socket.c:476
memif_conn_fd_accept_ready
int memif_conn_fd_accept_ready(memif_socket_t *ms)
Definition:
socket.c:845
memif_msg_enq_connect
static_fn int memif_msg_enq_connect(memif_connection_t *c)
Definition:
socket.c:245
memif_msg_receive_hello
static_fn int memif_msg_receive_hello(memif_connection_t *c, memif_msg_t *msg)
Definition:
socket.c:334
memif_msg_receive_connected
static_fn int memif_msg_receive_connected(memif_connection_t *c, memif_msg_t *msg)
Definition:
socket.c:593
memif_msg_enq_add_ring
static_fn int memif_msg_enq_add_ring(memif_connection_t *c, uint8_t index, uint8_t dir)
Definition:
socket.c:200
extras
libmemif
src
socket.h
Generated on Wed Sep 5 2018 06:03:24 for FD.io VPP by
1.8.11