Files
@ b58c8263d2f6
Branch filter:
Location: DistRen/src/common/libremoteio.h - annotation
b58c8263d2f6
2.4 KiB
text/plain
Updated .hgignore
4b9e91831d84 abcf8952747b 4b9e91831d84 4b9e91831d84 4b9e91831d84 4b9e91831d84 4b9e91831d84 4b9e91831d84 4b9e91831d84 4b9e91831d84 4b9e91831d84 4b9e91831d84 4b9e91831d84 4b9e91831d84 4b9e91831d84 4b9e91831d84 4b9e91831d84 4b9e91831d84 4b9e91831d84 4b9e91831d84 4b9e91831d84 4b9e91831d84 4b9e91831d84 57766eb693c3 1665faff5bfd 57766eb693c3 4b9e91831d84 4b9e91831d84 4b9e91831d84 4b9e91831d84 4b9e91831d84 bbfee659a30a bbfee659a30a a556e24d0635 0aeea9ae7665 0aeea9ae7665 0aeea9ae7665 8dabe557e169 8dabe557e169 8dabe557e169 bbfee659a30a bbfee659a30a bbfee659a30a bbfee659a30a f8b15ae5255a 75a599984bd2 bbfee659a30a bbfee659a30a bbfee659a30a bbfee659a30a bbfee659a30a bbfee659a30a bbfee659a30a 4b9e91831d84 57766eb693c3 4b9e91831d84 4b9e91831d84 8ce43b559a30 8ce43b559a30 a556e24d0635 8ce43b559a30 8af872d2fe8d 8af872d2fe8d 8af872d2fe8d 8ce43b559a30 8ce43b559a30 8ce43b559a30 a556e24d0635 a556e24d0635 a556e24d0635 a556e24d0635 a556e24d0635 a556e24d0635 a556e24d0635 a556e24d0635 0aeea9ae7665 0aeea9ae7665 a556e24d0635 a556e24d0635 a556e24d0635 a556e24d0635 a556e24d0635 a556e24d0635 a556e24d0635 a556e24d0635 1665faff5bfd 4b9e91831d84 4b9e91831d84 | /*
Copyright 2010 Nathan Phillip Brink
This file is a part of DistRen.
DistRen is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
DistRen 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with DistRen. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _DISTREN_LIBREMOTEIO_H
#define _DISTREN_LIBREMOTEIO_H
#include "remoteio.h"
#include <confuse.h>
#include <list.h>
/**
private declarations for remoteio, to be included by options.c and remoteio.c
*/
enum remoteio_method
{
REMOTEIO_METHOD_SSH = 0,
#ifndef WINDOWS
REMOTEIO_METHOD_UNIX = 1,
#endif
REMOTEIO_METHOD_TCP = 2,
/* REMOETIO_METHOD_XMLRPC */ /*< maybe someday */
REMOTEIO_METHOD_MAX = 3 /*< This is a number used to check the consitency of remoteio_server structs */
};
struct remoteio_server
{
char *name; /*< The friendly named passed to remoteio_open() */
char *hostname;
char *username;
enum remoteio_method method;
unsigned int types; /*< See ``Server types'' in protocol.h */
};
struct remoteio_opts
{
char *ssh_command;
list_t servers; /* type: (struct remoteio_server *) */
};
struct remoteio {
enum remoteio_method method;
struct remoteio_opts *opts;
struct execio *execio;
#ifndef WINDOWS
int sock;
#endif
};
/* lookup table */
typedef int remoteio_open_func_t(struct remoteio *rem, struct remoteio_server *server);
typedef int remoteio_read_func_t(struct remoteio *rem, void *buf, size_t len, size_t *bytesread);
typedef int remoteio_write_func_t(struct remoteio *rem, void *buf, size_t len, size_t *bytesread);
typedef int remoteio_close_func_t(struct remoteio *rem);
struct remoteio_method_funcmap
{
enum remoteio_method method;
remoteio_open_func_t *open_func;
remoteio_read_func_t *read_func;
remoteio_write_func_t *write_func;
remoteio_close_func_t *close_func;
char *name; /*< used for error messages */
};
int remoteio_config(cfg_t *cfg, struct remoteio_opts *opts);
#endif
|