]> granicus.if.org Git - ipset/commitdiff
First staget to ipset-5
authorJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Thu, 22 Apr 2010 14:42:58 +0000 (16:42 +0200)
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Thu, 22 Apr 2010 14:42:58 +0000 (16:42 +0200)
Create src/ and move ipset source there. Get rid of unnecessary and
outdated files.

17 files changed:
Makefile [deleted file]
TODO [deleted file]
libipt_set.h [deleted file]
src/ipset.8 [moved from ipset.8 with 100% similarity]
src/ipset.c [moved from ipset.c with 100% similarity]
src/ipset.h [moved from ipset.h with 100% similarity]
src/ipset_iphash.c [moved from ipset_iphash.c with 100% similarity]
src/ipset_ipmap.c [moved from ipset_ipmap.c with 100% similarity]
src/ipset_ipporthash.c [moved from ipset_ipporthash.c with 100% similarity]
src/ipset_ipportiphash.c [moved from ipset_ipportiphash.c with 100% similarity]
src/ipset_ipportnethash.c [moved from ipset_ipportnethash.c with 100% similarity]
src/ipset_iptree.c [moved from ipset_iptree.c with 100% similarity]
src/ipset_iptreemap.c [moved from ipset_iptreemap.c with 100% similarity]
src/ipset_macipmap.c [moved from ipset_macipmap.c with 100% similarity]
src/ipset_nethash.c [moved from ipset_nethash.c with 100% similarity]
src/ipset_portmap.c [moved from ipset_portmap.c with 100% similarity]
src/ipset_setlist.c [moved from ipset_setlist.c with 100% similarity]

diff --git a/Makefile b/Makefile
deleted file mode 100644 (file)
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 (file)
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 (file)
index 771a0fe..0000000
+++ /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*/
similarity index 100%
rename from ipset.8
rename to src/ipset.8
similarity index 100%
rename from ipset.c
rename to src/ipset.c
similarity index 100%
rename from ipset.h
rename to src/ipset.h
similarity index 100%
rename from ipset_iphash.c
rename to src/ipset_iphash.c
similarity index 100%
rename from ipset_ipmap.c
rename to src/ipset_ipmap.c
similarity index 100%
rename from ipset_ipporthash.c
rename to src/ipset_ipporthash.c
similarity index 100%
rename from ipset_iptree.c
rename to src/ipset_iptree.c
similarity index 100%
rename from ipset_iptreemap.c
rename to src/ipset_iptreemap.c
similarity index 100%
rename from ipset_macipmap.c
rename to src/ipset_macipmap.c
similarity index 100%
rename from ipset_nethash.c
rename to src/ipset_nethash.c
similarity index 100%
rename from ipset_portmap.c
rename to src/ipset_portmap.c
similarity index 100%
rename from ipset_setlist.c
rename to src/ipset_setlist.c