Re: Newbie question: advice in adding a new feature to network manager...

On Thu, 2007-08-16 at 00:54 -0500, Doug Anson wrote:
> Hi:
> I’m new to NetworkManager and have an interest in coding up a new
> feature into it. I think it would be great to have the ability to
> partition out adhoc networks from infrastructure networks in the
> available wireless network list. That way, if it happens to be the
> case that there is a lurking adhoc network called say “foo” and an
> infrastructure network called “foo”, the user can differentiate
> between the two and choose which one they want to associate with. 

Right.  There are two pieces to this.  The first is that NM currently
aggregrates networks together based on SSID, which we need to change.

I believe for 0.7 we should have NM expose a list of _all_ BSSIDs via
D-Bus, and leave the UI side to sort out what exactly it wishes to
connect to, and to aggregate that list on it's own.  So that's the first
piece; it means ripping out all the aggregation code in NM that happens
in src/nm-device-802-11-wireless.c when the scan results come in.  We
should weed out duplicates on BSSID _only_.

The second piece is to aggregate APs in the GUI menus.  If you define a
tuple of:

(band, mode, security)

and aggregate APs based on that, I believe that's sufficient to capture
the behavior we want.  This allows the applet to know exactly what
options to default to when showing the Need your Key dialog, or what
Connection object to pass to NM when you click on the network.  This is
a bit harder since some matching has to occur to pick the applicable
connection object.

This is all based on NM 0.7 (trunk) BTW, I don't think this should be
done for 0.6.x since that's the stable branch.

> Additionally, with that kind of segmentation, it would be nice to ONLY
> see adhoc networks or infrastructure networks in the list (as a
> configurable option). For a managed network environment, users may
> only be interested in seeing one kind of network at a given time. 

You could do that with the scheme above, yes.  Obviously by default it
should any BSSID, but a sysadmin could lock down what networks the user
sees by default quite easily by setting GConf keys or something that the
applet reads.

> So, any advice on how I can quickly ramp up into the design aspects of
> NetworkManager?  Any advice on where I would likely begin to
> experiment with changes?

I think we can dig up some design docs somewhere for 0.7, which includes
in the interface design all the lessons learned over the past few years.
libnm-glib/* are good source files to read (especially the header files)
and we should make Tambet clean up the modular diagram he did long ago
and put it up somewhere.

You could probably start with src/nm-device-802-11-wireless.c in the
function merge_scanned_ap().  That does the actual merge, and we
probably want to just rip this function out.  That gets called by
supplicant_iface_scanned_ap_cb(), which is triggered whenever
wpa_supplicant reports a new scanned BSSID.

Instead of doing the following:

	/* Add the AP to the device's AP list */
	merge_scanned_ap (self, ap);

	/* Once we have the list, copy in any relevant information from our Allowed list. */
	nm_ap_list_copy_properties (nm_device_802_11_wireless_ap_list_get (self),

NM should just search through the list returned by
nm_device_802_11_wireless_ap_list_get() and if the BSSID of the scanned
AP is already in that list, copy the properties of the newly scanned AP
over top of the one that's already in the list.  If it's a completely
new AP, it should just add the AP to the device's scan list.
app_data->allowed_ap_list will be going away quite soon, so the
nm_ap_list_copy_properties() should die as well once that happens.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]