#include "qemu-common.h"
#include "qdict.h"
#include "qemu-option.h"
+#include "net-queue.h"
-/* VLANs support */
+struct MACAddr {
+ uint8_t a[6];
+};
-typedef struct VLANClientState VLANClientState;
+/* VLANs support */
typedef int (NetCanReceive)(VLANClientState *);
typedef ssize_t (NetReceive)(VLANClientState *, const uint8_t *, size_t);
void *opaque;
QTAILQ_ENTRY(VLANClientState) next;
struct VLANState *vlan;
+ VLANClientState *peer;
+ NetQueue *send_queue;
char *model;
char *name;
char info_str[256];
};
-typedef struct VLANPacket VLANPacket;
-
-typedef void (NetPacketSent) (VLANClientState *, ssize_t);
-
-struct VLANPacket {
- QTAILQ_ENTRY(VLANPacket) entry;
- VLANClientState *sender;
- int size;
- NetPacketSent *sent_cb;
- uint8_t data[0];
-};
-
struct VLANState {
int id;
QTAILQ_HEAD(, VLANClientState) clients;
QTAILQ_ENTRY(VLANState) next;
unsigned int nb_guest_devs, nb_host_devs;
- QTAILQ_HEAD(send_queue, VLANPacket) send_queue;
- int delivering;
+ NetQueue *send_queue;
};
VLANState *qemu_find_vlan(int id, int allocate);
+VLANClientState *qemu_find_netdev(const char *id);
VLANClientState *qemu_new_vlan_client(VLANState *vlan,
+ VLANClientState *peer,
const char *model,
const char *name,
NetCanReceive *can_receive,
void qemu_purge_queued_packets(VLANClientState *vc);
void qemu_flush_queued_packets(VLANClientState *vc);
void qemu_format_nic_info_str(VLANClientState *vc, uint8_t macaddr[6]);
+void qemu_macaddr_default_if_unset(MACAddr *macaddr);
int qemu_show_nic_models(const char *arg, const char *const *models);
void qemu_check_nic_model(NICInfo *nd, const char *model);
int qemu_find_nic_model(NICInfo *nd, const char * const *models,