summaryrefslogtreecommitdiff
path: root/vl.h
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-04-21 23:27:19 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-04-21 23:27:19 +0000
commitc20709aa32045c79e21905c4c009aae53d008af5 (patch)
tree560308617bab7dc00827f99f822503483e424a72 /vl.h
parent92cb7d5423ed30a51ed9c9ea60cc674d4fa68820 (diff)
initial user mode network support
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@730 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'vl.h')
-rw-r--r--vl.h33
1 files changed, 22 insertions, 11 deletions
diff --git a/vl.h b/vl.h
index cd49e97a9d..19681ab958 100644
--- a/vl.h
+++ b/vl.h
@@ -132,29 +132,39 @@ void qemu_del_vm_stop_handler(VMStopHandler *cb, void *opaque);
void vm_start(void);
void vm_stop(int reason);
+/* async I/O support */
+
+typedef void IOReadHandler(void *opaque, const uint8_t *buf, int size);
+typedef int IOCanRWHandler(void *opaque);
+
+int qemu_add_fd_read_handler(int fd, IOCanRWHandler *fd_can_read,
+ IOReadHandler *fd_read, void *opaque);
+void qemu_del_fd_read_handler(int fd);
+
/* network redirectors support */
#define MAX_NICS 8
typedef struct NetDriverState {
- int fd;
+ int index; /* index number in QEMU */
uint8_t macaddr[6];
char ifname[16];
+ void (*send_packet)(struct NetDriverState *nd,
+ const uint8_t *buf, int size);
+ void (*add_read_packet)(struct NetDriverState *nd,
+ IOCanRWHandler *fd_can_read,
+ IOReadHandler *fd_read, void *opaque);
+ /* tun specific data */
+ int fd;
+ /* slirp specific data */
} NetDriverState;
extern int nb_nics;
extern NetDriverState nd_table[MAX_NICS];
-void net_send_packet(NetDriverState *nd, const uint8_t *buf, int size);
-
-/* async I/O support */
-
-typedef void IOReadHandler(void *opaque, const uint8_t *buf, int size);
-typedef int IOCanRWHandler(void *opaque);
-
-int qemu_add_fd_read_handler(int fd, IOCanRWHandler *fd_can_read,
- IOReadHandler *fd_read, void *opaque);
-void qemu_del_fd_read_handler(int fd);
+void qemu_send_packet(NetDriverState *nd, const uint8_t *buf, int size);
+void qemu_add_read_packet(NetDriverState *nd, IOCanRWHandler *fd_can_read,
+ IOReadHandler *fd_read, void *opaque);
/* timers */
@@ -417,6 +427,7 @@ void serial_receive_break(SerialState *s);
void pic_set_irq(int irq, int level);
void pic_init(void);
uint32_t pic_intack_read(CPUState *env);
+void pic_info(void);
/* i8254.c */