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 <thiagom@mail.com>
- Version:
- Id
- ksockaddr.h,v 1.18 2003/08/20 08:01:42 coolo Exp
Definition at line 236 of file ksockaddr.h.
Constructor & Destructor Documentation
|
Default constructor. Does nothing Definition at line 271 of file ksockaddr.cpp. |
|
Copy constructor.
Definition at line 276 of file ksockaddr.cpp. References setAddress(). |
|
Creates an IPv4 socket from raw sockaddr_in.
Definition at line 282 of file ksockaddr.cpp. References setAddress(). |
|
Creates an IPv6 socket from raw sockaddr_in6.
Definition at line 288 of file ksockaddr.cpp. References setAddress(). |
|
Creates a socket from information.
Definition at line 294 of file ksockaddr.cpp. References setAddress(). |
|
Creates a socket from information.
Definition at line 300 of file ksockaddr.cpp. References setAddress(). |
|
Creates a socket from text representation.
Definition at line 306 of file ksockaddr.cpp. References setAddress(). |
|
Destructor.
Definition at line 312 of file ksockaddr.cpp. |
Member Function Documentation
|
Sets this socket to given socket.
Definition at line 319 of file ksockaddr.cpp. References addressV4(), addressV6(), KSocketAddress::family(), setAddress(), and size(). Referenced by KInetSocketAddress(), and setAddress(). |
|
Sets this socket to given raw socket.
Definition at line 330 of file ksockaddr.cpp. References setAddress(), setHost(), and setPort(). |
|
Sets this socket to given raw socket. Note: this function does not clear the scope ID and flow info values
Definition at line 342 of file ksockaddr.cpp. References setAddress(). |
|
Sets this socket to raw address and port.
Definition at line 370 of file ksockaddr.cpp. References setAddress(), setHost(), and setPort(). |
|
Sets this socket to raw address and port.
Definition at line 375 of file ksockaddr.cpp. References setAddress(), setHost(), and setPort(). |
|
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.
Definition at line 380 of file ksockaddr.cpp. References setAddress(), setHost(), and setPort(). |
|
Sets this socket's host address to given raw address.
Definition at line 385 of file ksockaddr.cpp. References setHost(). Referenced by setAddress(), and setHost(). |
|
Sets this socket's host address to given raw address.
Definition at line 393 of file ksockaddr.cpp. References setHost(). |
|
Sets this socket's host address to given text representation.
Definition at line 405 of file ksockaddr.cpp. References setHost(). |
|
Sets this socket's port number to given port number.
Definition at line 454 of file ksockaddr.cpp. References setPort(). Referenced by setAddress(), and setPort(). |
|
Turns this into an IPv4 or IPv6 address.
Definition at line 465 of file ksockaddr.cpp. References setFamily(). Referenced by setFamily(). |
|
Sets flowinfo information for this socket address if this is IPv6.
Definition at line 488 of file ksockaddr.cpp. References setFlowinfo(). Referenced by setFlowinfo(). |
|
Sets the scope id for this socket if this is IPv6.
Definition at line 500 of file ksockaddr.cpp. References setScopeId(). Referenced by setScopeId(). |
|
Returns a pretty representation of this address.
Reimplemented from KSocketAddress. Definition at line 559 of file ksockaddr.cpp. References nodeName(), and serviceName(). |
|
Returns the text representation of the host address.
Reimplemented from KSocketAddress. Definition at line 574 of file ksockaddr.cpp. Referenced by pretty(). |
|
Returns the text representation of the port number.
Reimplemented from KSocketAddress. Definition at line 593 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.
Definition at line 513 of file ksockaddr.cpp. Referenced by setAddress(). |
|
Returns the socket address in IPv6.
Definition at line 532 of file ksockaddr.cpp. Referenced by setAddress(). |
|
Returns the host address. Might be empty.
Definition at line 541 of file ksockaddr.cpp. |
|
Returns the host address. WARNING: this function is not defined if there is no IPv6 support
|
|
Returns the port number.
Definition at line 598 of file ksockaddr.cpp. Referenced by serviceName(). |
|
Returns flowinfo for IPv6 socket.
Definition at line 608 of file ksockaddr.cpp. |
|
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 617 of file ksockaddr.cpp. Referenced by setAddress(). |
|
Compares two IPv4 addresses.
Definition at line 629 of file ksockaddr.cpp. References KSocketAddress::address(), areEqualInet(), KSocketAddress::family(), and KSocketAddress::size(). Referenced by areEqualInet(). |
|
Compares two IPv6 addresses.
Definition at line 646 of file ksockaddr.cpp. References KSocketAddress::address(), areEqualInet6(), KSocketAddress::family(), and KSocketAddress::size(). Referenced by areEqualInet6(). |
|
Returns the socket address. This will be NULL if this is a non-convertible v6.
Definition at line 517 of file ksockaddr.h. |
|
Returns the socket address.
Definition at line 525 of file ksockaddr.h. |
|
Sets this object to be the same as the other.
Definition at line 531 of file ksockaddr.h. |
|
Convert s the given raw address into text form. This function returns QString::null if the address cannot be converted.
Definition at line 716 of file ksockaddr.cpp. References addrToString(). Referenced by addrToString(). |
|
Converts the address given in text form into raw form.
The size of the destination buffer
Definition at line 723 of file ksockaddr.cpp. References stringToAddr(). Referenced by stringToAddr(). |
The documentation for this class was generated from the following files: