1 /* gpg-wks.h - Common definitions for wks server and client.
2 * Copyright (C) 2016 g10 Code GmbH
4 * This file is part of GnuPG.
6 * GnuPG is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
11 * GnuPG is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, see <https://www.gnu.org/licenses/>.
20 #ifndef GNUPG_GPG_WKS_H
21 #define GNUPG_GPG_WKS_H
23 #include "../common/util.h"
24 #include "../common/strlist.h"
25 #include "mime-maker.h"
27 /* We keep all global options in the structure OPT. */
35 const char *gpg_program;
36 const char *directory;
37 const char *default_from;
38 strlist_t extra_headers;
41 /* Debug values and macros. */
42 #define DBG_MIME_VALUE 1 /* Debug the MIME structure. */
43 #define DBG_PARSER_VALUE 2 /* Debug the Mail parser. */
44 #define DBG_CRYPTO_VALUE 4 /* Debug low level crypto. */
45 #define DBG_MEMORY_VALUE 32 /* Debug memory allocation stuff. */
46 #define DBG_MEMSTAT_VALUE 128 /* Show memory statistics. */
47 #define DBG_IPC_VALUE 1024 /* Debug assuan communication. */
48 #define DBG_EXTPROG_VALUE 16384 /* debug external program calls */
50 #define DBG_MIME (opt.debug & DBG_MIME_VALUE)
51 #define DBG_PARSER (opt.debug & DBG_PARSER_VALUE)
52 #define DBG_CRYPTO (opt.debug & DBG_CRYPTO_VALUE)
55 /* The parsed policy flags. */
58 unsigned int mailbox_only : 1;
59 unsigned int dane_only : 1;
60 unsigned int auth_submit : 1;
61 unsigned int max_pending; /* Seconds to wait for a confirmation. */
63 typedef struct policy_flags_s *policy_flags_t;
68 void wks_set_status_fd (int fd);
69 void wks_write_status (int no, const char *format, ...) GPGRT_ATTR_PRINTF(2,3);
70 gpg_error_t wks_list_key (estream_t key, char **r_fpr, strlist_t *r_mboxes);
71 gpg_error_t wks_send_mime (mime_maker_t mime);
72 gpg_error_t wks_parse_policy (policy_flags_t flags, estream_t stream,
75 /*-- wks-receive.c --*/
77 /* Flag values for the receive callback. */
78 #define WKS_RECEIVE_DRAFT2 1
80 gpg_error_t wks_receive (estream_t fp,
81 gpg_error_t (*result_cb)(void *opaque,
82 const char *mediatype,
89 #endif /*GNUPG_GPG_WKS_H*/