From 617e10e71ca1719a8f0070354489858e3cceba32 Mon Sep 17 00:00:00 2001 From: Simon Horman Date: Wed, 5 Jun 2013 14:28:48 +0900 Subject: [PATCH] odp-util: Export odp_tun_key_from_attr() Rename tun_key_from_attr() as odp_tun_key_from_attr() and export it. This is in preparation for calling this function outside of odp-util.c. Signed-off-by: Simon Horman Signed-off-by: Ben Pfaff --- lib/odp-util.c | 8 ++++---- lib/odp-util.h | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/odp-util.c b/lib/odp-util.c index 030ad5e5a..cc8b1dd84 100644 --- a/lib/odp-util.c +++ b/lib/odp-util.c @@ -786,8 +786,8 @@ tunnel_key_attr_len(int type) return -1; } -static enum odp_key_fitness -tun_key_from_attr(const struct nlattr *attr, struct flow_tnl *tun) +enum odp_key_fitness +odp_tun_key_from_attr(const struct nlattr *attr, struct flow_tnl *tun) { unsigned int left; const struct nlattr *a; @@ -919,7 +919,7 @@ format_odp_key_attr(const struct nlattr *a, struct ds *ds) case OVS_KEY_ATTR_TUNNEL: memset(&tun_key, 0, sizeof tun_key); - if (tun_key_from_attr(a, &tun_key) == ODP_FIT_ERROR) { + if (odp_tun_key_from_attr(a, &tun_key) == ODP_FIT_ERROR) { ds_put_format(ds, "(error)"); } else { ds_put_format(ds, "(tun_id=0x%"PRIx64",src="IP_FMT",dst="IP_FMT"," @@ -2089,7 +2089,7 @@ odp_flow_key_to_flow(const struct nlattr *key, size_t key_len, if (present_attrs & (UINT64_C(1) << OVS_KEY_ATTR_TUNNEL)) { enum odp_key_fitness res; - res = tun_key_from_attr(attrs[OVS_KEY_ATTR_TUNNEL], &flow->tunnel); + res = odp_tun_key_from_attr(attrs[OVS_KEY_ATTR_TUNNEL], &flow->tunnel); if (res == ODP_FIT_ERROR) { return ODP_FIT_ERROR; } else if (res == ODP_FIT_PERFECT) { diff --git a/lib/odp-util.h b/lib/odp-util.h index 0455370d3..621341890 100644 --- a/lib/odp-util.h +++ b/lib/odp-util.h @@ -87,6 +87,9 @@ struct odputil_keybuf { uint32_t keybuf[DIV_ROUND_UP(ODPUTIL_FLOW_KEY_BYTES, 4)]; }; +enum odp_key_fitness odp_tun_key_from_attr(const struct nlattr *, + struct flow_tnl *); + void odp_flow_key_format(const struct nlattr *, size_t, struct ds *); int odp_flow_key_from_string(const char *s, const struct simap *port_names, struct ofpbuf *); -- 2.20.1