885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose Unix SMB/CIFS implementation.
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose Winbind client API - SSSD version
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose Copyright (C) Sumit Bose <sbose@redhat.com> 2014
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose This library is free software; you can redistribute it and/or
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose modify it under the terms of the GNU Lesser General Public
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose License as published by the Free Software Foundation; either
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose version 3 of the License, or (at your option) any later version.
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose This library is distributed in the hope that it will be useful,
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose but WITHOUT ANY WARRANTY; without even the implied warranty of
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose Library General Public License for more details.
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose You should have received a copy of the GNU Lesser General Public License
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose along with this program. If not, see <http://www.gnu.org/licenses/>.
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose/* Required Headers */
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose/** @brief Ping winbindd to see if the daemon is running
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose * @return #wbcErr
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose /* TODO: add real check */
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bosestatic void wbcInterfaceDetailsDestructor(void *ptr)
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose struct wbcInterfaceDetails *i = (struct wbcInterfaceDetails *)ptr;
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose * @brief Query useful information about the winbind service
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose * @param *_details pointer to hold the struct wbcInterfaceDetails
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose * @return #wbcErr
885386b7e3f1c3e74b354576b98a092b0835d64eSumit BosewbcErr wbcInterfaceDetails(struct wbcInterfaceDetails **_details)
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose info = (struct wbcInterfaceDetails *)wbcAllocateMemory(
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose /* TODO: currently this call just returns a suitable winbind_separator
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose * for wbinfo. */
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose info->interface_version = WINBIND_INTERFACE_VERSION;
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose info->winbind_version = strdup("libwbclient for SSSD");
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose info->netbios_domain = strdup("-not available-");
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose/** @brief Lookup the current status of a trusted domain, sync wrapper
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose * @param domain Domain to query
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose * @param *dinfo Pointer to returned struct wbcDomainInfo
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose * @return #wbcErr
885386b7e3f1c3e74b354576b98a092b0835d64eSumit BosewbcErr wbcDomainInfo(const char *domain, struct wbcDomainInfo **dinfo)
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose/* Get the list of current DCs */
885386b7e3f1c3e74b354576b98a092b0835d64eSumit BosewbcErr wbcDcInfo(const char *domain, size_t *num_dcs,
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose/* Resolve a NetbiosName via WINS */
885386b7e3f1c3e74b354576b98a092b0835d64eSumit BosewbcErr wbcResolveWinsByName(const char *name, char **ip)
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose /* SSSD does not support WINS */
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose/* Resolve an IP address via WINS into a NetbiosName */
885386b7e3f1c3e74b354576b98a092b0835d64eSumit BosewbcErr wbcResolveWinsByIP(const char *ip, char **name)
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose /* SSSD does not support WINS */
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose/* Enumerate the domain trusts known by Winbind */
885386b7e3f1c3e74b354576b98a092b0835d64eSumit BosewbcErr wbcListTrusts(struct wbcDomainInfo **domains, size_t *num_domains)
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose/* Enumerate the domain trusts known by Winbind */
885386b7e3f1c3e74b354576b98a092b0835d64eSumit BosewbcErr wbcLookupDomainController(const char *domain,
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose/* Get extended domain controller information */
885386b7e3f1c3e74b354576b98a092b0835d64eSumit BosewbcErr wbcLookupDomainControllerEx(const char *domain,
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose const char *site,