2 * Copyright (c) 2005 Massachusetts Institute of Technology
4 * Permission is hereby granted, free of charge, to any person
5 * obtaining a copy of this software and associated documentation
6 * files (the "Software"), to deal in the Software without
7 * restriction, including without limitation the rights to use, copy,
8 * modify, merge, publish, distribute, sublicense, and/or sell copies
9 * of the Software, and to permit persons to whom the Software is
10 * furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice shall be
13 * included in all copies or substantial portions of the Software.
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
19 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28 #ifndef __KHIMAIRA_KHERROR_H
29 #define __KHIMAIRA_KHERROR_H
31 /*! \defgroup kherror NetIDMgr errors
34 /*! \brief Base for error codes
36 NetIDMgr errors range from \a KHM_ERROR_BASE to KHM_ERROR_BASE +
37 KHM_ERROR_RANGE, with the exception of KHM_ERROR_SUCCESS and
40 #define KHM_ERROR_BASE 0x40000000L
42 /*! \brief Range for error codes
44 NetIDMgr errors range from \a KHM_ERROR_BASE to
45 KHM_ERROR_BASE + KHM_ERROR_RANGE.
47 #define KHM_ERROR_RANGE 256L
49 /*! \defgroup kherror_codes Error codes
52 /*! \brief No error */
53 #define KHM_ERROR_NONE 0x00000000L
55 /*! \brief Success. Same as \a KHM_ERROR_NONE */
56 #define KHM_ERROR_SUCCESS KHM_ERROR_NONE
58 /*! \brief The supplied name was invalid */
59 #define KHM_ERROR_INVALID_NAME (KHM_ERROR_BASE + 1)
61 /*! \brief Too much data
63 A supplied buffer was invalid, was of insufficient size, or a
64 buffer was of a larger size than expected
66 #define KHM_ERROR_TOO_LONG (KHM_ERROR_BASE + 2)
68 /*! \brief One or more parameters supplied to a function were invalid */
69 #define KHM_ERROR_INVALID_PARAM (KHM_ERROR_BASE + 3)
71 /*! \brief A duplicate.
73 Usually means that something that should have been unique was
76 #define KHM_ERROR_DUPLICATE (KHM_ERROR_BASE + 4)
78 /*! \brief An object was not found
80 An object referenced in a parameter was not found.
82 #define KHM_ERROR_NOT_FOUND (KHM_ERROR_BASE + 5)
84 /*! \brief The relevant subsystem is not ready
86 Indicates that initialization has not been completed for a
89 #define KHM_ERROR_NOT_READY (KHM_ERROR_BASE + 6)
91 /*! \brief No more resources
93 A limited resource has been exhausted.
95 #define KHM_ERROR_NO_RESOURCES (KHM_ERROR_BASE + 7)
97 /*! \brief Type mismatch
99 #define KHM_ERROR_TYPE_MISMATCH (KHM_ERROR_BASE + 8)
101 /*! \brief Already exists
103 Usually indicates that an exclusive create operation failed due to
104 the existence of a similar object. Subtly different from
105 ::KHM_ERROR_DUPLICATE
107 #define KHM_ERROR_EXISTS (KHM_ERROR_BASE + 9)
109 /*! \brief Operation timed out
111 #define KHM_ERROR_TIMEOUT (KHM_ERROR_BASE + 10)
113 /*! \brief An EXIT message was received
115 #define KHM_ERROR_EXIT (KHM_ERROR_BASE + 11)
117 /*! \brief Unknown or unspecified error
119 #define KHM_ERROR_UNKNOWN (KHM_ERROR_BASE + 12)
121 /*! \brief General error
123 #define KHM_ERROR_GENERAL KHM_ERROR_UNKNOWN
125 /*! \brief An index was out of bounds
127 #define KHM_ERROR_OUT_OF_BOUNDS (KHM_ERROR_BASE + 13)
129 /*! \brief Object already deleted
131 One or more objects that were referenced were found to have been
134 #define KHM_ERROR_DELETED (KHM_ERROR_BASE + 14)
136 /*! \brief Invalid operation
138 The operation was not permitted to continue for some reason.
139 Usually because the necessary conditions for the operation haven't
140 been met yet or the operation can only be performed at certain
141 times during the execution of NetIDMgr.
143 #define KHM_ERROR_INVALID_OPERATION (KHM_ERROR_BASE + 15)
145 /*! \brief Signature check failed
147 #define KHM_ERROR_INVALID_SIGNATURE (KHM_ERROR_BASE + 16)
149 /*! \brief Not implemented yet
151 The operation that was attempted involved invoking functionality
152 that has not been implemented yet.
154 #define KHM_ERROR_NOT_IMPLEMENTED (KHM_ERROR_BASE + 17)
156 /*! \brief The objects were equivalent
158 #define KHM_ERROR_EQUIVALENT (KHM_ERROR_BASE + 18)
160 /*! \brief No provider exists to service the request
162 #define KHM_ERROR_NO_PROVIDER (KHM_ERROR_BASE + 19)
164 /*! \brief The operation succeeded, but with errors
166 #define KHM_ERROR_PARTIAL (KHM_ERROR_BASE + 20)
168 /*! \brief An incompatibility was found */
169 #define KHM_ERROR_INCOMPATIBLE (KHM_ERROR_BASE + 21)
171 /*@}*/ /*kherror_codes*/
173 /*! \brief Tests whether a return value indicates success */
174 #define KHM_SUCCEEDED(rv) ((rv)==KHM_ERROR_NONE)
176 /*! \brief Tests whether a return value indicates failure */
177 #define KHM_FAILED(rv) ((rv)!=KHM_ERROR_NONE)