head 1.4; access; symbols OPENPKG_E1_MP_HEAD:1.3 OPENPKG_E1_MP:1.3 OPENPKG_E1_MP_2_STABLE:1.3 OPENPKG_E1_FP:1.3 OPENPKG_2_STABLE_MP:1.3 OPENPKG_2_STABLE_20061018:1.3 OPENPKG_2_STABLE_20060622:1.3 OPENPKG_2_STABLE:1.3.0.10 OPENPKG_2_STABLE_BP:1.3 OPENPKG_2_5_RELEASE:1.3 OPENPKG_2_5_SOLID:1.3.0.8 OPENPKG_2_5_SOLID_BP:1.3 OPENPKG_2_4_RELEASE:1.3 OPENPKG_2_4_SOLID:1.3.0.6 OPENPKG_2_4_SOLID_BP:1.3 OPENPKG_CW_FP:1.3 OPENPKG_2_3_RELEASE:1.3 OPENPKG_2_3_SOLID:1.3.0.4 OPENPKG_2_3_SOLID_BP:1.3 OPENPKG_2_2_RELEASE:1.3 OPENPKG_2_2_SOLID:1.3.0.2 OPENPKG_2_2_SOLID_BP:1.3 OPENPKG_2_1_RELEASE:1.2 OPENPKG_2_1_SOLID:1.2.0.4 OPENPKG_2_1_SOLID_BP:1.2 OPENPKG_2_0_RELEASE:1.2 OPENPKG_2_0_SOLID:1.2.0.2 OPENPKG_2_0_SOLID_BP:1.2 OPENPKG_1_3_RELEASE:1.1.2.2 OPENPKG_1_3_SOLID:1.1.2.2.0.2 OPENPKG_1_3_SOLID_BP:1.1.2.2 OPENPKG_1_STABLE:1.1.0.2 OPENPKG_1_STABLE_MP:1.2; locks; strict; comment @# @; 1.4 date 2008.02.10.09.10.17; author rse; state Exp; branches; next 1.3; commitid SWgW2UqxKXOBDPQs; 1.3 date 2004.10.08.11.48.21; author rse; state Exp; branches; next 1.2; 1.2 date 2003.07.28.18.47.18; author rse; state Exp; branches; next 1.1; 1.1 date 2003.07.22.08.20.05; author rse; state Exp; branches 1.1.2.1; next ; 1.1.2.1 date 2003.07.24.20.49.26; author rse; state Exp; branches; next 1.1.2.2; 1.1.2.2 date 2003.07.29.10.11.37; author rse; state Exp; branches; next ; desc @@ 1.4 log @upgrading package: dnstracer 1.8.1 -> 1.9 @ text @Index: dnstracer.c --- dnstracer.c.orig 2008-02-09 13:47:37 +0100 +++ dnstracer.c 2008-02-10 10:08:43 +0100 @@@@ -689,7 +689,11 @@@@ } void +#ifdef NOIPV6 +dump_data(struct sockaddr_in *dest4, void *dest6, struct dnssession *session) +#else dump_data(struct sockaddr_in *dest4, struct sockaddr_in6 *dest6, struct dnssession *session) +#endif { struct dnsrr *answerrr; struct dnsrr *authorityrr; @@@@ -810,6 +814,7 @@@@ exit(1); } +#if defined(AI_NUMERICHOST) && defined(EAI_NODATA) if (global_source_address != NULL) { struct addrinfo hints, *src_res; int error; @@@@ -836,6 +841,7 @@@@ exit(1); } } +#endif return s; } @@@@ -1123,6 +1129,25 @@@@ /*****************************************************************************/ +static char *my_strcasestr(const char *s, const char *find) +{ + char c, sc; + size_t len; + + if ((c = *find++) != 0) { + c = tolower((unsigned char)c); + len = strlen(find); + do { + do { + if ((sc = *s++) == 0) + return (NULL); + } while ((char)tolower((unsigned char)sc) != c); + } while (strncasecmp(s, find, len) != 0); + s--; + } + return ((char *)s); +} + // // The core of this program // @@@@ -1198,7 +1223,11 @@@@ // don't have to worry about packets received from previous sessions. // session = (struct dnssession *)calloc(1, sizeof(struct dnssession)); +#ifdef NOIPV6 + session->socket = create_socket(AF_INET); +#else session->socket = create_socket(ipv6 ? AF_INET6 : AF_INET); +#endif session->ipv6 = ipv6; session->server = strdup(server_ip); session->host = strdup(host); @@@@ -1377,8 +1406,12 @@@@ struct hostent *h; char **addr_list = NULL; +#ifndef NOIPV6 h = gethostbyname2(nextserver_name, ip == 0 ? AF_INET : AF_INET6); +#else + h = gethostbyname(nextserver_name); +#endif if (h == NULL) continue; // @ 1.3 log @replace too unportable function strcasestr() @ text @d2 3 a4 4 --- dnstracer.c.orig 2004-07-08 13:17:59.000000000 +0200 +++ dnstracer.c 2004-10-08 13:46:54.091634581 +0200 @@@@ -642,7 +642,11 @@@@ get_resource(rr->type,session,rr->data,0)); d7 1 d9 1 a9 1 +void dump_data(struct sockaddr_in *dest4,void *dest6,struct dnssession *session) { d11 1 a11 1 void dump_data(struct sockaddr_in *dest4,struct sockaddr_in6 *dest6,struct dnssession *session) { d13 1 d16 1 a16 2 struct dnsrr *additionalrr; @@@@ -758,6 +762,7 @@@@ d21 2 a22 2 if (global_source_address!=NULL) { struct addrinfo hints,*src_res; d24 1 a24 1 @@@@ -784,6 +789,7 @@@@ d32 1 a32 1 @@@@ -1048,6 +1054,25 @@@@ d58 1 a58 1 @@@@ -1123,7 +1148,11 @@@@ d61 1 a61 1 session=(struct dnssession *)calloc(1,sizeof(struct dnssession)); d63 1 a63 1 + session->socket=create_socket(AF_INET); d65 1 a65 1 session->socket=create_socket(ipv6?AF_INET6:AF_INET); d67 4 a70 13 session->ipv6=ipv6; session->server=strdup(server_ip); session->host=strdup(host); @@@@ -1233,7 +1262,7 @@@@ } if (server_authfor!=NULL && strcmp(server_authfor,".")!=0 && - (unsigned char *)strcasestr(rrauth->domainname_string,server_authfor)!=rrauth->domainname_string+strlen(rrauth->domainname_string)-strlen(server_authfor)) { + (unsigned char *)my_strcasestr(rrauth->domainname_string,server_authfor)!=rrauth->domainname_string+strlen(rrauth->domainname_string)-strlen(server_authfor)) { if (!refersbackwards++) printf("Refers backwards "); rrauth=rrauth->next; @@@@ -1300,7 +1329,11 @@@@ d72 1 a72 1 char **addr_list=NULL; d75 2 a76 1 h=gethostbyname2(nextserver_name,ip==0?AF_INET:AF_INET6); d78 1 a78 1 + h=gethostbyname(nextserver_name); d80 1 a80 1 if (h==NULL) continue; a82 13 @@@@ -1540,8 +1573,12 @@@@ { struct hostent *h; +#ifndef NOIPV6 if (((h=gethostbyname2(server_name,AF_INET6))==NULL) && ((h=gethostbyname2(server_name,AF_INET))==NULL)) { +#else + if ((h=gethostbyname(server_name))==NULL) { +#endif fprintf(stderr,"Cannot find IP address for %s\n",server_name); return 1; } @ 1.2 log @fix NOIPV6 support and use it under Solaris @ text @d1 4 a4 3 --- dnstracer.c 2003-02-14 11:04:03.000000000 +0100 +++ dnstracer.c 2003-07-28 20:40:03.000000000 +0200 @@@@ -603,7 +603,11 @@@@ d16 1 a16 1 @@@@ -719,6 +723,7 @@@@ d24 1 a24 1 @@@@ -745,6 +750,7 @@@@ d32 27 a58 1 @@@@ -1084,7 +1090,11 @@@@ d70 10 a79 1 @@@@ -1246,7 +1256,11 @@@@ d91 1 a91 1 @@@@ -1480,8 +1494,12 @@@@ @ 1.1 log @add missing patch to CVS @ text @d1 43 a43 3 --- dnstracer.c.dist 2003-06-12 21:01:02.000000000 +0200 +++ dnstracer.c 2003-06-12 21:10:38.000000000 +0200 @@@@ -1246,7 +1246,11 @@@@ d47 1 a47 1 +#if defined(HAVE_GETHOSTBYNAME2) d55 1 a55 1 @@@@ -1480,8 +1484,12 @@@@ d59 1 a59 1 +#if defined(HAVE_GETHOSTBYNAME2) @ 1.1.2.1 log @mass Merge-From-CURRENT (MFC) in preparation for OpenPKG 1.3 [class PLUS only] @ text @@ 1.1.2.2 log @MFC: all changes since last merge @ text @d1 3 a3 43 --- dnstracer.c 2003-02-14 11:04:03.000000000 +0100 +++ dnstracer.c 2003-07-28 20:40:03.000000000 +0200 @@@@ -603,7 +603,11 @@@@ get_resource(rr->type,session,rr->data,0)); } +#ifdef NOIPV6 +void dump_data(struct sockaddr_in *dest4,void *dest6,struct dnssession *session) { +#else void dump_data(struct sockaddr_in *dest4,struct sockaddr_in6 *dest6,struct dnssession *session) { +#endif struct dnsrr *answerrr; struct dnsrr *authorityrr; struct dnsrr *additionalrr; @@@@ -719,6 +723,7 @@@@ exit(1); } +#if defined(AI_NUMERICHOST) && defined(EAI_NODATA) if (global_source_address!=NULL) { struct addrinfo hints,*src_res; int error; @@@@ -745,6 +750,7 @@@@ exit(1); } } +#endif return s; } @@@@ -1084,7 +1090,11 @@@@ // don't have to worry about packets received from previous sessions. // session=(struct dnssession *)calloc(1,sizeof(struct dnssession)); +#ifdef NOIPV6 + session->socket=create_socket(AF_INET); +#else session->socket=create_socket(ipv6?AF_INET6:AF_INET); +#endif session->ipv6=ipv6; session->server=strdup(server_ip); session->host=strdup(host); @@@@ -1246,7 +1256,11 @@@@ d7 1 a7 1 +#ifndef NOIPV6 d15 1 a15 1 @@@@ -1480,8 +1494,12 @@@@ d19 1 a19 1 +#ifndef NOIPV6 @