libvirt/proxy/proxy.h
Daniel Veillard 27b7a8be52 * configure.in Makefile.am proxy/Makefile.am proxy/libvirt_proxy.c
proxy/proxy.h proxy/proxy_client.c src/internal.h src/xen_internal.c
  src/xend_internal.c: started working on a proxy to access xend
  for unpriviledged users to avoid opening xend HTTP service to
  serve those read-only operations.
Daniel
2006-06-28 18:19:13 +00:00

69 lines
1.6 KiB
C

/*
* proxy.h: common definitions for proxy usage
*
* Copyright (C) 2006 Red Hat, Inc.
*
* See COPYING.LIB for the License of this software
*
* Daniel Veillard <veillard@redhat.com>
*/
#ifndef __LIBVIR_PROXY_H__
#define __LIBVIR_PROXY_H__
#include <libvirt/libvirt.h>
#ifdef __cplusplus
extern "C" {
#endif
#define PROXY_SOCKET_PATH "/tmp/livirt_proxy_conn"
#define PROXY_PROTO_VERSION 1
/*
* the command allowed though the proxy
*/
typedef enum {
VIR_PROXY_NONE = 0,
VIR_PROXY_VERSION = 1,
VIR_PROXY_NODE_INFO = 2,
VIR_PROXY_LIST = 3,
VIR_PROXY_NUM_DOMAIN = 4,
VIR_PROXY_LOOKUP_ID = 5,
VIR_PROXY_LOOKUP_UUID = 6,
VIR_PROXY_LOOKUP_NAME = 7,
VIR_PROXY_MAX_MEMORY = 8,
VIR_PROXY_DOMAIN_INFO = 9
} virProxyCommand;
/*
* structure used by the client to make a request to the proxy
* and by the proxy when answering the client.
* the size may not be fixed, it's passed as len.
*/
struct _virProxyPacket {
unsigned short version; /* version of the proxy protocol */
unsigned short command; /* command number a virProxyCommand */
unsigned short serial; /* command serial number */
unsigned short len; /* the length of the request */
union {
char string[8]; /* string data */
int arg; /* or int argument */
long larg; /* or long argument */
} data;
};
typedef struct _virProxyPacket virProxyPacket;
typedef virProxyPacket *virProxyPacketPtr;
/*
* Functions callable from libvirt library
*/
int xenProxyInit(virConnectPtr conn);
void xenProxyClose(virConnectPtr conn);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __LIBVIR_PROXY_H__ */