xref: /netbsd-src/external/ibm-public/postfix/dist/src/smtpd/pfilter.c (revision 2f0bfbf3442cd2cdaac48da3327827ac7fc34009)
1 #include "pfilter.h"
2 #include <stdio.h>	/* for NULL */
3 #include <blocklist.h>
4 
5 static struct blocklist *blstate;
6 
7 void
pfilter_notify(int a,int fd)8 pfilter_notify(int a, int fd)
9 {
10 	if (blstate == NULL)
11 		blstate = blocklist_open();
12 	if (blstate == NULL)
13 		return;
14 	(void)blocklist_r(blstate, a, fd, "smtpd");
15 	if (a == 0) {
16 		blocklist_close(blstate);
17 		blstate = NULL;
18 	}
19 }
20