X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=lib%2Finternal.h;fp=lib%2Finternal.h;h=69128e9bfbd49257ea7c993e748cf97bdd7640d8;hb=a6d8cf44fbc4fb4a09b3c3bb54701e35f201f997;hp=b9cc57c8f26da8073c4b37de6a53167be06cbfb3;hpb=00e9ee626a00324c1808ab860f00f1a07c88ade8;p=wrappi.git diff --git a/lib/internal.h b/lib/internal.h index b9cc57c..69128e9 100644 --- a/lib/internal.h +++ b/lib/internal.h @@ -21,6 +21,8 @@ #include #include +#include +#include #define STREQ(a,b) (strcmp((a),(b)) == 0) #define STRCASEEQ(a,b) (strcasecmp((a),(b)) == 0) @@ -51,11 +53,16 @@ struct wrap_h { * on the local side of a connection. */ - /* Connection URL. If scheme = NULL, it means we're using the local - * code. + uint32_t serial; /* Serial number used in protocol. */ + + FILE *rfp, *wfp; /* Connection to remote. */ + pid_t pid; /* Child process if using remote, eg ssh */ + + /* Connection URL. If scheme == LOCAL, it means we're using the + * local code. */ - const char *scheme; - const char *hostname; + wrap_scheme_enum scheme; + char *hostname; }; /* Declare an error, setting the error field in the handle. */ @@ -64,7 +71,26 @@ struct wrap_h { #define set_error_errno(fs...) \ wrap_int_set_error_errno ((struct wrap_internal_h *)w, (errno), __func__, fs) +extern void wrap_int_connect_ssh (wrap_h *w); +extern void wrap_int_make_request (wrap_h *w, int proc_nr, const void *args, void *ret); +extern void wrap_int_make_request_xdr (wrap_h *w, int proc_nr, const void *args, void *ret); extern void wrap_int_set_error (struct wrap_internal_h *w, const char *func, const char *fs, ...); extern void wrap_int_set_error_errno (struct wrap_internal_h *w, int errnum, const char *func, const char *fs, ...); +/* See lib/internal-procs.c for the static contents of this table. + * The table is indexed by wrap_int__num. These are defined in + * lib/internal-procs.h. + */ +struct proc_table { + const char *name; /* The name of this entry point. */ + + /* XDR encode/decode functions for serializing the args and ret. */ + xdrproc_t xdr_args; + xdrproc_t xdr_ret; +}; + +extern const struct proc_table wrap_int_proc_table[]; + +#include "internal-procs.h" + #endif /* WRAPPI_INTERNAL_H_ */