#include <ksockaddr.h>
Inheritance diagram for KInetSocketAddress:

Public Methods | |
| 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 Methods | |
| 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 Methods | |
| virtual void | virtual_hook (int id, void *data) |
Friends | |
| class | KExtendedSocket |
An Inet (IPv4 or IPv6) 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
Definition at line 236 of file ksockaddr.h.
|
|
Default constructor. Does nothing |
|
|
Copy constructor |
|
||||||||||||
|
Creates an IPv4 socket from raw sockaddr_in.
|
|
||||||||||||
|
Creates an IPv6 socket from raw sockaddr_in6.
|
|
||||||||||||
|
Creates a socket from information.
|
|
||||||||||||
|
Creates a socket from information.
|
|
||||||||||||||||
|
Creates a socket from text representation.
|
|
|
Destructor |
|
|
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 operator const sockaddr_in *(). |
|
|
Returns the socket address in IPv6
Referenced by operator const sockaddr_in6 *(). |
|
||||||||||||
|
Convert s the given raw address into text form. This function returns QString::null if the address cannot be converted.
|
|
||||||||||||||||
|
Compares two IPv4 addresses.
|
|
||||||||||||||||
|
Compares two IPv6 addresses.
|
|
|
Returns flowinfo for IPv6 socket.
|
|
|
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 text representation of the host address.
Reimplemented from KSocketAddress. |
|
|
Returns the socket address. This will be NULL if this is a non-convertible v6.
Definition at line 517 of file ksockaddr.h. References addressV4(). |
|
|
Returns the socket address.
Definition at line 525 of file ksockaddr.h. References addressV6(). |
|
|
Sets this object to be the same as the other. Definition at line 531 of file ksockaddr.h. References setAddress(). |
|
|
Returns the port number.
|
|
|
Returns a pretty representation of this address.
Reimplemented from KSocketAddress. |
|
|
Returns the scope id for this IPv6 socket.
|
|
|
Returns the text representation of the port number.
Reimplemented from KSocketAddress. |
|
||||||||||||||||
|
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 to raw address and port.
|
|
||||||||||||
|
Sets this socket to raw address and port.
|
|
||||||||||||
|
Sets this socket to given raw socket. Note: this function does not clear the scope ID and flow info values
|
|
||||||||||||
|
Sets this socket to given raw socket.
|
|
|
Sets this socket to given socket.
Referenced by operator=(). |
|
|
Turns this into an IPv4 or IPv6 address.
|
|
|
Sets flowinfo information for this socket address if this is IPv6.
|
|
||||||||||||
|
Sets this socket's host address to given text representation.
|
|
|
Sets this socket's host address to given raw address.
|
|
|
Sets this socket's host address to given raw address.
|
|
|
Sets this socket's port number to given port number.
|
|
|
Sets the scope id for this socket if this is IPv6.
|
|
|
Returns the socket length. Will be either sizeof(sockaddr_in) or sizeof(sockaddr_in6)
Reimplemented from KSocketAddress. |
|
||||||||||||||||
|
Converts the address given in text form into raw form. The size of the destination buffer
|
1.2.18