Home | History | Annotate | Line # | Download | only in ftpd
      1  1.4     lukem /*	$NetBSD: pfilter.c,v 1.4 2020/07/04 05:18:37 lukem Exp $	*/
      2  1.4     lukem 
      3  1.1  christos #include <stdio.h>
      4  1.2     lukem #include <unistd.h>
      5  1.3  christos #include <blocklist.h>
      6  1.1  christos 
      7  1.1  christos #include "pfilter.h"
      8  1.1  christos 
      9  1.3  christos static struct blocklist *blstate;
     10  1.1  christos 
     11  1.1  christos void
     12  1.1  christos pfilter_open(void)
     13  1.1  christos {
     14  1.1  christos 	if (blstate == NULL)
     15  1.3  christos 		blstate = blocklist_open();
     16  1.1  christos }
     17  1.1  christos 
     18  1.1  christos void
     19  1.1  christos pfilter_notify(int what, const char *msg)
     20  1.1  christos {
     21  1.1  christos 	pfilter_open();
     22  1.1  christos 
     23  1.1  christos 	if (blstate == NULL)
     24  1.1  christos 		return;
     25  1.1  christos 
     26  1.3  christos 	blocklist_r(blstate, what, STDIN_FILENO, msg);
     27  1.1  christos }
     28