udp: fix csum computation when offload disabled
[vpp.git] / src / vpp-api / vapi / vapi_common.h
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
36                            vpp (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_ENOTSOCK,      /**< vapi socket doesn't refer to a socket */
41     VAPI_EACCES,        /**< no write permission for socket */
42     VAPI_ECONNRESET,    /**< connection reset by peer*/
43     VAPI_ESOCK_FAILURE, /**< generic socket failure, check errno */
44   } vapi_error_e;
45
46   typedef enum
47   {
48     VAPI_MODE_BLOCKING = 1,    /**< operations block until response received */
49     VAPI_MODE_NONBLOCKING = 2, /**< operations never block */
50   } vapi_mode_e;
51
52   typedef unsigned int vapi_msg_id_t;
53
54 #define VAPI_INVALID_MSG_ID ((vapi_msg_id_t)(~0))
55
56 #ifdef __cplusplus
57 }
58 #endif
59
60 #endif