Fix SPA authenticator, checking client-supplied data before using it. Bug 2571
[exim.git] / src / src / lookupapi.h
CommitLineData
e6d225ae
DW
1/*************************************************
2* Exim - an Internet mail transport agent *
3*************************************************/
4
3386088d 5/* Copyright (c) University of Cambridge 1995 - 2015 */
1e1ddfac 6/* Copyright (c) The Exim Maintainers 2020 */
e6d225ae
DW
7/* See the file NOTICE for conditions of use and distribution. */
8
9
10/* The "type" field in each item is a set of bit flags:
11
12 lookup_querystyle => this is a query-style lookup,
13 else single-key (+ file) style
14 lookup_absfile => an absolute file name is required,
15 (for single-key style only)
16*/
17
18typedef struct lookup_info {
19 uschar *name; /* e.g. "lsearch" */
20 int type; /* query/singlekey/abs-file */
21 void *(*open)( /* open function */
d447dbd1 22 const uschar *, /* file name for those that have one */
e6d225ae
DW
23 uschar **); /* for error message */
24 BOOL (*check)( /* file checking function */
25 void *, /* handle */
d447dbd1 26 const uschar *, /* file name */
e6d225ae
DW
27 int, /* modemask for file checking */
28 uid_t *, /* owners for file checking */
29 gid_t *, /* owngroups for file checking */
30 uschar **); /* for error messages */
31 int (*find)( /* find function */
32 void *, /* handle */
d447dbd1 33 const uschar *, /* file name or NULL */
55414b25 34 const uschar *, /* key or query */
e6d225ae
DW
35 int, /* length of key or query */
36 uschar **, /* for returning answer */
37 uschar **, /* for error message */
67a57a5a
JH
38 uint *, /* cache TTL, seconds */
39 const uschar *); /* options */
e6d225ae
DW
40 void (*close)( /* close function */
41 void *); /* handle */
42 void (*tidy)(void); /* tidy function */
43 uschar *(*quote)( /* quoting function */
44 uschar *, /* string to quote */
45 uschar *); /* additional data from quote name */
6545de78
PP
46 void (*version_report)( /* diagnostic function */
47 FILE *); /* fh to write to */
e6d225ae
DW
48} lookup_info;
49
50/* This magic number is used by the following lookup_module_info structure
14b3c5bc
JH
51 for checking API compatibility. It used to be equivalent to the string"LMM3" */
52#define LOOKUP_MODULE_INFO_MAGIC 0x4c4d4933
6545de78 53/* Version 2 adds: version_report */
14b3c5bc 54/* Version 3 change: non/cache becomes TTL in seconds */
e6d225ae
DW
55
56typedef struct lookup_module_info {
57 uint magic;
58 lookup_info **lookups;
59 uint lookupcount;
60} lookup_module_info;
61
62/* End of lookupapi.h */