Lines Matching refs:info
238 const struct ovs_conntrack_info *info,
269 if (info)
270 zone = &info->zone;
530 const struct ovs_conntrack_info *info,
544 (key->ct_zone == info->zone.id);
546 if (*ct_executed || (!key->ct_state && info->force)) {
547 ct = ovs_ct_find_existing(net, &info->zone, info->family, skb,
558 const struct ovs_conntrack_info *info,
567 ct = ovs_ct_executed(net, key, info, skb, &ct_executed);
576 if (!nf_ct_zone_equal_any(info->ct, nf_ct_zone(ct)))
578 if (info->helper) {
582 if (help && rcu_access_pointer(help->helper) != info->helper)
585 if (info->nf_ct_timeout) {
589 if (!timeout_ext || info->nf_ct_timeout !=
594 if (info->force && CTINFO2DIR(ctinfo) != IP_CT_DIR_ORIGINAL) {
663 const struct ovs_conntrack_info *info,
669 if (!(info->nat & OVS_CT_NAT))
671 if (info->nat & OVS_CT_SRC_NAT)
673 if (info->nat & OVS_CT_DST_NAT)
676 err = nf_ct_nat(skb, ct, ctinfo, &action, &info->range, info->commit);
687 const struct ovs_conntrack_info *info,
695 /* Pass 'skb' through conntrack in 'net', using zone configured in 'info', if
702 const struct ovs_conntrack_info *info,
710 bool cached = skb_nfct_cached(net, key, info, skb);
717 .pf = info->family,
720 struct nf_conn *tmpl = info->ct;
742 ovs_ct_update_key(skb, info, key, true, true);
759 if (info->nat && !(key->ct_state & OVS_CS_F_NAT_MASK) &&
760 (nf_ct_is_confirmed(ct) || info->commit) &&
761 ovs_ct_nat(net, key, info, skb, ct, ctinfo) != NF_ACCEPT) {
771 if (!nf_ct_is_confirmed(ct) && info->commit &&
772 info->helper && !nfct_help(ct)) {
773 int err = __nf_ct_try_assign_helper(ct, info->ct,
780 if (info->nat && !nfct_seqadj(ct)) {
793 info->commit) &&
794 nf_ct_helper(skb, ct, ctinfo, info->family) != NF_ACCEPT) {
814 const struct ovs_conntrack_info *info,
820 err = __ovs_ct_lookup(net, key, info, skb);
844 const struct ovs_ct_limit_info *info, u16 zone)
846 return &info->limits[zone & (CT_LIMIT_HASH_BUCKETS - 1)];
850 static void ct_limit_set(const struct ovs_ct_limit_info *info,
856 head = ct_limit_hash_bucket(info, new_ct_limit->zone);
870 static void ct_limit_del(const struct ovs_ct_limit_info *info, u16 zone)
876 head = ct_limit_hash_bucket(info, zone);
887 static u32 ct_limit_get(const struct ovs_ct_limit_info *info, u16 zone)
892 head = ct_limit_hash_bucket(info, zone);
898 return info->default_limit;
902 const struct ovs_conntrack_info *info,
910 conncount_key = info->zone.id;
912 per_zone_limit = ct_limit_get(ct_limit_info, info->zone.id);
917 &conncount_key, tuple, &info->zone);
927 const struct ovs_conntrack_info *info,
934 err = __ovs_ct_lookup(net, key, info, skb);
946 err = ovs_ct_check_limit(net, info,
951 info->zone.id);
965 if (info->have_eventmask) {
969 cache->ctmask = info->eventmask;
976 if (info->mark.mask) {
977 err = ovs_ct_set_mark(ct, key, info->mark.value,
978 info->mark.mask);
983 err = ovs_ct_init_labels(ct, key, &info->labels.value,
984 &info->labels.mask);
990 labels_nonzero(&info->labels.mask)) {
991 err = ovs_ct_set_labels(ct, key, &info->labels.value,
992 &info->labels.mask);
1010 const struct ovs_conntrack_info *info)
1019 err = nf_ct_skb_network_trim(skb, info->family);
1026 err = ovs_ct_handle_fragments(net, key, info->zone.id,
1027 info->family, skb);
1032 if (info->commit)
1033 err = ovs_ct_commit(net, key, info, skb);
1035 err = ovs_ct_lookup(net, key, info, skb);
1061 struct ovs_conntrack_info *info, bool log)
1067 bool ip_vers = (info->family == NFPROTO_IPV6);
1101 if (info->nat) {
1105 info->nat |= OVS_CT_NAT;
1106 info->nat |= ((type == OVS_NAT_ATTR_SRC)
1111 nla_memcpy(&info->range.min_addr, a,
1112 sizeof(info->range.min_addr));
1113 info->range.flags |= NF_NAT_RANGE_MAP_IPS;
1118 nla_memcpy(&info->range.max_addr, a,
1119 sizeof(info->range.max_addr));
1120 info->range.flags |= NF_NAT_RANGE_MAP_IPS;
1124 info->range.min_proto.all = htons(nla_get_u16(a));
1125 info->range.flags |= NF_NAT_RANGE_PROTO_SPECIFIED;
1130 info->range.max_proto.all = htons(nla_get_u16(a));
1131 info->range.flags |= NF_NAT_RANGE_PROTO_SPECIFIED;
1135 info->range.flags |= NF_NAT_RANGE_PERSISTENT;
1139 info->range.flags |= NF_NAT_RANGE_PROTO_RANDOM;
1143 info->range.flags |= NF_NAT_RANGE_PROTO_RANDOM_FULLY;
1156 if (!info->nat) {
1158 if (info->range.flags) {
1164 info->nat = OVS_CT_NAT; /* NAT existing connections. */
1165 } else if (!info->commit) {
1172 if (info->range.flags & NF_NAT_RANGE_MAP_IPS && !have_ip_max) {
1173 memcpy(&info->range.max_addr, &info->range.min_addr,
1174 sizeof(info->range.max_addr));
1177 if (info->range.flags & NF_NAT_RANGE_PROTO_SPECIFIED &&
1179 info->range.max_proto.all = info->range.min_proto.all;
1206 static int parse_ct(const struct nlattr *attr, struct ovs_conntrack_info *info,
1235 info->force = true;
1238 info->commit = true;
1242 info->zone.id = nla_get_u16(a);
1253 info->mark = *mark;
1265 info->labels = *labels;
1278 int err = parse_nat(a, info, log);
1286 info->have_eventmask = true;
1287 info->eventmask = nla_get_u32(a);
1291 memcpy(info->timeout, nla_data(a), nla_len(a));
1292 if (!string_is_terminated(info->timeout, nla_len(a))) {
1307 if (!info->commit && info->mark.mask) {
1314 if (!info->commit && labels_nonzero(&info->labels.mask)) {
1414 static bool ovs_ct_nat_to_attr(const struct ovs_conntrack_info *info,
1423 if (info->nat & OVS_CT_SRC_NAT) {
1426 } else if (info->nat & OVS_CT_DST_NAT) {
1433 if (info->range.flags & NF_NAT_RANGE_MAP_IPS) {
1435 info->family == NFPROTO_IPV4) {
1437 info->range.min_addr.ip) ||
1438 (info->range.max_addr.ip
1439 != info->range.min_addr.ip &&
1441 info->range.max_addr.ip))))
1444 info->family == NFPROTO_IPV6) {
1446 &info->range.min_addr.in6) ||
1447 (memcmp(&info->range.max_addr.in6,
1448 &info->range.min_addr.in6,
1449 sizeof(info->range.max_addr.in6)) &&
1451 &info->range.max_addr.in6))))
1457 if (info->range.flags & NF_NAT_RANGE_PROTO_SPECIFIED &&
1459 ntohs(info->range.min_proto.all)) ||
1460 (info->range.max_proto.all != info->range.min_proto.all &&
1462 ntohs(info->range.max_proto.all)))))
1465 if (info->range.flags & NF_NAT_RANGE_PERSISTENT &&
1468 if (info->range.flags & NF_NAT_RANGE_PROTO_RANDOM &&
1471 if (info->range.flags & NF_NAT_RANGE_PROTO_RANDOM_FULLY &&
1588 const struct ovs_ct_limit_info *info = ovs_net->ct_limit_info;
1591 nf_conncount_destroy(net, NFPROTO_INET, info->data);
1593 struct hlist_head *head = &info->limits[i];
1600 kfree(info->limits);
1601 kfree(info);
1605 ovs_ct_limit_cmd_reply_start(struct genl_info *info, u8 cmd,
1608 struct ovs_header *ovs_header = genl_info_userhdr(info);
1615 *ovs_reply_header = genlmsg_put(skb, info->snd_portid,
1616 info->snd_seq,
1638 struct ovs_ct_limit_info *info)
1651 info->default_limit = zone_limit->limit;
1668 ct_limit_set(info, ct_limit);
1683 struct ovs_ct_limit_info *info)
1696 info->default_limit = OVS_CT_LIMIT_DEFAULT;
1703 ct_limit_del(info, zone);
1717 static int ovs_ct_limit_get_default_limit(struct ovs_ct_limit_info *info,
1722 .limit = info->default_limit,
1748 struct ovs_ct_limit_info *info,
1762 err = ovs_ct_limit_get_default_limit(info, reply);
1770 limit = ct_limit_get(info, zone);
1774 net, info->data, zone, limit, reply);
1790 struct ovs_ct_limit_info *info,
1797 err = ovs_ct_limit_get_default_limit(info, reply);
1803 head = &info->limits[i];
1805 err = __ovs_ct_limit_get_zone_limit(net, info->data,
1817 static int ovs_ct_limit_cmd_set(struct sk_buff *skb, struct genl_info *info)
1819 struct nlattr **a = info->attrs;
1826 reply = ovs_ct_limit_cmd_reply_start(info, OVS_CT_LIMIT_CMD_SET,
1844 return genlmsg_reply(reply, info);
1851 static int ovs_ct_limit_cmd_del(struct sk_buff *skb, struct genl_info *info)
1853 struct nlattr **a = info->attrs;
1860 reply = ovs_ct_limit_cmd_reply_start(info, OVS_CT_LIMIT_CMD_DEL,
1876 return genlmsg_reply(reply, info);
1883 static int ovs_ct_limit_cmd_get(struct sk_buff *skb, struct genl_info *info)
1885 struct nlattr **a = info->attrs;
1894 reply = ovs_ct_limit_cmd_reply_start(info, OVS_CT_LIMIT_CMD_GET,
1920 return genlmsg_reply(reply, info);