\hypertarget{group__Evil__Inet__Group}{\section{Inet.\+h functions}
\label{group__Evil__Inet__Group}\index{Inet.\+h functions@{Inet.\+h functions}}
}


This header provides functions ported from Unix in arpa/inet.\+h.  


\subsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\hypertarget{group__Evil__Inet__Group_ga2e4ab3dd91a2f3f88e514beeb7dd474f}{\#define \hyperlink{group__Evil__Inet__Group_ga2e4ab3dd91a2f3f88e514beeb7dd474f}{inet\+\_\+pton}(x, y, z)~\hyperlink{group__Evil__Inet__Group_ga6245bc4fccec569510fcc7cb747b2fcc}{evil\+\_\+inet\+\_\+pton}(x,y,z)}\label{group__Evil__Inet__Group_ga2e4ab3dd91a2f3f88e514beeb7dd474f}

\begin{DoxyCompactList}\small\item\em Wrapper around \hyperlink{group__Evil__Inet__Group_ga6245bc4fccec569510fcc7cb747b2fcc}{evil\+\_\+inet\+\_\+pton()}. \end{DoxyCompactList}\item 
\hypertarget{group__Evil__Inet__Group_gaa2cbbdb2821efd56bcfd03f17f7cb6f2}{\#define \hyperlink{group__Evil__Inet__Group_gaa2cbbdb2821efd56bcfd03f17f7cb6f2}{inet\+\_\+ntop}(x, y, z, s)~\hyperlink{group__Evil__Inet__Group_ga6a7a9fc9f3b52a003f6a35e00321b119}{evil\+\_\+inet\+\_\+ntop}(x,y,z,s)}\label{group__Evil__Inet__Group_gaa2cbbdb2821efd56bcfd03f17f7cb6f2}

\begin{DoxyCompactList}\small\item\em Wrapper around \hyperlink{group__Evil__Inet__Group_ga6a7a9fc9f3b52a003f6a35e00321b119}{evil\+\_\+inet\+\_\+ntop()}. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
int \hyperlink{group__Evil__Inet__Group_ga6245bc4fccec569510fcc7cb747b2fcc}{evil\+\_\+inet\+\_\+pton} (int af, const char $\ast$src, void $\ast$dst)
\begin{DoxyCompactList}\small\item\em Convert I\+Pv4 and I\+Pv6 addresses from text to binary form. \end{DoxyCompactList}\item 
const char $\ast$ \hyperlink{group__Evil__Inet__Group_ga6a7a9fc9f3b52a003f6a35e00321b119}{evil\+\_\+inet\+\_\+ntop} (int af, const char $\ast$src, void $\ast$dst, size\+\_\+t size)
\begin{DoxyCompactList}\small\item\em Convert I\+Pv4 and I\+Pv6 addresses from binary to text form. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
This header provides functions ported from Unix in arpa/inet.\+h. 



\subsection{Function Documentation}
\hypertarget{group__Evil__Inet__Group_ga6245bc4fccec569510fcc7cb747b2fcc}{\index{Inet.\+h functions@{Inet.\+h functions}!evil\+\_\+inet\+\_\+pton@{evil\+\_\+inet\+\_\+pton}}
\index{evil\+\_\+inet\+\_\+pton@{evil\+\_\+inet\+\_\+pton}!Inet.\+h functions@{Inet.\+h functions}}
\subsubsection[{evil\+\_\+inet\+\_\+pton}]{\setlength{\rightskip}{0pt plus 5cm}int evil\+\_\+inet\+\_\+pton (
\begin{DoxyParamCaption}
\item[{int}]{af, }
\item[{const char $\ast$}]{src, }
\item[{void $\ast$}]{dst}
\end{DoxyParamCaption}
)}}\label{group__Evil__Inet__Group_ga6245bc4fccec569510fcc7cb747b2fcc}


Convert I\+Pv4 and I\+Pv6 addresses from text to binary form. 


\begin{DoxyParams}{Parameters}
{\em af} & The address family. \\
\hline
{\em src} & The address to convert. \\
\hline
{\em dst} & The converted address structure. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
1 on success, 0 or -\/1 otherwise.
\end{DoxyReturn}
This function converts I\+Pv4 and I\+Pv6 addresses from {\ttfamily src} to the binary form {\ttfamily dst}. The following address families to pass to {\ttfamily af} are currently supported\+:


\begin{DoxyItemize}
\item i A\+F\+\_\+\+I\+N\+E\+T\+: {\ttfamily src} points to a character string containing an I\+Pv4 network address in dotted-\/decimal format, \char`\"{}ddd.\+ddd.\+ddd.\+ddd\char`\"{}, where ddd is a decimal number of up to three digits in the range 0 to
\begin{DoxyEnumerate}
\item The address is converted to a struct in\+\_\+addr and copied to dst, which must be sizeof(struct in\+\_\+addr) (4) bytes (32 bits) long. 
\end{DoxyEnumerate}
\item A\+F\+\_\+\+I\+N\+E\+T6\+: {\ttfamily src} points to a character string containing an I\+Pv6 network address. The address is converted to a struct in6\+\_\+addr and copied to dst, which must be sizeof(struct in6\+\_\+addr) (16) bytes (128 bits) long. The allowed formats for I\+Pv6 addresses follow these rules\+: 
\begin{DoxyEnumerate}
\item The preferred format is x\+:x\+:x\+:x\+:x\+:x\+:x\+:x. This form consists of eight hexadecimal numbers, each of which expresses a 16-\/bit value (i.\+e., each x can be up to 4 hex digits). 
\item A series of contiguous zero values in the preferred format can be abbreviated to \+:\+:. Only one instance of \+:\+: can occur in an address. For example, the loopback address 0\+:0\+:0\+:0\+:0\+:0\+:0\+:1 can be abbreviated as \+:\+:1. The wildcard address, consisting of all zeros, can be written as \+:\+:. 
\item An alternate format is useful for expressing I\+Pv4-\/mapped I\+Pv6 addresses. This form is written as x\+:x\+:x\+:x\+:x\+:x\+:d.\+d.\+d.\+d, where the six leading xs are hexadecimal values that define the six most-\/significant 16-\/bit pieces of the address (i.\+e., 96 bits), and the ds express a value in dotted-\/decimal notation that defines the least significant 32 bits of the address. An example of such an address is \+:\+: F\+F\+F\+F\+:204.\+152.\+189.\+116. 
\end{DoxyEnumerate}
\end{DoxyItemize}On success this function returns 1 (network address was successfully converted). 0 is returned if {\ttfamily src} does not contain a character string representing a valid network address in the specified address family. If af does not contain a valid address family, -\/1 is returned and errno is set to E\+A\+F\+N\+O\+S\+U\+P\+P\+O\+R\+T.

\begin{DoxySeeAlso}{See also}
\hyperlink{group__Evil__Inet__Group_ga6a7a9fc9f3b52a003f6a35e00321b119}{evil\+\_\+inet\+\_\+ntop()} 

\hyperlink{group__Evil__Inet__Group_gaa2cbbdb2821efd56bcfd03f17f7cb6f2}{inet\+\_\+ntop()}
\end{DoxySeeAlso}
Conformity\+: P\+O\+S\+I\+X.\+1-\/2001.

Supported O\+S\+: Windows X\+P, C\+E. \hypertarget{group__Evil__Inet__Group_ga6a7a9fc9f3b52a003f6a35e00321b119}{\index{Inet.\+h functions@{Inet.\+h functions}!evil\+\_\+inet\+\_\+ntop@{evil\+\_\+inet\+\_\+ntop}}
\index{evil\+\_\+inet\+\_\+ntop@{evil\+\_\+inet\+\_\+ntop}!Inet.\+h functions@{Inet.\+h functions}}
\subsubsection[{evil\+\_\+inet\+\_\+ntop}]{\setlength{\rightskip}{0pt plus 5cm}const char$\ast$ evil\+\_\+inet\+\_\+ntop (
\begin{DoxyParamCaption}
\item[{int}]{af, }
\item[{const char $\ast$}]{src, }
\item[{void $\ast$}]{dst, }
\item[{size\+\_\+t}]{size}
\end{DoxyParamCaption}
)}}\label{group__Evil__Inet__Group_ga6a7a9fc9f3b52a003f6a35e00321b119}


Convert I\+Pv4 and I\+Pv6 addresses from binary to text form. 


\begin{DoxyParams}{Parameters}
{\em af} & The address family. \\
\hline
{\em src} & The address structure to convert. \\
\hline
{\em dst} & A buffer containing the converted string. \\
\hline
{\em size} & The size of the buffer. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
1 on success, 0 otherwise.
\end{DoxyReturn}
This function converts the network address structure {\ttfamily src} in the {\ttfamily af} address family into a character string. The resulting string is copied to the buffer pointed to by {\ttfamily dst}, which must be a non-\/\+N\+U\+L\+L pointer. The caller specifies the number of bytes available in this buffer in the argument {\ttfamily size}. The following address families to pass to {\ttfamily af} are currently supported\+:

\begin{DoxyItemize}
\item A\+F\+\_\+\+I\+N\+E\+T\+: {\ttfamily src} points to a struct in\+\_\+addr (in network byte order) which is converted to an I\+Pv4 network address in the dotted-\/decimal format, \char`\"{}ddd.\+ddd.\+ddd.\+ddd\char`\"{}. The buffer {\ttfamily dst} must be at least I\+N\+E\+T\+\_\+\+A\+D\+D\+R\+S\+T\+R\+L\+E\+N bytes long. \item A\+F\+\_\+\+I\+N\+E\+T6\+: {\ttfamily src} points to a struct in6\+\_\+addr (in network byte order) which is converted to a representation of this address in the most appropriate I\+Pv6 network address format for this address. The buffer {\ttfamily dst} must be at least I\+N\+E\+T6\+\_\+\+A\+D\+D\+R\+S\+T\+R\+L\+E\+N bytes long.\end{DoxyItemize}
On success, this function returns a non-\/\+N\+U\+L\+L pointer to {\ttfamily dst}. N\+U\+L\+L is returned if there was an error, with errno set to indicate the error.

\begin{DoxySeeAlso}{See also}
\hyperlink{group__Evil__Inet__Group_ga6245bc4fccec569510fcc7cb747b2fcc}{evil\+\_\+inet\+\_\+pton()} 

\hyperlink{group__Evil__Inet__Group_ga2e4ab3dd91a2f3f88e514beeb7dd474f}{inet\+\_\+pton()}
\end{DoxySeeAlso}
Conformity\+: P\+O\+S\+I\+X.\+1-\/2001.

Supported O\+S\+: Windows X\+P, C\+E. 