blob: df3806a7630559d0e44368f567b5f9bf9d459b28 [file] [log] [blame]
Ed Warnickecb9cada2015-12-08 15:45:58 -07001/*
2 * Copyright (c) 2015 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#ifndef included_vnet_api_errno_h
16#define included_vnet_api_errno_h
17
Klement Sekeraff92efe2017-11-30 07:00:31 +010018#include <stdarg.h>
19#include <vppinfra/types.h>
20#include <vppinfra/format.h>
21
Ed Warnickecb9cada2015-12-08 15:45:58 -070022#define foreach_vnet_api_error \
23_(UNSPECIFIED, -1, "Unspecified Error") \
24_(INVALID_SW_IF_INDEX, -2, "Invalid sw_if_index") \
25_(NO_SUCH_FIB, -3, "No such FIB / VRF") \
26_(NO_SUCH_INNER_FIB, -4, "No such inner FIB / VRF") \
27_(NO_SUCH_LABEL, -5, "No such label") \
28_(NO_SUCH_ENTRY, -6, "No such entry") \
29_(INVALID_VALUE, -7, "Invalid value") \
30_(INVALID_VALUE_2, -8, "Invalid value #2") \
31_(UNIMPLEMENTED, -9, "Unimplemented") \
32_(INVALID_SW_IF_INDEX_2, -10, "Invalid sw_if_index #2") \
33_(SYSCALL_ERROR_1, -11, "System call error #1") \
34_(SYSCALL_ERROR_2, -12, "System call error #2") \
35_(SYSCALL_ERROR_3, -13, "System call error #3") \
36_(SYSCALL_ERROR_4, -14, "System call error #4") \
37_(SYSCALL_ERROR_5, -15, "System call error #5") \
38_(SYSCALL_ERROR_6, -16, "System call error #6") \
39_(SYSCALL_ERROR_7, -17, "System call error #7") \
40_(SYSCALL_ERROR_8, -18, "System call error #8") \
41_(SYSCALL_ERROR_9, -19, "System call error #9") \
Dave Barach2feaffc2017-01-14 10:30:50 -050042_(SYSCALL_ERROR_10, -20, "System call error #10") \
Ed Warnickecb9cada2015-12-08 15:45:58 -070043_(FEATURE_DISABLED, -30, "Feature disabled by configuration") \
44_(INVALID_REGISTRATION, -31, "Invalid registration") \
45_(NEXT_HOP_NOT_IN_FIB, -50, "Next hop not in FIB") \
46_(UNKNOWN_DESTINATION, -51, "Unknown destination") \
Neale Ranns097fa662018-05-01 05:17:55 -070047_(NO_PATHS_IN_ROUTE, -52, "No paths specified in route") \
Ed Warnickecb9cada2015-12-08 15:45:58 -070048_(NEXT_HOP_NOT_FOUND_MP, -53, "Next hop not found (multipath)") \
49_(NO_MATCHING_INTERFACE, -54, "No matching interface for probe") \
50_(INVALID_VLAN, -55, "Invalid VLAN") \
51_(VLAN_ALREADY_EXISTS, -56, "VLAN subif already exists") \
52_(INVALID_SRC_ADDRESS, -57, "Invalid src address") \
53_(INVALID_DST_ADDRESS, -58, "Invalid dst address") \
54_(ADDRESS_LENGTH_MISMATCH, -59, "Address length mismatch") \
55_(ADDRESS_NOT_FOUND_FOR_INTERFACE, -60, "Address not found for interface") \
Juraj Sloboda5bb1eca2018-10-22 09:57:13 +020056_(ADDRESS_NOT_DELETABLE, -61, "Address not deletable") \
Ed Warnickecb9cada2015-12-08 15:45:58 -070057_(IP6_NOT_ENABLED, -62, "ip6 not enabled") \
Ed Warnickecb9cada2015-12-08 15:45:58 -070058_(NO_SUCH_NODE, -63, "No such graph node") \
59_(NO_SUCH_NODE2, -64, "No such graph node #2") \
60_(NO_SUCH_TABLE, -65, "No such table") \
61_(NO_SUCH_TABLE2, -66, "No such table #2") \
62_(NO_SUCH_TABLE3, -67, "No such table #3") \
63_(SUBIF_ALREADY_EXISTS, -68, "Subinterface already exists") \
64_(SUBIF_CREATE_FAILED, -69, "Subinterface creation failed") \
65_(INVALID_MEMORY_SIZE, -70, "Invalid memory size requested") \
66_(INVALID_INTERFACE, -71, "Invalid interface") \
67_(INVALID_VLAN_TAG_COUNT, -72, "Invalid number of tags for requested operation") \
68_(INVALID_ARGUMENT, -73, "Invalid argument") \
69_(UNEXPECTED_INTF_STATE, -74, "Unexpected interface state") \
70_(TUNNEL_EXIST, -75, "Tunnel already exists") \
71_(INVALID_DECAP_NEXT, -76, "Invalid decap-next") \
72_(RESPONSE_NOT_READY, -77, "Response not ready") \
Damjan Marion83243a02016-02-29 13:09:30 +010073_(NOT_CONNECTED, -78, "Not connected to the data plane") \
John Lobcebbb92016-04-05 15:47:43 -040074_(IF_ALREADY_EXISTS, -79, "Interface already exists") \
Andrej Kozemcakb92feb62016-03-31 13:51:42 +020075_(BOND_SLAVE_NOT_ALLOWED, -80, "Operation not allowed on slave of BondEthernet") \
Chris Luke99cb3352016-04-26 10:49:53 -040076_(VALUE_EXIST, -81, "Value already exists") \
Keith Burns (alagalah)52fc44d2016-03-25 09:38:50 -070077_(SAME_SRC_DST, -82, "Source and destination are the same") \
78_(IP6_MULTICAST_ADDRESS_NOT_PRESENT, -83, "IP6 multicast address required") \
Paul Vinciguerra6a69b242019-06-17 23:07:13 -040079_(SR_POLICY_NAME_NOT_PRESENT, -84, "Segment routing policy name required") \
Marek Gradzkid85036f2016-04-26 12:09:05 +020080_(NOT_RUNNING_AS_ROOT, -85, "Not running as root") \
81_(ALREADY_CONNECTED, -86, "Connection to the data plane already exists") \
82_(UNSUPPORTED_JNI_VERSION, -87, "Unsupported JNI version") \
Neale Ranns3ec09e92020-02-24 13:32:30 +000083_(IP_PREFIX_INVALID, -88, "IP prefix invalid (masked bits set in address") \
Andrej Kozemcak8ebb2a12016-06-07 12:25:20 +020084_(INVALID_WORKER, -89, "Invalid worker thread") \
Pavel Kotucek20c90f72016-06-07 14:44:26 +020085_(LISP_DISABLED, -90, "LISP is disabled") \
Filip Tehlar006eb262016-06-27 13:09:20 +020086_(CLASSIFY_TABLE_NOT_FOUND, -91, "Classify table not found") \
Paul Vinciguerra6a69b242019-06-17 23:07:13 -040087_(INVALID_EID_TYPE, -92, "Unsupported LISP EID type") \
Dave Barach6f9bca22016-04-30 10:25:32 -040088_(CANNOT_CREATE_PCAP_FILE, -93, "Cannot create pcap file") \
89_(INCORRECT_ADJACENCY_TYPE, -94, "Invalid adjacency type for this operation") \
90_(EXCEEDED_NUMBER_OF_RANGES_CAPACITY, -95, "Operation would exceed configured capacity of ranges") \
Pierre Pfister041eacc2016-08-04 16:13:09 +010091_(EXCEEDED_NUMBER_OF_PORTS_CAPACITY, -96, "Operation would exceed capacity of number of ports") \
Pavel Kotucekd85590a2016-08-26 13:35:40 +020092_(INVALID_ADDRESS_FAMILY, -97, "Invalid address family") \
Filip Tehlar69a9b762016-09-23 10:00:52 +020093_(INVALID_SUB_SW_IF_INDEX, -98, "Invalid sub-interface sw_if_index") \
Pavel Kotucek7490a752016-11-15 09:19:11 +010094_(TABLE_TOO_BIG, -99, "Table too big") \
Klement Sekera0e3c0de2016-09-29 14:43:44 +020095_(CANNOT_ENABLE_DISABLE_FEATURE, -100, "Cannot enable/disable feature") \
Dave Barach68b0fb02017-02-28 15:15:56 -050096_(BFD_EEXIST, -101, "Duplicate BFD object") \
97_(BFD_ENOENT, -102, "No such BFD object") \
98_(BFD_EINUSE, -103, "BFD object in use") \
99_(BFD_NOTSUPP, -104, "BFD feature not supported") \
100_(ADDRESS_IN_USE, -105, "Address in use") \
101_(ADDRESS_NOT_IN_USE, -106, "Address not in use") \
102_(QUEUE_FULL, -107, "Queue full") \
Florin Corasb384b542018-01-15 01:08:33 -0800103_(APP_UNSUPPORTED_CFG, -108, "Unsupported application config") \
Dave Barach68b0fb02017-02-28 15:15:56 -0500104_(URI_FIFO_CREATE_FAILED, -109, "URI FIFO segment create failed") \
105_(LISP_RLOC_LOCAL, -110, "RLOC address is local") \
106_(BFD_EAGAIN, -111, "BFD object cannot be manipulated at this time") \
107_(INVALID_GPE_MODE, -112, "Invalid GPE mode") \
Neale Ranns4008ac92017-02-13 23:20:04 -0800108_(LISP_GPE_ENTRIES_PRESENT, -113, "LISP GPE entries are present") \
Florin Corase04c2992017-03-01 08:17:34 -0800109_(ADDRESS_FOUND_FOR_INTERFACE, -114, "Address found for interface") \
Florin Corascea194d2017-10-02 00:18:51 -0700110_(SESSION_CONNECT, -115, "Session failed to connect") \
Florin Coras6cf30ad2017-04-04 23:08:23 -0700111_(ENTRY_ALREADY_EXISTS, -116, "Entry already exists") \
Paul Vinciguerra6a69b242019-06-17 23:07:13 -0400112_(SVM_SEGMENT_CREATE_FAIL, -117, "Svm segment create fail") \
113_(APPLICATION_NOT_ATTACHED, -118, "Application not attached") \
Eyal Barib1352ed2017-04-07 23:14:17 +0300114_(BD_ALREADY_EXISTS, -119, "Bridge domain already exists") \
Damjan Marion44036902017-04-28 12:29:15 +0200115_(BD_IN_USE, -120, "Bridge domain has member interfaces") \
John Lo97934772017-05-18 22:26:47 -0400116_(BD_NOT_MODIFIABLE, -121, "Bridge domain 0 can't be deleted/modified") \
Paul Vinciguerra6a69b242019-06-17 23:07:13 -0400117_(BD_ID_EXCEED_MAX, -122, "Bridge domain ID exceeds 16M limit") \
John Lo8d00fff2017-08-03 00:35:36 -0400118_(SUBIF_DOESNT_EXIST, -123, "Subinterface doesn't exist") \
119_(L2_MACS_EVENT_CLINET_PRESENT, -124, "Client already exist for L2 MACs events") \
Stevenbd8a6112017-07-30 10:29:26 -0700120_(INVALID_QUEUE, -125, "Invalid queue") \
Jon Loeliger35ffa3e2017-09-28 13:54:16 -0500121_(UNSUPPORTED, -126, "Unsupported") \
Florin Corascea194d2017-10-02 00:18:51 -0700122_(DUPLICATE_IF_ADDRESS, -127, "Address already present on another interface") \
123_(APP_INVALID_NS, -128, "Invalid application namespace") \
124_(APP_WRONG_NS_SECRET, -129, "Wrong app namespace secret") \
125_(APP_CONNECT_SCOPE, -130, "Connect scope") \
126_(APP_ALREADY_ATTACHED, -131, "App already attached") \
127_(SESSION_REDIRECT, -132, "Redirect failed") \
Dave Barach65457162017-10-10 17:53:14 -0400128_(ILLEGAL_NAME, -133, "Illegal name") \
129_(NO_NAME_SERVERS, -134, "No name servers configured") \
130_(NAME_SERVER_NOT_FOUND, -135, "Name server not found") \
131_(NAME_RESOLUTION_NOT_ENABLED, -136, "Name resolution not enabled") \
132_(NAME_SERVER_FORMAT_ERROR, -137, "Server format error (bug!)") \
133_(NAME_SERVER_NO_SUCH_NAME, -138, "No such name") \
134_(NAME_SERVER_NO_ADDRESSES, -139, "No addresses available") \
Florin Corasa2ff7b82017-11-08 17:55:03 -0800135_(NAME_SERVER_NEXT_SERVER, -140, "Retry with new server") \
Jon Loeliger27cadd22017-11-10 13:15:12 -0600136_(APP_CONNECT_FILTERED, -141, "Connect was filtered") \
137_(ACL_IN_USE_INBOUND, -142, "Inbound ACL in use") \
Damjan Marion91c6ef72017-12-01 13:34:24 +0100138_(ACL_IN_USE_OUTBOUND, -143, "Outbound ACL in use") \
139_(INIT_FAILED, -144, "Initialization Failed") \
Paul Vinciguerra6a69b242019-06-17 23:07:13 -0400140_(NETLINK_ERROR, -145, "Netlink error") \
Jon Loeliger3d460bd2018-02-01 16:36:12 -0600141_(BIER_BSL_UNSUP, -146, "BIER bit-string-length unsupported") \
John Loa43ccae2018-02-13 17:15:23 -0500142_(INSTANCE_IN_USE, -147, "Instance in use") \
Paul Vinciguerra6a69b242019-06-17 23:07:13 -0400143_(INVALID_SESSION_ID, -148, "Session ID out of range") \
Andrew Yourtchenko94f9a6d2018-03-21 19:53:39 +0100144_(ACL_IN_USE_BY_LOOKUP_CONTEXT, -149, "ACL in use by a lookup context") \
Alexander Chernavine178b272018-09-24 05:42:01 -0400145_(INVALID_VALUE_3, -150, "Invalid value #3") \
146_(NON_ETHERNET, -151, "Interface is not an Ethernet interface") \
Neale Rannsaf3f0782019-03-26 08:21:25 +0000147_(BD_ALREADY_HAS_BVI, -152, "Bridge domain already has a BVI interface") \
148_(INVALID_PROTOCOL, -153, "Invalid Protocol") \
Neale Rannse8915fc2019-04-23 20:57:55 -0400149_(INVALID_ALGORITHM, -154, "Invalid Algorithm") \
Neale Rannse6be7022019-06-04 15:37:34 +0000150_(RSRC_IN_USE, -155, "Resource In Use") \
Neale Ranns097fa662018-05-01 05:17:55 -0700151_(KEY_LENGTH, -156, "invalid Key Length") \
Paul Vinciguerra888640a2019-05-14 21:01:28 -0400152_(FIB_PATH_UNSUPPORTED_NH_PROTO, -157, "Unsupported FIB Path protocol") \
Dave Barach2c41a612019-10-07 12:04:31 -0400153_(API_ENDIAN_FAILED, -159, "Endian mismatch detected") \
Nathan Skrzypczak45ec9f42019-11-06 14:47:40 +0100154_(NO_CHANGE, -160, "No change in table") \
Neale Rannscbe25aa2019-09-30 10:53:31 +0000155_(MISSING_CERT_KEY, -161, "Missing certifcate or key") \
Filip Tehlare5d34912020-03-02 15:17:37 +0000156_(LIMIT_EXCEEDED, -162, "limit exceeded") \
157_(IKE_NO_PORT, -163, "port not managed by IKE") \
158_(UDP_PORT_TAKEN, -164, "UDP port already taken") \
Ole Troanf5db3712020-05-20 15:47:06 +0200159_(EAGAIN, -165, "Retry stream call with cursor") \
Florin Corase6c3e8f2020-07-28 19:20:40 -0700160_(INVALID_VALUE_4, -166, "Invalid value #4") \
Dave Barach2c41a612019-10-07 12:04:31 -0400161
Dave Barachba868bb2016-08-08 09:51:21 -0400162typedef enum
163{
Ed Warnickecb9cada2015-12-08 15:45:58 -0700164#define _(a,b,c) VNET_API_ERROR_##a = (b),
Dave Barachba868bb2016-08-08 09:51:21 -0400165 foreach_vnet_api_error
Ed Warnickecb9cada2015-12-08 15:45:58 -0700166#undef _
167 VNET_API_N_ERROR,
168} vnet_api_error_t;
169
Klement Sekeraff92efe2017-11-30 07:00:31 +0100170/* *INDENT-OFF* */
171static inline u8 *
172format_vnet_api_errno (u8 * s, va_list * args)
173{
174 vnet_api_error_t api_error = va_arg (*args, vnet_api_error_t);
175#ifdef _
176#undef _
177#endif
178#define _(a, b, c) \
179 case b: \
180 s = format (s, "%s", c); \
181 break;
182 switch (api_error)
183 {
184 foreach_vnet_api_error
185 default:
186 s = format (s, "UNKNOWN");
187 break;
188 }
189 return s;
190#undef _
191}
192/* *INDENT-ON* */
193
Ed Warnickecb9cada2015-12-08 15:45:58 -0700194#endif /* included_vnet_api_errno_h */
Dave Barachba868bb2016-08-08 09:51:21 -0400195
196/*
197 * fd.io coding-style-patch-verification: ON
198 *
199 * Local Variables:
200 * eval: (c-set-style "gnu")
201 * End:
202 */