xref: /freebsd/contrib/tcp_wrappers/refuse.c (revision d9a42747950146bf03cda7f6e25d219253f8a57a)
1  /*
2   * refuse() reports a refused connection, and takes the consequences: in
3   * case of a datagram-oriented service, the unread datagram is taken from
4   * the input queue (or inetd would see the same datagram again and again);
5   * the program is terminated.
6   *
7   * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
8   *
9   * $FreeBSD$
10   */
11 
12 #ifndef lint
13 static char sccsid[] = "@(#) refuse.c 1.5 94/12/28 17:42:39";
14 #endif
15 
16 /* System libraries. */
17 
18 #include <stdio.h>
19 #include <syslog.h>
20 
21 /* Local stuff. */
22 
23 #include "tcpd.h"
24 
25 /* refuse - refuse request */
26 
27 void    refuse(struct request_info *request)
28 {
29 #ifdef INET6
30     syslog(deny_severity, "refused connect from %s (%s)",
31 	   eval_client(request), eval_hostaddr(request->client));
32 #else
33     syslog(deny_severity, "refused connect from %s", eval_client(request));
34 #endif
35     clean_exit(request);
36     /* NOTREACHED */
37 }
38 
39