KInetSocketAddress Class Reference
An Inet (IPv4 or IPv6) socket address an Internet socket address. More...
#include <ksockaddr.h>
Inheritance diagram for KInetSocketAddress:

Public Member Functions | |
KInetSocketAddress () | |
KInetSocketAddress (const KInetSocketAddress &) | |
KInetSocketAddress (const sockaddr_in *sin, ksocklen_t len) | |
KInetSocketAddress (const sockaddr_in6 *sin6, ksocklen_t len) | |
KInetSocketAddress (const in_addr &addr, unsigned short port) | |
KInetSocketAddress (const in6_addr &addr, unsigned short port) | |
KInetSocketAddress (const QString &addr, unsigned short port, int family=-1) | |
virtual | ~KInetSocketAddress () |
bool | setAddress (const KInetSocketAddress &ksa) |
bool | setAddress (const sockaddr_in *sin, ksocklen_t len) |
bool | setAddress (const sockaddr_in6 *sin6, ksocklen_t len) |
bool | setAddress (const in_addr &addr, unsigned short port) |
bool | setAddress (const in6_addr &addr, unsigned short port) |
bool | setAddress (const QString &addr, unsigned short port, int family=-1) |
bool | setHost (const in_addr &addr) |
bool | setHost (const in6_addr &addr) |
bool | setHost (const QString &addr, int family=-1) |
bool | setPort (unsigned short port) |
bool | setFamily (int family) |
bool | setFlowinfo (Q_UINT32 flowinfo) |
bool | setScopeId (int scopeid) |
virtual QString | pretty () const |
virtual QString | nodeName () const |
virtual QString | serviceName () const |
const sockaddr_in * | addressV4 () const |
const sockaddr_in6 * | addressV6 () const |
in_addr | hostV4 () const |
in6_addr | hostV6 () const |
unsigned short | port () const |
Q_UINT32 | flowinfo () const |
int | scopeId () const |
virtual ksocklen_t | size () const |
operator const sockaddr_in * () const | |
operator const sockaddr_in6 * () const | |
KInetSocketAddress & | operator= (const KInetSocketAddress &other) |
Static Public Member Functions | |
bool | areEqualInet (const KSocketAddress &s1, const KSocketAddress &s2, bool coreOnly) |
bool | areEqualInet6 (const KSocketAddress &s1, const KSocketAddress &s2, bool coreOnly) |
QString | addrToString (int family, const void *addr) |
bool | stringToAddr (int family, const char *text, void *dest) |
Protected Member Functions | |
virtual void | virtual_hook (int id, void *data) |
Detailed Description
An Inet (IPv4 or IPv6) socket address an Internet socket address.This is an IPv4 or IPv6 address of the Internet
This class inherits most of the functionality from KSocketAddress, but is targeted specifically to Internet addresses
- Author:
- Thiago Macieira <thiago.macieira@kdemail.net>
Definition at line 232 of file ksockaddr.h.
Constructor & Destructor Documentation
|
Default constructor. Does nothing Definition at line 269 of file ksockaddr.cpp. |
|
Copy constructor. Definition at line 274 of file ksockaddr.cpp. References setAddress(). |
|
Creates an IPv4 socket from raw sockaddr_in.
References setAddress(). |
|
Creates an IPv6 socket from raw sockaddr_in6.
References setAddress(). |
|
Creates a socket from information.
References setAddress(). |
|
Creates a socket from information.
References setAddress(). |
|
Creates a socket from text representation.
References setAddress(). |
|
Destructor. Definition at line 310 of file ksockaddr.cpp. |
Member Function Documentation
|
Sets this socket to given socket.
References addressV4(), addressV6(), KSocketAddress::family(), and size(). Referenced by KInetSocketAddress(). |
|
Sets this socket to given raw socket.
|
|
Sets this socket to given raw socket. Note: this function does not clear the scope ID and flow info values
|
|
Sets this socket to raw address and port.
|
|
Sets this socket to raw address and port.
|
|
Sets this socket to text address and port.
You can use the If the value is -1 (default), this function will make an effort to discover what is the family. That isn't too hard, actually, and it works in all cases. But, if you want to be sure that your socket is of the type you want, use this parameter. This function returns false if the socket address was not valid.
|
|
Sets this socket's host address to given raw address.
Referenced by setAddress(). |
|
Sets this socket's host address to given raw address.
|
|
Sets this socket's host address to given text representation.
|
|
Sets this socket's port number to given port number.
Referenced by setAddress(). |
|
Turns this into an IPv4 or IPv6 address.
|
|
Sets flowinfo information for this socket address if this is IPv6.
|
|
Sets the scope id for this socket if this is IPv6.
|
|
Returns a pretty representation of this address.
Reimplemented from KSocketAddress. Definition at line 557 of file ksockaddr.cpp. References nodeName(), and serviceName(). |
|
Returns the text representation of the host address.
Reimplemented from KSocketAddress. Definition at line 572 of file ksockaddr.cpp. Referenced by pretty(). |
|
Returns the text representation of the port number.
Reimplemented from KSocketAddress. Definition at line 591 of file ksockaddr.cpp. References port(). Referenced by pretty(). |
|
Returns the socket address. This will be NULL if this is a non-convertible v6. This function will return an IPv4 socket if this IPv6 socket is a v4-mapped address. That is, if it's really an IPv4 address, but in v6 disguise.
Referenced by setAddress(). |
|
Returns the socket address in IPv6.
Referenced by setAddress(). |
|
Returns the host address. Might be empty.
|
|
Returns the host address. WARNING: this function is not defined if there is no IPv6 support
|
|
Returns the port number.
Referenced by serviceName(). |
|
Returns flowinfo for IPv6 socket.
|
|
Returns the scope id for this IPv6 socket.
|
|
Returns the socket length. Will be either sizeof(sockaddr_in) or sizeof(sockaddr_in6)
Reimplemented from KSocketAddress. Definition at line 615 of file ksockaddr.cpp. Referenced by setAddress(). |
|
Compares two IPv4 addresses.
References KSocketAddress::address(), KSocketAddress::family(), and KSocketAddress::size(). Referenced by KSocketAddress::isCoreEqual(), and KSocketAddress::isEqual(). |
|
Compares two IPv6 addresses.
References KSocketAddress::address(), KSocketAddress::family(), and KSocketAddress::size(). Referenced by KSocketAddress::isCoreEqual(), and KSocketAddress::isEqual(). |
|
Returns the socket address. This will be NULL if this is a non-convertible v6.
|
|
Returns the socket address.
|
|
Sets this object to be the same as the other. Definition at line 527 of file ksockaddr.h. |
|
Convert s the given raw address into text form. This function returns QString::null if the address cannot be converted.
|
|
Converts the address given in text form into raw form.
The size of the destination buffer
|
The documentation for this class was generated from the following files: