\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 }
\DoxyCodeLine{6 \textcolor{preprocessor}{\#include <stddef.h>}}
\DoxyCodeLine{7 \textcolor{preprocessor}{\#include <stdint.h>}}
\DoxyCodeLine{8 }
\DoxyCodeLine{9 \textcolor{preprocessor}{\#include <osmocom/core/msgb.h>}}
\DoxyCodeLine{10 \textcolor{preprocessor}{\#include <osmocom/core/socket.h>}}
\DoxyCodeLine{11 \textcolor{preprocessor}{\#include <osmocom/core/netdev.h>}}
\DoxyCodeLine{12 }
\DoxyCodeLine{13 \textcolor{keyword}{struct }osmo\_tundev;}
\DoxyCodeLine{14 }
\DoxyCodeLine{15 \textcolor{comment}{/* callback user gets ownership of the msgb and is expected to free it. */}}
\DoxyCodeLine{16 \textcolor{keyword}{typedef} int (*osmo\_tundev\_data\_ind\_cb\_t)(\textcolor{keyword}{struct }osmo\_tundev *tun, \textcolor{keyword}{struct }msgb *msg);}
\DoxyCodeLine{17 }
\DoxyCodeLine{18 \textcolor{keyword}{struct }osmo\_tundev *osmo\_tundev\_alloc(\textcolor{keywordtype}{void} *ctx, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *name);}
\DoxyCodeLine{19 \textcolor{keywordtype}{void} osmo\_tundev\_free(\textcolor{keyword}{struct} osmo\_tundev *tundev);}
\DoxyCodeLine{20 \textcolor{keywordtype}{int} osmo\_tundev\_open(\textcolor{keyword}{struct} osmo\_tundev *tundev);}
\DoxyCodeLine{21 \textcolor{keywordtype}{int} osmo\_tundev\_close(\textcolor{keyword}{struct} osmo\_tundev *tundev);}
\DoxyCodeLine{22 \textcolor{keywordtype}{bool} osmo\_tundev\_is\_open(\textcolor{keyword}{struct} osmo\_tundev *tundev);}
\DoxyCodeLine{23 }
\DoxyCodeLine{24 \textcolor{keywordtype}{void} osmo\_tundev\_set\_priv\_data(\textcolor{keyword}{struct} osmo\_tundev *tundev, \textcolor{keywordtype}{void} *priv\_data);}
\DoxyCodeLine{25 \textcolor{keywordtype}{void} *osmo\_tundev\_get\_priv\_data(\textcolor{keyword}{struct} osmo\_tundev *tundev);}
\DoxyCodeLine{26 }
\DoxyCodeLine{27 \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{28 }
\DoxyCodeLine{29 \textcolor{keyword}{const} \textcolor{keywordtype}{char} *osmo\_tundev\_get\_name(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_tundev *tundev);}
\DoxyCodeLine{30 }
\DoxyCodeLine{31 \textcolor{keywordtype}{int} osmo\_tundev\_get\_fd(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_tundev *tundev);}
\DoxyCodeLine{32 }
\DoxyCodeLine{33 \textcolor{keywordtype}{int} osmo\_tundev\_set\_dev\_name(\textcolor{keyword}{struct} osmo\_tundev *tundev, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *dev\_name);}
\DoxyCodeLine{34 \textcolor{keyword}{const} \textcolor{keywordtype}{char} *osmo\_tundev\_get\_dev\_name(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_tundev *tundev);}
\DoxyCodeLine{35 }
\DoxyCodeLine{36 \textcolor{keywordtype}{int} osmo\_tundev\_set\_netns\_name(\textcolor{keyword}{struct} osmo\_tundev *tundev, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *netns);}
\DoxyCodeLine{37 \textcolor{keyword}{const} \textcolor{keywordtype}{char} *osmo\_tundev\_get\_netns\_name(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_tundev *tundev);}
\DoxyCodeLine{38 }
\DoxyCodeLine{39 \textcolor{keyword}{struct }osmo\_netdev *osmo\_tundev\_get\_netdev(\textcolor{keyword}{struct} osmo\_tundev *tundev);}
\DoxyCodeLine{40 }
\DoxyCodeLine{41 \textcolor{keywordtype}{int} osmo\_tundev\_send(\textcolor{keyword}{struct} osmo\_tundev *tundev, \textcolor{keyword}{struct} msgb *msg);}

\end{DoxyCode}
