2 * Copyright (c) 2020, The OpenThread Authors.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * 3. Neither the name of the copyright holder nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 * POSSIBILITY OF SUCH DAMAGE.
31 * This file includes definitions for d-bus client errors.
34 #ifndef OTBR_DBUS_COMMON_ERROR_HPP_
35 #define OTBR_DBUS_COMMON_ERROR_HPP_
39 #include <dbus/dbus.h>
44 * @namespace otbr::DBus
46 * @brief This namespace contains OpenThread Border Router DBus API.
51 enum class ClientError
53 ERROR_NONE = 0, ///< No error.
55 ERROR_ERRNO = -1, ///< Error defined by errno.
56 ERROR_DBUS = -3, ///< DBus error.
64 * Message was dropped.
69 * Insufficient buffers.
76 OT_ERROR_NO_ROUTE = 4,
79 * Service is busy and could not service the operation.
84 * Failed to parse message or arguments.
89 * Input arguments are invalid.
91 OT_ERROR_INVALID_ARGS = 7,
94 * Security checks failed.
96 OT_ERROR_SECURITY = 8,
99 * Address resolution requires an address query operation.
101 OT_ERROR_ADDRESS_QUERY = 9,
104 * Address is not in the source match table.
106 OT_ERROR_NO_ADDRESS = 10,
109 * Operation was aborted.
114 * Function or method is not implemented.
116 OT_ERROR_NOT_IMPLEMENTED = 12,
119 * Cannot complete due to invalid state.
121 OT_ERROR_INVALID_STATE = 13,
124 * No acknowledgment was received after macMaxFrameRetries (IEEE 802.15.4-2006).
126 OT_ERROR_NO_ACK = 14,
129 * A transmission could not take place due to activity on the channel, i.e., the CSMA-CA mechanism has failed
130 * (IEEE 802.15.4-2006).
132 OT_ERROR_CHANNEL_ACCESS_FAILURE = 15,
135 * Not currently attached to a Thread Partition.
137 OT_ERROR_DETACHED = 16,
140 * FCS check failure while receiving.
147 OT_ERROR_NO_FRAME_RECEIVED = 18,
150 * Received a frame from an unknown neighbor.
152 OT_ERROR_UNKNOWN_NEIGHBOR = 19,
155 * Received a frame from an invalid source address.
157 OT_ERROR_INVALID_SOURCE_ADDRESS = 20,
160 * Received a frame filtered by the address filter (allowlisted or denylisted).
162 OT_ERROR_ADDRESS_FILTERED = 21,
165 * Received a frame filtered by the destination address check.
167 OT_ERROR_DESTINATION_ADDRESS_FILTERED = 22,
170 * The requested item could not be found.
172 OT_ERROR_NOT_FOUND = 23,
175 * The operation is already in progress.
177 OT_ERROR_ALREADY = 24,
180 * The creation of IPv6 address failed.
182 OT_ERROR_IP6_ADDRESS_CREATION_FAILURE = 26,
185 * Operation prevented by mode flags
187 OT_ERROR_NOT_CAPABLE = 27,
190 * Coap response or acknowledgment or DNS, SNTP response not received.
192 OT_ERROR_RESPONSE_TIMEOUT = 28,
195 * Received a duplicated frame.
197 OT_ERROR_DUPLICATED = 29,
200 * Message is being dropped from reassembly list due to timeout.
202 OT_ERROR_REASSEMBLY_TIMEOUT = 30,
205 * Message is not a TMF Message.
207 OT_ERROR_NOT_TMF = 31,
210 * Received a non-lowpan data frame.
212 OT_ERROR_NOT_LOWPAN_DATA_FRAME = 32,
215 * The link margin was too low.
217 OT_ERROR_LINK_MARGIN_LOW = 34,
220 * Generic error (should not use).
222 OT_ERROR_GENERIC = 255,
225 bool operator==(ClientError aError, int aValue);
226 bool operator!=(ClientError aError, int aValue);
231 #endif // OTBR_DBUS_COMMON_ERROR_HPP_