Lines Matching defs: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))
1385 ct_info.timeout);
1387 ct_info.nf_ct_timeout = rcu_dereference(
1388 nf_ct_timeout_find(ct_info.ct)->timeout);
1393 err = nf_ct_add_helper(ct_info.ct, helper, ct_info.family,
1394 key->ip.proto, ct_info.nat, &ct_info.helper);
1401 err = ovs_nla_add_action(sfa, OVS_ACTION_ATTR_CT, &ct_info,
1402 sizeof(ct_info), log);
1406 if (ct_info.commit)
1407 __set_bit(IPS_CONFIRMED_BIT, &ct_info.ct->status);
1410 __ovs_ct_free_action(&ct_info);
1482 int ovs_ct_action_to_attr(const struct ovs_conntrack_info *ct_info,
1491 if (ct_info->commit && nla_put_flag(skb, ct_info->force
1496 nla_put_u16(skb, OVS_CT_ATTR_ZONE, ct_info->zone.id))
1498 if (IS_ENABLED(CONFIG_NF_CONNTRACK_MARK) && ct_info->mark.mask &&
1499 nla_put(skb, OVS_CT_ATTR_MARK, sizeof(ct_info->mark),
1500 &ct_info->mark))
1503 labels_nonzero(&ct_info->labels.mask) &&
1504 nla_put(skb, OVS_CT_ATTR_LABELS, sizeof(ct_info->labels),
1505 &ct_info->labels))
1507 if (ct_info->helper) {
1509 ct_info->helper->name))
1512 if (ct_info->have_eventmask &&
1513 nla_put_u32(skb, OVS_CT_ATTR_EVENTMASK, ct_info->eventmask))
1515 if (ct_info->timeout[0]) {
1516 if (nla_put_string(skb, OVS_CT_ATTR_TIMEOUT, ct_info->timeout))
1521 if (ct_info->nat && !ovs_ct_nat_to_attr(ct_info, skb))
1531 struct ovs_conntrack_info *ct_info = nla_data(a);
1533 __ovs_ct_free_action(ct_info);
1536 static void __ovs_ct_free_action(struct ovs_conntrack_info *ct_info)
1538 if (ct_info->helper) {
1540 if (ct_info->nat)
1541 nf_nat_helper_put(ct_info->helper);
1543 nf_conntrack_helper_put(ct_info->helper);
1545 if (ct_info->ct) {
1546 if (ct_info->timeout[0])
1547 nf_ct_destroy_timeout(ct_info->ct);
1548 nf_ct_tmpl_free(ct_info->ct);