reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
ExternalDnsFactory.cxx
Go to the documentation of this file.
1#ifdef HAVE_CONFIG_H
2#include "config.h"
3#endif
4
5#if !defined(WIN32)
6#include <sys/types.h>
7#endif
8
9//#define USE_LOCAL_DNS
10#ifdef USE_LOCAL_DNS
12#else
13#include "rutil/dns/AresDns.hxx"
14#endif
15
18
19
20using namespace resip;
21
22ExternalDnsCreator* ExternalDnsFactory::mCreator = 0;
23
24static volatile bool enablePostConnectSocketFuncCall = false;
25
26void
31
32bool
37
38void
40{
41 mCreator = creator;
42}
43
46{
47 if(mCreator)
48 {
49 return mCreator->createExternalDns();
50 }
51 else
52 {
53#ifdef USE_LOCAL_DNS
54 InfoLog (<< "Using Local DNS instead of Ares. Should only be used for tests.");
55 return new LocalDns();
56#else
57 return new AresDns();
58#endif
59 }
60}
61
62/* ====================================================================
63 * The Vovida Software License, Version 1.0
64 *
65 * Copyright (c) 2026 SIP Spectrum, Inc. http://www.sipspectrum.com
66 * Copyright (c) 2000-2005 Vovida Networks, Inc. All rights reserved.
67 *
68 * Redistribution and use in source and binary forms, with or without
69 * modification, are permitted provided that the following conditions
70 * are met:
71 *
72 * 1. Redistributions of source code must retain the above copyright
73 * notice, this list of conditions and the following disclaimer.
74 *
75 * 2. Redistributions in binary form must reproduce the above copyright
76 * notice, this list of conditions and the following disclaimer in
77 * the documentation and/or other materials provided with the
78 * distribution.
79 *
80 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
81 * and "Vovida Open Communication Application Library (VOCAL)" must
82 * not be used to endorse or promote products derived from this
83 * software without prior written permission. For written
84 * permission, please contact vocal@vovida.org.
85 *
86 * 4. Products derived from this software may not be called "VOCAL", nor
87 * may "VOCAL" appear in their name, without prior written
88 * permission of Vovida Networks, Inc.
89 *
90 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
91 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
92 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
93 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
94 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
95 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
96 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
97 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
98 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
99 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
100 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
101 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
102 * DAMAGE.
103 *
104 * ====================================================================
105 *
106 * This software consists of voluntary contributions made by Vovida
107 * Networks, Inc. and many individuals on behalf of Vovida Networks,
108 * Inc. For more information on Vovida Networks, Inc., please see
109 * <http://www.vovida.org/>.
110 *
111 */
static volatile bool enablePostConnectSocketFuncCall
#define InfoLog(args_)
Definition Logger.hxx:131
virtual ExternalDns * createExternalDns()=0
static ExternalDns * createExternalDns()
static void setExternalCreator(ExternalDnsCreator *creator)
static bool getEnablePostConnectSocketFuncCall()
static void setEnablePostConnectSocketFuncCall(bool enabled=true)
dcm! – add UnusedChecking(_enum) below;