diff options
author | cy <cy@FreeBSD.org> | 2013-07-19 05:41:57 +0000 |
---|---|---|
committer | cy <cy@FreeBSD.org> | 2013-07-19 05:41:57 +0000 |
commit | 672af8808c0e7c15f330b401482f9271c2eb3fa6 (patch) | |
tree | 225b5acf68c01bc6a260b386c2b2dbf4fa2839e3 /contrib/ipfilter/ipsend/slinux.c | |
parent | 71e82d94e82560b20789833f60056506de34de8b (diff) | |
download | FreeBSD-src-672af8808c0e7c15f330b401482f9271c2eb3fa6.zip FreeBSD-src-672af8808c0e7c15f330b401482f9271c2eb3fa6.tar.gz |
As per the developers handbook (5.3.1 step 1), prepare the vendor trees for
import of new ipfilter vendor sources by flattening them.
To keep the tags consistent with dist, the tags are also flattened.
Approved by: glebius (Mentor)
Diffstat (limited to 'contrib/ipfilter/ipsend/slinux.c')
-rw-r--r-- | contrib/ipfilter/ipsend/slinux.c | 90 |
1 files changed, 0 insertions, 90 deletions
diff --git a/contrib/ipfilter/ipsend/slinux.c b/contrib/ipfilter/ipsend/slinux.c deleted file mode 100644 index 7c362b6..0000000 --- a/contrib/ipfilter/ipsend/slinux.c +++ /dev/null @@ -1,90 +0,0 @@ -/* - * (C)opyright 1992-1998 Darren Reed. (from tcplog) - * - * See the IPFILTER.LICENCE file for details on licencing. - * - */ - -#include <stdio.h> -#include <string.h> -#include <netdb.h> -#include <ctype.h> -#include <signal.h> -#include <errno.h> -#include <sys/types.h> -#include <sys/time.h> -#include <sys/timeb.h> -#include <sys/socket.h> -#include <sys/file.h> -#include <sys/ioctl.h> -#include <sys/dir.h> -#include <linux/netdevice.h> -#include <net/if.h> -#include <netinet/in.h> -#include <netinet/in_systm.h> -#include <netinet/ip.h> -#include <netinet/tcp.h> -#include "ipsend.h" - -#if !defined(lint) -static const char sccsid[] = "@(#)slinux.c 1.2 8/25/95"; -static const char rcsid[] = "@(#)$Id: slinux.c,v 2.3 2001/06/09 17:09:26 darrenr Exp $"; -#endif - -#define CHUNKSIZE 8192 -#define BUFSPACE (4*CHUNKSIZE) - -/* - * Be careful to only include those defined in the flags option for the - * interface are included in the header size. - */ - -static int timeout; -static char *eth_dev = NULL; - - -int initdevice(dev, spare) -char *dev; -int spare; -{ - int fd; - - eth_dev = strdup(dev); - if ((fd = socket(AF_INET, SOCK_PACKET, htons(ETHERTYPE_IP))) == -1) - { - perror("socket(SOCK_PACKET)"); - exit(-1); - } - - return fd; -} - - -/* - * output an IP packet onto a fd opened for /dev/nit - */ -int sendip(fd, pkt, len) -int fd, len; -char *pkt; -{ - struct sockaddr s; - struct ifreq ifr; - - strncpy(ifr.ifr_name, eth_dev, sizeof(ifr.ifr_name)); - if (ioctl(fd, SIOCGIFHWADDR, &ifr) == -1) - { - perror("SIOCGIFHWADDR"); - return -1; - } - bcopy(ifr.ifr_hwaddr.sa_data, pkt + 6, 6); - s.sa_family = ETHERTYPE_IP; - strncpy(s.sa_data, eth_dev, sizeof(s.sa_data)); - - if (sendto(fd, pkt, len, 0, &s, sizeof(s)) == -1) - { - perror("send"); - return -1; - } - - return len; -} |