Hybrid ICN (hICN) plugin  v21.06-rc0-4-g18fa668
error.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017-2020 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 #ifndef __HICN_ERROR_H__
17 #define __HICN_ERROR_H__
18 
25 #define foreach_hicn_error \
26  _ (NONE, 0, "Ok") \
27  _ (UNSPECIFIED, -128, "Unspecified Error") \
28  _ (FACE_NOT_FOUND, -129, "Face not found in Face table") \
29  _ (FACE_NULL, -130, "Face null") \
30  _ (FACE_IP_ADJ_NOT_FOUND, -131, "Ip adjacecny for face not found") \
31  _ (FACE_HW_INT_NOT_FOUND, -132, "Hardware interface not found") \
32  _ (FACE_NOMEM, -133, "Face table is full") \
33  _ (FACE_NO_GLOBAL_IP, -134, "No global ip address for face") \
34  _ (FACE_NOT_FOUND_IN_ENTRY, -135, "Face not found in entry") \
35  _ (FACE_ALREADY_DELETED, -136, "Face alredy deleted") \
36  _ (FACE_ALREADY_CREATED, -137, "Face alredy created") \
37  _ (FWD_NOT_ENABLED, -138, "hICN forwarder not enabled") \
38  _ (FWD_ALREADY_ENABLED, -139, "hICN forwarder alredy enabled") \
39  _ (PARSER_UNSUPPORTED_PROTO, -140, "Unsupported protocol") \
40  _ (PARSER_PKT_INVAL, -141, "Packet null") \
41  _ (PIT_CONFIG_MINLT_OOB, -142, "Min lifetime ouf of bounds") \
42  _ (PIT_CONFIG_MAXLT_OOB, -143, "Max lifetime ouf of bounds") \
43  _ (PIT_CONFIG_MINMAXLT, -144, "Min lifetime grater than max lifetime") \
44  _ (PIT_CONFIG_DFTLT_OOB, -145, "Default lifetime ouf of bounds") \
45  _ (PIT_CONFIG_SIZE_OOB, -146, "Pit size ouf of bounds") \
46  _ (CS_CONFIG_SIZE_OOB, -147, "CS size ouf of bounds") \
47  _ (CS_CONFIG_RESERVED_OOB, -148, \
48  "Reseved CS must be between 0 and 100 (excluded)") \
49  _ (DPO_CTX_NHOPS_NS, -149, "No space for additional next hop") \
50  _ (DPO_CTX_NHOPS_EXISTS, -150, "Next hop already in the route") \
51  _ (DPO_CTX_NOT_FOUND, -151, "Dpo context not found") \
52  _ (DPO_MGR_ID_NOT_VALID, -152, "Dpo id for strategy and context not valid") \
53  _ (HASHTB_HASH_NOT_FOUND, -153, "Hash not found in hash table") \
54  _ (HASHTB_HASH_INVAL, -154, "Error while calculating the hash") \
55  _ (HASHTB_NOMEM, -155, "Unable to allocate new buckets or nodes") \
56  _ (HASHTB_INVAL, -156, "Invalid argument") \
57  _ (HASHTB_KEY_INVAL, -157, "Invalid hashtb key") \
58  _ (HASHTB_EXIST, -158, "Hash already in hashtable") \
59  _ (ROUTE_INVAL, -159, "Invalid face id and weight") \
60  _ (ROUTE_NO_LD, -160, "Expected load balance dpo") \
61  _ (ROUTE_MLT_LD, -161, "Unexpected mulitple buckets in load balance dpo") \
62  _ (ROUTE_NO_INSERT, -162, "Unable to insert a new FIB entry") \
63  _ (ROUTE_DPO_NO_HICN, -163, "Dpo is not of type hICN") \
64  _ (ROUTE_NOT_FOUND, -164, "Route not found in FIB") \
65  _ (ROUTE_NOT_UPDATED, -165, "Unable to update route") \
66  _ (ROUTE_ALREADY_EXISTS, -166, "Route already in FIB") \
67  _ (CLI_INVAL, -167, "Invalid input") \
68  _ (IPS_ADDR_TYPE_NONUNIFORM, -168, \
69  "Src and dst addr have different ip types") \
70  _ (FACE_TYPE_EXISTS, -169, "Face type already registered") \
71  _ (NO_BUFFERS, -170, "No vlib_buffer available for packet cloning.") \
72  _ (NOT_IMPLEMENTED, -171, "Function not yet implemented") \
73  _ (IFACE_IP_ADJ_NOT_FOUND, -172, \
74  "IP adjacency on incomplete face not available") \
75  _ (APPFACE_ALREADY_ENABLED, -173, \
76  "Application face already enabled on interface") \
77  _ (APPFACE_FEATURE, -174, "Error while enabling app face feature") \
78  _ (APPFACE_NOT_FOUND, -175, "Application face not found") \
79  _ (APPFACE_PROD_PREFIX_NULL, -176, \
80  "Prefix must not be null for producer face") \
81  _ (STRATEGY_NH_NOT_FOUND, -177, "Next hop not found") \
82  _ (MW_STRATEGY_SET, -178, "Error while setting weight for next hop") \
83  _ (STRATEGY_NOT_FOUND, -179, "Strategy not found") \
84  _ (UDP_TUNNEL_NOT_FOUND, -180, "Udp tunnel not found") \
85  _ (UDP_TUNNEL_SRC_DST_TYPE, -181, \
86  "Src and dst addresses have different type (ipv4 and ipv6)")
87 
88 typedef enum
89 {
90 #define _(a, b, c) HICN_ERROR_##a = (b),
91  foreach_hicn_error
92 #undef _
93  HICN_N_ERROR,
94 } hicn_error_t;
95 
96 extern const char *HICN_ERROR_STRING[];
97 
98 #define get_error_string(errno) \
99  (char *) (errno ? HICN_ERROR_STRING[(-errno) - 127] : \
100  HICN_ERROR_STRING[errno])
101 
102 #endif /* //__HICN_ERROR_H__ */
103 
104 /*
105  * fd.io coding-style-patch-verification: ON
106  *
107  * Local Variables: eval: (c-set-style "gnu") End:
108  */