Lines Matching refs:key
89 sizeof((match)->key->field), is_mask); \
91 (match)->mask->key.field = value; \
93 (match)->key->field = value; \
100 memcpy((u8 *)&(match)->mask->key + offset, value_p, \
103 memcpy((u8 *)(match)->key + offset, value_p, len); \
113 sizeof((match)->key->field), is_mask); \
115 memset((u8 *)&(match)->mask->key.field, value, \
116 sizeof((match)->mask->key.field)); \
118 memset((u8 *)&(match)->key->field, value, \
119 sizeof((match)->key->field)); \
148 if (match->key->eth.type == htons(ETH_P_ARP) in match_validate()
149 || match->key->eth.type == htons(ETH_P_RARP)) { in match_validate()
151 if (match->mask && (match->mask->key.eth.type == htons(0xffff))) in match_validate()
155 if (eth_p_mpls(match->key->eth.type)) { in match_validate()
157 if (match->mask && (match->mask->key.eth.type == htons(0xffff))) in match_validate()
161 if (match->key->eth.type == htons(ETH_P_IP)) { in match_validate()
163 if (match->mask && (match->mask->key.eth.type == htons(0xffff))) in match_validate()
166 if (match->key->ip.frag != OVS_FRAG_TYPE_LATER) { in match_validate()
167 if (match->key->ip.proto == IPPROTO_UDP) { in match_validate()
169 if (match->mask && (match->mask->key.ip.proto == 0xff)) in match_validate()
173 if (match->key->ip.proto == IPPROTO_SCTP) { in match_validate()
175 if (match->mask && (match->mask->key.ip.proto == 0xff)) in match_validate()
179 if (match->key->ip.proto == IPPROTO_TCP) { in match_validate()
182 if (match->mask && (match->mask->key.ip.proto == 0xff)) { in match_validate()
188 if (match->key->ip.proto == IPPROTO_ICMP) { in match_validate()
190 if (match->mask && (match->mask->key.ip.proto == 0xff)) in match_validate()
196 if (match->key->eth.type == htons(ETH_P_IPV6)) { in match_validate()
198 if (match->mask && (match->mask->key.eth.type == htons(0xffff))) in match_validate()
201 if (match->key->ip.frag != OVS_FRAG_TYPE_LATER) { in match_validate()
202 if (match->key->ip.proto == IPPROTO_UDP) { in match_validate()
204 if (match->mask && (match->mask->key.ip.proto == 0xff)) in match_validate()
208 if (match->key->ip.proto == IPPROTO_SCTP) { in match_validate()
210 if (match->mask && (match->mask->key.ip.proto == 0xff)) in match_validate()
214 if (match->key->ip.proto == IPPROTO_TCP) { in match_validate()
217 if (match->mask && (match->mask->key.ip.proto == 0xff)) { in match_validate()
223 if (match->key->ip.proto == IPPROTO_ICMPV6) { in match_validate()
225 if (match->mask && (match->mask->key.ip.proto == 0xff)) in match_validate()
228 if (match->key->tp.src == in match_validate()
230 match->key->tp.src == htons(NDISC_NEIGHBOUR_ADVERTISEMENT)) { in match_validate()
232 if (match->mask && (match->mask->key.tp.src == htons(0xff))) in match_validate()
423 if (nla_len(a) > sizeof(match->key->tun_opts)) { in genev_tun_opt_from_nlattr()
425 nla_len(a), sizeof(match->key->tun_opts)); in genev_tun_opt_from_nlattr()
453 if (match->key->tun_opts_len != nla_len(a)) { in genev_tun_opt_from_nlattr()
455 match->key->tun_opts_len, nla_len(a)); in genev_tun_opt_from_nlattr()
481 BUILD_BUG_ON(sizeof(opts) > sizeof(match->key->tun_opts)); in vxlan_tun_opt_from_nlattr()
612 if (!match->key->tun_key.ipv4_dst) { in ipv4_tun_from_nlattr()
883 sizeof(match->key->ipv6.addr.src), in ovs_key_from_nlattrs()
887 sizeof(match->key->ipv6.addr.dst), in ovs_key_from_nlattrs()
989 sizeof(match->key->ipv6.nd.target), in ovs_key_from_nlattrs()
1119 if (match->key->tun_key.ipv4_dst) in ovs_nla_get_match()
1216 const struct sw_flow_key *key, bool log) in ovs_nla_get_identifier() argument
1227 memcpy(new_key, key, sizeof(*key)); in ovs_nla_get_identifier()
1254 struct sw_flow_key *key, in ovs_nla_get_flow_metadata() argument
1267 match.key = key; in ovs_nla_get_flow_metadata()
1269 key->phy.in_port = DP_MAX_PORTS; in ovs_nla_get_flow_metadata()
1521 return ovs_nla_put_key(&flow->key, &flow->key, in ovs_nla_put_masked_key()
1528 return ovs_nla_put_key(&flow->key, &flow->mask->key, in ovs_nla_put_mask()
1645 const struct sw_flow_key *key,
1650 const struct sw_flow_key *key, int depth, in validate_and_copy_sample() argument
1689 err = __ovs_nla_copy_actions(actions, key, depth + 1, sfa, in validate_and_copy_sample()
1701 struct sw_flow_key *key, in ovs_match_init() argument
1705 match->key = key; in ovs_match_init()
1708 memset(key, 0, sizeof(*key)); in ovs_match_init()
1711 memset(&mask->key, 0, sizeof(mask->key)); in ovs_match_init()
1716 static int validate_geneve_opts(struct sw_flow_key *key) in validate_geneve_opts() argument
1719 int opts_len = key->tun_opts_len; in validate_geneve_opts()
1722 option = (struct geneve_opt *)TUN_METADATA_OPTS(key, key->tun_opts_len); in validate_geneve_opts()
1739 key->tun_key.tun_flags |= crit_opt ? TUNNEL_CRIT_OPT : 0; in validate_geneve_opts()
1748 struct sw_flow_key key; in validate_and_copy_set_tun() local
1753 ovs_match_init(&match, &key, NULL); in validate_and_copy_set_tun()
1758 if (key.tun_opts_len) { in validate_and_copy_set_tun()
1761 err = validate_geneve_opts(&key); in validate_and_copy_set_tun()
1775 sizeof(*tun_info) + key.tun_opts_len, log); in validate_and_copy_set_tun()
1780 tun_info->tunnel = key.tun_key; in validate_and_copy_set_tun()
1781 tun_info->options_len = key.tun_opts_len; in validate_and_copy_set_tun()
1789 TUN_METADATA_OPTS(&key, key.tun_opts_len), key.tun_opts_len); in validate_and_copy_set_tun()
2012 const struct sw_flow_key *key, in __ovs_nla_copy_actions() argument
2128 err = validate_set(a, key, sfa, in __ovs_nla_copy_actions()
2135 err = validate_set(a, key, sfa, in __ovs_nla_copy_actions()
2142 err = validate_and_copy_sample(a, key, depth, sfa, in __ovs_nla_copy_actions()
2168 const struct sw_flow_key *key, in ovs_nla_copy_actions() argument
2177 err = __ovs_nla_copy_actions(attr, key, 0, sfa, key->eth.type, in ovs_nla_copy_actions()
2178 key->eth.tci, log); in ovs_nla_copy_actions()