Class naming update
This commit is contained in:
@@ -25,7 +25,7 @@ namespace eap
|
||||
///
|
||||
/// TTLS configuration
|
||||
///
|
||||
class config_ttls;
|
||||
class config_method_ttls;
|
||||
}
|
||||
|
||||
namespace eapserial
|
||||
@@ -36,7 +36,7 @@ namespace eapserial
|
||||
/// \param[inout] cursor Memory cursor
|
||||
/// \param[in] val Configuration to pack
|
||||
///
|
||||
inline void pack(_Inout_ unsigned char *&cursor, _In_ const eap::config_ttls &val);
|
||||
inline void pack(_Inout_ unsigned char *&cursor, _In_ const eap::config_method_ttls &val);
|
||||
|
||||
///
|
||||
/// Returns packed size of a TTLS based method configuration
|
||||
@@ -45,7 +45,7 @@ namespace eapserial
|
||||
///
|
||||
/// \returns Size of data when packed (in bytes)
|
||||
///
|
||||
inline size_t get_pk_size(const eap::config_ttls &val);
|
||||
inline size_t get_pk_size(const eap::config_method_ttls &val);
|
||||
|
||||
///
|
||||
/// Unpacks a TTLS based method configuration
|
||||
@@ -53,7 +53,7 @@ namespace eapserial
|
||||
/// \param[inout] cursor Memory cursor
|
||||
/// \param[out] val Configuration to unpack to
|
||||
///
|
||||
inline void unpack(_Inout_ const unsigned char *&cursor, _Out_ eap::config_ttls &val);
|
||||
inline void unpack(_Inout_ const unsigned char *&cursor, _Out_ eap::config_method_ttls &val);
|
||||
}
|
||||
|
||||
#pragma once
|
||||
@@ -66,7 +66,7 @@ namespace eapserial
|
||||
|
||||
|
||||
namespace eap {
|
||||
class config_ttls : public config_tls
|
||||
class config_method_ttls : public config_method_tls
|
||||
{
|
||||
public:
|
||||
///
|
||||
@@ -74,26 +74,26 @@ namespace eap {
|
||||
///
|
||||
/// \param[in] mod Reference of the EAP module to use for global services
|
||||
///
|
||||
config_ttls(_In_ module &mod);
|
||||
config_method_ttls(_In_ module &mod);
|
||||
|
||||
///
|
||||
/// Copies configuration
|
||||
///
|
||||
/// \param[in] other Configuration to copy from
|
||||
///
|
||||
config_ttls(const _In_ config_ttls &other);
|
||||
config_method_ttls(const _In_ config_method_ttls &other);
|
||||
|
||||
///
|
||||
/// Moves configuration
|
||||
///
|
||||
/// \param[in] other Configuration to move from
|
||||
///
|
||||
config_ttls(_Inout_ config_ttls &&other);
|
||||
config_method_ttls(_Inout_ config_method_ttls &&other);
|
||||
|
||||
///
|
||||
/// Destructs configuration
|
||||
///
|
||||
virtual ~config_ttls();
|
||||
virtual ~config_method_ttls();
|
||||
|
||||
///
|
||||
/// Copies configuration
|
||||
@@ -102,7 +102,7 @@ namespace eap {
|
||||
///
|
||||
/// \returns Reference to this object
|
||||
///
|
||||
config_ttls& operator=(const _In_ config_ttls &other);
|
||||
config_method_ttls& operator=(const _In_ config_method_ttls &other);
|
||||
|
||||
///
|
||||
/// Moves configuration
|
||||
@@ -111,7 +111,7 @@ namespace eap {
|
||||
///
|
||||
/// \returns Reference to this object
|
||||
///
|
||||
config_ttls& operator=(_Inout_ config_ttls &&other);
|
||||
config_method_ttls& operator=(_Inout_ config_method_ttls &&other);
|
||||
|
||||
///
|
||||
/// Clones configuration
|
||||
@@ -165,13 +165,13 @@ namespace eap {
|
||||
|
||||
namespace eapserial
|
||||
{
|
||||
inline void pack(_Inout_ unsigned char *&cursor, _In_ const eap::config_ttls &val)
|
||||
inline void pack(_Inout_ unsigned char *&cursor, _In_ const eap::config_method_ttls &val)
|
||||
{
|
||||
pack(cursor, (const eap::config_tls&)val);
|
||||
pack(cursor, (const eap::config_method_tls&)val);
|
||||
if (val.m_inner) {
|
||||
if (dynamic_cast<eap::config_pap*>(val.m_inner)) {
|
||||
if (dynamic_cast<eap::config_method_pap*>(val.m_inner)) {
|
||||
pack(cursor, eap::type_pap);
|
||||
pack(cursor, (const eap::config_pap&)*val.m_inner);
|
||||
pack(cursor, (const eap::config_method_pap&)*val.m_inner);
|
||||
} else {
|
||||
assert(0); // Unsupported inner authentication method type.
|
||||
pack(cursor, eap::type_undefined);
|
||||
@@ -181,14 +181,14 @@ namespace eapserial
|
||||
}
|
||||
|
||||
|
||||
inline size_t get_pk_size(const eap::config_ttls &val)
|
||||
inline size_t get_pk_size(const eap::config_method_ttls &val)
|
||||
{
|
||||
size_t size_inner;
|
||||
if (val.m_inner) {
|
||||
if (dynamic_cast<eap::config_pap*>(val.m_inner)) {
|
||||
if (dynamic_cast<eap::config_method_pap*>(val.m_inner)) {
|
||||
size_inner =
|
||||
get_pk_size(eap::type_pap) +
|
||||
get_pk_size((const eap::config_pap&)*val.m_inner);
|
||||
get_pk_size((const eap::config_method_pap&)*val.m_inner);
|
||||
} else {
|
||||
size_inner = get_pk_size(eap::type_undefined);
|
||||
assert(0); // Unsupported inner authentication method type.
|
||||
@@ -197,14 +197,14 @@ namespace eapserial
|
||||
size_inner = get_pk_size(eap::type_undefined);
|
||||
|
||||
return
|
||||
get_pk_size((const eap::config_tls&)val) +
|
||||
get_pk_size((const eap::config_method_tls&)val) +
|
||||
size_inner;
|
||||
}
|
||||
|
||||
|
||||
inline void unpack(_Inout_ const unsigned char *&cursor, _Out_ eap::config_ttls &val)
|
||||
inline void unpack(_Inout_ const unsigned char *&cursor, _Out_ eap::config_method_ttls &val)
|
||||
{
|
||||
unpack(cursor, (eap::config_tls&)val);
|
||||
unpack(cursor, (eap::config_method_tls&)val);
|
||||
|
||||
if (val.m_inner)
|
||||
delete val.m_inner;
|
||||
@@ -213,8 +213,8 @@ namespace eapserial
|
||||
unpack(cursor, eap_type);
|
||||
switch (eap_type) {
|
||||
case eap::type_pap:
|
||||
val.m_inner = new eap::config_pap(val.m_module);
|
||||
unpack(cursor, (eap::config_pap&)*val.m_inner);
|
||||
val.m_inner = new eap::config_method_pap(val.m_module);
|
||||
unpack(cursor, (eap::config_method_pap&)*val.m_inner);
|
||||
break;
|
||||
default:
|
||||
val.m_inner = NULL;
|
||||
|
@@ -35,7 +35,7 @@ namespace eap
|
||||
|
||||
namespace eap
|
||||
{
|
||||
class peer_ttls : public peer<config_ttls, credentials_ttls, bool, bool>
|
||||
class peer_ttls : public peer<config_method_ttls, credentials_ttls, bool, bool>
|
||||
{
|
||||
public:
|
||||
///
|
||||
|
@@ -33,7 +33,7 @@ namespace eap
|
||||
|
||||
namespace eap
|
||||
{
|
||||
class session_ttls : public session<config_ttls, credentials_ttls, bool, bool>
|
||||
class session_ttls : public session<config_method_ttls, credentials_ttls, bool, bool>
|
||||
{
|
||||
public:
|
||||
///
|
||||
|
@@ -25,42 +25,42 @@ using namespace winstd;
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// eap::config_ttls
|
||||
// eap::config_method_ttls
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
eap::config_ttls::config_ttls(_In_ module &mod) :
|
||||
eap::config_method_ttls::config_method_ttls(_In_ module &mod) :
|
||||
m_inner(NULL),
|
||||
config_tls(mod)
|
||||
config_method_tls(mod)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
eap::config_ttls::config_ttls(const _In_ config_ttls &other) :
|
||||
eap::config_method_ttls::config_method_ttls(const _In_ config_method_ttls &other) :
|
||||
m_inner(other.m_inner ? (config_method*)other.m_inner->clone() : NULL),
|
||||
config_tls(other)
|
||||
config_method_tls(other)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
eap::config_ttls::config_ttls(_Inout_ config_ttls &&other) :
|
||||
eap::config_method_ttls::config_method_ttls(_Inout_ config_method_ttls &&other) :
|
||||
m_inner(other.m_inner),
|
||||
config_tls(std::move(other))
|
||||
config_method_tls(std::move(other))
|
||||
{
|
||||
other.m_inner = NULL;
|
||||
}
|
||||
|
||||
|
||||
eap::config_ttls::~config_ttls()
|
||||
eap::config_method_ttls::~config_method_ttls()
|
||||
{
|
||||
if (m_inner)
|
||||
delete m_inner;
|
||||
}
|
||||
|
||||
|
||||
eap::config_ttls& eap::config_ttls::operator=(const _In_ config_ttls &other)
|
||||
eap::config_method_ttls& eap::config_method_ttls::operator=(const _In_ config_method_ttls &other)
|
||||
{
|
||||
if (this != &other) {
|
||||
(config_tls&)*this = other;
|
||||
(config_method_tls&)*this = other;
|
||||
if (m_inner) delete m_inner;
|
||||
m_inner = other.m_inner ? (config_method*)other.m_inner->clone() : NULL;
|
||||
}
|
||||
@@ -69,10 +69,10 @@ eap::config_ttls& eap::config_ttls::operator=(const _In_ config_ttls &other)
|
||||
}
|
||||
|
||||
|
||||
eap::config_ttls& eap::config_ttls::operator=(_Inout_ config_ttls &&other)
|
||||
eap::config_method_ttls& eap::config_method_ttls::operator=(_Inout_ config_method_ttls &&other)
|
||||
{
|
||||
if (this != &other) {
|
||||
(config_tls&&)*this = std::move(other);
|
||||
(config_method_tls&&)*this = std::move(other);
|
||||
if (m_inner) delete m_inner;
|
||||
m_inner = other.m_inner;
|
||||
other.m_inner = NULL;
|
||||
@@ -82,19 +82,19 @@ eap::config_ttls& eap::config_ttls::operator=(_Inout_ config_ttls &&other)
|
||||
}
|
||||
|
||||
|
||||
eap::config* eap::config_ttls::clone() const
|
||||
eap::config* eap::config_method_ttls::clone() const
|
||||
{
|
||||
return new config_ttls(*this);
|
||||
return new config_method_ttls(*this);
|
||||
}
|
||||
|
||||
|
||||
bool eap::config_ttls::save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pConfigRoot, _Out_ EAP_ERROR **ppEapError) const
|
||||
bool eap::config_method_ttls::save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pConfigRoot, _Out_ EAP_ERROR **ppEapError) const
|
||||
{
|
||||
assert(pDoc);
|
||||
assert(pConfigRoot);
|
||||
assert(ppEapError);
|
||||
|
||||
if (!config_tls::save(pDoc, pConfigRoot, ppEapError))
|
||||
if (!config_method_tls::save(pDoc, pConfigRoot, ppEapError))
|
||||
return false;
|
||||
|
||||
const bstr bstrNamespace(L"urn:ietf:params:xml:ns:yang:ietf-eap-metadata");
|
||||
@@ -107,7 +107,7 @@ bool eap::config_ttls::save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pConfi
|
||||
return false;
|
||||
}
|
||||
|
||||
if (dynamic_cast<const config_pap*>(m_inner)) {
|
||||
if (dynamic_cast<const config_method_pap*>(m_inner)) {
|
||||
// <InnerAuthenticationMethod>/<NonEAPAuthMethod>
|
||||
if ((dwResult = eapxml::put_element_value(pDoc, pXmlElInnerAuthenticationMethod, bstr(L"NonEAPAuthMethod"), bstrNamespace, bstr(L"PAP"))) != ERROR_SUCCESS) {
|
||||
*ppEapError = m_module.make_error(dwResult, _T(__FUNCTION__) _T(" Error creating <NonEAPAuthMethod> element."));
|
||||
@@ -126,13 +126,13 @@ bool eap::config_ttls::save(_In_ IXMLDOMDocument *pDoc, _In_ IXMLDOMNode *pConfi
|
||||
}
|
||||
|
||||
|
||||
bool eap::config_ttls::load(_In_ IXMLDOMNode *pConfigRoot, _Out_ EAP_ERROR **ppEapError)
|
||||
bool eap::config_method_ttls::load(_In_ IXMLDOMNode *pConfigRoot, _Out_ EAP_ERROR **ppEapError)
|
||||
{
|
||||
assert(pConfigRoot);
|
||||
assert(ppEapError);
|
||||
DWORD dwResult;
|
||||
|
||||
if (!config_tls::load(pConfigRoot, ppEapError))
|
||||
if (!config_method_tls::load(pConfigRoot, ppEapError))
|
||||
return false;
|
||||
|
||||
std::wstring xpath(eapxml::get_xpath(pConfigRoot));
|
||||
@@ -159,7 +159,7 @@ bool eap::config_ttls::load(_In_ IXMLDOMNode *pConfigRoot, _Out_ EAP_ERROR **ppE
|
||||
// PAP
|
||||
m_module.log_config((xpath + L"/NonEAPAuthMethod").c_str(), L"PAP");
|
||||
assert(!m_inner);
|
||||
m_inner = new eap::config_pap(m_module);
|
||||
m_inner = new eap::config_method_pap(m_module);
|
||||
if (!m_inner->load(pXmlElInnerAuthenticationMethod, ppEapError))
|
||||
return false;
|
||||
} else {
|
||||
@@ -171,7 +171,7 @@ bool eap::config_ttls::load(_In_ IXMLDOMNode *pConfigRoot, _Out_ EAP_ERROR **ppE
|
||||
}
|
||||
|
||||
|
||||
eap::type_t eap::config_ttls::get_method_id() const
|
||||
eap::type_t eap::config_method_ttls::get_method_id() const
|
||||
{
|
||||
return eap::type_ttls;
|
||||
}
|
||||
|
@@ -28,7 +28,7 @@ using namespace winstd;
|
||||
// eap::peer_ttls
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
eap::peer_ttls::peer_ttls() : peer<config_ttls, credentials_ttls, bool, bool>(type_ttls)
|
||||
eap::peer_ttls::peer_ttls() : peer<config_method_ttls, credentials_ttls, bool, bool>(type_ttls)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -28,19 +28,19 @@ using namespace winstd;
|
||||
// eap::session_ttls
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
eap::session_ttls::session_ttls(_In_ module &mod) : session<config_ttls, credentials_ttls, bool, bool>(mod)
|
||||
eap::session_ttls::session_ttls(_In_ module &mod) : session<config_method_ttls, credentials_ttls, bool, bool>(mod)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
eap::session_ttls::session_ttls(_In_ const session_ttls &other) :
|
||||
session<config_ttls, credentials_ttls, bool, bool>(other)
|
||||
session<config_method_ttls, credentials_ttls, bool, bool>(other)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
eap::session_ttls::session_ttls(_Inout_ session_ttls &&other) :
|
||||
session<config_ttls, credentials_ttls, bool, bool>(std::move(other))
|
||||
session<config_method_ttls, credentials_ttls, bool, bool>(std::move(other))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ eap::session_ttls::session_ttls(_Inout_ session_ttls &&other) :
|
||||
eap::session_ttls& eap::session_ttls::operator=(_In_ const session_ttls &other)
|
||||
{
|
||||
if (this != &other)
|
||||
(session<config_ttls, credentials_ttls, bool, bool>&)*this = other;
|
||||
(session<config_method_ttls, credentials_ttls, bool, bool>&)*this = other;
|
||||
|
||||
return *this;
|
||||
}
|
||||
@@ -57,7 +57,7 @@ eap::session_ttls& eap::session_ttls::operator=(_In_ const session_ttls &other)
|
||||
eap::session_ttls& eap::session_ttls::operator=(_Inout_ session_ttls &&other)
|
||||
{
|
||||
if (this != &other)
|
||||
(session<config_ttls, credentials_ttls, bool, bool>&)*this = std::move(other);
|
||||
(session<config_method_ttls, credentials_ttls, bool, bool>&)*this = std::move(other);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
Reference in New Issue
Block a user