10 #include "internal/internal.h"
12 const struct attr_grp_bitmask attr_grp_bitmask[ATTR_GRP_MAX]= {
13 [ATTR_GRP_ORIG_IPV4] = {
14 .bitmask[0] = (1 << ATTR_ORIG_IPV4_SRC) |
15 (1 << ATTR_ORIG_IPV4_DST) |
16 (1 << ATTR_ORIG_L3PROTO),
17 .type = NFCT_BITMASK_AND,
19 [ATTR_GRP_REPL_IPV4] = {
20 .bitmask[0] = (1 << ATTR_REPL_IPV4_SRC) |
21 (1 << ATTR_REPL_IPV4_DST) |
22 (1 << ATTR_REPL_L3PROTO),
23 .type = NFCT_BITMASK_AND,
25 [ATTR_GRP_ORIG_IPV6] = {
26 .bitmask[0] = (1 << ATTR_ORIG_IPV6_SRC) |
27 (1 << ATTR_ORIG_IPV6_DST) |
28 (1 << ATTR_ORIG_L3PROTO),
29 .type = NFCT_BITMASK_AND,
31 [ATTR_GRP_REPL_IPV6] = {
32 .bitmask[0] = (1 << ATTR_REPL_IPV6_SRC) |
33 (1 << ATTR_REPL_IPV6_DST) |
34 (1 << ATTR_REPL_L3PROTO),
35 .type = NFCT_BITMASK_AND,
37 [ATTR_GRP_ORIG_PORT] = {
38 .bitmask[0] = (1 << ATTR_ORIG_PORT_SRC) |
39 (1 << ATTR_ORIG_PORT_DST) |
40 (1 << ATTR_ORIG_L4PROTO),
41 .type = NFCT_BITMASK_AND,
43 [ATTR_GRP_REPL_PORT] = {
44 .bitmask[0] = (1 << ATTR_REPL_PORT_SRC) |
45 (1 << ATTR_REPL_PORT_DST) |
46 (1 << ATTR_REPL_L4PROTO),
47 .type = NFCT_BITMASK_AND,
50 .bitmask[0] = (1 << ATTR_ICMP_CODE) |
51 (1 << ATTR_ICMP_TYPE) |
53 .type = NFCT_BITMASK_AND,
55 [ATTR_GRP_MASTER_IPV4] = {
56 .bitmask[1] = (1 << (ATTR_MASTER_IPV4_SRC - 32)) |
57 (1 << (ATTR_MASTER_IPV4_DST - 32)) |
58 (1 << (ATTR_MASTER_L3PROTO - 32)),
59 .type = NFCT_BITMASK_AND,
61 [ATTR_GRP_MASTER_IPV6] = {
62 .bitmask[1] = (1 << (ATTR_MASTER_IPV6_SRC - 32)) |
63 (1 << (ATTR_MASTER_IPV6_DST - 32)) |
64 (1 << (ATTR_MASTER_L3PROTO - 32)),
65 .type = NFCT_BITMASK_AND,
67 [ATTR_GRP_MASTER_PORT] = {
68 .bitmask[1] = (1 << (ATTR_MASTER_PORT_SRC - 32)) |
69 (1 << (ATTR_MASTER_PORT_DST - 32)) |
70 (1 << (ATTR_MASTER_L4PROTO - 32)),
71 .type = NFCT_BITMASK_AND,
73 [ATTR_GRP_ORIG_COUNTERS] = {
74 .bitmask[0] = (1 << (ATTR_ORIG_COUNTER_PACKETS)) |
75 (1 << (ATTR_ORIG_COUNTER_BYTES)),
76 .type = NFCT_BITMASK_AND,
78 [ATTR_GRP_REPL_COUNTERS] = {
79 .bitmask[0] = (1 << (ATTR_REPL_COUNTER_PACKETS)) |
80 (1 << (ATTR_REPL_COUNTER_BYTES)),
81 .type = NFCT_BITMASK_AND,
83 [ATTR_GRP_ORIG_ADDR_SRC] = {
84 .bitmask[0] = (1 << ATTR_ORIG_IPV4_SRC) |
85 (1 << ATTR_ORIG_IPV6_SRC),
86 .type = NFCT_BITMASK_OR,
88 [ATTR_GRP_ORIG_ADDR_DST] = {
89 .bitmask[0] = (1 << ATTR_ORIG_IPV4_DST) |
90 (1 << ATTR_ORIG_IPV6_DST),
91 .type = NFCT_BITMASK_OR,
94 [ATTR_GRP_REPL_ADDR_SRC] = {
95 .bitmask[0] = (1 << ATTR_REPL_IPV4_SRC) |
96 (1 << ATTR_REPL_IPV6_SRC),
97 .type = NFCT_BITMASK_OR,
99 [ATTR_GRP_REPL_ADDR_DST] = {
100 .bitmask[0] = (1 << ATTR_REPL_IPV4_DST) |
101 (1 << ATTR_REPL_IPV6_DST),
102 .type = NFCT_BITMASK_OR,