2 +++ b/extensions/libxt_FLOWOFFLOAD.c
6 +#include <linux/netfilter/xt_FLOWOFFLOAD.h>
12 +static void offload_help(void)
15 +"FLOWOFFLOAD target options:\n"
16 +" --hw Enable hardware offload\n"
20 +static const struct xt_option_entry offload_opts[] = {
21 + {.name = "hw", .id = O_HW, .type = XTTYPE_NONE},
25 +static void offload_parse(struct xt_option_call *cb)
27 + struct xt_flowoffload_target_info *info = cb->data;
29 + xtables_option_parse(cb);
30 + switch (cb->entry->id) {
32 + info->flags |= XT_FLOWOFFLOAD_HW;
37 +static void offload_print(const void *ip, const struct xt_entry_target *target, int numeric)
39 + const struct xt_flowoffload_target_info *info =
40 + (const struct xt_flowoffload_target_info *)target->data;
42 + printf(" FLOWOFFLOAD");
43 + if (info->flags & XT_FLOWOFFLOAD_HW)
47 +static void offload_save(const void *ip, const struct xt_entry_target *target)
49 + const struct xt_flowoffload_target_info *info =
50 + (const struct xt_flowoffload_target_info *)target->data;
52 + if (info->flags & XT_FLOWOFFLOAD_HW)
56 +static struct xtables_target offload_tg_reg[] = {
58 + .family = NFPROTO_UNSPEC,
59 + .name = "FLOWOFFLOAD",
61 + .version = XTABLES_VERSION,
62 + .size = XT_ALIGN(sizeof(struct xt_flowoffload_target_info)),
63 + .userspacesize = sizeof(struct xt_flowoffload_target_info),
64 + .help = offload_help,
65 + .print = offload_print,
66 + .save = offload_save,
67 + .x6_parse = offload_parse,
68 + .x6_options = offload_opts,
74 + xtables_register_targets(offload_tg_reg, ARRAY_SIZE(offload_tg_reg));
77 +++ b/include/linux/netfilter/xt_FLOWOFFLOAD.h
79 +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
80 +#ifndef _XT_FLOWOFFLOAD_H
81 +#define _XT_FLOWOFFLOAD_H
83 +#include <linux/types.h>
86 + XT_FLOWOFFLOAD_HW = 1 << 0,
88 + XT_FLOWOFFLOAD_MASK = XT_FLOWOFFLOAD_HW
91 +struct xt_flowoffload_target_info {
95 +#endif /* _XT_FLOWOFFLOAD_H */