From 0278351a9b9208272449ce4d875e265f6a54aee5 Mon Sep 17 00:00:00 2001 From: Jozsef Kadlecsik Date: Thu, 22 Apr 2010 16:42:58 +0200 Subject: First staget to ipset-5 Create src/ and move ipset source there. Get rid of unnecessary and outdated files. --- libipt_set.h | 45 --------------------------------------------- 1 file changed, 45 deletions(-) delete mode 100644 libipt_set.h (limited to 'libipt_set.h') 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 -#include -#include - -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*/ -- cgit v1.2.3