'Openflow 1.1 spec clarifies that wildcards should not be set when the protocol in
question is not matched i.e., dl_type != 0x800 -> no wildcards for IP.
Test this here'

def test_pack_flow_mod_openflow_dl_type_wildcards(self):

    def show_wildcards(w):
        parts = [k.lower()[len('OFPFW_'):] for (k, v) in ofp_flow_wildcards_rev_map.iteritems() if ((v & w) == v)]
        nw_src_bits = ((w & OFPFW_NW_SRC_MASK) >> OFPFW_NW_SRC_SHIFT)
        nw_src_bits = ((w & OFPFW_NW_SRC_MASK) >> OFPFW_NW_SRC_SHIFT)
        if (nw_src_bits > 0):
            parts.append(('nw_src(/%d)' % (32 - nw_src_bits)))
        nw_dst_bits = ((w & OFPFW_NW_DST_MASK) >> OFPFW_NW_DST_SHIFT)
        if (nw_dst_bits > 0):
            parts.append(('nw_dst(/%d)' % (32 - nw_dst_bits)))
        return '|'.join(parts)
    def test_wildcards(match, expected):
        (packed,) = struct.unpack_from('!L', match.pack(flow_mod=True))
        self.assertEquals(packed, expected, ('packed:    %s    <>    expected:    %s' % (show_wildcards(packed), show_wildcards(expected))))
    test_wildcards(ofp_match(), (OFPFW_ALL & (~ (((((OFPFW_NW_TOS | OFPFW_NW_PROTO) | OFPFW_NW_SRC_MASK) | OFPFW_NW_DST_MASK) | OFPFW_TP_SRC) | OFPFW_TP_DST))))
    all_normalized = (((OFPFW_ALL & (~ (OFPFW_NW_SRC_MASK | OFPFW_NW_DST_MASK))) | OFPFW_NW_SRC_ALL) | OFPFW_NW_DST_ALL)
    test_wildcards(ofp_match(dl_type=2054), (all_normalized & (~ (((OFPFW_NW_TOS | OFPFW_TP_SRC) | OFPFW_TP_DST) | OFPFW_DL_TYPE))))
    test_wildcards(ofp_match(dl_type=2048), (all_normalized & (~ ((OFPFW_TP_SRC | OFPFW_TP_DST) | OFPFW_DL_TYPE))))
    test_wildcards(ofp_match(dl_type=2048, nw_proto=6), (all_normalized & (~ (OFPFW_DL_TYPE | OFPFW_NW_PROTO))))
