PcapPlusPlus  21.05
pcpp::PcapRemoteAuthentication Struct Reference

#include <PcapRemoteDevice.h>

Public Member Functions

 PcapRemoteAuthentication (const std::string username, const std::string password)
 
 PcapRemoteAuthentication (const PcapRemoteAuthentication &other)
 
pcap_rmtauth getPcapRmAuth () const
 

Public Attributes

std::string userName
 
std::string password
 

Detailed Description

The remote daemon (rpcapd) can be configured to require authentication before allowing a client to connect. This is done for security reasons of course. This struct wraps the WinPcap/Npcap authentication object (pcap_rmtauth) and can (but not must) be given to PcapRemoteDeviceList when initiating a connection to the remote daemon

Constructor & Destructor Documentation

◆ PcapRemoteAuthentication() [1/2]

pcpp::PcapRemoteAuthentication::PcapRemoteAuthentication ( const std::string  username,
const std::string  password 
)
inline

A constructor that sets username and password

Parameters
[in]usernameThe username for authentication with the remote daemon
[in]passwordThe password for authentication with the remote daemon

◆ PcapRemoteAuthentication() [2/2]

pcpp::PcapRemoteAuthentication::PcapRemoteAuthentication ( const PcapRemoteAuthentication other)
inline

A copy c'tor for this object

Parameters
[in]otherThe object to copy from

Member Function Documentation

◆ getPcapRmAuth()

pcap_rmtauth pcpp::PcapRemoteAuthentication::getPcapRmAuth ( ) const

A conversion method from PcapRemoteAuthentication to pcap_rmtauth. Note: the char* pointers of the returned pcap_rmtauth points to the same places in memory as PcapRemoteAuthentication::userName and PcapRemoteAuthentication::password so the user should avoid freeing this memory

Returns
A pcap_rmtauth that is converted from this class

Member Data Documentation

◆ password

std::string pcpp::PcapRemoteAuthentication::password

The password for authentication

◆ userName

std::string pcpp::PcapRemoteAuthentication::userName

The username for authentication