blob: 2dfff8defa4c64e568933900afd84eb5ade0705c [file] [log] [blame]
pbrook87ecb682007-11-17 17:14:51 +00001#ifndef QEMU_NET_H
2#define QEMU_NET_H
3
4/* VLANs support */
5
6typedef struct VLANClientState VLANClientState;
7
8struct VLANClientState {
9 IOReadHandler *fd_read;
10 /* Packets may still be sent if this returns zero. It's used to
11 rate-limit the slirp code. */
12 IOCanRWHandler *fd_can_read;
13 void *opaque;
14 struct VLANClientState *next;
15 struct VLANState *vlan;
16 char info_str[256];
17};
18
19struct VLANState {
20 int id;
21 VLANClientState *first_client;
22 struct VLANState *next;
23 unsigned int nb_guest_devs, nb_host_devs;
24};
25
26VLANState *qemu_find_vlan(int id);
27VLANClientState *qemu_new_vlan_client(VLANState *vlan,
28 IOReadHandler *fd_read,
29 IOCanRWHandler *fd_can_read,
30 void *opaque);
31int qemu_can_send_packet(VLANClientState *vc);
32void qemu_send_packet(VLANClientState *vc, const uint8_t *buf, int size);
33void qemu_handler_true(void *opaque);
34
35void do_info_network(void);
36
37/* NIC info */
38
39#define MAX_NICS 8
40
41struct NICInfo {
42 uint8_t macaddr[6];
43 const char *model;
44 VLANState *vlan;
45};
46
47extern int nb_nics;
48extern NICInfo nd_table[MAX_NICS];
49
50#endif