/* * remote_sockets.c: helpers for getting remote driver socket paths * * Copyright (C) 2007-2019 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 * License along with this library. If not, see * . */ #include #include "remote_sockets.h" VIR_ENUM_IMPL(remoteDriverTransport, REMOTE_DRIVER_TRANSPORT_LAST, "tls", "unix", "ssh", "libssh2", "ext", "tcp", "libssh"); VIR_ENUM_IMPL(remoteDriverMode, REMOTE_DRIVER_MODE_LAST, "auto", "legacy", "direct"); int remoteSplitURIScheme(virURIPtr uri, char **driver, char **transport) { char *p = strchr(uri->scheme, '+'); *driver = *transport = NULL; if (p) *driver = g_strndup(uri->scheme, p - uri->scheme); else *driver = g_strdup(uri->scheme); if (p) { *transport = g_strdup(p + 1); p = *transport; while (*p) { *p = g_ascii_tolower(*p); p++; } } return 0; }