Introduce the DERIVE and ABSOLUTE data source types.
[collectd.git] / src / libiptc / libip4tc.c
index a0cdc2f..66abb44 100644 (file)
@@ -1,3 +1,21 @@
+/**
+ * This file was imported from the iptables sources.
+ * Copyright (C) 1999-2008 Netfilter Core Team
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; only version 2 of the License is applicable.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+ */
+
 /* Library which manipulates firewall rules.  Version 0.1. */
 
 /* Architecture of firewall rules is as follows:
@@ -26,7 +44,7 @@
 typedef unsigned int socklen_t;
 #endif
 
-#include "libiptc/libiptc.h"
+#include "libiptc.h"
 
 #define IP_VERSION     4
 #define IP_OFFSET      0x1FFF
@@ -148,10 +166,7 @@ dump_entry(STRUCT_ENTRY *e, const TC_HANDLE_T handle)
        printf("Invflags: %02X\n", e->ip.invflags);
        printf("Counters: %llu packets, %llu bytes\n",
               (unsigned long long)e->counters.pcnt, (unsigned long long)e->counters.bcnt);
-       printf("Cache: %08X ", e->nfcache);
-       if (e->nfcache & NFC_ALTERED) printf("ALTERED ");
-       if (e->nfcache & NFC_UNKNOWN) printf("UNKNOWN ");
-       printf("\n");
+       printf("Cache: %08X\n", e->nfcache);
 
        IPT_MATCH_ITERATE(e, print_match);
 
@@ -204,8 +219,7 @@ is_same(const STRUCT_ENTRY *a, const STRUCT_ENTRY *b, unsigned char *matchmask)
                        return NULL;
        }
 
-       if (a->nfcache != b->nfcache
-           || a->target_offset != b->target_offset
+       if (a->target_offset != b->target_offset
            || a->next_offset != b->next_offset)
                return NULL;