mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
net: introduce NICState and qemu_new_nic()
Common state for all NICs. The opaque member will replace the opaque member in VLANClientState since only NICs need it. The conf member will allow us to iterate over NICs, access the MAC addr for the NIC and send a packet from each NIC in qemu_announce_self(). Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
731d5856cb
commit
ebef2c093e
2 changed files with 32 additions and 0 deletions
11
net.h
11
net.h
|
@ -75,6 +75,12 @@ struct VLANClientState {
|
|||
unsigned receive_disabled : 1;
|
||||
};
|
||||
|
||||
typedef struct NICState {
|
||||
VLANClientState nc;
|
||||
NICConf *conf;
|
||||
void *opaque;
|
||||
} NICState;
|
||||
|
||||
struct VLANState {
|
||||
int id;
|
||||
QTAILQ_HEAD(, VLANClientState) clients;
|
||||
|
@ -90,6 +96,11 @@ VLANClientState *qemu_new_net_client(NetClientInfo *info,
|
|||
VLANClientState *peer,
|
||||
const char *model,
|
||||
const char *name);
|
||||
NICState *qemu_new_nic(NetClientInfo *info,
|
||||
NICConf *conf,
|
||||
const char *model,
|
||||
const char *name,
|
||||
void *opaque);
|
||||
VLANClientState *qemu_new_vlan_client(net_client_type type,
|
||||
VLANState *vlan,
|
||||
VLANClientState *peer,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue