]> asedeno.scripts.mit.edu Git - 1ts-debian.git/commitdiff
This commit was generated by cvs2svn to compensate for changes in r69,
authorkcr <kcr@cbed1d16-5ef5-0310-b6a1-d4a37b08ba1f>
Tue, 19 Jun 2001 10:40:06 +0000 (10:40 +0000)
committerkcr <kcr@cbed1d16-5ef5-0310-b6a1-d4a37b08ba1f>
Tue, 19 Jun 2001 10:40:06 +0000 (10:40 +0000)
which included commits to RCS files with non-trunk default branches.

git-svn-id: svn://svn.1ts.org/debian/trunk@70 cbed1d16-5ef5-0310-b6a1-d4a37b08ba1f

libares/NEWS
libares/ahost.c
libares/ares.h
libares/ares_mkquery.3
libares/ares_mkquery.c
libares/ares_process.c
libares/ares_query.3
libares/ares_query.c
libares/ares_search.3
libares/ares_search.c

index 1c7058e003928901e25768e634e702b25f72ae27..728b4b8e6fa20b2f36100218b9f8c27640d09cd1 100644 (file)
@@ -1,3 +1,9 @@
+Major changes in release 1.1.1:
+* ares should now compile as C++ code (no longer uses reserved word
+  "class").
+* Added SRV support to adig test program.
+* Fixed a few error handling bugs in query processing.
+
 Major changes in release 1.1.0:
 * Added ares_free_string() function so that memory can be freed in the
   same layer as it is allocated, a desirable feature in some
index bea4e2c790a7fe1c0f5bffd13cea64351f3fd627..48c75df5173d05f69f1d6d84f0191ae92c3862b8 100644 (file)
@@ -13,7 +13,7 @@
  * without express or implied warranty.
  */
 
-static const char rcsid[] = "$Id: ahost.c,v 1.3 1999/10/23 19:28:13 danw Exp $";
+static const char rcsid[] = "$Id: ahost.c,v 1.4 2001/04/02 17:39:42 ghudson Exp $";
 
 #include <sys/types.h>
 #include <sys/time.h>
@@ -21,6 +21,7 @@ static const char rcsid[] = "$Id: ahost.c,v 1.3 1999/10/23 19:28:13 danw Exp $";
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
 #include <netdb.h>
index 9850fc91fb8c56f3c798e4aace810083ba2ffbbe..34b4a6c8051157a7e1fe113c07433f5fcf41a175 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: ares.h,v 1.2 2000/01/05 16:29:43 ghudson Exp $ */
+/* $Id: ares.h,v 1.3 2000/09/21 19:15:48 ghudson Exp $ */
 
 /* Copyright 1998 by the Massachusetts Institute of Technology.
  *
@@ -94,9 +94,9 @@ void ares_destroy(ares_channel channel);
 
 void ares_send(ares_channel channel, const unsigned char *qbuf, int qlen,
               ares_callback callback, void *arg);
-void ares_query(ares_channel channel, const char *name, int class,
+void ares_query(ares_channel channel, const char *name, int dnsclass,
                int type, ares_callback callback, void *arg);
-void ares_search(ares_channel channel, const char *name, int class,
+void ares_search(ares_channel channel, const char *name, int dnsclass,
                 int type, ares_callback callback, void *arg);
 void ares_gethostbyname(ares_channel channel, const char *name, int family,
                        ares_host_callback callback, void *arg);
@@ -108,7 +108,7 @@ struct timeval *ares_timeout(ares_channel channel, struct timeval *maxtv,
                             struct timeval *tv);
 void ares_process(ares_channel channel, fd_set *read_fds, fd_set *write_fds);
 
-int ares_mkquery(const char *name, int class, int type, unsigned short id,
+int ares_mkquery(const char *name, int dnsclass, int type, unsigned short id,
                 int rd, unsigned char **buf, int *buflen);
 int ares_expand_name(const unsigned char *encoded, const unsigned char *abuf,
                     int alen, char **s, int *enclen);
index 34815253bd77f341157ac007f103c00f5f5d2069..e7f265c41b025ae5516728ab5b4fa5d75f6d9212 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: ares_mkquery.3,v 1.2 2000/01/05 16:29:43 ghudson Exp $
+.\" $Id: ares_mkquery.3,v 1.5 2000/09/21 19:15:50 ghudson Exp $
 .\"
 .\" Copyright 1998, 2000 by the Massachusetts Institute of Technology.
 .\"
@@ -22,9 +22,10 @@ ares_mkquery \- Compose a single-question DNS query buffer
 .B #include <ares.h>
 .PP
 .B
-int ares_mkquery(const char *\fIname\fP, int \fIclass\fP, int \fItype\fP,
+int ares_mkquery(const char *\fIname\fP, int \fIdnsclass\fP, int \fItype\fP,
 .B
-       unsigned short \fIid\fP, char **\fIbuf\fP, int *\fIbuflen\fP)
+       unsigned short \fIid\fP, int \fIrd\fP, char **\fIbuf\fP,
+       int *\fIbuflen\fP)
 .fi
 .SH DESCRIPTION
 The
@@ -35,16 +36,18 @@ The parameter
 gives the query name as a NUL-terminated C string of period-separated
 labels optionally ending with a period; periods and backslashes within
 a label must be escaped with a backlash.  The parameters
-.I class
+.I dnsclass
 and
 .I type
 give the class and type of the query using the values defined in
 .BR <arpa/nameser.h> .
 The parameter
 .I id
-gives a 16-bit identifier for the query.  The query will be placed in
-an allocated buffer, a pointer to which will be stored in the variable
-pointed to by
+gives a 16-bit identifier for the query.  The parameter
+.I rd
+should be nonzero if recursion is desired, zero if not.  The query
+will be placed in an allocated buffer, a pointer to which will be
+stored in the variable pointed to by
 .IR buf ,
 and the length of which will be stored in the variable pointed to by
 .IR buflen .
@@ -52,7 +55,7 @@ It is the caller's responsibility to free this buffer using
 .B ares_free_string
 when it is no longer needed.
 .SH RETURN VALUES
-.B ares_expand_name
+.B ares_mkquery
 can return any of the following values:
 .TP 15
 .B ARES_SUCCESS
index 490d7afe49efaf37c1dc3a0f531e37135a0c9bb5..60e8f214b2dd619403e635b0606a07faaec0d200 100644 (file)
@@ -13,7 +13,7 @@
  * without express or implied warranty.
  */
 
-static const char rcsid[] = "$Id: ares_mkquery.c,v 1.2 1999/10/23 19:28:14 danw Exp $";
+static const char rcsid[] = "$Id: ares_mkquery.c,v 1.3 2000/09/21 19:15:51 ghudson Exp $";
 
 #include <sys/types.h>
 #include <netinet/in.h>
@@ -71,7 +71,7 @@ static const char rcsid[] = "$Id: ares_mkquery.c,v 1.2 1999/10/23 19:28:14 danw
  * be thought of as the root domain).
  */
 
-int ares_mkquery(const char *name, int class, int type, unsigned short id,
+int ares_mkquery(const char *name, int dnsclass, int type, unsigned short id,
                 int rd, unsigned char **buf, int *buflen)
 {
   int len;
@@ -149,7 +149,7 @@ int ares_mkquery(const char *name, int class, int type, unsigned short id,
 
   /* Finish off the question with the type and class. */
   DNS_QUESTION_SET_TYPE(q, type);
-  DNS_QUESTION_SET_CLASS(q, class);
+  DNS_QUESTION_SET_CLASS(q, dnsclass);
 
   return ARES_SUCCESS;
 }
index c4b18cf14a7c509db7605f986d6a7bcf4862a6a7..5afef51515d30aa3400eb2ed5cc1b690fbbc6c7a 100644 (file)
@@ -13,7 +13,7 @@
  * without express or implied warranty.
  */
 
-static const char rcsid[] = "$Id: ares_process.c,v 1.5 2000/02/17 18:27:27 ghudson Exp $";
+static const char rcsid[] = "$Id: ares_process.c,v 1.7 2001/03/17 16:43:36 ghudson Exp $";
 
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -392,6 +392,7 @@ void ares__send_query(ares_channel channel, struct query *query, time_t now)
            {
              query->skip_server[query->server] = 1;
              next_server(channel, query, now);
+             return;
            }
        }
       sendreq = malloc(sizeof(struct send_request));
@@ -415,12 +416,14 @@ void ares__send_query(ares_channel channel, struct query *query, time_t now)
            {
              query->skip_server[query->server] = 1;
              next_server(channel, query, now);
+             return;
            }
        }
       if (send(server->udp_socket, query->qbuf, query->qlen, 0) == -1)
        {
          query->skip_server[query->server] = 1;
          next_server(channel, query, now);
+         return;
        }
       query->timeout = now
          + ((query->try == 0) ? channel->timeout
@@ -501,7 +504,7 @@ static int same_questions(const unsigned char *qbuf, int qlen,
     char *name;
     int namelen;
     int type;
-    int class;
+    int dnsclass;
   } q, a;
   int i, j;
 
@@ -529,7 +532,7 @@ static int same_questions(const unsigned char *qbuf, int qlen,
          return 0;
        }
       q.type = DNS_QUESTION_TYPE(q.p);
-      q.class = DNS_QUESTION_CLASS(q.p);
+      q.dnsclass = DNS_QUESTION_CLASS(q.p);
       q.p += QFIXEDSZ;
 
       /* Search for this question in the answer. */
@@ -551,12 +554,12 @@ static int same_questions(const unsigned char *qbuf, int qlen,
              return 0;
            }
          a.type = DNS_QUESTION_TYPE(a.p);
-         a.class = DNS_QUESTION_CLASS(a.p);
+         a.dnsclass = DNS_QUESTION_CLASS(a.p);
          a.p += QFIXEDSZ;
 
          /* Compare the decoded questions. */
          if (strcasecmp(q.name, a.name) == 0 && q.type == a.type
-             && q.class == a.class)
+             && q.dnsclass == a.dnsclass)
            {
              free(a.name);
              break;
index a6e8b7a21f5dd883e9d3ccf8a17d69c469db1358..e332f4f2a74655ee5df9f97a0572f9bc24549c27 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: ares_query.3,v 1.1 1998/08/13 18:07:34 ghudson Exp $
+.\" $Id: ares_query.3,v 1.2 2000/09/21 19:15:56 ghudson Exp $
 .\"
 .\" Copyright 1998 by the Massachusetts Institute of Technology.
 .\"
@@ -25,7 +25,7 @@ ares_query \- Initiate a single-question DNS query
 .B     unsigned char *\fIabuf\fP, int \fIalen\fP)
 .PP
 .B void ares_query(ares_channel \fIchannel\fP, const char *\fIname\fP,
-.B     int \fIclass\fP, int \fItype\fP, ares_callback \fIcallback\fP,
+.B     int \fIdnsclass\fP, int \fItype\fP, ares_callback \fIcallback\fP,
 .B     void *\fIarg\fP)
 .fi
 .SH DESCRIPTION
@@ -39,7 +39,7 @@ The parameter
 gives the query name as a NUL-terminated C string of period-separated
 labels optionally ending with a period; periods and backslashes within
 a label must be escaped with a backslash.  The parameters
-.I class
+.I dnsclass
 and
 .I type
 give the class and type of the query using the values defined in
index 0c2be97d09e804264c713c28b42c993abac3b5b7..878e8132813a1ba7aebb2d21eab8e3862cc06139 100644 (file)
@@ -13,7 +13,7 @@
  * without express or implied warranty.
  */
 
-static const char rcsid[] = "$Id: ares_query.c,v 1.4 2000/01/05 16:29:44 ghudson Exp $";
+static const char rcsid[] = "$Id: ares_query.c,v 1.5 2000/09/21 19:15:58 ghudson Exp $";
 
 #include <sys/types.h>
 #include <netinet/in.h>
@@ -30,7 +30,7 @@ struct qquery {
 
 static void qcallback(void *arg, int status, unsigned char *abuf, int alen);
 
-void ares_query(ares_channel channel, const char *name, int class,
+void ares_query(ares_channel channel, const char *name, int dnsclass,
                int type, ares_callback callback, void *arg)
 {
   struct qquery *qquery;
@@ -39,7 +39,8 @@ void ares_query(ares_channel channel, const char *name, int class,
 
   /* Compose the query. */
   rd = !(channel->flags & ARES_FLAG_NORECURSE);
-  status = ares_mkquery(name, class, type, channel->next_id, rd, &qbuf, &qlen);
+  status = ares_mkquery(name, dnsclass, type, channel->next_id, rd, &qbuf,
+                       &qlen);
   channel->next_id++;
   if (status != ARES_SUCCESS)
     {
index f9ceb23169857dd39b424a63c5f21713b0200f20..567c78ccb9044240e0b2cb945b2eefd53634467f 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: ares_search.3,v 1.1 1998/08/13 18:07:35 ghudson Exp $
+.\" $Id: ares_search.3,v 1.2 2000/09/21 19:16:00 ghudson Exp $
 .\"
 .\" Copyright 1998 by the Massachusetts Institute of Technology.
 .\"
@@ -25,7 +25,7 @@ ares_search \- Initiate a DNS query with domain search
 .B     unsigned char *\fIabuf\fP, int \fIalen\fP)
 .PP
 .B void ares_search(ares_channel \fIchannel\fP, const char *\fIname\fP,
-.B     int \fIclass\fP, int \fItype\fP, ares_callback \fIcallback\fP,
+.B     int \fIdnsclass\fP, int \fItype\fP, ares_callback \fIcallback\fP,
 .B     void *\fIarg\fP)
 .fi
 .SH DESCRIPTION
@@ -41,7 +41,7 @@ gives the alias name or the base of the query name as a NUL-terminated
 C string of period-separated labels; if it ends with a period, the
 channel's search domains will not be used.  Periods and backslashes
 within a label must be escaped with a backslash.  The parameters
-.I class
+.I dnsclass
 and
 .I type
 give the class and type of the query using the values defined in
index f37a9ef33a539f19c668e2b3d98d04744afd331b..1f258b8116728e679941e488a8167b60acebcf6a 100644 (file)
@@ -13,7 +13,7 @@
  * without express or implied warranty.
  */
 
-static const char rcsid[] = "$Id: ares_search.c,v 1.2 1999/10/23 19:28:14 danw Exp $";
+static const char rcsid[] = "$Id: ares_search.c,v 1.3 2000/09/21 19:16:02 ghudson Exp $";
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -26,7 +26,7 @@ struct search_query {
   /* Arguments passed to ares_search */
   ares_channel channel;
   char *name;                  /* copied into an allocated buffer */
-  int class;
+  int dnsclass;
   int type;
   ares_callback callback;
   void *arg;
@@ -43,7 +43,7 @@ static void end_squery(struct search_query *squery, int status,
 static int cat_domain(const char *name, const char *domain, char **s);
 static int single_domain(ares_channel channel, const char *name, char **s);
 
-void ares_search(ares_channel channel, const char *name, int class,
+void ares_search(ares_channel channel, const char *name, int dnsclass,
                 int type, ares_callback callback, void *arg)
 {
   struct search_query *squery;
@@ -62,7 +62,7 @@ void ares_search(ares_channel channel, const char *name, int class,
     }
   if (s)
     {
-      ares_query(channel, s, class, type, callback, arg);
+      ares_query(channel, s, dnsclass, type, callback, arg);
       free(s);
       return;
     }
@@ -84,7 +84,7 @@ void ares_search(ares_channel channel, const char *name, int class,
       callback(arg, ARES_ENOMEM, NULL, 0);
       return;
     }
-  squery->class = class;
+  squery->dnsclass = dnsclass;
   squery->type = type;
   squery->status_as_is = -1;
   squery->callback = callback;
@@ -107,7 +107,7 @@ void ares_search(ares_channel channel, const char *name, int class,
       /* Try the name as-is first. */
       squery->next_domain = 0;
       squery->trying_as_is = 1;
-      ares_query(channel, name, class, type, search_callback, squery);
+      ares_query(channel, name, dnsclass, type, search_callback, squery);
     }
   else
     {
@@ -117,7 +117,7 @@ void ares_search(ares_channel channel, const char *name, int class,
       status = cat_domain(name, channel->domains[0], &s);
       if (status == ARES_SUCCESS)
        {
-         ares_query(channel, s, class, type, search_callback, squery);
+         ares_query(channel, s, dnsclass, type, search_callback, squery);
          free(s);
        }
       else
@@ -152,7 +152,7 @@ static void search_callback(void *arg, int status, unsigned char *abuf,
            {
              squery->trying_as_is = 0;
              squery->next_domain++;
-             ares_query(channel, s, squery->class, squery->type,
+             ares_query(channel, s, squery->dnsclass, squery->type,
                         search_callback, squery);
              free(s);
            }
@@ -161,7 +161,7 @@ static void search_callback(void *arg, int status, unsigned char *abuf,
        {
          /* Try the name as-is at the end. */
          squery->trying_as_is = 1;
-         ares_query(channel, squery->name, squery->class, squery->type,
+         ares_query(channel, squery->name, squery->dnsclass, squery->type,
                     search_callback, squery);
        }
       else