Lines Matching refs:skb
145 static void ovs_ct_update_key(const struct sk_buff *skb, in ovs_ct_update_key() argument
154 ct = nf_ct_get(skb, &ctinfo); in ovs_ct_update_key()
170 void ovs_ct_fill_key(const struct sk_buff *skb, struct sw_flow_key *key) in ovs_ct_fill_key() argument
172 ovs_ct_update_key(skb, NULL, key, false); in ovs_ct_fill_key()
175 int ovs_ct_put_key(const struct sw_flow_key *key, struct sk_buff *skb) in ovs_ct_put_key() argument
177 if (nla_put_u32(skb, OVS_KEY_ATTR_CT_STATE, key->ct.state)) in ovs_ct_put_key()
181 nla_put_u16(skb, OVS_KEY_ATTR_CT_ZONE, key->ct.zone)) in ovs_ct_put_key()
185 nla_put_u32(skb, OVS_KEY_ATTR_CT_MARK, key->ct.mark)) in ovs_ct_put_key()
189 nla_put(skb, OVS_KEY_ATTR_CT_LABELS, sizeof(key->ct.labels), in ovs_ct_put_key()
196 static int ovs_ct_set_mark(struct sk_buff *skb, struct sw_flow_key *key, in ovs_ct_set_mark() argument
206 ct = nf_ct_get(skb, &ctinfo); in ovs_ct_set_mark()
223 static int ovs_ct_set_labels(struct sk_buff *skb, struct sw_flow_key *key, in ovs_ct_set_labels() argument
233 ct = nf_ct_get(skb, &ctinfo); in ovs_ct_set_labels()
255 static int ovs_ct_helper(struct sk_buff *skb, u16 proto) in ovs_ct_helper() argument
263 ct = nf_ct_get(skb, &ctinfo); in ovs_ct_helper()
277 protoff = ip_hdrlen(skb); in ovs_ct_helper()
280 u8 nexthdr = ipv6_hdr(skb)->nexthdr; in ovs_ct_helper()
284 ofs = ipv6_skip_exthdr(skb, sizeof(struct ipv6hdr), &nexthdr, in ovs_ct_helper()
298 return helper->help(skb, protoff, ct, ctinfo); in ovs_ct_helper()
305 u16 zone, struct sk_buff *skb) in handle_fragments() argument
307 struct ovs_skb_cb ovs_cb = *OVS_CB(skb); in handle_fragments()
313 memset(IPCB(skb), 0, sizeof(struct inet_skb_parm)); in handle_fragments()
314 err = ip_defrag(net, skb, user); in handle_fragments()
318 ovs_cb.mru = IPCB(skb)->frag_max_size; in handle_fragments()
324 memset(IP6CB(skb), 0, sizeof(struct inet6_skb_parm)); in handle_fragments()
325 reasm = nf_ct_frag6_gather(net, skb, user); in handle_fragments()
329 if (skb == reasm) { in handle_fragments()
330 kfree_skb(skb); in handle_fragments()
337 skb_get(skb); in handle_fragments()
341 skb_morph(skb, reasm); in handle_fragments()
342 skb->next = reasm->next; in handle_fragments()
344 ovs_cb.mru = IP6CB(skb)->frag_max_size; in handle_fragments()
347 kfree_skb(skb); in handle_fragments()
352 skb_clear_hash(skb); in handle_fragments()
353 skb->ignore_df = 1; in handle_fragments()
354 *OVS_CB(skb) = ovs_cb; in handle_fragments()
361 u16 proto, const struct sk_buff *skb) in ovs_ct_expect_find() argument
365 if (!nf_ct_get_tuplepr(skb, skb_network_offset(skb), proto, net, &tuple)) in ovs_ct_expect_find()
371 static bool skb_nfct_cached(const struct net *net, const struct sk_buff *skb, in skb_nfct_cached() argument
377 ct = nf_ct_get(skb, &ctinfo); in skb_nfct_cached()
397 struct sk_buff *skb) in __ovs_ct_lookup() argument
404 if (!skb_nfct_cached(net, skb, info)) { in __ovs_ct_lookup()
409 if (skb->nfct) in __ovs_ct_lookup()
410 nf_conntrack_put(skb->nfct); in __ovs_ct_lookup()
412 skb->nfct = &tmpl->ct_general; in __ovs_ct_lookup()
413 skb->nfctinfo = IP_CT_NEW; in __ovs_ct_lookup()
417 skb) != NF_ACCEPT) in __ovs_ct_lookup()
420 if (ovs_ct_helper(skb, info->family) != NF_ACCEPT) { in __ovs_ct_lookup()
426 ovs_ct_update_key(skb, info, key, true); in __ovs_ct_lookup()
434 struct sk_buff *skb) in ovs_ct_lookup() argument
438 exp = ovs_ct_expect_find(net, &info->zone, info->family, skb); in ovs_ct_lookup()
447 err = __ovs_ct_lookup(net, key, info, skb); in ovs_ct_lookup()
458 struct sk_buff *skb) in ovs_ct_commit() argument
472 err = __ovs_ct_lookup(net, key, info, skb); in ovs_ct_commit()
475 if (nf_conntrack_confirm(skb) != NF_ACCEPT) in ovs_ct_commit()
495 int ovs_ct_execute(struct net *net, struct sk_buff *skb, in ovs_ct_execute() argument
503 nh_ofs = skb_network_offset(skb); in ovs_ct_execute()
504 skb_pull(skb, nh_ofs); in ovs_ct_execute()
507 err = handle_fragments(net, key, info->zone.id, skb); in ovs_ct_execute()
513 err = ovs_ct_commit(net, key, info, skb); in ovs_ct_execute()
515 err = ovs_ct_lookup(net, key, info, skb); in ovs_ct_execute()
520 err = ovs_ct_set_mark(skb, key, info->mark.value, in ovs_ct_execute()
526 err = ovs_ct_set_labels(skb, key, &info->labels.value, in ovs_ct_execute()
529 skb_push(skb, nh_ofs); in ovs_ct_execute()
531 kfree_skb(skb); in ovs_ct_execute()
723 struct sk_buff *skb) in ovs_ct_action_to_attr() argument
727 start = nla_nest_start(skb, OVS_ACTION_ATTR_CT); in ovs_ct_action_to_attr()
731 if (ct_info->commit && nla_put_flag(skb, OVS_CT_ATTR_COMMIT)) in ovs_ct_action_to_attr()
734 nla_put_u16(skb, OVS_CT_ATTR_ZONE, ct_info->zone.id)) in ovs_ct_action_to_attr()
737 nla_put(skb, OVS_CT_ATTR_MARK, sizeof(ct_info->mark), in ovs_ct_action_to_attr()
742 nla_put(skb, OVS_CT_ATTR_LABELS, sizeof(ct_info->labels), in ovs_ct_action_to_attr()
746 if (nla_put_string(skb, OVS_CT_ATTR_HELPER, in ovs_ct_action_to_attr()
751 nla_nest_end(skb, start); in ovs_ct_action_to_attr()