2010-12-01 16:35:50 +00:00
|
|
|
/*
|
|
|
|
* virnetclientprogram.h: generic network RPC client program
|
|
|
|
*
|
|
|
|
* Copyright (C) 2006-2011 Red Hat, Inc.
|
|
|
|
*
|
|
|
|
* 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:35:50 +00:00
|
|
|
*/
|
|
|
|
|
2019-06-18 16:12:39 +00:00
|
|
|
#pragma once
|
2010-12-01 16:35:50 +00:00
|
|
|
|
2019-06-18 16:12:39 +00:00
|
|
|
#include <rpc/types.h>
|
|
|
|
#include <rpc/xdr.h>
|
2010-12-01 16:35:50 +00:00
|
|
|
|
2019-06-18 16:12:39 +00:00
|
|
|
#include "virnetmessage.h"
|
|
|
|
#include "virobject.h"
|
2010-12-01 16:35:50 +00:00
|
|
|
|
|
|
|
typedef struct _virNetClient virNetClient;
|
|
|
|
|
|
|
|
typedef struct _virNetClientProgram virNetClientProgram;
|
|
|
|
|
|
|
|
typedef struct _virNetClientProgramEvent virNetClientProgramEvent;
|
|
|
|
|
|
|
|
typedef struct _virNetClientProgramErrorHandler virNetClientProgramErrorHander;
|
|
|
|
|
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
typedef void (*virNetClientProgramDispatchFunc)(virNetClientProgram *prog,
|
|
|
|
virNetClient *client,
|
2010-12-01 16:35:50 +00:00
|
|
|
void *msg,
|
|
|
|
void *opaque);
|
|
|
|
|
|
|
|
struct _virNetClientProgramEvent {
|
|
|
|
int proc;
|
|
|
|
virNetClientProgramDispatchFunc func;
|
|
|
|
size_t msg_len;
|
|
|
|
xdrproc_t msg_filter;
|
|
|
|
};
|
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
virNetClientProgram *virNetClientProgramNew(unsigned program,
|
2010-12-01 16:35:50 +00:00
|
|
|
unsigned version,
|
2021-03-11 07:16:13 +00:00
|
|
|
virNetClientProgramEvent *events,
|
2010-12-01 16:35:50 +00:00
|
|
|
size_t nevents,
|
|
|
|
void *eventOpaque);
|
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
unsigned virNetClientProgramGetProgram(virNetClientProgram *prog);
|
|
|
|
unsigned virNetClientProgramGetVersion(virNetClientProgram *prog);
|
2010-12-01 16:35:50 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
int virNetClientProgramMatches(virNetClientProgram *prog,
|
|
|
|
virNetMessage *msg);
|
2010-12-01 16:35:50 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
int virNetClientProgramDispatch(virNetClientProgram *prog,
|
|
|
|
virNetClient *client,
|
|
|
|
virNetMessage *msg);
|
2010-12-01 16:35:50 +00:00
|
|
|
|
2021-03-11 07:16:13 +00:00
|
|
|
int virNetClientProgramCall(virNetClientProgram *prog,
|
|
|
|
virNetClient *client,
|
2010-12-01 16:35:50 +00:00
|
|
|
unsigned serial,
|
|
|
|
int proc,
|
2011-10-21 10:48:03 +00:00
|
|
|
size_t noutfds,
|
|
|
|
int *outfds,
|
|
|
|
size_t *ninfds,
|
|
|
|
int **infds,
|
2010-12-01 16:35:50 +00:00
|
|
|
xdrproc_t args_filter, void *args,
|
|
|
|
xdrproc_t ret_filter, void *ret);
|