Lines Matching refs:ct_info

107 static void __ovs_ct_free_action(struct ovs_conntrack_info *ct_info);
1352 struct ovs_conntrack_info ct_info;
1363 memset(&ct_info, 0, sizeof(ct_info));
1364 ct_info.family = family;
1366 nf_ct_zone_init(&ct_info.zone, NF_CT_DEFAULT_ZONE_ID,
1369 err = parse_ct(attr, &ct_info, &helper, log);
1374 ct_info.ct = nf_ct_tmpl_alloc(net, &ct_info.zone, GFP_KERNEL);
1375 if (!ct_info.ct) {
1380 if (ct_info.timeout[0]) {
1381 if (nf_ct_set_timeout(net, ct_info.ct, family, key->ip.proto,
1382 ct_info.timeout))
1384 "policy `%s'\n", ct_info.timeout);
1386 ct_info.nf_ct_timeout = rcu_dereference(
1387 nf_ct_timeout_find(ct_info.ct)->timeout);
1392 err = nf_ct_add_helper(ct_info.ct, helper, ct_info.family,
1393 key->ip.proto, ct_info.nat, &ct_info.helper);
1400 err = ovs_nla_add_action(sfa, OVS_ACTION_ATTR_CT, &ct_info,
1401 sizeof(ct_info), log);
1405 if (ct_info.commit)
1406 __set_bit(IPS_CONFIRMED_BIT, &ct_info.ct->status);
1409 __ovs_ct_free_action(&ct_info);
1481 int ovs_ct_action_to_attr(const struct ovs_conntrack_info *ct_info,
1490 if (ct_info->commit && nla_put_flag(skb, ct_info->force
1495 nla_put_u16(skb, OVS_CT_ATTR_ZONE, ct_info->zone.id))
1497 if (IS_ENABLED(CONFIG_NF_CONNTRACK_MARK) && ct_info->mark.mask &&
1498 nla_put(skb, OVS_CT_ATTR_MARK, sizeof(ct_info->mark),
1499 &ct_info->mark))
1502 labels_nonzero(&ct_info->labels.mask) &&
1503 nla_put(skb, OVS_CT_ATTR_LABELS, sizeof(ct_info->labels),
1504 &ct_info->labels))
1506 if (ct_info->helper) {
1508 ct_info->helper->name))
1511 if (ct_info->have_eventmask &&
1512 nla_put_u32(skb, OVS_CT_ATTR_EVENTMASK, ct_info->eventmask))
1514 if (ct_info->timeout[0]) {
1515 if (nla_put_string(skb, OVS_CT_ATTR_TIMEOUT, ct_info->timeout))
1520 if (ct_info->nat && !ovs_ct_nat_to_attr(ct_info, skb))
1530 struct ovs_conntrack_info *ct_info = nla_data(a);
1532 __ovs_ct_free_action(ct_info);
1535 static void __ovs_ct_free_action(struct ovs_conntrack_info *ct_info)
1537 if (ct_info->helper) {
1539 if (ct_info->nat)
1540 nf_nat_helper_put(ct_info->helper);
1542 nf_conntrack_helper_put(ct_info->helper);
1544 if (ct_info->ct) {
1545 if (ct_info->timeout[0])
1546 nf_ct_destroy_timeout(ct_info->ct);
1547 nf_ct_tmpl_free(ct_info->ct);