Merge branch 'mainstream'
[sliver-openvswitch.git] / lib / netdev-provider.h
index b0630cb..6f22356 100644 (file)
@@ -634,17 +634,28 @@ struct netdev_class {
     void (*rx_destruct)(struct netdev_rx *);
     void (*rx_dealloc)(struct netdev_rx *);
 
-    /* Attempts to receive a packet from 'rx' into the 'size' bytes in
-     * 'buffer'.  If successful, returns the number of bytes in the received
-     * packet, otherwise a negative errno value.  Returns -EAGAIN immediately
-     * if no packet is ready to be received.
+    /* Attempts to receive a packet from 'rx' into the tailroom of 'buffer',
+     * which should initially be empty.  If successful, returns 0 and
+     * increments 'buffer->size' by the number of bytes in the received packet,
+     * otherwise a positive errno value.  Returns EAGAIN immediately if no
+     * packet is ready to be received.
      *
-     * Must return -EMSGSIZE, and discard the packet, if the received packet
-     * is longer than 'size' bytes.
+     * Must return EMSGSIZE, and discard the packet, if the received packet
+     * is longer than 'ofpbuf_tailroom(buffer)'.
+     *
+     * Implementations may make use of VLAN_HEADER_LEN bytes of tailroom to
+     * add a VLAN header which is obtained out-of-band to the packet. If
+     * this occurs then VLAN_HEADER_LEN bytes of tailroom will no longer be
+     * available for the packet, otherwise it may be used for the packet
+     * itself.
+     *
+     * It is advised that the tailroom of 'buffer' should be
+     * VLAN_HEADER_LEN bytes longer than the MTU to allow space for an
+     * out-of-band VLAN header to be added to the packet.
      *
      * This function may be set to null if it would always return EOPNOTSUPP
      * anyhow. */
-    int (*rx_recv)(struct netdev_rx *rx, void *buffer, size_t size);
+    int (*rx_recv)(struct netdev_rx *rx, struct ofpbuf *buffer);
 
     /* Registers with the poll loop to wake up from the next call to
      * poll_block() when a packet is ready to be received with netdev_rx_recv()
@@ -665,6 +676,9 @@ extern const struct netdev_class netdev_tap_class;
 extern const struct netdev_class netdev_bsd_class;
 #endif
 
+extern const struct netdev_class netdev_tunnel_class;
+extern const struct netdev_class netdev_pltap_class;
+
 #ifdef  __cplusplus
 }
 #endif