Lines Matching defs:ct_info

107 static void __ovs_ct_free_action(struct ovs_conntrack_info *ct_info);
1383 struct ovs_conntrack_info ct_info;
1394 memset(&ct_info, 0, sizeof(ct_info));
1395 ct_info.family = family;
1397 nf_ct_zone_init(&ct_info.zone, NF_CT_DEFAULT_ZONE_ID,
1400 err = parse_ct(attr, &ct_info, &helper, log);
1405 ct_info.ct = nf_ct_tmpl_alloc(net, &ct_info.zone, GFP_KERNEL);
1406 if (!ct_info.ct) {
1411 if (ct_info.timeout[0]) {
1412 if (nf_ct_set_timeout(net, ct_info.ct, family, key->ip.proto,
1413 ct_info.timeout))
1416 ct_info.timeout);
1418 ct_info.nf_ct_timeout = rcu_dereference(
1419 nf_ct_timeout_find(ct_info.ct)->timeout);
1424 err = nf_ct_add_helper(ct_info.ct, helper, ct_info.family,
1425 key->ip.proto, ct_info.nat, &ct_info.helper);
1432 err = ovs_nla_add_action(sfa, OVS_ACTION_ATTR_CT, &ct_info,
1433 sizeof(ct_info), log);
1437 if (ct_info.commit)
1438 __set_bit(IPS_CONFIRMED_BIT, &ct_info.ct->status);
1441 __ovs_ct_free_action(&ct_info);
1513 int ovs_ct_action_to_attr(const struct ovs_conntrack_info *ct_info,
1522 if (ct_info->commit && nla_put_flag(skb, ct_info->force
1527 nla_put_u16(skb, OVS_CT_ATTR_ZONE, ct_info->zone.id))
1529 if (IS_ENABLED(CONFIG_NF_CONNTRACK_MARK) && ct_info->mark.mask &&
1530 nla_put(skb, OVS_CT_ATTR_MARK, sizeof(ct_info->mark),
1531 &ct_info->mark))
1534 labels_nonzero(&ct_info->labels.mask) &&
1535 nla_put(skb, OVS_CT_ATTR_LABELS, sizeof(ct_info->labels),
1536 &ct_info->labels))
1538 if (ct_info->helper) {
1540 ct_info->helper->name))
1543 if (ct_info->have_eventmask &&
1544 nla_put_u32(skb, OVS_CT_ATTR_EVENTMASK, ct_info->eventmask))
1546 if (ct_info->timeout[0]) {
1547 if (nla_put_string(skb, OVS_CT_ATTR_TIMEOUT, ct_info->timeout))
1552 if (ct_info->nat && !ovs_ct_nat_to_attr(ct_info, skb))
1562 struct ovs_conntrack_info *ct_info = nla_data(a);
1564 __ovs_ct_free_action(ct_info);
1567 static void __ovs_ct_free_action(struct ovs_conntrack_info *ct_info)
1569 if (ct_info->helper) {
1571 if (ct_info->nat)
1572 nf_nat_helper_put(ct_info->helper);
1574 nf_conntrack_helper_put(ct_info->helper);
1576 if (ct_info->ct) {
1577 if (ct_info->timeout[0])
1578 nf_ct_destroy_timeout(ct_info->ct);
1579 nf_ct_tmpl_free(ct_info->ct);