ofproto-dpif-xlate: Hide 'struct xlate_ctx'.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
ofproto-dpif: Check for MPLS depth at the flow.

The earlier check on base_flow.mpls_depth seemed wrong, as multiple
MPLS push actions would have resulted in the flow.mpls_depth being
set to 1 each time.

Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
ofproto-dpif-xlate: Harmonize naming of internal functions.

It would be good to be able to harminize the use of "xlate", "execute",
"compose", etc.  "xlate" clearly relates to the use of the various
translation context structures, but the distinction between "execute" and
"compose" is not that clear, so these names could be going either way.
Choose to go with "compose", keeping with the older tradition.

Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
ofproto-dpif-xlate: Make code more readable via 'flow' and 'wc' locals.

'ctx->xin->flow' and 'ctx->xout->wc' are both pretty long.  Where it gets
in the way of code readability, this patch replaces them by 'xin' and
'xout' using local variables.

Also, replace an explicit comparison against IP and IPv6 Ethertypes by
a call to is_ip_any().

Co-authored-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
ofp-print: Avoid returning static data.

Returning a static data buffer makes code more brittle and definitely
not thread-safe, so this commit switches to using a caller-provided
buffer instead.

Signed-off-by: Ben Pfaff <blp@nicira.com>