2010-12-01 16:36:40 +00:00
|
|
|
/*
|
|
|
|
* virnetserverservice.h: generic network RPC server service
|
|
|
|
*
|
2014-07-15 12:37:14 +00:00
|
|
|
* Copyright (C) 2006-2011, 2014 Red Hat, Inc.
|
2010-12-01 16:36:40 +00:00
|
|
|
* 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_SERVICE_H__
|
|
|
|
# define __VIR_NET_SERVER_SERVICE_H__
|
|
|
|
|
|
|
|
# include "virnetserverprogram.h"
|
2012-07-11 13:35:52 +00:00
|
|
|
# include "virobject.h"
|
2010-12-01 16:36:40 +00:00
|
|
|
|
2017-12-21 14:28:59 +00:00
|
|
|
typedef enum {
|
2010-12-01 16:36:40 +00:00
|
|
|
VIR_NET_SERVER_SERVICE_AUTH_NONE = 0,
|
|
|
|
VIR_NET_SERVER_SERVICE_AUTH_SASL,
|
|
|
|
VIR_NET_SERVER_SERVICE_AUTH_POLKIT,
|
2017-12-21 14:28:59 +00:00
|
|
|
} virNetServerServiceAuthMethods;
|
2010-12-01 16:36:40 +00:00
|
|
|
|
|
|
|
typedef int (*virNetServerServiceDispatchFunc)(virNetServerServicePtr svc,
|
2012-08-09 11:06:45 +00:00
|
|
|
virNetSocketPtr sock,
|
2010-12-01 16:36:40 +00:00
|
|
|
void *opaque);
|
|
|
|
|
2014-07-15 12:37:14 +00:00
|
|
|
virNetServerServicePtr virNetServerServiceNewFDOrUNIX(const char *path,
|
|
|
|
mode_t mask,
|
|
|
|
gid_t grp,
|
|
|
|
int auth,
|
|
|
|
# if WITH_GNUTLS
|
|
|
|
virNetTLSContextPtr tls,
|
|
|
|
# endif
|
|
|
|
bool readonly,
|
|
|
|
size_t max_queued_clients,
|
|
|
|
size_t nrequests_client_max,
|
|
|
|
unsigned int nfds,
|
|
|
|
unsigned int *cur_fd);
|
2010-12-01 16:36:40 +00:00
|
|
|
virNetServerServicePtr virNetServerServiceNewTCP(const char *nodename,
|
|
|
|
const char *service,
|
2015-05-21 14:51:28 +00:00
|
|
|
int family,
|
2010-12-01 16:36:40 +00:00
|
|
|
int auth,
|
2013-01-08 21:02:05 +00:00
|
|
|
# if WITH_GNUTLS
|
2013-01-07 14:54:18 +00:00
|
|
|
virNetTLSContextPtr tls,
|
|
|
|
# endif
|
2010-12-01 16:36:40 +00:00
|
|
|
bool readonly,
|
2013-07-25 12:45:38 +00:00
|
|
|
size_t max_queued_clients,
|
2013-01-07 14:54:18 +00:00
|
|
|
size_t nrequests_client_max);
|
2010-12-01 16:36:40 +00:00
|
|
|
virNetServerServicePtr virNetServerServiceNewUNIX(const char *path,
|
|
|
|
mode_t mask,
|
|
|
|
gid_t grp,
|
|
|
|
int auth,
|
2013-01-08 21:02:05 +00:00
|
|
|
# if WITH_GNUTLS
|
2013-01-07 14:54:18 +00:00
|
|
|
virNetTLSContextPtr tls,
|
|
|
|
# endif
|
2010-12-01 16:36:40 +00:00
|
|
|
bool readonly,
|
2013-07-25 12:45:38 +00:00
|
|
|
size_t max_queued_clients,
|
2013-01-07 14:54:18 +00:00
|
|
|
size_t nrequests_client_max);
|
2012-08-09 14:09:19 +00:00
|
|
|
virNetServerServicePtr virNetServerServiceNewFD(int fd,
|
|
|
|
int auth,
|
2013-01-08 21:02:05 +00:00
|
|
|
# if WITH_GNUTLS
|
2013-01-07 14:54:18 +00:00
|
|
|
virNetTLSContextPtr tls,
|
|
|
|
# endif
|
2012-08-09 14:09:19 +00:00
|
|
|
bool readonly,
|
2014-07-16 17:26:16 +00:00
|
|
|
size_t max_queued_clients,
|
2013-01-07 14:54:18 +00:00
|
|
|
size_t nrequests_client_max);
|
2010-12-01 16:36:40 +00:00
|
|
|
|
2012-08-09 11:54:54 +00:00
|
|
|
virNetServerServicePtr virNetServerServiceNewPostExecRestart(virJSONValuePtr object);
|
|
|
|
|
|
|
|
virJSONValuePtr virNetServerServicePreExecRestart(virNetServerServicePtr service);
|
|
|
|
|
2011-03-02 17:11:42 +00:00
|
|
|
int virNetServerServiceGetPort(virNetServerServicePtr svc);
|
|
|
|
|
2010-12-01 16:36:40 +00:00
|
|
|
int virNetServerServiceGetAuth(virNetServerServicePtr svc);
|
|
|
|
bool virNetServerServiceIsReadonly(virNetServerServicePtr svc);
|
2012-08-09 11:06:45 +00:00
|
|
|
size_t virNetServerServiceGetMaxRequests(virNetServerServicePtr svc);
|
2013-01-08 21:02:05 +00:00
|
|
|
# ifdef WITH_GNUTLS
|
2012-08-09 11:06:45 +00:00
|
|
|
virNetTLSContextPtr virNetServerServiceGetTLSContext(virNetServerServicePtr svc);
|
2013-01-07 14:54:18 +00:00
|
|
|
# endif
|
2010-12-01 16:36:40 +00:00
|
|
|
|
|
|
|
void virNetServerServiceSetDispatcher(virNetServerServicePtr svc,
|
|
|
|
virNetServerServiceDispatchFunc func,
|
|
|
|
void *opaque);
|
|
|
|
|
|
|
|
void virNetServerServiceToggle(virNetServerServicePtr svc,
|
|
|
|
bool enabled);
|
|
|
|
|
2011-08-04 08:54:58 +00:00
|
|
|
void virNetServerServiceClose(virNetServerServicePtr svc);
|
|
|
|
|
2010-12-01 16:36:40 +00:00
|
|
|
#endif
|