1
by David Paleino
Import upstream version 1.5.2 |
1 |
THEORY OF OPERATION: |
2 |
||
3 |
Wicd is designed to give the user as much control over behavior of network |
|
4 |
connections as possible. Every network, both wired and wireless, has its |
|
5 |
own profile with its own configuration options and connection behavior. |
|
6 |
Wicd will try to automatically connect only to networks the user specifies |
|
7 |
it should try, with a preference first to a wired network, then to wireless. |
|
8 |
||
9 |
For wired connections, users have many options for determining what network |
|
10 |
settings to use. Wicd allows creation of an unlimited number of wired |
|
11 |
profiles, each of which has its own unique settings. The user can choose to |
|
12 |
automatically connect to a selected default profile, choose a profile from a |
|
13 |
pop-up window every time wicd connects, or have wicd automatically choose the |
|
14 |
last profile used to manually connect. |
|
15 |
||
16 |
For wireless connections, users can select any number of wireless networks |
|
17 |
to automatically connect; wicd will choose the one with the highest signal |
|
18 |
strength to try to connect. |
|
19 |
||
20 |
If the user chooses, wicd will try to automatically reconnect when it detects |
|
21 |
that a connection is lost. If the last known connection state is wired, wicd |
|
22 |
will first try to reconnect to the wired network, and if it is not available, |
|
23 |
wicd will try any available wireless networks which have automatic connection |
|
24 |
enabled. If the last known connection state is wireless, wicd will first try |
|
25 |
to reconnect to the previously connected network (even if that network does |
|
26 |
not have automatic connection enabled), and should that fail, it will try both |
|
27 |
a wired connection and any available wireless networks which have automatic |
|
28 |
connection enabled. |
|
29 |
||
30 |
Wicd uses built-in linux wireless-tools, such as ifconfig and iwconfig, to |
|
31 |
get and configure network info. There is some flexibility in its use of DHCP, |
|
32 |
providing support for dhclient, dhcpcd, and pump. Wicd uses wpa_supplicant |
|
33 |
to handle all wireless encryption settings, and uses a template-based system |
|
34 |
to create the configuration files used by wpa_supplicant. These templates |
|
35 |
can be edited, and new templates can be created by the user and imported into |
|
36 |
wicd, allowing connection to networks with uncommon encryption settings. |
|
37 |
||
38 |
||
39 |
STRUCTURE: |
|
40 |
||
41 |
Wicd has two major parts: the daemon, which runs with root privileges; and the |
|
42 |
user interface, which runs with normal user privileges. The two parts run as |
|
43 |
separate processes and make use of D-Bus to communicate. |
|
44 |
||
45 |
The daemon is responsible for making and configuring connections, reading and |
|
46 |
writing configuration files and logs, and monitoring the connection status. |
|
47 |
The daemon's job is split between two processes: daemon.py and monitor.py. |
|
48 |
All the connection status monitoring, as well as the auto-reconnection logic, |
|
49 |
takes place in monitor.py. Everthing else is done by wicd-daemon.py. |
|
50 |
||
51 |
The user interface (stored in wicd-client.py), which is made up of a tray |
|
52 |
icon, a main GUI window, and its child dialogs, gets configuration and network |
|
53 |
info from the daemon either by querying it using the methods in the daemon's |
|
54 |
dbus interface or by receiving signals emitted from the daemon over D-Bus. |
|
55 |
Any configuration changes made in the user interface are passed back to the |
|
56 |
daemon, which actually applies the changes and writes them to configuration |
|
57 |
files. |
|
58 |
||
59 |
Since the user interface just queries for connection and configuration info |
|
60 |
from the daemon, it is possible to run wicd without the GUI at all. Also, |
|
61 |
the daemon is started by wicd's init script during system startup (before any |
|
62 |
user logs in), making it possible to use wicd with "headless" machines. |
|
63 |