summaryrefslogtreecommitdiffstats
path: root/xtoptions.c
diff options
context:
space:
mode:
authorJan Engelhardt <jengelh@medozas.de>2011-03-06 17:13:54 +0100
committerJan Engelhardt <jengelh@medozas.de>2011-04-13 18:09:26 +0200
commitbc438c4cbdab09fafbbceecddd54e44e4234a4a1 (patch)
treee9f1983d66e68b9c4206123523e51606367541cf /xtoptions.c
parent8bf513ada0aae0e4b1ac5160113fc532c2f525d0 (diff)
libxtables: XTTYPE_UINT64RC support
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Diffstat (limited to 'xtoptions.c')
-rw-r--r--xtoptions.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/xtoptions.c b/xtoptions.c
index babc8276..a74938fa 100644
--- a/xtoptions.c
+++ b/xtoptions.c
@@ -143,6 +143,8 @@ static void xtopt_parse_mint(struct xt_option_call *cb)
esize = sizeof(uint8_t);
else if (entry->type == XTTYPE_UINT16RC)
esize = sizeof(uint16_t);
+ else if (entry->type == XTTYPE_UINT64RC)
+ esize = sizeof(uint64_t);
maxiter = entry->size / esize;
if (maxiter == 0)
maxiter = 2; /* ARRAY_SIZE(cb->val.uXX_range) */
@@ -173,6 +175,8 @@ static void xtopt_parse_mint(struct xt_option_call *cb)
cb->val.u16_range[cb->nvals] = value;
else if (entry->type == XTTYPE_UINT32RC)
cb->val.u32_range[cb->nvals] = value;
+ else if (entry->type == XTTYPE_UINT64RC)
+ cb->val.u64_range[cb->nvals] = value;
}
if (entry->flags & XTOPT_PUT) {
if (entry->type == XTTYPE_UINT8RC)
@@ -181,6 +185,8 @@ static void xtopt_parse_mint(struct xt_option_call *cb)
*(uint16_t *)put = value;
else if (entry->type == XTTYPE_UINT32RC)
*(uint32_t *)put = value;
+ else if (entry->type == XTTYPE_UINT64RC)
+ *(uint64_t *)put = value;
put += esize;
}
if (*end == '\0')
@@ -246,6 +252,7 @@ static void (*const xtopt_subparse[])(struct xt_option_call *) = {
[XTTYPE_UINT8RC] = xtopt_parse_mint,
[XTTYPE_UINT16RC] = xtopt_parse_mint,
[XTTYPE_UINT32RC] = xtopt_parse_mint,
+ [XTTYPE_UINT64RC] = xtopt_parse_mint,
[XTTYPE_STRING] = xtopt_parse_string,
[XTTYPE_MARKMASK32] = xtopt_parse_markmask,
};
@@ -257,6 +264,7 @@ static const size_t xtopt_psize[] = {
[XTTYPE_UINT8RC] = sizeof(uint8_t[2]),
[XTTYPE_UINT16RC] = sizeof(uint16_t[2]),
[XTTYPE_UINT32RC] = sizeof(uint32_t[2]),
+ [XTTYPE_UINT64RC] = sizeof(uint64_t[2]),
[XTTYPE_STRING] = -1,
};