Added installation of ModuleVirt.py, added an option to configure the XSL document.
[handlervirt.git] / handler_virt.h
blobe83916fd9772e51a903eaac8df973104d616d00e
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 /* Cherokee
5 * Authors:
6 * Alvaro Lopez Ortega <alvaro@alobbs.com>
7 * Stefan de Konink <stefan@konink.de>
9 * Copyright (C) 2001-2008 Alvaro Lopez Ortega
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of version 2 of the GNU General Public
13 * License as published by the Free Software Foundation.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
23 * USA
26 #ifndef CHEROKEE_HANDLER_VIRT_H
27 #define CHEROKEE_HANDLER_VIRT_H
30 #include "common.h"
31 #include "buffer.h"
32 #include "handler.h"
33 #include "connection.h"
34 #include "plugin_loader.h"
37 #include <libvirt/libvirt.h>
38 #include <cherokee/cherokee.h>
39 #include "handler_avahi.h"
41 /* Data types
43 typedef struct {
44 cherokee_handler_avahi_t base;
46 /* Configuration parameters */
47 cherokee_boolean_t authenticate;
48 cherokee_boolean_t read_only;
49 cherokee_buffer_t xsl;
50 } cherokee_handler_virt_props_t;
52 typedef struct {
53 cherokee_handler_t base;
54 cherokee_buffer_t buffer;
55 cherokee_buffer_t user;
56 cherokee_buffer_t vm;
57 enum {
58 not_authenticated = -2,
59 not_implemented = -1,
60 nothing = 0,
61 domainAttachDevice,
62 domainDetachDevice,
63 domainGetID,
64 domainGetMaxMemory,
65 domainGetMaxVcpus,
66 domainGetName,
67 domainGetOSType,
68 domainGetSchedulerParameters,
69 domainGetSchedulerType,
70 domainGetUUID,
71 domainGetUUIDString,
72 domainGetVcpus,
73 domainReboot,
74 domainShutdown,
75 domainInterfaceStats,
76 xml,
77 domainGetXMLDesc,
78 showall,
79 showuservms
80 } action;
81 } cherokee_handler_virt_t;
83 #define HDL_VIRT(x) ((cherokee_handler_virt_t *)(x))
84 #define PROP_VIRT(x) ((cherokee_handler_virt_props_t *)(x))
85 #define HDL_VIRT_PROPS(x) (PROP_VIRT(MODULE(x)->props))
87 /* Library init function
89 void PLUGIN_INIT_NAME(virt) (cherokee_plugin_loader_t *loader);
90 ret_t cherokee_handler_virt_new (cherokee_handler_t **hdl, cherokee_connection_t *cnt, cherokee_module_props_t *props);
92 /* virtual methods implementation
94 ret_t cherokee_handler_virt_init (cherokee_handler_virt_t *hdl);
96 static ret_t virt_build_page (cherokee_handler_virt_t *hdl);
98 #endif /* CHEROKEE_HANDLER_VIRT_H */