summaryrefslogtreecommitdiffstats
path: root/doxygen/latex/class_network_manager.tex
blob: 3a158f148bb924f9f10da2e21cf658fca380bc95 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
\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}