libwebsockets/doc/latex/group__extensions.tex
2016-07-14 08:57:28 +08:00

293 lines
19 KiB
TeX

\hypertarget{group__extensions}{}\section{Extensions}
\label{group__extensions}\index{Extensions@{Extensions}}
\subsection*{Data Structures}
\begin{DoxyCompactItemize}
\item
struct \hyperlink{structlws__ext__options}{lws\+\_\+ext\+\_\+options}
\item
struct \hyperlink{structlws__ext__option__arg}{lws\+\_\+ext\+\_\+option\+\_\+arg}
\item
struct \hyperlink{structlws__extension}{lws\+\_\+extension}
\end{DoxyCompactItemize}
\subsection*{Typedefs}
\begin{DoxyCompactItemize}
\item
typedef int \hyperlink{group__extensions_gaae7169b2cd346b34fa33d0250db2afd0}{lws\+\_\+extension\+\_\+callback\+\_\+function}(struct lws\+\_\+context $\ast$context, const struct \hyperlink{structlws__extension}{lws\+\_\+extension} $\ast$ext, struct lws $\ast$wsi, enum lws\+\_\+extension\+\_\+callback\+\_\+reasons reason, void $\ast$user, void $\ast$in, size\+\_\+t len)
\end{DoxyCompactItemize}
\subsection*{Enumerations}
\begin{DoxyCompactItemize}
\item
enum {\bfseries lws\+\_\+extension\+\_\+callback\+\_\+reasons} \{ \\*
{\bfseries L\+W\+S\+\_\+\+E\+X\+T\+\_\+\+C\+B\+\_\+\+S\+E\+R\+V\+E\+R\+\_\+\+C\+O\+N\+T\+E\+X\+T\+\_\+\+C\+O\+N\+S\+T\+R\+U\+CT} = 0,
{\bfseries L\+W\+S\+\_\+\+E\+X\+T\+\_\+\+C\+B\+\_\+\+C\+L\+I\+E\+N\+T\+\_\+\+C\+O\+N\+T\+E\+X\+T\+\_\+\+C\+O\+N\+S\+T\+R\+U\+CT} = 1,
{\bfseries L\+W\+S\+\_\+\+E\+X\+T\+\_\+\+C\+B\+\_\+\+S\+E\+R\+V\+E\+R\+\_\+\+C\+O\+N\+T\+E\+X\+T\+\_\+\+D\+E\+S\+T\+R\+U\+CT} = 2,
{\bfseries L\+W\+S\+\_\+\+E\+X\+T\+\_\+\+C\+B\+\_\+\+C\+L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+\+C\+B\+\_\+\+P\+A\+Y\+L\+O\+A\+D\+\_\+\+RX} = 22,
{\bfseries L\+W\+S\+\_\+\+E\+X\+T\+\_\+\+C\+B\+\_\+\+O\+P\+T\+I\+O\+N\+\_\+\+D\+E\+F\+A\+U\+LT} = 23,
\\*
{\bfseries L\+W\+S\+\_\+\+E\+X\+T\+\_\+\+C\+B\+\_\+\+O\+P\+T\+I\+O\+N\+\_\+\+S\+ET} = 24,
{\bfseries L\+W\+S\+\_\+\+E\+X\+T\+\_\+\+C\+B\+\_\+\+O\+P\+T\+I\+O\+N\+\_\+\+C\+O\+N\+F\+I\+RM} = 25,
{\bfseries L\+W\+S\+\_\+\+E\+X\+T\+\_\+\+C\+B\+\_\+\+N\+A\+M\+E\+D\+\_\+\+O\+P\+T\+I\+O\+N\+\_\+\+S\+ET} = 26
\}\hypertarget{group__extensions_gae9993815eee72c6070300a0ae2f022d7}{}\label{group__extensions_gae9993815eee72c6070300a0ae2f022d7}
\item
enum \hyperlink{group__extensions_gacc9f55936dc165257a2e1f7d47bce89e}{lws\+\_\+ext\+\_\+options\+\_\+types} \{ \hyperlink{group__extensions_ggacc9f55936dc165257a2e1f7d47bce89eaabcf56c456c1ff6e81dc82586a16f14c}{E\+X\+T\+A\+R\+G\+\_\+\+N\+O\+NE},
\hyperlink{group__extensions_ggacc9f55936dc165257a2e1f7d47bce89ea1c86adf924c8786a12bee9687094673e}{E\+X\+T\+A\+R\+G\+\_\+\+D\+EC},
\hyperlink{group__extensions_ggacc9f55936dc165257a2e1f7d47bce89ea5265abe3e1c3f64412f2affe7bffd880}{E\+X\+T\+A\+R\+G\+\_\+\+O\+P\+T\+\_\+\+D\+EC}
\}
\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item
L\+W\+S\+\_\+\+V\+I\+S\+I\+B\+LE L\+W\+S\+\_\+\+E\+X\+T\+E\+RN int \hyperlink{group__extensions_gae0e24e1768f83a7fb07896ce975704b9}{lws\+\_\+set\+\_\+extension\+\_\+option} (struct lws $\ast$wsi, const char $\ast$ext\+\_\+name, const char $\ast$opt\+\_\+name, const char $\ast$opt\+\_\+val)
\item
L\+W\+S\+\_\+\+V\+I\+S\+I\+B\+LE L\+W\+S\+\_\+\+E\+X\+T\+E\+RN int L\+W\+S\+\_\+\+W\+A\+R\+N\+\_\+\+U\+N\+U\+S\+E\+D\+\_\+\+R\+E\+S\+U\+LT \hyperlink{group__extensions_ga6fb3e2c3dfb9d64dc87026a4e99c128b}{lws\+\_\+ext\+\_\+parse\+\_\+options} (const struct \hyperlink{structlws__extension}{lws\+\_\+extension} $\ast$ext, struct lws $\ast$wsi, void $\ast$ext\+\_\+user, const struct \hyperlink{structlws__ext__options}{lws\+\_\+ext\+\_\+options} $\ast$opts, const char $\ast$o, int len)
\item
L\+W\+S\+\_\+\+E\+X\+T\+E\+RN int \hyperlink{group__extensions_ga4cdbe42d872e21a448a947714d6c607e}{lws\+\_\+extension\+\_\+callback\+\_\+pm\+\_\+deflate} (struct lws\+\_\+context $\ast$context, const struct \hyperlink{structlws__extension}{lws\+\_\+extension} $\ast$ext, struct lws $\ast$wsi, enum lws\+\_\+extension\+\_\+callback\+\_\+reasons reason, void $\ast$user, void $\ast$in, size\+\_\+t len)
\end{DoxyCompactItemize}
\subsection{Detailed Description}
\subsubsection*{Extension releated functions}
Ws defines optional extensions, lws provides the ability to implement these in user code if so desired.
We provide one extensions permessage-\/deflate.
\subsection{Typedef Documentation}
\index{Extensions@{Extensions}!lws\+\_\+extension\+\_\+callback\+\_\+function@{lws\+\_\+extension\+\_\+callback\+\_\+function}}
\index{lws\+\_\+extension\+\_\+callback\+\_\+function@{lws\+\_\+extension\+\_\+callback\+\_\+function}!Extensions@{Extensions}}
\subsubsection[{\texorpdfstring{lws\+\_\+extension\+\_\+callback\+\_\+function}{lws\_extension\_callback\_function}}]{\setlength{\rightskip}{0pt plus 5cm}typedef int lws\+\_\+extension\+\_\+callback\+\_\+function(struct lws\+\_\+context $\ast$context, const struct {\bf lws\+\_\+extension} $\ast$ext, struct lws $\ast$wsi, enum lws\+\_\+extension\+\_\+callback\+\_\+reasons reason, void $\ast$user, void $\ast$in, size\+\_\+t len)}\hypertarget{group__extensions_gaae7169b2cd346b34fa33d0250db2afd0}{}\label{group__extensions_gaae7169b2cd346b34fa33d0250db2afd0}
{\ttfamily \#include $<$\hyperlink{libwebsockets_8h}{lib/libwebsockets.\+h}$>$}
typedef \hyperlink{group__extensions_gaae7169b2cd346b34fa33d0250db2afd0}{lws\+\_\+extension\+\_\+callback\+\_\+function()} -\/ Hooks to allow extensions to operate
\begin{DoxyParams}{Parameters}
{\em context} & Websockets context \\
\hline
{\em ext} & This extension \\
\hline
{\em wsi} & Opaque websocket instance pointer \\
\hline
{\em reason} & The reason for the call \\
\hline
{\em user} & Pointer to ptr to per-\/session user data allocated by library \\
\hline
{\em in} & Pointer used for some callback reasons \\
\hline
{\em len} & Length set for some callback reasons \begin{DoxyVerb} Each extension that is active on a particular connection receives
callbacks during the connection lifetime to allow the extension to
operate on websocket data and manage itself.
Libwebsockets takes care of allocating and freeing "user" memory for
each active extension on each connection. That is what is pointed to
by the user parameter.
LWS_EXT_CB_CONSTRUCT: called when the server has decided to
select this extension from the list provided by the client,
just before the server will send back the handshake accepting
the connection with this extension active. This gives the
extension a chance to initialize its connection context found
in user.
LWS_EXT_CB_CLIENT_CONSTRUCT: same as LWS_EXT_CB_CONSTRUCT
but called when client is instantiating this extension. Some
extensions will work the same on client and server side and then
you can just merge handlers for both CONSTRUCTS.
LWS_EXT_CB_DESTROY: called when the connection the extension was
being used on is about to be closed and deallocated. It's the
last chance for the extension to deallocate anything it has
allocated in the user data (pointed to by user) before the
user data is deleted. This same callback is used whether you
are in client or server instantiation context.
LWS_EXT_CB_PACKET_RX_PREPARSE: when this extension was active on
a connection, and a packet of data arrived at the connection,
it is passed to this callback to give the extension a chance to
change the data, eg, decompress it. user is pointing to the
extension's private connection context data, in is pointing
to an lws_tokens struct, it consists of a char * pointer called
token, and an int called token_len. At entry, these are
set to point to the received buffer and set to the content
length. If the extension will grow the content, it should use
a new buffer allocated in its private user context data and
set the pointed-to lws_tokens members to point to its buffer.
LWS_EXT_CB_PACKET_TX_PRESEND: this works the same way as
LWS_EXT_CB_PACKET_RX_PREPARSE above, except it gives the
extension a chance to change websocket data just before it will
be sent out. Using the same lws_token pointer scheme in in,
the extension can change the buffer and the length to be
transmitted how it likes. Again if it wants to grow the
buffer safely, it should copy the data into its own buffer and
set the lws_tokens token pointer to it.
LWS_EXT_CB_ARGS_VALIDATE:\end{DoxyVerb}
\\
\hline
\end{DoxyParams}
\subsection{Enumeration Type Documentation}
\index{Extensions@{Extensions}!lws\+\_\+ext\+\_\+options\+\_\+types@{lws\+\_\+ext\+\_\+options\+\_\+types}}
\index{lws\+\_\+ext\+\_\+options\+\_\+types@{lws\+\_\+ext\+\_\+options\+\_\+types}!Extensions@{Extensions}}
\subsubsection[{\texorpdfstring{lws\+\_\+ext\+\_\+options\+\_\+types}{lws\_ext\_options\_types}}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf lws\+\_\+ext\+\_\+options\+\_\+types}}\hypertarget{group__extensions_gacc9f55936dc165257a2e1f7d47bce89e}{}\label{group__extensions_gacc9f55936dc165257a2e1f7d47bce89e}
{\ttfamily \#include $<$\hyperlink{libwebsockets_8h}{lib/libwebsockets.\+h}$>$}
enum lws\+\_\+ext\+\_\+options\+\_\+types \begin{Desc}
\item[Enumerator]\par
\begin{description}
\index{E\+X\+T\+A\+R\+G\+\_\+\+N\+O\+NE@{E\+X\+T\+A\+R\+G\+\_\+\+N\+O\+NE}!Extensions@{Extensions}}\index{Extensions@{Extensions}!E\+X\+T\+A\+R\+G\+\_\+\+N\+O\+NE@{E\+X\+T\+A\+R\+G\+\_\+\+N\+O\+NE}}\item[{\em
E\+X\+T\+A\+R\+G\+\_\+\+N\+O\+NE\hypertarget{group__extensions_ggacc9f55936dc165257a2e1f7d47bce89eaabcf56c456c1ff6e81dc82586a16f14c}{}\label{group__extensions_ggacc9f55936dc165257a2e1f7d47bce89eaabcf56c456c1ff6e81dc82586a16f14c}
}]does not take an argument \index{E\+X\+T\+A\+R\+G\+\_\+\+D\+EC@{E\+X\+T\+A\+R\+G\+\_\+\+D\+EC}!Extensions@{Extensions}}\index{Extensions@{Extensions}!E\+X\+T\+A\+R\+G\+\_\+\+D\+EC@{E\+X\+T\+A\+R\+G\+\_\+\+D\+EC}}\item[{\em
E\+X\+T\+A\+R\+G\+\_\+\+D\+EC\hypertarget{group__extensions_ggacc9f55936dc165257a2e1f7d47bce89ea1c86adf924c8786a12bee9687094673e}{}\label{group__extensions_ggacc9f55936dc165257a2e1f7d47bce89ea1c86adf924c8786a12bee9687094673e}
}]requires a decimal argument \index{E\+X\+T\+A\+R\+G\+\_\+\+O\+P\+T\+\_\+\+D\+EC@{E\+X\+T\+A\+R\+G\+\_\+\+O\+P\+T\+\_\+\+D\+EC}!Extensions@{Extensions}}\index{Extensions@{Extensions}!E\+X\+T\+A\+R\+G\+\_\+\+O\+P\+T\+\_\+\+D\+EC@{E\+X\+T\+A\+R\+G\+\_\+\+O\+P\+T\+\_\+\+D\+EC}}\item[{\em
E\+X\+T\+A\+R\+G\+\_\+\+O\+P\+T\+\_\+\+D\+EC\hypertarget{group__extensions_ggacc9f55936dc165257a2e1f7d47bce89ea5265abe3e1c3f64412f2affe7bffd880}{}\label{group__extensions_ggacc9f55936dc165257a2e1f7d47bce89ea5265abe3e1c3f64412f2affe7bffd880}
}]may have an optional decimal argument \end{description}
\end{Desc}
\begin{DoxyCode}
<<<<<<< current
995 \{
996 \hyperlink{group__extensions_ggacc9f55936dc165257a2e1f7d47bce89eaabcf56c456c1ff6e81dc82586a16f14c}{EXTARG\_NONE},
997 \hyperlink{group__extensions_ggacc9f55936dc165257a2e1f7d47bce89ea1c86adf924c8786a12bee9687094673e}{EXTARG\_DEC},
998 \hyperlink{group__extensions_ggacc9f55936dc165257a2e1f7d47bce89ea5265abe3e1c3f64412f2affe7bffd880}{EXTARG\_OPT\_DEC}
1000 \textcolor{comment}{/* Add new things just above here ---^}
1001 \textcolor{comment}{ * This is part of the ABI, don't needlessly break compatibility */}
1002 \};
=======
994 \{
995 \hyperlink{group__extensions_ggacc9f55936dc165257a2e1f7d47bce89eaabcf56c456c1ff6e81dc82586a16f14c}{EXTARG\_NONE},
996 \hyperlink{group__extensions_ggacc9f55936dc165257a2e1f7d47bce89ea1c86adf924c8786a12bee9687094673e}{EXTARG\_DEC},
997 \hyperlink{group__extensions_ggacc9f55936dc165257a2e1f7d47bce89ea5265abe3e1c3f64412f2affe7bffd880}{EXTARG\_OPT\_DEC}
999 \textcolor{comment}{/* Add new things just above here ---^}
1000 \textcolor{comment}{ * This is part of the ABI, don't needlessly break compatibility */}
1001 \};
>>>>>>> patched
\end{DoxyCode}
\subsection{Function Documentation}
\index{Extensions@{Extensions}!lws\+\_\+ext\+\_\+parse\+\_\+options@{lws\+\_\+ext\+\_\+parse\+\_\+options}}
\index{lws\+\_\+ext\+\_\+parse\+\_\+options@{lws\+\_\+ext\+\_\+parse\+\_\+options}!Extensions@{Extensions}}
\subsubsection[{\texorpdfstring{lws\+\_\+ext\+\_\+parse\+\_\+options(const struct lws\+\_\+extension $\ast$ext, struct lws $\ast$wsi, void $\ast$ext\+\_\+user, const struct lws\+\_\+ext\+\_\+options $\ast$opts, const char $\ast$o, int len)}{lws\_ext\_parse\_options(const struct lws\_extension *ext, struct lws *wsi, void *ext\_user, const struct lws\_ext\_options *opts, const char *o, int len)}}]{\setlength{\rightskip}{0pt plus 5cm}L\+W\+S\+\_\+\+V\+I\+S\+I\+B\+LE L\+W\+S\+\_\+\+E\+X\+T\+E\+RN int L\+W\+S\+\_\+\+W\+A\+R\+N\+\_\+\+U\+N\+U\+S\+E\+D\+\_\+\+R\+E\+S\+U\+LT lws\+\_\+ext\+\_\+parse\+\_\+options (
\begin{DoxyParamCaption}
\item[{const struct {\bf lws\+\_\+extension} $\ast$}]{ext, }
\item[{struct lws $\ast$}]{wsi, }
\item[{void $\ast$}]{ext\+\_\+user, }
\item[{const struct {\bf lws\+\_\+ext\+\_\+options} $\ast$}]{opts, }
\item[{const char $\ast$}]{o, }
\item[{int}]{len}
\end{DoxyParamCaption}
)}\hypertarget{group__extensions_ga6fb3e2c3dfb9d64dc87026a4e99c128b}{}\label{group__extensions_ga6fb3e2c3dfb9d64dc87026a4e99c128b}
{\ttfamily \#include $<$\hyperlink{libwebsockets_8h}{lib/libwebsockets.\+h}$>$}
\hyperlink{group__extensions_ga6fb3e2c3dfb9d64dc87026a4e99c128b}{lws\+\_\+ext\+\_\+parse\+\_\+options()} -\/ deal with parsing negotiated extension options
\begin{DoxyParams}{Parameters}
{\em ext} & related extension struct \\
\hline
{\em wsi} & websocket connection \\
\hline
{\em ext\+\_\+user} & per-\/connection extension private data \\
\hline
{\em opts} & list of supported options \\
\hline
{\em o} & option string to parse \\
\hline
{\em len} & length \\
\hline
\end{DoxyParams}
\index{Extensions@{Extensions}!lws\+\_\+extension\+\_\+callback\+\_\+pm\+\_\+deflate@{lws\+\_\+extension\+\_\+callback\+\_\+pm\+\_\+deflate}}
\index{lws\+\_\+extension\+\_\+callback\+\_\+pm\+\_\+deflate@{lws\+\_\+extension\+\_\+callback\+\_\+pm\+\_\+deflate}!Extensions@{Extensions}}
\subsubsection[{\texorpdfstring{lws\+\_\+extension\+\_\+callback\+\_\+pm\+\_\+deflate(struct lws\+\_\+context $\ast$context, const struct lws\+\_\+extension $\ast$ext, struct lws $\ast$wsi, enum lws\+\_\+extension\+\_\+callback\+\_\+reasons reason, void $\ast$user, void $\ast$in, size\+\_\+t len)}{lws\_extension\_callback\_pm\_deflate(struct lws\_context *context, const struct lws\_extension *ext, struct lws *wsi, enum lws\_extension\_callback\_reasons reason, void *user, void *in, size\_t len)}}]{\setlength{\rightskip}{0pt plus 5cm}L\+W\+S\+\_\+\+E\+X\+T\+E\+RN int lws\+\_\+extension\+\_\+callback\+\_\+pm\+\_\+deflate (
\begin{DoxyParamCaption}
\item[{struct lws\+\_\+context $\ast$}]{context, }
\item[{const struct {\bf lws\+\_\+extension} $\ast$}]{ext, }
\item[{struct lws $\ast$}]{wsi, }
\item[{enum lws\+\_\+extension\+\_\+callback\+\_\+reasons}]{reason, }
\item[{void $\ast$}]{user, }
\item[{void $\ast$}]{in, }
\item[{size\+\_\+t}]{len}
\end{DoxyParamCaption}
)}\hypertarget{group__extensions_ga4cdbe42d872e21a448a947714d6c607e}{}\label{group__extensions_ga4cdbe42d872e21a448a947714d6c607e}
{\ttfamily \#include $<$\hyperlink{libwebsockets_8h}{lib/libwebsockets.\+h}$>$}
\hyperlink{group__extensions_ga4cdbe42d872e21a448a947714d6c607e}{lws\+\_\+extension\+\_\+callback\+\_\+pm\+\_\+deflate()} -\/ extension for R\+F\+C7692
\begin{DoxyParams}{Parameters}
{\em context} & lws context \\
\hline
{\em ext} & related \hyperlink{structlws__extension}{lws\+\_\+extension} struct \\
\hline
{\em wsi} & websocket connection \\
\hline
{\em reason} & incoming callback reason \\
\hline
{\em user} & per-\/connection extension private data \\
\hline
{\em in} & pointer parameter \\
\hline
{\em len} & length parameter\\
\hline
\end{DoxyParams}
Built-\/in callback implementing R\+F\+C7692 permessage-\/deflate \index{Extensions@{Extensions}!lws\+\_\+set\+\_\+extension\+\_\+option@{lws\+\_\+set\+\_\+extension\+\_\+option}}
\index{lws\+\_\+set\+\_\+extension\+\_\+option@{lws\+\_\+set\+\_\+extension\+\_\+option}!Extensions@{Extensions}}
\subsubsection[{\texorpdfstring{lws\+\_\+set\+\_\+extension\+\_\+option(struct lws $\ast$wsi, const char $\ast$ext\+\_\+name, const char $\ast$opt\+\_\+name, const char $\ast$opt\+\_\+val)}{lws\_set\_extension\_option(struct lws *wsi, const char *ext\_name, const char *opt\_name, const char *opt\_val)}}]{\setlength{\rightskip}{0pt plus 5cm}L\+W\+S\+\_\+\+V\+I\+S\+I\+B\+LE L\+W\+S\+\_\+\+E\+X\+T\+E\+RN int lws\+\_\+set\+\_\+extension\+\_\+option (
\begin{DoxyParamCaption}
\item[{struct lws $\ast$}]{wsi, }
\item[{const char $\ast$}]{ext\+\_\+name, }
\item[{const char $\ast$}]{opt\+\_\+name, }
\item[{const char $\ast$}]{opt\+\_\+val}
\end{DoxyParamCaption}
)}\hypertarget{group__extensions_gae0e24e1768f83a7fb07896ce975704b9}{}\label{group__extensions_gae0e24e1768f83a7fb07896ce975704b9}
{\ttfamily \#include $<$\hyperlink{libwebsockets_8h}{lib/libwebsockets.\+h}$>$}
\hyperlink{group__extensions_gae0e24e1768f83a7fb07896ce975704b9}{lws\+\_\+set\+\_\+extension\+\_\+option()}\+: set extension option if possible
\begin{DoxyParams}{Parameters}
{\em wsi} & websocket connection \\
\hline
{\em ext\+\_\+name} & name of ext, like \char`\"{}permessage-\/deflate\char`\"{} \\
\hline
{\em opt\+\_\+name} & name of option, like \char`\"{}rx\+\_\+buf\+\_\+size\char`\"{} \\
\hline
{\em opt\+\_\+val} & value to set option to \\
\hline
\end{DoxyParams}