{
MFF_TCP_SRC, "tcp_src", "tp_src",
MF_FIELD_SIZES(be16),
- MFM_NONE, FWW_TP_SRC,
+ MFM_FULLY, 0,
MFS_DECIMAL,
MFP_TCP,
true,
}, {
MFF_TCP_DST, "tcp_dst", "tp_dst",
MF_FIELD_SIZES(be16),
- MFM_NONE, FWW_TP_DST,
+ MFM_FULLY, 0,
MFS_DECIMAL,
MFP_TCP,
true,
{
MFF_UDP_SRC, "udp_src", NULL,
MF_FIELD_SIZES(be16),
- MFM_NONE, FWW_TP_SRC,
+ MFM_FULLY, 0,
MFS_DECIMAL,
MFP_UDP,
true,
}, {
MFF_UDP_DST, "udp_dst", NULL,
MF_FIELD_SIZES(be16),
- MFM_NONE, FWW_TP_DST,
+ MFM_FULLY, 0,
MFS_DECIMAL,
MFP_UDP,
true,
{
MFF_ICMPV4_TYPE, "icmp_type", NULL,
MF_FIELD_SIZES(u8),
- MFM_NONE, FWW_TP_SRC,
+ MFM_NONE, 0,
MFS_DECIMAL,
MFP_ICMPV4,
false,
}, {
MFF_ICMPV4_CODE, "icmp_code", NULL,
MF_FIELD_SIZES(u8),
- MFM_NONE, FWW_TP_DST,
+ MFM_NONE, 0,
MFS_DECIMAL,
MFP_ICMPV4,
false,
{
MFF_ICMPV6_TYPE, "icmpv6_type", NULL,
MF_FIELD_SIZES(u8),
- MFM_NONE, FWW_TP_SRC,
+ MFM_NONE, 0,
MFS_DECIMAL,
MFP_ICMPV6,
false,
}, {
MFF_ICMPV6_CODE, "icmpv6_code", NULL,
MF_FIELD_SIZES(u8),
- MFM_NONE, FWW_TP_DST,
+ MFM_NONE, 0,
MFS_DECIMAL,
MFP_ICMPV6,
false,
case MFF_ARP_OP:
case MFF_ARP_SHA:
case MFF_ARP_THA:
- case MFF_TCP_SRC:
- case MFF_TCP_DST:
- case MFF_UDP_SRC:
- case MFF_UDP_DST:
- case MFF_ICMPV4_TYPE:
- case MFF_ICMPV4_CODE:
- case MFF_ICMPV6_TYPE:
- case MFF_ICMPV6_CODE:
case MFF_ND_TARGET:
case MFF_ND_SLL:
case MFF_ND_TLL:
case MFF_ARP_TPA:
return !wc->nw_dst_mask;
+ case MFF_TCP_SRC:
+ case MFF_UDP_SRC:
+ case MFF_ICMPV4_TYPE:
+ case MFF_ICMPV6_TYPE:
+ return !wc->tp_src_mask;
+ case MFF_TCP_DST:
+ case MFF_UDP_DST:
+ case MFF_ICMPV4_CODE:
+ case MFF_ICMPV6_CODE:
+ return !wc->tp_dst_mask;
+
case MFF_N_IDS:
default:
NOT_REACHED();
case MFF_ARP_OP:
case MFF_ARP_SHA:
case MFF_ARP_THA:
- case MFF_TCP_SRC:
- case MFF_TCP_DST:
- case MFF_UDP_SRC:
- case MFF_UDP_DST:
- case MFF_ICMPV4_TYPE:
- case MFF_ICMPV4_CODE:
- case MFF_ICMPV6_TYPE:
- case MFF_ICMPV6_CODE:
case MFF_ND_TARGET:
case MFF_ND_SLL:
case MFF_ND_TLL:
mask->be32 = wc->nw_dst_mask;
break;
+ case MFF_TCP_SRC:
+ case MFF_UDP_SRC:
+ mask->be16 = wc->tp_src_mask;
+ break;
+ case MFF_TCP_DST:
+ case MFF_UDP_DST:
+ mask->be16 = wc->tp_dst_mask;
+ break;
+
+ case MFF_ICMPV4_TYPE:
+ case MFF_ICMPV6_TYPE:
+ mask->u8 = ntohs(wc->tp_src_mask);
+ break;
+ case MFF_ICMPV4_CODE:
+ case MFF_ICMPV6_CODE:
+ mask->u8 = ntohs(wc->tp_dst_mask);
+ break;
+
case MFF_N_IDS:
default:
NOT_REACHED();
case MFF_UDP_SRC:
case MFF_ICMPV4_TYPE:
case MFF_ICMPV6_TYPE:
- rule->wc.wildcards |= FWW_TP_SRC;
+ rule->wc.tp_src_mask = htons(0);
rule->flow.tp_src = htons(0);
break;
case MFF_UDP_DST:
case MFF_ICMPV4_CODE:
case MFF_ICMPV6_CODE:
- rule->wc.wildcards |= FWW_TP_DST;
+ rule->wc.tp_dst_mask = htons(0);
rule->flow.tp_dst = htons(0);
break;
case MFF_ARP_OP:
case MFF_ARP_SHA:
case MFF_ARP_THA:
- case MFF_TCP_SRC:
- case MFF_TCP_DST:
- case MFF_UDP_SRC:
- case MFF_UDP_DST:
case MFF_ICMPV4_TYPE:
case MFF_ICMPV4_CODE:
case MFF_ICMPV6_TYPE:
cls_rule_set_nw_dst_masked(rule, value->be32, mask->be32);
break;
+ case MFF_TCP_SRC:
+ case MFF_UDP_SRC:
+ cls_rule_set_tp_src_masked(rule, value->be16, mask->be16);
+ break;
+
+ case MFF_TCP_DST:
+ case MFF_UDP_DST:
+ cls_rule_set_tp_dst_masked(rule, value->be16, mask->be16);
+ break;
+
case MFF_N_IDS:
default:
NOT_REACHED();