X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fnetdev-provider.h;h=6f22356382c7f42707d206d66b579d2562d13727;hb=1e827902be9194d71ea851c9ce2676f65eeed33a;hp=b0630cb4b30193fbf79054a074dc1b97464a29a2;hpb=fe68c005871ec5b4b3f33c1b99593667cc83c234;p=sliver-openvswitch.git diff --git a/lib/netdev-provider.h b/lib/netdev-provider.h index b0630cb4b..6f2235638 100644 --- a/lib/netdev-provider.h +++ b/lib/netdev-provider.h @@ -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