summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJozsef Kadlecsik <kadlec@blackhole.kfki.hu>2010-04-22 16:42:58 +0200
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>2010-04-22 16:42:58 +0200
commit0278351a9b9208272449ce4d875e265f6a54aee5 (patch)
tree0ad039c2f4b6310a06fae8124485176114d81a5e
parent584e8d0604a55fcda68848bef82a2954d8af71f5 (diff)
First staget to ipset-5
Create src/ and move ipset source there. Get rid of unnecessary and outdated files.
-rw-r--r--Makefile139
-rw-r--r--TODO2
-rw-r--r--libipt_set.h45
-rw-r--r--src/ipset.8 (renamed from ipset.8)0
-rw-r--r--src/ipset.c (renamed from ipset.c)0
-rw-r--r--src/ipset.h (renamed from ipset.h)0
-rw-r--r--src/ipset_iphash.c (renamed from ipset_iphash.c)0
-rw-r--r--src/ipset_ipmap.c (renamed from ipset_ipmap.c)0
-rw-r--r--src/ipset_ipporthash.c (renamed from ipset_ipporthash.c)0
-rw-r--r--src/ipset_ipportiphash.c (renamed from ipset_ipportiphash.c)0
-rw-r--r--src/ipset_ipportnethash.c (renamed from ipset_ipportnethash.c)0
-rw-r--r--src/ipset_iptree.c (renamed from ipset_iptree.c)0
-rw-r--r--src/ipset_iptreemap.c (renamed from ipset_iptreemap.c)0
-rw-r--r--src/ipset_macipmap.c (renamed from ipset_macipmap.c)0
-rw-r--r--src/ipset_nethash.c (renamed from ipset_nethash.c)0
-rw-r--r--src/ipset_portmap.c (renamed from ipset_portmap.c)0
-rw-r--r--src/ipset_setlist.c (renamed from ipset_setlist.c)0
17 files changed, 0 insertions, 186 deletions
diff --git a/Makefile b/Makefile
deleted file mode 100644
index bbec449..0000000
--- a/Makefile
+++ /dev/null
@@ -1,139 +0,0 @@
-#!/usr/bin/make
-
-######################################################################
-# YOU SHOULD NOT NEED TO TOUCH ANYTHING BELOW THIS LINE
-######################################################################
-
-ifndef KERNEL_DIR
-KERNEL_DIR=/lib/modules/`uname -r`/build
-endif
-ifndef KBUILD_OUTPUT
-KBUILD_OUTPUT=$(KERNEL_DIR)
-endif
-ifndef IP_NF_SET_MAX
-IP_NF_SET_MAX=256
-endif
-ifndef IP_NF_SET_HASHSIZE
-IP_NF_SET_HASHSIZE=1024
-endif
-ifndef V
-V=0
-endif
-
-IPSET_VERSION:=4.2
-
-PREFIX:=/usr/local
-LIBDIR:=$(PREFIX)/lib
-BINDIR:=$(PREFIX)/sbin
-MANDIR:=$(PREFIX)/man
-INCDIR:=$(PREFIX)/include
-IPSET_LIB_DIR:=$(LIBDIR)/ipset
-
-# directory for new iptables releases
-RELEASE_DIR:=/tmp
-
-COPT_FLAGS:=-O2
-WARN_FLAGS:=-Wall
-EXTRA_WARN_FLAGS:=\
- -Wextra \
- -Waggregate-return \
- -Wbad-function-cast \
- -Wcast-align \
- -Wformat=2 \
- -Wfloat-equal \
- -Winit-self \
- -Winline \
- -Wmissing-declarations \
- -Wmissing-prototypes \
- -Wnested-externs \
- -Wold-style-definition \
- -Wpacked \
- -Wredundant-decls \
- -Wshadow \
- -Wsign-compare \
- -Wstrict-prototypes \
- -Wswitch-default \
- -Wswitch-enum \
- -Wundef \
- -Wwrite-strings \
- -Wno-missing-field-initializers \
- -Werror
-
-ifndef NO_EXTRA_WARN_FLAGS
- WARN_FLAGS+=$(EXTRA_WARN_FLAGS)
-endif
-
-ABI_FLAGS:=
-CFLAGS:=$(ABI_FLAGS) $(COPT_FLAGS) $(WARN_FLAGS) -Ikernel/include -I. # -g -DIPSET_DEBUG
-SH_CFLAGS:=$(CFLAGS) -fPIC
-LDFLAGS:=$(ABI_FLAGS)
-SETTYPES:=ipmap portmap macipmap
-SETTYPES+=iptree iptreemap
-SETTYPES+=iphash nethash ipporthash ipportiphash ipportnethash
-SETTYPES+=setlist
-
-PROGRAMS=ipset
-SHARED_LIBS=$(foreach T, $(SETTYPES),libipset_$(T).so)
-INSTALL=$(DESTDIR)$(BINDIR)/ipset $(DESTDIR)$(MANDIR)/man8/ipset.8
-INSTALL+=$(foreach T, $(SETTYPES), $(DESTDIR)$(LIBDIR)/ipset/libipset_$(T).so)
-
-all: binaries modules
-
-.PHONY: tests
-
-tests:
- cd tests; ./runtest.sh
-
-binaries: $(PROGRAMS) $(SHARED_LIBS)
-
-binaries_install: binaries $(INSTALL)
-
-patch_kernel:
- cd kernel; ./patch_kernel $(KERNEL_DIR)
-
-modules:
- @[ ! -f $(KERNEL_DIR)/net/ipv4/netfilter/Config.in ] || (echo "Error: The directory '$(KERNEL_DIR)' looks like a Linux 2.4.x kernel source tree, you have to patch it by 'make patch_kernel'." && exit 1)
- @[ -f $(KERNEL_DIR)/net/ipv4/netfilter/Kconfig ] || (echo "Error: The directory '$(KERNEL_DIR)' doesn't look like a Linux 2.6.x kernel source tree." && exit 1)
- @[ -f $(KBUILD_OUTPUT)/.config ] || (echo "Error: The kernel source in '$(KERNEL_DIR)' must be configured" && exit 1)
- @[ -f $(KBUILD_OUTPUT)/Module.symvers ] || echo "Warning: You should run 'make modules' in '$(KERNEL_DIR)' beforehand"
- cd kernel; make -C $(KBUILD_OUTPUT) M=`pwd` V=$V IP_NF_SET_MAX=$(IP_NF_SET_MAX) IP_NF_SET_HASHSIZE=$(IP_NF_SET_HASHSIZE) modules
-
-modules_install: modules
- cd kernel; make -C $(KBUILD_OUTPUT) M=`pwd` modules_install
-
-install: binaries_install modules_install
-
-clean: $(EXTRA_CLEANS)
- rm -rf $(PROGRAMS) $(SHARED_LIBS) *.o *~ tests/*~
- [ -f $(KERNEL_DIR)/net/ipv4/netfilter/Config.in ] || (cd kernel; make -C $(KERNEL_DIR) M=`pwd` clean)
-
-release: clean
- cp -a . /tmp/ipset-$(IPSET_VERSION)
- tar cjf ../ipset-$(IPSET_VERSION).tar.bz2 -C /tmp --exclude=.git ipset-$(IPSET_VERSION)
- rm -rf /tmp/ipset-$(IPSET_VERSION)
-
-#The ipset(8) self
-ipset.o: ipset.c ipset.h
- $(CC) $(CFLAGS) -DIPSET_VERSION=\"$(IPSET_VERSION)\" -DIPSET_LIB_DIR=\"$(IPSET_LIB_DIR)\" -c -o $@ $<
-
-ipset: ipset.o
- $(CC) $(CFLAGS) $(LDFLAGS) -rdynamic -o $@ $^ -ldl
-
-#Pooltypes
-ipset_%.o: ipset_%.c ipset.h
- $(CC) $(SH_CFLAGS) -o $@ -c $<
-
-libipset_%.so: ipset_%.o
- $(CC) -shared $(LDFLAGS) -o $@ $<
-
-$(DESTDIR)$(LIBDIR)/ipset/libipset_%.so: libipset_%.so
- @[ -d $(DESTDIR)$(LIBDIR)/ipset ] || mkdir -p $(DESTDIR)$(LIBDIR)/ipset
- cp $< $@
-
-$(DESTDIR)$(BINDIR)/ipset: ipset
- @[ -d $(DESTDIR)$(BINDIR) ] || mkdir -p $(DESTDIR)$(BINDIR)
- cp $< $@
-
-$(DESTDIR)$(MANDIR)/man8/ipset.8: ipset.8
- @[ -d $(DESTDIR)$(MANDIR)/man8 ] || mkdir -p $(DESTDIR)$(MANDIR)/man8
- cp $< $@
diff --git a/TODO b/TODO
deleted file mode 100644
index 9d46233..0000000
--- a/TODO
+++ /dev/null
@@ -1,2 +0,0 @@
-- rewrite kernel-userspace communication from sockopt to netlink
-- IPv6 support
diff --git a/libipt_set.h b/libipt_set.h
deleted file mode 100644
index 771a0fe..0000000
--- a/libipt_set.h
+++ /dev/null
@@ -1,45 +0,0 @@
-#ifndef _LIBIPT_SET_H
-#define _LIBIPT_SET_H
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <errno.h>
-
-static int get_set_getsockopt(void *data, size_t * size)
-{
- int sockfd = -1;
- sockfd = socket(AF_INET, SOCK_RAW, IPPROTO_RAW);
- if (sockfd < 0)
- exit_error(OTHER_PROBLEM,
- "Can't open socket to ipset.\n");
- /* Send! */
- return getsockopt(sockfd, SOL_IP, SO_IP_SET, data, size);
-}
-
-static void
-parse_bindings(const char *optarg, struct ipt_set_info *info)
-{
- char *saved = strdup(optarg);
- char *ptr, *tmp = saved;
- int i = 0;
-
- while (i < IP_SET_MAX_BINDINGS && tmp != NULL) {
- ptr = strsep(&tmp, ",");
- if (strncmp(ptr, "src", 3) == 0)
- info->flags[i++] |= IPSET_SRC;
- else if (strncmp(ptr, "dst", 3) == 0)
- info->flags[i++] |= IPSET_DST;
- else
- exit_error(PARAMETER_PROBLEM,
- "You must spefify (the comma separated list of) 'src' or 'dst'.");
- }
-
- if (tmp)
- exit_error(PARAMETER_PROBLEM,
- "Can't follow bindings deeper than %d.",
- IP_SET_MAX_BINDINGS);
-
- free(saved);
-}
-
-#endif /*_LIBIPT_SET_H*/
diff --git a/ipset.8 b/src/ipset.8
index fa73298..fa73298 100644
--- a/ipset.8
+++ b/src/ipset.8
diff --git a/ipset.c b/src/ipset.c
index 3b8e248..3b8e248 100644
--- a/ipset.c
+++ b/src/ipset.c
diff --git a/ipset.h b/src/ipset.h
index c49418d..c49418d 100644
--- a/ipset.h
+++ b/src/ipset.h
diff --git a/ipset_iphash.c b/src/ipset_iphash.c
index 0bc5bd1..0bc5bd1 100644
--- a/ipset_iphash.c
+++ b/src/ipset_iphash.c
diff --git a/ipset_ipmap.c b/src/ipset_ipmap.c
index 87b8e69..87b8e69 100644
--- a/ipset_ipmap.c
+++ b/src/ipset_ipmap.c
diff --git a/ipset_ipporthash.c b/src/ipset_ipporthash.c
index 9249b2a..9249b2a 100644
--- a/ipset_ipporthash.c
+++ b/src/ipset_ipporthash.c
diff --git a/ipset_ipportiphash.c b/src/ipset_ipportiphash.c
index 49861bf..49861bf 100644
--- a/ipset_ipportiphash.c
+++ b/src/ipset_ipportiphash.c
diff --git a/ipset_ipportnethash.c b/src/ipset_ipportnethash.c
index 3a60bf1..3a60bf1 100644
--- a/ipset_ipportnethash.c
+++ b/src/ipset_ipportnethash.c
diff --git a/ipset_iptree.c b/src/ipset_iptree.c
index 508e67a..508e67a 100644
--- a/ipset_iptree.c
+++ b/src/ipset_iptree.c
diff --git a/ipset_iptreemap.c b/src/ipset_iptreemap.c
index 22bdcb3..22bdcb3 100644
--- a/ipset_iptreemap.c
+++ b/src/ipset_iptreemap.c
diff --git a/ipset_macipmap.c b/src/ipset_macipmap.c
index fb97cae..fb97cae 100644
--- a/ipset_macipmap.c
+++ b/src/ipset_macipmap.c
diff --git a/ipset_nethash.c b/src/ipset_nethash.c
index c7891cf..c7891cf 100644
--- a/ipset_nethash.c
+++ b/src/ipset_nethash.c
diff --git a/ipset_portmap.c b/src/ipset_portmap.c
index a1065ae..a1065ae 100644
--- a/ipset_portmap.c
+++ b/src/ipset_portmap.c
diff --git a/ipset_setlist.c b/src/ipset_setlist.c
index de16c44..de16c44 100644
--- a/ipset_setlist.c
+++ b/src/ipset_setlist.c