17c478bd9Sstevel@tonic-gate /*
2445f2479Sjbeck  * Copyright (c) 1999-2003, 2006 Sendmail, Inc. and its suppliers.
37c478bd9Sstevel@tonic-gate  *	All rights reserved.
47c478bd9Sstevel@tonic-gate  *
57c478bd9Sstevel@tonic-gate  * By using this file, you agree to the terms and conditions set
67c478bd9Sstevel@tonic-gate  * forth in the LICENSE file which can be found at the top level of
77c478bd9Sstevel@tonic-gate  * the sendmail distribution.
87c478bd9Sstevel@tonic-gate  */
97c478bd9Sstevel@tonic-gate 
107c478bd9Sstevel@tonic-gate /*
117c478bd9Sstevel@tonic-gate **  LIBMILTER.H -- include file for mail filter library functions
127c478bd9Sstevel@tonic-gate */
137c478bd9Sstevel@tonic-gate 
147c478bd9Sstevel@tonic-gate #ifndef _LIBMILTER_H
157c478bd9Sstevel@tonic-gate # define _LIBMILTER_H	1
167c478bd9Sstevel@tonic-gate 
177c478bd9Sstevel@tonic-gate #include <sm/gen.h>
187c478bd9Sstevel@tonic-gate 
197c478bd9Sstevel@tonic-gate #ifdef _DEFINE
207c478bd9Sstevel@tonic-gate # define EXTERN
217c478bd9Sstevel@tonic-gate # define INIT(x)	= x
22*e9af4bc0SJohn Beck SM_IDSTR(MilterlId, "@(#)$Id: libmilter.h,v 8.77 2008/11/25 18:28:18 ca Exp $")
237c478bd9Sstevel@tonic-gate #else /* _DEFINE */
247c478bd9Sstevel@tonic-gate # define EXTERN extern
257c478bd9Sstevel@tonic-gate # define INIT(x)
267c478bd9Sstevel@tonic-gate #endif /* _DEFINE */
277c478bd9Sstevel@tonic-gate 
287c478bd9Sstevel@tonic-gate 
29058561cbSjbeck #include "sm/tailq.h"
30058561cbSjbeck 
317c478bd9Sstevel@tonic-gate #define NOT_SENDMAIL	1
327c478bd9Sstevel@tonic-gate #define _SOCK_ADDR	union bigsockaddr
337c478bd9Sstevel@tonic-gate #include "sendmail.h"
347c478bd9Sstevel@tonic-gate 
35058561cbSjbeck #ifdef SM_ASSERT
36058561cbSjbeck #undef SM_ASSERT
37058561cbSjbeck #endif
38058561cbSjbeck #ifndef SM_ASSERT
39058561cbSjbeck #include <assert.h>
40058561cbSjbeck #define SM_ASSERT(x) assert(x)
41058561cbSjbeck #endif
42058561cbSjbeck 
437c478bd9Sstevel@tonic-gate #include "libmilter/milter.h"
447c478bd9Sstevel@tonic-gate 
45058561cbSjbeck #define MAX_MACROS_ENTRIES	7	/* max size of macro pointer array */
46058561cbSjbeck 
47058561cbSjbeck typedef SM_TAILQ_HEAD(, smfi_str)	smfi_hd_T;
48058561cbSjbeck typedef struct smfi_str smfi_str_S;
49058561cbSjbeck 
50058561cbSjbeck /*
51058561cbSjbeck **  Context for one milter session.
52058561cbSjbeck **
53058561cbSjbeck **  Notes:
54058561cbSjbeck **	There is a 1-1 correlation between a sendmail SMTP server process,
55058561cbSjbeck **	an SMTP session, and an milter context. Due to the nature of SMTP
56058561cbSjbeck **	session handling in sendmail 8, this libmilter implementation deals
57058561cbSjbeck **	only with a single SMTP session per MTA - libmilter connection.
58058561cbSjbeck **
59058561cbSjbeck **	There is no "global" context for libmilter, global variables are
60058561cbSjbeck **	just that (they are not "collected" in a context).
61058561cbSjbeck **
62058561cbSjbeck **  Implementation hint:
63058561cbSjbeck **  macros are stored in mac_buf[] as sequence of:
64058561cbSjbeck **  macro_name \0 macro_value
65058561cbSjbeck **  (just as read from the MTA)
66058561cbSjbeck **  mac_ptr is a list of pointers into mac_buf to the beginning of each
67058561cbSjbeck **  entry, i.e., macro_name, macro_value, ...
68058561cbSjbeck */
69058561cbSjbeck 
70058561cbSjbeck struct smfi_str
71058561cbSjbeck {
72058561cbSjbeck 	sthread_t	ctx_id;		/* thread id */
73058561cbSjbeck 	socket_t	ctx_sd;		/* socket descriptor */
74058561cbSjbeck 	int		ctx_dbg;	/* debug level */
75058561cbSjbeck 	time_t		ctx_timeout;	/* timeout */
76058561cbSjbeck 	int		ctx_state;	/* state */
77058561cbSjbeck 	smfiDesc_ptr	ctx_smfi;	/* filter description */
78058561cbSjbeck 
79058561cbSjbeck 	int		ctx_prot_vers;	/* libmilter protocol version */
80058561cbSjbeck 	unsigned long	ctx_aflags;	/* milter action flags */
81058561cbSjbeck 
82058561cbSjbeck 	unsigned long	ctx_pflags;	/* milter protocol flags */
83058561cbSjbeck 
84058561cbSjbeck 	/*
85058561cbSjbeck 	**  milter protocol flags that are sent to the MTA;
86058561cbSjbeck 	**  this is the same as ctx_pflags except for those flags that
87058561cbSjbeck 	**  are not offered by the MTA but emulated in libmilter.
88058561cbSjbeck 	*/
89058561cbSjbeck 
90058561cbSjbeck 	unsigned long	ctx_pflags2mta;
91058561cbSjbeck 
92058561cbSjbeck 	/*
93058561cbSjbeck 	**  milter protocol version that is sent to the MTA;
94058561cbSjbeck 	**  this is the same as ctx_prot_vers unless the
95058561cbSjbeck 	**  MTA protocol version (ctx_mta_prot_vers) is smaller
96058561cbSjbeck 	**  but still "acceptable".
97058561cbSjbeck 	*/
98058561cbSjbeck 
99058561cbSjbeck 	int		ctx_prot_vers2mta;
100058561cbSjbeck 
101058561cbSjbeck 	char		**ctx_mac_ptr[MAX_MACROS_ENTRIES];
102058561cbSjbeck 	char		*ctx_mac_buf[MAX_MACROS_ENTRIES];
103058561cbSjbeck 	char		*ctx_mac_list[MAX_MACROS_ENTRIES];
104058561cbSjbeck 	char		*ctx_reply;	/* reply code */
105058561cbSjbeck 	void		*ctx_privdata;	/* private data */
106058561cbSjbeck 
107058561cbSjbeck 	int		ctx_mta_prot_vers;	/* MTA protocol version */
108058561cbSjbeck 	unsigned long	ctx_mta_pflags;	/* MTA protocol flags */
109058561cbSjbeck 	unsigned long	ctx_mta_aflags;	/* MTA action flags */
110058561cbSjbeck 
111058561cbSjbeck #if _FFR_THREAD_MONITOR
112058561cbSjbeck 	time_t		ctx_start;	/* start time of thread */
113058561cbSjbeck 	SM_TAILQ_ENTRY(smfi_str)	ctx_mon_link;
114058561cbSjbeck #endif /* _FFR_THREAD_MONITOR */
115058561cbSjbeck 
116058561cbSjbeck #if _FFR_WORKERS_POOL
117058561cbSjbeck 	long		ctx_sid;	/* session identifier */
118058561cbSjbeck 	int		ctx_wstate;	/* state of the session (worker pool) */
119058561cbSjbeck 	int		ctx_wait;	/* elapsed time waiting for sm cmd */
120058561cbSjbeck 	SM_TAILQ_ENTRY(smfi_str)	ctx_link;
121058561cbSjbeck #endif /* _FFR_WORKERS_POOL */
122058561cbSjbeck };
123058561cbSjbeck 
1247c478bd9Sstevel@tonic-gate # define ValidSocket(sd)	((sd) >= 0)
1257c478bd9Sstevel@tonic-gate # define INVALID_SOCKET		(-1)
1267c478bd9Sstevel@tonic-gate # define closesocket		close
1277c478bd9Sstevel@tonic-gate # define MI_SOCK_READ(s, b, l)	read(s, b, l)
1287c478bd9Sstevel@tonic-gate # define MI_SOCK_READ_FAIL(x)	((x) < 0)
1297c478bd9Sstevel@tonic-gate # define MI_SOCK_WRITE(s, b, l)	write(s, b, l)
1307c478bd9Sstevel@tonic-gate 
1317c478bd9Sstevel@tonic-gate # define thread_create(ptid,wr,arg) pthread_create(ptid, NULL, wr, arg)
1327c478bd9Sstevel@tonic-gate # define sthread_get_id()	pthread_self()
1337c478bd9Sstevel@tonic-gate 
1347c478bd9Sstevel@tonic-gate typedef pthread_mutex_t smutex_t;
1357c478bd9Sstevel@tonic-gate # define smutex_init(mp)	(pthread_mutex_init(mp, NULL) == 0)
1367c478bd9Sstevel@tonic-gate # define smutex_destroy(mp)	(pthread_mutex_destroy(mp) == 0)
1377c478bd9Sstevel@tonic-gate # define smutex_lock(mp)	(pthread_mutex_lock(mp) == 0)
1387c478bd9Sstevel@tonic-gate # define smutex_unlock(mp)	(pthread_mutex_unlock(mp) == 0)
1397c478bd9Sstevel@tonic-gate # define smutex_trylock(mp)	(pthread_mutex_trylock(mp) == 0)
1407c478bd9Sstevel@tonic-gate 
141058561cbSjbeck #if _FFR_WORKERS_POOL
142058561cbSjbeck /* SM_CONF_POLL shall be defined with _FFR_WORKERS_POOL */
143058561cbSjbeck # if !SM_CONF_POLL
144058561cbSjbeck #  define SM_CONF_POLL 1
145058561cbSjbeck # endif /* SM_CONF_POLL */
146058561cbSjbeck #endif /* _FFR_WORKERS_POOL */
147058561cbSjbeck 
148058561cbSjbeck typedef pthread_cond_t scond_t;
149058561cbSjbeck #define scond_init(cp)			pthread_cond_init(cp, NULL)
150058561cbSjbeck #define scond_destroy(cp)		pthread_cond_destroy(cp)
151058561cbSjbeck #define scond_wait(cp, mp)		pthread_cond_wait(cp, mp)
152058561cbSjbeck #define scond_signal(cp)		pthread_cond_signal(cp)
153058561cbSjbeck #define scond_broadcast(cp)		pthread_cond_broadcast(cp)
154058561cbSjbeck #define scond_timedwait(cp, mp, to)					\
155058561cbSjbeck 	do								\
156058561cbSjbeck 	{								\
157058561cbSjbeck 		struct timespec timeout;				\
158058561cbSjbeck 		struct timeval now;					\
159058561cbSjbeck 		gettimeofday(&now, NULL);				\
160058561cbSjbeck 		timeout.tv_sec = now.tv_sec + to;			\
161058561cbSjbeck 		timeout.tv_nsec = now.tv_usec / 1000;			\
162058561cbSjbeck 		r = pthread_cond_timedwait(cp,mp,&timeout);		\
163058561cbSjbeck 		if (r != 0 && r != ETIMEDOUT)				\
164058561cbSjbeck 			smi_log(SMI_LOG_ERR,				\
165058561cbSjbeck 				"pthread_cond_timedwait error %d", r);	\
166058561cbSjbeck 	} while (0)
167058561cbSjbeck 
168058561cbSjbeck 
1697c478bd9Sstevel@tonic-gate #if SM_CONF_POLL
1707c478bd9Sstevel@tonic-gate 
1717c478bd9Sstevel@tonic-gate # include <poll.h>
1727c478bd9Sstevel@tonic-gate # define MI_POLLSELECT  "poll"
1737c478bd9Sstevel@tonic-gate 
1747c478bd9Sstevel@tonic-gate # define MI_POLL_RD_FLAGS (POLLIN | POLLPRI)
1757c478bd9Sstevel@tonic-gate # define MI_POLL_WR_FLAGS (POLLOUT)
1767c478bd9Sstevel@tonic-gate # define MI_MS(timeout)	(((timeout)->tv_sec * 1000) + (timeout)->tv_usec)
1777c478bd9Sstevel@tonic-gate 
1787c478bd9Sstevel@tonic-gate # define FD_RD_VAR(rds, excs) struct pollfd rds
1797c478bd9Sstevel@tonic-gate # define FD_WR_VAR(wrs) struct pollfd wrs
1807c478bd9Sstevel@tonic-gate 
1817c478bd9Sstevel@tonic-gate # define FD_RD_INIT(sd, rds, excs)			\
1827c478bd9Sstevel@tonic-gate 		(rds).fd = (sd);			\
1837c478bd9Sstevel@tonic-gate 		(rds).events = MI_POLL_RD_FLAGS;	\
1847c478bd9Sstevel@tonic-gate 		(rds).revents = 0
1857c478bd9Sstevel@tonic-gate 
1867c478bd9Sstevel@tonic-gate # define FD_WR_INIT(sd, wrs)				\
1877c478bd9Sstevel@tonic-gate 		(wrs).fd = (sd);			\
1887c478bd9Sstevel@tonic-gate 		(wrs).events = MI_POLL_WR_FLAGS;	\
1897c478bd9Sstevel@tonic-gate 		(wrs).revents = 0
1907c478bd9Sstevel@tonic-gate 
1917c478bd9Sstevel@tonic-gate # define FD_IS_RD_EXC(sd, rds, excs)	\
1927c478bd9Sstevel@tonic-gate 		(((rds).revents & (POLLERR | POLLHUP | POLLNVAL)) != 0)
1937c478bd9Sstevel@tonic-gate 
1947c478bd9Sstevel@tonic-gate # define FD_IS_WR_RDY(sd, wrs)		\
1957c478bd9Sstevel@tonic-gate 		(((wrs).revents & MI_POLL_WR_FLAGS) != 0)
1967c478bd9Sstevel@tonic-gate 
1977c478bd9Sstevel@tonic-gate # define FD_IS_RD_RDY(sd, rds, excs)			\
1987c478bd9Sstevel@tonic-gate 		(((rds).revents & MI_POLL_RD_FLAGS) != 0)
1997c478bd9Sstevel@tonic-gate 
2007c478bd9Sstevel@tonic-gate # define FD_WR_READY(sd, excs, timeout)	\
2017c478bd9Sstevel@tonic-gate 		poll(&(wrs), 1, MI_MS(timeout))
2027c478bd9Sstevel@tonic-gate 
2037c478bd9Sstevel@tonic-gate # define FD_RD_READY(sd, rds, excs, timeout)	\
2047c478bd9Sstevel@tonic-gate 		poll(&(rds), 1, MI_MS(timeout))
2057c478bd9Sstevel@tonic-gate 
2067c478bd9Sstevel@tonic-gate #else /* SM_CONF_POLL */
2077c478bd9Sstevel@tonic-gate 
2087c478bd9Sstevel@tonic-gate # include <sm/fdset.h>
2097c478bd9Sstevel@tonic-gate # define MI_POLLSELECT  "select"
2107c478bd9Sstevel@tonic-gate 
2117c478bd9Sstevel@tonic-gate # define FD_RD_VAR(rds, excs) fd_set rds, excs
2127c478bd9Sstevel@tonic-gate # define FD_WR_VAR(wrs) fd_set wrs
2137c478bd9Sstevel@tonic-gate 
2147c478bd9Sstevel@tonic-gate # define FD_RD_INIT(sd, rds, excs)			\
2157c478bd9Sstevel@tonic-gate 		FD_ZERO(&(rds));			\
2167c478bd9Sstevel@tonic-gate 		FD_SET((unsigned int) (sd), &(rds));	\
2177c478bd9Sstevel@tonic-gate 		FD_ZERO(&(excs));			\
2187c478bd9Sstevel@tonic-gate 		FD_SET((unsigned int) (sd), &(excs))
2197c478bd9Sstevel@tonic-gate 
2207c478bd9Sstevel@tonic-gate # define FD_WR_INIT(sd, wrs)			\
2217c478bd9Sstevel@tonic-gate 		FD_ZERO(&(wrs));			\
222445f2479Sjbeck 		FD_SET((unsigned int) (sd), &(wrs))
2237c478bd9Sstevel@tonic-gate 
2247c478bd9Sstevel@tonic-gate # define FD_IS_RD_EXC(sd, rds, excs) FD_ISSET(sd, &(excs))
2257c478bd9Sstevel@tonic-gate # define FD_IS_WR_RDY(sd, wrs) FD_ISSET((sd), &(wrs))
2267c478bd9Sstevel@tonic-gate # define FD_IS_RD_RDY(sd, rds, excs) FD_ISSET((sd), &(rds))
2277c478bd9Sstevel@tonic-gate 
2287c478bd9Sstevel@tonic-gate # define FD_WR_READY(sd, wrs, timeout)	\
2297c478bd9Sstevel@tonic-gate 		select((sd) + 1, NULL, &(wrs), NULL, (timeout))
2307c478bd9Sstevel@tonic-gate # define FD_RD_READY(sd, rds, excs, timeout)	\
2317c478bd9Sstevel@tonic-gate 		select((sd) + 1, &(rds), NULL, &(excs), (timeout))
2327c478bd9Sstevel@tonic-gate 
2337c478bd9Sstevel@tonic-gate #endif /* SM_CONF_POLL */
2347c478bd9Sstevel@tonic-gate 
2357c478bd9Sstevel@tonic-gate #include <sys/time.h>
2367c478bd9Sstevel@tonic-gate 
2377c478bd9Sstevel@tonic-gate /* some defaults */
2387c478bd9Sstevel@tonic-gate #define MI_TIMEOUT	7210		/* default timeout for read/write */
2397c478bd9Sstevel@tonic-gate #define MI_CHK_TIME	5		/* checking whether to terminate */
2407c478bd9Sstevel@tonic-gate 
2417c478bd9Sstevel@tonic-gate #ifndef MI_SOMAXCONN
2427c478bd9Sstevel@tonic-gate # if SOMAXCONN > 20
2437c478bd9Sstevel@tonic-gate #  define MI_SOMAXCONN	SOMAXCONN
2447c478bd9Sstevel@tonic-gate # else /* SOMAXCONN */
2457c478bd9Sstevel@tonic-gate #  define MI_SOMAXCONN	20
2467c478bd9Sstevel@tonic-gate # endif /* SOMAXCONN */
2477c478bd9Sstevel@tonic-gate #endif /* ! MI_SOMAXCONN */
2487c478bd9Sstevel@tonic-gate 
2497c478bd9Sstevel@tonic-gate /* maximum number of repeated failures in mi_listener() */
2507c478bd9Sstevel@tonic-gate #define MAX_FAILS_M	16	/* malloc() */
2517c478bd9Sstevel@tonic-gate #define MAX_FAILS_T	16	/* thread creation */
2527c478bd9Sstevel@tonic-gate #define MAX_FAILS_A	16	/* accept() */
2537c478bd9Sstevel@tonic-gate #define MAX_FAILS_S	16	/* select() */
2547c478bd9Sstevel@tonic-gate 
2557c478bd9Sstevel@tonic-gate /* internal "commands", i.e., error codes */
2567c478bd9Sstevel@tonic-gate #define SMFIC_TIMEOUT	((char) 1)	/* timeout */
2577c478bd9Sstevel@tonic-gate #define SMFIC_SELECT	((char) 2)	/* select error */
2587c478bd9Sstevel@tonic-gate #define SMFIC_MALLOC	((char) 3)	/* malloc error */
2597c478bd9Sstevel@tonic-gate #define SMFIC_RECVERR	((char) 4)	/* recv() error */
2607c478bd9Sstevel@tonic-gate #define SMFIC_EOF	((char) 5)	/* eof */
2617c478bd9Sstevel@tonic-gate #define SMFIC_UNKNERR	((char) 6)	/* unknown error */
2627c478bd9Sstevel@tonic-gate #define SMFIC_TOOBIG	((char) 7)	/* body chunk too big */
2637c478bd9Sstevel@tonic-gate #define SMFIC_VALIDCMD	' '		/* first valid command */
2647c478bd9Sstevel@tonic-gate 
2657c478bd9Sstevel@tonic-gate /* hack */
2667c478bd9Sstevel@tonic-gate #define smi_log		syslog
2677c478bd9Sstevel@tonic-gate #define sm_dprintf	(void) printf
2687c478bd9Sstevel@tonic-gate #define milter_ret	int
2697c478bd9Sstevel@tonic-gate #define SMI_LOG_ERR	LOG_ERR
2707c478bd9Sstevel@tonic-gate #define SMI_LOG_FATAL	LOG_ERR
2717c478bd9Sstevel@tonic-gate #define SMI_LOG_WARN	LOG_WARNING
2727c478bd9Sstevel@tonic-gate #define SMI_LOG_INFO	LOG_INFO
2737c478bd9Sstevel@tonic-gate #define SMI_LOG_DEBUG	LOG_DEBUG
2747c478bd9Sstevel@tonic-gate 
2757c478bd9Sstevel@tonic-gate /* stop? */
2767c478bd9Sstevel@tonic-gate #define MILTER_CONT	0
2777c478bd9Sstevel@tonic-gate #define MILTER_STOP	1
2787c478bd9Sstevel@tonic-gate #define MILTER_ABRT	2
2797c478bd9Sstevel@tonic-gate 
2807c478bd9Sstevel@tonic-gate /* functions */
2817c478bd9Sstevel@tonic-gate extern int	mi_handle_session __P((SMFICTX_PTR));
2827c478bd9Sstevel@tonic-gate extern int	mi_engine __P((SMFICTX_PTR));
2837c478bd9Sstevel@tonic-gate extern int	mi_listener __P((char *, int, smfiDesc_ptr, time_t, int));
2847c478bd9Sstevel@tonic-gate extern void	mi_clr_macros __P((SMFICTX_PTR, int));
285*e9af4bc0SJohn Beck extern void	mi_clr_ctx __P((SMFICTX_PTR));
2867c478bd9Sstevel@tonic-gate extern int	mi_stop __P((void));
2877c478bd9Sstevel@tonic-gate extern int	mi_control_startup __P((char *));
2887c478bd9Sstevel@tonic-gate extern void	mi_stop_milters __P((int));
2897c478bd9Sstevel@tonic-gate extern void	mi_clean_signals __P((void));
2907c478bd9Sstevel@tonic-gate extern struct hostent *mi_gethostbyname __P((char *, int));
2917c478bd9Sstevel@tonic-gate extern int	mi_inet_pton __P((int, const char *, void *));
2927c478bd9Sstevel@tonic-gate extern void	mi_closener __P((void));
2937c478bd9Sstevel@tonic-gate extern int	mi_opensocket __P((char *, int, int, bool, smfiDesc_ptr));
2947c478bd9Sstevel@tonic-gate 
2957c478bd9Sstevel@tonic-gate /* communication functions */
2967c478bd9Sstevel@tonic-gate extern char	*mi_rd_cmd __P((socket_t, struct timeval *, char *, size_t *, char *));
2977c478bd9Sstevel@tonic-gate extern int	mi_wr_cmd __P((socket_t, struct timeval *, int, char *, size_t));
2987c478bd9Sstevel@tonic-gate extern bool	mi_sendok __P((SMFICTX_PTR, int));
2997c478bd9Sstevel@tonic-gate 
3007c478bd9Sstevel@tonic-gate 
301058561cbSjbeck #if _FFR_THREAD_MONITOR
302058561cbSjbeck extern bool Monitor;
303058561cbSjbeck 
304058561cbSjbeck #define MI_MONITOR_INIT()	mi_monitor_init()
305058561cbSjbeck #define MI_MONITOR_BEGIN(ctx, cmd)			\
306058561cbSjbeck 	do						\
307058561cbSjbeck 	{						\
308058561cbSjbeck 		if (Monitor)				\
309058561cbSjbeck 			mi_monitor_work_begin(ctx, cmd);\
310058561cbSjbeck 	} while (0)
311058561cbSjbeck 
312058561cbSjbeck #define MI_MONITOR_END(ctx, cmd)			\
313058561cbSjbeck 	do						\
314058561cbSjbeck 	{						\
315058561cbSjbeck 		if (Monitor)				\
316058561cbSjbeck 			mi_monitor_work_end(ctx, cmd);	\
317058561cbSjbeck 	} while (0)
318058561cbSjbeck 
319058561cbSjbeck int mi_monitor_init __P((void));
320058561cbSjbeck int mi_monitor_work_begin __P((SMFICTX_PTR, int));
321058561cbSjbeck int mi_monitor_work_end __P((SMFICTX_PTR, int));
322058561cbSjbeck 
323058561cbSjbeck #else /* _FFR_THREAD_MONITOR */
324058561cbSjbeck #define MI_MONITOR_INIT()	MI_SUCCESS
325058561cbSjbeck #define MI_MONITOR_BEGIN(ctx, cmd)
326058561cbSjbeck #define MI_MONITOR_END(ctx, cmd)
327058561cbSjbeck #endif /* _FFR_THREAD_MONITOR */
328058561cbSjbeck 
329058561cbSjbeck #if _FFR_WORKERS_POOL
330058561cbSjbeck extern int mi_pool_manager_init __P((void));
331058561cbSjbeck extern int mi_pool_controller_init __P((void));
332058561cbSjbeck extern int mi_start_session __P((SMFICTX_PTR));
333058561cbSjbeck #endif /* _FFR_WORKERS_POOL */
334058561cbSjbeck 
3357c478bd9Sstevel@tonic-gate #endif /* ! _LIBMILTER_H */
336