2010-12-01 16:36:40 +00:00
|
|
|
/*
|
|
|
|
* virnetserver.h: generic network RPC server
|
|
|
|
*
|
|
|
|
* Copyright (C) 2006-2011 Red Hat, Inc.
|
|
|
|
* Copyright (C) 2006 Daniel P. Berrange
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2012-09-20 22:30:55 +00:00
|
|
|
* License along with this library. If not, see
|
2012-07-21 10:06:23 +00:00
|
|
|
* <http://www.gnu.org/licenses/>.
|
2010-12-01 16:36:40 +00:00
|
|
|
*
|
|
|
|
* Author: Daniel P. Berrange <berrange@redhat.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __VIR_NET_SERVER_H__
|
|
|
|
# define __VIR_NET_SERVER_H__
|
|
|
|
|
|
|
|
# include <signal.h>
|
|
|
|
|
2013-01-08 21:02:05 +00:00
|
|
|
# ifdef WITH_GNUTLS
|
2013-01-07 14:54:18 +00:00
|
|
|
# include "virnettlscontext.h"
|
|
|
|
# endif
|
2010-12-01 16:36:40 +00:00
|
|
|
# include "virnetserverprogram.h"
|
|
|
|
# include "virnetserverclient.h"
|
|
|
|
# include "virnetserverservice.h"
|
2012-07-11 13:35:52 +00:00
|
|
|
# include "virobject.h"
|
2012-12-12 17:53:50 +00:00
|
|
|
# include "virjson.h"
|
2010-12-01 16:36:40 +00:00
|
|
|
|
|
|
|
virNetServerPtr virNetServerNew(size_t min_workers,
|
|
|
|
size_t max_workers,
|
2011-08-12 12:04:31 +00:00
|
|
|
size_t priority_workers,
|
2010-12-01 16:36:40 +00:00
|
|
|
size_t max_clients,
|
2011-08-24 13:33:34 +00:00
|
|
|
int keepaliveInterval,
|
|
|
|
unsigned int keepaliveCount,
|
|
|
|
bool keepaliveRequired,
|
2011-03-02 17:11:42 +00:00
|
|
|
const char *mdnsGroupName,
|
2012-08-09 11:31:34 +00:00
|
|
|
virNetServerClientPrivNew clientPrivNew,
|
2012-08-09 11:54:54 +00:00
|
|
|
virNetServerClientPrivPreExecRestart clientPrivPreExecRestart,
|
2012-08-09 11:31:34 +00:00
|
|
|
virFreeCallback clientPrivFree,
|
|
|
|
void *clientPrivOpaque);
|
2010-12-01 16:36:40 +00:00
|
|
|
|
2012-08-09 11:54:54 +00:00
|
|
|
virNetServerPtr virNetServerNewPostExecRestart(virJSONValuePtr object,
|
|
|
|
virNetServerClientPrivNew clientPrivNew,
|
|
|
|
virNetServerClientPrivNewPostExecRestart clientPrivNewPostExecRestart,
|
|
|
|
virNetServerClientPrivPreExecRestart clientPrivPreExecRestart,
|
|
|
|
virFreeCallback clientPrivFree,
|
|
|
|
void *clientPrivOpaque);
|
|
|
|
|
|
|
|
virJSONValuePtr virNetServerPreExecRestart(virNetServerPtr srv);
|
|
|
|
|
2010-12-01 16:36:40 +00:00
|
|
|
typedef int (*virNetServerAutoShutdownFunc)(virNetServerPtr srv, void *opaque);
|
|
|
|
|
|
|
|
bool virNetServerIsPrivileged(virNetServerPtr srv);
|
|
|
|
|
|
|
|
void virNetServerAutoShutdown(virNetServerPtr srv,
|
2012-10-31 19:03:55 +00:00
|
|
|
unsigned int timeout);
|
|
|
|
|
|
|
|
void virNetServerAddShutdownInhibition(virNetServerPtr srv);
|
|
|
|
void virNetServerRemoveShutdownInhibition(virNetServerPtr srv);
|
2010-12-01 16:36:40 +00:00
|
|
|
|
|
|
|
typedef void (*virNetServerSignalFunc)(virNetServerPtr srv, siginfo_t *info, void *opaque);
|
|
|
|
|
|
|
|
int virNetServerAddSignalHandler(virNetServerPtr srv,
|
|
|
|
int signum,
|
|
|
|
virNetServerSignalFunc func,
|
|
|
|
void *opaque);
|
|
|
|
|
|
|
|
int virNetServerAddService(virNetServerPtr srv,
|
2011-03-02 17:11:42 +00:00
|
|
|
virNetServerServicePtr svc,
|
|
|
|
const char *mdnsEntryName);
|
2010-12-01 16:36:40 +00:00
|
|
|
|
|
|
|
int virNetServerAddProgram(virNetServerPtr srv,
|
|
|
|
virNetServerProgramPtr prog);
|
|
|
|
|
2013-01-08 21:02:05 +00:00
|
|
|
# if WITH_GNUTLS
|
2010-12-01 16:36:40 +00:00
|
|
|
int virNetServerSetTLSContext(virNetServerPtr srv,
|
|
|
|
virNetTLSContextPtr tls);
|
2013-01-07 14:54:18 +00:00
|
|
|
# endif
|
2010-12-01 16:36:40 +00:00
|
|
|
|
|
|
|
void virNetServerUpdateServices(virNetServerPtr srv,
|
|
|
|
bool enabled);
|
|
|
|
|
|
|
|
void virNetServerRun(virNetServerPtr srv);
|
|
|
|
|
|
|
|
void virNetServerQuit(virNetServerPtr srv);
|
|
|
|
|
2011-08-04 08:54:58 +00:00
|
|
|
void virNetServerClose(virNetServerPtr srv);
|
2010-12-01 16:36:40 +00:00
|
|
|
|
2011-08-24 13:33:34 +00:00
|
|
|
bool virNetServerKeepAliveRequired(virNetServerPtr srv);
|
|
|
|
|
2010-12-01 16:36:40 +00:00
|
|
|
#endif
|