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-07-21 10:06:23 +00:00
|
|
|
* License along with this library; If not, see
|
|
|
|
* <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>
|
|
|
|
|
|
|
|
# include "virnettlscontext.h"
|
|
|
|
# include "virnetserverprogram.h"
|
|
|
|
# include "virnetserverclient.h"
|
|
|
|
# include "virnetserverservice.h"
|
2012-07-11 13:35:52 +00:00
|
|
|
# include "virobject.h"
|
2010-12-01 16:36:40 +00:00
|
|
|
|
|
|
|
typedef int (*virNetServerClientInitHook)(virNetServerPtr srv,
|
2012-03-15 18:14:51 +00:00
|
|
|
virNetServerClientPtr client,
|
|
|
|
void *opaque);
|
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-03-15 18:14:51 +00:00
|
|
|
virNetServerClientInitHook clientInitHook,
|
|
|
|
void *opaque);
|
2010-12-01 16:36:40 +00:00
|
|
|
|
|
|
|
typedef int (*virNetServerAutoShutdownFunc)(virNetServerPtr srv, void *opaque);
|
|
|
|
|
|
|
|
bool virNetServerIsPrivileged(virNetServerPtr srv);
|
|
|
|
|
|
|
|
void virNetServerAutoShutdown(virNetServerPtr srv,
|
|
|
|
unsigned int timeout,
|
|
|
|
virNetServerAutoShutdownFunc func,
|
|
|
|
void *opaque);
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
int virNetServerSetTLSContext(virNetServerPtr srv,
|
|
|
|
virNetTLSContextPtr tls);
|
|
|
|
|
|
|
|
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
|