~ubuntu-branches/ubuntu/lucid/opendkim/lucid-backports

« back to all changes in this revision

Viewing changes to libopendkim/vbr.h

  • Committer: Bazaar Package Importer
  • Author(s): Mike Markley
  • Date: 2010-03-17 13:04:28 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20100317130428-i5klbz2debsy0aku
Tags: 2.0.0+dfsg-1
* New upstream version.
* The libopendkim ABI has changed, resulting in an soname change.
  - libopendkim0 package renamed to libopendkim1.
* New LDAP and Lua support have been enabled.
* Wrote clearer package descriptions. Closes: #572725
* Added build-dependency on autotools-dev. For now, the package ships with
  very old config.sub and config.guess files, but this will be resolved
  upstream in the near future.
  - Also removed extraneous top-level config.{sub,guess} files.
* Applied two upstream patches for off-by-one errors, including one that can
  cause crashes when signing.
* debian/copyright file was not accurate; it has been updated to reflect the
  fork from the dkim-milter project. The dkim-milter license should be fully
  compatible with the BSD license of this fork.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
**  Copyright (c) 2007 Sendmail, Inc. and its suppliers.
3
 
**    All rights reserved.
4
 
**
5
 
**  Copyright (c) 2009, The OpenDKIM Project.  All rights reserved.
6
 
*/
7
 
 
8
 
#ifndef _VBR_H_
9
 
#define _VBR_H_
10
 
 
11
 
#ifndef lint
12
 
static char vbr_h_id[] = "@(#)$Id: vbr.h,v 1.1 2009/07/16 19:12:04 cm-msk Exp $";
13
 
#endif /* !lint */
14
 
 
15
 
/* strings */
16
 
#define VBR_ALL                 "all"
17
 
#define VBR_INFOHEADER          "VBR-Info"
18
 
#define VBR_PREFIX              "_vouch"
19
 
 
20
 
/* definitions */
21
 
#define VBR_MAXHEADER           1024
22
 
#define VBR_MAXHOSTNAMELEN      256
23
 
 
24
 
/* return codes */
25
 
typedef int VBR_STAT;
26
 
 
27
 
#define VBR_STAT_OK             0
28
 
#define VBR_STAT_INVALID        1
29
 
#define VBR_STAT_DNSERROR       2
30
 
#define VBR_STAT_NORESOURCE     3
31
 
 
32
 
/* types */
33
 
struct vbr_handle;
34
 
typedef struct vbr_handle VBR;
35
 
 
36
 
/* prototypes */
37
 
 
38
 
/*
39
 
**  VBR_INIT -- initialize a VBR handle
40
 
**
41
 
**  Parameters:
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
45
 
**
46
 
**  Return value:
47
 
**      A new VBR handle suitable for use with other VBR functions, or
48
 
**      NULL on failure.
49
 
**  
50
 
**  Side effects:
51
 
**      Strange radar returns at Indianapolis ARTCC.
52
 
*/
53
 
 
54
 
extern VBR * vbr_init __P((void *(*caller_mallocf)(void *closure,
55
 
                                                   size_t nbytes),
56
 
                           void (*caller_freef)(void *closure, void *p),
57
 
                           void *closure));
58
 
 
59
 
/*
60
 
**  VBR_CLOSE -- shut down a VBR instance
61
 
**
62
 
**  Parameters:
63
 
**      vbr -- VBR handle to shut down
64
 
**
65
 
**  Return value:
66
 
**      None.
67
 
*/
68
 
 
69
 
extern void vbr_close __P((VBR *));
70
 
 
71
 
/*
72
 
**  VBR_GETERROR -- return any stored error string from within the VBR
73
 
**                  context handle
74
 
**
75
 
**  Parameters:
76
 
**      vbr -- VBR handle from which to retrieve an error string
77
 
**
78
 
**  Return value:
79
 
**      A pointer to the stored string, or NULL if none was stored.
80
 
*/
81
 
 
82
 
extern const char *vbr_geterror __P((VBR *));
83
 
 
84
 
/*
85
 
**  VBR_GETHEADER -- generate and store the VBR-Info header
86
 
**
87
 
**  Parameters:
88
 
**      vbr -- VBR handle, created by vbr_init()
89
 
**      hdr -- header buffer
90
 
**      len -- number of bytes available at "hdr"
91
 
**
92
 
**  Return value:
93
 
**      STAT_OK -- success
94
 
**      STAT_NORESOURCE -- "hdr" was too short
95
 
*/
96
 
 
97
 
extern VBR_STAT vbr_getheader __P((VBR *, char *, size_t));
98
 
 
99
 
/*
100
 
**  VBR_SETCERT -- store the VBR certifiers of this message
101
 
**
102
 
**  Parameters:
103
 
**      vbr -- VBR handle, created by vbr_init()
104
 
**      cert -- certifiers string
105
 
**
106
 
**  Return value:
107
 
**      None (yet).
108
 
*/
109
 
 
110
 
extern void vbr_setcert __P((VBR *, char *));
111
 
 
112
 
/*
113
 
**  VBR_SETTYPE -- store the VBR type of this message
114
 
**
115
 
**  Parameters:
116
 
**      vbr -- VBR handle, created by vbr_init()
117
 
**      type -- type string
118
 
**
119
 
**  Return value:
120
 
**      None (yet).
121
 
*/
122
 
 
123
 
extern void vbr_settype __P((VBR *, char *));
124
 
 
125
 
/*
126
 
**  VBR_SETDOMAIN -- declare the sender's domain
127
 
**
128
 
**  Parameters:
129
 
**      vbr -- VBR handle, created by vbr_init()
130
 
**      cert -- certifiers string
131
 
**
132
 
**  Return value:
133
 
**      None (yet).
134
 
*/
135
 
 
136
 
extern void vbr_setdomain __P((VBR *, char *));
137
 
 
138
 
/*
139
 
**  VBR_TRUSTEDCERTS -- set list of trusted certifiers
140
 
**
141
 
**  Parameters:
142
 
**      vbr -- VBR handle, created by vbr_init()
143
 
**      certs -- NULL terminted vector of trusted certifier names
144
 
**
145
 
**  Return value:
146
 
**      None (yet).
147
 
*/
148
 
 
149
 
extern void vbr_trustedcerts __P((VBR *, char **));
150
 
 
151
 
/*
152
 
**  VBR_QUERY -- query the vouching servers for results
153
 
**
154
 
**  Parameters:
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
158
 
**
159
 
**  Return value:
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
164
 
**
165
 
**  Notes:
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
170
 
*/
171
 
 
172
 
extern VBR_STAT vbr_query __P((VBR *, char **, char **));
173
 
 
174
 
#ifdef USE_ARLIB
175
 
/*
176
 
**  VBR_SETTIMEOUT -- set the DNS timeout
177
 
**
178
 
**  Parameters:
179
 
**      vbr -- VBR handle, created by vbr_init()
180
 
**      timeout -- requested timeout (seconds)
181
 
**
182
 
**  Return value:
183
 
**      None (yet).
184
 
*/
185
 
 
186
 
extern void vbr_settimeout __P((VBR *, u_int));
187
 
 
188
 
/*
189
 
**  VBR_SETCALLBACKINT -- set the DNS callback interval
190
 
**
191
 
**  Parameters:
192
 
**      vbr -- VBR handle, created by vbr_init()
193
 
**      cbint -- requested callback interval (seconds)
194
 
**
195
 
**  Return value:
196
 
**      None (yet).
197
 
*/
198
 
 
199
 
extern void vbr_setcallbackint __P((VBR *, u_int));
200
 
 
201
 
/*
202
 
**  VBR_SETCALLBACKCTX -- set the DNS callback context
203
 
**
204
 
**  Parameters:
205
 
**      vbr -- VBR handle, created by vbr_init()
206
 
**      ctx -- context to pass to the DNS callback
207
 
**
208
 
**  Return value:
209
 
**      None (yet).
210
 
*/
211
 
 
212
 
extern void vbr_setcallbackctx __P((VBR *, void *));
213
 
 
214
 
/*
215
 
**  VBR_SETDNSCALLBACK -- set the DNS wait callback
216
 
**
217
 
**  Parameters:
218
 
**      vbr -- VBR handle, created by vbr_init()
219
 
**      func -- function to call; should take an opaque context pointer
220
 
**
221
 
**  Return value:
222
 
**      None.
223
 
*/
224
 
 
225
 
extern VBR_STAT vbr_setdnscallback __P((VBR *vbr,
226
 
                                        void (*func)(const void *context)));
227
 
 
228
 
#endif /* USE_ARLIB */
229
 
 
230
 
#endif /* _VBR_H_ */