summaryrefslogtreecommitdiff
path: root/xutils.c
diff options
context:
space:
mode:
authorDaniel Borkmann <dborkman@redhat.com>2013-06-04 11:55:28 +0200
committerDaniel Borkmann <dborkman@redhat.com>2013-06-04 11:55:28 +0200
commit83ef345503943cc6f7c2f02381f71113601e8261 (patch)
treec86227397301650996a2b2db5d4b75b8ad33f7d1 /xutils.c
parent7bd73747fff54cf51642dbbf042c621e59a2c005 (diff)
xutils: eliminate xutils, move rest to epoll2
Finally eliminate xutils.{c,h} and move the rest to epoll2. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Diffstat (limited to 'xutils.c')
-rw-r--r--xutils.c73
1 files changed, 0 insertions, 73 deletions
diff --git a/xutils.c b/xutils.c
deleted file mode 100644
index 56b4c59..0000000
--- a/xutils.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * netsniff-ng - the packet sniffing beast
- * Copyright 2009, 2010 Daniel Borkmann.
- * Copyright 2009, 2010 Emmanuel Roullit.
- * Subject to the GPL, version 2.
- */
-
-#define _GNU_SOURCE
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <fcntl.h>
-#include <string.h>
-#include <unistd.h>
-#include <errno.h>
-#include <stdarg.h>
-#include <ctype.h>
-#include <signal.h>
-#include <arpa/inet.h>
-#include <time.h>
-#include <sched.h>
-#include <limits.h>
-#include <stdbool.h>
-#include <netdb.h>
-#include <ifaddrs.h>
-#include <sys/time.h>
-#include <sys/socket.h>
-#include <sys/ioctl.h>
-#include <sys/mman.h>
-#include <sys/resource.h>
-#include <sys/epoll.h>
-#include <sys/syscall.h>
-#include <asm/unistd.h>
-#include <linux/if.h>
-#include <linux/socket.h>
-#include <linux/types.h>
-#include <linux/if_ether.h>
-#include <linux/if_packet.h>
-#include <linux/sockios.h>
-#include <netinet/tcp.h>
-#include <netinet/udp.h>
-
-#include "die.h"
-#include "str.h"
-#include "xutils.h"
-#include "ring.h"
-#include "sock.h"
-#include "built_in.h"
-
-void set_epoll_descriptor(int fd_epoll, int action, int fd_toadd, int events)
-{
- int ret;
- struct epoll_event ev;
-
- memset(&ev, 0, sizeof(ev));
- ev.events = events;
- ev.data.fd = fd_toadd;
-
- ret = epoll_ctl(fd_epoll, action, fd_toadd, &ev);
- if (ret < 0)
- panic("Cannot add socket for epoll!\n");
-}
-
-int set_epoll_descriptor2(int fd_epoll, int action, int fd_toadd, int events)
-{
- struct epoll_event ev;
-
- memset(&ev, 0, sizeof(ev));
- ev.events = events;
- ev.data.fd = fd_toadd;
-
- return epoll_ctl(fd_epoll, action, fd_toadd, &ev);
-}