Commit | Line | Data |
---|---|---|
a61040d6 TJ |
1 | /*************************************************************************** |
2 | * Copyright (C) 2004 by Intra2net AG * | |
3 | * opensource@intra2net.com * | |
4 | * * | |
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; * | |
8 | * * | |
9 | ***************************************************************************/ | |
10 | ||
322f2b5b TJ |
11 | #ifndef _ipt_ACCOUNT_cl_H |
12 | #define _ipt_ACCOUNT_cl_H | |
13 | ||
a61040d6 | 14 | #include <linux/netfilter_ipv4/ipt_ACCOUNT.h> |
322f2b5b | 15 | |
49ba8949 TJ |
16 | /* Don't set this below the size of struct ipt_account_handle_sockopt */ |
17 | #define IPT_ACCOUNT_MIN_BUFSIZE 4096 | |
322f2b5b TJ |
18 | |
19 | struct ipt_ACCOUNT_context | |
20 | { | |
21 | int sockfd; | |
8721821e | 22 | struct ipt_acc_handle_sockopt handle; |
322f2b5b TJ |
23 | |
24 | unsigned int data_size; | |
25 | void *data; | |
26 | unsigned int pos; | |
27 | ||
28 | char *error_str; | |
29 | }; | |
30 | ||
49ba8949 TJ |
31 | #ifdef __cplusplus |
32 | extern "C" { | |
33 | #endif | |
322f2b5b | 34 | |
49ba8949 TJ |
35 | int ipt_ACCOUNT_init(struct ipt_ACCOUNT_context *ctx); |
36 | void ipt_ACCOUNT_deinit(struct ipt_ACCOUNT_context *ctx); | |
37 | ||
42b9e9f8 | 38 | int ipt_ACCOUNT_read_entries(struct ipt_ACCOUNT_context *ctx, const char *table, char dont_flush); |
8721821e | 39 | struct ipt_acc_handle_ip *ipt_ACCOUNT_get_next_entry(struct ipt_ACCOUNT_context *ctx); |
49ba8949 TJ |
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() */ | |
d7e0bb9c TJ |
43 | |
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); | |
42b9e9f8 | 47 | const char *ipt_ACCOUNT_get_next_name(struct ipt_ACCOUNT_context *ctx); |
322f2b5b | 48 | |
49ba8949 TJ |
49 | #ifdef __cplusplus |
50 | } | |
51 | #endif | |
52 | ||
53 | ||
322f2b5b | 54 | #endif |