.TH "KInetSocketAddress" kde3 "11 Jun 2005" "Version Version 3.4.1" "kdecore Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KInetSocketAddress \- An Inet (IPv4 or IPv6) socket address an Internet socket address.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <ksockaddr.h>\fP
.PP
Inherits \fBKSocketAddress\fP.
.PP
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKInetSocketAddress\fP ()"
.br
.ti -1c
.RI "\fBKInetSocketAddress\fP (const \fBKInetSocketAddress\fP &)"
.br
.ti -1c
.RI "\fBKInetSocketAddress\fP (const sockaddr_in *sin, ksocklen_t len)"
.br
.ti -1c
.RI "\fBKInetSocketAddress\fP (const sockaddr_in6 *sin6, ksocklen_t len)"
.br
.ti -1c
.RI "\fBKInetSocketAddress\fP (const in_addr &addr, unsigned short port)"
.br
.ti -1c
.RI "\fBKInetSocketAddress\fP (const in6_addr &addr, unsigned short port)"
.br
.ti -1c
.RI "\fBKInetSocketAddress\fP (const \fBQString\fP &addr, unsigned short port, int family=-1)"
.br
.ti -1c
.RI "virtual \fB~KInetSocketAddress\fP ()"
.br
.ti -1c
.RI "bool \fBsetAddress\fP (const \fBKInetSocketAddress\fP &ksa)"
.br
.ti -1c
.RI "bool \fBsetAddress\fP (const sockaddr_in *sin, ksocklen_t len)"
.br
.ti -1c
.RI "bool \fBsetAddress\fP (const sockaddr_in6 *sin6, ksocklen_t len)"
.br
.ti -1c
.RI "bool \fBsetAddress\fP (const in_addr &addr, unsigned short port)"
.br
.ti -1c
.RI "bool \fBsetAddress\fP (const in6_addr &addr, unsigned short port)"
.br
.ti -1c
.RI "bool \fBsetAddress\fP (const \fBQString\fP &addr, unsigned short port, int family=-1)"
.br
.ti -1c
.RI "bool \fBsetHost\fP (const in_addr &addr)"
.br
.ti -1c
.RI "bool \fBsetHost\fP (const in6_addr &addr)"
.br
.ti -1c
.RI "bool \fBsetHost\fP (const \fBQString\fP &addr, int family=-1)"
.br
.ti -1c
.RI "bool \fBsetPort\fP (unsigned short port)"
.br
.ti -1c
.RI "bool \fBsetFamily\fP (int family)"
.br
.ti -1c
.RI "bool \fBsetFlowinfo\fP (Q_UINT32 flowinfo)"
.br
.ti -1c
.RI "bool \fBsetScopeId\fP (int scopeid)"
.br
.ti -1c
.RI "virtual \fBQString\fP \fBpretty\fP () const "
.br
.ti -1c
.RI "virtual \fBQString\fP \fBnodeName\fP () const "
.br
.ti -1c
.RI "virtual \fBQString\fP \fBserviceName\fP () const "
.br
.ti -1c
.RI "const sockaddr_in * \fBaddressV4\fP () const "
.br
.ti -1c
.RI "const sockaddr_in6 * \fBaddressV6\fP () const "
.br
.ti -1c
.RI "in_addr \fBhostV4\fP () const "
.br
.ti -1c
.RI "in6_addr \fBhostV6\fP () const "
.br
.ti -1c
.RI "unsigned short \fBport\fP () const "
.br
.ti -1c
.RI "Q_UINT32 \fBflowinfo\fP () const "
.br
.ti -1c
.RI "int \fBscopeId\fP () const "
.br
.ti -1c
.RI "virtual ksocklen_t \fBsize\fP () const "
.br
.ti -1c
.RI "\fBoperator const sockaddr_in *\fP () const "
.br
.ti -1c
.RI "\fBoperator const sockaddr_in6 *\fP () const "
.br
.ti -1c
.RI "\fBKInetSocketAddress\fP & \fBoperator=\fP (const \fBKInetSocketAddress\fP &other)"
.br
.in -1c
.SS "Static Public Member Functions"

.in +1c
.ti -1c
.RI "static bool \fBareEqualInet\fP (const \fBKSocketAddress\fP &s1, const \fBKSocketAddress\fP &s2, bool coreOnly)"
.br
.ti -1c
.RI "static bool \fBareEqualInet6\fP (const \fBKSocketAddress\fP &s1, const \fBKSocketAddress\fP &s2, bool coreOnly)"
.br
.ti -1c
.RI "static \fBQString\fP \fBaddrToString\fP (int family, const void *addr)"
.br
.ti -1c
.RI "static bool \fBstringToAddr\fP (int family, const char *text, void *dest)"
.br
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "virtual void \fBvirtual_hook\fP (int id, void *data)"
.br
.in -1c
.SS "Friends"

.in +1c
.ti -1c
.RI "class \fBKExtendedSocket\fP"
.br
.in -1c
.SH "Detailed Description"
.PP 
An Inet (IPv4 or IPv6) socket address an Internet socket address. 

This is an IPv4 or IPv6 address of the Internet
.PP
This class inherits most of the functionality from \fBKSocketAddress\fP, but is targeted specifically to Internet addresses
.PP
\fBAuthor:\fP
.RS 4
Thiago Macieira <thiago.macieira@kdemail.net> 
.RE
.PP

.PP
Definition at line 233 of file ksockaddr.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KInetSocketAddress::KInetSocketAddress ()"
.PP
Default constructor. 
.PP
Does nothing 
.PP
Definition at line 271 of file ksockaddr.cpp.
.SS "KInetSocketAddress::KInetSocketAddress (const \fBKInetSocketAddress\fP &)"
.PP
Copy constructor. 
.PP
Definition at line 276 of file ksockaddr.cpp.
.PP
References setAddress().
.SS "KInetSocketAddress::KInetSocketAddress (const sockaddr_in * sin, ksocklen_t len)"
.PP
Creates an IPv4 socket from raw sockaddr_in. 
.PP
\fBParameters:\fP
.RS 4
\fIsin\fP a sockaddr_in structure to copy from 
.br
\fIlen\fP the socket address length 
.RE
.PP

.PP
Definition at line 282 of file ksockaddr.cpp.
.PP
References setAddress().
.SS "KInetSocketAddress::KInetSocketAddress (const sockaddr_in6 * sin6, ksocklen_t len)"
.PP
Creates an IPv6 socket from raw sockaddr_in6. 
.PP
\fBParameters:\fP
.RS 4
\fIsin6\fP a sockaddr_in6 structure to copy from 
.br
\fIlen\fP the socket address length 
.RE
.PP

.PP
Definition at line 288 of file ksockaddr.cpp.
.PP
References setAddress().
.SS "KInetSocketAddress::KInetSocketAddress (const in_addr & addr, unsigned short port)"
.PP
Creates a socket from information. 
.PP
\fBParameters:\fP
.RS 4
\fIaddr\fP a binary address 
.br
\fIport\fP a port number 
.RE
.PP

.PP
Definition at line 294 of file ksockaddr.cpp.
.PP
References setAddress().
.SS "KInetSocketAddress::KInetSocketAddress (const in6_addr & addr, unsigned short port)"
.PP
Creates a socket from information. 
.PP
\fBParameters:\fP
.RS 4
\fIaddr\fP a binary address 
.br
\fIport\fP a port number 
.RE
.PP

.PP
Definition at line 300 of file ksockaddr.cpp.
.PP
References setAddress().
.SS "KInetSocketAddress::KInetSocketAddress (const \fBQString\fP & addr, unsigned short port, int family = \fC-1\fP)"
.PP
Creates a socket from text representation. 
.PP
\fBParameters:\fP
.RS 4
\fIaddr\fP a text representation of the address 
.br
\fIport\fP a port number 
.br
\fIfamily\fP the family for this address. Use -1 to guess the family type 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsetAddress\fP 
.RE
.PP

.PP
Definition at line 306 of file ksockaddr.cpp.
.PP
References setAddress().
.SS "KInetSocketAddress::~\fBKInetSocketAddress\fP ()\fC [virtual]\fP"
.PP
Destructor. 
.PP
Definition at line 312 of file ksockaddr.cpp.
.SH "Member Function Documentation"
.PP 
.SS "bool KInetSocketAddress::setAddress (const \fBKInetSocketAddress\fP & ksa)"
.PP
Sets this socket to given socket. 
.PP
\fBParameters:\fP
.RS 4
\fIksa\fP the other socket 
.RE
.PP
\fBReturns:\fP
.RS 4
true if successful, false otherwise 
.RE
.PP

.PP
Definition at line 319 of file ksockaddr.cpp.
.PP
Referenced by KInetSocketAddress().
.SS "bool KInetSocketAddress::setAddress (const sockaddr_in * sin, ksocklen_t len)"
.PP
Sets this socket to given raw socket. 
.PP
\fBParameters:\fP
.RS 4
\fIsin\fP the raw socket 
.br
\fIlen\fP the socket address length 
.RE
.PP
\fBReturns:\fP
.RS 4
true if successful, false otherwise 
.RE
.PP

.PP
Definition at line 330 of file ksockaddr.cpp.
.PP
References setHost(), and setPort().
.SS "bool KInetSocketAddress::setAddress (const sockaddr_in6 * sin6, ksocklen_t len)"
.PP
Sets this socket to given raw socket. 
.PP
Note: this function does not clear the scope ID and flow info values 
.PP
\fBParameters:\fP
.RS 4
\fIsin6\fP the raw socket 
.br
\fIlen\fP the socket address length 
.RE
.PP
\fBReturns:\fP
.RS 4
true if successful, false otherwise 
.RE
.PP

.PP
Definition at line 342 of file ksockaddr.cpp.
.SS "bool KInetSocketAddress::setAddress (const in_addr & addr, unsigned short port)"
.PP
Sets this socket to raw address and port. 
.PP
\fBParameters:\fP
.RS 4
\fIaddr\fP the address 
.br
\fIport\fP the port number 
.RE
.PP
\fBReturns:\fP
.RS 4
true if successful, false otherwise 
.RE
.PP

.PP
Definition at line 370 of file ksockaddr.cpp.
.PP
References setHost(), and setPort().
.SS "bool KInetSocketAddress::setAddress (const in6_addr & addr, unsigned short port)"
.PP
Sets this socket to raw address and port. 
.PP
\fBParameters:\fP
.RS 4
\fIaddr\fP the address 
.br
\fIport\fP the port number 
.RE
.PP
\fBReturns:\fP
.RS 4
true if successful, false otherwise 
.RE
.PP

.PP
Definition at line 375 of file ksockaddr.cpp.
.PP
References setHost(), and setPort().
.SS "bool KInetSocketAddress::setAddress (const \fBQString\fP & addr, unsigned short port, int family = \fC-1\fP)"
.PP
Sets this socket to text address and port. 
.PP
You can use the \fCfamily\fP parameter to specify what kind of socket you want this to be. It could be AF_INET or AF_INET6 or -1.
.PP
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.
.PP
This function returns false if the socket address was not valid. 
.PP
\fBParameters:\fP
.RS 4
\fIaddr\fP the address 
.br
\fIport\fP the port number 
.br
\fIfamily\fP the address family, -1 for any 
.RE
.PP
\fBReturns:\fP
.RS 4
true if successful, false otherwise 
.RE
.PP

.PP
Definition at line 380 of file ksockaddr.cpp.
.PP
References setHost(), and setPort().
.SS "bool KInetSocketAddress::setHost (const in_addr & addr)"
.PP
Sets this socket's host address to given raw address. 
.PP
\fBParameters:\fP
.RS 4
\fIaddr\fP the address 
.RE
.PP
\fBReturns:\fP
.RS 4
true if successful, false otherwise 
.RE
.PP

.PP
Definition at line 385 of file ksockaddr.cpp.
.PP
Referenced by setAddress().
.SS "bool KInetSocketAddress::setHost (const in6_addr & addr)"
.PP
Sets this socket's host address to given raw address. 
.PP
\fBParameters:\fP
.RS 4
\fIaddr\fP the address 
.RE
.PP
\fBReturns:\fP
.RS 4
true if successful, false otherwise 
.RE
.PP

.PP
Definition at line 393 of file ksockaddr.cpp.
.SS "bool KInetSocketAddress::setHost (const \fBQString\fP & addr, int family = \fC-1\fP)"
.PP
Sets this socket's host address to given text representation. 
.PP
\fBParameters:\fP
.RS 4
\fIaddr\fP the address 
.br
\fIfamily\fP the address family, -1 to guess the family 
.RE
.PP
\fBReturns:\fP
.RS 4
true if successful, false otherwise 
.RE
.PP

.PP
Definition at line 405 of file ksockaddr.cpp.
.SS "bool KInetSocketAddress::setPort (unsigned short port)"
.PP
Sets this socket's port number to given port number. 
.PP
\fBParameters:\fP
.RS 4
\fIport\fP the port number 
.RE
.PP
\fBReturns:\fP
.RS 4
true if successful, false otherwise 
.RE
.PP

.PP
Definition at line 454 of file ksockaddr.cpp.
.PP
Referenced by setAddress().
.SS "bool KInetSocketAddress::setFamily (int family)"
.PP
Turns this into an IPv4 or IPv6 address. 
.PP
\fBParameters:\fP
.RS 4
\fIfamily\fP the new address family 
.RE
.PP
\fBReturns:\fP
.RS 4
false if this is v6 and information was lost. That doesn't mean the conversion was unsuccessful. 
.RE
.PP

.PP
Definition at line 465 of file ksockaddr.cpp.
.SS "bool KInetSocketAddress::setFlowinfo (Q_UINT32 flowinfo)"
.PP
Sets flowinfo information for this socket address if this is IPv6. 
.PP
\fBParameters:\fP
.RS 4
\fIflowinfo\fP flowinfo 
.RE
.PP
\fBReturns:\fP
.RS 4
true if successful, false otherwise 
.RE
.PP

.PP
Definition at line 488 of file ksockaddr.cpp.
.SS "bool KInetSocketAddress::setScopeId (int scopeid)"
.PP
Sets the scope id for this socket if this is IPv6. 
.PP
\fBParameters:\fP
.RS 4
\fIscopeid\fP the scope id 
.RE
.PP
\fBReturns:\fP
.RS 4
true if successful, false otherwise 
.RE
.PP

.PP
Definition at line 500 of file ksockaddr.cpp.
.SS "\fBQString\fP KInetSocketAddress::pretty () const\fC [virtual]\fP"
.PP
Returns a pretty representation of this address. 
.PP
\fBReturns:\fP
.RS 4
a pretty representation 
.RE
.PP

.PP
Reimplemented from \fBKSocketAddress\fP.
.PP
Definition at line 559 of file ksockaddr.cpp.
.PP
References QString::arg(), nodeName(), and serviceName().
.SS "\fBQString\fP KInetSocketAddress::nodeName () const\fC [virtual]\fP"
.PP
Returns the text representation of the host address. 
.PP
\fBReturns:\fP
.RS 4
a text representation of the host address 
.RE
.PP

.PP
Reimplemented from \fBKSocketAddress\fP.
.PP
Definition at line 574 of file ksockaddr.cpp.
.PP
References QString::fromLatin1().
.PP
Referenced by pretty().
.SS "\fBQString\fP KInetSocketAddress::serviceName () const\fC [virtual]\fP"
.PP
Returns the text representation of the port number. 
.PP
\fBReturns:\fP
.RS 4
the name of the service (a number) 
.RE
.PP

.PP
Reimplemented from \fBKSocketAddress\fP.
.PP
Definition at line 593 of file ksockaddr.cpp.
.PP
References QString::number(), and port().
.PP
Referenced by pretty().
.SS "const sockaddr_in * KInetSocketAddress::addressV4 () const"
.PP
Returns the socket address. 
.PP
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. 
.PP
\fBReturns:\fP
.RS 4
the sockaddr_in struct, can be 0. 
.RE
.PP

.PP
Definition at line 513 of file ksockaddr.cpp.
.SS "const sockaddr_in6 * KInetSocketAddress::addressV6 () const"
.PP
Returns the socket address in IPv6. 
.PP
\fBReturns:\fP
.RS 4
the sockaddr_in struct, can be 0 if IPv6 is unsupported. 
.RE
.PP

.PP
Definition at line 532 of file ksockaddr.cpp.
.SS "in_addr KInetSocketAddress::hostV4 () const"
.PP
Returns the host address. 
.PP
Might be empty. 
.PP
\fBReturns:\fP
.RS 4
the host address 
.RE
.PP

.PP
Definition at line 541 of file ksockaddr.cpp.
.SS "in6_addr KInetSocketAddress::hostV6 () const"
.PP
Returns the host address. 
.PP
WARNING: this function is not defined if there is no IPv6 support 
.PP
\fBReturns:\fP
.RS 4
the host address 
.RE
.PP

.SS "unsigned short KInetSocketAddress::port () const"
.PP
Returns the port number. 
.PP
\fBReturns:\fP
.RS 4
the port number 
.RE
.PP

.PP
Definition at line 598 of file ksockaddr.cpp.
.PP
Referenced by serviceName().
.SS "Q_UINT32 KInetSocketAddress::flowinfo () const"
.PP
Returns flowinfo for IPv6 socket. 
.PP
\fBReturns:\fP
.RS 4
the flowinfo, 0 if unsupported 
.RE
.PP

.PP
Definition at line 608 of file ksockaddr.cpp.
.SS "int KInetSocketAddress::scopeId () const"
.PP
Returns the scope id for this IPv6 socket. 
.PP
\fBReturns:\fP
.RS 4
the scope id 
.RE
.PP

.SS "ksocklen_t KInetSocketAddress::size () const\fC [virtual]\fP"
.PP
Returns the socket length. 
.PP
Will be either sizeof(sockaddr_in) or sizeof(sockaddr_in6) 
.PP
\fBReturns:\fP
.RS 4
the length of the socket 
.RE
.PP

.PP
Reimplemented from \fBKSocketAddress\fP.
.PP
Definition at line 617 of file ksockaddr.cpp.
.SS "bool KInetSocketAddress::areEqualInet (const \fBKSocketAddress\fP & s1, const \fBKSocketAddress\fP & s2, bool coreOnly)\fC [static]\fP"
.PP
Compares two IPv4 addresses. 
.PP
\fBParameters:\fP
.RS 4
\fIs1\fP the first address to compare 
.br
\fIs2\fP the second address to compare 
.br
\fIcoreOnly\fP true if only core parts should be compared (only the address) 
.RE
.PP
\fBReturns:\fP
.RS 4
true if the given addresses are equal. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBareEqualInet6()\fP 
.PP
\fBKSocketAddress::isEqual()\fP 
.PP
\fBKSocketAddress::isCoreEqual()\fP 
.RE
.PP

.PP
Definition at line 629 of file ksockaddr.cpp.
.PP
Referenced by KSocketAddress::isCoreEqual(), and KSocketAddress::isEqual().
.SS "bool KInetSocketAddress::areEqualInet6 (const \fBKSocketAddress\fP & s1, const \fBKSocketAddress\fP & s2, bool coreOnly)\fC [static]\fP"
.PP
Compares two IPv6 addresses. 
.PP
\fBParameters:\fP
.RS 4
\fIs1\fP the first address to compare 
.br
\fIs2\fP the second address to compare 
.br
\fIcoreOnly\fP true if only core parts should be compared (only the address) 
.RE
.PP
\fBReturns:\fP
.RS 4
true if the given addresses are equal. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBareEqualInet()\fP 
.PP
\fBKSocketAddress::isEqual()\fP 
.PP
\fBKSocketAddress::isCoreEqual()\fP 
.RE
.PP

.PP
Definition at line 646 of file ksockaddr.cpp.
.PP
Referenced by KSocketAddress::isCoreEqual(), and KSocketAddress::isEqual().
.SS "KInetSocketAddress::operator const sockaddr_in * () const\fC [inline]\fP"
.PP
Returns the socket address. 
.PP
This will be NULL if this is a non-convertible v6. 
.PP
\fBReturns:\fP
.RS 4
the sockaddr_in structure, can be 0 if v6. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBaddressV4()\fP 
.RE
.PP

.PP
Definition at line 514 of file ksockaddr.h.
.SS "KInetSocketAddress::operator const sockaddr_in6 * () const\fC [inline]\fP"
.PP
Returns the socket address. 
.PP
\fBReturns:\fP
.RS 4
the sockaddr_in structure, can be 0 if v6 is unsupported. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBaddressV6()\fP 
.RE
.PP

.PP
Definition at line 522 of file ksockaddr.h.
.SS "\fBKInetSocketAddress\fP& KInetSocketAddress::operator= (const \fBKInetSocketAddress\fP & other)\fC [inline]\fP"
.PP
Sets this object to be the same as the other. 
.PP
Definition at line 528 of file ksockaddr.h.
.SS "\fBQString\fP KInetSocketAddress::addrToString (int family, const void * addr)\fC [static]\fP"
.PP
Convert s the given raw address into text form. 
.PP
This function returns QString::null if the address cannot be converted. 
.PP
\fBParameters:\fP
.RS 4
\fIfamily\fP the family of the address 
.br
\fIaddr\fP the address, in raw form 
.RE
.PP
\fBReturns:\fP
.RS 4
the converted address, or QString::null if not possible. 
.RE
.PP

.PP
Definition at line 716 of file ksockaddr.cpp.
.PP
References QString::fromLatin1().
.SS "bool KInetSocketAddress::stringToAddr (int family, const char * text, void * dest)\fC [static]\fP"
.PP
Converts the address given in text form into raw form. 
.PP
The size of the destination buffer \fCdest\fP is supposed to be large enough to hold the address of the given family. 
.PP
\fBParameters:\fP
.RS 4
\fIfamily\fP the family of the address 
.br
\fItext\fP the text representation of the address 
.br
\fIdest\fP the destination buffer of the address 
.RE
.PP
\fBReturns:\fP
.RS 4
true if convertion was successful. 
.RE
.PP

.PP
Definition at line 723 of file ksockaddr.cpp.

.SH "Author"
.PP 
Generated automatically by Doxygen for kdecore Library from the source code.
