summaryrefslogtreecommitdiffstats
path: root/src/expect/getter.c
blob: 47087a7cea6b39d1024062e783646a4d9ec1b832 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/*
 * (C) 2005-2011 by Pablo Neira Ayuso <pablo@netfilter.org>
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 */

#include "internal/internal.h"

static const void *get_exp_attr_master(const struct nf_expect *exp)
{
	return &exp->master;
}

static const void *get_exp_attr_expected(const struct nf_expect *exp)
{
	return &exp->expected;
}

static const void *get_exp_attr_mask(const struct nf_expect *exp)
{
	return &exp->mask;
}

static const void *get_exp_attr_timeout(const struct nf_expect *exp)
{
	return &exp->timeout;
}

static const void *get_exp_attr_zone(const struct nf_expect *exp)
{
	return &exp->zone;
}

static const void *get_exp_attr_flags(const struct nf_expect *exp)
{
	return &exp->flags;
}

static const void *get_exp_attr_class(const struct nf_expect *exp)
{
	return &exp->class;
}

static const void *get_exp_attr_helper_name(const struct nf_expect *exp)
{
	return exp->helper_name;
}

static const void *get_exp_attr_nat_dir(const struct nf_expect *exp)
{
	return &exp->nat_dir;
}

static const void *get_exp_attr_nat_tuple(const struct nf_expect *exp)
{
	return &exp->nat;
}

static const void *get_exp_attr_expectfn(const struct nf_expect *exp)
{
	return exp->expectfn;
}

const get_exp_attr get_exp_attr_array[ATTR_EXP_MAX] = {
	[ATTR_EXP_MASTER]		= get_exp_attr_master,
	[ATTR_EXP_EXPECTED]		= get_exp_attr_expected,
	[ATTR_EXP_MASK]			= get_exp_attr_mask,
	[ATTR_EXP_TIMEOUT]		= get_exp_attr_timeout,
	[ATTR_EXP_ZONE]			= get_exp_attr_zone,
	[ATTR_EXP_FLAGS]		= get_exp_attr_flags,
	[ATTR_EXP_HELPER_NAME]		= get_exp_attr_helper_name,
	[ATTR_EXP_CLASS]		= get_exp_attr_class,
	[ATTR_EXP_NAT_TUPLE]		= get_exp_attr_nat_tuple,
	[ATTR_EXP_NAT_DIR]		= get_exp_attr_nat_dir,
	[ATTR_EXP_FN]			= get_exp_attr_expectfn,
};