2 +++ b/extensions/libxt_id.c
4 +/* Shared library add-on to iptables to add id match support. */
8 +#include <linux/netfilter/xt_id.h>
14 +static const struct xt_option_entry id_opts[] = {
18 + .type = XTTYPE_UINT32,
19 + .flags = XTOPT_MAND | XTOPT_PUT,
20 + XTOPT_POINTER(struct xt_id_info, id)
25 +/* Saves the union ipt_matchinfo in parsable form to stdout. */
27 +id_save(const void *ip, const struct xt_entry_match *match)
29 + struct xt_id_info *idinfo = (void *)match->data;
31 + printf(" --id %lu", idinfo->id);
34 +static struct xtables_match id_match = {
35 + .family = NFPROTO_UNSPEC,
37 + .version = XTABLES_VERSION,
38 + .size = XT_ALIGN(sizeof(struct xt_id_info)),
39 + .userspacesize = XT_ALIGN(sizeof(struct xt_id_info)),
41 + .x6_parse = xtables_option_parse,
42 + .x6_options = id_opts,
47 + xtables_register_match(&id_match);
50 +++ b/include/linux/netfilter/xt_id.h