1/* 2 * (C)opyright 1992-1998 Darren Reed. (from tcplog) 3 * |
4 * See the IPFILTER.LICENCE file for details on licencing. |
5 */ 6 7#include <stdio.h> 8#include <netdb.h> 9#include <ctype.h> 10#include <fcntl.h> 11#include <signal.h> 12#include <errno.h> --- 20 unchanged lines hidden (view full) --- 33#include <netinet/udp.h> 34#include <netinet/udp_var.h> 35#include <netinet/tcp.h> 36 37#include "ipsend.h" 38 39#if !defined(lint) 40static const char sccsid[] = "@(#)sdlpi.c 1.3 10/30/95 (C)1995 Darren Reed"; |
41static const char rcsid[] = "@(#)$Id: sdlpi.c,v 2.1.4.2 2001/06/26 10:43:22 darrenr Exp $"; |
42#endif 43 44#define CHUNKSIZE 8192 45#define BUFSPACE (4*CHUNKSIZE) 46 47 48/* 49 * Be careful to only include those defined in the flags option for the 50 * interface are included in the header size. 51 */ 52int initdevice(device, sport, tout) 53char *device; 54int sport, tout; 55{ 56 char devname[16], *s, buf[256]; 57 int i, fd; 58 |
59 (void) strcpy(devname, "/dev/"); 60 (void) strncat(devname, device, sizeof(devname) - strlen(devname)); |
61 62 s = devname + 5; 63 while (*s && !isdigit(*s)) 64 s++; 65 if (!*s) 66 { 67 fprintf(stderr, "bad device name %s\n", devname); 68 exit(-1); --- 64 unchanged lines hidden --- |