summaryrefslogtreecommitdiffstats
path: root/contrib/ipfilter/ipsend/sockraw.c
diff options
context:
space:
mode:
authorcy <cy@FreeBSD.org>2013-07-19 05:41:57 +0000
committercy <cy@FreeBSD.org>2013-07-19 05:41:57 +0000
commit672af8808c0e7c15f330b401482f9271c2eb3fa6 (patch)
tree225b5acf68c01bc6a260b386c2b2dbf4fa2839e3 /contrib/ipfilter/ipsend/sockraw.c
parent71e82d94e82560b20789833f60056506de34de8b (diff)
downloadFreeBSD-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/sockraw.c')
-rw-r--r--contrib/ipfilter/ipsend/sockraw.c87
1 files changed, 0 insertions, 87 deletions
diff --git a/contrib/ipfilter/ipsend/sockraw.c b/contrib/ipfilter/ipsend/sockraw.c
deleted file mode 100644
index 0e3fe59..0000000
--- a/contrib/ipfilter/ipsend/sockraw.c
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * (C)opyright 2000 Darren Reed.
- *
- * See the IPFILTER.LICENCE file for details on licencing.
- *
- * WARNING: Attempting to use this .c file on HP-UX 11.00 will cause the
- * system to crash.
- */
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/ioctl.h>
-
-#include <net/if.h>
-#include <netinet/in.h>
-#include <netinet/in_systm.h>
-#include <netinet/ip.h>
-#include <netinet/if_ether.h>
-#include <netinet/ip_var.h>
-#include <netinet/udp.h>
-#include <netinet/udp_var.h>
-#include <netinet/tcp.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <errno.h>
-#include "ipsend.h"
-
-#if !defined(lint) && defined(LIBC_SCCS)
-static char sirix[] = "@(#)sirix.c 1.0 10/9/97 (C)1997 Marc Boucher";
-#endif
-
-
-int initdevice(char *device, int tout)
-{
- struct sockaddr s;
- struct ifreq ifr;
- int fd;
-
- memset(&ifr, 0, sizeof(ifr));
- strncpy(ifr.ifr_name, device, sizeof ifr.ifr_name);
-
- if ((fd = socket(AF_INET, SOCK_RAW, IPPROTO_RAW)) < 0)
- {
- perror("socket(AF_INET, SOCK_RAW, IPPROTO_RAW)");
- return -1;
- }
-
- if (ioctl(fd, SIOCGIFADDR, &ifr) == -1)
- {
- perror("ioctl SIOCGIFADDR");
- return -1;
- }
-
- bzero((char *)&s, sizeof(s));
- s.sa_family = AF_INET;
- bcopy(&ifr.ifr_addr, s.sa_data, 4);
- if (bind(fd, &s, sizeof(s)) == -1)
- perror("bind");
- return fd;
-}
-
-
-/*
- * output an IP packet
- */
-int sendip(int fd, char *pkt, int len)
-{
- struct ether_header *eh;
- struct sockaddr_in sin;
-
- eh = (struct ether_header *)pkt;
- bzero((char *)&sin, sizeof(sin));
- sin.sin_family = AF_INET;
- pkt += 14;
- len -= 14;
- bcopy(pkt + 12, (char *)&sin.sin_addr, 4);
-
- if (sendto(fd, pkt, len, 0, &sin, sizeof(sin)) == -1)
- {
- perror("send");
- return -1;
- }
-
- return len;
-}
OpenPOWER on IntegriCloud