chiark / gitweb /
Replace use of variable-length-arrays.
[gnupg2.git] / common / keyserver.h
1 /* keyserver.h - Public definitions for gpg keyserver helpers.
2  * Copyright (C) 2001, 2002, 2011 Free Software Foundation, Inc.
3  *
4  * This file is part of GnuPG.
5  *
6  * This file is free software; you can redistribute it and/or modify
7  * it under the terms of either
8  *
9  *   - the GNU Lesser General Public License as published by the Free
10  *     Software Foundation; either version 3 of the License, or (at
11  *     your option) any later version.
12  *
13  * or
14  *
15  *   - the GNU General Public License as published by the Free
16  *     Software Foundation; either version 2 of the License, or (at
17  *     your option) any later version.
18  *
19  * or both in parallel, as here.
20  *
21  * This file is distributed in the hope that it will be useful,
22  * but WITHOUT ANY WARRANTY; without even the implied warranty of
23  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
24  * GNU General Public License for more details.
25  *
26  * You should have received a copy of the GNU General Public License
27  * along with this program; if not, see <https://www.gnu.org/licenses/>.
28  */
29
30 #ifndef GNUPG_COMMON_KEYSERVER_H
31 #define GNUPG_COMMON_KEYSERVER_H
32
33 #define KEYSERVER_PROTO_VERSION    1
34
35 /* These are usable for return codes for the gpgkeys_ process, and
36    also KEY FAILED codes. */
37 #define KEYSERVER_OK               0 /* not an error */
38 #define KEYSERVER_INTERNAL_ERROR   1 /* gpgkeys_ internal error */
39 #define KEYSERVER_NOT_SUPPORTED    2 /* operation not supported */
40 #define KEYSERVER_VERSION_ERROR    3 /* VERSION mismatch */
41 #define KEYSERVER_GENERAL_ERROR    4 /* keyserver internal error */
42 #define KEYSERVER_NO_MEMORY        5 /* out of memory */
43 #define KEYSERVER_KEY_NOT_FOUND    6 /* key not found */
44 #define KEYSERVER_KEY_EXISTS       7 /* key already exists */
45 #define KEYSERVER_KEY_INCOMPLETE   8 /* key incomplete (EOF) */
46 #define KEYSERVER_UNREACHABLE      9 /* unable to contact keyserver */
47
48 /* Must be 127 due to shell internal magic. */
49 #define KEYSERVER_SCHEME_NOT_FOUND 127
50
51 /* Object to hold information pertaining to a keyserver; it also
52    allows building a list of keyservers.  Note that g10/options.h has
53    a typedef for this.  FIXME: We should make use of the
54    parse_uri_t. */
55 struct keyserver_spec
56 {
57   struct keyserver_spec *next;
58   char *uri;
59   char *scheme;
60   char *auth;
61   char *host;
62   char *port;
63   char *path;
64   char *opaque;
65   strlist_t options;
66   struct
67   {
68     unsigned int direct_uri:1;
69   } flags;
70 };
71
72
73 #endif /*GNUPG_COMMON_KEYSERVER_H*/