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)
26 +id_print(const void *ip, const struct xt_entry_match *match, int numeric)
28 + struct xt_id_info *idinfo = (void *)match->data;
30 + printf(" ID:%08lx", idinfo->id);
34 +/* Saves the union ipt_matchinfo in parsable form to stdout. */
36 +id_save(const void *ip, const struct xt_entry_match *match)
38 + struct xt_id_info *idinfo = (void *)match->data;
40 + printf(" --id 0x%lx", idinfo->id);
43 +static struct xtables_match id_match = {
44 + .family = NFPROTO_UNSPEC,
46 + .version = XTABLES_VERSION,
47 + .size = XT_ALIGN(sizeof(struct xt_id_info)),
48 + .userspacesize = XT_ALIGN(sizeof(struct xt_id_info)),
51 + .x6_parse = xtables_option_parse,
52 + .x6_options = id_opts,
57 + xtables_register_match(&id_match);
60 +++ b/include/linux/netfilter/xt_id.h