2 * virt-proxy - host/guest communication layer
4 * Copyright IBM Corp. 2010
7 * Michael Roth <mdroth@linux.vnet.ibm.com>
9 * This work is licensed under the terms of the GNU GPL, version 2 or later.
10 * See the COPYING file in the top-level directory.
17 #include "qemu-common.h"
18 #include "qemu-queue.h"
19 #include "qemu-char.h"
21 typedef struct VPDriver VPDriver
;
23 VP_CTX_CHARDEV
, /* in qemu/host, channel is a virtproxy chardev */
24 VP_CTX_FD
, /* in guest, channel is an FD */
27 /* wrappers for s/vp/qemu/ functions we need */
28 int vp_send_all(int fd
, const void *buf
, int len1
);
29 int vp_set_fd_handler2(int fd
,
30 IOCanReadHandler
*fd_read_poll
,
34 int vp_set_fd_handler(int fd
,
38 void vp_chr_read(CharDriverState
*s
, uint8_t *buf
, int len
);
40 /* virtproxy interface */
41 VPDriver
*vp_new(enum vp_context ctx
, CharDriverState
*s
, int fd
, bool listen
);
42 int vp_set_oforward(VPDriver
*drv
, int fd
, const char *service_id
);
43 int vp_set_iforward(VPDriver
*drv
, const char *service_id
, const char *addr
,
44 const char *port
, bool ipv6
);
45 int vp_handle_packet_buf(VPDriver
*drv
, const void *buf
, int count
);
47 #endif /* VIRTPROXY_H */