Index: /pjproject/trunk/pjlib-util/build/pjlib_util.dsp
===================================================================
--- /pjproject/trunk/pjlib-util/build/pjlib_util.dsp	(revision 753)
+++ /pjproject/trunk/pjlib-util/build/pjlib_util.dsp	(revision 754)
@@ -89,22 +89,8 @@
 
 SOURCE="..\src\pjlib-util\dns.c"
-
-!IF  "$(CFG)" == "pjlib_util - Win32 Release"
-
-!ELSEIF  "$(CFG)" == "pjlib_util - Win32 Debug"
-
-!ENDIF 
-
 # End Source File
 # Begin Source File
 
 SOURCE="..\src\pjlib-util\dns_dump.c"
-
-!IF  "$(CFG)" == "pjlib_util - Win32 Release"
-
-!ELSEIF  "$(CFG)" == "pjlib_util - Win32 Debug"
-
-!ENDIF 
-
 # End Source File
 # Begin Source File
@@ -123,11 +109,4 @@
 
 SOURCE="..\src\pjlib-util\resolver.c"
-
-!IF  "$(CFG)" == "pjlib_util - Win32 Release"
-
-!ELSEIF  "$(CFG)" == "pjlib_util - Win32 Debug"
-
-!ENDIF 
-
 # End Source File
 # Begin Source File
@@ -171,4 +150,8 @@
 # Begin Source File
 
+SOURCE="..\include\pjlib-util\config.h"
+# End Source File
+# Begin Source File
+
 SOURCE="..\include\pjlib-util\dns.h"
 # End Source File
@@ -212,4 +195,8 @@
 
 SOURCE="..\include\pjlib-util\stun.h"
+# End Source File
+# Begin Source File
+
+SOURCE="..\include\pjlib-util\types.h"
 # End Source File
 # Begin Source File
Index: /pjproject/trunk/pjlib-util/docs/doxygen.cfg
===================================================================
--- /pjproject/trunk/pjlib-util/docs/doxygen.cfg	(revision 753)
+++ /pjproject/trunk/pjlib-util/docs/doxygen.cfg	(revision 754)
@@ -18,5 +18,5 @@
 # by quotes) that should identify the project.
 
-PROJECT_NAME           =  PJLIB-UTIL
+PROJECT_NAME           =  "PJLIB-UTIL Reference"
 
 # The PROJECT_NUMBER tag can be used to enter a project or revision number. 
@@ -495,5 +495,5 @@
 # doxygen will generate files with .html extension.
 
-HTML_FILE_EXTENSION    = .html
+HTML_FILE_EXTENSION    = .htm
 
 # The HTML_HEADER tag can be used to specify a personal HTML header for 
Index: /pjproject/trunk/pjlib-util/docs/footer.html
===================================================================
--- /pjproject/trunk/pjlib-util/docs/footer.html	(revision 753)
+++ /pjproject/trunk/pjlib-util/docs/footer.html	(revision 754)
@@ -1,4 +1,11 @@
-</TD></TR>
-</TABLE>
+<p>&nbsp;</p>
+<hr><center>
+PJLIB-UTIL Open Source, small footprint, and portable asynchronous/caching DNS resolver, text scanner, STUN client, and XML library<br>
+(C)2001-2006 Benny Prijono
+</center>
+
+
+<!--#include virtual="/footer.html" -->
+
 </BODY>
 </HTML>
Index: /pjproject/trunk/pjlib-util/docs/header.html
===================================================================
--- /pjproject/trunk/pjlib-util/docs/header.html	(revision 753)
+++ /pjproject/trunk/pjlib-util/docs/header.html	(revision 754)
@@ -1,10 +1,9 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
-<title>PJLIB Documentation</title>
-<link href="doxygen.css" rel="stylesheet" type="text/css">
+<title>$title</title>
+<link href="/style/style.css" rel="stylesheet" type="text/css">
 </head><body>
-<A HREF="/">&lt;-- HOME</A><HR>
+	<!--#include virtual="/header.html" -->
+	<p><A HREF="/">Home</A> --&gt; <A HREF="/docs.htm">Documentations</A> --&gt; PJLIB Reference</p>
 
-<TABLE border="0">
-  <TR><TD width="600" align="left">
 
Index: /pjproject/trunk/pjlib-util/include/pjlib-util.h
===================================================================
--- /pjproject/trunk/pjlib-util/include/pjlib-util.h	(revision 753)
+++ /pjproject/trunk/pjlib-util/include/pjlib-util.h	(revision 754)
@@ -20,4 +20,9 @@
 #define __PJLIB_UTIL_H__
 
+/**
+ * @file pjlib-util.h
+ * @brief pjlib-util.h
+ */
+
 #include <pjlib-util/dns.h>
 #include <pjlib-util/errno.h>
@@ -29,4 +34,9 @@
 #include <pjlib-util/xml.h>
 
+
+/**
+ * @addtogroup PJLIB_UTIL
+ * @{
+ */
 
 PJ_BEGIN_DECL
@@ -40,4 +50,8 @@
 
 
+/**
+ * @}
+ */
+
 PJ_END_DECL
 
Index: /pjproject/trunk/pjlib-util/include/pjlib-util/config.h
===================================================================
--- /pjproject/trunk/pjlib-util/include/pjlib-util/config.h	(revision 754)
+++ /pjproject/trunk/pjlib-util/include/pjlib-util/config.h	(revision 754)
@@ -0,0 +1,208 @@
+/* $Id$ */
+/* 
+ * Copyright (C) 2003-2006 Benny Prijono <benny@prijono.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
+ */
+#ifndef __PJLIB_UTIL_CONFIG_H__
+#define __PJLIB_UTIL_CONFIG_H__
+
+
+/**
+ * @file config.h
+ * @brief Compile time settings
+ */
+
+/**
+ * @defgroup PJLIB_UTIL_CONFIG PJLIB-UTIL Configuration
+ * @ingroup PJLIB_UTIL
+ * @{
+ */
+
+
+/* **************************************************************************
+ * DNS CONFIGURATION
+ */
+
+/**
+ * This constant specifies the maximum names to keep in the temporary name
+ * table when performing name compression scheme when duplicating DNS packet
+ * (the #pj_dns_packet_dup() function).
+ *
+ * Generally name compression is desired, since it saves some memory (see
+ * PJ_DNS_RESOLVER_RES_BUF_SIZE setting). However it comes at the expense of 
+ * a little processing overhead to perform name scanning and also a little
+ * bit more stack usage (8 bytes per entry on 32bit platform).
+ *
+ * Default: 16
+ */
+#ifndef PJ_DNS_MAX_NAMES_IN_NAMETABLE
+#   define PJ_DNS_MAX_NAMES_IN_NAMETABLE	    16
+#endif
+
+
+/* **************************************************************************
+ * RESOLVER CONFIGURATION
+ */
+
+
+/**
+ * Maximum numbers of DNS nameservers that can be configured in resolver.
+ */
+#ifndef PJ_DNS_RESOLVER_MAX_NS
+#   define PJ_DNS_RESOLVER_MAX_NS		    16
+#endif
+
+
+/**
+ * Default retransmission delay, in miliseconds. The combination of 
+ * retransmission delay and count determines the query timeout.
+ *
+ * Default: 2000 (2 seconds, according to RFC 1035)
+ */
+#ifndef PJ_DNS_RESOLVER_QUERY_RETRANSMIT_DELAY
+#   define PJ_DNS_RESOLVER_QUERY_RETRANSMIT_DELAY   2000
+#endif
+
+
+/**
+ * Maximum number of transmissions before timeout is declared for
+ * the query.
+ *
+ * Default: 5
+ */
+#ifndef PJ_DNS_RESOLVER_QUERY_RETRANSMIT_COUNT
+#   define PJ_DNS_RESOLVER_QUERY_RETRANSMIT_COUNT   5
+#endif
+
+
+/**
+ * Maximum life-time of DNS response in the resolver response cache, 
+ * in seconds. If the value is zero, then DNS response caching will be 
+ * disabled.
+ *
+ * Default is 300 seconds (5 minutes).
+ *
+ * @see PJ_DNS_RESOLVER_INVALID_TTL
+ */
+#ifndef PJ_DNS_RESOLVER_MAX_TTL
+#   define PJ_DNS_RESOLVER_MAX_TTL		    (5*60)
+#endif
+
+/**
+ * The life-time of invalid DNS response in the resolver response cache.
+ * An invalid DNS response is a response which RCODE is non-zero and 
+ * response without any answer section. These responses can be put in 
+ * the cache too to minimize message round-trip.
+ *
+ * Default: 60 (one minute).
+ *
+ * @see PJ_DNS_RESOLVER_MAX_TTL
+ */
+#ifndef PJ_DNS_RESOLVER_INVALID_TTL
+#   define PJ_DNS_RESOLVER_INVALID_TTL		    60
+#endif
+
+/**
+ * The interval on which nameservers which are known to be good to be 
+ * probed again to determine whether they are still good. Note that
+ * this applies to both active nameserver (the one currently being used)
+ * and idle nameservers (good nameservers that are not currently selected).
+ * The probing to query the "goodness" of nameservers involves sending
+ * the same query to multiple servers, so it's probably not a good idea
+ * to send this probing too often.
+ *
+ * Default: 600 (ten minutes)
+ *
+ * @see PJ_DNS_RESOLVER_BAD_NS_TTL
+ */
+#ifndef PJ_DNS_RESOLVER_GOOD_NS_TTL
+#   define PJ_DNS_RESOLVER_GOOD_NS_TTL		    (10*60)
+#endif
+
+/**
+ * The interval on which nameservers which known to be bad to be probed
+ * again to determine whether it is still bad.
+ *
+ * Default: 60 (one minute)
+ *
+ * @see PJ_DNS_RESOLVER_GOOD_NS_TTL
+ */
+#ifndef PJ_DNS_RESOLVER_BAD_NS_TTL
+#   define PJ_DNS_RESOLVER_BAD_NS_TTL		    (1*60)
+#endif
+
+
+/**
+ * Maximum size of UDP packet. RFC 1035 states that maximum size of
+ * DNS packet carried over UDP is 512 bytes.
+ *
+ * Default: 512 byes
+ */
+#ifndef PJ_DNS_RESOLVER_MAX_UDP_SIZE
+#   define PJ_DNS_RESOLVER_MAX_UDP_SIZE		    512
+#endif
+
+
+/**
+ * Size of memory pool allocated for each individual DNS response cache.
+ * This value here should be more or less the same as maximum UDP packet
+ * size (PJ_DNS_RESOLVER_MAX_UDP_SIZE), since the DNS replicator function
+ * (#pj_dns_packet_dup()) is also capable of performing name compressions.
+ *
+ * Default: 512 (as a broad guidance, 400 is good for 4 SRV entries).
+ */
+#ifndef PJ_DNS_RESOLVER_RES_BUF_SIZE
+#   define PJ_DNS_RESOLVER_RES_BUF_SIZE		    512
+#endif
+
+
+
+/* **************************************************************************
+ * SCANNER CONFIGURATION
+ */
+
+
+/**
+ * Macro PJ_SCANNER_USE_BITWISE is defined and non-zero (by default yes)
+ * will enable the use of bitwise for character input specification (cis).
+ * This would save several kilobytes of .bss memory in the SIP parser.
+ */
+#ifndef PJ_SCANNER_USE_BITWISE
+#  define PJ_SCANNER_USE_BITWISE		    1
+#endif
+
+
+
+/* **************************************************************************
+ * STUN CLIENT CONFIGURATION
+ */
+
+/**
+ * Maximum number of attributes in the STUN packet.
+ *
+ * Default: 16
+ */
+#ifndef PJ_STUN_MAX_ATTR
+#   define PJ_STUN_MAX_ATTR			    16
+#endif
+
+
+/**
+ * @}
+ */
+
+#endif	/* __PJLIB_UTIL_CONFIG_H__ */
+
Index: /pjproject/trunk/pjlib-util/include/pjlib-util/dns.h
===================================================================
--- /pjproject/trunk/pjlib-util/include/pjlib-util/dns.h	(revision 753)
+++ /pjproject/trunk/pjlib-util/include/pjlib-util/dns.h	(revision 754)
@@ -25,13 +25,17 @@
  * @brief Low level DNS message parsing and packetization.
  */
-#include <pj/types.h>
+#include <pjlib-util/types.h>
 
 
 PJ_BEGIN_DECL
 
-
-/**
- * @defgroup PJ_DNS Low-level DNS message parsing and packetization
- * @ingroup PJ
+/**
+ * @defgroup PJ_DNS DNS and Asynchronous DNS Resolver
+ * @ingroup PJLIB_UTIL
+ */
+
+/**
+ * @defgroup PJ_DNS_PARSING Low-level DNS Message Parsing and Packetization
+ * @ingroup PJ_DNS
  * @{
  *
@@ -200,21 +204,4 @@
 
 /**
- * This constant specifies the maximum names to keep in the temporary name
- * table when performing name compression scheme when duplicating DNS packet
- * (the #pj_dns_packet_dup() function).
- *
- * Generally name compression is desired, since it saves some memory (see
- * PJ_DNS_RESOLVER_RES_BUF_SIZE setting). However it comes at the expense of 
- * a little processing overhead to perform name scanning and also a little
- * bit more stack usage (8 bytes per entry on 32bit platform).
- *
- * Default: 16
- */
-#ifndef PJ_DNS_MAX_NAMES_IN_NAMETABLE
-#   define PJ_DNS_MAX_NAMES_IN_NAMETABLE	16
-#endif
-
-
-/**
  * This structure describes a DNS query record.
  */
@@ -345,5 +332,5 @@
  * @param pool		The pool to allocate memory for the duplicated packet.
  * @param p		The DNS packet to be cloned.
- * @p_dst		Pointer to store the cloned DNS packet.
+ * @param p_dst		Pointer to store the cloned DNS packet.
  */
 PJ_DECL(void) pj_dns_packet_dup(pj_pool_t *pool,
Index: /pjproject/trunk/pjlib-util/include/pjlib-util/errno.h
===================================================================
--- /pjproject/trunk/pjlib-util/include/pjlib-util/errno.h	(revision 753)
+++ /pjproject/trunk/pjlib-util/include/pjlib-util/errno.h	(revision 754)
@@ -23,4 +23,9 @@
 #include <pj/errno.h>
 
+/**
+ * @defgroup PJLIB_UTIL_ERROR PJLIB-UTIL Error Codes
+ * @ingroup PJLIB_UTIL
+ * @{
+ */
 
 /**
@@ -241,3 +246,7 @@
 
 
+/**
+ * @}
+ */
+
 #endif	/* __PJLIB_UTIL_ERRNO_H__ */
Index: /pjproject/trunk/pjlib-util/include/pjlib-util/getopt.h
===================================================================
--- /pjproject/trunk/pjlib-util/include/pjlib-util/getopt.h	(revision 753)
+++ /pjproject/trunk/pjlib-util/include/pjlib-util/getopt.h	(revision 754)
@@ -22,4 +22,15 @@
 #ifndef __PJ_GETOPT_H__
 #define __PJ_GETOPT_H__ 1
+
+/**
+ * @file getopt.h
+ * @brief Compile time settings
+ */
+
+/**
+ * @defgroup PJLIB_UTIL_GETOPT Getopt
+ * @ingroup PJLIB_UTIL
+ * @{
+ */
 
 #ifdef	__cplusplus
@@ -128,4 +139,8 @@
 #endif
 
+/**
+ * @}
+ */
+
 #endif /* pj_getopt.h */
 
Index: /pjproject/trunk/pjlib-util/include/pjlib-util/md5.h
===================================================================
--- /pjproject/trunk/pjlib-util/include/pjlib-util/md5.h	(revision 753)
+++ /pjproject/trunk/pjlib-util/include/pjlib-util/md5.h	(revision 754)
@@ -20,7 +20,19 @@
 #define __PJLIB_UTIL_MD5_H__
 
+/**
+ * @file md5.h
+ * @brief MD5 Functions
+ */
+
 #include <pj/types.h>
 
 PJ_BEGIN_DECL
+
+/**
+ * @defgroup PJLIB_UTIL_MD5 MD5 Functions
+ * @ingroup PJLIB_UTIL
+ * @{
+ */
+
 
 /** MD5 context. */
@@ -51,5 +63,11 @@
 PJ_DECL(void) pj_md5_final(pj_md5_context *pms, pj_uint8_t digest[16]);
 
+
+/**
+ * @}
+ */
+
 PJ_END_DECL
 
+
 #endif	/* __PJLIB_UTIL_MD5_H__ */
Index: /pjproject/trunk/pjlib-util/include/pjlib-util/resolver.h
===================================================================
--- /pjproject/trunk/pjlib-util/include/pjlib-util/resolver.h	(revision 753)
+++ /pjproject/trunk/pjlib-util/include/pjlib-util/resolver.h	(revision 754)
@@ -31,6 +31,6 @@
 
 /**
- * @defgroup PJ_DNS_RESOLVER Asynchronous DNS Server Resolution
- * @ingroup PJLIB_UTIL
+ * @defgroup PJ_DNS_RESOLVER DNS Asynchronous/Caching Resolution Engine
+ * @ingroup PJ_DNS
  * @{
  *
@@ -133,5 +133,6 @@
  *
  * Note that a single response entry will occupy about 600-700 bytes of 
- * pool memory. 
+ * pool memory (the PJ_DNS_RESOLVER_RES_BUF_SIZE value plus internal
+ * structure). 
  *
  * Application can work around this problem by doing one of these:
@@ -149,121 +150,10 @@
  * The PJLIB-UTIL resolver was built from the information in the following
  * standards:
- *  - RFC 1035: "Domain names - implementation and specification"
- *  - RFC 2782: "A DNS RR for specifying the location of services (DNS SRV)"
- */
-
-
-/*
- * CONFIGURATIONS
- */
-
-/**
- * Maximum numbers of DNS nameservers that can be configured in resolver.
- */
-#ifndef PJ_DNS_RESOLVER_MAX_NS
-#   define PJ_DNS_RESOLVER_MAX_NS		    16
-#endif
-
-
-/**
- * Default retransmission delay, in miliseconds. The combination of 
- * retransmission delay and count determines the query timeout.
- *
- * Default: 2000 (2 seconds, according to RFC 1035)
- */
-#ifndef PJ_DNS_RESOLVER_QUERY_RETRANSMIT_DELAY
-#   define PJ_DNS_RESOLVER_QUERY_RETRANSMIT_DELAY   2000
-#endif
-
-
-/**
- * Maximum number of transmissions before timeout is declared for
- * the query.
- *
- * Default: 2
- */
-#ifndef PJ_DNS_RESOLVER_QUERY_RETRANSMIT_COUNT
-#   define PJ_DNS_RESOLVER_QUERY_RETRANSMIT_COUNT   5
-#endif
-
-
-/**
- * Maximum life-time of DNS response in the resolver response cache, 
- * in seconds. If the value is zero, then DNS response caching will be 
- * disabled.
- *
- * Default is 300 seconds (5 minutes).
- *
- * @see PJ_DNS_RESOLVER_INVALID_TTL
- */
-#ifndef PJ_DNS_RESOLVER_MAX_TTL
-#   define PJ_DNS_RESOLVER_MAX_TTL		    (5*60)
-#endif
-
-/**
- * The life-time of invalid DNS response in the resolver response cache.
- * An invalid DNS response is a response without an answer. These 
- * responses can be put in the cache too to minimize message round-trip.
- *
- * Default: 0 (which means, invalid DNS response will not be cached).
- *
- * @see PJ_DNS_RESOLVER_MAX_TTL
- */
-#ifndef PJ_DNS_RESOLVER_INVALID_TTL
-#   define PJ_DNS_RESOLVER_INVALID_TTL		    60
-#endif
-
-/**
- * The interval on which nameservers which are known to be good to be 
- * probed again to determine whether they are still good. Note that
- * this applies to both active nameserver (the one currently being used)
- * and idle nameservers (good nameservers that are not currently selected).
- * The probing to query the "goodness" of nameservers involves sending
- * the same query to multiple servers, so it's probably not a good idea
- * to send this probing too often.
- *
- * Default: 600 (ten minutes)
- *
- * @see PJ_DNS_RESOLVER_BAD_NS_TTL
- */
-#ifndef PJ_DNS_RESOLVER_GOOD_NS_TTL
-#   define PJ_DNS_RESOLVER_GOOD_NS_TTL		    (10*60)
-#endif
-
-/**
- * The interval on which nameservers which known to be bad to be probed
- * again to determine whether it is still bad.
- *
- * Default: 600 (ten minutes)
- *
- * @see PJ_DNS_RESOLVER_GOOD_NS_TTL
- */
-#ifndef PJ_DNS_RESOLVER_BAD_NS_TTL
-#   define PJ_DNS_RESOLVER_BAD_NS_TTL		    (1*60)
-#endif
-
-
-/**
- * Maximum size of UDP packet. RFC 1035 states that maximum size of
- * DNS packet carried over UDP is 512 bytes.
- *
- * Default: 512 byes
- */
-#ifndef PJ_DNS_RESOLVER_MAX_UDP_SIZE
-#   define PJ_DNS_RESOLVER_MAX_UDP_SIZE		    512
-#endif
-
-
-/**
- * Size of memory pool allocated for each individual DNS response cache.
- * This value here should be more or less the same as maximum UDP packet
- * size (PJ_DNS_RESOLVER_MAX_UDP_SIZE), since the DNS replicator function
- * (#pj_dns_packet_dup()) is also capable of performing name compressions.
- *
- * Default: 512 (as a broad guidance, 400 is good for 4 SRV entries).
- */
-#ifndef PJ_DNS_RESOLVER_RES_BUF_SIZE
-#   define PJ_DNS_RESOLVER_RES_BUF_SIZE		    512
-#endif
+ *  - <A HREF="http://www.faqs.org/rfcs/rfc1035.html">
+ *    RFC 1035: "Domain names - implementation and specification"</A>
+ *  - <A HREF="http://www.faqs.org/rfcs/rfc2782.html">
+ *    RFC 2782: "A DNS RR for specifying the location of services (DNS SRV)"
+ *    </A>
+ */
 
 
Index: /pjproject/trunk/pjlib-util/include/pjlib-util/scanner.h
===================================================================
--- /pjproject/trunk/pjlib-util/include/pjlib-util/scanner.h	(revision 753)
+++ /pjproject/trunk/pjlib-util/include/pjlib-util/scanner.h	(revision 754)
@@ -25,23 +25,14 @@
  */
 
-#include <pj/types.h>
-
-/**
- * Macro PJ_SCANNER_USE_BITWISE is defined and non-zero (by default yes)
- * will enable the use of bitwise for character input specification (cis).
- * This would save several kilobytes of .bss memory in the SIP parser.
- */
-#ifndef PJ_SCANNER_USE_BITWISE
-#  define PJ_SCANNER_USE_BITWISE   1
-#endif
-
+#include <pjlib-util/types.h>
 
 PJ_BEGIN_DECL
 
 /**
- * @defgroup PJ_SCAN Text Scanning
- * @ingroup PJ_MISC
- * @brief
- * Text scanning utility.
+ * @defgroup PJ_SCAN Fast Text Scanning
+ * @ingroup PJLIB_UTIL
+ * @brief Text scanning utility.
+ *
+ * This module describes a fast text scanning functions.
  *
  * @{
Index: /pjproject/trunk/pjlib-util/include/pjlib-util/string.h
===================================================================
--- /pjproject/trunk/pjlib-util/include/pjlib-util/string.h	(revision 753)
+++ /pjproject/trunk/pjlib-util/include/pjlib-util/string.h	(revision 754)
@@ -27,4 +27,10 @@
 #include <pj/types.h>
 #include <pjlib-util/scanner.h>
+
+/**
+ * @defgroup PJLIB_UTIL_STRING String Escaping Utilities
+ * @ingroup PJLIB_UTIL
+ * @{
+ */
 
 PJ_BEGIN_DECL
@@ -88,3 +94,8 @@
 PJ_END_DECL
 
+
+/**
+ * @}
+ */
+
 #endif	/* __PJLIB_UTIL_STRING_H__ */
Index: /pjproject/trunk/pjlib-util/include/pjlib-util/stun.h
===================================================================
--- /pjproject/trunk/pjlib-util/include/pjlib-util/stun.h	(revision 753)
+++ /pjproject/trunk/pjlib-util/include/pjlib-util/stun.h	(revision 754)
@@ -20,11 +20,23 @@
 #define __PJ_STUN_H__
 
-#include <pj/types.h>
+/**
+ * @file stun.h
+ * @brief STUN client.
+ */
+
+#include <pjlib-util/types.h>
 #include <pj/sock.h>
 
+/**
+ * @defgroup PJLIB_UTIL_STUN_CLIENT Mini/Tiny STUN Client
+ * @ingroup PJLIB_UTIL
+ * @{
+ */
+
 PJ_BEGIN_DECL
 
-#define PJ_STUN_MAX_ATTR    16
-
+/**
+ * This enumeration describes STUN message types.
+ */
 typedef enum pj_stun_msg_type
 {
@@ -37,4 +49,8 @@
 } pj_stun_msg_type;
 
+
+/**
+ * This enumeration describes STUN attribute types.
+ */
 typedef enum pj_stun_attr_type
 {
@@ -52,4 +68,8 @@
 } pj_stun_attr_type;
 
+
+/**
+ * This structre describes STUN message header.
+ */
 typedef struct pj_stun_msg_hdr
 {
@@ -59,4 +79,8 @@
 } pj_stun_msg_hdr;
 
+
+/**
+ * This structre describes STUN attribute header.
+ */
 typedef struct pj_stun_attr_hdr
 {
@@ -65,4 +89,8 @@
 } pj_stun_attr_hdr;
 
+
+/**
+ * This structre describes STUN MAPPED-ADDR attribute.
+ */
 typedef struct pj_stun_mapped_addr_attr
 {
@@ -119,4 +147,43 @@
 PJ_DECL(void*) pj_stun_msg_find_attr( pj_stun_msg *msg, pj_stun_attr_type t);
 
+
+/**
+ * This is the main function to request the mapped address of local sockets
+ * to multiple STUN servers. This function is able to find the mapped 
+ * addresses of multiple sockets simultaneously, and for each socket, two
+ * requests will be sent to two different STUN servers to see if both servers
+ * get the same public address for the same socket. (Note that application can
+ * specify the same address for the two servers, but still two requests will
+ * be sent for each server).
+ *
+ * This function will perform necessary retransmissions of the requests if
+ * response is not received within a predetermined period. When all responses
+ * have been received, the function will compare the mapped addresses returned
+ * by the servers, and when both are equal, the address will be returned in
+ * \a mapped_addr argument.
+ *
+ * @param pf		The pool factory where memory will be allocated from.
+ * @param sock_cnt	Number of sockets in the socket array.
+ * @param sock		Array of local UDP sockets which public addresses are
+ *			to be queried from the STUN servers.
+ * @param srv1		Host name or IP address string of the first STUN
+ *			server.
+ * @param port1		The port number of the first STUN server. 
+ * @param srv2		Host name or IP address string of the second STUN
+ *			server.
+ * @param port2		The port number of the second STUN server. 
+ * @param mapped_addr	Array to receive the mapped public address of the local
+ *			UDP sockets, when the function returns PJ_SUCCESS.
+ *
+ * @return		This functions returns PJ_SUCCESS if responses are
+ *			received from all servers AND all servers returned the
+ *			same mapped public address. Otherwise this function may
+ *			return one of the following error codes:
+ *			- PJLIB_UTIL_ESTUNNOTRESPOND: no respons from servers.
+ *			- PJLIB_UTIL_ESTUNSYMMETRIC: different mapped addresses
+ *			  are returned by servers.
+ *			- etc.
+ *
+ */
 PJ_DECL(pj_status_t) pj_stun_get_mapped_addr( pj_pool_factory *pf,
 					      int sock_cnt, pj_sock_t sock[],
@@ -127,4 +194,8 @@
 PJ_END_DECL
 
+/**
+ * @}
+ */
+
 #endif	/* __PJ_STUN_H__ */
 
Index: /pjproject/trunk/pjlib-util/include/pjlib-util/types.h
===================================================================
--- /pjproject/trunk/pjlib-util/include/pjlib-util/types.h	(revision 754)
+++ /pjproject/trunk/pjlib-util/include/pjlib-util/types.h	(revision 754)
@@ -0,0 +1,63 @@
+/* $Id$ */
+/* 
+ * Copyright (C) 2003-2006 Benny Prijono <benny@prijono.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
+ */
+#ifndef __PJLIB_UTIL_TYPES_H__
+#define __PJLIB_UTIL_TYPES_H__
+
+/**
+ * @file types.h
+ * @brief PJLIB-UTIL types.
+ */
+
+#include <pj/types.h>
+#include <pjlib-util/config.h>
+
+/**
+ * @defgroup PJLIB_UTIL PJLIB-UTIL Library
+ */
+
+/**
+ * @mainpage PJLIB-UTIL
+ *
+ * \n
+ * \n
+ * \n
+ * This is the documentation of PJLIB-UTIL, an auxiliary library providing
+ * adjunct functions to PJLIB.
+ * 
+ * Please go to the <A HREF="modules.htm"><B>Modules</B></A> page for list
+ * of modules.
+ *
+ *
+ * \n
+ * \n
+ * \n
+ * \n
+ * \n
+ * \n
+ * \n
+ * \n
+ * \n
+ * \n
+ * \n
+ * \n
+ * \n
+ */
+
+#endif	/* __PJLIB_UTIL_TYPES_H__ */
+
Index: /pjproject/trunk/pjlib-util/include/pjlib-util/xml.h
===================================================================
--- /pjproject/trunk/pjlib-util/include/pjlib-util/xml.h	(revision 753)
+++ /pjproject/trunk/pjlib-util/include/pjlib-util/xml.h	(revision 754)
@@ -31,6 +31,6 @@
 
 /**
- * @defgroup PJ_XML XML Parser/Helper.
- * @ingroup PJ
+ * @defgroup PJ_TINY_XML Mini/Tiny XML Parser/Helper
+ * @ingroup PJLIB_UTIL
  * @{
  */
Index: /pjproject/trunk/pjlib-util/src/pjlib-util/dns.c
===================================================================
--- /pjproject/trunk/pjlib-util/src/pjlib-util/dns.c	(revision 753)
+++ /pjproject/trunk/pjlib-util/src/pjlib-util/dns.c	(revision 754)
@@ -456,5 +456,5 @@
 				      sizeof(pj_dns_parsed_query));
 	for (i=0; i<res->hdr.qdcount; ++i) {
-	    int parsed_len;
+	    int parsed_len = 0;
 	    
 	    status = parse_query(&res->q[i], pool, packet, start, end,
Index: /pjproject/trunk/pjlib-util/src/pjlib-util/resolver.c
===================================================================
--- /pjproject/trunk/pjlib-util/src/pjlib-util/resolver.c	(revision 753)
+++ /pjproject/trunk/pjlib-util/src/pjlib-util/resolver.c	(revision 754)
@@ -949,5 +949,5 @@
     /* Calculate expiration time. */
     if (set_expiry) {
-	if (pkt->hdr.anscount == 0) {
+	if (pkt->hdr.anscount == 0 || status != PJ_SUCCESS) {
 	    /* If we don't have answers for the name, then give a different
 	     * ttl value (note: PJ_DNS_RESOLVER_INVALID_TTL may be zero, 
