2
** Copyright (c) 2007 Sendmail, Inc. and its suppliers.
3
** All rights reserved.
5
** Copyright (c) 2009, The OpenDKIM Project. All rights reserved.
12
static char vbr_h_id[] = "@(#)$Id: vbr.h,v 1.1 2009/07/16 19:12:04 cm-msk Exp $";
17
#define VBR_INFOHEADER "VBR-Info"
18
#define VBR_PREFIX "_vouch"
21
#define VBR_MAXHEADER 1024
22
#define VBR_MAXHOSTNAMELEN 256
28
#define VBR_STAT_INVALID 1
29
#define VBR_STAT_DNSERROR 2
30
#define VBR_STAT_NORESOURCE 3
34
typedef struct vbr_handle VBR;
39
** VBR_INIT -- initialize a VBR handle
42
** caller_mallocf -- caller-provided memory allocation function
43
** caller_freef -- caller-provided memory release function
44
** closure -- memory closure to pass to the above when used
47
** A new VBR handle suitable for use with other VBR functions, or
51
** Strange radar returns at Indianapolis ARTCC.
54
extern VBR * vbr_init __P((void *(*caller_mallocf)(void *closure,
56
void (*caller_freef)(void *closure, void *p),
60
** VBR_CLOSE -- shut down a VBR instance
63
** vbr -- VBR handle to shut down
69
extern void vbr_close __P((VBR *));
72
** VBR_GETERROR -- return any stored error string from within the VBR
76
** vbr -- VBR handle from which to retrieve an error string
79
** A pointer to the stored string, or NULL if none was stored.
82
extern const char *vbr_geterror __P((VBR *));
85
** VBR_GETHEADER -- generate and store the VBR-Info header
88
** vbr -- VBR handle, created by vbr_init()
89
** hdr -- header buffer
90
** len -- number of bytes available at "hdr"
94
** STAT_NORESOURCE -- "hdr" was too short
97
extern VBR_STAT vbr_getheader __P((VBR *, char *, size_t));
100
** VBR_SETCERT -- store the VBR certifiers of this message
103
** vbr -- VBR handle, created by vbr_init()
104
** cert -- certifiers string
110
extern void vbr_setcert __P((VBR *, char *));
113
** VBR_SETTYPE -- store the VBR type of this message
116
** vbr -- VBR handle, created by vbr_init()
117
** type -- type string
123
extern void vbr_settype __P((VBR *, char *));
126
** VBR_SETDOMAIN -- declare the sender's domain
129
** vbr -- VBR handle, created by vbr_init()
130
** cert -- certifiers string
136
extern void vbr_setdomain __P((VBR *, char *));
139
** VBR_TRUSTEDCERTS -- set list of trusted certifiers
142
** vbr -- VBR handle, created by vbr_init()
143
** certs -- NULL terminted vector of trusted certifier names
149
extern void vbr_trustedcerts __P((VBR *, char **));
152
** VBR_QUERY -- query the vouching servers for results
155
** vbr -- VBR handle, created by vbr_init()
156
** res -- result string (one of "fail", "pass"); returned
157
** cert -- name of the certifier that returned a "pass"; returned
160
** VBR_STAT_OK -- able to determine a result
161
** VBR_STAT_INVALID -- vbr_trustedcerts(), vbr_settype() and
162
** vbr_setcert() were not all called
163
** VBR_STAT_CANTVRFY -- DNS issue prevented resolution
166
** - "pass" is the result if ANY certifier vouched for the message.
167
** - "res" is not modified if no result could be determined
168
** - "cert" and "domain" are not modified if a "pass" is not returned
169
** - there's no attempt to validate the values found
172
extern VBR_STAT vbr_query __P((VBR *, char **, char **));
176
** VBR_SETTIMEOUT -- set the DNS timeout
179
** vbr -- VBR handle, created by vbr_init()
180
** timeout -- requested timeout (seconds)
186
extern void vbr_settimeout __P((VBR *, u_int));
189
** VBR_SETCALLBACKINT -- set the DNS callback interval
192
** vbr -- VBR handle, created by vbr_init()
193
** cbint -- requested callback interval (seconds)
199
extern void vbr_setcallbackint __P((VBR *, u_int));
202
** VBR_SETCALLBACKCTX -- set the DNS callback context
205
** vbr -- VBR handle, created by vbr_init()
206
** ctx -- context to pass to the DNS callback
212
extern void vbr_setcallbackctx __P((VBR *, void *));
215
** VBR_SETDNSCALLBACK -- set the DNS wait callback
218
** vbr -- VBR handle, created by vbr_init()
219
** func -- function to call; should take an opaque context pointer
225
extern VBR_STAT vbr_setdnscallback __P((VBR *vbr,
226
void (*func)(const void *context)));
228
#endif /* USE_ARLIB */