virtagent: Makefile fixups
[qemu/mdroth.git] / virtproxy.h
blobed98d405c125a60c57142e5f99c7be3290602d44
1 /*
2 * virt-proxy - host/guest communication layer
4 * Copyright IBM Corp. 2010
6 * Authors:
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.
14 #ifndef VIRTPROXY_H
15 #define VIRTPROXY_H
17 #include "qemu-common.h"
18 #include "qemu-queue.h"
19 #include "qemu-char.h"
21 typedef struct VPDriver VPDriver;
22 enum vp_context {
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,
31 IOHandler *fd_read,
32 IOHandler *fd_write,
33 void *opaque);
34 int vp_set_fd_handler(int fd,
35 IOHandler *fd_read,
36 IOHandler *fd_write,
37 void *opaque);
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 */