\hypertarget{group__Eeze__Net}{\section{Net}
\label{group__Eeze__Net}\index{Net@{Net}}
}


Gather information about network devices.  


\subsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
\hypertarget{group__Eeze__Net_ga85488f286f8e7df46eddee1b6eca49eb}{typedef struct Eeze\+\_\+\+Net {\bfseries Eeze\+\_\+\+Net}}\label{group__Eeze__Net_ga85488f286f8e7df46eddee1b6eca49eb}

\end{DoxyCompactItemize}
\subsection*{Enumerations}
\begin{DoxyCompactItemize}
\item 
\hypertarget{group__Eeze__Net_gad16d50b27c7b5eb751578c205fa77ce8}{enum {\bfseries Eeze\+\_\+\+Net\+\_\+\+Addr\+\_\+\+Type} \{ \\*
{\bfseries E\+E\+Z\+E\+\_\+\+N\+E\+T\+\_\+\+A\+D\+D\+R\+\_\+\+T\+Y\+P\+E\+\_\+\+I\+P}, 
\\*
{\bfseries E\+E\+Z\+E\+\_\+\+N\+E\+T\+\_\+\+A\+D\+D\+R\+\_\+\+T\+Y\+P\+E\+\_\+\+I\+P6}, 
\\*
{\bfseries E\+E\+Z\+E\+\_\+\+N\+E\+T\+\_\+\+A\+D\+D\+R\+\_\+\+T\+Y\+P\+E\+\_\+\+B\+R\+O\+A\+D\+C\+A\+S\+T}, 
\\*
{\bfseries E\+E\+Z\+E\+\_\+\+N\+E\+T\+\_\+\+A\+D\+D\+R\+\_\+\+T\+Y\+P\+E\+\_\+\+B\+R\+O\+A\+D\+C\+A\+S\+T6}, 
\\*
{\bfseries E\+E\+Z\+E\+\_\+\+N\+E\+T\+\_\+\+A\+D\+D\+R\+\_\+\+T\+Y\+P\+E\+\_\+\+N\+E\+T\+M\+A\+S\+K}, 
\\*
{\bfseries E\+E\+Z\+E\+\_\+\+N\+E\+T\+\_\+\+A\+D\+D\+R\+\_\+\+T\+Y\+P\+E\+\_\+\+N\+E\+T\+M\+A\+S\+K6}
 \}}\label{group__Eeze__Net_gad16d50b27c7b5eb751578c205fa77ce8}

\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
Eeze\+\_\+\+Net $\ast$ \hyperlink{group__Eeze__Net_ga334024e69b8e278ce812f1efac2cd261}{eeze\+\_\+net\+\_\+new} (const char $\ast$name)
\begin{DoxyCompactList}\small\item\em Create a new net object. \end{DoxyCompactList}\item 
void \hyperlink{group__Eeze__Net_ga192cd8aa41b6ddf98bd497e5a00d36e3}{eeze\+\_\+net\+\_\+free} (Eeze\+\_\+\+Net $\ast$net)
\begin{DoxyCompactList}\small\item\em Free a net object. \end{DoxyCompactList}\item 
const char $\ast$ \hyperlink{group__Eeze__Net_ga0e6960f363b7f2a39b9590b0ff7a6a38}{eeze\+\_\+net\+\_\+mac\+\_\+get} (Eeze\+\_\+\+Net $\ast$net)
\begin{DoxyCompactList}\small\item\em Get the M\+A\+C address of a net object. \end{DoxyCompactList}\item 
int \hyperlink{group__Eeze__Net_ga76085270ab356a62cd29fdd4d7f9ed3f}{eeze\+\_\+net\+\_\+idx\+\_\+get} (Eeze\+\_\+\+Net $\ast$net)
\begin{DoxyCompactList}\small\item\em Get the index of a net object. \end{DoxyCompactList}\item 
\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\+\_\+\+Bool} \hyperlink{group__Eeze__Net_ga1a25e7606769746457c81af13a253e50}{eeze\+\_\+net\+\_\+scan} (Eeze\+\_\+\+Net $\ast$net)
\begin{DoxyCompactList}\small\item\em Scan an interface to cache its network addresses. \end{DoxyCompactList}\item 
const char $\ast$ \hyperlink{group__Eeze__Net_gaa6d1b02d58081a3fc13f4641f0f7bbb1}{eeze\+\_\+net\+\_\+addr\+\_\+get} (Eeze\+\_\+\+Net $\ast$net, Eeze\+\_\+\+Net\+\_\+\+Addr\+\_\+\+Type type)
\begin{DoxyCompactList}\small\item\em Get the address of a net object. \end{DoxyCompactList}\item 
const char $\ast$ \hyperlink{group__Eeze__Net_ga76d7ff9fc682b2643f190f18f6ae87bd}{eeze\+\_\+net\+\_\+attribute\+\_\+get} (Eeze\+\_\+\+Net $\ast$net, const char $\ast$attr)
\begin{DoxyCompactList}\small\item\em Get a system attribute of a net object. \end{DoxyCompactList}\item 
const char $\ast$ \hyperlink{group__Eeze__Net_gac723140a5362c1e6dba767b304beb07d}{eeze\+\_\+net\+\_\+syspath\+\_\+get} (Eeze\+\_\+\+Net $\ast$net)
\begin{DoxyCompactList}\small\item\em Get the /sys/ path of a net object. \end{DoxyCompactList}\item 
\hyperlink{group__Eina__List__Group_ga3295e1210efea1fb0fd6acbf3cbc1f29}{Eina\+\_\+\+List} $\ast$ \hyperlink{group__Eeze__Net_gae5571ef4f00ee346c89f3a9cf7a1657f}{eeze\+\_\+net\+\_\+list} (void)
\begin{DoxyCompactList}\small\item\em Get a list of all the network interfaces available. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Gather information about network devices. 



\subsection{Function Documentation}
\hypertarget{group__Eeze__Net_ga334024e69b8e278ce812f1efac2cd261}{\index{Net@{Net}!eeze\+\_\+net\+\_\+new@{eeze\+\_\+net\+\_\+new}}
\index{eeze\+\_\+net\+\_\+new@{eeze\+\_\+net\+\_\+new}!Net@{Net}}
\subsubsection[{eeze\+\_\+net\+\_\+new}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} Eeze\+\_\+\+Net $\ast$ eeze\+\_\+net\+\_\+new (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{name}
\end{DoxyParamCaption}
)}}\label{group__Eeze__Net_ga334024e69b8e278ce812f1efac2cd261}


Create a new net object. 


\begin{DoxyParams}{Parameters}
{\em name} & The name of the underlying device (eth0, br1, etc) \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A newly allocated net object, or N\+U\+L\+L on failure
\end{DoxyReturn}
This function creates a new net object based on {\ttfamily name}. Only the most minimal lookups are performed at creation in order to save memory. 

References eina\+\_\+hash\+\_\+add(), eina\+\_\+hash\+\_\+find(), E\+I\+N\+A\+\_\+\+R\+E\+F\+C\+O\+U\+N\+T\+\_\+\+I\+N\+I\+T, E\+I\+N\+A\+\_\+\+R\+E\+F\+C\+O\+U\+N\+T\+\_\+\+R\+E\+F, and eina\+\_\+stringshare\+\_\+add().



Referenced by eeze\+\_\+net\+\_\+list().

\hypertarget{group__Eeze__Net_ga192cd8aa41b6ddf98bd497e5a00d36e3}{\index{Net@{Net}!eeze\+\_\+net\+\_\+free@{eeze\+\_\+net\+\_\+free}}
\index{eeze\+\_\+net\+\_\+free@{eeze\+\_\+net\+\_\+free}!Net@{Net}}
\subsubsection[{eeze\+\_\+net\+\_\+free}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} void eeze\+\_\+net\+\_\+free (
\begin{DoxyParamCaption}
\item[{Eeze\+\_\+\+Net $\ast$}]{net}
\end{DoxyParamCaption}
)}}\label{group__Eeze__Net_ga192cd8aa41b6ddf98bd497e5a00d36e3}


Free a net object. 


\begin{DoxyParams}{Parameters}
{\em net} & The object to free\\
\hline
\end{DoxyParams}
Use this function to free a net object. \begin{DoxySeeAlso}{See also}
\hyperlink{group__Eeze__Net_ga334024e69b8e278ce812f1efac2cd261}{eeze\+\_\+net\+\_\+new()} 

\hyperlink{group__Eeze__Net_gae5571ef4f00ee346c89f3a9cf7a1657f}{eeze\+\_\+net\+\_\+list()} 
\end{DoxySeeAlso}


References eina\+\_\+hash\+\_\+del\+\_\+by\+\_\+key(), E\+I\+N\+A\+\_\+\+R\+E\+F\+C\+O\+U\+N\+T\+\_\+\+U\+N\+R\+E\+F, and eina\+\_\+stringshare\+\_\+del().

\hypertarget{group__Eeze__Net_ga0e6960f363b7f2a39b9590b0ff7a6a38}{\index{Net@{Net}!eeze\+\_\+net\+\_\+mac\+\_\+get@{eeze\+\_\+net\+\_\+mac\+\_\+get}}
\index{eeze\+\_\+net\+\_\+mac\+\_\+get@{eeze\+\_\+net\+\_\+mac\+\_\+get}!Net@{Net}}
\subsubsection[{eeze\+\_\+net\+\_\+mac\+\_\+get}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} const char $\ast$ eeze\+\_\+net\+\_\+mac\+\_\+get (
\begin{DoxyParamCaption}
\item[{Eeze\+\_\+\+Net $\ast$}]{net}
\end{DoxyParamCaption}
)}}\label{group__Eeze__Net_ga0e6960f363b7f2a39b9590b0ff7a6a38}


Get the M\+A\+C address of a net object. 


\begin{DoxyParams}{Parameters}
{\em net} & The net object \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The M\+A\+C address, N\+U\+L\+L on failure Use this function to retrieve the non-\/stringshared M\+A\+C address of {\ttfamily net}. 
\end{DoxyReturn}
\hypertarget{group__Eeze__Net_ga76085270ab356a62cd29fdd4d7f9ed3f}{\index{Net@{Net}!eeze\+\_\+net\+\_\+idx\+\_\+get@{eeze\+\_\+net\+\_\+idx\+\_\+get}}
\index{eeze\+\_\+net\+\_\+idx\+\_\+get@{eeze\+\_\+net\+\_\+idx\+\_\+get}!Net@{Net}}
\subsubsection[{eeze\+\_\+net\+\_\+idx\+\_\+get}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} int eeze\+\_\+net\+\_\+idx\+\_\+get (
\begin{DoxyParamCaption}
\item[{Eeze\+\_\+\+Net $\ast$}]{net}
\end{DoxyParamCaption}
)}}\label{group__Eeze__Net_ga76085270ab356a62cd29fdd4d7f9ed3f}


Get the index of a net object. 


\begin{DoxyParams}{Parameters}
{\em net} & The net object \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The ifindex of the object, -\/1 on failure Use this function to get the hardware index of {\ttfamily net} 
\end{DoxyReturn}
\hypertarget{group__Eeze__Net_ga1a25e7606769746457c81af13a253e50}{\index{Net@{Net}!eeze\+\_\+net\+\_\+scan@{eeze\+\_\+net\+\_\+scan}}
\index{eeze\+\_\+net\+\_\+scan@{eeze\+\_\+net\+\_\+scan}!Net@{Net}}
\subsubsection[{eeze\+\_\+net\+\_\+scan}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} {\bf Eina\+\_\+\+Bool} eeze\+\_\+net\+\_\+scan (
\begin{DoxyParamCaption}
\item[{Eeze\+\_\+\+Net $\ast$}]{net}
\end{DoxyParamCaption}
)}}\label{group__Eeze__Net_ga1a25e7606769746457c81af13a253e50}


Scan an interface to cache its network addresses. 


\begin{DoxyParams}{Parameters}
{\em net} & The net object to scan \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
E\+I\+N\+A\+\_\+\+T\+R\+U\+E on success, E\+I\+N\+A\+\_\+\+F\+A\+L\+S\+E on failure Use this function to scan and cache the ip address, netmask, and broadcast address for an interface. This function will perform a full scan every time it is called, and I\+Pv6 addresses will be cached if Eeze was compiled with I\+Pv6 support was enabled at compile time. 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\hyperlink{group__Eeze__Net_gaa6d1b02d58081a3fc13f4641f0f7bbb1}{eeze\+\_\+net\+\_\+addr\+\_\+get()} 
\end{DoxySeeAlso}


References E\+I\+N\+A\+\_\+\+F\+A\+L\+S\+E, E\+I\+N\+A\+\_\+\+T\+R\+U\+E, and inet\+\_\+ntop.

\hypertarget{group__Eeze__Net_gaa6d1b02d58081a3fc13f4641f0f7bbb1}{\index{Net@{Net}!eeze\+\_\+net\+\_\+addr\+\_\+get@{eeze\+\_\+net\+\_\+addr\+\_\+get}}
\index{eeze\+\_\+net\+\_\+addr\+\_\+get@{eeze\+\_\+net\+\_\+addr\+\_\+get}!Net@{Net}}
\subsubsection[{eeze\+\_\+net\+\_\+addr\+\_\+get}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} const char $\ast$ eeze\+\_\+net\+\_\+addr\+\_\+get (
\begin{DoxyParamCaption}
\item[{Eeze\+\_\+\+Net $\ast$}]{net, }
\item[{Eeze\+\_\+\+Net\+\_\+\+Addr\+\_\+\+Type}]{type}
\end{DoxyParamCaption}
)}}\label{group__Eeze__Net_gaa6d1b02d58081a3fc13f4641f0f7bbb1}


Get the address of a net object. 


\begin{DoxyParams}{Parameters}
{\em net} & The net object \\
\hline
{\em type} & The type of address to retrieve \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The stringshared address for {\ttfamily net} corresponding to {\ttfamily type}, N\+U\+L\+L on failure This function returns a value previously cached. 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\hyperlink{group__Eeze__Net_ga1a25e7606769746457c81af13a253e50}{eeze\+\_\+net\+\_\+scan()} 
\end{DoxySeeAlso}
\hypertarget{group__Eeze__Net_ga76d7ff9fc682b2643f190f18f6ae87bd}{\index{Net@{Net}!eeze\+\_\+net\+\_\+attribute\+\_\+get@{eeze\+\_\+net\+\_\+attribute\+\_\+get}}
\index{eeze\+\_\+net\+\_\+attribute\+\_\+get@{eeze\+\_\+net\+\_\+attribute\+\_\+get}!Net@{Net}}
\subsubsection[{eeze\+\_\+net\+\_\+attribute\+\_\+get}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} const char $\ast$ eeze\+\_\+net\+\_\+attribute\+\_\+get (
\begin{DoxyParamCaption}
\item[{Eeze\+\_\+\+Net $\ast$}]{net, }
\item[{const char $\ast$}]{attr}
\end{DoxyParamCaption}
)}}\label{group__Eeze__Net_ga76d7ff9fc682b2643f190f18f6ae87bd}


Get a system attribute of a net object. 


\begin{DoxyParams}{Parameters}
{\em net} & The net object \\
\hline
{\em attr} & The attribute to retrieve \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The non-\/stringshared value of the attribute, N\+U\+L\+L on failure Use this function to perform a udev sysattr lookup on the underlying device of {\ttfamily net} 
\end{DoxyReturn}
\hypertarget{group__Eeze__Net_gac723140a5362c1e6dba767b304beb07d}{\index{Net@{Net}!eeze\+\_\+net\+\_\+syspath\+\_\+get@{eeze\+\_\+net\+\_\+syspath\+\_\+get}}
\index{eeze\+\_\+net\+\_\+syspath\+\_\+get@{eeze\+\_\+net\+\_\+syspath\+\_\+get}!Net@{Net}}
\subsubsection[{eeze\+\_\+net\+\_\+syspath\+\_\+get}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} const char $\ast$ eeze\+\_\+net\+\_\+syspath\+\_\+get (
\begin{DoxyParamCaption}
\item[{Eeze\+\_\+\+Net $\ast$}]{net}
\end{DoxyParamCaption}
)}}\label{group__Eeze__Net_gac723140a5362c1e6dba767b304beb07d}


Get the /sys/ path of a net object. 


\begin{DoxyParams}{Parameters}
{\em net} & The net object \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The stringshared /sys/ path of the interface, N\+U\+L\+L on failure 
\end{DoxyReturn}
\hypertarget{group__Eeze__Net_gae5571ef4f00ee346c89f3a9cf7a1657f}{\index{Net@{Net}!eeze\+\_\+net\+\_\+list@{eeze\+\_\+net\+\_\+list}}
\index{eeze\+\_\+net\+\_\+list@{eeze\+\_\+net\+\_\+list}!Net@{Net}}
\subsubsection[{eeze\+\_\+net\+\_\+list}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\+A\+P\+I} {\bf Eina\+\_\+\+List} $\ast$ eeze\+\_\+net\+\_\+list (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}}\label{group__Eeze__Net_gae5571ef4f00ee346c89f3a9cf7a1657f}


Get a list of all the network interfaces available. 

\begin{DoxyReturn}{Returns}
A list of Eeze\+\_\+\+Net objects Use this function to get all network interfaces available to the application. This list must be freed by the user. 
\end{DoxyReturn}


References eeze\+\_\+net\+\_\+new(), and eina\+\_\+list\+\_\+append().

