\doxysection{osmo\+\_\+io\+\_\+ops Struct Reference} \label{structosmo__io__ops}\index{osmo\_io\_ops@{osmo\_io\_ops}} {\ttfamily \#include $<$osmo\+\_\+io.\+h$>$} \doxysubsection*{Data Fields} \begin{DoxyCompactItemize} \item \begin{tabbing} xx\=xx\=xx\=xx\=xx\=xx\=xx\=xx\=xx\=\kill union \{\\ \>struct \{\\ \>\>void($\ast$ \textbf{ read\_cb} )(struct \textbf{ osmo\_io\_fd} $\ast$iofd, int \\ \>\>\>\textbf{ res}, struct \textbf{ msgb} $\ast$\textbf{ msg})\\ \>\>\>{\em call-\/back function when something was read from fd }\\ \>\>void($\ast$ \textbf{ write\_cb} )(struct \textbf{ osmo\_io\_fd} $\ast$iofd, int \\ \>\>\>\textbf{ res}, struct \textbf{ msgb} $\ast$\textbf{ msg})\\ \>\>\>{\em call-\/back function when write has completed on fd }\\ \>\>int($\ast$ \textbf{ segmentation\_cb} )(struct \textbf{ msgb} $\ast$\textbf{ msg})\\ \>\>\>{\em call-\/back function to segment the data at message boundaries. }\\ \>\} \\ \>struct \{\\ \>\>void($\ast$ \textbf{ recvfrom\_cb} )(struct \textbf{ osmo\_io\_fd} $\ast$iofd, int \\ \>\>\>\textbf{ res}, struct \textbf{ msgb} $\ast$\textbf{ msg}, const \\ \>\>\>struct \textbf{ osmo\_sockaddr} $\ast$saddr)\\ \>\>\>{\em call-\/back function emulating recvfrom }\\ \>\>void($\ast$ \textbf{ sendto\_cb} )(struct \textbf{ osmo\_io\_fd} $\ast$iofd, int \\ \>\>\>\textbf{ res}, struct \textbf{ msgb} $\ast$\textbf{ msg}, const \\ \>\>\>struct \textbf{ osmo\_sockaddr} $\ast$daddr)\\ \>\>\>{\em call-\/back function emulating sendto }\\ \>\} \\ \}; \\ \end{tabbing}\end{DoxyCompactItemize} \doxysubsection{Field Documentation} \mbox{\label{structosmo__io__ops_a72c4ef6c99982271902c626b41da7698}} \doxysubsubsection{} {\footnotesize\ttfamily union \{ ... \} osmo\+\_\+io\+\_\+ops\+::@19} \mbox{\label{structosmo__io__ops_a0d6ea2f2d5398d1c81f4195be3f1ee13}} \index{osmo\_io\_ops@{osmo\_io\_ops}!read\_cb@{read\_cb}} \index{read\_cb@{read\_cb}!osmo\_io\_ops@{osmo\_io\_ops}} \doxysubsubsection{read\_cb} {\footnotesize\ttfamily void($\ast$ osmo\+\_\+io\+\_\+ops\+::read\+\_\+cb) (struct \textbf{ osmo\+\_\+io\+\_\+fd} $\ast$iofd, int \textbf{ res}, struct \textbf{ msgb} $\ast$\textbf{ msg})} call-\/back function when something was read from fd \mbox{\label{structosmo__io__ops_a164b855a40443b2b47463be771e58552}} \index{osmo\_io\_ops@{osmo\_io\_ops}!recvfrom\_cb@{recvfrom\_cb}} \index{recvfrom\_cb@{recvfrom\_cb}!osmo\_io\_ops@{osmo\_io\_ops}} \doxysubsubsection{recvfrom\_cb} {\footnotesize\ttfamily void($\ast$ osmo\+\_\+io\+\_\+ops\+::recvfrom\+\_\+cb) (struct \textbf{ osmo\+\_\+io\+\_\+fd} $\ast$iofd, int \textbf{ res}, struct \textbf{ msgb} $\ast$\textbf{ msg}, const struct \textbf{ osmo\+\_\+sockaddr} $\ast$saddr)} call-\/back function emulating recvfrom \mbox{\label{structosmo__io__ops_afbe74fab87f1f05e6fe55704b85e8dd9}} \index{osmo\_io\_ops@{osmo\_io\_ops}!segmentation\_cb@{segmentation\_cb}} \index{segmentation\_cb@{segmentation\_cb}!osmo\_io\_ops@{osmo\_io\_ops}} \doxysubsubsection{segmentation\_cb} {\footnotesize\ttfamily int($\ast$ osmo\+\_\+io\+\_\+ops\+::segmentation\+\_\+cb) (struct \textbf{ msgb} $\ast$\textbf{ msg})} call-\/back function to segment the data at message boundaries. Needs to return the size of the next message. If it returns -\/EAGAIN or a value larger than \doxyref{msgb\+\_\+length()}{p.}{group__msgb_ga036077cd924b90a798cb3b6c5541a492} (message is incomplete) osmo\+\_\+io will wait for more data to be read. Other negative values cause the msg to be discarded. If a full message was received (\doxyref{segmentation\+\_\+cb()}{p.}{structosmo__io__ops_afbe74fab87f1f05e6fe55704b85e8dd9} returns a value $<$= \doxyref{msgb\+\_\+length()}{p.}{group__msgb_ga036077cd924b90a798cb3b6c5541a492}) the msgb will be trimmed to size by osmo\+\_\+io and forwarded to the read call-\/back. Any parsing done to the msgb by \doxyref{segmentation\+\_\+cb()}{p.}{structosmo__io__ops_afbe74fab87f1f05e6fe55704b85e8dd9} will be preserved for the \doxyref{read\+\_\+cb()}{p.}{structosmo__io__ops_a0d6ea2f2d5398d1c81f4195be3f1ee13} (e.\+g. setting lxh or msgb-\/$>$cb). \mbox{\label{structosmo__io__ops_a76d3bb8b0f08a19a08c91e8a8949329f}} \index{osmo\_io\_ops@{osmo\_io\_ops}!sendto\_cb@{sendto\_cb}} \index{sendto\_cb@{sendto\_cb}!osmo\_io\_ops@{osmo\_io\_ops}} \doxysubsubsection{sendto\_cb} {\footnotesize\ttfamily void($\ast$ osmo\+\_\+io\+\_\+ops\+::sendto\+\_\+cb) (struct \textbf{ osmo\+\_\+io\+\_\+fd} $\ast$iofd, int \textbf{ res}, struct \textbf{ msgb} $\ast$\textbf{ msg}, const struct \textbf{ osmo\+\_\+sockaddr} $\ast$daddr)} call-\/back function emulating sendto \mbox{\label{structosmo__io__ops_a667c25d83ee279b51562cd1b80794c10}} \index{osmo\_io\_ops@{osmo\_io\_ops}!write\_cb@{write\_cb}} \index{write\_cb@{write\_cb}!osmo\_io\_ops@{osmo\_io\_ops}} \doxysubsubsection{write\_cb} {\footnotesize\ttfamily void($\ast$ osmo\+\_\+io\+\_\+ops\+::write\+\_\+cb) (struct \textbf{ osmo\+\_\+io\+\_\+fd} $\ast$iofd, int \textbf{ res}, struct \textbf{ msgb} $\ast$\textbf{ msg})} call-\/back function when write has completed on fd The documentation for this struct was generated from the following file\+:\begin{DoxyCompactItemize} \item include/osmocom/core/\textbf{ osmo\+\_\+io.\+h}\end{DoxyCompactItemize}