\doxysection{Milter.\+pyip6 Namespace Reference}
\label{namespaceMilter_1_1pyip6}\index{Milter.pyip6@{Milter.pyip6}}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
def \textbf{ inet\+\_\+ntop} (s)
\item 
def \textbf{ inet\+\_\+pton} (p)
\end{DoxyCompactItemize}
\doxysubsection*{Variables}
\begin{DoxyCompactItemize}
\item 
\mbox{\label{namespaceMilter_1_1pyip6_ac9aa881587adf8e64d0a474acbe617d0}} 
string {\bfseries PAT\+\_\+\+IP4} = r\textquotesingle{}\textbackslash{}.\textquotesingle{}.join([r\textquotesingle{}(?\+:\textbackslash{}d$\vert$[1-\/9]\textbackslash{}d$\vert$1\textbackslash{}d\textbackslash{}d$\vert$2[0-\/4]\textbackslash{}d$\vert$25[0-\/5])\textquotesingle{}]$\ast$4)
\item 
\mbox{\label{namespaceMilter_1_1pyip6_a0cbbe1eabde2fc27b415353e3f486692}} 
{\bfseries RE\+\_\+\+IP4} = re.\+compile(PAT\+\_\+\+IP4+\textquotesingle{}\$\textquotesingle{})
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
\begin{DoxyVerb}Pure Python IP6 parsing and formatting

Copyright (c) 2006 Stuart Gathman <stuart@bmsi.com>

This module is free software, and you may redistribute it and/or modify
it under the same terms as Python itself, so long as this copyright message
and disclaimer are retained in their original form.
\end{DoxyVerb}
 

\doxysubsection{Function Documentation}
\mbox{\label{namespaceMilter_1_1pyip6_ae782c801ad3486a52b1c79ed4da078de}} 
\index{Milter.pyip6@{Milter.pyip6}!inet\_ntop@{inet\_ntop}}
\index{inet\_ntop@{inet\_ntop}!Milter.pyip6@{Milter.pyip6}}
\doxysubsubsection{inet\_ntop()}
{\footnotesize\ttfamily def Milter.\+pyip6.\+inet\+\_\+ntop (\begin{DoxyParamCaption}\item[{}]{s }\end{DoxyParamCaption})}

\begin{DoxyVerb}Convert ip6 address to standard hex notation.

Examples:

>>> inet_ntop(struct.pack("!HHHHHHHH",0,0,0,0,0,0xFFFF,0x0102,0x0304))
'::FFFF:1.2.3.4'

>>> inet_ntop(struct.pack("!HHHHHHHH",0x1234,0x5678,0,0,0,0,0x0102,0x0304))
'1234:5678::102:304'

>>> inet_ntop(struct.pack("!HHHHHHHH",0,0,0,0x1234,0x5678,0,0x0102,0x0304))
'::1234:5678:0:102:304'

>>> inet_ntop(struct.pack("!HHHHHHHH",0x1234,0x5678,0,0x0102,0x0304,0,0,0))
'1234:5678:0:102:304::'

>>> inet_ntop(struct.pack("!HHHHHHHH",0,0,0,0,0,0,0,0))
'::'
\end{DoxyVerb}
 \mbox{\label{namespaceMilter_1_1pyip6_aa5a95149fb67a0c89d39217246e7815b}} 
\index{Milter.pyip6@{Milter.pyip6}!inet\_pton@{inet\_pton}}
\index{inet\_pton@{inet\_pton}!Milter.pyip6@{Milter.pyip6}}
\doxysubsubsection{inet\_pton()}
{\footnotesize\ttfamily def Milter.\+pyip6.\+inet\+\_\+pton (\begin{DoxyParamCaption}\item[{}]{p }\end{DoxyParamCaption})}

\begin{DoxyVerb}Convert ip6 standard hex notation to ip6 address.

Examples:

>>> struct.unpack('!HHHHHHHH',inet_pton('::'))
(0, 0, 0, 0, 0, 0, 0, 0)

>>> struct.unpack('!HHHHHHHH',inet_pton('::1234'))
(0, 0, 0, 0, 0, 0, 0, 4660)

>>> struct.unpack('!HHHHHHHH',inet_pton('1234::'))
(4660, 0, 0, 0, 0, 0, 0, 0)

>>> struct.unpack('!HHHHHHHH',inet_pton('1234::5678'))
(4660, 0, 0, 0, 0, 0, 0, 22136)

>>> struct.unpack('!HHHHHHHH',inet_pton('::FFFF:1.2.3.4'))
(0, 0, 0, 0, 0, 65535, 258, 772)

>>> struct.unpack('!HHHHHHHH',inet_pton('1.2.3.4'))
(0, 0, 0, 0, 0, 65535, 258, 772)

>>> try: inet_pton('::1.2.3.4.5')
... except ValueError as x: print(x)
::1.2.3.4.5
\end{DoxyVerb}
 