X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Flibiptc%2Flibip4tc.c;h=66abb44c2f3d1718b05956b23b9aac95183e9653;hb=722d00817c110d532b38504088cc9847d8eee9ed;hp=a0cdc2f8ecc7b81a25ac04efb443f3bbdc36dd3d;hpb=863dfcdf274509e4e1836c2c8f1f10f09e1d13be;p=collectd.git diff --git a/src/libiptc/libip4tc.c b/src/libiptc/libip4tc.c index a0cdc2f8..66abb44c 100644 --- a/src/libiptc/libip4tc.c +++ b/src/libiptc/libip4tc.c @@ -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;