\section{KNetwork::KReverse\-Resolver Class Reference}
\label{classKNetwork_1_1KReverseResolver}\index{KNetwork::KReverseResolver@{KNetwork::KReverseResolver}}
Run a reverse-resolution on a socket address.  


{\tt \#include $<$kreverseresolver.h$>$}

Inheritance diagram for KNetwork::KReverse\-Resolver:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=92pt]{classKNetwork_1_1KReverseResolver__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KNetwork::KReverse\-Resolver:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=92pt]{classKNetwork_1_1KReverseResolver__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Types}
\begin{CompactItemize}
\item 
enum {\bf Flags} \{ \par
{\bf Numeric\-Host} =  0x01, 
{\bf Numeric\-Service} =  0x02, 
{\bf Node\-Name\-Only} =  0x04, 
{\bf Datagram} =  0x08, 
\par
{\bf Numeric\-Scope} =  0x10, 
{\bf Resolution\-Required} =  0x20
 \}
\end{CompactItemize}
\subsection*{Signals}
\begin{CompactItemize}
\item 
void {\bf finished} (const {\bf KReverse\-Resolver} \&obj)
\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KReverse\-Resolver} (const {\bf KSocket\-Address} \&addr, int flags=0, {\bf QObject} $\ast$=0L, const char $\ast$=0L)
\item 
virtual {\bf $\sim$KReverse\-Resolver} ()
\item 
bool {\bf is\-Running} () const 
\item 
bool {\bf success} () const 
\item 
bool {\bf failure} () const 
\item 
{\bf QString} {\bf node} () const 
\item 
{\bf QString} {\bf service} () const 
\item 
const {\bf KSocket\-Address} \& {\bf address} () const 
\item 
bool {\bf start} ()
\item 
virtual bool {\bf event} ({\bf QEvent} $\ast$)
\end{CompactItemize}
\subsection*{Static Public Member Functions}
\begin{CompactItemize}
\item 
static bool {\bf resolve} (const {\bf KSocket\-Address} \&addr, {\bf QString} \&node, {\bf QString} \&serv, int flags=0)
\item 
static bool {\bf resolve} (const struct sockaddr $\ast$sa, Q\_\-UINT16 salen, {\bf QString} \&node, {\bf QString} \&serv, int flags=0)
\end{CompactItemize}


\subsection{Detailed Description}
Run a reverse-resolution on a socket address. 

This class is provided as a counterpart to {\bf KResolver}{\rm (p.\,\pageref{classKNetwork_1_1KResolver})} in such a way as it produces a reverse resolution: it resolves a socket address from its binary representations into a textual representation.

Most users will use the static functions {\bf resolve}{\rm (p.\,\pageref{classKNetwork_1_1KReverseResolver_e0})}, which work both synchronously (blocking) and asynchronously (non-blocking).

\begin{Desc}
\item[Author:]Thiago Macieira $<${\tt thiago.macieira@kdemail.net}$>$ \end{Desc}




Definition at line 50 of file kreverseresolver.h.

\subsection{Member Enumeration Documentation}
\index{KNetwork::KReverseResolver@{KNetwork::KReverse\-Resolver}!Flags@{Flags}}
\index{Flags@{Flags}!KNetwork::KReverseResolver@{KNetwork::KReverse\-Resolver}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}enum {\bf KNetwork::KReverse\-Resolver::Flags}}\label{classKNetwork_1_1KReverseResolver_w6}


Flags for the reverse resolution. 

These flags are used by the reverse resolution functions for setting resolution parameters. The possible values are: \begin{itemize}
\item Numeric\-Host: don't try to resolve the host address to a text form. Instead, convert the address to its numeric textual representation. \item Numeric\-Service: the same as Numeric\-Host, but for the service name \item Node\-Name\-Only: returns the node name only (i.e., not the Fully Qualified Domain Name) \item Datagram: in case of ambiguity in the service name, prefer the name associated with the datagram protocol \item Numeric\-Scope: for those addresses which have the concept of scope, resolve using the numeric value instead of the proper scope name. \item Resolution\-Required: normally, when resolving, if the name resolution fails, the process normally converts the numeric address into its presentation forms. This flag causes the function to return with error instead. \end{itemize}


Definition at line 74 of file kreverseresolver.h.

\subsection{Constructor \& Destructor Documentation}
\index{KNetwork::KReverseResolver@{KNetwork::KReverse\-Resolver}!KReverseResolver@{KReverseResolver}}
\index{KReverseResolver@{KReverseResolver}!KNetwork::KReverseResolver@{KNetwork::KReverse\-Resolver}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KReverse\-Resolver::KReverse\-Resolver (const {\bf KSocket\-Address} \& {\em addr}, int {\em flags} = {\tt 0}, {\bf QObject} $\ast$ = {\tt 0L}, const char $\ast$ = {\tt 0L})}\label{classKNetwork_1_1KReverseResolver_a0}


Constructs this object to resolve the given socket address. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em addr}]the address to resolve \item[{\em flags}]the flags to use, see {\bf Flags}{\rm (p.\,\pageref{classKNetwork_1_1KReverseResolver_w6})} \end{description}
\end{Desc}


Definition at line 113 of file kreverseresolver.cpp.\index{KNetwork::KReverseResolver@{KNetwork::KReverse\-Resolver}!~KReverseResolver@{$\sim$KReverseResolver}}
\index{~KReverseResolver@{$\sim$KReverseResolver}!KNetwork::KReverseResolver@{KNetwork::KReverse\-Resolver}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KReverse\-Resolver::$\sim${\bf KReverse\-Resolver} ()\hspace{0.3cm}{\tt  [virtual]}}\label{classKNetwork_1_1KReverseResolver_a1}


Destructor. 



Definition at line 120 of file kreverseresolver.cpp.

\subsection{Member Function Documentation}
\index{KNetwork::KReverseResolver@{KNetwork::KReverse\-Resolver}!isRunning@{isRunning}}
\index{isRunning@{isRunning}!KNetwork::KReverseResolver@{KNetwork::KReverse\-Resolver}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KReverse\-Resolver::is\-Running () const}\label{classKNetwork_1_1KReverseResolver_a2}


This function returns 'true' if the processing is still running. 



Definition at line 126 of file kreverseresolver.cpp.

Referenced by failure(), and success().\index{KNetwork::KReverseResolver@{KNetwork::KReverse\-Resolver}!success@{success}}
\index{success@{success}!KNetwork::KReverseResolver@{KNetwork::KReverse\-Resolver}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KReverse\-Resolver::success () const}\label{classKNetwork_1_1KReverseResolver_a3}


This function returns true if the processing has finished with success, false if it's still running or failed. 



Definition at line 131 of file kreverseresolver.cpp.

References is\-Running().\index{KNetwork::KReverseResolver@{KNetwork::KReverse\-Resolver}!failure@{failure}}
\index{failure@{failure}!KNetwork::KReverseResolver@{KNetwork::KReverse\-Resolver}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KReverse\-Resolver::failure () const}\label{classKNetwork_1_1KReverseResolver_a4}


This function returns true if the processing has finished with failure, false if it's still running or succeeded. 



Definition at line 136 of file kreverseresolver.cpp.

References is\-Running().\index{KNetwork::KReverseResolver@{KNetwork::KReverse\-Resolver}!node@{node}}
\index{node@{node}!KNetwork::KReverseResolver@{KNetwork::KReverse\-Resolver}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KReverse\-Resolver::node () const}\label{classKNetwork_1_1KReverseResolver_a5}


Returns the resolved node name, if the resolution has finished successfully, or QString::null otherwise. 



Definition at line 141 of file kreverseresolver.cpp.

Referenced by resolve().\index{KNetwork::KReverseResolver@{KNetwork::KReverse\-Resolver}!service@{service}}
\index{service@{service}!KNetwork::KReverseResolver@{KNetwork::KReverse\-Resolver}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KReverse\-Resolver::service () const}\label{classKNetwork_1_1KReverseResolver_a6}


Returns the resolved service name, if the resolution has finished successfully, or QString::null otherwise. 



Definition at line 146 of file kreverseresolver.cpp.\index{KNetwork::KReverseResolver@{KNetwork::KReverse\-Resolver}!address@{address}}
\index{address@{address}!KNetwork::KReverseResolver@{KNetwork::KReverse\-Resolver}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const {\bf KSocket\-Address} \& KReverse\-Resolver::address () const}\label{classKNetwork_1_1KReverseResolver_a7}


Returns the socket address which was subject to resolution. 



Definition at line 151 of file kreverseresolver.cpp.\index{KNetwork::KReverseResolver@{KNetwork::KReverse\-Resolver}!start@{start}}
\index{start@{start}!KNetwork::KReverseResolver@{KNetwork::KReverse\-Resolver}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KReverse\-Resolver::start ()}\label{classKNetwork_1_1KReverseResolver_a8}


Starts the resolution. 

This function returns 'true' if the resolution has started successfully. 

Definition at line 156 of file kreverseresolver.cpp.\index{KNetwork::KReverseResolver@{KNetwork::KReverse\-Resolver}!event@{event}}
\index{event@{event}!KNetwork::KReverseResolver@{KNetwork::KReverse\-Resolver}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KReverse\-Resolver::event ({\bf QEvent} $\ast$)\hspace{0.3cm}{\tt  [virtual]}}\label{classKNetwork_1_1KReverseResolver_a9}


Overrides event handling. 



Reimplemented from {\bf QObject}.

Definition at line 173 of file kreverseresolver.cpp.

References QObject::event(), and finished().\index{KNetwork::KReverseResolver@{KNetwork::KReverse\-Resolver}!finished@{finished}}
\index{finished@{finished}!KNetwork::KReverseResolver@{KNetwork::KReverse\-Resolver}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KNetwork::KReverse\-Resolver::finished (const {\bf KReverse\-Resolver} \& {\em obj})\hspace{0.3cm}{\tt  [signal]}}\label{classKNetwork_1_1KReverseResolver_l0}


This signal is emitted when the resolution has finished. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em obj}]this class, which contains the results \end{description}
\end{Desc}


Referenced by event().\index{KNetwork::KReverseResolver@{KNetwork::KReverse\-Resolver}!resolve@{resolve}}
\index{resolve@{resolve}!KNetwork::KReverseResolver@{KNetwork::KReverse\-Resolver}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KReverse\-Resolver::resolve (const {\bf KSocket\-Address} \& {\em addr}, {\bf QString} \& {\em node}, {\bf QString} \& {\em serv}, int {\em flags} = {\tt 0})\hspace{0.3cm}{\tt  [static]}}\label{classKNetwork_1_1KReverseResolver_e0}


Resolves a socket address to its textual representation. 

FIXME!! How can we do this in a non-blocking manner!?

This function is used to resolve a socket address from its binary representation to a textual form, even if numeric only.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em addr}]the socket address to be resolved \item[{\em node}]the {\bf QString} where we will store the resolved node \item[{\em serv}]the {\bf QString} where we will store the resolved service \item[{\em flags}]flags to be used for this resolution. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if the resolution succeeded, false if not \end{Desc}
\begin{Desc}
\item[See also:]Reverse\-Flags for the possible values for {\tt flags} \end{Desc}


Definition at line 193 of file kreverseresolver.cpp.

References node().

Referenced by resolve().\index{KNetwork::KReverseResolver@{KNetwork::KReverse\-Resolver}!resolve@{resolve}}
\index{resolve@{resolve}!KNetwork::KReverseResolver@{KNetwork::KReverse\-Resolver}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KReverse\-Resolver::resolve (const struct sockaddr $\ast$ {\em sa}, Q\_\-UINT16 {\em salen}, {\bf QString} \& {\em node}, {\bf QString} \& {\em serv}, int {\em flags} = {\tt 0})\hspace{0.3cm}{\tt  [static]}}\label{classKNetwork_1_1KReverseResolver_e1}


Resolves a socket address to its textual representation. 

FIXME!! How can we do this in a non-blocking manner!?

This function behaves just like the above one, except it takes a sockaddr structure and its size as parameters.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em sa}]the sockaddr structure containing the address to be resolved \item[{\em salen}]the length of the sockaddr structure \item[{\em node}]the {\bf QString} where we will store the resolved node \item[{\em serv}]the {\bf QString} where we will store the resolved service \item[{\em flags}]flags to be used for this resolution. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if the resolution succeeded, false if not \end{Desc}
\begin{Desc}
\item[See also:]Reverse\-Flags for the possible values for {\tt flags} \end{Desc}


Definition at line 206 of file kreverseresolver.cpp.

References node(), and resolve().

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
kreverseresolver.h\item 
kreverseresolver.cpp\end{CompactItemize}
