Mixes for Privacy and Anonymity in the Internet
Public Member Functions | List of all members
CASocketAddrUnix Class Reference

This is a class for Unix Domain Protocol Sockat Addresses. More...

Inheritance diagram for CASocketAddrUnix:
CASocketAddr sockaddr_un

Public Member Functions

 CASocketAddrUnix ()
 Constructs an address with an empty path. More...
 
 CASocketAddrUnix (const CASocketAddrUnix &addr)
 Constructs an Unix Adress from an other Unix-Address. More...
 
SINT32 getType () const
 Returns the type (family) of the socket this address is for (always AF_LOCAL) More...
 
CASocketAddrclone () const
 Creates a new copy of this address. More...
 
SINT32 getSize () const
 Resturns the size of the SOCKADDR struct used. More...
 
const SOCKADDRLPSOCKADDR () const
 Makes a cast to SOCKADDR* . More...
 
SINT32 setPath (const char *path)
 Sets the path of this unix address. More...
 
UINT8getPath () const
 Retruns the path of this address. More...
 
virtual SINT32 toString (UINT8 *buff, UINT32 bufflen) const
 Returns a human readable string describing this address. More...
 
- Public Member Functions inherited from CASocketAddr
virtual ~CASocketAddr ()
 

Detailed Description

This is a class for Unix Domain Protocol Sockat Addresses.

Constructor & Destructor Documentation

◆ CASocketAddrUnix() [1/2]

CASocketAddrUnix::CASocketAddrUnix ( )

Constructs an address with an empty path.

References AF_LOCAL.

Referenced by clone().

◆ CASocketAddrUnix() [2/2]

CASocketAddrUnix::CASocketAddrUnix ( const CASocketAddrUnix addr)

Constructs an Unix Adress from an other Unix-Address.

References AF_LOCAL.

Member Function Documentation

◆ clone()

CASocketAddr* CASocketAddrUnix::clone ( ) const
virtual

Creates a new copy of this address.

Returns
a copy of this address

Implements CASocketAddr.

References CASocketAddrUnix().

◆ getPath()

UINT8 * CASocketAddrUnix::getPath ( ) const

Retruns the path of this address.

Gets the path for the unix domain protocol address.

Returns
the path of this address or NULL if not set

The returned char array has to be freed by the caller using delete[].

Return values
NULLif path was no specified yet
copyof the path value

References len.

Referenced by toString().

◆ getSize()

SINT32 CASocketAddrUnix::getSize ( ) const
virtual

Resturns the size of the SOCKADDR struct used.

return sizeof(sockaddr_un)

Implements CASocketAddr.

◆ getType()

SINT32 CASocketAddrUnix::getType ( ) const
virtual

Returns the type (family) of the socket this address is for (always AF_LOCAL)

Return values
AF_LOCAL

Implements CASocketAddr.

References AF_LOCAL.

◆ LPSOCKADDR()

const SOCKADDR* CASocketAddrUnix::LPSOCKADDR ( ) const
virtual

Makes a cast to SOCKADDR* .

Implements CASocketAddr.

◆ setPath()

SINT32 CASocketAddrUnix::setPath ( const char *  path)

Sets the path of this unix address.

Sets the path for the unix domain protocol address.

Parameters
paththe new path of this address
Return values
E_SUCCESSif succesful
E_UNKNOWNotherwise
Parameters
paththe new path value (zero terminated)
Return values
E_SUCCESSif no error occured
E_UNSPECIFIEDif path was NULL
E_SPACEif path was to long

References E_SPACE, E_SUCCESS, and E_UNSPECIFIED.

◆ toString()

virtual SINT32 CASocketAddrUnix::toString ( UINT8 buff,
UINT32  bufflen 
) const
virtual

Returns a human readable string describing this address.

Parameters
buffbuffer which holds the string
bufflensize of the buffer
Return values
E_SPACEif the bufvfer is to small for the string
E_UNKNOWNif an error occured
E_SUCCESSif successfull

Implements CASocketAddr.

References E_SPACE, E_SUCCESS, E_UNKNOWN, and getPath().