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  */
31typedef struct {
32    const char *map_class;		/* parameter name */
33    MAPS   *maps;			/* map handle */
34} HBC_MAP_INFO;
35
36typedef 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 *, int, const char *, const char *, const char *, ssize_t, off_t);
40} HBC_CALL_BACKS;
41
42typedef struct {
43    HBC_CALL_BACKS *call_backs;
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
51extern HBC_CHECKS *hbc_header_checks_create(const char *, const char *,
52					         const char *, const char *,
53					         const char *, const char *,
54					            HBC_CALL_BACKS *);
55extern HBC_CHECKS *hbc_body_checks_create(const char *, const char *,
56					          HBC_CALL_BACKS *);
57extern char *hbc_header_checks(void *, HBC_CHECKS *, int, const HEADER_OPTS *,
58			               VSTRING *, off_t);
59extern 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)
68extern void _hbc_checks_free(HBC_CHECKS *, ssize_t);
69extern char hbc_checks_error;
70extern 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
84