- switch (mf->id) {
- case MFF_TUN_ID:
- case MFF_TUN_SRC:
- case MFF_TUN_DST:
- case MFF_TUN_TOS:
- case MFF_TUN_TTL:
- case MFF_TUN_FLAGS:
- mask->be64 = wc->masks.tunnel.tun_id;
- break;
- case MFF_METADATA:
- mask->be64 = wc->masks.metadata;
- break;
- case MFF_IN_PORT:
- mask->be16 = htons(wc->masks.in_port);
- break;
- CASE_MFF_REGS:
- mask->be32 = htonl(wc->masks.regs[mf->id - MFF_REG0]);
- break;
-
- case MFF_ETH_DST:
- memcpy(mask->mac, wc->masks.dl_dst, ETH_ADDR_LEN);
- break;
- case MFF_ETH_SRC:
- memcpy(mask->mac, wc->masks.dl_src, ETH_ADDR_LEN);
- break;
- case MFF_ETH_TYPE:
- mask->be16 = wc->masks.dl_type;
- break;
-
- case MFF_VLAN_TCI:
- mask->be16 = wc->masks.vlan_tci;
- break;
- case MFF_DL_VLAN:
- mask->be16 = wc->masks.vlan_tci & htons(VLAN_VID_MASK);
- break;
- case MFF_VLAN_VID:
- mask->be16 = wc->masks.vlan_tci & htons(VLAN_VID_MASK | VLAN_CFI);
- break;
- case MFF_DL_VLAN_PCP:
- case MFF_VLAN_PCP:
- mask->u8 = vlan_tci_to_pcp(wc->masks.vlan_tci);
- break;
-
- case MFF_IPV4_SRC:
- mask->be32 = wc->masks.nw_src;
- break;
- case MFF_IPV4_DST:
- mask->be32 = wc->masks.nw_dst;
- break;
-
- case MFF_IPV6_SRC:
- mask->ipv6 = wc->masks.ipv6_src;
- break;
- case MFF_IPV6_DST:
- mask->ipv6 = wc->masks.ipv6_dst;
- break;
- case MFF_IPV6_LABEL:
- mask->be32 = wc->masks.ipv6_label;
- break;
-
- case MFF_IP_PROTO:
- mask->u8 = wc->masks.nw_proto;
- break;
- case MFF_IP_DSCP:
- mask->u8 = wc->masks.nw_tos & IP_DSCP_MASK;
- break;
- case MFF_IP_ECN:
- mask->u8 = wc->masks.nw_tos & IP_ECN_MASK;
- break;
-
- case MFF_ND_TARGET:
- mask->ipv6 = wc->masks.nd_target;
- break;
-
- case MFF_IP_TTL:
- mask->u8 = wc->masks.nw_ttl;
- break;
- case MFF_IP_FRAG:
- mask->u8 = wc->masks.nw_frag & FLOW_NW_FRAG_MASK;
- break;
-
- case MFF_ARP_OP:
- mask->u8 = wc->masks.nw_proto;
- break;
- case MFF_ARP_SPA:
- mask->be32 = wc->masks.nw_src;
- break;
- case MFF_ARP_TPA:
- mask->be32 = wc->masks.nw_dst;
- break;
- case MFF_ARP_SHA:
- case MFF_ND_SLL:
- memcpy(mask->mac, wc->masks.arp_sha, ETH_ADDR_LEN);
- break;
- case MFF_ARP_THA:
- case MFF_ND_TLL:
- memcpy(mask->mac, wc->masks.arp_tha, ETH_ADDR_LEN);
- break;
-
- case MFF_TCP_SRC:
- case MFF_UDP_SRC:
- mask->be16 = wc->masks.tp_src;
- break;
- case MFF_TCP_DST:
- case MFF_UDP_DST:
- mask->be16 = wc->masks.tp_dst;
- break;
-
- case MFF_ICMPV4_TYPE:
- case MFF_ICMPV6_TYPE:
- mask->u8 = ntohs(wc->masks.tp_src);
- break;
- case MFF_ICMPV4_CODE:
- case MFF_ICMPV6_CODE:
- mask->u8 = ntohs(wc->masks.tp_dst);
- break;
-
- case MFF_N_IDS:
- default:
- NOT_REACHED();
- }