144743Smarkm /* 244743Smarkm * refuse() reports a refused connection, and takes the consequences: in 344743Smarkm * case of a datagram-oriented service, the unread datagram is taken from 444743Smarkm * the input queue (or inetd would see the same datagram again and again); 544743Smarkm * the program is terminated. 644743Smarkm * 744743Smarkm * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands. 856977Sshin * 956977Sshin * $FreeBSD$ 1044743Smarkm */ 1144743Smarkm 1244743Smarkm#ifndef lint 1344743Smarkmstatic char sccsid[] = "@(#) refuse.c 1.5 94/12/28 17:42:39"; 1444743Smarkm#endif 1544743Smarkm 1644743Smarkm/* System libraries. */ 1744743Smarkm 1844743Smarkm#include <stdio.h> 1944743Smarkm#include <syslog.h> 2044743Smarkm 2144743Smarkm/* Local stuff. */ 2244743Smarkm 2344743Smarkm#include "tcpd.h" 2444743Smarkm 2544743Smarkm/* refuse - refuse request */ 2644743Smarkm 2744743Smarkmvoid refuse(request) 2844743Smarkmstruct request_info *request; 2944743Smarkm{ 3056977Sshin#ifdef INET6 3156977Sshin syslog(deny_severity, "refused connect from %s (%s)", 3256977Sshin eval_client(request), eval_hostaddr(request->client)); 3356977Sshin#else 3444743Smarkm syslog(deny_severity, "refused connect from %s", eval_client(request)); 3556977Sshin#endif 3644743Smarkm clean_exit(request); 3744743Smarkm /* NOTREACHED */ 3844743Smarkm} 3944743Smarkm 40