]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
Makefile fixes for release. v1.0.0-alpha
authorRusty Russell <rusty@linuxcare.com.au>
Mon, 20 Mar 2000 07:03:28 +0000 (07:03 +0000)
committerRusty Russell <rusty@rustcorp.com.au>
Mon, 20 Mar 2000 07:03:28 +0000 (07:03 +0000)
Whitespace cleanups.

13 files changed:
Rules.make
extensions/libipt_LOG.c
extensions/libipt_MARK.c
extensions/libipt_REJECT.c
extensions/libipt_TOS.c
extensions/libipt_limit.c
extensions/libipt_mark.c
extensions/libipt_tos.c
iptables-restore.c
iptables-save.c
iptables.c
libipq/libipq.c
libiptc/libiptc.c

index b90866d5f43c986ae78f77b533019119821d6a06..1623c46f379cf7eb9302eb684b4d21e5f6f7b2a9 100644 (file)
@@ -25,10 +25,10 @@ $(SHARED_LIBS): %.so : %_sh.o
 %_sh.o : %.c
        $(CC) $(SH_CFLAGS) -o $@ -c $<
 
-distrib: nowhitespace distclean delrelease /home/public/netfilter/netfilter-$(NETFILTER_VERSION).tar.bz2 #diff md5sums
+distrib: nowhitespace distclean delrelease /home/public/netfilter/iptables-$(NETFILTER_VERSION).tar.bz2 #diff md5sums
 
 delrelease:
-       rm -f /home/public/netfilter/netfilter-$(NETFILTER_VERSION).tar.bz2
+       rm -f /home/public/netfilter/iptables-$(NETFILTER_VERSION).tar.bz2
 
 distclean: clean
        @rm -f TAGS `find . -name '*~' -o -name '*.[do]' -o -name '*.rej'` .makefirst
@@ -36,17 +36,17 @@ distclean: clean
 nowhitespace:
        @if grep -n '[   ]$$' `find . -name 'Makefile' -o -name '*.[ch]'`; then exit 1; else exit 0; fi
 
-/home/public/netfilter/netfilter-$(NETFILTER_VERSION).tar.bz2:
-       cd .. && ln -sfn netfilter netfilter-$(NETFILTER_VERSION) && tar cvf - --exclude install-kernel --exclude transfer --exclude netfilter-$(NETFILTER_VERSION)/bugs --exclude CVS --exclude .depend --exclude netfilter-$(NETFILTER_VERSION)/./NAT/userspace/.depend --exclude netfilter-$(NETFILTER_VERSION)/linux-netfilter netfilter-$(NETFILTER_VERSION)/. | bzip2 -9 > $@ && rm netfilter-$(NETFILTER_VERSION)
+/home/public/netfilter/iptables-$(NETFILTER_VERSION).tar.bz2:
+       cd .. && ln -sfn userspace iptables-$(NETFILTER_VERSION) && tar cvf - --exclude install-kernel --exclude transfer --exclude iptables-$(NETFILTER_VERSION)/bugs --exclude CVS --exclude .depend iptables-$(NETFILTER_VERSION)/. | bzip2 -9 > $@ && rm iptables-$(NETFILTER_VERSION)
 
-diff: /home/public/netfilter/netfilter-$(NETFILTER_VERSION).tar.bz2
+diff: /home/public/netfilter/iptables-$(NETFILTER_VERSION).tar.bz2
        @mkdir /tmp/diffdir
-       @cd /tmp/diffdir && tar xfI /home/public/netfilter/netfilter-$(NETFILTER_VERSION).tar.bz2
-       @set -e; cd /tmp/diffdir; tar xfI /home/public/netfilter/netfilter-$(OLD_NETFILTER_VERSION).tar.bz2; echo Creating patch-netfilter-$(OLD_NETFILTER_VERSION)-$(NETFILTER_VERSION).bz2; diff -urN netfilter-$(OLD_NETFILTER_VERSION) netfilter-$(NETFILTER_VERSION) | bzip2 -9 > /home/public/netfilter/patch-netfilter-$(OLD_NETFILTER_VERSION)-$(NETFILTER_VERSION).bz2
+       @cd /tmp/diffdir && tar xfI /home/public/netfilter/iptables-$(NETFILTER_VERSION).tar.bz2
+       @set -e; cd /tmp/diffdir; tar xfI /home/public/netfilter/iptables-$(OLD_NETFILTER_VERSION).tar.bz2; echo Creating patch-iptables-$(OLD_NETFILTER_VERSION)-$(NETFILTER_VERSION).bz2; diff -urN iptables-$(OLD_NETFILTER_VERSION) iptables-$(NETFILTER_VERSION) | bzip2 -9 > /home/public/netfilter/patch-iptables-$(OLD_NETFILTER_VERSION)-$(NETFILTER_VERSION).bz2
        @rm -rf /tmp/diffdir
 
 md5sums:
-       cd /home/public/netfilter/ && md5sum patch-netfilter-*-$(NETFILTER_VERSION).bz2 netfilter-$(NETFILTER_VERSION).tar.bz2
+       cd /home/public/netfilter/ && md5sum patch-iptables-*-$(NETFILTER_VERSION).bz2 iptables-$(NETFILTER_VERSION).tar.bz2
 
 .makefirst:
        @echo Making dependencies: please wait...
index cab5739d8a181a8157a47072fde9ed09000947bc..ce4adb230eb13a9c15263a94bfb420cf09befbb0 100644 (file)
@@ -113,7 +113,7 @@ parse(int c, char **argv, int invert, unsigned int *flags,
                if (*flags & IPT_LOG_OPT_LEVEL)
                        exit_error(PARAMETER_PROBLEM,
                                   "Can't specify --log-level twice");
-                       
+
                if (check_inverse(optarg, &invert))
                        exit_error(PARAMETER_PROBLEM,
                                   "Unexpected `!' after --log-level");
@@ -126,7 +126,7 @@ parse(int c, char **argv, int invert, unsigned int *flags,
                if (*flags & IPT_LOG_OPT_PREFIX)
                        exit_error(PARAMETER_PROBLEM,
                                   "Can't specify --log-prefix twice");
-                       
+
                if (check_inverse(optarg, &invert))
                        exit_error(PARAMETER_PROBLEM,
                                   "Unexpected `!' after --log-prefix");
index ef5a60d55ab96645d4170d935f8c54e7535f0863..a7cb60c09ed4a13cba9d4f13f72dd74c7a4f9193 100644 (file)
@@ -56,7 +56,7 @@ parse(int c, char **argv, int invert, unsigned int *flags,
                                   "MARK target: Can't specify --set-mark twice");
                *flags = 1;
                break;
-               
+
        default:
                return 0;
        }
@@ -87,7 +87,7 @@ print(const struct ipt_ip *ip,
        const struct ipt_mark_target_info *markinfo =
                (const struct ipt_mark_target_info *)target->data;
        printf("MARK set ");
-       print_mark(markinfo->mark, numeric);    
+       print_mark(markinfo->mark, numeric);
 }
 
 /* Saves the union ipt_targinfo in parsable form to stdout. */
@@ -96,8 +96,8 @@ save(const struct ipt_ip *ip, const struct ipt_entry_target *target)
 {
        const struct ipt_mark_target_info *markinfo =
                (const struct ipt_mark_target_info *)target->data;
-       
-       printf("--set-mark 0x%lx ", markinfo->mark);    
+
+       printf("--set-mark 0x%lx ", markinfo->mark);
 }
 
 struct iptables_target mark
index e33658733bf5b8a223a5667ce9223bacd6b06462..f174c6a3a5e54365dfbd672a975b5155ac3ae09c 100644 (file)
@@ -18,7 +18,7 @@ struct reject_names {
 };
 
 static const struct reject_names reject_table[] = {
-       {"icmp-net-unreachable", "net-unreach", 
+       {"icmp-net-unreachable", "net-unreach",
                IPT_ICMP_NET_UNREACHABLE, "ICMP network unreachable"},
        {"icmp-host-unreachable", "host-unreach",
                IPT_ICMP_HOST_UNREACHABLE, "ICMP host unreachable"},
@@ -26,17 +26,17 @@ static const struct reject_names reject_table[] = {
                IPT_ICMP_PORT_UNREACHABLE, "ICMP port unreachable (default)"},
        {"icmp-proto-unreachable", "proto-unreach",
                IPT_ICMP_PROT_UNREACHABLE, "ICMP protocol unreachable"},
-       {"tcp-reset", "rst", 
+       {"tcp-reset", "rst",
                IPT_TCP_RESET, "for TCP only: faked TCP RST"},
        {"echo-reply", "echoreply",
                IPT_ICMP_ECHOREPLY, "for ICMP echo only: faked ICMP echo reply"},
 };
 
-static void 
+static void
 print_reject_types()
 {
        unsigned int i;
-       
+
        printf("Valid reject types:\n");
 
        for (i = 0; i < sizeof(reject_table)/sizeof(struct reject_names); i++) {
@@ -49,7 +49,7 @@ print_reject_types()
 /* Saves the union ipt_targinfo in parsable form to stdout. */
 
 /* Function which prints out usage message. */
-static void 
+static void
 help(void)
 {
        printf(
@@ -70,10 +70,10 @@ static void
 init(struct ipt_entry_target *t, unsigned int *nfcache)
 {
        struct ipt_reject_info *reject = (struct ipt_reject_info *)t->data;
-       
+
        /* default */
        reject->with = IPT_ICMP_PORT_UNREACHABLE;
-       
+
        /* Can't cache this */
        *nfcache |= NFC_UNKNOWN;
 }
@@ -84,15 +84,15 @@ static int
 parse(int c, char **argv, int invert, unsigned int *flags,
       const struct ipt_entry *entry,
       struct ipt_entry_target **target)
-{      
+{
        struct ipt_reject_info *reject = (struct ipt_reject_info *)(*target)->data;
        unsigned int limit = sizeof(reject_table)/sizeof(struct reject_names);
        unsigned int i;
-               
+
        switch(c) {
        case '1':
                if (check_inverse(optarg, &invert))
-                       exit_error(PARAMETER_PROBLEM, 
+                       exit_error(PARAMETER_PROBLEM,
                                   "Unexpected `!' after --reject-with");
                for (i = 0; i < limit; i++) {
                        if ((strncasecmp(reject_table[i].name, optarg, strlen(optarg)) == 0)
@@ -106,7 +106,7 @@ parse(int c, char **argv, int invert, unsigned int *flags,
                /* Fall through */
        }
        return 0;
-}      
+}
 
 /* Final check; nothing. */
 static void final_check(unsigned int flags)
@@ -114,15 +114,15 @@ static void final_check(unsigned int flags)
 }
 
 /* Prints out ipt_reject_info. */
-static void 
+static void
 print(const struct ipt_ip *ip,
-      const struct ipt_entry_target *target, 
+      const struct ipt_entry_target *target,
       int numeric)
 {
-       const struct ipt_reject_info *reject 
+       const struct ipt_reject_info *reject
                = (const struct ipt_reject_info *)target->data;
        unsigned int i;
-       
+
        for (i = 0; i < sizeof(reject_table)/sizeof(struct reject_names); i++) {
                if (reject_table[i].with == reject->with)
                        break;
@@ -133,9 +133,9 @@ print(const struct ipt_ip *ip,
 /* Saves ipt_reject in parsable form to stdout. */
 static void save(const struct ipt_ip *ip, const struct ipt_entry_target *target)
 {
-       const struct ipt_reject_info *reject 
+       const struct ipt_reject_info *reject
                = (const struct ipt_reject_info *)target->data;
-       
+
        printf("--reject-with %s ", reject_table[reject->with].name);
 }
 
index 4a8e91ba45b4b27a2d4404de56d680f374271003..f01fc26487e15bbd98c84016ca0c5faf86f499b1 100644 (file)
@@ -31,7 +31,7 @@ static void
 help(void)
 {
        unsigned int i;
-       
+
        printf(
 "TOS target v%s options:\n"
 "  --set-tos value                   Set Type of Service field to one of the\n"
@@ -100,7 +100,7 @@ parse(int c, char **argv, int invert, unsigned int *flags,
                parse_tos(optarg, tosinfo);
                *flags = 1;
                break;
-               
+
        default:
                return 0;
        }
@@ -120,7 +120,7 @@ static void
 print_tos(u_int8_t tos, int numeric)
 {
        unsigned int i;
-       
+
        if (!numeric) {
                for (i = 0; i<sizeof(TOS_values)/sizeof(struct TOS_value); i++)
                        if (TOS_values[i].TOS == tos) {
@@ -140,7 +140,7 @@ print(const struct ipt_ip *ip,
        const struct ipt_tos_target_info *tosinfo =
                (const struct ipt_tos_target_info *)target->data;
        printf("TOS set ");
-       print_tos(tosinfo->tos, numeric);       
+       print_tos(tosinfo->tos, numeric);
 }
 
 /* Saves the union ipt_targinfo in parsable form to stdout. */
@@ -149,8 +149,8 @@ save(const struct ipt_ip *ip, const struct ipt_entry_target *target)
 {
        const struct ipt_tos_target_info *tosinfo =
                (const struct ipt_tos_target_info *)target->data;
-       
-       printf("--set-tos 0x%02x ", tosinfo->tos);      
+
+       printf("--set-tos 0x%02x ", tosinfo->tos);
 }
 
 struct iptables_target tos
index aed63059297a050987f531c85c9ab158e090395e..b6cc74f258e5d014b0eec2492440b3f9f38d8f67 100644 (file)
@@ -107,7 +107,7 @@ parse(int c, char **argv, int invert, unsigned int *flags,
                if (!parse_rate(optarg, &r->avg))
                        exit_error(PARAMETER_PROBLEM,
                                   "bad rate `%s'", optarg);
-               break;  
+               break;
 
        case '$':
                if (check_inverse(optarg, &invert))
index 318cd94dc68154b206c43aebdfe609311c71e080..dcf54488edd5099c63c6d8dbf75574ef2995d8c9 100644 (file)
@@ -70,7 +70,7 @@ print_mark(unsigned long mark, unsigned long mask, int invert, int numeric)
 {
        if (invert)
                fputc('!', stdout);
-               
+
        if(mask != 0xffffffff)
                printf("0x%lx/0x%lx ", mark, mask);
        else
index eb62081e7a0cca12046b07bf85cecb8ccf13efe3..6d2d77247e9767c00894feb15da5992e59bd2458 100644 (file)
@@ -26,7 +26,7 @@ static void
 help(void)
 {
        unsigned int i;
-       
+
        printf(
 "TOS match v%s options:\n"
 "[!] --tos value                 Match Type of Service field from one of the\n"
@@ -108,10 +108,10 @@ static void
 print_tos(u_int8_t tos, int invert, int numeric)
 {
        unsigned int i;
-       
+
        if (invert)
                fputc('!', stdout);
-               
+
        if (!numeric) {
                for (i = 0; i<sizeof(TOS_values)/sizeof(struct TOS_value); i++)
                        if (TOS_values[i].TOS == tos) {
index 9b4ece29bbed0f18503020c7011759c0d4538ce5..f9a95952d0e273176f9640a9a035a6792c74e0b4 100644 (file)
@@ -126,7 +126,7 @@ int main(int argc, char *argv[])
                                                   "Bad line %u: need ]\n",
                                                   line);
                        }
-                                       
+
                        /* strtok: a function only a coder could love */
                        newargv[0] = argv[0];
                        for (i = 1; i < sizeof(newargv)/sizeof(char *); i++) {
index 40e9d6a55335cf72b7f8ab61ad4b195a50074eef..6b0e4199f041b6ca8d01eae1cb5fd418a2acfb25 100644 (file)
@@ -32,7 +32,7 @@ print_iface(char letter, const char *iface, const unsigned char *mask,
 
        if (mask[0] == 0)
                return;
-       
+
        printf("-%c %s", letter, invert ? "! " : "");
 
        for (i = 0; i < IFNAMSIZ; i++) {
index e7110ea2c7fb884bf10ec722772143c81827cd43..eb772bed87992171a6f624fbf5e30121acbb08bf 100644 (file)
@@ -663,7 +663,7 @@ parse_interface(const char *arg, char *vianame, unsigned char *mask)
                exit_error(PARAMETER_PROBLEM,
                           "interface name `%s' must be shorter than IFNAMSIZ"
                           " (%i)", arg, IFNAMSIZ-1);
-       
+
        strcpy(vianame, arg);
        if (vialen == 0)
                memset(mask, 0, IFNAMSIZ);
@@ -1285,11 +1285,11 @@ flush_entries(const ipt_chainlabel chain, int verbose,
 {
        if (!chain)
                return for_each_chain(flush_entries, verbose, handle);
-       
-               if (verbose)
-                       fprintf(stdout, "Flushing chain `%s'\n", chain);
-               return iptc_flush_entries(chain, handle);
-       }
+
+       if (verbose)
+               fprintf(stdout, "Flushing chain `%s'\n", chain);
+       return iptc_flush_entries(chain, handle);
+}
 
 static int
 zero_entries(const ipt_chainlabel chain, int verbose,
@@ -1297,7 +1297,7 @@ zero_entries(const ipt_chainlabel chain, int verbose,
 {
        if (!chain)
                return for_each_chain(zero_entries, verbose, handle);
-       
+
        if (verbose)
                fprintf(stdout, "Zeroing chain `%s'\n", chain);
        return iptc_zero_entries(chain, handle);
@@ -1320,7 +1320,7 @@ delete_chain(const ipt_chainlabel chain, int verbose,
                /* No user-defined chains? */
                if (!i)
                        return ret;
-                       
+
                /* Be careful iterating: it isn't safe during delete. */
                /* Re-iterate after each delete successful */
                while ((i = iptc_next_chain(last, handle)) != NULL) {
@@ -1867,9 +1867,9 @@ int do_command(int argc, char *argv[], char **table, iptc_handle_t *handle)
                        target->init(target->t, &fw.nfcache);
                }
 
-               if (!target) {  
+               if (!target) {
                        struct ipt_entry_target unknown_target;
-       
+
                        /* Don't know it.  Must be extension with no
                            options? */
                        unknown_target.target_size = sizeof(unknown_target);
index 06e4a02e10d9e49cc4740674a8b5e9ea19768cbf..c017f3ab0542c18c1e1740e3a6ecf88abb8070d9 100644 (file)
@@ -22,7 +22,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <unistd.h>
-        
+
 #include <libipq/libipq.h>
 
 /****************************************************************************
@@ -75,14 +75,14 @@ static int ipq_errno = IPQ_ERR_NONE;
 
 static ssize_t ipq_netlink_sendto(const struct ipq_handle *h,
                                   const void *msg, size_t len);
-                    
+
 static ssize_t ipq_netlink_recvfrom(const struct ipq_handle *h,
                                     unsigned char *buf, size_t len);
-                      
+
 static ssize_t ipq_netlink_sendmsg(const struct ipq_handle *h,
                                    const struct msghdr *msg,
                                    unsigned int flags);
-                     
+
 static char *ipq_strerror(int errcode);
 
 static ssize_t ipq_netlink_sendto(const struct ipq_handle *h,
@@ -92,7 +92,7 @@ static ssize_t ipq_netlink_sendto(const struct ipq_handle *h,
                            (struct sockaddr *)&h->peer, sizeof(h->peer));
        if (status < 0)
                ipq_errno = IPQ_ERR_SEND;
-       return status;  
+       return status;
 }
 
 static ssize_t ipq_netlink_sendmsg(const struct ipq_handle *h,
@@ -102,7 +102,7 @@ static ssize_t ipq_netlink_sendmsg(const struct ipq_handle *h,
        int status = sendmsg(h->fd, msg, flags);
        if (status < 0)
                ipq_errno = IPQ_ERR_SEND;
-       return status;  
+       return status;
 }
 
 static ssize_t ipq_netlink_recvfrom(const struct ipq_handle *h,
@@ -110,7 +110,7 @@ static ssize_t ipq_netlink_recvfrom(const struct ipq_handle *h,
 {
        int addrlen, status;
        struct nlmsghdr *nlh;
-       
+
        if (len < sizeof(struct nlmsgerr)) {
                ipq_errno = IPQ_ERR_RECVBUF;
                return -1;
@@ -151,7 +151,7 @@ static char *ipq_strerror(int errcode)
  *
  ****************************************************************************/
 
-/* 
+/*
  * Create and initialise an ipq handle.
  * FIXME: implement flags.
  */
@@ -159,7 +159,7 @@ struct ipq_handle *ipq_create_handle(u_int32_t flags)
 {
        int status;
        struct ipq_handle *h;
-       
+
        h = (struct ipq_handle *)malloc(sizeof(struct ipq_handle));
        if (h == NULL) {
                ipq_errno = IPQ_ERR_HANDLE;
@@ -192,7 +192,7 @@ struct ipq_handle *ipq_create_handle(u_int32_t flags)
 }
 
 /*
- * No error condition is checked here at this stage, but it may happen 
+ * No error condition is checked here at this stage, but it may happen
  * if/when reliable messaging is implemented.
  */
 int ipq_destroy_handle(struct ipq_handle *h)
@@ -211,7 +211,7 @@ int ipq_set_mode(const struct ipq_handle *h,
                struct nlmsghdr nlh;
                ipq_peer_msg_t pm;
        } req;
-       
+
        memset(&req, 0, sizeof(req));
        req.nlh.nlmsg_len = NLMSG_LENGTH(sizeof(req));
        req.nlh.nlmsg_flags = NLM_F_REQUEST;
index 9109703303bf9067df491e588e32ec6b0441021d..e96c0a97d270b0c3b0ebf424112737faf8112eb0 100644 (file)
@@ -248,7 +248,7 @@ iptc_init(const char *tablename)
                free(h);
                return NULL;
        }
-       
+
        CHECK(h);
        return h;
 }
@@ -802,7 +802,7 @@ standard_map(struct ipt_entry *e, int verdict)
 
        return 1;
 }
-       
+
 static int
 map_target(const iptc_handle_t handle,
           struct ipt_entry *e,
@@ -1096,7 +1096,7 @@ iptc_delete_entry(const ipt_chainlabel chain,
        free(fw);
        errno = ENOENT;
        return 0;
-}      
+}
 
 /* Delete the rule in position `rulenum' in `chain'. */
 int
@@ -1179,7 +1179,7 @@ int
 iptc_zero_entries(const ipt_chainlabel chain, iptc_handle_t *handle)
 {
        unsigned int i, end;
-       
+
        CHECK(*handle);
        if (!find_label(&i, chain, *handle)) {
                errno = ENOENT;
@@ -1305,7 +1305,7 @@ iptc_delete_chain(const ipt_chainlabel chain, iptc_handle_t *handle)
        CHECK(*handle);
        if (!iptc_get_references(&references, chain, handle))
                return 0;
-       
+
        iptc_fn = iptc_delete_chain;
 
        if (iptc_builtin(chain, *handle)) {
@@ -1483,7 +1483,7 @@ iptc_commit(iptc_handle_t *handle)
                errno = ENOMEM;
                return 0;
        }
-               
+
        /* These are the counters we're going to put back, later. */
        newcounters = malloc(counterlen);
        if (!newcounters) {
@@ -1550,7 +1550,7 @@ iptc_commit(iptc_handle_t *handle)
                }
        }
 
-       if (setsockopt(sockfd, IPPROTO_IP, IPT_SO_SET_ADD_COUNTERS,     
+       if (setsockopt(sockfd, IPPROTO_IP, IPT_SO_SET_ADD_COUNTERS,
               newcounters, counterlen) < 0) {
                free(repl->counters);
                free(repl);