\hypertarget{session__builder_8h}{}\section{src/session\+\_\+builder.h File Reference}
\label{session__builder_8h}\index{src/session\+\_\+builder.\+h@{src/session\+\_\+builder.\+h}}
{\ttfamily \#include $<$stdint.\+h$>$}\newline
{\ttfamily \#include \char`\"{}signal\+\_\+protocol\+\_\+types.\+h\char`\"{}}\newline
Include dependency graph for session\+\_\+builder.\+h\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=270pt]{session__builder_8h__incl}
\end{center}
\end{figure}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
int \hyperlink{session__builder_8h_ac21e975d8ddd4be36fe4f776e6fca67d}{session\+\_\+builder\+\_\+create} (\hyperlink{signal__protocol__types_8h_aa997098aa1a29dee93a0e9836abe9e26}{session\+\_\+builder} $\ast$$\ast$builder, \hyperlink{signal__protocol__types_8h_a407899f11766a172ae880601b8c3b4df}{signal\+\_\+protocol\+\_\+store\+\_\+context} $\ast$store, const \hyperlink{structsignal__protocol__address}{signal\+\_\+protocol\+\_\+address} $\ast$remote\+\_\+address, \hyperlink{structsignal__context}{signal\+\_\+context} $\ast$global\+\_\+context)
\item 
int \hyperlink{session__builder_8h_a082adee8735b34847b4822eaa7bbabf7}{session\+\_\+builder\+\_\+process\+\_\+pre\+\_\+key\+\_\+bundle} (\hyperlink{signal__protocol__types_8h_aa997098aa1a29dee93a0e9836abe9e26}{session\+\_\+builder} $\ast$builder, \hyperlink{signal__protocol__types_8h_a89e94e72d2c9d55af6381a126ea6d3f8}{session\+\_\+pre\+\_\+key\+\_\+bundle} $\ast$bundle)
\item 
void \hyperlink{session__builder_8h_ab4a4e9b60dd3966ece495e6c91dd9c57}{session\+\_\+builder\+\_\+free} (\hyperlink{signal__protocol__types_8h_aa997098aa1a29dee93a0e9836abe9e26}{session\+\_\+builder} $\ast$builder)
\end{DoxyCompactItemize}


\subsection{Function Documentation}
\mbox{\Hypertarget{session__builder_8h_ac21e975d8ddd4be36fe4f776e6fca67d}\label{session__builder_8h_ac21e975d8ddd4be36fe4f776e6fca67d}} 
\index{session\+\_\+builder.\+h@{session\+\_\+builder.\+h}!session\+\_\+builder\+\_\+create@{session\+\_\+builder\+\_\+create}}
\index{session\+\_\+builder\+\_\+create@{session\+\_\+builder\+\_\+create}!session\+\_\+builder.\+h@{session\+\_\+builder.\+h}}
\subsubsection{\texorpdfstring{session\+\_\+builder\+\_\+create()}{session\_builder\_create()}}
{\footnotesize\ttfamily int session\+\_\+builder\+\_\+create (\begin{DoxyParamCaption}\item[{\hyperlink{signal__protocol__types_8h_aa997098aa1a29dee93a0e9836abe9e26}{session\+\_\+builder} $\ast$$\ast$}]{builder,  }\item[{\hyperlink{signal__protocol__types_8h_a407899f11766a172ae880601b8c3b4df}{signal\+\_\+protocol\+\_\+store\+\_\+context} $\ast$}]{store,  }\item[{const \hyperlink{structsignal__protocol__address}{signal\+\_\+protocol\+\_\+address} $\ast$}]{remote\+\_\+address,  }\item[{\hyperlink{structsignal__context}{signal\+\_\+context} $\ast$}]{global\+\_\+context }\end{DoxyParamCaption})}

Constructs a session builder.

The store and global contexts must remain valid for the lifetime of the session builder.

When finished, free the returned instance by calling \hyperlink{session__builder_8h_ab4a4e9b60dd3966ece495e6c91dd9c57}{session\+\_\+builder\+\_\+free()}.


\begin{DoxyParams}{Parameters}
{\em builder} & set to a freshly allocated session builder instance \\
\hline
{\em store} & the signal\+\_\+protocol\+\_\+store\+\_\+context to store all state information in \\
\hline
{\em remote\+\_\+address} & the address of the remote user to build a session with \\
\hline
{\em global\+\_\+context} & the global library context \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 on success, or negative on failure 
\end{DoxyReturn}
\mbox{\Hypertarget{session__builder_8h_ab4a4e9b60dd3966ece495e6c91dd9c57}\label{session__builder_8h_ab4a4e9b60dd3966ece495e6c91dd9c57}} 
\index{session\+\_\+builder.\+h@{session\+\_\+builder.\+h}!session\+\_\+builder\+\_\+free@{session\+\_\+builder\+\_\+free}}
\index{session\+\_\+builder\+\_\+free@{session\+\_\+builder\+\_\+free}!session\+\_\+builder.\+h@{session\+\_\+builder.\+h}}
\subsubsection{\texorpdfstring{session\+\_\+builder\+\_\+free()}{session\_builder\_free()}}
{\footnotesize\ttfamily void session\+\_\+builder\+\_\+free (\begin{DoxyParamCaption}\item[{\hyperlink{signal__protocol__types_8h_aa997098aa1a29dee93a0e9836abe9e26}{session\+\_\+builder} $\ast$}]{builder }\end{DoxyParamCaption})}

\mbox{\Hypertarget{session__builder_8h_a082adee8735b34847b4822eaa7bbabf7}\label{session__builder_8h_a082adee8735b34847b4822eaa7bbabf7}} 
\index{session\+\_\+builder.\+h@{session\+\_\+builder.\+h}!session\+\_\+builder\+\_\+process\+\_\+pre\+\_\+key\+\_\+bundle@{session\+\_\+builder\+\_\+process\+\_\+pre\+\_\+key\+\_\+bundle}}
\index{session\+\_\+builder\+\_\+process\+\_\+pre\+\_\+key\+\_\+bundle@{session\+\_\+builder\+\_\+process\+\_\+pre\+\_\+key\+\_\+bundle}!session\+\_\+builder.\+h@{session\+\_\+builder.\+h}}
\subsubsection{\texorpdfstring{session\+\_\+builder\+\_\+process\+\_\+pre\+\_\+key\+\_\+bundle()}{session\_builder\_process\_pre\_key\_bundle()}}
{\footnotesize\ttfamily int session\+\_\+builder\+\_\+process\+\_\+pre\+\_\+key\+\_\+bundle (\begin{DoxyParamCaption}\item[{\hyperlink{signal__protocol__types_8h_aa997098aa1a29dee93a0e9836abe9e26}{session\+\_\+builder} $\ast$}]{builder,  }\item[{\hyperlink{signal__protocol__types_8h_a89e94e72d2c9d55af6381a126ea6d3f8}{session\+\_\+pre\+\_\+key\+\_\+bundle} $\ast$}]{bundle }\end{DoxyParamCaption})}

Build a new session from a session\+\_\+pre\+\_\+key\+\_\+bundle retrieved from a server.


\begin{DoxyParams}{Parameters}
{\em bundle} & A pre key bundle for the destination recipient, retrieved from a server. \\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em S\+G\+\_\+\+S\+U\+C\+C\+E\+SS} & Success \\
\hline
{\em S\+G\+\_\+\+E\+R\+R\+\_\+\+I\+N\+V\+A\+L\+I\+D\+\_\+\+K\+EY} & when the session\+\_\+pre\+\_\+key\+\_\+bundle is badly formatted. \\
\hline
{\em S\+G\+\_\+\+E\+R\+R\+\_\+\+U\+N\+T\+R\+U\+S\+T\+E\+D\+\_\+\+I\+D\+E\+N\+T\+I\+TY} & when the sender\textquotesingle{}s identity key is not trusted. \\
\hline
\end{DoxyRetVals}
