2016-02-13 08:27:50 +00:00
|
|
|
/*
|
|
|
|
* libvirt_nss: Name Service Switch plugin
|
|
|
|
*
|
|
|
|
* The aim is to enable users and applications to translate
|
|
|
|
* domain names into IP addresses. However, this is currently
|
|
|
|
* available only for those domains which gets their IP addresses
|
|
|
|
* from a libvirt managed network.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2016 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
|
|
|
|
* <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2019-06-18 16:13:15 +00:00
|
|
|
#pragma once
|
2016-02-13 08:27:50 +00:00
|
|
|
|
2019-06-18 16:13:15 +00:00
|
|
|
#include <nss.h>
|
|
|
|
#include <netdb.h>
|
2016-02-13 08:27:50 +00:00
|
|
|
|
2019-06-18 16:13:15 +00:00
|
|
|
#if !defined(LIBVIRT_NSS_GUEST)
|
|
|
|
# define NSS_NAME(s) _nss_libvirt_##s##_r
|
|
|
|
#else
|
|
|
|
# define NSS_NAME(s) _nss_libvirt_guest_##s##_r
|
|
|
|
#endif
|
2016-12-04 10:56:44 +00:00
|
|
|
|
2016-02-14 10:38:37 +00:00
|
|
|
enum nss_status
|
2016-12-04 10:56:44 +00:00
|
|
|
NSS_NAME(gethostbyname)(const char *name, struct hostent *result,
|
|
|
|
char *buffer, size_t buflen, int *errnop,
|
|
|
|
int *herrnop);
|
2016-02-14 10:38:37 +00:00
|
|
|
|
|
|
|
enum nss_status
|
2016-12-04 10:56:44 +00:00
|
|
|
NSS_NAME(gethostbyname2)(const char *name, int af, struct hostent *result,
|
|
|
|
char *buffer, size_t buflen, int *errnop,
|
|
|
|
int *herrnop);
|
2016-02-14 10:38:37 +00:00
|
|
|
enum nss_status
|
2016-12-04 10:56:44 +00:00
|
|
|
NSS_NAME(gethostbyname3)(const char *name, int af, struct hostent *result,
|
|
|
|
char *buffer, size_t buflen, int *errnop,
|
|
|
|
int *herrnop, int32_t *ttlp, char **canonp);
|
2019-06-18 16:13:15 +00:00
|
|
|
#ifdef HAVE_STRUCT_GAIH_ADDRTUPLE
|
2016-02-14 07:13:54 +00:00
|
|
|
enum nss_status
|
2016-12-04 10:56:44 +00:00
|
|
|
NSS_NAME(gethostbyname4)(const char *name, struct gaih_addrtuple **pat,
|
|
|
|
char *buffer, size_t buflen, int *errnop,
|
|
|
|
int *herrnop, int32_t *ttlp);
|
2019-06-18 16:13:15 +00:00
|
|
|
#endif /* HAVE_STRUCT_GAIH_ADDRTUPLE */
|
2016-03-27 18:07:10 +00:00
|
|
|
|
2019-06-18 16:13:15 +00:00
|
|
|
#if defined(HAVE_BSD_NSS)
|
2016-03-27 18:07:10 +00:00
|
|
|
ns_mtab*
|
|
|
|
nss_module_register(const char *name, unsigned int *size,
|
|
|
|
nss_module_unregister_fn *unregister);
|
2019-06-18 16:13:15 +00:00
|
|
|
#endif /* HAVE_BSD_NSS */
|