Postfix3.3.1
resolve_clnt.h
[詳解]
1 #ifndef _RESOLVE_CLNT_H_INCLUDED_
2 #define _RESOLVE_CLNT_H_INCLUDED_
3 
4 /*++
5 /* NAME
6 /* resolve_clnt 3h
7 /* SUMMARY
8 /* address resolver client
9 /* SYNOPSIS
10 /* #include <resolve_clnt.h>
11 /* DESCRIPTION
12 /* .nf
13 
14  /*
15  * Utility library.
16  */
17 #include <vstring.h>
18 
19  /*
20  * External interface.
21  */
22 #define RESOLVE_REGULAR "resolve"
23 #define RESOLVE_VERIFY "verify"
24 
25 #define RESOLVE_FLAG_FINAL (1<<0) /* final delivery */
26 #define RESOLVE_FLAG_ROUTED (1<<1) /* routed destination */
27 #define RESOLVE_FLAG_ERROR (1<<2) /* bad destination syntax */
28 #define RESOLVE_FLAG_FAIL (1<<3) /* request failed */
29 
30 #define RESOLVE_CLASS_LOCAL (1<<8) /* mydestination/inet_interfaces */
31 #define RESOLVE_CLASS_ALIAS (1<<9) /* virtual_alias_domains */
32 #define RESOLVE_CLASS_VIRTUAL (1<<10) /* virtual_mailbox_domains */
33 #define RESOLVE_CLASS_RELAY (1<<11) /* relay_domains */
34 #define RESOLVE_CLASS_DEFAULT (1<<12) /* raise reject_unauth_destination */
35 
36 #define RESOLVE_CLASS_FINAL \
37  (RESOLVE_CLASS_LOCAL | RESOLVE_CLASS_ALIAS | RESOLVE_CLASS_VIRTUAL)
38 
39 #define RESOLVE_CLASS_MASK \
40  (RESOLVE_CLASS_LOCAL | RESOLVE_CLASS_ALIAS | RESOLVE_CLASS_VIRTUAL \
41  | RESOLVE_CLASS_RELAY | RESOLVE_CLASS_DEFAULT)
42 
43 typedef struct RESOLVE_REPLY {
47  int flags;
49 
50 extern void resolve_clnt_init(RESOLVE_REPLY *);
51 extern void resolve_clnt(const char *, const char *, const char *, RESOLVE_REPLY *);
52 extern void resolve_clnt_free(RESOLVE_REPLY *);
53 
54 #define RESOLVE_NULL_FROM ""
55 
56 #define resolve_clnt_query_from(f, a, r) \
57  resolve_clnt(RESOLVE_REGULAR, (f), (a), (r))
58 #define resolve_clnt_verify_from(f, a, r) \
59  resolve_clnt(RESOLVE_VERIFY, (f), (a), (r))
60 
61 #define RESOLVE_CLNT_ASSIGN(reply, transport, nexthop, recipient) { \
62  (reply).transport = (transport); \
63  (reply).nexthop = (nexthop); \
64  (reply).recipient = (recipient); \
65  }
66 
67 /* LICENSE
68 /* .ad
69 /* .fi
70 /* The Secure Mailer license must be distributed with this software.
71 /* AUTHOR(S)
72 /* Wietse Venema
73 /* IBM T.J. Watson Research
74 /* P.O. Box 704
75 /* Yorktown Heights, NY 10598, USA
76 /*
77 /* Wietse Venema
78 /* Google, Inc.
79 /* 111 8th Avenue
80 /* New York, NY 10011, USA
81 /*--*/
82 
83 #endif
void resolve_clnt_init(RESOLVE_REPLY *)
Definition: resolve_clnt.c:147
void resolve_clnt(const char *, const char *, const char *, RESOLVE_REPLY *)
Definition: resolve_clnt.c:157
struct RESOLVE_REPLY RESOLVE_REPLY
VSTRING * recipient
Definition: resolve_clnt.h:46
VSTRING * nexthop
Definition: resolve_clnt.h:45
VSTRING * transport
Definition: resolve_clnt.h:44
void resolve_clnt_free(RESOLVE_REPLY *)
Definition: resolve_clnt.c:287