FD.io VPP  v18.01.2-1-g9b554f3
Vector Packet Processing
vapi_common.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 vapi_common_h_included
19 #define vapi_common_h_included
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
25 typedef enum
26 {
27  VAPI_OK = 0, /**< success */
28  VAPI_EINVAL, /**< invalid value encountered */
29  VAPI_EAGAIN, /**< operation would block */
30  VAPI_ENOTSUP, /**< operation not supported */
31  VAPI_ENOMEM, /**< out of memory */
32  VAPI_ENORESP, /**< no response to request */
33  VAPI_EMAP_FAIL, /**< failure while mapping api */
34  VAPI_ECON_FAIL, /**< failure while connecting to vpp */
35  VAPI_EINCOMPATIBLE, /**< fundamental incompatibility while connecting to vpp
36  (control ping/control ping reply mismatch) */
37  VAPI_MUTEX_FAILURE, /**< failure manipulating internal mutex(es) */
38  VAPI_EUSER, /**< user error used for breaking dispatch,
39  never used by VAPI */
40 } vapi_error_e;
41 
42 typedef enum
43 {
44  VAPI_MODE_BLOCKING = 1, /**< operations block until response received */
45  VAPI_MODE_NONBLOCKING = 2, /**< operations never block */
46 } vapi_mode_e;
47 
48 typedef enum
49 {
50  VAPI_WAIT_FOR_READ, /**< wait until some message is readable */
51  VAPI_WAIT_FOR_WRITE, /**< wait until a message can be written */
52  VAPI_WAIT_FOR_READ_WRITE, /**< wait until a read or write can be done */
54 
55 typedef unsigned int vapi_msg_id_t;
56 
57 #define INVALID_MSG_ID ((vapi_msg_id_t)(~0))
58 
59 #ifdef __cplusplus
60 }
61 #endif
62 
63 #endif
failure manipulating internal mutex(es)
Definition: vapi_common.h:37
operations block until response received
Definition: vapi_common.h:44
operations never block
Definition: vapi_common.h:45
operation would block
Definition: vapi_common.h:29
vapi_mode_e
Definition: vapi_common.h:42
out of memory
Definition: vapi_common.h:31
fundamental incompatibility while connecting to vpp (control ping/control ping reply mismatch) ...
Definition: vapi_common.h:35
operation not supported
Definition: vapi_common.h:30
wait until some message is readable
Definition: vapi_common.h:50
invalid value encountered
Definition: vapi_common.h:28
no response to request
Definition: vapi_common.h:32
failure while mapping api
Definition: vapi_common.h:33
vapi_wait_mode_e
Definition: vapi_common.h:48
success
Definition: vapi_common.h:27
wait until a message can be written
Definition: vapi_common.h:51
wait until a read or write can be done
Definition: vapi_common.h:52
user error used for breaking dispatch, never used by VAPI
Definition: vapi_common.h:38
unsigned int vapi_msg_id_t
Definition: vapi_common.h:55
vapi_error_e
Definition: vapi_common.h:25
failure while connecting to vpp
Definition: vapi_common.h:34