X-Git-Url: http://developer.intra2net.com/git/?p=libipt_ACCOUNT;a=blobdiff_plain;f=iptaccount%2Fiptaccount.c;h=4854efda036b89b4a253a4d840fb6b663182e41c;hp=5c413b85f1ba20de89b5922577a890293673231c;hb=e3ccc02f6d76e1c1495370812fd790fd84c7cab1;hpb=8721821e74f3ea001c87c0db492377748cc0b691 diff --git a/iptaccount/iptaccount.c b/iptaccount/iptaccount.c index 5c413b8..4854efd 100644 --- a/iptaccount/iptaccount.c +++ b/iptaccount/iptaccount.c @@ -55,9 +55,11 @@ void show_usage(void) int main(int argc, char *argv[]) { struct ipt_ACCOUNT_context ctx; - struct ipt_account_handle_ip *entry; + struct ipt_acc_handle_ip *entry; int i; - char optchar, doHandleUsage=0, doHandleFree=0, doTableNames=0, doFlush=0, doContinue=0; + char optchar, doHandleUsage=0, doHandleFree=0, doTableNames=0, + doFlush=0, doContinue=0; + char *table_name = NULL; printf("\nipt_ACCOUNT userspace accounting tool v%s\n\n", VERSION); @@ -155,8 +157,8 @@ int main(int argc, char *argv[]) printf("get_table_names failed: %s\n", ctx.error_str); exit (-1); } - char *name; - while ((name = ipt_ACCOUNT_get_next_name(&ctx)) != NULL) + const char *name; + while ((name = ipt_ACCOUNT_get_next_name(&ctx)) != 0) printf("Found table: %s\n", name); } @@ -175,13 +177,15 @@ int main(int argc, char *argv[]) exit (-1); } - printf("Run #%d - %u %s found\n", i, ctx.handle.itemcount, ctx.handle.itemcount == 1 ? "item" : "items"); + printf("Run #%d - %u %s found\n", i, ctx.handle.itemcount, + ctx.handle.itemcount == 1 ? "item" : "items"); // Output and free entries while ((entry = ipt_ACCOUNT_get_next_entry(&ctx)) != NULL) { printf("IP: %s SRC packets: %u bytes: %u DST packets: %u bytes: %u\n", - addr_to_dotted(entry->ip), entry->src_packets, entry->src_bytes, entry->dst_packets, entry->dst_bytes); + addr_to_dotted(entry->ip), entry->src_packets, entry->src_bytes, + entry->dst_packets, entry->dst_bytes); } if (doContinue)