2 Copyright (C) 2006-2016 Ben Kibbey <bjk@luxsci.net>
4 This file is part of libpwmd.
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
11 This library 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 GNU
14 Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with this library; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
45 #define N_(msgid) dgettext("libpwmd", msgid)
47 #define N_(msgid) (msgid)
50 #define N_ARRAY(a) (sizeof(a)/sizeof(a[0]))
54 PWMD_IPV6
, PWMD_IPV4
, PWMD_IP_ANY
57 #if defined(WITH_SSH) || defined(WITH_GNUTLS)
64 struct addrinfo
*addrs
;
65 struct addrinfo
*addr
;
66 pthread_cond_t dns_cond
;
67 pthread_mutex_t dns_mutex
;
77 #define OPT_LOCK_ON_OPEN 0x0001
78 #define OPT_SIGPIPE 0x0002
83 #if defined(WITH_SSH) || defined(WITH_GNUTLS)
89 /* Options set with pwmd_setopt(). */
90 pwmd_ip_version_t prot
;
91 pwmd_knownhost_cb_t kh_cb
;
103 pid_t pinentry_pid
; // for local pinentry timeouts
104 assuan_context_t pctx
;
109 char *pinentry_display
;
110 char *pinentry_lcctype
;
111 char *pinentry_lcmessages
;
112 char *pinentry_error
;
113 char *pinentry_prompt
;
115 int pinentry_tries
; // local pinentry
116 int pinentry_try
; // local pinentry
117 char *passphrase_hint
;
118 char *passphrase_info
;
120 int pinentry_timeout
;
121 int current_pinentry_timeout
;
122 int disable_pinentry
;
124 int pinentry_disabled
; // for sending the disable command
125 pwmd_status_cb_t status_func
;
127 pwmd_inquire_cb_t inquire_func
;
129 size_t inquire_total
;
131 size_t inquire_maxlen
;
133 gpg_error_t (*_inquire_func
) (void *, const char *);
138 int override_inquire
;
140 unsigned version
; // of pwmd
143 gpg_error_t
_assuan_command (pwm_t
* pwm
, assuan_context_t ctx
,
144 char **result
, size_t * len
, const char *cmd
);
145 gpg_error_t
_connect_finalize (pwm_t
* pwm
);
146 #if defined(WITH_SSH) || defined(WITH_GNUTLS)
147 void free_tcp (pwm_t
*);
148 gpg_error_t
tcp_connect_common (pwm_t
* pwm
);