\doxysection{include/osmocom/gsm/apn.h File Reference}
\label{apn_8h}\index{include/osmocom/gsm/apn.h@{include/osmocom/gsm/apn.h}}
{\ttfamily \#include $<$stdint.\+h$>$}\newline
\doxysubsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define \textbf{ APN\+\_\+\+NI\+\_\+\+MAXLEN}~63
\item 
\#define \textbf{ APN\+\_\+\+MAXLEN}~100
\end{DoxyCompactItemize}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
char $\ast$ \textbf{ osmo\+\_\+apn\+\_\+qualify} (unsigned int mcc, unsigned int mnc, const char $\ast$ni)
\item 
char $\ast$ \textbf{ osmo\+\_\+apn\+\_\+qualify\+\_\+buf} (char $\ast$buf, size\+\_\+t buf\+\_\+len, unsigned int mcc, unsigned int mnc, const char $\ast$ni)
\item 
char $\ast$ \textbf{ osmo\+\_\+apn\+\_\+qualify\+\_\+c} (const void $\ast$ctx, unsigned int mcc, unsigned int mnc, const char $\ast$ni)
\item 
char $\ast$ \textbf{ osmo\+\_\+apn\+\_\+qualify\+\_\+from\+\_\+imsi} (const char $\ast$imsi, const char $\ast$ni, int have\+\_\+3dig\+\_\+mnc)
\item 
char $\ast$ \textbf{ osmo\+\_\+apn\+\_\+qualify\+\_\+from\+\_\+imsi\+\_\+buf} (char $\ast$buf, size\+\_\+t buf\+\_\+len, const char $\ast$imsi, const char $\ast$ni, int have\+\_\+3dig\+\_\+mnc)
\item 
char $\ast$ \textbf{ osmo\+\_\+apn\+\_\+qualify\+\_\+from\+\_\+imsi\+\_\+c} (const void $\ast$ctx, const char $\ast$imsi, const char $\ast$ni, int have\+\_\+3dig\+\_\+mnc)
\item 
int \textbf{ osmo\+\_\+apn\+\_\+from\+\_\+str} (uint8\+\_\+t $\ast$apn\+\_\+enc, size\+\_\+t max\+\_\+apn\+\_\+enc\+\_\+len, const char $\ast$str)
\begin{DoxyCompactList}\small\item\em Convert a dot-\/separated string into an encoded APN. \end{DoxyCompactList}\item 
char $\ast$ \textbf{ osmo\+\_\+apn\+\_\+to\+\_\+str} (char $\ast$out\+\_\+str, const uint8\+\_\+t $\ast$apn\+\_\+enc, size\+\_\+t apn\+\_\+enc\+\_\+len)
\begin{DoxyCompactList}\small\item\em Convert an encoded APN into a dot-\/separated string. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Macro Definition Documentation}
\mbox{\label{apn_8h_a752176a043b70601019fc64084d7f9b6}} 
\index{apn.h@{apn.h}!APN\_MAXLEN@{APN\_MAXLEN}}
\index{APN\_MAXLEN@{APN\_MAXLEN}!apn.h@{apn.h}}
\doxysubsubsection{APN\_MAXLEN}
{\footnotesize\ttfamily \#define APN\+\_\+\+MAXLEN~100}

\mbox{\label{apn_8h_a48839c4b0fd7b97c1ba5cc3fbf63421f}} 
\index{apn.h@{apn.h}!APN\_NI\_MAXLEN@{APN\_NI\_MAXLEN}}
\index{APN\_NI\_MAXLEN@{APN\_NI\_MAXLEN}!apn.h@{apn.h}}
\doxysubsubsection{APN\_NI\_MAXLEN}
{\footnotesize\ttfamily \#define APN\+\_\+\+NI\+\_\+\+MAXLEN~63}



\doxysubsection{Function Documentation}
\mbox{\label{apn_8h_a81077716204680020995012aaff14701}} 
\index{apn.h@{apn.h}!osmo\_apn\_from\_str@{osmo\_apn\_from\_str}}
\index{osmo\_apn\_from\_str@{osmo\_apn\_from\_str}!apn.h@{apn.h}}
\doxysubsubsection{osmo\_apn\_from\_str()}
{\footnotesize\ttfamily int osmo\+\_\+apn\+\_\+from\+\_\+str (\begin{DoxyParamCaption}\item[{uint8\+\_\+t $\ast$}]{apn\+\_\+enc,  }\item[{size\+\_\+t}]{max\+\_\+apn\+\_\+enc\+\_\+len,  }\item[{const char $\ast$}]{str }\end{DoxyParamCaption})}



Convert a dot-\/separated string into an encoded APN. 


\begin{DoxyParams}{Parameters}
{\em apn\+\_\+enc} & the encoded APN \\
\hline
{\em max\+\_\+apn\+\_\+enc\+\_\+len} & the size of the apn\+\_\+enc buffer \\
\hline
{\em str} & the source string\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
out\+\_\+str on success and NULL otherwise 
\end{DoxyReturn}


References \textbf{ len}.



Referenced by \textbf{ msgb\+\_\+sgsap\+\_\+name\+\_\+put()}.

\mbox{\label{apn_8h_a23cd8e247ea70ab10d7fa353a5f33cbd}} 
\index{apn.h@{apn.h}!osmo\_apn\_qualify@{osmo\_apn\_qualify}}
\index{osmo\_apn\_qualify@{osmo\_apn\_qualify}!apn.h@{apn.h}}
\doxysubsubsection{osmo\_apn\_qualify()}
{\footnotesize\ttfamily char $\ast$ osmo\+\_\+apn\+\_\+qualify (\begin{DoxyParamCaption}\item[{unsigned int}]{mcc,  }\item[{unsigned int}]{mnc,  }\item[{const char $\ast$}]{ni }\end{DoxyParamCaption})}



References \textbf{ apn\+\_\+strbuf}, and \textbf{ osmo\+\_\+apn\+\_\+qualify\+\_\+buf()}.

\mbox{\label{apn_8h_a7abad7fd6a1a9e69e4dc0bf3137f325b}} 
\index{apn.h@{apn.h}!osmo\_apn\_qualify\_buf@{osmo\_apn\_qualify\_buf}}
\index{osmo\_apn\_qualify\_buf@{osmo\_apn\_qualify\_buf}!apn.h@{apn.h}}
\doxysubsubsection{osmo\_apn\_qualify\_buf()}
{\footnotesize\ttfamily char $\ast$ osmo\+\_\+apn\+\_\+qualify\+\_\+buf (\begin{DoxyParamCaption}\item[{char $\ast$}]{buf,  }\item[{size\+\_\+t}]{buf\+\_\+len,  }\item[{unsigned int}]{mcc,  }\item[{unsigned int}]{mnc,  }\item[{const char $\ast$}]{ni }\end{DoxyParamCaption})}



References \textbf{ APN\+\_\+\+GPRS\+\_\+\+FMT}.



Referenced by \textbf{ osmo\+\_\+apn\+\_\+qualify()}, \textbf{ osmo\+\_\+apn\+\_\+qualify\+\_\+c()}, and \textbf{ osmo\+\_\+apn\+\_\+qualify\+\_\+from\+\_\+imsi\+\_\+buf()}.

\mbox{\label{apn_8h_a193fd496451dd011b5b3b771751a5eb2}} 
\index{apn.h@{apn.h}!osmo\_apn\_qualify\_c@{osmo\_apn\_qualify\_c}}
\index{osmo\_apn\_qualify\_c@{osmo\_apn\_qualify\_c}!apn.h@{apn.h}}
\doxysubsubsection{osmo\_apn\_qualify\_c()}
{\footnotesize\ttfamily char $\ast$ osmo\+\_\+apn\+\_\+qualify\+\_\+c (\begin{DoxyParamCaption}\item[{const void $\ast$}]{ctx,  }\item[{unsigned int}]{mcc,  }\item[{unsigned int}]{mnc,  }\item[{const char $\ast$}]{ni }\end{DoxyParamCaption})}



References \textbf{ APN\+\_\+\+MAXLEN}, and \textbf{ osmo\+\_\+apn\+\_\+qualify\+\_\+buf()}.

\mbox{\label{apn_8h_a2548cfc66eb8b32f53ee1eb61113d6c7}} 
\index{apn.h@{apn.h}!osmo\_apn\_qualify\_from\_imsi@{osmo\_apn\_qualify\_from\_imsi}}
\index{osmo\_apn\_qualify\_from\_imsi@{osmo\_apn\_qualify\_from\_imsi}!apn.h@{apn.h}}
\doxysubsubsection{osmo\_apn\_qualify\_from\_imsi()}
{\footnotesize\ttfamily char $\ast$ osmo\+\_\+apn\+\_\+qualify\+\_\+from\+\_\+imsi (\begin{DoxyParamCaption}\item[{const char $\ast$}]{imsi,  }\item[{const char $\ast$}]{ni,  }\item[{int}]{have\+\_\+3dig\+\_\+mnc }\end{DoxyParamCaption})}



References \textbf{ apn\+\_\+strbuf}, and \textbf{ osmo\+\_\+apn\+\_\+qualify\+\_\+from\+\_\+imsi\+\_\+buf()}.

\mbox{\label{apn_8h_a302e2b5dd95237db7cf2bb9ca0896fad}} 
\index{apn.h@{apn.h}!osmo\_apn\_qualify\_from\_imsi\_buf@{osmo\_apn\_qualify\_from\_imsi\_buf}}
\index{osmo\_apn\_qualify\_from\_imsi\_buf@{osmo\_apn\_qualify\_from\_imsi\_buf}!apn.h@{apn.h}}
\doxysubsubsection{osmo\_apn\_qualify\_from\_imsi\_buf()}
{\footnotesize\ttfamily char $\ast$ osmo\+\_\+apn\+\_\+qualify\+\_\+from\+\_\+imsi\+\_\+buf (\begin{DoxyParamCaption}\item[{char $\ast$}]{buf,  }\item[{size\+\_\+t}]{buf\+\_\+len,  }\item[{const char $\ast$}]{imsi,  }\item[{const char $\ast$}]{ni,  }\item[{int}]{have\+\_\+3dig\+\_\+mnc }\end{DoxyParamCaption})}



References \textbf{ osmo\+\_\+apn\+\_\+qualify\+\_\+buf()}.



Referenced by \textbf{ osmo\+\_\+apn\+\_\+qualify\+\_\+from\+\_\+imsi()}, and \textbf{ osmo\+\_\+apn\+\_\+qualify\+\_\+from\+\_\+imsi\+\_\+c()}.

\mbox{\label{apn_8h_a363a56411d9507ad14d863c0b098df6d}} 
\index{apn.h@{apn.h}!osmo\_apn\_qualify\_from\_imsi\_c@{osmo\_apn\_qualify\_from\_imsi\_c}}
\index{osmo\_apn\_qualify\_from\_imsi\_c@{osmo\_apn\_qualify\_from\_imsi\_c}!apn.h@{apn.h}}
\doxysubsubsection{osmo\_apn\_qualify\_from\_imsi\_c()}
{\footnotesize\ttfamily char $\ast$ osmo\+\_\+apn\+\_\+qualify\+\_\+from\+\_\+imsi\+\_\+c (\begin{DoxyParamCaption}\item[{const void $\ast$}]{ctx,  }\item[{const char $\ast$}]{imsi,  }\item[{const char $\ast$}]{ni,  }\item[{int}]{have\+\_\+3dig\+\_\+mnc }\end{DoxyParamCaption})}



References \textbf{ APN\+\_\+\+MAXLEN}, and \textbf{ osmo\+\_\+apn\+\_\+qualify\+\_\+from\+\_\+imsi\+\_\+buf()}.

\mbox{\label{apn_8h_a3067d001dd50c2b3ea720117d596f46d}} 
\index{apn.h@{apn.h}!osmo\_apn\_to\_str@{osmo\_apn\_to\_str}}
\index{osmo\_apn\_to\_str@{osmo\_apn\_to\_str}!apn.h@{apn.h}}
\doxysubsubsection{osmo\_apn\_to\_str()}
{\footnotesize\ttfamily char $\ast$ osmo\+\_\+apn\+\_\+to\+\_\+str (\begin{DoxyParamCaption}\item[{char $\ast$}]{out\+\_\+str,  }\item[{const uint8\+\_\+t $\ast$}]{apn\+\_\+enc,  }\item[{size\+\_\+t}]{apn\+\_\+enc\+\_\+len }\end{DoxyParamCaption})}



Convert an encoded APN into a dot-\/separated string. 


\begin{DoxyParams}{Parameters}
{\em out\+\_\+str} & the destination buffer (size must be $>$= max(app\+\_\+enc\+\_\+len,1)) \\
\hline
{\em apn\+\_\+enc} & the encoded APN \\
\hline
{\em apn\+\_\+enc\+\_\+len} & the length of the encoded APN\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
out\+\_\+str on success and NULL otherwise 
\end{DoxyReturn}
