Revision 7c9d8e07 vl.h
b/vl.h | ||
---|---|---|
196 | 196 |
|
197 | 197 |
typedef void IOReadHandler(void *opaque, const uint8_t *buf, int size); |
198 | 198 |
typedef int IOCanRWHandler(void *opaque); |
199 |
typedef void IOHandler(void *opaque); |
|
199 | 200 |
|
200 |
int qemu_add_fd_read_handler(int fd, IOCanRWHandler *fd_can_read, |
|
201 |
IOReadHandler *fd_read, void *opaque); |
|
202 |
void qemu_del_fd_read_handler(int fd); |
|
201 |
int qemu_set_fd_handler2(int fd, |
|
202 |
IOCanRWHandler *fd_read_poll, |
|
203 |
IOHandler *fd_read, |
|
204 |
IOHandler *fd_write, |
|
205 |
void *opaque); |
|
206 |
int qemu_set_fd_handler(int fd, |
|
207 |
IOHandler *fd_read, |
|
208 |
IOHandler *fd_write, |
|
209 |
void *opaque); |
|
203 | 210 |
|
204 | 211 |
/* character device */ |
205 | 212 |
|
... | ... | |
270 | 277 |
|
271 | 278 |
extern CharDriverState *parallel_hds[MAX_PARALLEL_PORTS]; |
272 | 279 |
|
273 |
/* network redirectors support */ |
|
280 |
/* VLANs support */ |
|
281 |
|
|
282 |
typedef struct VLANClientState VLANClientState; |
|
283 |
|
|
284 |
struct VLANClientState { |
|
285 |
IOReadHandler *fd_read; |
|
286 |
void *opaque; |
|
287 |
struct VLANClientState *next; |
|
288 |
struct VLANState *vlan; |
|
289 |
char info_str[256]; |
|
290 |
}; |
|
291 |
|
|
292 |
typedef struct VLANState { |
|
293 |
int id; |
|
294 |
VLANClientState *first_client; |
|
295 |
struct VLANState *next; |
|
296 |
} VLANState; |
|
297 |
|
|
298 |
VLANState *qemu_find_vlan(int id); |
|
299 |
VLANClientState *qemu_new_vlan_client(VLANState *vlan, |
|
300 |
IOReadHandler *fd_read, void *opaque); |
|
301 |
void qemu_send_packet(VLANClientState *vc, const uint8_t *buf, int size); |
|
302 |
|
|
303 |
void do_info_network(void); |
|
304 |
|
|
305 |
/* NIC info */ |
|
274 | 306 |
|
275 | 307 |
#define MAX_NICS 8 |
276 | 308 |
|
277 |
typedef struct NetDriverState { |
|
278 |
int index; /* index number in QEMU */ |
|
309 |
typedef struct NICInfo { |
|
279 | 310 |
uint8_t macaddr[6]; |
280 |
char ifname[16]; |
|
281 |
void (*send_packet)(struct NetDriverState *nd, |
|
282 |
const uint8_t *buf, int size); |
|
283 |
void (*add_read_packet)(struct NetDriverState *nd, |
|
284 |
IOCanRWHandler *fd_can_read, |
|
285 |
IOReadHandler *fd_read, void *opaque); |
|
286 |
/* tun specific data */ |
|
287 |
int fd; |
|
288 |
/* slirp specific data */ |
|
289 |
} NetDriverState; |
|
311 |
VLANState *vlan; |
|
312 |
} NICInfo; |
|
290 | 313 |
|
291 | 314 |
extern int nb_nics; |
292 |
extern NetDriverState nd_table[MAX_NICS]; |
|
293 |
|
|
294 |
void qemu_send_packet(NetDriverState *nd, const uint8_t *buf, int size); |
|
295 |
void qemu_add_read_packet(NetDriverState *nd, IOCanRWHandler *fd_can_read, |
|
296 |
IOReadHandler *fd_read, void *opaque); |
|
315 |
extern NICInfo nd_table[MAX_NICS]; |
|
297 | 316 |
|
298 | 317 |
/* timers */ |
299 | 318 |
|
... | ... | |
692 | 711 |
|
693 | 712 |
/* ne2000.c */ |
694 | 713 |
|
695 |
void isa_ne2000_init(int base, int irq, NetDriverState *nd);
|
|
696 |
void pci_ne2000_init(PCIBus *bus, NetDriverState *nd);
|
|
714 |
void isa_ne2000_init(int base, int irq, NICInfo *nd);
|
|
715 |
void pci_ne2000_init(PCIBus *bus, NICInfo *nd);
|
|
697 | 716 |
|
698 | 717 |
/* pckbd.c */ |
699 | 718 |
|
... | ... | |
781 | 800 |
uint32_t iommu_translate_local(void *opaque, uint32_t addr); |
782 | 801 |
|
783 | 802 |
/* lance.c */ |
784 |
void lance_init(NetDriverState *nd, int irq, uint32_t leaddr, uint32_t ledaddr);
|
|
803 |
void lance_init(NICInfo *nd, int irq, uint32_t leaddr, uint32_t ledaddr);
|
|
785 | 804 |
|
786 | 805 |
/* tcx.c */ |
787 | 806 |
void *tcx_init(DisplayState *ds, uint32_t addr, uint8_t *vram_base, |
Also available in: Unified diff