net: Refactor net_client_types

Position entries of net_client_types according to the corresponding
values of NET_CLIENT_TYPE_*. The array size is now defined by
NET_CLIENT_TYPE_MAX. This will allow to obtain entries based on type
value in later patches.

At this chance rename NET_CLIENT_TYPE_SLIRP to NET_CLIENT_TYPE_USER for
the sake of consistency.

CC: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
Jan Kiszka 2011-07-20 12:20:20 +02:00 committed by Anthony Liguori
parent 19061e63c0
commit 6f7b3b1be2
3 changed files with 23 additions and 15 deletions

6
net.h
View file

@ -31,11 +31,13 @@ typedef struct NICConf {
typedef enum {
NET_CLIENT_TYPE_NONE,
NET_CLIENT_TYPE_NIC,
NET_CLIENT_TYPE_SLIRP,
NET_CLIENT_TYPE_USER,
NET_CLIENT_TYPE_TAP,
NET_CLIENT_TYPE_SOCKET,
NET_CLIENT_TYPE_VDE,
NET_CLIENT_TYPE_DUMP
NET_CLIENT_TYPE_DUMP,
NET_CLIENT_TYPE_MAX
} net_client_type;
typedef void (NetPoll)(VLANClientState *, bool enable);