-
-int
-dpif_linux_vport_send(int dp_ifindex, uint32_t port_no,
- const void *data, size_t size)
-{
- struct ofpbuf actions, key, packet;
- struct odputil_keybuf keybuf;
- struct flow flow;
- uint64_t action;
-
- ofpbuf_use_const(&packet, data, size);
- flow_extract(&packet, htonll(0), 0, &flow);
-
- ofpbuf_use_stack(&key, &keybuf, sizeof keybuf);
- odp_flow_key_from_flow(&key, &flow);
-
- ofpbuf_use_stack(&actions, &action, sizeof action);
- nl_msg_put_u32(&actions, OVS_ACTION_ATTR_OUTPUT, port_no);
-
- return dpif_linux_execute__(dp_ifindex, key.data, key.size,
- actions.data, actions.size, &packet);
-}
-
-static void
-dpif_linux_port_changed(const struct rtnetlink_link_change *change,
- void *dpif_)
-{
- struct dpif_linux *dpif = dpif_;
-
- if (change) {
- if (change->master_ifindex == dpif->dp_ifindex
- && (change->nlmsg_type == RTM_NEWLINK
- || change->nlmsg_type == RTM_DELLINK))
- {
- /* Our datapath changed, either adding a new port or deleting an
- * existing one. */
- sset_add(&dpif->changed_ports, change->ifname);
- }
- } else {
- dpif->change_error = true;
- }
-}