FD.io VPP  v21.06-3-gbb25fbf28
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 VAPI_INVALID_MSG_ID ((vapi_msg_id_t)(~0))
58 
59 #ifdef __cplusplus
60 }
61 #endif
62 
63 #endif
vapi_error_e
vapi_error_e
Definition: vapi_common.h:25
VAPI_WAIT_FOR_READ_WRITE
@ VAPI_WAIT_FOR_READ_WRITE
wait until a read or write can be done
Definition: vapi_common.h:52
VAPI_OK
@ VAPI_OK
success
Definition: vapi_common.h:27
VAPI_MODE_NONBLOCKING
@ VAPI_MODE_NONBLOCKING
operations never block
Definition: vapi_common.h:45
VAPI_MODE_BLOCKING
@ VAPI_MODE_BLOCKING
operations block until response received
Definition: vapi_common.h:44
VAPI_EAGAIN
@ VAPI_EAGAIN
operation would block
Definition: vapi_common.h:29
VAPI_EINCOMPATIBLE
@ VAPI_EINCOMPATIBLE
fundamental incompatibility while connecting to vpp (control ping/control ping reply mismatch)
Definition: vapi_common.h:35
vapi_msg_id_t
unsigned int vapi_msg_id_t
Definition: vapi_common.h:55
VAPI_WAIT_FOR_READ
@ VAPI_WAIT_FOR_READ
wait until some message is readable
Definition: vapi_common.h:50
VAPI_ENORESP
@ VAPI_ENORESP
no response to request
Definition: vapi_common.h:32
VAPI_EUSER
@ VAPI_EUSER
user error used for breaking dispatch, never used by VAPI
Definition: vapi_common.h:38
VAPI_WAIT_FOR_WRITE
@ VAPI_WAIT_FOR_WRITE
wait until a message can be written
Definition: vapi_common.h:51
vapi_wait_mode_e
vapi_wait_mode_e
Definition: vapi_common.h:48
vapi_mode_e
vapi_mode_e
Definition: vapi_common.h:42
VAPI_ECON_FAIL
@ VAPI_ECON_FAIL
failure while connecting to vpp
Definition: vapi_common.h:34
VAPI_ENOMEM
@ VAPI_ENOMEM
out of memory
Definition: vapi_common.h:31
VAPI_EMAP_FAIL
@ VAPI_EMAP_FAIL
failure while mapping api
Definition: vapi_common.h:33
VAPI_ENOTSUP
@ VAPI_ENOTSUP
operation not supported
Definition: vapi_common.h:30
VAPI_EINVAL
@ VAPI_EINVAL
invalid value encountered
Definition: vapi_common.h:28
VAPI_MUTEX_FAILURE
@ VAPI_MUTEX_FAILURE
failure manipulating internal mutex(es)
Definition: vapi_common.h:37