1 /***************************************************************************
2 * Copyright (C) 2004 by Intra2net AG *
3 * opensource@intra2net.com *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU Lesser General Public License *
7 * version 2.1 as published by the Free Software Foundation; *
9 ***************************************************************************/
11 #ifndef _ipt_ACCOUNT_cl_H
12 #define _ipt_ACCOUNT_cl_H
14 #include <linux/netfilter_ipv4/ipt_ACCOUNT.h>
16 /* Don't set this below the size of struct ipt_account_handle_sockopt */
17 #define IPT_ACCOUNT_MIN_BUFSIZE 4096
19 struct ipt_ACCOUNT_context
22 struct ipt_account_handle_sockopt handle;
24 unsigned int data_size;
35 int ipt_ACCOUNT_init(struct ipt_ACCOUNT_context *ctx);
36 void ipt_ACCOUNT_deinit(struct ipt_ACCOUNT_context *ctx);
38 int ipt_ACCOUNT_read_entries(struct ipt_ACCOUNT_context *ctx, const char *table, char dont_flush);
39 struct ipt_account_handle_ip *ipt_ACCOUNT_get_next_entry(struct ipt_ACCOUNT_context *ctx);
40 /* ipt_ACCOUNT_free_entries is for internal use only function as this library
41 is constructed to be used in a loop -> Don't allocate memory all the time.
42 The data buffer is freed on deinit() */
44 int ipt_ACCOUNT_get_handle_usage(struct ipt_ACCOUNT_context *ctx);
45 int ipt_ACCOUNT_free_all_handles(struct ipt_ACCOUNT_context *ctx);
46 int ipt_ACCOUNT_get_table_names(struct ipt_ACCOUNT_context *ctx);
47 const char *ipt_ACCOUNT_get_next_name(struct ipt_ACCOUNT_context *ctx);