| 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 | ||
| e3ccc02f TJ |
38 | int ipt_ACCOUNT_read_entries(struct ipt_ACCOUNT_context *ctx, |
| 39 | const char *table, char dont_flush); | |
| 40 | struct ipt_acc_handle_ip *ipt_ACCOUNT_get_next_entry( | |
| 41 | struct ipt_ACCOUNT_context *ctx); | |
| 42 | ||
| 49ba8949 TJ |
43 | /* ipt_ACCOUNT_free_entries is for internal use only function as this library |
| 44 | is constructed to be used in a loop -> Don't allocate memory all the time. | |
| 45 | The data buffer is freed on deinit() */ | |
| d7e0bb9c TJ |
46 | |
| 47 | int ipt_ACCOUNT_get_handle_usage(struct ipt_ACCOUNT_context *ctx); | |
| 48 | int ipt_ACCOUNT_free_all_handles(struct ipt_ACCOUNT_context *ctx); | |
| 49 | int ipt_ACCOUNT_get_table_names(struct ipt_ACCOUNT_context *ctx); | |
| 42b9e9f8 | 50 | const char *ipt_ACCOUNT_get_next_name(struct ipt_ACCOUNT_context *ctx); |
| 322f2b5b | 51 | |
| 49ba8949 TJ |
52 | #ifdef __cplusplus |
| 53 | } | |
| 54 | #endif | |
| 55 | ||
| 56 | ||
| 322f2b5b | 57 | #endif |