2 * Copyright (C) 2011-2012 Red Hat Inc.
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
29 wrap_connect (wrap_h *w)
32 case WRAP_SCHEME_LOCAL:
37 wrap_int_connect_ssh (w);
41 set_error ("invalid scheme");
47 wrap_set_scheme (wrap_h *w, wrap_scheme_enum scheme)
49 if (scheme < 0 || scheme >= wrap_scheme_enum_nr(w)) {
50 set_error ("scheme out of range");
57 wrap_set_hostname (wrap_h *w, const char *hostname)
59 if (hostname == NULL || strlen (hostname) == 0) {
60 set_error ("invalid hostname");
63 w->hostname = strdup (hostname);
65 set_error_errno ("strdup");
69 wrap_set_wrappid_path (wrap_h *w, const char *wrappid)
71 if (wrappid == NULL || strlen (wrappid) == 0 || wrappid[0] != '/') {
72 set_error ("invalid path");
75 w->wrappid_path = strdup (wrappid);
77 set_error_errno ("strdup");
81 wrap_int_make_request (wrap_h *w, int proc_nr, const void *args, void *ret)
84 case WRAP_SCHEME_LOCAL:
85 abort (); /* shouldn't be reachable */
87 /* XDR-based methods. */
89 wrap_int_make_request_xdr (w, proc_nr, args, ret);
93 set_error ("invalid scheme");