• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #include <resolv.h>
2 #include <string.h>
3 
res_querydomain(const char * name,const char * domain,int class,int type,unsigned char * dest,int len)4 int res_querydomain(const char *name, const char *domain, int class, int type, unsigned char *dest, int len)
5 {
6 	char tmp[255];
7 	size_t nl = strnlen(name, 255);
8 	size_t dl = strnlen(domain, 255);
9 	if (nl+dl+1 > 254) return -1;
10 	memcpy(tmp, name, nl);
11 	tmp[nl] = '.';
12 	memcpy(tmp+nl+1, domain, dl+1);
13 	return res_query(tmp, class, type, dest, len);
14 }
15