-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathnss_debug-hosts.c
67 lines (53 loc) · 1.9 KB
/
nss_debug-hosts.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#include <arpa/inet.h>
#include <netdb.h>
#include <netinet/in.h>
#include <nss.h>
#include <stdio.h>
#include <sys/socket.h>
enum nss_status
_nss_debug_sethostent(int stayopen)
{
fprintf(stderr, "NSS DEBUG: Called %s with args (stayopen: %d)\n", __FUNCTION__, stayopen);
return NSS_STATUS_SUCCESS;
}
enum nss_status
_nss_debug_endhostent(void)
{
fprintf(stderr, "NSS DEBUG: Called %s\n", __FUNCTION__);
return NSS_STATUS_NOTFOUND;
}
enum nss_status
_nss_debug_gethostent_r(struct hostent *host, char *buffer, size_t buflen, int *errnop, int *h_errnop)
{
fprintf(stderr, "NSS DEBUG: Called %s\n", __FUNCTION__);
return NSS_STATUS_NOTFOUND;
}
enum nss_status
_nss_debug_gethostbyaddr_r(const void *addr, socklen_t addrlen, int af, struct hostent *host, char *buffer,
size_t buflen, int *errnop, int *h_errnop)
{
fprintf(stderr, "NSS DEBUG: Called %s with args (addr: %s)\n", __FUNCTION__,
inet_ntoa(*(struct in_addr *)addr));
return NSS_STATUS_NOTFOUND;
}
enum nss_status
_nss_debug_gethostbyname2_r(const char *name, int af, struct hostent *host, char *buffer, size_t buflen,
int *errnop, int *h_errnop)
{
fprintf(stderr, "NSS DEBUG: Called %s with args (name: %s)\n", __FUNCTION__, name);
return NSS_STATUS_NOTFOUND;
}
enum nss_status
_nss_debug_gethostbyname4_r(const char *name, struct gaih_addrtuple **pat, char *buffer, size_t buflen,
int *errnop, int *herrnop, int32_t *ttlp)
{
fprintf(stderr, "NSS DEBUG: Called %s with args (name: %s)\n", __FUNCTION__, name);
return NSS_STATUS_NOTFOUND;
}
enum nss_status
_nss_debug_gethostbyname_r(const char *name, struct hostent *host, char *buffer, size_t buflen,
int *errnop, int *h_errnop)
{
fprintf(stderr, "NSS DEBUG: Called %s with args (name: %s)\n", __FUNCTION__, name);
return NSS_STATUS_NOTFOUND;
}