From 1d9a4b73a37c6e942f909c2d42ca13b5c47e8362 Mon Sep 17 00:00:00 2001 From: Mystery Man Date: Tue, 5 Apr 2005 19:41:54 +0000 Subject: This commit was manufactured by cvs2svn to create tag 'V10_2_20mdk'. --- mdk-stage1/dietlibc/libcruft/res_mkquery.c | 75 ------------------------------ 1 file changed, 75 deletions(-) delete mode 100644 mdk-stage1/dietlibc/libcruft/res_mkquery.c (limited to 'mdk-stage1/dietlibc/libcruft/res_mkquery.c') diff --git a/mdk-stage1/dietlibc/libcruft/res_mkquery.c b/mdk-stage1/dietlibc/libcruft/res_mkquery.c deleted file mode 100644 index cf5693668..000000000 --- a/mdk-stage1/dietlibc/libcruft/res_mkquery.c +++ /dev/null @@ -1,75 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "dietfeatures.h" - -static char dnspacket[]="\xfe\xfe\001\000\000\001\000\000\000\000\000\000"; - -/* - 1 1 1 1 1 1 - 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 - +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ - | ID | - +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ - |QR| Opcode |AA|TC|RD|RA| Z | RCODE | - +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ - | QDCOUNT | - +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ - | ANCOUNT | - +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ - | NSCOUNT | - +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ - | ARCOUNT | - +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ -*/ - -extern void __dns_make_fd(void); -extern int __dns_fd; - -extern int __dns_servers; -extern struct sockaddr __dns_server_ips[]; - -extern void __dns_readstartfiles(void); - -int res_mkquery(int op, const char *dname, int class, int type, char* data, - int datalen, const unsigned char* newrr, char* buf, int buflen) { - unsigned char packet[512]; - memmove(packet,dnspacket,12); - if ((_res.options&RES_RECURSE)==0) packet[2]=0; - *(unsigned short*)packet=rand(); - { - unsigned char* x; - const char* y,* tmp; - x=packet+12; y=dname; - while (*y) { - while (*y=='.') ++y; - for (tmp=y; *tmp && *tmp!='.'; ++tmp) ; - *x=tmp-y; - if (!(tmp-y)) break; - ++x; - if (x>=packet+510-(tmp-y)) { return -1; } - memmove(x,y,tmp-y); - x+=tmp-y; - if (!*tmp) { - *x=0; - break; - } - y=tmp; - } - *++x= 0; *++x= type; /* A */ - *++x= 0; *++x= class; /* IN */ - ++x; - if (x-packet>buflen) return -1; - memmove(buf,packet,x-packet); - return x-packet; - } -} - -- cgit v1.2.1