flow->in_port = OFPP_NONE;
goto exit;
}
+ flow->in_port = ofport->ofp_port;
port = ofport_dpif_cast(ofport);
/* XXX: Since the tunnel module is not scoped per backer, it's
}
}
-/* Transforms 'flow' so that it appears to have been received by a tunnel
- * OpenFlow port controlled by this module instead of the datapath port it
- * actually came in on. Sets 'flow''s in_port to the appropriate OpenFlow port
- * number. Returns the 'ofport' corresponding to the new in_port.
+/* Looks in the table of tunnels for a tunnel matching the metadata in 'flow'.
+ * Returns the 'ofport' corresponding to the new in_port, or a null pointer if
+ * none is found.
*
* Callers should verify that 'flow' needs to be received by calling
- * tnl_port_should_receive() before this function.
- *
- * Leaves 'flow' untouched and returns null if unsuccessful. */
+ * tnl_port_should_receive() before this function. */
const struct ofport *
-tnl_port_receive(struct flow *flow)
+tnl_port_receive(const struct flow *flow)
{
char *pre_flow_str = NULL;
struct tnl_port *tnl_port;
pre_flow_str = flow_to_string(flow);
}
- flow->in_port = tnl_port->ofport->ofp_port;
- /* Keep flow->tunnel to allow matching on tunnel metadata */
-
if (pre_flow_str) {
char *post_flow_str = flow_to_string(flow);
char *tnl_str = tnl_port_fmt(tnl_port);
struct tnl_port *tnl_port_add(const struct ofport *, uint32_t odp_port);
void tnl_port_del(struct tnl_port *);
-const struct ofport *tnl_port_receive(struct flow *);
+const struct ofport *tnl_port_receive(const struct flow *);
uint32_t tnl_port_send(const struct tnl_port *, struct flow *);
/* Returns true if 'flow' should be submitted to tnl_port_receive(). */