libipt_ACCOUNT: (gerd) use const where appropriate
[libipt_ACCOUNT] / src / ipt_ACCOUNT_cl.h
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  
11 #ifndef _ipt_ACCOUNT_cl_H
12 #define _ipt_ACCOUNT_cl_H
13
14 #include <linux/netfilter_ipv4/ipt_ACCOUNT.h>
15
16 /* Don't set this below the size of struct ipt_account_handle_sockopt */
17 #define IPT_ACCOUNT_MIN_BUFSIZE 4096
18
19 struct ipt_ACCOUNT_context
20 {
21     int sockfd;
22     struct ipt_account_handle_sockopt handle;
23     
24     unsigned int data_size;
25     void *data;
26     unsigned int pos;
27         
28     char *error_str;
29 };
30
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34
35     int ipt_ACCOUNT_init(struct ipt_ACCOUNT_context *ctx);
36     void ipt_ACCOUNT_deinit(struct ipt_ACCOUNT_context *ctx);
37     
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() */
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);
47     const char *ipt_ACCOUNT_get_next_name(struct ipt_ACCOUNT_context *ctx);
48
49 #ifdef __cplusplus
50 }
51 #endif
52    
53    
54 #endif