\doxysection{netdev.\+h}
\label{netdev_8h_source}\index{include/osmocom/core/netdev.h@{include/osmocom/core/netdev.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 }
\DoxyCodeLine{13 \textcolor{keyword}{struct }osmo\_netdev;}
\DoxyCodeLine{14 }
\DoxyCodeLine{15 \textcolor{keyword}{typedef} int (*osmo\_netdev\_ifupdown\_ind\_cb\_t)(\textcolor{keyword}{struct }osmo\_netdev *netdev, \textcolor{keywordtype}{bool} ifupdown);}
\DoxyCodeLine{16 \textcolor{keyword}{typedef} int (*osmo\_netdev\_dev\_name\_chg\_cb\_t)(\textcolor{keyword}{struct }osmo\_netdev *netdev, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *new\_dev\_name);}
\DoxyCodeLine{17 \textcolor{keyword}{typedef} int (*osmo\_netdev\_mtu\_chg\_cb\_t)(\textcolor{keyword}{struct }osmo\_netdev *netdev, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} new\_mtu);}
\DoxyCodeLine{18 }
\DoxyCodeLine{19 \textcolor{keyword}{struct }osmo\_netdev *osmo\_netdev\_alloc(\textcolor{keywordtype}{void} *ctx, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *name);}
\DoxyCodeLine{20 \textcolor{keywordtype}{void} osmo\_netdev\_free(\textcolor{keyword}{struct} osmo\_netdev *netdev);}
\DoxyCodeLine{21 }
\DoxyCodeLine{22 \textcolor{keywordtype}{int} osmo\_netdev\_register(\textcolor{keyword}{struct} osmo\_netdev *netdev);}
\DoxyCodeLine{23 \textcolor{keywordtype}{int} osmo\_netdev\_unregister(\textcolor{keyword}{struct} osmo\_netdev *netdev);}
\DoxyCodeLine{24 \textcolor{keywordtype}{bool} osmo\_netdev\_is\_registered(\textcolor{keyword}{struct} osmo\_netdev *netdev);}
\DoxyCodeLine{25 }
\DoxyCodeLine{26 \textcolor{keyword}{const} \textcolor{keywordtype}{char} *osmo\_netdev\_get\_name(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_netdev *netdev);}
\DoxyCodeLine{27 }
\DoxyCodeLine{28 \textcolor{keywordtype}{void} osmo\_netdev\_set\_priv\_data(\textcolor{keyword}{struct} osmo\_netdev *netdev, \textcolor{keywordtype}{void} *priv\_data);}
\DoxyCodeLine{29 \textcolor{keywordtype}{void} *osmo\_netdev\_get\_priv\_data(\textcolor{keyword}{struct} osmo\_netdev *netdev);}
\DoxyCodeLine{30 }
\DoxyCodeLine{31 \textcolor{keywordtype}{int} osmo\_netdev\_set\_ifindex(\textcolor{keyword}{struct} osmo\_netdev *netdev, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} ifindex);}
\DoxyCodeLine{32 \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} osmo\_netdev\_get\_ifindex(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_netdev *netdev);}
\DoxyCodeLine{33 }
\DoxyCodeLine{34 \textcolor{keyword}{const} \textcolor{keywordtype}{char} *osmo\_netdev\_get\_dev\_name(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_netdev *netdev);}
\DoxyCodeLine{35 }
\DoxyCodeLine{36 \textcolor{keywordtype}{int} osmo\_netdev\_set\_netns\_name(\textcolor{keyword}{struct} osmo\_netdev *netdev, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *netns);}
\DoxyCodeLine{37 \textcolor{keyword}{const} \textcolor{keywordtype}{char} *osmo\_netdev\_get\_netns\_name(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_netdev *netdev);}
\DoxyCodeLine{38 }
\DoxyCodeLine{39 \textcolor{keywordtype}{int} osmo\_netdev\_set\_mtu(\textcolor{keyword}{struct} osmo\_netdev *netdev, uint32\_t mtu);}
\DoxyCodeLine{40 }
\DoxyCodeLine{41 \textcolor{keywordtype}{void} osmo\_netdev\_set\_ifupdown\_ind\_cb(\textcolor{keyword}{struct} osmo\_netdev *netdev, osmo\_netdev\_ifupdown\_ind\_cb\_t ifupdown\_ind\_cb);}
\DoxyCodeLine{42 \textcolor{keywordtype}{void} osmo\_netdev\_set\_dev\_name\_chg\_cb(\textcolor{keyword}{struct} osmo\_netdev *netdev, osmo\_netdev\_dev\_name\_chg\_cb\_t dev\_name\_chg\_cb);}
\DoxyCodeLine{43 \textcolor{keywordtype}{void} osmo\_netdev\_set\_mtu\_chg\_cb(\textcolor{keyword}{struct} osmo\_netdev *netdev, osmo\_netdev\_mtu\_chg\_cb\_t mtu\_chg\_cb);}
\DoxyCodeLine{44 }
\DoxyCodeLine{45 \textcolor{keywordtype}{int} osmo\_netdev\_add\_addr(\textcolor{keyword}{struct} osmo\_netdev *netdev, \textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_sockaddr *addr, uint8\_t prefixlen);}
\DoxyCodeLine{46 \textcolor{keywordtype}{int} osmo\_netdev\_add\_route(\textcolor{keyword}{struct} osmo\_netdev *netdev, \textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_sockaddr *dst\_addr,}
\DoxyCodeLine{47                           uint8\_t dst\_prefixlen, \textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_sockaddr *gw\_addr);}
\DoxyCodeLine{48 \textcolor{keywordtype}{int} osmo\_netdev\_ifupdown(\textcolor{keyword}{struct} osmo\_netdev *netdev, \textcolor{keywordtype}{bool} ifupdown);}
\DoxyCodeLine{49 }
\DoxyCodeLine{50 \textcolor{preprocessor}{\#endif }\textcolor{comment}{/* (!EMBEDDED) */}\textcolor{preprocessor}{}}

\end{DoxyCode}
