aboutsummaryrefslogtreecommitdiff
path: root/src/network/res_querydomain.c
blob: 322de1dac737d89416280ac2e461c8398a993e3c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <resolv.h>
#include <string.h>

int res_querydomain(const char *name, const char *domain, int class, int type, unsigned char *dest, int len)
{
	char tmp[255];
	size_t nl = strnlen(name, 255);
	size_t dl = strnlen(domain, 255);
	if (nl+dl+1 > 254) return -1;
	memcpy(tmp, name, nl);
	tmp[nl] = '.';
	memcpy(tmp+nl+1, domain, dl+1);
	return res_query(tmp, class, type, dest, len);
}


#ifdef TEST
int
main(void) {
	return 0;
}
#endif