| 1 |
/* |
| 2 |
* (C) 2005-2011 by Pablo Neira Ayuso <[email protected]> |
| 3 |
* |
| 4 |
* This program is free software; you can redistribute it and/or modify it |
| 5 |
* under the terms of the GNU General Public License as published by |
| 6 |
* the Free Software Foundation; either version 2 of the License, or |
| 7 |
* (at your option) any later version. |
| 8 |
*/ |
| 9 |
|
| 10 |
#include "internal/internal.h" |
| 11 |
|
| 12 |
static const void *get_exp_attr_master(const struct nf_expect *exp) |
| 13 |
{ |
| 14 |
return &exp->master; |
| 15 |
} |
| 16 |
|
| 17 |
static const void *get_exp_attr_expected(const struct nf_expect *exp) |
| 18 |
{ |
| 19 |
return &exp->expected; |
| 20 |
} |
| 21 |
|
| 22 |
static const void *get_exp_attr_mask(const struct nf_expect *exp) |
| 23 |
{ |
| 24 |
return &exp->mask; |
| 25 |
} |
| 26 |
|
| 27 |
static const void *get_exp_attr_timeout(const struct nf_expect *exp) |
| 28 |
{ |
| 29 |
return &exp->timeout; |
| 30 |
} |
| 31 |
|
| 32 |
static const void *get_exp_attr_zone(const struct nf_expect *exp) |
| 33 |
{ |
| 34 |
return &exp->zone; |
| 35 |
} |
| 36 |
|
| 37 |
static const void *get_exp_attr_flags(const struct nf_expect *exp) |
| 38 |
{ |
| 39 |
return &exp->flags; |
| 40 |
} |
| 41 |
|
| 42 |
static const void *get_exp_attr_class(const struct nf_expect *exp) |
| 43 |
{ |
| 44 |
return &exp->class; |
| 45 |
} |
| 46 |
|
| 47 |
static const void *get_exp_attr_helper_name(const struct nf_expect *exp) |
| 48 |
{ |
| 49 |
return exp->helper_name; |
| 50 |
} |
| 51 |
|
| 52 |
static const void *get_exp_attr_nat_dir(const struct nf_expect *exp) |
| 53 |
{ |
| 54 |
return &exp->nat_dir; |
| 55 |
} |
| 56 |
|
| 57 |
static const void *get_exp_attr_nat_tuple(const struct nf_expect *exp) |
| 58 |
{ |
| 59 |
return &exp->nat; |
| 60 |
} |
| 61 |
|
| 62 |
static const void *get_exp_attr_expectfn(const struct nf_expect *exp) |
| 63 |
{ |
| 64 |
return exp->expectfn; |
| 65 |
} |
| 66 |
|
| 67 |
const get_exp_attr get_exp_attr_array[ATTR_EXP_MAX] = { |
| 68 |
[ATTR_EXP_MASTER] = get_exp_attr_master, |
| 69 |
[ATTR_EXP_EXPECTED] = get_exp_attr_expected, |
| 70 |
[ATTR_EXP_MASK] = get_exp_attr_mask, |
| 71 |
[ATTR_EXP_TIMEOUT] = get_exp_attr_timeout, |
| 72 |
[ATTR_EXP_ZONE] = get_exp_attr_zone, |
| 73 |
[ATTR_EXP_FLAGS] = get_exp_attr_flags, |
| 74 |
[ATTR_EXP_HELPER_NAME] = get_exp_attr_helper_name, |
| 75 |
[ATTR_EXP_CLASS] = get_exp_attr_class, |
| 76 |
[ATTR_EXP_NAT_TUPLE] = get_exp_attr_nat_tuple, |
| 77 |
[ATTR_EXP_NAT_DIR] = get_exp_attr_nat_dir, |
| 78 |
[ATTR_EXP_FN] = get_exp_attr_expectfn, |
| 79 |
}; |