FD.io VPP
v19.08.3-2-gbabecb413
Vector Packet Processing
memif.api
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2017 Cisco and/or its affiliates.
3
* Licensed under the Apache License, Version 2.0 (the "License");
4
* you may not use this file except in compliance with the License.
5
* You may obtain a copy of the License at:
6
*
7
* http://www.apache.org/licenses/LICENSE-2.0
8
*
9
* Unless required by applicable law or agreed to in writing, software
10
* distributed under the License is distributed on an "AS IS" BASIS,
11
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
* See the License for the specific language governing permissions and
13
* limitations under the License.
14
*/
15
16
option
version
=
"2.0.0"
;
17
18
/** \brief Create or remove named socket file for memif interfaces
19
@param client_index - opaque cookie to identify the sender
20
@param context - sender context, to match reply w/ request
21
@param is_add - 0 = remove, 1 = add association
22
@param socket_id - non-0 32-bit integer used to identify a socket file
23
@param socket_filename - filename of the socket to be used for connection
24
establishment; id 0 always maps to default "/var/vpp/memif.sock";
25
no socket filename needed when is_add == 0.
26
*/
27
autoreply define
memif_socket_filename_add_del
28
{
29
u32
client_index
;
30
u32
context
;
31
u8
is_add
;
/* 0 = remove, 1 = add association */
32
u32
socket_id
;
/* unique non-0 id for given socket file name */
33
u8
socket_filename[128];
/* NUL terminated filename */
34
};
35
36
/** \brief Create memory interface
37
@param client_index - opaque cookie to identify the sender
38
@param context - sender context, to match reply w/ request
39
@param role - role of the interface in the connection (master/slave)
40
@param mode - interface mode
41
@param rx_queues - number of rx queues (only valid for slave)
42
@param tx_queues - number of tx queues (only valid for slave)
43
@param id - 32bit integer used to authenticate and match opposite sides
44
of the connection
45
@param socket_id - socket filename id to be used for connection
46
establishment
47
@param ring_size - the number of entries of RX/TX rings
48
@param buffer_size - size of the buffer allocated for each ring entry
49
@param hw_addr - interface MAC address
50
*/
51
define
memif_create
52
{
53
u32
client_index
;
54
u32
context
;
55
56
u8
role
;
/* 0 = master, 1 = slave */
57
u8
mode
;
/* 0 = ethernet, 1 = ip, 2 = punt/inject */
58
u8
rx_queues
;
/* optional, default is 1 */
59
u8
tx_queues
;
/* optional, default is 1 */
60
u32
id
;
/* optional, default is 0 */
61
u32
socket_id
;
/* optional, default is 0, "/var/vpp/memif.sock" */
62
u8
secret[24];
/* optional, default is "" */
63
u32
ring_size
;
/* optional, default is 1024 entries, must be power of 2 */
64
u16
buffer_size
;
/* optional, default is 2048 bytes */
65
u8
hw_addr[6];
/* optional, randomly generated if not defined */
66
};
67
68
/** \brief Create memory interface response
69
@param context - sender context, to match reply w/ request
70
@param retval - return value for request
71
@param sw_if_index - software index of the newly created interface
72
*/
73
define memif_create_reply
74
{
75
u32
context
;
76
i32
retval
;
77
u32
sw_if_index
;
78
};
79
80
/** \brief Delete memory interface
81
@param client_index - opaque cookie to identify the sender
82
@param context - sender context, to match reply w/ request
83
@param sw_if_index - software index of the interface to delete
84
*/
85
autoreply define
memif_delete
86
{
87
u32
client_index
;
88
u32
context
;
89
90
u32
sw_if_index
;
91
};
92
93
/** \brief Memory interface details structure
94
@param context - sender context, to match reply w/ request
95
@param socket_id - u32 used to identify the given socket filename
96
@param socket_filename - correpsonding NUL terminated socket filename
97
*/
98
define memif_socket_filename_details
99
{
100
u32
context
;
101
u32
socket_id
;
102
u8
socket_filename[128];
103
};
104
105
/** \brief Dump the table of socket ids and corresponding filenames
106
@param client_index - opaque cookie to identify the sender
107
@param context - sender context, to match reply w/ request
108
*/
109
define memif_socket_filename_dump
110
{
111
u32
client_index
;
112
u32
context
;
113
};
114
115
/** \brief Memory interface details structure
116
@param context - sender context, to match reply w/ request (memif_dump)
117
@param sw_if_index - index of the interface
118
@param if_name - name of the interface
119
@param hw_addr - interface MAC address
120
@param id - id associated with the interface
121
@param role - role of the interface in the connection (master/slave)
122
@param mode - interface mode
123
@param socket_id - id of the socket filename used by this interface
124
to establish new connections
125
@param ring_size - the number of entries of RX/TX rings
126
@param buffer_size - size of the buffer allocated for each ring entry
127
@param admin_up_down - interface administrative status
128
@param link_up_down - interface link status
129
130
*/
131
define memif_details
132
{
133
u32
context
;
134
135
u32
sw_if_index
;
136
u8
if_name[64];
137
u8
hw_addr[6];
138
139
/* memif specific parameters */
140
u32
id
;
141
u8
role
;
/* 0 = master, 1 = slave */
142
u8
mode
;
/* 0 = ethernet, 1 = ip, 2 = punt/inject */
143
u32
socket_id
;
144
u32
ring_size
;
145
u16
buffer_size
;
/* optional, default is 2048 bytes */
146
147
/* 1 = up, 0 = down */
148
u8
admin_up_down
;
149
u8
link_up_down
;
150
};
151
152
/** \brief Dump all memory interfaces
153
@param client_index - opaque cookie to identify the sender
154
@param context - sender context, to match reply w/ request
155
*/
156
define memif_dump
157
{
158
u32
client_index
;
159
u32
context
;
160
};
161
162
/*
163
* Local Variables:
164
* eval: (c-set-style "gnu")
165
* End:
166
*/
vl_api_memif_socket_filename_details_t::socket_id
u32 socket_id
Definition:
memif.api:101
version
option version
Definition:
memif.api:16
vl_api_memif_details_t::mode
u8 mode
Definition:
memif.api:142
vl_api_memif_socket_filename_dump_t::client_index
u32 client_index
Definition:
memif.api:111
vl_api_memif_socket_filename_details_t::context
u32 context
Definition:
memif.api:100
vl_api_memif_create_t::client_index
u32 client_index
Definition:
memif.api:53
vl_api_memif_create_t::mode
u8 mode
Definition:
memif.api:57
vl_api_memif_socket_filename_add_del_t::context
u32 context
Definition:
memif.api:30
vl_api_memif_create_t::socket_id
u32 socket_id
Definition:
memif.api:61
u8
unsigned char u8
Definition:
types.h:56
vl_api_memif_create_t::ring_size
u32 ring_size
Definition:
memif.api:63
vl_api_memif_details_t::socket_id
u32 socket_id
Definition:
memif.api:143
u32
unsigned int u32
Definition:
types.h:88
vl_api_memif_details_t::link_up_down
u8 link_up_down
Definition:
memif.api:149
vl_api_memif_socket_filename_add_del_t::socket_id
u32 socket_id
Definition:
memif.api:32
vl_api_memif_create_reply_t::retval
i32 retval
Definition:
memif.api:76
vl_api_memif_socket_filename_add_del_t::client_index
u32 client_index
Definition:
memif.api:29
vl_api_memif_socket_filename_add_del_t::is_add
u8 is_add
Definition:
memif.api:31
u16
unsigned short u16
Definition:
types.h:57
vl_api_memif_dump_t::client_index
u32 client_index
Definition:
memif.api:158
vl_api_memif_delete_t::client_index
u32 client_index
Definition:
memif.api:87
vl_api_memif_dump_t::context
u32 context
Definition:
memif.api:159
vl_api_memif_details_t::buffer_size
u16 buffer_size
Definition:
memif.api:145
memif_socket_filename_add_del
int memif_socket_filename_add_del(u8 is_add, u32 sock_id, u8 *sock_filename)
Definition:
memif.c:660
vl_api_memif_details_t::ring_size
u32 ring_size
Definition:
memif.api:144
vl_api_memif_details_t::role
u8 role
Definition:
memif.api:141
vl_api_memif_details_t::admin_up_down
u8 admin_up_down
Definition:
memif.api:148
vl_api_memif_create_reply_t::context
u32 context
Definition:
memif.api:75
vl_api_memif_create_t::tx_queues
u8 tx_queues
Definition:
memif.api:59
vl_api_memif_details_t::id
u32 id
Definition:
memif.api:140
i32
signed int i32
Definition:
types.h:77
memif_create
int memif_create(memif_conn_handle_t *conn, memif_conn_args_t *args, memif_connection_update_t *on_connect, memif_connection_update_t *on_disconnect, memif_interrupt_t *on_interrupt, void *private_ctx)
Memory interface create function.
Definition:
main.c:1095
vl_api_memif_socket_filename_dump_t::context
u32 context
Definition:
memif.api:112
vl_api_memif_details_t::context
u32 context
Definition:
memif.api:133
vl_api_memif_create_t::buffer_size
u16 buffer_size
Definition:
memif.api:64
vl_api_memif_details_t::sw_if_index
u32 sw_if_index
Definition:
memif.api:135
vl_api_memif_create_t::id
u32 id
Definition:
memif.api:60
vl_api_memif_create_t::context
u32 context
Definition:
memif.api:54
vl_api_memif_create_t::role
u8 role
Definition:
memif.api:56
vl_api_memif_create_reply_t::sw_if_index
u32 sw_if_index
Definition:
memif.api:77
vl_api_memif_create_t::rx_queues
u8 rx_queues
Definition:
memif.api:58
vl_api_memif_delete_t::sw_if_index
u32 sw_if_index
Definition:
memif.api:90
memif_delete
int memif_delete(memif_conn_handle_t *conn)
Memif delete.
Definition:
main.c:1816
vl_api_memif_delete_t::context
u32 context
Definition:
memif.api:88
src
plugins
memif
memif.api
Generated on Mon Oct 19 2020 14:03:24 for FD.io VPP by
1.8.13