|
reSIProcate/rutil
9694
|
00001 #ifndef RESIP_QUERY_TYPES_HXX 00002 #define RESIP_QUERY_TYPES_HXX 00003 00004 #include "rutil/HeapInstanceCounter.hxx" 00005 #include "rutil/compat.hxx" 00006 #include "rutil/Socket.hxx" 00007 #include "rutil/BaseException.hxx" 00008 #include "DnsResourceRecord.hxx" 00009 #include "DnsHostRecord.hxx" 00010 #include "DnsCnameRecord.hxx" 00011 #include "DnsAAAARecord.hxx" 00012 #include "DnsSrvRecord.hxx" 00013 #include "DnsNaptrRecord.hxx" 00014 00015 //'Interface' of the RRType concept 00016 // class QueryType 00017 // { 00018 // public: 00019 // static unsigned short getRRType(); 00020 // enum SupportsCName; //does following CNAME apply to this query type 00021 // }; 00022 00023 00025 00026 namespace resip 00027 { 00028 00029 #define defineQueryType(_name, _type, _rrType, _supportsCName, _rfc) \ 00030 class RR_##_name \ 00031 { \ 00032 public: \ 00033 RESIP_HeapCount(RR_##_name); \ 00034 enum {SupportsCName = _supportsCName}; \ 00035 static unsigned short getRRType(); \ 00036 typedef _type Type; \ 00037 static Data getRRTypeName(); \ 00038 }; \ 00039 extern RR_##_name q_##_name 00040 00041 defineQueryType(A, DnsHostRecord, 1, true, "RFC 1035"); 00042 defineQueryType(CNAME, DnsCnameRecord, 5, false, "RFC 1035"); 00043 00044 defineQueryType(AAAA, DnsAAAARecord, 28, true, "RFC 3596"); 00045 00046 defineQueryType(SRV, DnsSrvRecord, 33, true, "RFC 2782"); 00047 defineQueryType(NAPTR, DnsNaptrRecord, 35, true, "RFC 2915"); 00048 00049 } 00050 00051 #undef defineQueryType 00052 00053 #endif 00054 00055 /* ==================================================================== 00056 * The Vovida Software License, Version 1.0 00057 * 00058 * Copyright (c) 2000-2005 Vovida Networks, Inc. All rights reserved. 00059 * 00060 * Redistribution and use in source and binary forms, with or without 00061 * modification, are permitted provided that the following conditions 00062 * are met: 00063 * 00064 * 1. Redistributions of source code must retain the above copyright 00065 * notice, this list of conditions and the following disclaimer. 00066 * 00067 * 2. Redistributions in binary form must reproduce the above copyright 00068 * notice, this list of conditions and the following disclaimer in 00069 * the documentation and/or other materials provided with the 00070 * distribution. 00071 * 00072 * 3. The names "VOCAL", "Vovida Open Communication Application Library", 00073 * and "Vovida Open Communication Application Library (VOCAL)" must 00074 * not be used to endorse or promote products derived from this 00075 * software without prior written permission. For written 00076 * permission, please contact vocal@vovida.org. 00077 * 00078 * 4. Products derived from this software may not be called "VOCAL", nor 00079 * may "VOCAL" appear in their name, without prior written 00080 * permission of Vovida Networks, Inc. 00081 * 00082 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED 00083 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 00084 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND 00085 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA 00086 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES 00087 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL, 00088 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 00089 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 00090 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 00091 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00092 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE 00093 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 00094 * DAMAGE. 00095 * 00096 * ==================================================================== 00097 * 00098 * This software consists of voluntary contributions made by Vovida 00099 * Networks, Inc. and many individuals on behalf of Vovida Networks, 00100 * Inc. For more information on Vovida Networks, Inc., please see 00101 * <http://www.vovida.org/>. 00102 * 00103 */ 00104
1.7.5.1