* *
***************************************************************************/
+#include <limits.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <linux/netfilter_ipv4/ip_tables.h>
#include <ipt_ACCOUNT_cl.h>
+#include <string.h>
+#include <stdlib.h>
+
int ipt_ACCOUNT_init(struct ipt_ACCOUNT_context *ctx)
{
memset (ctx, 0, sizeof(struct ipt_ACCOUNT_context));
const char *table, char dont_flush)
{
unsigned int s = sizeof (struct ipt_acc_handle_sockopt);
+ unsigned int new_size;
int rtn;
strncpy(ctx->handle.name, table, ACCOUNT_TABLE_NAME_LEN-1);
// Check data buffer size
ctx->pos = 0;
- unsigned int new_size;
new_size = ctx->handle.itemcount * sizeof(struct ipt_acc_handle_ip);
// We want to prevent reallocations all the time
if (new_size < IPT_ACCOUNT_MIN_BUFSIZE)
const char *ipt_ACCOUNT_get_next_name(struct ipt_ACCOUNT_context *ctx)
{
+ const char *rtn;
if (((char *)ctx->data)[ctx->pos] == 0)
return 0;
- const char *rtn = ctx->data + ctx->pos;
+ rtn = ctx->data + ctx->pos;
ctx->pos += strlen(ctx->data+ctx->pos) + 1;
return rtn;