1 /*        $NetBSD: anvil_clnt.h,v 1.3 2020/03/18 19:05:16 christos Exp $        */
2 
3 #ifndef _ANVIL_CLNT_H_INCLUDED_
4 #define _ANVIL_CLNT_H_INCLUDED_
5 
6 /*++
7 /* NAME
8 /*        anvil_clnt 3h
9 /* SUMMARY
10 /*        connection count and rate management client interface
11 /* SYNOPSIS
12 /*        #include <anvil_clnt.h>
13 /* DESCRIPTION
14 /* .nf
15 
16  /*
17   * System library.
18   */
19 #include <stdarg.h>
20 
21  /*
22   * Utility library.
23   */
24 #include <attr_clnt.h>
25 
26  /*
27   * Protocol interface: requests and endpoints.
28   */
29 #define ANVIL_SERVICE                   "anvil"
30 #define ANVIL_CLASS           "private"
31 
32 #define ANVIL_ATTR_REQ                  "request"
33 #define ANVIL_REQ_CONN                  "connect"
34 #define ANVIL_REQ_DISC                  "disconnect"
35 #define ANVIL_REQ_MAIL                  "message"
36 #define ANVIL_REQ_RCPT                  "recipient"
37 #define ANVIL_REQ_NTLS                  "newtls"
38 #define ANVIL_REQ_NTLS_STAT   "newtls_status"
39 #define ANVIL_REQ_AUTH                  "auth"
40 #define ANVIL_REQ_LOOKUP      "lookup"
41 #define ANVIL_ATTR_IDENT      "ident"
42 #define ANVIL_ATTR_COUNT      "count"
43 #define ANVIL_ATTR_RATE                 "rate"
44 #define ANVIL_ATTR_MAIL                 "mail"
45 #define ANVIL_ATTR_RCPT                 "rcpt"
46 #define ANVIL_ATTR_NTLS                 "newtls"
47 #define ANVIL_ATTR_AUTH                 "auth"
48 #define ANVIL_ATTR_STATUS     "status"
49 
50 #define ANVIL_STAT_OK                   0
51 #define ANVIL_STAT_FAIL                 (-1)
52 
53  /*
54   * Functional interface.
55   */
56 typedef struct ANVIL_CLNT ANVIL_CLNT;
57 
58 extern ANVIL_CLNT *anvil_clnt_create(void);
59 extern int anvil_clnt_connect(ANVIL_CLNT *, const char *, const char *, int *, int *);
60 extern int anvil_clnt_mail(ANVIL_CLNT *, const char *, const char *, int *);
61 extern int anvil_clnt_rcpt(ANVIL_CLNT *, const char *, const char *, int *);
62 extern int anvil_clnt_newtls(ANVIL_CLNT *, const char *, const char *, int *);
63 extern int anvil_clnt_newtls_stat(ANVIL_CLNT *, const char *, const char *, int *);
64 extern int anvil_clnt_auth(ANVIL_CLNT *, const char *, const char *, int *);
65 extern int anvil_clnt_lookup(ANVIL_CLNT *, const char *, const char *, int *, int *, int *, int *, int *, int *);
66 extern int anvil_clnt_disconnect(ANVIL_CLNT *, const char *, const char *);
67 extern void anvil_clnt_free(ANVIL_CLNT *);
68 
69 /* LICENSE
70 /* .ad
71 /* .fi
72 /*        The Secure Mailer license must be distributed with this software.
73 /* AUTHOR(S)
74 /*        Wietse Venema
75 /*        IBM T.J. Watson Research
76 /*        P.O. Box 704
77 /*        Yorktown Heights, NY 10598, USA
78 /*
79 /*        Wietse Venema
80 /*        Google, Inc.
81 /*        111 8th Avenue
82 /*        New York, NY 10011, USA
83 /*--*/
84 
85 #endif
86