1#ifndef VHOST_NET_H 2#define VHOST_NET_H 3 4#include "net/net.h" 5#include "hw/virtio/vhost-backend.h" 6 7struct vhost_net; 8typedef struct vhost_net VHostNetState; 9 10typedef struct VhostNetOptions { 11 VhostBackendType backend_type; 12 NetClientState *net_backend; 13 void *opaque; 14} VhostNetOptions; 15 16uint64_t vhost_net_get_max_queues(VHostNetState *net); 17struct vhost_net *vhost_net_init(VhostNetOptions *options); 18 19int vhost_net_start(VirtIODevice *dev, NetClientState *ncs, int total_queues); 20void vhost_net_stop(VirtIODevice *dev, NetClientState *ncs, int total_queues); 21 22void vhost_net_cleanup(VHostNetState *net); 23 24uint64_t vhost_net_get_features(VHostNetState *net, uint64_t features); 25void vhost_net_ack_features(VHostNetState *net, uint64_t features); 26 27bool vhost_net_virtqueue_pending(VHostNetState *net, int n); 28void vhost_net_virtqueue_mask(VHostNetState *net, VirtIODevice *dev, 29 int idx, bool mask); 30int vhost_net_notify_migration_done(VHostNetState *net, char* mac_addr); 31VHostNetState *get_vhost_net(NetClientState *nc); 32 33int vhost_set_vring_enable(NetClientState * nc, int enable); 34#endif 35