17c478bd9Sstevel@tonic-gate /* 27c478bd9Sstevel@tonic-gate * Copyright 2001 Sun Microsystems, Inc. All rights reserved. 37c478bd9Sstevel@tonic-gate * Use is subject to license terms. 47c478bd9Sstevel@tonic-gate */ 57c478bd9Sstevel@tonic-gate 67c478bd9Sstevel@tonic-gate /* 77c478bd9Sstevel@tonic-gate * refuse() reports a refused connection, and takes the consequences: in 87c478bd9Sstevel@tonic-gate * case of a datagram-oriented service, the unread datagram is taken from 97c478bd9Sstevel@tonic-gate * the input queue (or inetd would see the same datagram again and again); 107c478bd9Sstevel@tonic-gate * the program is terminated. 11*1da57d55SToomas Soome * 127c478bd9Sstevel@tonic-gate * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands. 137c478bd9Sstevel@tonic-gate */ 147c478bd9Sstevel@tonic-gate 157c478bd9Sstevel@tonic-gate #ifndef lint 167c478bd9Sstevel@tonic-gate static char sccsid[] = "@(#) refuse.c 1.5 94/12/28 17:42:39"; 177c478bd9Sstevel@tonic-gate #endif 187c478bd9Sstevel@tonic-gate 197c478bd9Sstevel@tonic-gate /* System libraries. */ 207c478bd9Sstevel@tonic-gate 217c478bd9Sstevel@tonic-gate #include <stdio.h> 227c478bd9Sstevel@tonic-gate #include <syslog.h> 237c478bd9Sstevel@tonic-gate 247c478bd9Sstevel@tonic-gate /* Local stuff. */ 257c478bd9Sstevel@tonic-gate 267c478bd9Sstevel@tonic-gate #include "tcpd.h" 277c478bd9Sstevel@tonic-gate 287c478bd9Sstevel@tonic-gate /* refuse - refuse request */ 297c478bd9Sstevel@tonic-gate refuse(request)307c478bd9Sstevel@tonic-gatevoid refuse(request) 317c478bd9Sstevel@tonic-gate struct request_info *request; 327c478bd9Sstevel@tonic-gate { 337c478bd9Sstevel@tonic-gate syslog(deny_severity, "refused connect from %s", eval_client(request)); 347c478bd9Sstevel@tonic-gate clean_exit(request); 357c478bd9Sstevel@tonic-gate /* NOTREACHED */ 367c478bd9Sstevel@tonic-gate } 377c478bd9Sstevel@tonic-gate 38