Support for packing and unpacking of config_method_eapmsg added

This commit is contained in:
2016-10-04 11:23:12 +02:00
parent 5dad353d98
commit 597095b536
3 changed files with 102 additions and 0 deletions

View File

@@ -89,6 +89,33 @@ namespace eap
///
virtual config* clone() const;
///
/// \name BLOB management
/// @{
///
/// Packs a configuration
///
/// \param[inout] cursor Memory cursor
///
virtual void operator<<(_Inout_ cursor_out &cursor) const;
///
/// Returns packed size of a configuration
///
/// \returns Size of data when packed (in bytes)
///
virtual size_t get_pk_size() const;
///
/// Unpacks a configuration
///
/// \param[inout] cursor Memory cursor
///
virtual void operator>>(_Inout_ cursor_in &cursor);
/// @}
///
/// Returns EAP method type of this configuration
///

View File

@@ -80,6 +80,31 @@ eap::config* eap::config_method_eapmsg::clone() const
}
void eap::config_method_eapmsg::operator<<(_Inout_ cursor_out &cursor) const
{
config_method::operator<<(cursor);
cursor << m_type ;
cursor << m_cfg_blob;
}
size_t eap::config_method_eapmsg::get_pk_size() const
{
return
config_method::get_pk_size() +
pksizeof(m_type ) +
pksizeof(m_cfg_blob);
}
void eap::config_method_eapmsg::operator>>(_Inout_ cursor_in &cursor)
{
config_method::operator>>(cursor);
cursor >> m_type ;
cursor >> m_cfg_blob;
}
eap_type_t eap::config_method_eapmsg::get_method_id() const
{
return (eap_type_t)m_type.eapType.type;