2005-08-23 19:11:19 +00:00
|
|
|
//
|
|
|
|
// VMime library (http://www.vmime.org)
|
|
|
|
// Copyright (C) 2002-2005 Vincent Richard <vincent@vincent-richard.net>
|
|
|
|
//
|
|
|
|
// 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.
|
|
|
|
//
|
2005-09-17 10:10:29 +00:00
|
|
|
// You should have received a copy of the GNU General Public License along along
|
|
|
|
// with this program; if not, write to the Free Software Foundation, Inc., Foundation, Inc.,
|
|
|
|
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA..
|
2005-08-23 19:11:19 +00:00
|
|
|
//
|
|
|
|
|
2005-09-17 09:08:45 +00:00
|
|
|
#include "vmime/config.hpp"
|
2005-08-23 19:11:19 +00:00
|
|
|
#include "vmime/net/service.hpp"
|
|
|
|
|
2005-09-17 09:08:45 +00:00
|
|
|
#if VMIME_HAVE_SASL_SUPPORT
|
|
|
|
#include "vmime/security/sasl/defaultSASLAuthenticator.hpp"
|
|
|
|
#else
|
|
|
|
#include "vmime/security/defaultAuthenticator.hpp"
|
|
|
|
#endif // VMIME_HAVE_SASL_SUPPORT
|
2005-08-23 19:11:19 +00:00
|
|
|
|
|
|
|
|
|
|
|
namespace vmime {
|
|
|
|
namespace net {
|
|
|
|
|
|
|
|
|
2005-09-17 09:08:45 +00:00
|
|
|
service::service(ref <session> sess, const serviceInfos& /* infos */,
|
|
|
|
ref <security::authenticator> auth)
|
2005-08-23 19:11:19 +00:00
|
|
|
: m_session(sess), m_auth(auth)
|
|
|
|
{
|
|
|
|
if (!auth)
|
|
|
|
{
|
2005-09-17 09:08:45 +00:00
|
|
|
#if VMIME_HAVE_SASL_SUPPORT
|
|
|
|
m_auth = vmime::create
|
|
|
|
<security::sasl::defaultSASLAuthenticator>();
|
|
|
|
#else
|
|
|
|
m_auth = vmime::create
|
|
|
|
<security::defaultAuthenticator>();
|
|
|
|
#endif // VMIME_HAVE_SASL_SUPPORT
|
2005-08-23 19:11:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
service::~service()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ref <const session> service::getSession() const
|
|
|
|
{
|
|
|
|
return (m_session);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ref <session> service::getSession()
|
|
|
|
{
|
|
|
|
return (m_session);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-09-17 09:08:45 +00:00
|
|
|
ref <const security::authenticator> service::getAuthenticator() const
|
2005-08-23 19:11:19 +00:00
|
|
|
{
|
|
|
|
return (m_auth);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-09-17 09:08:45 +00:00
|
|
|
ref <security::authenticator> service::getAuthenticator()
|
2005-08-23 19:11:19 +00:00
|
|
|
{
|
|
|
|
return (m_auth);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-09-17 09:08:45 +00:00
|
|
|
void service::setAuthenticator(ref <security::authenticator> auth)
|
|
|
|
{
|
|
|
|
m_auth = auth;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-08-23 19:11:19 +00:00
|
|
|
} // net
|
|
|
|
} // vmime
|