Sophie

Sophie

distrib > Mandriva > 2007.0 > i586 > by-pkgid > ad1ba1135a9c9eeffc2e538163e00373 > files > 670

libCommonC++2_1.4-devel-1.4.1-1mdv2007.0.i586.rpm

\section{ost::IPV4Mask Class Reference}
\label{classost_1_1_i_p_v4_mask}\index{ost::IPV4Mask@{ost::IPV4Mask}}
Internet addresses used specifically as masking addresses (such as \char`\"{} 255.255.255.0\char`\"{}) are held in the {\bf IPV4Mask}{\rm (p.\,\pageref{classost_1_1_i_p_v4_mask})} derived object.Internet Address Mask such as subnet masks.  


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

Inheritance diagram for ost::IPV4Mask::\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2cm]{classost_1_1_i_p_v4_mask}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf IPV4Mask} (const char $\ast$mask)
\begin{CompactList}\small\item\em Create the mask from a null terminated ASCII string such as \char`\"{}255.255.255.128\char`\"{}. \item\end{CompactList}\item 
{\bf IPV4Address} \& {\bf operator=} (unsigned long addr)
\begin{CompactList}\small\item\em Allows assignment from the return of functions like inet\_\-addr() or htonl(). \item\end{CompactList}\end{CompactItemize}
\subsection*{Friends}
\begin{CompactItemize}
\item 
\_\-\_\-EXPORT {\bf IPV4Host} {\bf operator \&} (const {\bf IPV4Host} \&addr, const {\bf IPV4Mask} \&mask)
\begin{CompactList}\small\item\em Masks are usually used to coerce host addresses into a specific router or class domain. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Internet addresses used specifically as masking addresses (such as \char`\"{} 255.255.255.0\char`\"{}) are held in the {\bf IPV4Mask}{\rm (p.\,\pageref{classost_1_1_i_p_v4_mask})} derived object.Internet Address Mask such as subnet masks. 

The seperate class is used so that C++ type casting can automatically determine when an {\bf IPV4Address}{\rm (p.\,\pageref{classost_1_1_i_p_v4_address})} object is really a mask address object rather than simply using the base class. This also allows manipulative operators for address masking to operate only when presented with a Masked address as well as providing cleaner and safer source.

\begin{Desc}
\item[Author:]David Sugar $<${\tt dyfet@ostel.com}$>$ \end{Desc}




\subsection{Constructor \& Destructor Documentation}
\index{ost::IPV4Mask@{ost::IPV4Mask}!IPV4Mask@{IPV4Mask}}
\index{IPV4Mask@{IPV4Mask}!ost::IPV4Mask@{ost::IPV4Mask}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}ost::IPV4Mask::IPV4Mask (const char $\ast$ {\em mask})}\label{classost_1_1_i_p_v4_mask_c1eee23d7fb3b9d366e537d27ee7bc50}


Create the mask from a null terminated ASCII string such as \char`\"{}255.255.255.128\char`\"{}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em mask}]null terminated ASCII mask string. \end{description}
\end{Desc}


\subsection{Member Function Documentation}
\index{ost::IPV4Mask@{ost::IPV4Mask}!operator=@{operator=}}
\index{operator=@{operator=}!ost::IPV4Mask@{ost::IPV4Mask}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf IPV4Address}\& ost::IPV4Mask::operator= (unsigned long {\em addr})\hspace{0.3cm}{\tt  [inline]}}\label{classost_1_1_i_p_v4_mask_49ec7fe09dfcc3b9a963e2dc6f1186d4}


Allows assignment from the return of functions like inet\_\-addr() or htonl(). 



Reimplemented from {\bf ost::IPV4Address} {\rm (p.\,\pageref{classost_1_1_i_p_v4_address_c05d9c4599ad313dec545a9e89e7e2d5})}.

\subsection{Friends And Related Function Documentation}
\index{ost::IPV4Mask@{ost::IPV4Mask}!operator &@{operator \&}}
\index{operator &@{operator \&}!ost::IPV4Mask@{ost::IPV4Mask}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\_\-\_\-EXPORT {\bf IPV4Host} operator \& (const {\bf IPV4Host} \& {\em addr}, const {\bf IPV4Mask} \& {\em mask})\hspace{0.3cm}{\tt  [friend]}}\label{classost_1_1_i_p_v4_mask_400c689d4f8484e7b26ad9c9fe865c7f}


Masks are usually used to coerce host addresses into a specific router or class domain. 

This can be done by taking the Inet Host Address object and \char`\"{}and\char`\"{}ing it with an address mask. This operation can be directly expressed in C++ through the \& operator.

\begin{Desc}
\item[Returns:]a internet host address that has been masked. \end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em addr}]host address to be masked by subnet. \item[{\em mask}]inetnet mask address object to mask by. \end{description}
\end{Desc}


The documentation for this class was generated from the following file:\begin{CompactItemize}
\item 
{\bf address.h}\end{CompactItemize}