• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdecore
 

tdecore

  • KNetwork
  • KInetSocketAddress
Public Member Functions | Protected Member Functions | Friends | List of all members
KNetwork::KInetSocketAddress Class Reference

#include <tdesocketaddress.h>

Inheritance diagram for KNetwork::KInetSocketAddress:
KNetwork::TDESocketAddress

Public Member Functions

 KInetSocketAddress ()
 
 KInetSocketAddress (const sockaddr *sa, TQ_UINT16 len)
 
 KInetSocketAddress (const KIpAddress &host, TQ_UINT16 port)
 
 KInetSocketAddress (const KInetSocketAddress &other)
 
 KInetSocketAddress (const TDESocketAddress &other)
 
virtual ~KInetSocketAddress ()
 
KInetSocketAddress & operator= (const KInetSocketAddress &other)
 
 operator const sockaddr_in * () const
 
 operator const sockaddr_in6 * () const
 
int ipVersion () const
 
KIpAddress ipAddress () const
 
KInetSocketAddress & setHost (const KIpAddress &addr)
 
TQ_UINT16 port () const
 
KInetSocketAddress & setPort (TQ_UINT16 port)
 
KInetSocketAddress & makeIPv4 ()
 
KInetSocketAddress & makeIPv6 ()
 
TQ_UINT32 flowinfo () const
 
KInetSocketAddress & setFlowinfo (TQ_UINT32 flowinfo)
 
int scopeId () const
 
KInetSocketAddress & setScopeId (int scopeid)
 
- Public Member Functions inherited from KNetwork::TDESocketAddress
 TDESocketAddress ()
 
 TDESocketAddress (const sockaddr *sa, TQ_UINT16 len)
 
 TDESocketAddress (const TDESocketAddress &other)
 
virtual ~TDESocketAddress ()
 
TDESocketAddress & operator= (const TDESocketAddress &other)
 
const sockaddr * address () const
 
sockaddr * address ()
 
TDESocketAddress & setAddress (const sockaddr *sa, TQ_UINT16 len)
 
 operator const sockaddr * () const
 
TQ_UINT16 length () const
 
TDESocketAddress & setLength (TQ_UINT16 len)
 
int family () const
 
virtual TDESocketAddress & setFamily (int family)
 
int ianaFamily () const
 
bool operator== (const TDESocketAddress &other) const
 
virtual TQString nodeName () const
 
virtual TQString serviceName () const
 
virtual TQString toString () const
 
KInetSocketAddress & asInet ()
 
KInetSocketAddress asInet () const
 
KUnixSocketAddress & asUnix ()
 
KUnixSocketAddress asUnix () const
 

Protected Member Functions

 KInetSocketAddress (TDESocketAddressData *d)
 
- Protected Member Functions inherited from KNetwork::TDESocketAddress
 TDESocketAddress (TDESocketAddressData *d)
 

Friends

class TDESocketAddress
 

Additional Inherited Members

- Static Public Member Functions inherited from KNetwork::TDESocketAddress
static int ianaFamily (int af)
 
static int fromIanaFamily (int iana)
 
- Protected Attributes inherited from KNetwork::TDESocketAddress
TDESocketAddressData * d
 

Detailed Description

an Internet socket address

An Inet (IPv4 or IPv6) socket address

This is an IPv4 or IPv6 address of the Internet.

Author
Thiago Macieira thiag.nosp@m.o.ma.nosp@m.cieir.nosp@m.a@kd.nosp@m.email.nosp@m..net

Definition at line 651 of file tdesocketaddress.h.

Constructor & Destructor Documentation

◆ KInetSocketAddress() [1/6]

KInetSocketAddress::KInetSocketAddress ( )

Public constructor.

Creates an empty object.

Definition at line 708 of file tdesocketaddress.cpp.

◆ KInetSocketAddress() [2/6]

KInetSocketAddress::KInetSocketAddress ( const sockaddr *  sa,
TQ_UINT16  len 
)

Creates an object from raw data.

Note: if the socket address sa does not contain a valid Internet socket (IPv4 or IPv6), this object will be empty.

Parameters
sathe sockaddr structure
lenthe structure's length

Definition at line 713 of file tdesocketaddress.cpp.

◆ KInetSocketAddress() [3/6]

KInetSocketAddress::KInetSocketAddress ( const KIpAddress &  host,
TQ_UINT16  port 
)

Creates an object from an IP address and port.

Parameters
hostthe IP address
portthe port number

Definition at line 721 of file tdesocketaddress.cpp.

◆ KInetSocketAddress() [4/6]

KInetSocketAddress::KInetSocketAddress ( const KInetSocketAddress &  other)

Copy constructor.

Data is not shared.

Parameters
otherthe other object

Definition at line 728 of file tdesocketaddress.cpp.

◆ KInetSocketAddress() [5/6]

KInetSocketAddress::KInetSocketAddress ( const TDESocketAddress &  other)

Copy constructor.

If the other, generic socket address contains an Internet address, it will be copied. Otherwise, this object will be empty.

Parameters
otherthe other object

Definition at line 734 of file tdesocketaddress.cpp.

◆ ~KInetSocketAddress()

KInetSocketAddress::~KInetSocketAddress ( )
virtual

Destroys this object.

Definition at line 748 of file tdesocketaddress.cpp.

◆ KInetSocketAddress() [6/6]

KInetSocketAddress::KInetSocketAddress ( TDESocketAddressData *  d)
protected

Definition at line 742 of file tdesocketaddress.cpp.

Member Function Documentation

◆ flowinfo()

TQ_UINT32 KInetSocketAddress::flowinfo ( ) const

Returns the flowinfo information from the IPv6 socket address.

Returns
the flowinfo information or 0 if this object is empty or IPv4

Definition at line 892 of file tdesocketaddress.cpp.

◆ ipAddress()

KIpAddress KInetSocketAddress::ipAddress ( ) const

Returns the IP address component.

Definition at line 784 of file tdesocketaddress.cpp.

◆ ipVersion()

int KInetSocketAddress::ipVersion ( ) const

Returns the IP version of the address this object holds.

Returns
4 or 6, if IPv4 or IPv6, respectively; 0 if this object is empty

Definition at line 761 of file tdesocketaddress.cpp.

◆ makeIPv4()

KInetSocketAddress & KInetSocketAddress::makeIPv4 ( )

Converts this object to an IPv4 socket address.

It has no effect if the object is already an IPv4 socket address.

If this object is an IPv6 address, the port number is preserved. All other information is lost.

Returns
a reference to itself

Definition at line 880 of file tdesocketaddress.cpp.

◆ makeIPv6()

KInetSocketAddress & KInetSocketAddress::makeIPv6 ( )

Converts this object to an IPv6 socket address.

It has no effect if the object is already an IPv6 socket address.

If this object is an IPv4 address, the port number is preserved.

Returns
a reference to itself

Definition at line 886 of file tdesocketaddress.cpp.

◆ operator const sockaddr_in *()

KNetwork::KInetSocketAddress::operator const sockaddr_in * ( ) const
inline

Cast operator to sockaddr_in.

Definition at line 715 of file tdesocketaddress.h.

◆ operator const sockaddr_in6 *()

KNetwork::KInetSocketAddress::operator const sockaddr_in6 * ( ) const
inline

Cast operator to sockaddr_in6.

Definition at line 721 of file tdesocketaddress.h.

◆ operator=()

KInetSocketAddress & KInetSocketAddress::operator= ( const KInetSocketAddress &  other)

Copy operator.

Copies the other object into this one.

Parameters
otherthe other object

Definition at line 754 of file tdesocketaddress.cpp.

◆ port()

TQ_UINT16 KInetSocketAddress::port ( ) const

Retrieves the port number stored in this object.

Returns
a port number in the range 0 to 65535, inclusive. An empty or invalid object will have a port number of 0.

Definition at line 829 of file tdesocketaddress.cpp.

◆ scopeId()

int KInetSocketAddress::scopeId ( ) const

Returns the scope id this IPv6 socket is bound to.

Returns
the scope id, or 0 if this is not an IPv6 object

Definition at line 911 of file tdesocketaddress.cpp.

◆ setFlowinfo()

KInetSocketAddress & KInetSocketAddress::setFlowinfo ( TQ_UINT32  flowinfo)

Sets the flowinfo information for an IPv6 socket address.

If this is not an IPv6 socket address, this function converts it to one. See makeIPv6.

Parameters
flowinfothe flowinfo to set
Returns
a reference to itself

Definition at line 904 of file tdesocketaddress.cpp.

◆ setHost()

KInetSocketAddress & KInetSocketAddress::setHost ( const KIpAddress &  addr)

Sets the IP address to the given raw address.

This call will preserve port numbers accross IP versions, but will lose IPv6 specific data if the address is set to IPv4.

Parameters
addrthe address to set to
Returns
a reference to itself

Definition at line 806 of file tdesocketaddress.cpp.

◆ setPort()

KInetSocketAddress & KInetSocketAddress::setPort ( TQ_UINT16  port)

Sets the port number.

If this object is empty, this function will default to creating an IPv4 address.

Parameters
portthe port number to set
Returns
a reference to itself

Definition at line 852 of file tdesocketaddress.cpp.

◆ setScopeId()

KInetSocketAddress & KInetSocketAddress::setScopeId ( int  scopeid)

Sets the scope id for this IPv6 object.

If this is not an IPv6 socket address, this function converts it to one. See makeIPv6

Parameters
scopeidthe scopeid to set
Returns
a reference to itself

Definition at line 923 of file tdesocketaddress.cpp.

Friends And Related Function Documentation

◆ TDESocketAddress

friend class TDESocketAddress
friend

Definition at line 653 of file tdesocketaddress.h.


The documentation for this class was generated from the following files:
  • tdesocketaddress.h
  • tdesocketaddress.cpp

tdecore

Skip menu "tdecore"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdecore

Skip menu "tdecore"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdecore by doxygen 1.9.4
This website is maintained by Timothy Pearson.