Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 1 | /* |
| 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 Sekera | ff92efe | 2017-11-30 07:00:31 +0100 | [diff] [blame] | 18 | #include <stdarg.h> |
| 19 | #include <vppinfra/types.h> |
| 20 | #include <vppinfra/format.h> |
| 21 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 22 | #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 Barach | 2feaffc | 2017-01-14 10:30:50 -0500 | [diff] [blame] | 42 | _(SYSCALL_ERROR_10, -20, "System call error #10") \ |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 43 | _(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") \ |
| 47 | _(PREFIX_MATCHES_NEXT_HOP, -52, "Prefix matches next hop") \ |
| 48 | _(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 Sloboda | 5bb1eca | 2018-10-22 09:57:13 +0200 | [diff] [blame] | 56 | _(ADDRESS_NOT_DELETABLE, -61, "Address not deletable") \ |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 57 | _(IP6_NOT_ENABLED, -62, "ip6 not enabled") \ |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 58 | _(IN_PROGRESS, 10, "Operation in progress") \ |
| 59 | _(NO_SUCH_NODE, -63, "No such graph node") \ |
| 60 | _(NO_SUCH_NODE2, -64, "No such graph node #2") \ |
| 61 | _(NO_SUCH_TABLE, -65, "No such table") \ |
| 62 | _(NO_SUCH_TABLE2, -66, "No such table #2") \ |
| 63 | _(NO_SUCH_TABLE3, -67, "No such table #3") \ |
| 64 | _(SUBIF_ALREADY_EXISTS, -68, "Subinterface already exists") \ |
| 65 | _(SUBIF_CREATE_FAILED, -69, "Subinterface creation failed") \ |
| 66 | _(INVALID_MEMORY_SIZE, -70, "Invalid memory size requested") \ |
| 67 | _(INVALID_INTERFACE, -71, "Invalid interface") \ |
| 68 | _(INVALID_VLAN_TAG_COUNT, -72, "Invalid number of tags for requested operation") \ |
| 69 | _(INVALID_ARGUMENT, -73, "Invalid argument") \ |
| 70 | _(UNEXPECTED_INTF_STATE, -74, "Unexpected interface state") \ |
| 71 | _(TUNNEL_EXIST, -75, "Tunnel already exists") \ |
| 72 | _(INVALID_DECAP_NEXT, -76, "Invalid decap-next") \ |
| 73 | _(RESPONSE_NOT_READY, -77, "Response not ready") \ |
Damjan Marion | 83243a0 | 2016-02-29 13:09:30 +0100 | [diff] [blame] | 74 | _(NOT_CONNECTED, -78, "Not connected to the data plane") \ |
John Lo | bcebbb9 | 2016-04-05 15:47:43 -0400 | [diff] [blame] | 75 | _(IF_ALREADY_EXISTS, -79, "Interface already exists") \ |
Andrej Kozemcak | b92feb6 | 2016-03-31 13:51:42 +0200 | [diff] [blame] | 76 | _(BOND_SLAVE_NOT_ALLOWED, -80, "Operation not allowed on slave of BondEthernet") \ |
Chris Luke | 99cb335 | 2016-04-26 10:49:53 -0400 | [diff] [blame] | 77 | _(VALUE_EXIST, -81, "Value already exists") \ |
Keith Burns (alagalah) | 52fc44d | 2016-03-25 09:38:50 -0700 | [diff] [blame] | 78 | _(SAME_SRC_DST, -82, "Source and destination are the same") \ |
| 79 | _(IP6_MULTICAST_ADDRESS_NOT_PRESENT, -83, "IP6 multicast address required") \ |
Marek Gradzki | d85036f | 2016-04-26 12:09:05 +0200 | [diff] [blame] | 80 | _(SR_POLICY_NAME_NOT_PRESENT, -84, "Segement routing policy name required") \ |
| 81 | _(NOT_RUNNING_AS_ROOT, -85, "Not running as root") \ |
| 82 | _(ALREADY_CONNECTED, -86, "Connection to the data plane already exists") \ |
| 83 | _(UNSUPPORTED_JNI_VERSION, -87, "Unsupported JNI version") \ |
Damjan Marion | 0247b46 | 2016-06-08 01:37:11 +0200 | [diff] [blame] | 84 | _(FAILED_TO_ATTACH_TO_JAVA_THREAD, -88, "Failed to attach to Java thread") \ |
Andrej Kozemcak | 8ebb2a1 | 2016-06-07 12:25:20 +0200 | [diff] [blame] | 85 | _(INVALID_WORKER, -89, "Invalid worker thread") \ |
Pavel Kotucek | 20c90f7 | 2016-06-07 14:44:26 +0200 | [diff] [blame] | 86 | _(LISP_DISABLED, -90, "LISP is disabled") \ |
Filip Tehlar | 006eb26 | 2016-06-27 13:09:20 +0200 | [diff] [blame] | 87 | _(CLASSIFY_TABLE_NOT_FOUND, -91, "Classify table not found") \ |
Pavel Kotucek | 9e6ed6e | 2016-07-12 10:18:26 +0200 | [diff] [blame] | 88 | _(INVALID_EID_TYPE, -92, "Unsupported LSIP EID type") \ |
Dave Barach | 6f9bca2 | 2016-04-30 10:25:32 -0400 | [diff] [blame] | 89 | _(CANNOT_CREATE_PCAP_FILE, -93, "Cannot create pcap file") \ |
| 90 | _(INCORRECT_ADJACENCY_TYPE, -94, "Invalid adjacency type for this operation") \ |
| 91 | _(EXCEEDED_NUMBER_OF_RANGES_CAPACITY, -95, "Operation would exceed configured capacity of ranges") \ |
Pierre Pfister | 041eacc | 2016-08-04 16:13:09 +0100 | [diff] [blame] | 92 | _(EXCEEDED_NUMBER_OF_PORTS_CAPACITY, -96, "Operation would exceed capacity of number of ports") \ |
Pavel Kotucek | d85590a | 2016-08-26 13:35:40 +0200 | [diff] [blame] | 93 | _(INVALID_ADDRESS_FAMILY, -97, "Invalid address family") \ |
Filip Tehlar | 69a9b76 | 2016-09-23 10:00:52 +0200 | [diff] [blame] | 94 | _(INVALID_SUB_SW_IF_INDEX, -98, "Invalid sub-interface sw_if_index") \ |
Pavel Kotucek | 7490a75 | 2016-11-15 09:19:11 +0100 | [diff] [blame] | 95 | _(TABLE_TOO_BIG, -99, "Table too big") \ |
Klement Sekera | 0e3c0de | 2016-09-29 14:43:44 +0200 | [diff] [blame] | 96 | _(CANNOT_ENABLE_DISABLE_FEATURE, -100, "Cannot enable/disable feature") \ |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 97 | _(BFD_EEXIST, -101, "Duplicate BFD object") \ |
| 98 | _(BFD_ENOENT, -102, "No such BFD object") \ |
| 99 | _(BFD_EINUSE, -103, "BFD object in use") \ |
| 100 | _(BFD_NOTSUPP, -104, "BFD feature not supported") \ |
| 101 | _(ADDRESS_IN_USE, -105, "Address in use") \ |
| 102 | _(ADDRESS_NOT_IN_USE, -106, "Address not in use") \ |
| 103 | _(QUEUE_FULL, -107, "Queue full") \ |
Florin Coras | b384b54 | 2018-01-15 01:08:33 -0800 | [diff] [blame] | 104 | _(APP_UNSUPPORTED_CFG, -108, "Unsupported application config") \ |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 105 | _(URI_FIFO_CREATE_FAILED, -109, "URI FIFO segment create failed") \ |
| 106 | _(LISP_RLOC_LOCAL, -110, "RLOC address is local") \ |
| 107 | _(BFD_EAGAIN, -111, "BFD object cannot be manipulated at this time") \ |
| 108 | _(INVALID_GPE_MODE, -112, "Invalid GPE mode") \ |
Neale Ranns | 4008ac9 | 2017-02-13 23:20:04 -0800 | [diff] [blame] | 109 | _(LISP_GPE_ENTRIES_PRESENT, -113, "LISP GPE entries are present") \ |
Florin Coras | e04c299 | 2017-03-01 08:17:34 -0800 | [diff] [blame] | 110 | _(ADDRESS_FOUND_FOR_INTERFACE, -114, "Address found for interface") \ |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 111 | _(SESSION_CONNECT, -115, "Session failed to connect") \ |
Florin Coras | 6cf30ad | 2017-04-04 23:08:23 -0700 | [diff] [blame] | 112 | _(ENTRY_ALREADY_EXISTS, -116, "Entry already exists") \ |
| 113 | _(SVM_SEGMENT_CREATE_FAIL, -117, "svm segment create fail") \ |
Eyal Bari | b1352ed | 2017-04-07 23:14:17 +0300 | [diff] [blame] | 114 | _(APPLICATION_NOT_ATTACHED, -118, "application not attached") \ |
| 115 | _(BD_ALREADY_EXISTS, -119, "Bridge domain already exists") \ |
Damjan Marion | 4403690 | 2017-04-28 12:29:15 +0200 | [diff] [blame] | 116 | _(BD_IN_USE, -120, "Bridge domain has member interfaces") \ |
John Lo | 9793477 | 2017-05-18 22:26:47 -0400 | [diff] [blame] | 117 | _(BD_NOT_MODIFIABLE, -121, "Bridge domain 0 can't be deleted/modified") \ |
| 118 | _(BD_ID_EXCEED_MAX, -122, "Bridge domain ID exceed 16M limit") \ |
John Lo | 8d00fff | 2017-08-03 00:35:36 -0400 | [diff] [blame] | 119 | _(SUBIF_DOESNT_EXIST, -123, "Subinterface doesn't exist") \ |
| 120 | _(L2_MACS_EVENT_CLINET_PRESENT, -124, "Client already exist for L2 MACs events") \ |
Steven | bd8a611 | 2017-07-30 10:29:26 -0700 | [diff] [blame] | 121 | _(INVALID_QUEUE, -125, "Invalid queue") \ |
Jon Loeliger | 35ffa3e | 2017-09-28 13:54:16 -0500 | [diff] [blame] | 122 | _(UNSUPPORTED, -126, "Unsupported") \ |
Florin Coras | cea194d | 2017-10-02 00:18:51 -0700 | [diff] [blame] | 123 | _(DUPLICATE_IF_ADDRESS, -127, "Address already present on another interface") \ |
| 124 | _(APP_INVALID_NS, -128, "Invalid application namespace") \ |
| 125 | _(APP_WRONG_NS_SECRET, -129, "Wrong app namespace secret") \ |
| 126 | _(APP_CONNECT_SCOPE, -130, "Connect scope") \ |
| 127 | _(APP_ALREADY_ATTACHED, -131, "App already attached") \ |
| 128 | _(SESSION_REDIRECT, -132, "Redirect failed") \ |
Dave Barach | 6545716 | 2017-10-10 17:53:14 -0400 | [diff] [blame] | 129 | _(ILLEGAL_NAME, -133, "Illegal name") \ |
| 130 | _(NO_NAME_SERVERS, -134, "No name servers configured") \ |
| 131 | _(NAME_SERVER_NOT_FOUND, -135, "Name server not found") \ |
| 132 | _(NAME_RESOLUTION_NOT_ENABLED, -136, "Name resolution not enabled") \ |
| 133 | _(NAME_SERVER_FORMAT_ERROR, -137, "Server format error (bug!)") \ |
| 134 | _(NAME_SERVER_NO_SUCH_NAME, -138, "No such name") \ |
| 135 | _(NAME_SERVER_NO_ADDRESSES, -139, "No addresses available") \ |
Florin Coras | a2ff7b8 | 2017-11-08 17:55:03 -0800 | [diff] [blame] | 136 | _(NAME_SERVER_NEXT_SERVER, -140, "Retry with new server") \ |
Jon Loeliger | 27cadd2 | 2017-11-10 13:15:12 -0600 | [diff] [blame] | 137 | _(APP_CONNECT_FILTERED, -141, "Connect was filtered") \ |
| 138 | _(ACL_IN_USE_INBOUND, -142, "Inbound ACL in use") \ |
Damjan Marion | 91c6ef7 | 2017-12-01 13:34:24 +0100 | [diff] [blame] | 139 | _(ACL_IN_USE_OUTBOUND, -143, "Outbound ACL in use") \ |
| 140 | _(INIT_FAILED, -144, "Initialization Failed") \ |
Neale Ranns | f051072 | 2018-01-31 11:35:41 -0800 | [diff] [blame] | 141 | _(NETLINK_ERROR, -145, "netlink error") \ |
Jon Loeliger | 3d460bd | 2018-02-01 16:36:12 -0600 | [diff] [blame] | 142 | _(BIER_BSL_UNSUP, -146, "BIER bit-string-length unsupported") \ |
John Lo | a43ccae | 2018-02-13 17:15:23 -0500 | [diff] [blame] | 143 | _(INSTANCE_IN_USE, -147, "Instance in use") \ |
Andrew Yourtchenko | 94f9a6d | 2018-03-21 19:53:39 +0100 | [diff] [blame] | 144 | _(INVALID_SESSION_ID, -148, "session ID out of range") \ |
| 145 | _(ACL_IN_USE_BY_LOOKUP_CONTEXT, -149, "ACL in use by a lookup context") \ |
Alexander Chernavin | e178b27 | 2018-09-24 05:42:01 -0400 | [diff] [blame] | 146 | _(INVALID_VALUE_3, -150, "Invalid value #3") \ |
| 147 | _(NON_ETHERNET, -151, "Interface is not an Ethernet interface") \ |
| 148 | _(BD_ALREADY_HAS_BVI, -152, "Bridge domain already has a BVI interface") |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 149 | |
Dave Barach | ba868bb | 2016-08-08 09:51:21 -0400 | [diff] [blame] | 150 | typedef enum |
| 151 | { |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 152 | #define _(a,b,c) VNET_API_ERROR_##a = (b), |
Dave Barach | ba868bb | 2016-08-08 09:51:21 -0400 | [diff] [blame] | 153 | foreach_vnet_api_error |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 154 | #undef _ |
| 155 | VNET_API_N_ERROR, |
| 156 | } vnet_api_error_t; |
| 157 | |
Klement Sekera | ff92efe | 2017-11-30 07:00:31 +0100 | [diff] [blame] | 158 | /* *INDENT-OFF* */ |
| 159 | static inline u8 * |
| 160 | format_vnet_api_errno (u8 * s, va_list * args) |
| 161 | { |
| 162 | vnet_api_error_t api_error = va_arg (*args, vnet_api_error_t); |
| 163 | #ifdef _ |
| 164 | #undef _ |
| 165 | #endif |
| 166 | #define _(a, b, c) \ |
| 167 | case b: \ |
| 168 | s = format (s, "%s", c); \ |
| 169 | break; |
| 170 | switch (api_error) |
| 171 | { |
| 172 | foreach_vnet_api_error |
| 173 | default: |
| 174 | s = format (s, "UNKNOWN"); |
| 175 | break; |
| 176 | } |
| 177 | return s; |
| 178 | #undef _ |
| 179 | } |
| 180 | /* *INDENT-ON* */ |
| 181 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 182 | #endif /* included_vnet_api_errno_h */ |
Dave Barach | ba868bb | 2016-08-08 09:51:21 -0400 | [diff] [blame] | 183 | |
| 184 | /* |
| 185 | * fd.io coding-style-patch-verification: ON |
| 186 | * |
| 187 | * Local Variables: |
| 188 | * eval: (c-set-style "gnu") |
| 189 | * End: |
| 190 | */ |