-tnl_port_config_from_nlattr(const struct nlattr *options, size_t options_len,
- struct nlattr *a[OVS_TUNNEL_ATTR_MAX + 1])
-{
- static const struct nl_policy ovs_tunnel_policy[] = {
- [OVS_TUNNEL_ATTR_FLAGS] = { .type = NL_A_U32, .optional = true },
- [OVS_TUNNEL_ATTR_DST_IPV4] = { .type = NL_A_BE32, .optional = true },
- [OVS_TUNNEL_ATTR_SRC_IPV4] = { .type = NL_A_BE32, .optional = true },
- [OVS_TUNNEL_ATTR_IN_KEY] = { .type = NL_A_BE64, .optional = true },
- [OVS_TUNNEL_ATTR_OUT_KEY] = { .type = NL_A_BE64, .optional = true },
- [OVS_TUNNEL_ATTR_TOS] = { .type = NL_A_U8, .optional = true },
- [OVS_TUNNEL_ATTR_TTL] = { .type = NL_A_U8, .optional = true },
- [OVS_TUNNEL_ATTR_DST_PORT] = { .type = NL_A_U16, .optional = true },
- };
- struct ofpbuf buf;
-
- ofpbuf_use_const(&buf, options, options_len);
- if (!nl_policy_parse(&buf, 0, ovs_tunnel_policy,
- a, ARRAY_SIZE(ovs_tunnel_policy))) {
- return EINVAL;
- }
- return 0;
-}
-
-static uint64_t
-get_be64_or_zero(const struct nlattr *a)
-{
- return a ? ntohll(nl_attr_get_be64(a)) : 0;
-}
-
-static int
-unparse_tunnel_config(const char *name OVS_UNUSED, const char *type OVS_UNUSED,
- const struct nlattr *options, size_t options_len,
- struct smap *args)