\doxysection{tun.\+h}
\label{tun_8h_source}\index{include/osmocom/core/tun.h@{include/osmocom/core/tun.h}}
\textbf{ Go to the documentation of this file.}
\begin{DoxyCode}{0}
\DoxyCodeLine{1 }
\DoxyCodeLine{4 \textcolor{preprocessor}{\#pragma once}}
\DoxyCodeLine{5 \textcolor{preprocessor}{\#if (!EMBEDDED)}}
\DoxyCodeLine{6 }
\DoxyCodeLine{7 \textcolor{preprocessor}{\#include <stddef.h>}}
\DoxyCodeLine{8 \textcolor{preprocessor}{\#include <stdint.h>}}
\DoxyCodeLine{9 }
\DoxyCodeLine{10 \textcolor{preprocessor}{\#include <osmocom/core/msgb.h>}}
\DoxyCodeLine{11 \textcolor{preprocessor}{\#include <osmocom/core/socket.h>}}
\DoxyCodeLine{12 \textcolor{preprocessor}{\#include <osmocom/core/netdev.h>}}
\DoxyCodeLine{13 }
\DoxyCodeLine{14 \textcolor{keyword}{struct }osmo\_tundev;}
\DoxyCodeLine{15 }
\DoxyCodeLine{16 \textcolor{comment}{/* callback user gets ownership of the msgb and is expected to free it. */}}
\DoxyCodeLine{17 \textcolor{keyword}{typedef} int (*osmo\_tundev\_data\_ind\_cb\_t)(\textcolor{keyword}{struct }osmo\_tundev *tun, \textcolor{keyword}{struct }msgb *msg);}
\DoxyCodeLine{18 }
\DoxyCodeLine{19 \textcolor{keyword}{struct }osmo\_tundev *osmo\_tundev\_alloc(\textcolor{keywordtype}{void} *ctx, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *name);}
\DoxyCodeLine{20 \textcolor{keywordtype}{void} osmo\_tundev\_free(\textcolor{keyword}{struct} osmo\_tundev *tundev);}
\DoxyCodeLine{21 \textcolor{keywordtype}{int} osmo\_tundev\_open(\textcolor{keyword}{struct} osmo\_tundev *tundev);}
\DoxyCodeLine{22 \textcolor{keywordtype}{int} osmo\_tundev\_close(\textcolor{keyword}{struct} osmo\_tundev *tundev);}
\DoxyCodeLine{23 \textcolor{keywordtype}{bool} osmo\_tundev\_is\_open(\textcolor{keyword}{struct} osmo\_tundev *tundev);}
\DoxyCodeLine{24 }
\DoxyCodeLine{25 \textcolor{keywordtype}{void} osmo\_tundev\_set\_priv\_data(\textcolor{keyword}{struct} osmo\_tundev *tundev, \textcolor{keywordtype}{void} *priv\_data);}
\DoxyCodeLine{26 \textcolor{keywordtype}{void} *osmo\_tundev\_get\_priv\_data(\textcolor{keyword}{struct} osmo\_tundev *tundev);}
\DoxyCodeLine{27 }
\DoxyCodeLine{28 \textcolor{keywordtype}{void} osmo\_tundev\_set\_data\_ind\_cb(\textcolor{keyword}{struct} osmo\_tundev *tundev, osmo\_tundev\_data\_ind\_cb\_t data\_ind\_cb);}
\DoxyCodeLine{29 }
\DoxyCodeLine{30 \textcolor{keyword}{const} \textcolor{keywordtype}{char} *osmo\_tundev\_get\_name(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_tundev *tundev);}
\DoxyCodeLine{31 }
\DoxyCodeLine{32 \textcolor{keywordtype}{int} osmo\_tundev\_get\_fd(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_tundev *tundev);}
\DoxyCodeLine{33 }
\DoxyCodeLine{34 \textcolor{keywordtype}{int} osmo\_tundev\_set\_dev\_name(\textcolor{keyword}{struct} osmo\_tundev *tundev, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *dev\_name);}
\DoxyCodeLine{35 \textcolor{keyword}{const} \textcolor{keywordtype}{char} *osmo\_tundev\_get\_dev\_name(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_tundev *tundev);}
\DoxyCodeLine{36 }
\DoxyCodeLine{37 \textcolor{keywordtype}{int} osmo\_tundev\_set\_netns\_name(\textcolor{keyword}{struct} osmo\_tundev *tundev, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *netns);}
\DoxyCodeLine{38 \textcolor{keyword}{const} \textcolor{keywordtype}{char} *osmo\_tundev\_get\_netns\_name(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_tundev *tundev);}
\DoxyCodeLine{39 }
\DoxyCodeLine{40 \textcolor{keyword}{struct }osmo\_netdev *osmo\_tundev\_get\_netdev(\textcolor{keyword}{struct} osmo\_tundev *tundev);}
\DoxyCodeLine{41 }
\DoxyCodeLine{42 \textcolor{keywordtype}{int} osmo\_tundev\_send(\textcolor{keyword}{struct} osmo\_tundev *tundev, \textcolor{keyword}{struct} msgb *msg);}
\DoxyCodeLine{43 }
\DoxyCodeLine{44 \textcolor{preprocessor}{\#endif }\textcolor{comment}{/* (!EMBEDDED) */}\textcolor{preprocessor}{}}

\end{DoxyCode}
