RE: Questions on NetworkManager-0.7.0

2008-03-26 Thread Jue Yang
dear nick,
 
Thank you very much for helping me to understand the structure of NM and 
the relationship between NM and applet.
 
I have some more questions about NM and wish you can help me again.Today I met 
a problem on DHClient. 
 
(1) The log is like "localhost dhclient: Can't create 
/usr/local/var/run/dhclient-wlan0.pid: Permission denied".
 
I downloaded dhclient-3.0.6 src code but still did not find how to change 
"path_dhclient_db". Maybe it is not printed from dhclient.c.
 
 
I still have some questions about NM.
 
(2) Can I interpret the relationship between NM and applet like following 
diagram?

|- src 
--| |- libnm -|  
 NIC_Driver<->wpa_supplicant<->NetworkManager <-> NMManager<->  
 NMClient   <-> Applet
 (iwctrl)(dbus)[NM 
database] (dbus sig)  [NMA database]
 
(3) I could not find the place applet emits a signal "DeviceAdded", so how does 
applet create a NMClient?   
 
(4) I will be so glad to know the calling history about "the wireless device 
has scanned a new network/ap". 
 I means how NM informs Applet to add a new network. 
 
(5) Also I would like to know the calling history about "user select an ap to 
associate". 
 I means how Applet informs NM to perform joining things.
 
(6) Last question :Connection is for a device or an ap?
 
Sorry to have bothered you so much. 
 sincerely,
 
Jeanne



> Date: Tue, 25 Mar 2008 14:23:58 +0100> From: [EMAIL PROTECTED]> To: [EMAIL 
> PROTECTED]> Subject: Re: Questions on NetworkManager-0.7.0> > 2008/3/25, Jue 
> Yang <[EMAIL PROTECTED]>:> > I'm a fresh to develop Network Manager based on 
> version 0.7.0. I have digged> > it few days and feel so confused. Could 
> anybody give me the answers to> > following questions.> > I'm new too, but I 
> guess i can answere this.> > > 1. Why does NM separate to two layers, libnm 
> and src?> > libnm is the network manager library (utils and glib bindings): 
> shared> code between the network manager daemon (in src) and (for example) 
> the> network-manager-applet. So libnm-{util,glib} are libraries, src is a> 
> program.> > > 2. How to do initialization of all objects? I mean who calls 
> those> > "class_init" functions.> > Those are called by the GObject, using 
> the macro G_DEFINE_TYPE and friends.> > > 3. Can Applet just call functions 
> in libnm? During Applet setting an> > active network, which way used to keep 
> synchronizing between libnm and src?> > Two applications (nm-daemon and 
> nm-applet) cannot share the same data.> They communicate using dbus. libnm is 
> used to "handle" the shared data> over dbus.> > Cheers,> Nick
_
Windows Live Hotmail is giving away Zunes.
http://www.windowslive-hotmail.com/ZuneADay/?locale=en-US&ocid=TXT_TAGLM_Mobile_Zune_V3___
NetworkManager-list mailing list
NetworkManager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


RE: Questions on NetworkManager-0.7.0

2008-03-26 Thread Jue Yang
dear dan,
 
First, thank you very much for helpping me to break a way with Network Manager 
0.7.0. 
 
Your points help me a lot and the best is I will never feel alone and helpless.
 
Today I met a problem on DHClient. 
 
(1) The log is like "localhost dhclient: Can't create 
/usr/local/var/run/dhclient-wlan0.pid: Permission denied".
 
I downloaded dhclient-3.0.6 src code but still did not find how to change 
"path_dhclient_db". Maybe it is not printed from dhclient.c.
 
 
I still have some questions about NM.
 
(2) Can I interpret the relationship between NM and applet like the following 
diagram?

 |- src 
--|  |- libnm -|  
 NIC_Driver<->wpa_supplicant<->NetworkManager <-> NMManager<-> 
NMClient   <-> Applet
   (iwctrl)(dbus)[NM 
database]  (dbus sig)  [NMA database]
 
(3) I could not find the place applet emits a signal "DeviceAdded", so how does 
applet create a NMClient?   
 
(4) I will be so glad to know the calling history about "the wireless device 
has scanned a new network/ap". 
 I means how NM informs Applet to add a new network. 
 
(5) Also I would like to know the calling history about "user select an ap to 
associate". 
 I means how Applet informs NM to perform joining things.
 
(6) Last question :Connection is for a device or an ap?
 
Sorry to have bothered you so much. I feel a little lazy and guilty, but still 
waiting for your good news.  
 
sincerely,
 
Jeanne



> Subject: Re: Questions on NetworkManager-0.7.0> From: [EMAIL PROTECTED]> To: 
> [EMAIL PROTECTED]> CC: networkmanager-list@gnome.org> Date: Tue, 25 Mar 2008 
> 10:45:23 -0400> > On Tue, 2008-03-25 at 03:11 +, Jue Yang wrote:> > Hi,> 
> > > > > > > > I’m a fresh to develop Network Manager based on version 0.7.0. 
> I have> > digged it few days and feel so confused. Could anybody give me the> 
> > answers to following questions. > > > > 1. Why does NM separate to two 
> layers, libnm and src?> > libnm-glib is only used by _client_ of 
> NetworkManager, and wraps the> D-Bus objects that NetworkManager exports in a 
> glib friendly API.> > libnm-util is common code and structures used both by 
> clients of> NetworkManager and NetworkManager itself.> > > 2. How to do 
> initialization of all objects? I mean who calls> > those “class_init” 
> functions. > > This is handled by glib. When you call g_object_new(, 
> ...) glib> looks up the type that you have given it (which is registered 
> indirectly> by those lines in the header files like #define NM_TYPE_FOO> 
> (nm_foo_get_type ())).> > Once it's got the class structure identified by the 
> type you have given> it with g_object_new(), glib will call the class_init 
> and constructor> functions of the class and it's subclasses as necessary.> > 
> For more information on glib objects, see:> > 
> http://library.gnome.org/devel/gobject/unstable/chapter-gobject.html> > > 3. 
> Can Applet just call functions in libnm? During Applet> > setting an active 
> network, which way used to keep synchronizing> > between libnm and src?> > 
> Yes, the applet can call libnm-glib functions, provided it has created> the 
> right objects. You must first create the libnm-glib NMClient> object, which 
> effectively wraps the D-Bus interface exported by the> NMManager object in 
> src/. Once the applet has the NMClient object, it> can attach to the signals 
> of NMClient, ask NMClient for the list of> devices, the list of currently 
> active connections, etc.> > Most of the synchronization between a client an 
> NetworkManager (aided by> libnm-glib for glib-based applications) is through 
> signals. The> NMClient object proxies the PropertiesChanged signal that 
> NetowrkManager> emits when the NMManager state changes, and it decodes the 
> signal and> re-emits the signal as a GObject signal on the NMClient object. 
> There's> actually some magic underneath to extract the properties that have> 
> actually changed (there can be more than one at a time) from the> 
> PropertiesChanged signal over D-Bus, and then set the internal cached> 
> variables inside the NMClient object, and when those internal cached> 
> variables change, emit GObject notify signals to alert users of> libnm-glib 
> that something has changed.> > It's sort of complicated; but as a client of 
> NetworkManager you just> need to pick one of (1) the D-Bus interface, or (2) 
> the libnm-glib> interface, or (3) the K

Re: Questions on NetworkManager-0.7.0

2008-03-25 Thread Dan Williams
On Tue, 2008-03-25 at 03:11 +, Jue Yang wrote:
> Hi,
> 
>  
> 
> I’m a fresh to develop Network Manager based on version 0.7.0. I have
> digged it few days and feel so confused. Could anybody give me the
> answers to following questions. 
> 
> 1.   Why does NM separate to two layers, libnm and src?

libnm-glib is only used by _client_ of NetworkManager, and wraps the
D-Bus objects that NetworkManager exports in a glib friendly API.

libnm-util is common code and structures used both by clients of
NetworkManager and NetworkManager itself.

> 2.   How to do initialization of all objects? I mean who calls
> those “class_init” functions. 

This is handled by glib.  When you call g_object_new(, ...) glib
looks up the type that you have given it (which is registered indirectly
by those lines in the header files like #define NM_TYPE_FOO
(nm_foo_get_type ())).

Once it's got the class structure identified by the type you have given
it with g_object_new(), glib will call the class_init and constructor
functions of the class and it's subclasses as necessary.

For more information on glib objects, see:

http://library.gnome.org/devel/gobject/unstable/chapter-gobject.html

> 3.   Can Applet just call functions in libnm? During Applet
> setting an active network, which way used to keep synchronizing
> between libnm and src?

Yes, the applet can call libnm-glib functions, provided it has created
the right objects.  You must first create the libnm-glib NMClient
object, which effectively wraps the D-Bus interface exported by the
NMManager object in src/.  Once the applet has the NMClient object, it
can attach to the signals of NMClient, ask NMClient for the list of
devices, the list of currently active connections, etc.

Most of the synchronization between a client an NetworkManager (aided by
libnm-glib for glib-based applications) is through signals.  The
NMClient object proxies the PropertiesChanged signal that NetowrkManager
emits when the NMManager state changes, and it decodes the signal and
re-emits the signal as a GObject signal on the NMClient object.  There's
actually some magic underneath to extract the properties that have
actually changed (there can be more than one at a time) from the
PropertiesChanged signal over D-Bus, and then set the internal cached
variables inside the NMClient object, and when those internal cached
variables change, emit GObject notify signals to alert users of
libnm-glib that something has changed.

It's sort of complicated; but as a client of NetworkManager you just
need to pick one of (1) the D-Bus interface, or (2) the libnm-glib
interface, or (3) the KDE Solid interface when it's done.  (2) and (3)
just wrap the D-Bus interface (1) in a more friendly manner and do
things like convert D-Bus types to glib/qt types (a{sv} -> GHashTable
for example).

Dan


___
NetworkManager-list mailing list
NetworkManager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


Questions on NetworkManager-0.7.0

2008-03-25 Thread Jue Yang
Hi,
 
I’m a fresh to develop Network Manager based on version 0.7.0. I have digged it 
few days and feel so confused. Could anybody give me the answers to following 
questions. 
1.   Why does NM separate to two layers, libnm and src?
2.   How to do initialization of all objects? I mean who calls those 
“class_init” functions. 
3.   Can Applet just call functions in libnm? During Applet setting an 
active network, which way used to keep synchronizing between libnm and src?
best regardsJeanne
 
_
In a rush?  Get real-time answers with Windows Live Messenger.
http://www.windowslive.com/messenger/overview.html?ocid=TXT_TAGLM_WL_Refresh_realtime_042008___
NetworkManager-list mailing list
NetworkManager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list