Re: Disconnect WiFi using cNetworkManager Python library

2012-01-25 Thread Vratislav Podzimek
On Mon, 2012-01-23 at 15:48 +0100, Olivier Deckmyn wrote:
> Hi,
> 
> 
> I’m building an Python application that has to connect and disconnect
> from Wifi on linux box. It's my very first experience with d-bus and
> gobject.
> 
> 
> I’m using NetworkManager layer, through the nice networkmanager lib
> found in cnetworkmanager
> (http://vidner.net/martin/software/cnetworkmanager/ thanx to Martin
> Vidner), in my daemon (named stationd).
Don't know if something has changed, but last time I was looking at the
cnetworkmanager code it was using the old NM API (version 0.7 I think).

-- 
Vratislav Podzimek

Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic

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


Re: Querying network state via D-Bus; unexpected result values

2011-11-29 Thread Vratislav Podzimek
On Mon, 2011-11-28 at 15:44 +0100, Jirka Klimes wrote:
> On Monday 28 of November 2011 02:14:07 Adam Tauno Williams wrote:
> > I'm attempting to interrogate the state of the network condition via
> > Network Manager's D-Bus service.  I can reliably get a value, but the
> > value seems incorrect.
> > 
> > According to
> > <http://projects.gnome.org/NetworkManager/developers/spec-07.html#type-NM_D
> > EVICE_STATE> I expect to see a value of 8 [NM_DEVICE_STATE_ACTIVATED] if
> > the device is online.   But what I see from call is generally a 20 if the
> > interface [Device 0, eth0] is unplugged and a value of 100 if the
> > interface is online.
> > 
> 
> The link you use is for NM 0.7, but according to device states value you 
> apparently use NM 0.9 that changed state codes.
Well, the results when querying google for "network manager dbus api"
are far from being ideal. I fell into that trap too some months ago.

-- 
Vratislav Podzimek

Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic

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


Re: Display the network manager applet by command line

2011-09-13 Thread Vratislav Podzimek
On Tue, 2011-09-13 at 07:46 +0200, Julien Briche wrote:
> On 12/09/2011 23:29, Dan Williams wrote:
> > On Fri, 2011-09-09 at 08:01 +0200, Julien Briche wrote:
> >> On 08/09/2011 19:39, Dan Williams wrote:
> >>> On Wed, 2011-09-07 at 08:51 +0200, Julien Briche wrote:
> >>>> Hello,
> >>>> I am currently working on a ubuntu 10.10 and using NetworkManager APplet
> >>>> 0.8.1.
> >>>> I would like to display the network manager applet by a command line but
> >>>> couldn't find any.
> >>>> Actually, if I click on the network-manager applet icon on the panel,
> >>>> the applet appears, but I want it to appear without clicking.
> >>>> I tried any soft provided by network manager, and also tried to
> >>>> dbus-monitor the appearance of the applet but nothing happens on
> >>>> dbus-monitor on click.
> >>> Two considerations here.  First, if you're using the stock nm-applet,
> >>> you need to have a "notification area" applet on your panel, which is
> >>> what nm-applet embeds itself in.  Most desktops (Gnome, KDE, XFCE, etc)
> >>> have a notification area.
> >>>
> >>> However, if you're using Ubuntu 10.10 or later, Ubuntu-specific
> >>> modifications to nm-applet make the applet present itself using the
> >>> generic menu indicator system (libindicator) and thus you have to have
> >>> something that provides that indicator interface that nm-applet can talk
> >>> to.
> >>>
> >>> Assumign you  have the pre-requisites, you can simply type:
> >>>
> >>> nm-applet&
> >>>
> >>> and that will start nm-applet and return you to the command prompt.  Or
> >>> use your favorite login/session manager to simply
> >>> spawn /usr/bin/nm-applet and it should show up.
> >>>
> >>> Dan
> >>>
> >>>
> >>>
> >> Hello,
> >> thanks for your answer but it is not what I looked for.
> >> Actually the nm-applet is running and I can see its icon in the
> >> notification area (of gnome).
> >> What I want to do is to see the panel with all the networks available
> >> and all the options.
> >> When I do type :
> >>
> >> nm-applet&
> >>
> >> , it ouputs:
> >>
> >>an instance of nm-applet is already running
> > Ah, so do you mean you want a command-line list of available networks,
> > or you'd like some mechanism to cause nm-applet to drop it's menu down
> > and show networks, or something else?
> >
> > Dan
> >
> 
> Hello,
> Iin fact, I want a command line to cause nm-applet to drop it's menu 
> down and show networks,
> like when I click on the nm icon in the notification area
> Julien

Try to look at Dogtail [1] or LDTP [2]. Both should provide a solution
for you, I think.

[1] https://fedorahosted.org/dogtail/
[2] http://ldtp.freedesktop.org/wiki/About

--
Vratislav Podzimek

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


Re: NM utils in Python?

2011-06-22 Thread Vratislav Podzimek
On Wed, 2011-06-22 at 10:52 +0300, Alex Pyattaev wrote: 
> You can use any C function in python natively with CDLL module. No need for 
> rewriting anything.  Hope it helps.
Thanks, that's great!

Vratislav Podzimek

> On Wednesday 22 June 2011 09:28:23 Vratislav Podzimek wrote:
> > Hi everyone,
> > is there any way how to use NM utils in Python? This time I need
> > something like 'nm_utils_ip4_netmask_to_prefix()', but there is are many
> > other very useful functions in libnm-util-nm-utils.
> > If there's no way how to use them in Python it might be great to change
> > it. Have a nm-utils Python module written in C? I could do something for
> > it but I have no experience with writing Python modules in C so it would
> > take quite a long time.
> > 
> > Thanks a lot in advance for any advice.
> > Vratislav Podzimek
> > 
> > ___
> > networkmanager-list mailing list
> > networkmanager-list@gnome.org
> > http://mail.gnome.org/mailman/listinfo/networkmanager-list



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


NM utils in Python?

2011-06-22 Thread Vratislav Podzimek
Hi everyone,
is there any way how to use NM utils in Python? This time I need
something like 'nm_utils_ip4_netmask_to_prefix()', but there is are many
other very useful functions in libnm-util-nm-utils.
If there's no way how to use them in Python it might be great to change
it. Have a nm-utils Python module written in C? I could do something for
it but I have no experience with writing Python modules in C so it would
take quite a long time.

Thanks a lot in advance for any advice.
Vratislav Podzimek

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


Re: Password Security

2011-06-08 Thread Vratislav Podzimek
As Pantelis mentioned -- if you want to have password not visible for
common users, make it system wide. Otherwise you would have to keep your
eye on your laptop when logged in. 
Hint: You can always lock screen when leaving

On Wed, 2011-06-08 at 10:10 +0200, Timo Babst wrote:
> Hello, I am using NetworkManager Applet 0.8. It works great except for 
> one very annoying thing : there is a checkbox that says "show password" 
> and someone (luckily a friend) was able to copy my password just by 
> using this little funny feature. Could'nt you make sure that the user 
> has to be root in order to view the password? It IS very annoying, since 
> this feature makes every password absolutely useless. Sorry to be so 
> direct, but this really is a BIG issue for me (and I think it should not 
> be too hard to change it for the guy who developped it).
> 
> Best regards,
> 
> Timo Babst
> ___
> networkmanager-list mailing list
> networkmanager-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/networkmanager-list


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


Re: changing ip addresses using nm dbus with qt

2011-06-06 Thread Vratislav Podzimek
Hi,
first of all, you have to get connection which you want to change. ip
addresses are set for connection not for device.
You can use ListConnections() method of
org.freedesktop.NetworkManager.Settings
(http://projects.gnome.org/NetworkManager/developers/migrating-to-09/spec.html#org.freedesktop.NetworkManager.Settings)
 for this. And then you would have to get connection settings with 
GetSettings() method of org.freedesktop.NetworkManager.Settings.Connection 
(http://projects.gnome.org/NetworkManager/developers/migrating-to-09/spec.html#org.freedesktop.NetworkManager.Settings.Connection)
You can then change settings as you need and then use Update() (just
above GetSettings() on the latter link).

I don't know Qt--D-Bus, so I can't give you exact example.
Vratislav Podzimek

On Mon, 2011-06-06 at 15:37 +0530, Savio Sebastian wrote:
> Hi all,
> I am trying to change the ip addresses(switching between DHCP and
> manual) using nm dbus with the qt
> i am able to get the devices list  but how can i change the ip
> addresses
> any examples available
> Thanks
> 
> ___
> networkmanager-list mailing list
> networkmanager-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/networkmanager-list


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


Re: script set static ip

2011-05-30 Thread Vratislav Podzimek
Or you can always use the D-Bus API which can give you more feedback. ;)

Vratislav Podzimek


On Fri, 2011-05-27 at 16:48 +0200, Elias wrote:
> Hi Carl,
> 
> I think the easiest way is to create the corresponding config file.
> 
> Here is how to do that:
> http://trac.linexa.de/wiki/development/BootCD-booting#Createastaticnetworkmanagerfileforeth0
> 
> I hope this is what you want...
> 
> Regards,
> Alex
> 
> On 05/27/2011 04:34 PM, Carl Karsten wrote:
> > how do I create additional 'connections' - the thing that gets created
> > by the gui
> > "Edit Connections...", "New"
> >
> > I would like to create 3:
> > dhcp (same as default Auto)
> > static: 10.0.0.1
> > local IP: link-local only
> >
> > I am expecting to use gconftool-2 but when I looked at gconf-editor I
> > could not find the static IP I created using the GUI.
> >
> 
> 
> ___
> networkmanager-list mailing list
> networkmanager-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/networkmanager-list


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


Re: WEP-key format

2011-04-15 Thread Vratislav Podzimek
On Thu, 2011-04-14 at 13:14 -0500, Dan Williams wrote:
> On Tue, 2011-04-12 at 11:36 +0200, Vratislav Podzimek wrote:
> > On Tue, 2011-04-12 at 11:30 +0200, Vratislav Podzimek wrote:
> > > Hi,
> > > I am writing a simple Python client (or module) which would create a new
> > > wireless connection via NM D-Bus Interface. I have no problems with
> > > uprotected networks and also with WPA protected networks. But I cannot
> > > make it working with WEP. According to /var/log/messages there is a
> > > problem with WEP key:
> > > ifcfg-rh:
> > > parsing /etc/sysconfig/network-scripts/ifcfg-anaconda_wifi_test4 ... 
> > > ifcfg-rh: error: Invalid WEP key length.
> > > 
> > > According to
> > > http://www.mail-archive.com/networkmanager-list@gnome.org/msg07935.html
> > > I repeat characters of passphrase to have 64 chars and then I use md5
> > > hex digest.
> > > e.g.:
> > > passphrase: 'abcde'
> > > repeated:
> > > 'abcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcd'
> > > 
> > > ___
> > > networkmanager-list mailing list
> > > networkmanager-list@gnome.org
> > > http://mail.gnome.org/mailman/listinfo/networkmanager-list
> > Sorry, I accidentaly hit CTLR+ENTER instead of ENTER. So here is the
> > rest:
> > hexdigest: '04e49e18f78a0111df976d1a5a348651'
> > 
> > Is it possible to use this way or is there another way to be used for
> > getting a wep-key0 for the Connection.Settings dictionary?
> 
> If you have a passphrase, you can send the passphrase as it is, and NM
> will do the hashing.  But to ensure that the hashing is done correctly,
> set the "wep-key-type" item appropriately.  See the following for more
> details of that item:
> 
> http://projects.gnome.org/NetworkManager/developers/settings-spec-08.html
> 
> Dan
> 
> 
Thanks a lot for the link. Reading the page solved my problem and
probably many more that would otherwise occur in future. What is weird
is that I haven't come accross this page while "attacking google".

Vrata Podzimek

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


Re: WEP-key format

2011-04-12 Thread Vratislav Podzimek
On Tue, 2011-04-12 at 11:30 +0200, Vratislav Podzimek wrote:
> Hi,
> I am writing a simple Python client (or module) which would create a new
> wireless connection via NM D-Bus Interface. I have no problems with
> uprotected networks and also with WPA protected networks. But I cannot
> make it working with WEP. According to /var/log/messages there is a
> problem with WEP key:
> ifcfg-rh:
> parsing /etc/sysconfig/network-scripts/ifcfg-anaconda_wifi_test4 ... 
> ifcfg-rh: error: Invalid WEP key length.
> 
> According to
> http://www.mail-archive.com/networkmanager-list@gnome.org/msg07935.html
> I repeat characters of passphrase to have 64 chars and then I use md5
> hex digest.
> e.g.:
> passphrase: 'abcde'
> repeated:
> 'abcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcd'
> 
> ___
> networkmanager-list mailing list
> networkmanager-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/networkmanager-list
Sorry, I accidentaly hit CTLR+ENTER instead of ENTER. So here is the
rest:
hexdigest: '04e49e18f78a0111df976d1a5a348651'

Is it possible to use this way or is there another way to be used for
getting a wep-key0 for the Connection.Settings dictionary?

Thanks a lot for your advice.
Vratislav Podzimek


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


WEP-key format

2011-04-12 Thread Vratislav Podzimek
Hi,
I am writing a simple Python client (or module) which would create a new
wireless connection via NM D-Bus Interface. I have no problems with
uprotected networks and also with WPA protected networks. But I cannot
make it working with WEP. According to /var/log/messages there is a
problem with WEP key:
ifcfg-rh:
parsing /etc/sysconfig/network-scripts/ifcfg-anaconda_wifi_test4 ... 
ifcfg-rh: error: Invalid WEP key length.

According to
http://www.mail-archive.com/networkmanager-list@gnome.org/msg07935.html
I repeat characters of passphrase to have 64 chars and then I use md5
hex digest.
e.g.:
passphrase: 'abcde'
repeated:
'abcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcd'

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