-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy patherrors.h
48 lines (41 loc) · 1.2 KB
/
errors.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
* Copyright 2021 The HIBA Authors
*
* Use of this source code is governed by a BSD-style
* license that can be found in the LICENSE file or at
* https://developers.google.com/open-source/licenses/bsd
*/
#ifndef _ERRORS_H
#define _ERRORS_H
#define TO_HIBA_CODE(a) ((a) << 16)
#define HIBA_OK 0
/* Generic error codes. */
#define HIBA_INVALID_EXT -1
#define HIBA_BAD_VERSION -2
#define HIBA_BAD_PARAMS -3
#define HIBA_EXT_TOOBIG -4
#define HIBA_EXT_NOKEY -5
#define HIBA_UNKNOWN_EXT -6
#define HIBA_INTERNAL_ERROR -7
#define HIBA_INVALID_GRL -8
/* Extensions sanity checks diagnostics. */
#define HIBA_EXT_NODOMAIN -20
#define HIBA_GRANT_BADVALIDITY -21
#define HIBA_PAIRS_TOOMANY -22
#define HIBA_PAIR_EXISTS -23
#define HIBA_UNEXPECTED_KEY -24
#define HIBA_GRANT_BADOPTIONS -25
#define HIBA_ONE_IDENTITY_ONLY -26
/* Check results. */
#define HIBA_CHECK_NOKEY -40
#define HIBA_CHECK_BADVERSION -41
#define HIBA_CHECK_EXPIRED -42
#define HIBA_CHECK_REVOKED -43
#define HIBA_CHECK_NOGRL -44
#define HIBA_CHECK_BADHOSTNAME -45
#define HIBA_CHECK_BADROLE -46
#define HIBA_CHECK_NOGRANTS -47
#define HIBA_CHECK_DENIED -48
/* Return human readable error messages. */
const char *hiba_err(int err);
#endif /* _ERRORS_H */