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