\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 }
\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 }
\DoxyCodeLine{12 \textcolor{keyword}{struct }osmo\_netdev;}
\DoxyCodeLine{13 }
\DoxyCodeLine{14 \textcolor{keyword}{typedef} int (*osmo\_netdev\_ifupdown\_ind\_cb\_t)(\textcolor{keyword}{struct }osmo\_netdev *netdev, \textcolor{keywordtype}{bool} ifupdown);}
\DoxyCodeLine{15 \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{16 \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{17 }
\DoxyCodeLine{18 \textcolor{keyword}{struct }osmo\_netdev *osmo\_netdev\_alloc(\textcolor{keywordtype}{void} *ctx, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *name);}
\DoxyCodeLine{19 \textcolor{keywordtype}{void} osmo\_netdev\_free(\textcolor{keyword}{struct} osmo\_netdev *netdev);}
\DoxyCodeLine{20 }
\DoxyCodeLine{21 \textcolor{keywordtype}{int} osmo\_netdev\_register(\textcolor{keyword}{struct} osmo\_netdev *netdev);}
\DoxyCodeLine{22 \textcolor{keywordtype}{int} osmo\_netdev\_unregister(\textcolor{keyword}{struct} osmo\_netdev *netdev);}
\DoxyCodeLine{23 \textcolor{keywordtype}{bool} osmo\_netdev\_is\_registered(\textcolor{keyword}{struct} osmo\_netdev *netdev);}
\DoxyCodeLine{24 }
\DoxyCodeLine{25 \textcolor{keyword}{const} \textcolor{keywordtype}{char} *osmo\_netdev\_get\_name(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_netdev *netdev);}
\DoxyCodeLine{26 }
\DoxyCodeLine{27 \textcolor{keywordtype}{void} osmo\_netdev\_set\_priv\_data(\textcolor{keyword}{struct} osmo\_netdev *netdev, \textcolor{keywordtype}{void} *priv\_data);}
\DoxyCodeLine{28 \textcolor{keywordtype}{void} *osmo\_netdev\_get\_priv\_data(\textcolor{keyword}{struct} osmo\_netdev *netdev);}
\DoxyCodeLine{29 }
\DoxyCodeLine{30 \textcolor{keywordtype}{int} osmo\_netdev\_set\_ifindex(\textcolor{keyword}{struct} osmo\_netdev *netdev, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} ifindex);}
\DoxyCodeLine{31 \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} osmo\_netdev\_get\_ifindex(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_netdev *netdev);}
\DoxyCodeLine{32 }
\DoxyCodeLine{33 \textcolor{keyword}{const} \textcolor{keywordtype}{char} *osmo\_netdev\_get\_dev\_name(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_netdev *netdev);}
\DoxyCodeLine{34 }
\DoxyCodeLine{35 \textcolor{keywordtype}{int} osmo\_netdev\_set\_netns\_name(\textcolor{keyword}{struct} osmo\_netdev *netdev, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *netns);}
\DoxyCodeLine{36 \textcolor{keyword}{const} \textcolor{keywordtype}{char} *osmo\_netdev\_get\_netns\_name(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_netdev *netdev);}
\DoxyCodeLine{37 }
\DoxyCodeLine{38 \textcolor{keywordtype}{int} osmo\_netdev\_set\_mtu(\textcolor{keyword}{struct} osmo\_netdev *netdev, uint32\_t mtu);}
\DoxyCodeLine{39 }
\DoxyCodeLine{40 \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{41 \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{42 \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{43 }
\DoxyCodeLine{44 \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{45 \textcolor{keywordtype}{int} osmo\_netdev\_add\_route(\textcolor{keyword}{struct} osmo\_netdev *netdev, \textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_sockaddr *dst\_addr,}
\DoxyCodeLine{46                           uint8\_t dst\_prefixlen, \textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_sockaddr *gw\_addr);}
\DoxyCodeLine{47 \textcolor{keywordtype}{int} osmo\_netdev\_ifupdown(\textcolor{keyword}{struct} osmo\_netdev *netdev, \textcolor{keywordtype}{bool} ifupdown);}
\DoxyCodeLine{48 }

\end{DoxyCode}
