1 /*
2  * Copyright (C) 1996-2021 The Squid Software Foundation and contributors
3  *
4  * Squid software is distributed under GPLv2+ license and includes
5  * contributions from numerous individuals and organizations.
6  * Please see the COPYING and CONTRIBUTORS files for details.
7  */
8 
9 #include "squid.h"
10 #include "auth/ntlm/Config.h"
11 #include "auth/ntlm/Scheme.h"
12 #include "Debug.h"
13 #include "helper.h"
14 
15 Auth::Scheme::Pointer Auth::Ntlm::Scheme::_instance = NULL;
16 
17 Auth::Scheme::Pointer
GetInstance()18 Auth::Ntlm::Scheme::GetInstance()
19 {
20     if (_instance == NULL) {
21         _instance = new Auth::Ntlm::Scheme();
22         AddScheme(_instance);
23     }
24     return _instance;
25 }
26 
27 char const *
type() const28 Auth::Ntlm::Scheme::type() const
29 {
30     return "ntlm";
31 }
32 
33 void
shutdownCleanup()34 Auth::Ntlm::Scheme::shutdownCleanup()
35 {
36     if (_instance == NULL)
37         return;
38 
39     _instance = NULL;
40     debugs(29, DBG_CRITICAL, "Shutdown: NTLM authentication.");
41 }
42 
43 Auth::Config *
createConfig()44 Auth::Ntlm::Scheme::createConfig()
45 {
46     Auth::Ntlm::Config *ntlmCfg = new Auth::Ntlm::Config;
47     return dynamic_cast<Auth::Config*>(ntlmCfg);
48 }
49 
50