apt  2.2.4
About: Apt (Advanced Package Tool) is a management system for software packages (Debian/Ubuntu). Release series 2.2.
  Fossies Dox: apt-2.2.4.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

TlsFd Struct Reference
Inheritance diagram for TlsFd:
[legend]
Collaboration diagram for TlsFd:
[legend]

Public Member Functions

int Fd () APT_OVERRIDE
 Returns -1 for unusable, or an fd to select() on otherwise. More...
 
ssize_t Read (void *buf, size_t count) APT_OVERRIDE
 Should behave like read(2) More...
 
ssize_t Write (void *buf, size_t count) APT_OVERRIDE
 Should behave like write(2) More...
 
ssize_t DoTLSHandshake ()
 
template<typename T >
HandleError (T err)
 
int Close () APT_OVERRIDE
 Closes the file descriptor. Can be called multiple times. More...
 
bool HasPending () APT_OVERRIDE
 If there is pending data. More...
 
- Public Member Functions inherited from MethodFd
virtual ~MethodFd ()
 Destructor. More...
 

Public Attributes

std::unique_ptr< MethodFdUnderlyingFd
 
gnutls_session_t session
 
gnutls_certificate_credentials_t credentials
 
std::string hostname
 
unsigned long Timeout
 

Additional Inherited Members

- Static Public Member Functions inherited from MethodFd
static std::unique_ptr< MethodFdFromFd (int iFd)
 Construct a MethodFd from a UNIX file descriptor. More...
 

Detailed Description

Definition at line 805 of file connect.cc.

Member Function Documentation

◆ Close()

int Close ( )
inlinevirtual

Closes the file descriptor. Can be called multiple times.

Implements MethodFd.

Definition at line 883 of file connect.cc.

References HandleError(), session, and UnderlyingFd.

◆ DoTLSHandshake()

ssize_t DoTLSHandshake ( )
inline

Definition at line 824 of file connect.cc.

References Fd(), session, Timeout, and WaitFd().

Referenced by HandleError(), and UnwrapTLS().

◆ Fd()

int Fd ( )
inlinevirtual

Returns -1 for unusable, or an fd to select() on otherwise.

Implements MethodFd.

Definition at line 813 of file connect.cc.

References UnderlyingFd.

Referenced by DoTLSHandshake().

◆ HandleError()

T HandleError ( err)
inline

Definition at line 860 of file connect.cc.

References DoTLSHandshake().

Referenced by Close(), Read(), and Write().

◆ HasPending()

bool HasPending ( )
inlinevirtual

If there is pending data.

Reimplemented from MethodFd.

Definition at line 890 of file connect.cc.

References session.

◆ Read()

ssize_t Read ( void *  buf,
size_t  count 
)
inlinevirtual

Should behave like read(2)

Implements MethodFd.

Definition at line 815 of file connect.cc.

References HandleError(), and session.

◆ Write()

ssize_t Write ( void *  buf,
size_t  count 
)
inlinevirtual

Should behave like write(2)

Implements MethodFd.

Definition at line 819 of file connect.cc.

References HandleError(), and session.

Member Data Documentation

◆ credentials

gnutls_certificate_credentials_t credentials

Definition at line 809 of file connect.cc.

Referenced by UnwrapTLS().

◆ hostname

std::string hostname

Definition at line 810 of file connect.cc.

Referenced by UnwrapTLS().

◆ session

gnutls_session_t session

Definition at line 808 of file connect.cc.

Referenced by Close(), DoTLSHandshake(), HasPending(), Read(), UnwrapTLS(), and Write().

◆ Timeout

unsigned long Timeout

Definition at line 811 of file connect.cc.

Referenced by DoTLSHandshake(), and UnwrapTLS().

◆ UnderlyingFd

std::unique_ptr<MethodFd> UnderlyingFd

Definition at line 807 of file connect.cc.

Referenced by Close(), Fd(), and UnwrapTLS().


The documentation for this struct was generated from the following file: