Julian Hall | 6c59e4e | 2020-11-23 17:50:47 +0100 | [diff] [blame] | 1 | /* |
Imre Kis | 33c18be | 2023-06-21 18:47:36 +0200 | [diff] [blame^] | 2 | * Copyright (c) 2020-2023, Arm Limited and Contributors. All rights reserved. |
Julian Hall | 6c59e4e | 2020-11-23 17:50:47 +0100 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
| 7 | #ifndef RPC_STATUS_H |
| 8 | #define RPC_STATUS_H |
| 9 | |
| 10 | #include <stdint.h> |
| 11 | |
| 12 | #ifdef __cplusplus |
| 13 | extern "C" { |
| 14 | #endif |
| 15 | |
Imre Kis | 33c18be | 2023-06-21 18:47:36 +0200 | [diff] [blame^] | 16 | /** |
| 17 | * Used for returning the status of an RPC transaction. These values indicating the result of the |
| 18 | * RPC layer operations. Service level result must be handled in a service specific way. |
Julian Hall | 6c59e4e | 2020-11-23 17:50:47 +0100 | [diff] [blame] | 19 | */ |
Imre Kis | 33c18be | 2023-06-21 18:47:36 +0200 | [diff] [blame^] | 20 | |
Julian Hall | 6c59e4e | 2020-11-23 17:50:47 +0100 | [diff] [blame] | 21 | typedef int32_t rpc_status_t; |
| 22 | |
Imre Kis | 33c18be | 2023-06-21 18:47:36 +0200 | [diff] [blame^] | 23 | #define RPC_SUCCESS (0) |
| 24 | #define RPC_ERROR_INTERNAL (-1) |
| 25 | #define RPC_ERROR_INVALID_VALUE (-2) |
| 26 | #define RPC_ERROR_NOT_FOUND (-3) |
| 27 | #define RPC_ERROR_INVALID_STATE (-4) |
| 28 | #define RPC_ERROR_TRANSPORT_LAYER (-5) |
| 29 | #define RPC_ERROR_INVALID_REQUEST_BODY (-6) |
| 30 | #define RPC_ERROR_INVALID_RESPONSE_BODY (-7) |
| 31 | #define RPC_ERROR_RESOURCE_FAILURE (-8) |
| 32 | |
| 33 | typedef int64_t service_status_t; |
Julian Hall | d1dfda5 | 2021-11-25 18:46:45 +0100 | [diff] [blame] | 34 | |
Julian Hall | 6c59e4e | 2020-11-23 17:50:47 +0100 | [diff] [blame] | 35 | #ifdef __cplusplus |
| 36 | } |
| 37 | #endif |
| 38 | |
| 39 | #endif /* RPC_STATUS_H */ |