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