\hypertarget{class_network_manager}{
\section{NetworkManager Class Reference}
\label{class_network_manager}\index{NetworkManager@{NetworkManager}}
}


Manages the network configurations like setting new default routes.  




{\ttfamily \#include $<$networkmanager.h$>$}

\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{class_network_manager_a5aaf71c4aa7a2efab7f1dbae02312280}{NetworkManager} ()
\item 
virtual \hyperlink{class_network_manager_a2cfe4223139cf58587a9f066b956cb23}{$\sim$NetworkManager} ()
\item 
int \hyperlink{class_network_manager_a6eb5272254508a6c7f45209ffba5ac3b}{replaceDefaultRoute} (QString ifname, QString gateway, int metric, int af)
\item 
int \hyperlink{class_network_manager_aa8d692b2103ed7352b01008dd6c89789}{bringInterfaceUP} (QString ifname)
\item 
int \hyperlink{class_network_manager_a65151df085f72be2c321512c25a8f654}{bringInterfaceDown} (QString ifname)
\item 
int \hyperlink{class_network_manager_a7d8aa3550e9896b17719d6ef0ea61365}{ip4\_\-setManualConfiguration} (QString ifname, QString ipAddress, QString netmask, QString broadcast, QString gateway, int metric, int af, QString pathToResolvConf, QList$<$ QString $>$ nameServer)
\item 
int \hyperlink{class_network_manager_ada890449febc5c55edc03d83d7ed733a}{ip4\_\-configureInterface} (QString ifname, QString ipAddress, QString broadcast, QString netmask, int af)
\item 
int \hyperlink{class_network_manager_a457f2d885c27eeabf16a5b146771eb86}{ip6\_\-addRoute} (const char $\ast$iface, const struct in6\_\-addr $\ast$ip6\_\-dest, int ip6\_\-prefix, const struct in6\_\-addr $\ast$ip6\_\-gateway, int metric, int mss)
\item 
int \hyperlink{class_network_manager_ae3cd47623412d144225538f2d5ff1c89}{ip6\_\-addAddress} (struct ip6\_\-addr $\ast$ip6Addr, const char $\ast$iface)
\item 
int \hyperlink{class_network_manager_ab4e9c06fc0655c715f025b14ed39478c}{writeResolvConf} (QString path, QString ifname, QList$<$ QString $>$ nameServer)
\end{DoxyCompactItemize}


\subsection{Detailed Description}
Manages the network configurations like setting new default routes. Copyright (c) 2010,2011 -\/ RZ Uni Freiburg Copyright (c) 2010,2011 -\/ OpenSLX Project

This program/file is free software distributed under the GPL version 2. See \href{http://openslx.org/COPYING}{\tt http://openslx.org/COPYING}

If you have any feedback please consult \href{http://openslx.org/feedback}{\tt http://openslx.org/feedback} and send your feedback to \href{mailto:feedback@openslx.org}{\tt feedback@openslx.org}

General information about OpenSLX can be found under \href{http://openslx.org}{\tt http://openslx.org}

Manages the network configurations like setting new default routes. It provides methods for ipv4 and some method for ipv6. 

\subsection{Constructor \& Destructor Documentation}
\hypertarget{class_network_manager_a5aaf71c4aa7a2efab7f1dbae02312280}{
\index{NetworkManager@{NetworkManager}!NetworkManager@{NetworkManager}}
\index{NetworkManager@{NetworkManager}!NetworkManager@{NetworkManager}}
\subsubsection[{NetworkManager}]{\setlength{\rightskip}{0pt plus 5cm}NetworkManager::NetworkManager (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}
\label{class_network_manager_a5aaf71c4aa7a2efab7f1dbae02312280}
\hypertarget{class_network_manager_a2cfe4223139cf58587a9f066b956cb23}{
\index{NetworkManager@{NetworkManager}!$\sim$NetworkManager@{$\sim$NetworkManager}}
\index{$\sim$NetworkManager@{$\sim$NetworkManager}!NetworkManager@{NetworkManager}}
\subsubsection[{$\sim$NetworkManager}]{\setlength{\rightskip}{0pt plus 5cm}NetworkManager::$\sim$NetworkManager (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}virtual\mbox{]}}}}
\label{class_network_manager_a2cfe4223139cf58587a9f066b956cb23}


\subsection{Member Function Documentation}
\hypertarget{class_network_manager_a65151df085f72be2c321512c25a8f654}{
\index{NetworkManager@{NetworkManager}!bringInterfaceDown@{bringInterfaceDown}}
\index{bringInterfaceDown@{bringInterfaceDown}!NetworkManager@{NetworkManager}}
\subsubsection[{bringInterfaceDown}]{\setlength{\rightskip}{0pt plus 5cm}int NetworkManager::bringInterfaceDown (
\begin{DoxyParamCaption}
\item[{QString}]{ifname}
\end{DoxyParamCaption}
)}}
\label{class_network_manager_a65151df085f72be2c321512c25a8f654}
The method brings an interface down.


\begin{DoxyParams}{Parameters}
{\em ifname} & the name of the interface\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 -\/$>$ success -\/1 -\/$>$ error 
\end{DoxyReturn}
\hypertarget{class_network_manager_aa8d692b2103ed7352b01008dd6c89789}{
\index{NetworkManager@{NetworkManager}!bringInterfaceUP@{bringInterfaceUP}}
\index{bringInterfaceUP@{bringInterfaceUP}!NetworkManager@{NetworkManager}}
\subsubsection[{bringInterfaceUP}]{\setlength{\rightskip}{0pt plus 5cm}int NetworkManager::bringInterfaceUP (
\begin{DoxyParamCaption}
\item[{QString}]{ifname}
\end{DoxyParamCaption}
)}}
\label{class_network_manager_aa8d692b2103ed7352b01008dd6c89789}
The method brings an interface up.


\begin{DoxyParams}{Parameters}
{\em ifname} & the name of the interface\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 -\/$>$ success -\/1 -\/$>$ error 
\end{DoxyReturn}


Here is the caller graph for this function:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=400pt]{class_network_manager_aa8d692b2103ed7352b01008dd6c89789_icgraph}
\end{center}
\end{figure}


\hypertarget{class_network_manager_ada890449febc5c55edc03d83d7ed733a}{
\index{NetworkManager@{NetworkManager}!ip4\_\-configureInterface@{ip4\_\-configureInterface}}
\index{ip4\_\-configureInterface@{ip4\_\-configureInterface}!NetworkManager@{NetworkManager}}
\subsubsection[{ip4\_\-configureInterface}]{\setlength{\rightskip}{0pt plus 5cm}int NetworkManager::ip4\_\-configureInterface (
\begin{DoxyParamCaption}
\item[{QString}]{ifname, }
\item[{QString}]{ipAddress, }
\item[{QString}]{broadcast, }
\item[{QString}]{netmask, }
\item[{int}]{af}
\end{DoxyParamCaption}
)}}
\label{class_network_manager_ada890449febc5c55edc03d83d7ed733a}


Here is the caller graph for this function:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=400pt]{class_network_manager_ada890449febc5c55edc03d83d7ed733a_icgraph}
\end{center}
\end{figure}


\hypertarget{class_network_manager_a7d8aa3550e9896b17719d6ef0ea61365}{
\index{NetworkManager@{NetworkManager}!ip4\_\-setManualConfiguration@{ip4\_\-setManualConfiguration}}
\index{ip4\_\-setManualConfiguration@{ip4\_\-setManualConfiguration}!NetworkManager@{NetworkManager}}
\subsubsection[{ip4\_\-setManualConfiguration}]{\setlength{\rightskip}{0pt plus 5cm}int NetworkManager::ip4\_\-setManualConfiguration (
\begin{DoxyParamCaption}
\item[{QString}]{ifname, }
\item[{QString}]{ipAddress, }
\item[{QString}]{netmask, }
\item[{QString}]{broadcast, }
\item[{QString}]{gateway, }
\item[{int}]{metric, }
\item[{int}]{af, }
\item[{QString}]{pathToResolvConf, }
\item[{QList$<$ QString $>$}]{nameServer}
\end{DoxyParamCaption}
)}}
\label{class_network_manager_a7d8aa3550e9896b17719d6ef0ea61365}
This method is used when the manual configuration is needed.

This method is used when the manual configuration is needed. First we bring up the interface. Than we configure the interface with our manual entered configuration dates. After that we replace the old default route with the new and write a resolv.conf.


\begin{DoxyParams}{Parameters}
{\em ifname} & name of the interface which we are about to configure.\\
\hline
{\em ipAddress} & the new IP-\/Address.\\
\hline
{\em netmask} & the netmask of the IP-\/Address.\\
\hline
{\em broadcast} & the broadcast address. \\
\hline
{\em gateway} & the gateway address. \\
\hline
{\em metric} & do not exactly know why we need this. in most cases this should be 0. \\
\hline
{\em af} & the address type. Either AF\_\-INET for IPv4 or AF\_\-INET6 for IPv6. \\
\hline
{\em pathToResolvConf} & the path to the resolf.conf file. in most cases \char`\"{}/etc/\char`\"{}. \\
\hline
{\em nameServer} & the name server addresses. \\
\hline
\end{DoxyParams}


Here is the call graph for this function:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=400pt]{class_network_manager_a7d8aa3550e9896b17719d6ef0ea61365_cgraph}
\end{center}
\end{figure}




Here is the caller graph for this function:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=400pt]{class_network_manager_a7d8aa3550e9896b17719d6ef0ea61365_icgraph}
\end{center}
\end{figure}


\hypertarget{class_network_manager_ae3cd47623412d144225538f2d5ff1c89}{
\index{NetworkManager@{NetworkManager}!ip6\_\-addAddress@{ip6\_\-addAddress}}
\index{ip6\_\-addAddress@{ip6\_\-addAddress}!NetworkManager@{NetworkManager}}
\subsubsection[{ip6\_\-addAddress}]{\setlength{\rightskip}{0pt plus 5cm}int NetworkManager::ip6\_\-addAddress (
\begin{DoxyParamCaption}
\item[{struct ip6\_\-addr $\ast$}]{ip6Addr, }
\item[{const char $\ast$}]{iface}
\end{DoxyParamCaption}
)}}
\label{class_network_manager_ae3cd47623412d144225538f2d5ff1c89}
\hypertarget{class_network_manager_a457f2d885c27eeabf16a5b146771eb86}{
\index{NetworkManager@{NetworkManager}!ip6\_\-addRoute@{ip6\_\-addRoute}}
\index{ip6\_\-addRoute@{ip6\_\-addRoute}!NetworkManager@{NetworkManager}}
\subsubsection[{ip6\_\-addRoute}]{\setlength{\rightskip}{0pt plus 5cm}int NetworkManager::ip6\_\-addRoute (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{iface, }
\item[{const struct in6\_\-addr $\ast$}]{ip6\_\-dest, }
\item[{int}]{ip6\_\-prefix, }
\item[{const struct in6\_\-addr $\ast$}]{ip6\_\-gateway, }
\item[{int}]{metric, }
\item[{int}]{mss}
\end{DoxyParamCaption}
)}}
\label{class_network_manager_a457f2d885c27eeabf16a5b146771eb86}
\hypertarget{class_network_manager_a6eb5272254508a6c7f45209ffba5ac3b}{
\index{NetworkManager@{NetworkManager}!replaceDefaultRoute@{replaceDefaultRoute}}
\index{replaceDefaultRoute@{replaceDefaultRoute}!NetworkManager@{NetworkManager}}
\subsubsection[{replaceDefaultRoute}]{\setlength{\rightskip}{0pt plus 5cm}int NetworkManager::replaceDefaultRoute (
\begin{DoxyParamCaption}
\item[{QString}]{ifname, }
\item[{QString}]{gateway, }
\item[{int}]{mss, }
\item[{int}]{af}
\end{DoxyParamCaption}
)}}
\label{class_network_manager_a6eb5272254508a6c7f45209ffba5ac3b}
This method adds /replaces the default route. This method adds /replaces the default route. To keep it modular, it is possible to specify an ip address family.


\begin{DoxyParams}{Parameters}
{\em ifName} & the interface name\\
\hline
{\em gateway} & the gateway address (e.g: 192.168.0.254) \\
\hline
{\em mss} & the mss. \\
\hline
{\em af} & specify the family type of the ip address. possible values are: AF\_\-INET for an IPv4 address AF\_\-INET6 for an IPv6 address\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
return -\/1 if an error happened. return 0 if everything was ok. 
\end{DoxyReturn}


Here is the caller graph for this function:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=400pt]{class_network_manager_a6eb5272254508a6c7f45209ffba5ac3b_icgraph}
\end{center}
\end{figure}


\hypertarget{class_network_manager_ab4e9c06fc0655c715f025b14ed39478c}{
\index{NetworkManager@{NetworkManager}!writeResolvConf@{writeResolvConf}}
\index{writeResolvConf@{writeResolvConf}!NetworkManager@{NetworkManager}}
\subsubsection[{writeResolvConf}]{\setlength{\rightskip}{0pt plus 5cm}int NetworkManager::writeResolvConf (
\begin{DoxyParamCaption}
\item[{QString}]{path, }
\item[{QString}]{ifname, }
\item[{QList$<$ QString $>$}]{nameServer}
\end{DoxyParamCaption}
)}}
\label{class_network_manager_ab4e9c06fc0655c715f025b14ed39478c}
This method writes a resolv.conf file.


\begin{DoxyParams}{Parameters}
{\em path} & path to the resolv.conf file. (in most cases: /etc/) \\
\hline
{\em ifname} & name of the interface \\
\hline
{\em addresses} & of the nameserver\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
return 0 if success else -\/1 
\end{DoxyReturn}


Here is the caller graph for this function:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=400pt]{class_network_manager_ab4e9c06fc0655c715f025b14ed39478c_icgraph}
\end{center}
\end{figure}




The documentation for this class was generated from the following files:\begin{DoxyCompactItemize}
\item 
/home/niklas/workspace/fbgui/src/\hyperlink{networkmanager_8h}{networkmanager.h}\item 
/home/niklas/workspace/fbgui/src/\hyperlink{networkmanager_8cpp}{networkmanager.cpp}\end{DoxyCompactItemize}
