static void send_netflow_active_timeouts(struct ofproto_dpif *);
/* Utilities. */
-static int send_packet(struct ofproto_dpif *, uint32_t odp_port,
+static int send_packet(const struct ofport_dpif *,
const struct ofpbuf *packet);
static size_t
compose_sflow_action(const struct ofproto_dpif *, struct ofpbuf *odp_actions,
VLOG_WARN_RL(&rl, "%s: cannot send BPDU on port %d "
"with unknown MAC", ofproto->up.name, port_num);
} else {
- send_packet(ofproto_dpif_cast(ofport->up.ofproto),
- ofport->odp_port, pkt);
+ send_packet(ofport, pkt);
}
}
ofpbuf_delete(pkt);
pdu_size);
memcpy(packet_pdu, pdu, pdu_size);
- send_packet(ofproto_dpif_cast(port->up.ofproto), port->odp_port,
- &packet);
+ send_packet(port, &packet);
ofpbuf_uninit(&packet);
} else {
VLOG_ERR_RL(&rl, "port %s: cannot obtain Ethernet address of iface "
learning_packet = bond_compose_learning_packet(bundle->bond, e->mac,
e->vlan,
(void **)&port);
- ret = send_packet(ofproto_dpif_cast(port->up.ofproto),
- port->odp_port, learning_packet);
+ ret = send_packet(port, learning_packet);
ofpbuf_delete(learning_packet);
if (ret) {
error = ret;
ofpbuf_init(&packet, 0);
cfm_compose_ccm(ofport->cfm, &packet, ofport->up.opp.hw_addr);
- send_packet(ofproto_dpif_cast(ofport->up.ofproto),
- ofport->odp_port, &packet);
+ send_packet(ofport, &packet);
ofpbuf_uninit(&packet);
}
complete_operation(rule);
}
\f
-/* Sends 'packet' out of port 'odp_port' within 'ofproto'.
+/* Sends 'packet' out 'ofport'.
* Returns 0 if successful, otherwise a positive errno value. */
static int
-send_packet(struct ofproto_dpif *ofproto, uint32_t odp_port,
- const struct ofpbuf *packet)
+send_packet(const struct ofport_dpif *ofport, const struct ofpbuf *packet)
{
+ const struct ofproto_dpif *ofproto = ofproto_dpif_cast(ofport->up.ofproto);
+ uint16_t odp_port = ofport->odp_port;
struct ofpbuf key, odp_actions;
struct odputil_keybuf keybuf;
struct flow flow;