Postfix3.3.1
header_body_checks.h
[詳解]
1 #ifndef _HBC_H_INCLUDED_
2 #define _HBC_H_INCLUDED_
3 
4 /*++
5 /* NAME
6 /* header_body_checks 3h
7 /* SUMMARY
8 /* delivery agent header/body checks
9 /* SYNOPSIS
10 /* #include <header_body_checks.h>
11 /* DESCRIPTION
12 /* .nf
13 
14  /*
15  * Global library.
16  */
17 #include <mime_state.h>
18 #include <maps.h>
19 
20  /*
21  * Postfix < 2.5 compatibility.
22  */
23 #ifndef MIME_HDR_FIRST
24 #define MIME_HDR_FIRST (1)
25 #define MIME_HDR_LAST (3)
26 #endif
27 
28  /*
29  * External interface.
30  */
31 typedef struct {
32  const char *map_class; /* parameter name */
33  MAPS *maps; /* map handle */
34 } HBC_MAP_INFO;
35 
36 typedef struct {
37  void (*logger) (void *, const char *, const char *, const char *, const char *);
38  void (*prepend) (void *, int, const char *, ssize_t, off_t);
39  char *(*extend) (void *, const char *, ssize_t, const char *, const char *, const char *, ssize_t, off_t);
41 
42 typedef struct {
44  HBC_MAP_INFO map_info[1]; /* actually, a bunch */
45 } HBC_CHECKS;
46 
47 #define HBC_CHECKS_STAT_IGNORE ((char *) 0)
48 #define HBC_CHECKS_STAT_ERROR (&hbc_checks_error)
49 #define HBC_CHECKS_STAT_UNKNOWN (&hbc_checks_unknown)
50 
51 extern HBC_CHECKS *hbc_header_checks_create(const char *, const char *,
52  const char *, const char *,
53  const char *, const char *,
54  HBC_CALL_BACKS *);
55 extern HBC_CHECKS *hbc_body_checks_create(const char *, const char *,
56  HBC_CALL_BACKS *);
57 extern char *hbc_header_checks(void *, HBC_CHECKS *, int, const HEADER_OPTS *,
58  VSTRING *, off_t);
59 extern char *hbc_body_checks(void *, HBC_CHECKS *, const char *, ssize_t, off_t);
60 
61 #define hbc_header_checks_free(hbc) _hbc_checks_free((hbc), HBC_HEADER_SIZE)
62 #define hbc_body_checks_free(hbc) _hbc_checks_free((hbc), 1)
63 
64  /*
65  * The following are NOT part of the external API.
66  */
67 #define HBC_HEADER_SIZE (MIME_HDR_LAST - MIME_HDR_FIRST + 1)
68 extern void _hbc_checks_free(HBC_CHECKS *, ssize_t);
69 extern char hbc_checks_error;
70 extern const char hbc_checks_unknown;
71 
72 /* LICENSE
73 /* .ad
74 /* .fi
75 /* The Secure Mailer license must be distributed with this software.
76 /* AUTHOR(S)
77 /* Wietse Venema
78 /* IBM T.J. Watson Research
79 /* P.O. Box 704
80 /* Yorktown Heights, NY 10598, USA
81 /*--*/
82 
83 #endif
Definition: maps.h:22
const char hbc_checks_unknown
HBC_CHECKS * hbc_body_checks_create(const char *, const char *, HBC_CALL_BACKS *)
char * hbc_header_checks(void *, HBC_CHECKS *, int, const HEADER_OPTS *, VSTRING *, off_t)
HBC_CHECKS * hbc_header_checks_create(const char *, const char *, const char *, const char *, const char *, const char *, HBC_CALL_BACKS *)
char * hbc_body_checks(void *, HBC_CHECKS *, const char *, ssize_t, off_t)
int int
Definition: smtpd_proxy.h:21
HBC_CALL_BACKS * call_backs
void _hbc_checks_free(HBC_CHECKS *, ssize_t)
char hbc_checks_error
const char * map_class