Agreement to relicense NetworkManager under LGPL-2.1+

2020-05-15 Thread Pantelis Koukousoulas via networkmanager-list
FWIW,
I, Koukousoulas Pantelis, agree to relicense my contributions to
NetworkManager as LGPL-2.1+ as proposed by Thomas Haller. (I don't know if
there is any code from me
left in NetworkManager, since I haven't touched the project for many years,
but in case there is, I happily agree to relicense it).

Cheers,
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: cnetworkmanager: Will --wpa-pass expose my password?

2012-12-03 Thread Pantelis Koukousoulas
On Mon, Dec 3, 2012 at 3:32 AM,  brom...@lavabit.com wrote:
 Hello!

 I'd like to try cnetworkmanager. The only thing that stops me is the
 following options:

   --wep-hex=KEY use this WEP key of 26 hex digits
   --wep-pass=KEYuse this WEP passphrase
   --wpa-psk-hex=KEY use this WPA key of 64 hex digits
   --wpa-pass=KEYuse this WPA passphrase

 Will the above put a password in .bash_history?

 I don't want to store my password in a file (even with strict
 permissions.)

ΙΜΗΟ .bash_history is not such a big problem since you can
just do unset HISTFILE before calling the command.

/proc/*/cmdline on the other hand is probably more dangerous
and less easy to deal with.
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: NM Without UI

2012-09-17 Thread Pantelis Koukousoulas
On Mon, Sep 17, 2012 at 10:18 AM, Sanjay Pallikera san...@ridgerun.com wrote:
 Hi Pantelis,

 I hope 'nmcli' uses Dbus, because I want NM (without UI) with DBus strictly
 for my project.

Please don't send personal emails, send to the list instead.

All 3 solutions that Thomas mentioned use DBus to communicate with NM.

Just in the first case you would speak dbus directly, in the second case you
would speak dbus transparently through the libnm-glib library (e.g., by writing
a C or python program) and in the third case you would use nmcli from the shell.

It is your choice which one works better for your project.

Cheers,
Pantelis
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: NM Without UI

2012-09-17 Thread Pantelis Koukousoulas
On Mon, Sep 17, 2012 at 10:55 AM, Sanjay Pallikera san...@ridgerun.com wrote:
 Sorry Pantelis,
 Actually I can not see the 'Reply' button in the following link,

 https://mail.gnome.org/archives/networkmanager-list/2012-September/msg00115.html

 So I shoot email to your email ids,

 Could you please point me a link(thread) where I can reply instantly or I
 think just I  have shoot email to networkmanager-list@gnome.org ?

This thread you can reply to, just do reply to all instead of
reply. If you don't
have a reply to all or even better reply to list, then just write to
networkmanager-list@gnome.org like you said :)

Cheers,
Pantelis
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: NM Without UI

2012-09-17 Thread Pantelis Koukousoulas
On Mon, Sep 17, 2012 at 11:08 AM, Sanjay Pallikera san...@ridgerun.com wrote:
 So I need not include pkt...@gmail.com also? just I will reply to
 networkmanager-list@gnome.org is that ok?

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


Re: NM Without UI

2012-09-16 Thread Pantelis Koukousoulas
On Sun, Sep 16, 2012 at 8:30 PM, Sanjay Pallikera san...@ridgerun.com wrote:
 Hello,

 Actually I want to integrate NM with embedded systems without UI, so I want
 only a command line tool or a daemon.

 Kindly pls provide some info on this.

 Thanks in advance
 Sanjay

NM is actually just a daemon with no UI. The available UIs are separate applets.
There is also a command-line utility to control the daemon (nmcli).

Cheers,
Pantelis
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Testing of ADSL device support branch

2012-02-14 Thread Pantelis Koukousoulas
Hi,

Sorry for taking so long to test the latest adsl branch, I was in a
situation where I couldn't
compile NetworkManager's git. Now that I have a system with latest
ubuntu (12.04 alpha)
here are my rough results:

1) I needed to add --enable-more-warnings=no in order to get
NetworkManager git to compile
due to deprecation warnings coming from glib regarding

2) Once I got it to build successfully:

   * pppoe worked right away, thanks for eliminating br2684ctl!
   I liked all the cleanup / improvement changes

   * pppoa broke because of a small mistake while converting to
protocol constants I think.
 With a trivial change

-   } else if (g_strcmp0 (protocol, NM_SETTING_ADSL_PROTOCOL_PPPOA)) {
+   } else if (g_strcmp0 (protocol, NM_SETTING_ADSL_PROTOCOL_PPPOA) == 0) {

 it works again fine.
 You can find the above change in patch form by pulling from
 git://github.com/pkt/NetworkManager.git (adsl branch)

   * routed ip / ipoatm remains untested and non-working since
I don't have
  access to a system needing this mode of operation.

3) The above are for IPv4. IPv6 still doesn't work for various reasons
(small ones I think).
I can try my hand on fixing it myself if I find some free time and
contributions are
welcome as well of course.

Thanks Dan for your work on these patches :)

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


Re: Force default gateway for a specific connection?

2012-01-20 Thread Pantelis Koukousoulas
On Fri, Jan 20, 2012 at 11:13 AM, Thomas Bechtold
thomasbecht...@jpberlin.de wrote:
 That's not working in my case because both conenctions should grap the
 default route, but the modem connection should have a higher priority.

My humble opinion is that it should be like this by default, i.e., ppp
connections
should have higher priority for getting the default route with the
rationale being
that LAN connections can be used for many things while ppp connections are
more internet-specific in general.

Is there any real advantage for LAN to have higher priority than PPP?
___
networkmanager-list mailing list
networkmanager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: [RFC] ADSL: Experimental PPPoE support

2011-12-12 Thread Pantelis Koukousoulas
On Fri, Dec 9, 2011 at 8:05 AM, Dan Williams d...@redhat.com wrote:
 On Tue, 2011-05-17 at 21:38 +0300, Pantelis Koukousoulas wrote:
 This is a first cut at experimental PPPoE support for ADSL devices.
 There are several shortcuts and the code is ugly, but it works so
 it can be used as a strawman to improve upon.

 Happily waiting for comments / testing / suggestions :)

 I rebased the 'adsl' branch to git master and wrote some code to talk
 the ioctls directly instead of using br2684ctl.  As Dave Woodhouse
 pointed out, br2684ctl isn't that complicated so we might as well just
 talk to the kernel.  However, I don't have an ADSL connection to test
 with (I only have a modem for basic hardware detection support) so if
 anyone can test out the code on the 'adsl' branch that would be great.
 Make sure to run NM with --log-level=debug or to set level=debug in
 the [logging] section of NetworkManager.conf so we can more easily debug
 any failures.

Thanks :)

I will try to test it today and also provide ubuntu packages for other people
to test more easily as well.

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


Re: Trouble with privileges on dev version of NM

2011-06-18 Thread Pantelis Koukousoulas
On Sat, Jun 18, 2011 at 11:42 AM, Alex Pyattaev alex.pyatt...@gmail.com wrote:
 Sorry to bring it up again,
 but I had to go through the whole code of NM to find the root of this problem,
 and it seems that it has nothing to do with NM itself, but rather with
 interaction between NM and wpa-supplicant. Can anyone recall any trouble like
 that in there? My knowlege of WPA supplicant code is very limited, therefore I
 can not really debug this problem

http://mail.gnome.org/archives/networkmanager-list/2011-June/msg00089.html
___
networkmanager-list mailing list
networkmanager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: Display nm-secure-lock in appet if wlan is secure

2011-06-11 Thread Pantelis Koukousoulas
On Sat, Jun 11, 2011 at 2:26 PM, Goldstein goldstein...@gmail.com wrote:
 Hi guys,

 I'm new to the list. Sorry if this kind of message is not appropriate.

 The thing is that I find it a bit annoying that nm applet does not show the
 nm-secure-lock icon on top of the nm-signal-XX icon when I'm connected to a
 secure wlan network. I connect to may different wlans on a daily basis. In
 some of them my packets are transmitted encrypted, in some others are
 transmitted in the clear, and it would be great to have a visual aid to
 remind me to which kind of wlan I'm connected to (so I don't, for example,
 check my email using POP3).

 I wanted to provide a proper patch for the issue but I haven't been able to
 compile nm from the sources. However, I attach an incomplete and untested
 patch, that maybe one of you guys can use. Do you think something like this
 could be implemented in trunk?

IMHO, independent of the usefulness of the patch, you should really use
application level encryption (ssh, https, pop3s) for transfer of data you
consider sensitive. Even in the case of an encrypted wireless link, it is
far from impossible that someone is sniffing the traffic at the router
or even ISP.

What's more, there is no guarantee that these logs are not persistent,
which means a lot of people might look and search them.

Again, the above is independent of the potential value ot the patch itself.

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


Re: Password Security

2011-06-08 Thread Pantelis Koukousoulas
On Wed, Jun 8, 2011 at 11:10 AM, Timo Babst timo.ba...@epfl.ch 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).

Sorry to be so direct but it doesn't make every password absolutely
useless because it is not common practice for security-sensitive
people to give away their laptops, while logged in even ...

Notice that for connections that have user session scope, only your
account has access to your password, if good job is done then noone
else, (even root) should be able to access it easily.

The best is not to give your laptop to your friend, but if you want to
keep doing this, you can make the connection system scope and then
only root can see the password, as you requested.

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


Re: F15 NetworkManager and Lenovo T61/Intel 4965AGN Wireless

2011-05-30 Thread Pantelis Koukousoulas
On Tue, May 31, 2011 at 1:57 AM, Tim Evans tkev...@tkevans.com wrote:

 Just upgraded my Lenovo ThinkPad T61 from Fedora 14 to Fedora 15 (via
 preupgrade) and lost my Intel AGN wireless in the process. Wireless was
 working well with F-14.

 Actually, NetworkManager itself barfs (see debug output of a manual
 start, attached).  /var/log/dmesg is also attached for reference.

It seems that It dies while parsing
/etc/sysconfig/network-scripts/ifcfg-clatimor_farms

You can try to move this script somewhere and see what happens.
Also it would probably be nice if you can send an anonymized version
of this script (without any usernames / passwords etc) that still reproduces
the crash to the list, so that the bug can be fixed.

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


Re: cross compiling without gnome

2011-05-25 Thread Pantelis Koukousoulas
On Wed, May 25, 2011 at 2:59 PM,  raghunathan.kailasanat...@wipro.com wrote:
 Hi list,
 I am cross-compiling nm for an embedded target. I don't require
 any GNOME/GTK/GUI/applet functionality. Do I still require dbus-glib ? If not,
 how can I remove that from the config ?

D-BUS is not a GUI thing. It is the IPC that NM uses to communicate
with everything,
including the daemons it manages (modemmanager, wpa_supplicant, pppd
etc) and the command-line client. So even if you hacked the source and
removed d-bus, the resulting
NetworkManager would not be able to manage much.

 Also what would be appropriate --with-distro string to use for
 configure ? ... the target does not use any stock linux distributions (it has
 a custom linux port)

You can check what --with-distro the BLFS book proposes these days for example,
but probably the best would be to implement the proper backend for
your own distro
(based on what is already there) and thus use your distro's name as
--with-distro
argument. I don't think it is hard to do that at all.

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


Re: [PATCH 2/3] ADSL: Carrier Handling and PPP support

2011-05-21 Thread Pantelis Koukousoulas
On Sat, May 21, 2011 at 3:22 AM, David Woodhouse dw...@infradead.org wrote:
 Hm, new code in the 21st century without IPv6 support? :(
 I would need that fixed before I could test this.

Well, the reason that I didn't try to implement IPv6 in the first
version is that unfortunately my provider still doesn't support it,
so I wouldn't be able to test if it works :(

Is it true that pretty much the only thing needed for IPv6 is to
add the ipv6 option to pppd? (plus any networkmanager
specific stuff that may be needed).

If it is like this, it won't be hard to add support so that you can
test the code and maybe also look into adding this to the other
ppp links as well.


 +             vpi = nm_setting_adsl_get_vpi (adsl_pppoa);
 +             vci = nm_setting_adsl_get_vci (adsl_pppoa);
 +             encapsulation = nm_setting_adsl_get_encapsulation (adsl_pppoa);
 +             vpivci = g_strdup_printf(%s.%s, vpi, vci);

 You want to specify device number there, not just assume there's only
 one. There are dual-port PCI ADSL cards that work quite nicely in
 Linux...

I see, you mean like 0.8.35 and 1.8.35 for the second port.
I will try to fix this.

 +
 +             nm_cmd_line_add_string (cmd, plugin);
 +             nm_cmd_line_add_string (cmd, pppoatm.so);

 Hm, are you also supporting PPPoE(oA)? There are some providers which
 require it. Essentially the *only* thing you do on the ATM link itself
 is run br2684ctl to create a 'virtual' Ethernet device. And then you do
 normal PPPoE on that device.

I posted a proof of concept implementation of PPPoE patch in this list:
http://www.mail-archive.com/networkmanager-list@gnome.org/msg17967.html

Could you take a look? This was just enough code to get me a
successful PPPoE connection, but with your help/advise I could
improve it to be more generally useful :)

 +             nm_cmd_line_add_string (cmd, noipdefault);

 Why's that unconditional? Do we not have the option to set static IP
 addresses on a PPP connection? It's useful in some cases.

My impression is that NetworkManager wants it this way, it gets the IP
that the provider assigns but this doesn't mean it will actually set
this IP, if you say that you want a static IP it will use the one you
provide instead.

 +     dbus_g_error_domain_register (NM_SETTING_SERIAL_ERROR, NULL, 
 NM_TYPE_SETTING_ADSL_ERROR);

 s/SERIAL/ADSL/ ?

Indeed, thanks for spotting :)

Thanks a lot for your interest and your review :)
Pantelis
___
networkmanager-list mailing list
networkmanager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: 1199:6832 Sierra Wireless, Inc. MC8780 not working with NetworkManager 0.8.3.998 / ModemManager 0.4

2011-05-20 Thread Pantelis Koukousoulas
On Thu, May 19, 2011 at 11:00 PM, Gerd Bavendiek
gerd.bavend...@googlemail.com wrote:
 I have a ID 1199:6832 Sierra Wireless, Inc. MC8780 Device.
 Unfortunately NetworkManager in Ubuntu 9.10 Karmic
 was the last version I could use the device with. I recently checked
 Ubuntu 11.04 Natty (coming with NetworkManager version
 0.8.3.998). This too does not work, forcing me to stay with Karmic.
[...]
 All the details are here:
[...]
 Is there anything I can do (besides from learning to hack at
 NetworkManager ...) ?

Hi, I 'm not a NetworkManager dev, just a fellow ubuntu user :)

From a cursory reading of the bug reports you cited it seems like some
sierra modems crash when ModemManager sends CFUN=1 to them.

Can you help verify if this is indeed the case with yours as well?

I put a version of natty's modemmanager with the attached patch
applied in my ppa. So, the only thing you need to do to test is:

sudo add-apt-repository ppa:pktoss/ppa
sudo apt-get update
sudo apt-get install modemmanager

restart networkmanager/modemmanager or to be 100% sure you
can just reboot.

Test to see if your device works now

sudo add-apt-repository -r ppa:pktoss/ppa
sudo apt-get update

(The last 2 steps are in order to remove my ppa to avoid it breaking
your system with my other experimental stuff).

Alternatively you can just build modemmanager with the attached
patch applied by yourself.

If the patched modemmanager works, then please say it so that
the appropriate quirk for your device can be added.

Thanks,
Pantelis
Index: modemmanager-0.4+git.20110124t203624.00b6cce/plugins/mm-modem-sierra-gsm.c
===
--- modemmanager-0.4+git.20110124t203624.00b6cce.orig/plugins/mm-modem-sierra-gsm.c	2011-05-20 08:23:29.908008899 +0300
+++ modemmanager-0.4+git.20110124t203624.00b6cce/plugins/mm-modem-sierra-gsm.c	2011-05-20 08:32:49.606784301 +0300
@@ -638,6 +638,32 @@
 }
 
 static void
+set_property (GObject *object, guint prop_id,
+  const GValue *value, GParamSpec *pspec)
+{
+/* gobject does not like to just have get_property and seems to
+ * to not honour our overriden properties ... keep this as an empty
+ * func around */
+}
+
+static void
+get_property (GObject *object, guint prop_id,
+  GValue *value, GParamSpec *pspec)
+{
+/* At least some Sierra modems go down if you send a power up command */
+switch (prop_id) {
+case MM_GENERIC_GSM_PROP_POWER_UP_CMD:
+g_value_set_string (value, );
+break;
+case MM_GENERIC_GSM_PROP_POWER_DOWN_CMD:
+g_value_set_string (value, );
+break;
+default:
+break;
+}
+}
+
+static void
 mm_modem_sierra_gsm_class_init (MMModemSierraGsmClass *klass)
 {
 GObjectClass *object_class = G_OBJECT_CLASS (klass);
@@ -653,5 +679,16 @@
 gsm_class-get_access_technology = get_access_technology;
 gsm_class-get_sim_iccid = get_sim_iccid;
 gsm_class-do_disconnect = do_disconnect;
+
+object_class-get_property = get_property;
+object_class-set_property = set_property;
+
+g_object_class_override_property (object_class,
+  MM_GENERIC_GSM_PROP_POWER_UP_CMD,
+  MM_GENERIC_GSM_POWER_UP_CMD);
+
+g_object_class_override_property (object_class,
+  MM_GENERIC_GSM_PROP_POWER_DOWN_CMD,
+  MM_GENERIC_GSM_POWER_DOWN_CMD);
 }
 
___
networkmanager-list mailing list
networkmanager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: 1199:6832 Sierra Wireless, Inc. MC8780 not working with NetworkManager 0.8.3.998 / ModemManager 0.4

2011-05-20 Thread Pantelis Koukousoulas
On Fri, May 20, 2011 at 10:10 AM, Aleksander Morgado
aleksan...@lanedo.com wrote:

 
   From a cursory reading of the bug reports you cited it seems like some
  sierra modems crash when ModemManager sends CFUN=1 to them.
 
  Can you help verify if this is indeed the case with yours as well?
 

 So it really seems that not only Wavecom modems get a whole software
 restart (including USB stack) when they get AT+CFUN=1. The thing is, is
 removing the power-up command a solution for *all* Sierra modems or are
 there any Sierra modems that really need the power-up command? If so,
 we'll probably need to disable the power-up only for specific models,
 like the one reported in the bug; or the other way around, enable it
 only for only some specific models.

From reading the cited bug reports and from general instict I would think
that probably some of them need CFUN=1 and others crash when they get it
so the best thing to do is enable it selectively. (We can start from this
USBID and expand).

Unfortunately I don't have the device myself, so I can't test.


 Wasn't that patch already applied to Ubuntu's MM? According to the logs
 in https://bugs.launchpad.net/ubuntu/+source/modemmanager/+bug/459052
 that was written by Alexander Sack long ago, and possibly applied in
 Ubuntu... (comment #7?)

It was probably applied to ubuntu once but somehow it got dropped (I think
during the karmic - lucid transition if I read well).

In the current version (natty) there is no such patch from what I could see.

In any case, a distro-local patch is really a bad idea for solving this type
of problems, especially when you have such a friendly and responsive
upstream like in this case.

Unfortunately I don't have any modemmanager experience or time to
implement the quirk the right way, so if someone can start from
the previous attached patch and fix the problem correctly, it would be
great :)

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


Re: 1199:6832 Sierra Wireless, Inc. MC8780 not working with NetworkManager 0.8.3.998 / ModemManager 0.4

2011-05-20 Thread Pantelis Koukousoulas
On Fri, May 20, 2011 at 12:59 PM, Aleksander Morgado
aleksan...@lanedo.com wrote:
 Attached a patch which should do AT+CFUN=1 only if product ID is not
 0x6832. Can you guys test it?

 Minor fix in the previous patch, please use the one here instead.

I updated the package in my ppa with your patch.

Gerd, can you test the new one?

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


Re: [PATCH 0/3] Support for ADSL modems v3

2011-05-20 Thread Pantelis Koukousoulas
On Fri, May 20, 2011 at 12:30 AM, Dan Williams d...@redhat.com wrote:

 Great work, I've pushed this to the 'adsl' branch which I just created
 off git master.  Lets keep testing and after 0.9 comes out we'll merge
 this right into 0.9.2.  Any further patches you post can get dumped
 right into the 'adsl' branch, which I'll try to keep up-to-date with
 master through periodic merges.

Great, thanks :)

 (I cleaned up a few things; I also made the VPI/VCI properties of the
 NMSettingAdsl uints since that just makes the validation easier; also
 memory leak when reading the carrier code where 'path' and 'contents'
 weren't getting freed)

Excellent, I 'm sorry for these mistakes but I don't have much free
time, so I sent the patches as soon as I got a working connection, to
avoid the case of me becoming MIA for a while and having the patches
bitrot.

Thanks a lot for fixing the problems :)

 Thanks again!

Thank you for NetworkManager :)

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


[PATCH 0/3] Support for ADSL modems v3

2011-05-17 Thread Pantelis Koukousoulas
This is the third version, with some minor bugfixes.

Pantelis Koukousoulas (3):
  ADSL: Settings and initial scaffolding
  ADSL: Carrier Handling and PPP support
  ADSL: Add libnm-glib and nmcli code

 cli/src/connections.c|   66 -
 cli/src/devices.c|4 +
 cli/src/settings.c   |   50 
 cli/src/settings.h   |2 +
 include/NetworkManager.h |3 +
 introspection/Makefile.am|1 +
 introspection/nm-device-adsl.xml |   15 +
 libnm-glib/Makefile.am   |6 +
 libnm-glib/libnm-glib.ver|4 +-
 libnm-glib/nm-device-adsl.c  |  236 +++
 libnm-glib/nm-device-adsl.h  |   62 
 libnm-glib/nm-device.c   |   10 +-
 libnm-util/Makefile.am   |2 +
 libnm-util/libnm-util.ver|   12 +
 libnm-util/nm-connection.c   |   25 ++-
 libnm-util/nm-connection.h   |2 +
 libnm-util/nm-setting-adsl.c |  541 ++
 libnm-util/nm-setting-adsl.h |   97 ++
 src/Makefile.am  |6 +
 src/nm-device-adsl.c |  596 ++
 src/nm-device-adsl.h |   60 
 src/nm-device.c  |8 +-
 src/nm-udev-manager.c|   49 +++-
 src/ppp-manager/nm-ppp-manager.c |   31 ++-
 src/settings/nm-settings.c   |2 +
 25 files changed, 1870 insertions(+), 20 deletions(-)
 create mode 100644 introspection/nm-device-adsl.xml
 create mode 100644 libnm-glib/nm-device-adsl.c
 create mode 100644 libnm-glib/nm-device-adsl.h
 create mode 100644 libnm-util/nm-setting-adsl.c
 create mode 100644 libnm-util/nm-setting-adsl.h
 create mode 100644 src/nm-device-adsl.c
 create mode 100644 src/nm-device-adsl.h

-- 
1.7.4.1

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


[PATCH 1/3] ADSL: Settings and initial scaffolding

2011-05-17 Thread Pantelis Koukousoulas
This patch adds the settings code (NMSettingAdsl) and the initial
scaffolding i.e., a tiny stub version of NMDeviceAdsl and the
udev handler code to get the device detected.

With this patch you should be able to see an atm device being detected
by networkmanager in the logs, although of course it doesn't
do anything useful yet.

Extract from the logs:

 [1304668252.341354] [nm-udev-manager.c:562] adsl_add(): adsl_add: ATM Device 
detected from udev. Adding ..
(ueagle-atm0): failed to look up interface index
(ueagle-atm0): new ADSL device (driver: 'ueagle-atm' ifindex: -1)
(ueagle-atm0): exported as /org/freedesktop/NetworkManager/Devices/2
(ueagle-atm0): now managed
(ueagle-atm0): device state change: unmanaged - unavailable (reason 'managed') 
[10 20 2]
(ueagle-atm0): deactivating device (reason: 2).
 [1304668252.345102] [nm-system.c:1349] flush_routes(): (ueagle-atm0) failed to 
lookup interface index
 [1304668252.347821] [nm-device.c:3912] nm_device_state_changed(): 
(ueagle-atm0): device is available,

In this version, we hack the nm-device.c:nm_device_get_priority() to get better 
priority
instead of changing the DeviceType enum.

Signed-off-by: Pantelis Koukousoulas pkt...@gmail.com
---
 include/NetworkManager.h |2 +
 introspection/Makefile.am|1 +
 introspection/nm-device-adsl.xml |   15 +
 libnm-util/Makefile.am   |2 +
 libnm-util/libnm-util.ver|   12 +
 libnm-util/nm-setting-adsl.c |  541 ++
 libnm-util/nm-setting-adsl.h |   97 +++
 src/Makefile.am  |6 +
 src/nm-device-adsl.c |   83 ++
 src/nm-device-adsl.h |   57 
 src/nm-device.c  |8 +-
 src/nm-udev-manager.c|   49 -
 12 files changed, 870 insertions(+), 3 deletions(-)
 create mode 100644 introspection/nm-device-adsl.xml
 create mode 100644 libnm-util/nm-setting-adsl.c
 create mode 100644 libnm-util/nm-setting-adsl.h
 create mode 100644 src/nm-device-adsl.c
 create mode 100644 src/nm-device-adsl.h

diff --git a/include/NetworkManager.h b/include/NetworkManager.h
index 17c3a11..6997771 100644
--- a/include/NetworkManager.h
+++ b/include/NetworkManager.h
@@ -101,6 +101,7 @@ typedef enum {
  * @NM_DEVICE_TYPE_WIMAX: an 802.16e Mobile WiMAX broadband device
  * @NM_DEVICE_TYPE_MODEM: a modem supporting analog telephone, CDMA/EVDO,
  * GSM/UMTS, or LTE network access protocols
+ * @NM_DEVICE_TYPE_ADSL: ADSL modem
  *
  * #NMState values indicate the current overall networking state.
  */
@@ -114,6 +115,7 @@ typedef enum {
NM_DEVICE_TYPE_OLPC_MESH = 6,
NM_DEVICE_TYPE_WIMAX = 7,
NM_DEVICE_TYPE_MODEM = 8,
+   NM_DEVICE_TYPE_ADSL  = 9,
 } NMDeviceType;
 
 /* General device capability flags */
diff --git a/introspection/Makefile.am b/introspection/Makefile.am
index 320245e..4950e7d 100644
--- a/introspection/Makefile.am
+++ b/introspection/Makefile.am
@@ -8,6 +8,7 @@ EXTRA_DIST = \
nm-device-wifi.xml \
nm-device-olpc-mesh.xml \
nm-device-ethernet.xml \
+   nm-device-adsl.xml \
nm-device-modem.xml \
nm-device-wimax.xml \
nm-device.xml \
diff --git a/introspection/nm-device-adsl.xml b/introspection/nm-device-adsl.xml
new file mode 100644
index 000..9610f98
--- /dev/null
+++ b/introspection/nm-device-adsl.xml
@@ -0,0 +1,15 @@
+?xml version=1.0 encoding=UTF-8 ?
+
+node name=/ 
xmlns:tp=http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0;
+  interface name=org.freedesktop.NetworkManager.Device.Adsl
+
+signal name=PropertiesChanged
+arg name=properties type=a{sv} tp:type=String_Variant_Map
+tp:docstring
+A dictionary mapping property names to variant boxed values
+/tp:docstring
+/arg
+/signal
+
+  /interface
+/node
diff --git a/libnm-util/Makefile.am b/libnm-util/Makefile.am
index 0a29e9c..9f452a4 100644
--- a/libnm-util/Makefile.am
+++ b/libnm-util/Makefile.am
@@ -14,6 +14,7 @@ libnm_util_include_HEADERS =  \
nm-connection.h \
nm-setting.h\
nm-setting-8021x.h  \
+   nm-setting-adsl.h   \
nm-setting-bluetooth.h  \
nm-setting-connection.h \
nm-setting-ip4-config.h \
@@ -43,6 +44,7 @@ libnm_util_la_csources = \
nm-param-spec-specialized.c \
nm-setting.c\
nm-setting-8021x.c  \
+   nm-setting-adsl.c   \
nm-setting-bluetooth.c  \
nm-setting-connection.c \
nm-setting-ip4-config.c \
diff --git a/libnm-util/libnm-util.ver b/libnm-util/libnm-util.ver
index 4ff0838..f433d0a 100644
--- a/libnm-util/libnm-util.ver
+++ b/libnm-util/libnm-util.ver
@@ -27,6 +27,7 @@ global:
nm_connection_get_setting_vpn;
nm_connection_get_setting_wimax

[PATCH 2/3] ADSL: Carrier Handling and PPP support

2011-05-17 Thread Pantelis Koukousoulas
This is the juice of the patch series. Initial cut at carrier handling
(by polling /sys/class/atm/$iface/carrier) and also support for calling
pppd with the proper command-line to achieve a connection.

Also implement the necessary boilerplate for the NM state machine to
be happy with our device.

This is a duct tape and gum implementation, i.e., prefer copypaste
over proper refactoring, due to limited time, but the foundations are
now there, so we can make it work right slowly-slowly :)

With this patch, you can already test carrier management but not yet
make a complete connection.

Relevant extract from logs:
info (ueagle-atm0): carrier now ON (device state 20)
info (ueagle-atm0): device state change: unavailable - disconnected (reason 
'carrier-changed') [20 30 40]

Signed-off-by: Pantelis Koukousoulas pkt...@gmail.com
---
 include/NetworkManager.h |1 +
 src/nm-device-adsl.c |  519 +-
 src/nm-device-adsl.h |5 +-
 src/ppp-manager/nm-ppp-manager.c |   31 +++-
 src/settings/nm-settings.c   |2 +
 5 files changed, 553 insertions(+), 5 deletions(-)

diff --git a/include/NetworkManager.h b/include/NetworkManager.h
index 6997771..f2e4727 100644
--- a/include/NetworkManager.h
+++ b/include/NetworkManager.h
@@ -34,6 +34,7 @@
 #defineNM_DBUS_INTERFACE   
org.freedesktop.NetworkManager
 #defineNM_DBUS_INTERFACE_DEVICENM_DBUS_INTERFACE .Device
 #define NM_DBUS_INTERFACE_DEVICE_WIRED  NM_DBUS_INTERFACE_DEVICE .Wired
+#define NM_DBUS_INTERFACE_DEVICE_ADSL   NM_DBUS_INTERFACE_DEVICE .Adsl
 #define NM_DBUS_INTERFACE_DEVICE_WIRELESS   NM_DBUS_INTERFACE_DEVICE 
.Wireless
 #define NM_DBUS_INTERFACE_DEVICE_BLUETOOTH  NM_DBUS_INTERFACE_DEVICE 
.Bluetooth
 #define NM_DBUS_PATH_ACCESS_POINT   NM_DBUS_PATH /AccessPoint
diff --git a/src/nm-device-adsl.c b/src/nm-device-adsl.c
index 212fec1..77e4d0a 100644
--- a/src/nm-device-adsl.c
+++ b/src/nm-device-adsl.c
@@ -1,5 +1,6 @@
 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
-/* NetworkManager -- Network link manager
+/*
+ * Pantelis Koukousoulas pkt...@gmail.com
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -15,26 +16,153 @@
  * with this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  *
- * Pantelis Koukousoulas pkt...@gmail.com
  */
 
 #include glib.h
+#include glib/gi18n.h
+#include stdlib.h
+#include string.h
 
 #include nm-glib-compat.h
 #include nm-device-adsl.h
 #include nm-device-interface.h
+#include nm-device-private.h
 #include nm-properties-changed-signal.h
+#include nm-glib-compat.h
+#include NetworkManagerUtils.h
+#include nm-logging.h
+
+#include ppp-manager/nm-ppp-manager.h
+#include nm-setting-adsl.h
 
 #include nm-device-adsl-glue.h
 
 G_DEFINE_TYPE (NMDeviceAdsl, nm_device_adsl, NM_TYPE_DEVICE)
 
+#define NM_DEVICE_ADSL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), 
NM_TYPE_DEVICE_ADSL, NMDeviceAdslPrivate))
+
+typedef enum
+{
+   NM_ADSL_ERROR_CONNECTION_NOT_ADSL = 0,
+   NM_ADSL_ERROR_CONNECTION_INVALID,
+   NM_ADSL_ERROR_CONNECTION_INCOMPATIBLE,
+} NMAdslError;
+
+#define NM_ADSL_ERROR (nm_adsl_error_quark ())
+#define NM_TYPE_ADSL_ERROR (nm_adsl_error_get_type ())
+
+static GQuark
+nm_adsl_error_quark (void)
+{
+   static GQuark quark = 0;
+   if (!quark)
+   quark = g_quark_from_static_string (nm-ethernet-error);
+   return quark;
+}
+
+typedef struct {
+   gbooleandisposed;
+   gbooleancarrier;
+   guint   carrier_poll_id;
+
+   /* PPP */
+   NMPPPManager *ppp_manager;
+   NMIP4Config  *pending_ip4_config;
+} NMDeviceAdslPrivate;
+
 enum {
PROPERTIES_CHANGED,
LAST_SIGNAL
 };
+
 static guint signals[LAST_SIGNAL] = { 0 };
 
+enum {
+   PROP_0,
+   PROP_CARRIER,
+
+   LAST_PROP
+};
+
+/* FIXME: Move it to nm-device.c and then get rid of all 
foo_device_get_setting() all around.
+   It's here now to keep the patch short. */
+static NMSetting *
+device_get_setting (NMDevice *device, GType setting_type)
+{
+   NMActRequest *req;
+   NMSetting *setting = NULL;
+
+   req = nm_device_get_act_request (device);
+   if (req) {
+   NMConnection *connection;
+
+   connection = nm_act_request_get_connection (req);
+   if (connection)
+   setting = nm_connection_get_setting (connection, 
setting_type);
+   }
+
+   return setting;
+}
+
+static void
+set_carrier(NMDeviceAdsl *self, const gboolean carrier)
+{
+   NMDeviceAdslPrivate *priv;
+   NMDeviceState state;
+
+   g_return_if_fail (NM_IS_DEVICE (self));
+
+   priv = NM_DEVICE_ADSL_GET_PRIVATE (self);
+
+   if (priv-carrier == carrier

[PATCH 3/3] ADSL: Add libnm-glib and nmcli code

2011-05-17 Thread Pantelis Koukousoulas
** Message: nm-ppp-plugin: (nm_phasechange): status 9 / phase 'running'
** Message: nm-ppp-plugin: (nm_ip_up): ip-up event
** Message: nm-ppp-plugin: (nm_ip_up): sending Ip4Config to NetworkManager...
NetworkManager[29155]: debug [1304671150.607440] [nm-netlink-monitor.c:117] 
link_msg_handler(): netlink link message: iface idx 35 flags 0x110D1
NetworkManager[29155]: info PPP manager(IP Config Get) reply received.
NetworkManager[29155]: info Activation (ueagle-atm0) Stage 4 of 5 (IP4 
Configure Get) scheduled...
NetworkManager[29155]: info Activation (ueagle-atm0) Stage 4 of 5 (IP4 
Configure Get) started...
NetworkManager[29155]: info Activation (ueagle-atm0) Stage 5 of 5 (IP 
Configure Commit) scheduled...
NetworkManager[29155]: info Activation (ueagle-atm0) Stage 4 of 5 (IP4 
Configure Get) complete.
NetworkManager[29155]: info Activation (ueagle-atm0) Stage 5 of 5 (IP 
Configure Commit) started...
NetworkManager[29155]: debug [1304671150.608918] [nm-system.c:222] 
sync_addresses(): (ppp0): syncing addresses (family 2)
NetworkManager[29155]: info (ueagle-atm0): device state change: ip-config - 
activated (reason 'none') [70 100 0]
NetworkManager[29155]: info Policy set 'MYISP' (ppp0) as default for IPv4 
routing and DNS.
NetworkManager[29155]: info Activation (ueagle-atm0) successful, device 
activated.
NetworkManager[29155]: info Activation (ueagle-atm0) Stage 5 of 5 (IP 
Configure Commit) complete.

Signed-off-by: Pantelis Koukousoulas pkt...@gmail.com
---
 cli/src/connections.c   |   66 ++--
 cli/src/devices.c   |4 +
 cli/src/settings.c  |   50 +
 cli/src/settings.h  |2 +
 libnm-glib/Makefile.am  |6 +
 libnm-glib/libnm-glib.ver   |4 +-
 libnm-glib/nm-device-adsl.c |  236 +++
 libnm-glib/nm-device-adsl.h |   62 +++
 libnm-glib/nm-device.c  |   10 ++-
 libnm-util/nm-connection.c  |   25 +-
 libnm-util/nm-connection.h  |2 +
 11 files changed, 451 insertions(+), 16 deletions(-)
 create mode 100644 libnm-glib/nm-device-adsl.c
 create mode 100644 libnm-glib/nm-device-adsl.h

diff --git a/cli/src/connections.c b/cli/src/connections.c
index 2646aa9..5308f04 100644
--- a/cli/src/connections.c
+++ b/cli/src/connections.c
@@ -34,6 +34,7 @@
 #include nm-client.h
 #include nm-setting-connection.h
 #include nm-setting-wired.h
+#include nm-setting-adsl.h
 #include nm-setting-pppoe.h
 #include nm-setting-wireless.h
 #include nm-setting-gsm.h
@@ -44,6 +45,7 @@
 #include nm-setting-wimax.h
 #endif
 #include nm-device-ethernet.h
+#include nm-device-adsl.h
 #include nm-device-wifi.h
 #if WITH_WIMAX
 #include nm-device-wimax.h
@@ -104,12 +106,13 @@ static NmcOutputField nmc_fields_settings_names[] = {
SETTING_FIELD (NM_SETTING_SERIAL_SETTING_NAME, 0),/* 7 
*/
SETTING_FIELD (NM_SETTING_PPP_SETTING_NAME, 0),   /* 8 
*/
SETTING_FIELD (NM_SETTING_PPPOE_SETTING_NAME, 0), /* 9 
*/
-   SETTING_FIELD (NM_SETTING_GSM_SETTING_NAME, 0),   /* 10 
*/
-   SETTING_FIELD (NM_SETTING_CDMA_SETTING_NAME, 0),  /* 11 
*/
-   SETTING_FIELD (NM_SETTING_BLUETOOTH_SETTING_NAME, 0), /* 12 
*/
-   SETTING_FIELD (NM_SETTING_OLPC_MESH_SETTING_NAME, 0), /* 13 
*/
-   SETTING_FIELD (NM_SETTING_VPN_SETTING_NAME, 0),   /* 14 
*/
-   SETTING_FIELD (NM_SETTING_WIMAX_SETTING_NAME, 0), /* 15 
*/
+   SETTING_FIELD (NM_SETTING_ADSL_SETTING_NAME, 0),  /* 10 
*/
+   SETTING_FIELD (NM_SETTING_GSM_SETTING_NAME, 0),   /* 11 
*/
+   SETTING_FIELD (NM_SETTING_CDMA_SETTING_NAME, 0),  /* 12 
*/
+   SETTING_FIELD (NM_SETTING_BLUETOOTH_SETTING_NAME, 0), /* 13 
*/
+   SETTING_FIELD (NM_SETTING_OLPC_MESH_SETTING_NAME, 0), /* 14 
*/
+   SETTING_FIELD (NM_SETTING_VPN_SETTING_NAME, 0),   /* 15 
*/
+   SETTING_FIELD (NM_SETTING_WIMAX_SETTING_NAME, 0), /* 16 
*/
{NULL, NULL, 0, NULL, 0}
 };
 #define NMC_FIELDS_SETTINGS_NAMES_ALL_X  NM_SETTING_CONNECTION_SETTING_NAME,\
@@ -122,6 +125,7 @@ static NmcOutputField nmc_fields_settings_names[] = {
  NM_SETTING_SERIAL_SETTING_NAME,\
  NM_SETTING_PPP_SETTING_NAME,\
  NM_SETTING_PPPOE_SETTING_NAME,\
+ NM_SETTING_ADSL_SETTING_NAME,\
  NM_SETTING_GSM_SETTING_NAME,\
  NM_SETTING_CDMA_SETTING_NAME,\
  NM_SETTING_BLUETOOTH_SETTING_NAME,\
@@ -331,6 +335,15 @@ nmc_connection_detail (NMConnection *connection, NmCli 
*nmc)
}
 
if (!strcasecmp (nmc_fields_settings_names[section_idx].name

[RFC] ADSL: Experimental PPPoE support

2011-05-17 Thread Pantelis Koukousoulas
(): netlink link message: iface idx 63 flags 0x1090
NetworkManager[1495]: debug [1305654576.314939] [nm-udev-manager.c:622] 
handle_uevent(): UDEV event: action 'add' subsys 'net' device 'ppp0'
NetworkManager[1495]: debug [1305654576.314991] [nm-udev-manager.c:525] 
net_add(): ignoring interface with type 512
rcvd [LCP ConfReq id=0x11 mru 1492 auth pap magic 0x701d0b64]
sent [LCP ConfAck id=0x11 mru 1492 auth pap magic 0x701d0b64]
rcvd [LCP ConfAck id=0x1 mru 1492 magic 0x2de132c2]
** Message: nm-ppp-plugin: (nm_phasechange): status 6 / phase 'authenticate'
** Message: nm-ppp-plugin: (get_credentials): passwd-hook, requesting 
credentials...
NetworkManager[1495]: debug [1305654576.420633] [nm-agent-manager.c:1044] 
nm_agent_manager_get_secrets(): Secrets requested for connection 
/org/freedesktop/NetworkManager/Settings/0 (adsl)
NetworkManager[1495]: debug [1305654576.420743] 
[nm-settings-connection.c:717] nm_settings_connection_get_secrets(): 
(34d04e69-fdd9-4231-af2c-25ed1f34dc2e/adsl:1) secrets requested flags 0x1 hint 
'password'
NetworkManager[1495]: debug [1305654576.421675] [nm-agent-manager.c:959] 
get_start(): (0x91fde80/adsl) system settings secrets sufficient
NetworkManager[1495]: debug [1305654576.422178] 
[nm-settings-connection.c:573] agent_secrets_done_cb(): 
(34d04e69-fdd9-4231-af2c-25ed1f34dc2e/adsl:1) existing secrets returned
NetworkManager[1495]: debug [1305654576.422419] 
[nm-settings-connection.c:579] agent_secrets_done_cb(): 
(34d04e69-fdd9-4231-af2c-25ed1f34dc2e/adsl:1) secrets request completed
NetworkManager[1495]: debug [1305654576.424015] 
[nm-settings-connection.c:618] agent_secrets_done_cb(): 
(34d04e69-fdd9-4231-af2c-25ed1f34dc2e/adsl:1) new agent secrets processed
** Message: nm-ppp-plugin: (get_credentials): got credentials from 
NetworkManager
sent [PAP AuthReq id=0x1 user=myu...@myisp.com password=hidden]
rcvd [PAP AuthAck id=0x1 ]
PAP authentication succeeded
peer from calling number 00:90:1A:41:65:24 authorized
** Message: nm-ppp-plugin: (nm_phasechange): status 8 / phase 'network'
sent [IPCP ConfReq id=0x1 addr 0.0.0.0 ms-dns1 0.0.0.0 ms-dns2 0.0.0.0]
rcvd [IPCP ConfNak id=0x1 addr 94.70.77.249 ms-dns1 195.170.0.1 ms-dns2 
195.170.2.2]
sent [IPCP ConfReq id=0x2 addr 94.70.77.249 ms-dns1 195.170.0.1 ms-dns2 
195.170.2.2]
rcvd [IPCP ConfAck id=0x2 addr 94.70.77.249 ms-dns1 195.170.0.1 ms-dns2 
195.170.2.2]
rcvd [IPCP ConfReq id=0x40 addr 80.106.108.12]
sent [IPCP ConfAck id=0x40 addr 80.106.108.12]
NetworkManager[1495]: debug [1305654576.812559] [nm-netlink-monitor.c:117] 
link_msg_handler(): netlink link message: iface idx 63 flags 0x110D1
local  IP address 94.70.77.249
remote IP address 80.106.108.12
primary   DNS address 195.170.0.1
secondary DNS address 195.170.2.2
** Message: nm-ppp-plugin: (nm_phasechange): status 9 / phase 'running'
** Message: nm-ppp-plugin: (nm_ip_up): ip-up event
** Message: nm-ppp-plugin: (nm_ip_up): sending Ip4Config to NetworkManager...
NetworkManager[1495]: info PPP manager(IP Config Get) reply received.
NetworkManager[1495]: info Activation (ueagle-atm0) Stage 4 of 5 (IP4 
Configure Get) scheduled...
NetworkManager[1495]: info Activation (ueagle-atm0) Stage 4 of 5 (IP4 
Configure Get) started...
NetworkManager[1495]: info Activation (ueagle-atm0) Stage 5 of 5 (IP 
Configure Commit) scheduled...
NetworkManager[1495]: info Activation (ueagle-atm0) Stage 4 of 5 (IP4 
Configure Get) complete.
NetworkManager[1495]: info Activation (ueagle-atm0) Stage 5 of 5 (IP 
Configure Commit) started...
NetworkManager[1495]: debug [1305654576.818828] [nm-system.c:222] 
sync_addresses(): (ppp0): syncing addresses (family 2)
Script /etc/ppp/ip-up started (pid 1736)
Script /etc/ppp/ip-up finished (pid 1736), status = 0x0
NetworkManager[1495]: info (ueagle-atm0): device state change: ip-config - 
activated (reason 'none') [70 100 0]
NetworkManager[1495]: info Policy set 'CONNPPPOE' (ppp0) as default for IPv4 
routing and DNS.
NetworkManager[1495]: info Activation (ueagle-atm0) successful, device 
activated.
NetworkManager[1495]: info Activation (ueagle-atm0) Stage 5 of 5 (IP 
Configure Commit) complete.

Signed-off-by: Pantelis Koukousoulas pkt...@gmail.com
---
 configure.ac   |1 +
 include/NetworkManager.h   |3 +
 src/Makefile.am|2 +
 src/br2684-manager/Makefile.am |   25 ++
 src/br2684-manager/nm-br2684-manager.c |  427 
 src/br2684-manager/nm-br2684-manager.h |   64 +
 src/logging/nm-logging.c   |3 +-
 src/logging/nm-logging.h   |1 +
 src/nm-device-adsl.c   |   47 -
 src/nm-device.c|2 +
 src/ppp-manager/nm-ppp-manager.c   |   47 ++--
 11 files changed, 599 insertions(+), 23 deletions(-)
 create mode 100644 src/br2684-manager/Makefile.am
 create mode 100644 src/br2684-manager/nm-br2684-manager.c
 create mode 100644 src/br2684-manager/nm-br2684-manager.h

diff --git

[PATCH 1/3] ADSL: Settings and initial scaffolding

2011-05-12 Thread Pantelis Koukousoulas
This patch adds the settings code (NMSettingAdsl) and the initial
scaffolding i.e., a tiny stub version of NMDeviceAdsl and the
udev handler code to get the device detected.

With this patch you should be able to see an atm device being detected
by networkmanager in the logs, although of course it doesn't
do anything useful yet.

Extract from the logs:

 [1304668252.341354] [nm-udev-manager.c:562] adsl_add(): adsl_add: ATM Device 
detected from udev. Adding ..
(ueagle-atm0): failed to look up interface index
(ueagle-atm0): new ADSL device (driver: 'ueagle-atm' ifindex: -1)
(ueagle-atm0): exported as /org/freedesktop/NetworkManager/Devices/2
(ueagle-atm0): now managed
(ueagle-atm0): device state change: unmanaged - unavailable (reason 'managed') 
[10 20 2]
(ueagle-atm0): deactivating device (reason: 2).
 [1304668252.345102] [nm-system.c:1349] flush_routes(): (ueagle-atm0) failed to 
lookup interface index
 [1304668252.347821] [nm-device.c:3912] nm_device_state_changed(): 
(ueagle-atm0): device is available,

In this version, we hack the nm-device.c:nm_device_get_priority() to get better 
priority
instead of changing the DeviceType enum.

Signed-off-by: Pantelis Koukousoulas pkt...@gmail.com
---
 include/NetworkManager.h |2 +
 introspection/Makefile.am|1 +
 introspection/nm-device-adsl.xml |   15 +
 libnm-util/Makefile.am   |2 +
 libnm-util/libnm-util.ver|   12 +
 libnm-util/nm-setting-adsl.c |  540 ++
 libnm-util/nm-setting-adsl.h |   97 +++
 src/Makefile.am  |6 +
 src/nm-device-adsl.c |   83 ++
 src/nm-device-adsl.h |   57 
 src/nm-device.c  |8 +-
 src/nm-udev-manager.c|   49 -
 12 files changed, 869 insertions(+), 3 deletions(-)
 create mode 100644 introspection/nm-device-adsl.xml
 create mode 100644 libnm-util/nm-setting-adsl.c
 create mode 100644 libnm-util/nm-setting-adsl.h
 create mode 100644 src/nm-device-adsl.c
 create mode 100644 src/nm-device-adsl.h

diff --git a/include/NetworkManager.h b/include/NetworkManager.h
index 17c3a11..6997771 100644
--- a/include/NetworkManager.h
+++ b/include/NetworkManager.h
@@ -101,6 +101,7 @@ typedef enum {
  * @NM_DEVICE_TYPE_WIMAX: an 802.16e Mobile WiMAX broadband device
  * @NM_DEVICE_TYPE_MODEM: a modem supporting analog telephone, CDMA/EVDO,
  * GSM/UMTS, or LTE network access protocols
+ * @NM_DEVICE_TYPE_ADSL: ADSL modem
  *
  * #NMState values indicate the current overall networking state.
  */
@@ -114,6 +115,7 @@ typedef enum {
NM_DEVICE_TYPE_OLPC_MESH = 6,
NM_DEVICE_TYPE_WIMAX = 7,
NM_DEVICE_TYPE_MODEM = 8,
+   NM_DEVICE_TYPE_ADSL  = 9,
 } NMDeviceType;
 
 /* General device capability flags */
diff --git a/introspection/Makefile.am b/introspection/Makefile.am
index 320245e..4950e7d 100644
--- a/introspection/Makefile.am
+++ b/introspection/Makefile.am
@@ -8,6 +8,7 @@ EXTRA_DIST = \
nm-device-wifi.xml \
nm-device-olpc-mesh.xml \
nm-device-ethernet.xml \
+   nm-device-adsl.xml \
nm-device-modem.xml \
nm-device-wimax.xml \
nm-device.xml \
diff --git a/introspection/nm-device-adsl.xml b/introspection/nm-device-adsl.xml
new file mode 100644
index 000..9610f98
--- /dev/null
+++ b/introspection/nm-device-adsl.xml
@@ -0,0 +1,15 @@
+?xml version=1.0 encoding=UTF-8 ?
+
+node name=/ 
xmlns:tp=http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0;
+  interface name=org.freedesktop.NetworkManager.Device.Adsl
+
+signal name=PropertiesChanged
+arg name=properties type=a{sv} tp:type=String_Variant_Map
+tp:docstring
+A dictionary mapping property names to variant boxed values
+/tp:docstring
+/arg
+/signal
+
+  /interface
+/node
diff --git a/libnm-util/Makefile.am b/libnm-util/Makefile.am
index 0a29e9c..9f452a4 100644
--- a/libnm-util/Makefile.am
+++ b/libnm-util/Makefile.am
@@ -14,6 +14,7 @@ libnm_util_include_HEADERS =  \
nm-connection.h \
nm-setting.h\
nm-setting-8021x.h  \
+   nm-setting-adsl.h   \
nm-setting-bluetooth.h  \
nm-setting-connection.h \
nm-setting-ip4-config.h \
@@ -43,6 +44,7 @@ libnm_util_la_csources = \
nm-param-spec-specialized.c \
nm-setting.c\
nm-setting-8021x.c  \
+   nm-setting-adsl.c   \
nm-setting-bluetooth.c  \
nm-setting-connection.c \
nm-setting-ip4-config.c \
diff --git a/libnm-util/libnm-util.ver b/libnm-util/libnm-util.ver
index 4ff0838..f433d0a 100644
--- a/libnm-util/libnm-util.ver
+++ b/libnm-util/libnm-util.ver
@@ -27,6 +27,7 @@ global:
nm_connection_get_setting_vpn;
nm_connection_get_setting_wimax

ADSL: Carrier Handling and PPP support

2011-05-12 Thread Pantelis Koukousoulas
This is the juice of the patch series. Initial cut at carrier handling
(by polling /sys/class/atm/$iface/carrier) and also support for calling
pppd with the proper command-line to achieve a connection.

Also implement the necessary boilerplate for the NM state machine to
be happy with our device.

With this patch, you can already test carrier management but not yet
make a complete connection.

Relevant extract from logs:
info (ueagle-atm0): carrier now ON (device state 20)
info (ueagle-atm0): device state change: unavailable - disconnected (reason 
'carrier-changed') [20 30 40]

Signed-off-by: Pantelis Koukousoulas pkt...@gmail.com
---
 include/NetworkManager.h |1 +
 src/nm-device-adsl.c |  519 +-
 src/nm-device-adsl.h |5 +-
 src/ppp-manager/nm-ppp-manager.c |   31 +++-
 src/settings/nm-settings.c   |2 +
 5 files changed, 553 insertions(+), 5 deletions(-)

diff --git a/include/NetworkManager.h b/include/NetworkManager.h
index 6997771..f2e4727 100644
--- a/include/NetworkManager.h
+++ b/include/NetworkManager.h
@@ -34,6 +34,7 @@
 #defineNM_DBUS_INTERFACE   
org.freedesktop.NetworkManager
 #defineNM_DBUS_INTERFACE_DEVICENM_DBUS_INTERFACE .Device
 #define NM_DBUS_INTERFACE_DEVICE_WIRED  NM_DBUS_INTERFACE_DEVICE .Wired
+#define NM_DBUS_INTERFACE_DEVICE_ADSL   NM_DBUS_INTERFACE_DEVICE .Adsl
 #define NM_DBUS_INTERFACE_DEVICE_WIRELESS   NM_DBUS_INTERFACE_DEVICE 
.Wireless
 #define NM_DBUS_INTERFACE_DEVICE_BLUETOOTH  NM_DBUS_INTERFACE_DEVICE 
.Bluetooth
 #define NM_DBUS_PATH_ACCESS_POINT   NM_DBUS_PATH /AccessPoint
diff --git a/src/nm-device-adsl.c b/src/nm-device-adsl.c
index 212fec1..77e4d0a 100644
--- a/src/nm-device-adsl.c
+++ b/src/nm-device-adsl.c
@@ -1,5 +1,6 @@
 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
-/* NetworkManager -- Network link manager
+/*
+ * Pantelis Koukousoulas pkt...@gmail.com
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -15,26 +16,153 @@
  * with this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  *
- * Pantelis Koukousoulas pkt...@gmail.com
  */
 
 #include glib.h
+#include glib/gi18n.h
+#include stdlib.h
+#include string.h
 
 #include nm-glib-compat.h
 #include nm-device-adsl.h
 #include nm-device-interface.h
+#include nm-device-private.h
 #include nm-properties-changed-signal.h
+#include nm-glib-compat.h
+#include NetworkManagerUtils.h
+#include nm-logging.h
+
+#include ppp-manager/nm-ppp-manager.h
+#include nm-setting-adsl.h
 
 #include nm-device-adsl-glue.h
 
 G_DEFINE_TYPE (NMDeviceAdsl, nm_device_adsl, NM_TYPE_DEVICE)
 
+#define NM_DEVICE_ADSL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), 
NM_TYPE_DEVICE_ADSL, NMDeviceAdslPrivate))
+
+typedef enum
+{
+   NM_ADSL_ERROR_CONNECTION_NOT_ADSL = 0,
+   NM_ADSL_ERROR_CONNECTION_INVALID,
+   NM_ADSL_ERROR_CONNECTION_INCOMPATIBLE,
+} NMAdslError;
+
+#define NM_ADSL_ERROR (nm_adsl_error_quark ())
+#define NM_TYPE_ADSL_ERROR (nm_adsl_error_get_type ())
+
+static GQuark
+nm_adsl_error_quark (void)
+{
+   static GQuark quark = 0;
+   if (!quark)
+   quark = g_quark_from_static_string (nm-ethernet-error);
+   return quark;
+}
+
+typedef struct {
+   gbooleandisposed;
+   gbooleancarrier;
+   guint   carrier_poll_id;
+
+   /* PPP */
+   NMPPPManager *ppp_manager;
+   NMIP4Config  *pending_ip4_config;
+} NMDeviceAdslPrivate;
+
 enum {
PROPERTIES_CHANGED,
LAST_SIGNAL
 };
+
 static guint signals[LAST_SIGNAL] = { 0 };
 
+enum {
+   PROP_0,
+   PROP_CARRIER,
+
+   LAST_PROP
+};
+
+/* FIXME: Move it to nm-device.c and then get rid of all 
foo_device_get_setting() all around.
+   It's here now to keep the patch short. */
+static NMSetting *
+device_get_setting (NMDevice *device, GType setting_type)
+{
+   NMActRequest *req;
+   NMSetting *setting = NULL;
+
+   req = nm_device_get_act_request (device);
+   if (req) {
+   NMConnection *connection;
+
+   connection = nm_act_request_get_connection (req);
+   if (connection)
+   setting = nm_connection_get_setting (connection, 
setting_type);
+   }
+
+   return setting;
+}
+
+static void
+set_carrier(NMDeviceAdsl *self, const gboolean carrier)
+{
+   NMDeviceAdslPrivate *priv;
+   NMDeviceState state;
+
+   g_return_if_fail (NM_IS_DEVICE (self));
+
+   priv = NM_DEVICE_ADSL_GET_PRIVATE (self);
+
+   if (priv-carrier == carrier)
+   return;
+
+   priv-carrier = carrier;
+   g_object_notify (G_OBJECT (self), NM_DEVICE_ADSL_CARRIER);
+
+   state = nm_device_interface_get_state (NM_DEVICE_INTERFACE (self

[PATCH 3/3] ADSL: Add libnm-glib and nmcli code

2011-05-12 Thread Pantelis Koukousoulas
** Message: nm-ppp-plugin: (nm_phasechange): status 9 / phase 'running'
** Message: nm-ppp-plugin: (nm_ip_up): ip-up event
** Message: nm-ppp-plugin: (nm_ip_up): sending Ip4Config to NetworkManager...
NetworkManager[29155]: debug [1304671150.607440] [nm-netlink-monitor.c:117] 
link_msg_handler(): netlink link message: iface idx 35 flags 0x110D1
NetworkManager[29155]: info PPP manager(IP Config Get) reply received.
NetworkManager[29155]: info Activation (ueagle-atm0) Stage 4 of 5 (IP4 
Configure Get) scheduled...
NetworkManager[29155]: info Activation (ueagle-atm0) Stage 4 of 5 (IP4 
Configure Get) started...
NetworkManager[29155]: info Activation (ueagle-atm0) Stage 5 of 5 (IP 
Configure Commit) scheduled...
NetworkManager[29155]: info Activation (ueagle-atm0) Stage 4 of 5 (IP4 
Configure Get) complete.
NetworkManager[29155]: info Activation (ueagle-atm0) Stage 5 of 5 (IP 
Configure Commit) started...
NetworkManager[29155]: debug [1304671150.608918] [nm-system.c:222] 
sync_addresses(): (ppp0): syncing addresses (family 2)
NetworkManager[29155]: info (ueagle-atm0): device state change: ip-config - 
activated (reason 'none') [70 100 0]
NetworkManager[29155]: info Policy set 'MYISP' (ppp0) as default for IPv4 
routing and DNS.
NetworkManager[29155]: info Activation (ueagle-atm0) successful, device 
activated.
NetworkManager[29155]: info Activation (ueagle-atm0) Stage 5 of 5 (IP 
Configure Commit) complete.

Signed-off-by: Pantelis Koukousoulas pkt...@gmail.com
---
 cli/src/connections.c   |   66 ++--
 cli/src/devices.c   |4 +
 cli/src/settings.c  |   50 +
 cli/src/settings.h  |2 +
 libnm-glib/Makefile.am  |6 +
 libnm-glib/libnm-glib.ver   |4 +-
 libnm-glib/nm-device-adsl.c |  236 +++
 libnm-glib/nm-device-adsl.h |   62 +++
 libnm-glib/nm-device.c  |   10 ++-
 libnm-util/nm-connection.c  |   25 +-
 libnm-util/nm-connection.h  |2 +
 11 files changed, 451 insertions(+), 16 deletions(-)
 create mode 100644 libnm-glib/nm-device-adsl.c
 create mode 100644 libnm-glib/nm-device-adsl.h

diff --git a/cli/src/connections.c b/cli/src/connections.c
index 2646aa9..5308f04 100644
--- a/cli/src/connections.c
+++ b/cli/src/connections.c
@@ -34,6 +34,7 @@
 #include nm-client.h
 #include nm-setting-connection.h
 #include nm-setting-wired.h
+#include nm-setting-adsl.h
 #include nm-setting-pppoe.h
 #include nm-setting-wireless.h
 #include nm-setting-gsm.h
@@ -44,6 +45,7 @@
 #include nm-setting-wimax.h
 #endif
 #include nm-device-ethernet.h
+#include nm-device-adsl.h
 #include nm-device-wifi.h
 #if WITH_WIMAX
 #include nm-device-wimax.h
@@ -104,12 +106,13 @@ static NmcOutputField nmc_fields_settings_names[] = {
SETTING_FIELD (NM_SETTING_SERIAL_SETTING_NAME, 0),/* 7 
*/
SETTING_FIELD (NM_SETTING_PPP_SETTING_NAME, 0),   /* 8 
*/
SETTING_FIELD (NM_SETTING_PPPOE_SETTING_NAME, 0), /* 9 
*/
-   SETTING_FIELD (NM_SETTING_GSM_SETTING_NAME, 0),   /* 10 
*/
-   SETTING_FIELD (NM_SETTING_CDMA_SETTING_NAME, 0),  /* 11 
*/
-   SETTING_FIELD (NM_SETTING_BLUETOOTH_SETTING_NAME, 0), /* 12 
*/
-   SETTING_FIELD (NM_SETTING_OLPC_MESH_SETTING_NAME, 0), /* 13 
*/
-   SETTING_FIELD (NM_SETTING_VPN_SETTING_NAME, 0),   /* 14 
*/
-   SETTING_FIELD (NM_SETTING_WIMAX_SETTING_NAME, 0), /* 15 
*/
+   SETTING_FIELD (NM_SETTING_ADSL_SETTING_NAME, 0),  /* 10 
*/
+   SETTING_FIELD (NM_SETTING_GSM_SETTING_NAME, 0),   /* 11 
*/
+   SETTING_FIELD (NM_SETTING_CDMA_SETTING_NAME, 0),  /* 12 
*/
+   SETTING_FIELD (NM_SETTING_BLUETOOTH_SETTING_NAME, 0), /* 13 
*/
+   SETTING_FIELD (NM_SETTING_OLPC_MESH_SETTING_NAME, 0), /* 14 
*/
+   SETTING_FIELD (NM_SETTING_VPN_SETTING_NAME, 0),   /* 15 
*/
+   SETTING_FIELD (NM_SETTING_WIMAX_SETTING_NAME, 0), /* 16 
*/
{NULL, NULL, 0, NULL, 0}
 };
 #define NMC_FIELDS_SETTINGS_NAMES_ALL_X  NM_SETTING_CONNECTION_SETTING_NAME,\
@@ -122,6 +125,7 @@ static NmcOutputField nmc_fields_settings_names[] = {
  NM_SETTING_SERIAL_SETTING_NAME,\
  NM_SETTING_PPP_SETTING_NAME,\
  NM_SETTING_PPPOE_SETTING_NAME,\
+ NM_SETTING_ADSL_SETTING_NAME,\
  NM_SETTING_GSM_SETTING_NAME,\
  NM_SETTING_CDMA_SETTING_NAME,\
  NM_SETTING_BLUETOOTH_SETTING_NAME,\
@@ -331,6 +335,15 @@ nmc_connection_detail (NMConnection *connection, NmCli 
*nmc)
}
 
if (!strcasecmp (nmc_fields_settings_names[section_idx].name

[PATCH 3/3] Add libnm-glib and nmcli code

2011-05-06 Thread Pantelis Koukousoulas
** Message: nm-ppp-plugin: (nm_phasechange): status 9 / phase 'running'
** Message: nm-ppp-plugin: (nm_ip_up): ip-up event
** Message: nm-ppp-plugin: (nm_ip_up): sending Ip4Config to NetworkManager...
NetworkManager[29155]: debug [1304671150.607440] [nm-netlink-monitor.c:117] 
link_msg_handler(): netlink link message: iface idx 35 flags 0x110D1
NetworkManager[29155]: info PPP manager(IP Config Get) reply received.
NetworkManager[29155]: info Activation (ueagle-atm0) Stage 4 of 5 (IP4 
Configure Get) scheduled...
NetworkManager[29155]: info Activation (ueagle-atm0) Stage 4 of 5 (IP4 
Configure Get) started...
NetworkManager[29155]: info Activation (ueagle-atm0) Stage 5 of 5 (IP 
Configure Commit) scheduled...
NetworkManager[29155]: info Activation (ueagle-atm0) Stage 4 of 5 (IP4 
Configure Get) complete.
NetworkManager[29155]: info Activation (ueagle-atm0) Stage 5 of 5 (IP 
Configure Commit) started...
NetworkManager[29155]: debug [1304671150.608918] [nm-system.c:222] 
sync_addresses(): (ppp0): syncing addresses (family 2)
NetworkManager[29155]: info (ueagle-atm0): device state change: ip-config - 
activated (reason 'none') [70 100 0]
NetworkManager[29155]: info Policy set 'MYISP' (ppp0) as default for IPv4 
routing and DNS.
NetworkManager[29155]: info Activation (ueagle-atm0) successful, device 
activated.
NetworkManager[29155]: info Activation (ueagle-atm0) Stage 5 of 5 (IP 
Configure Commit) complete.

Signed-off-by: Pantelis Koukousoulas pkt...@gmail.com
---
 cli/src/connections.c   |   66 ++--
 cli/src/devices.c   |4 +
 cli/src/settings.c  |   50 +
 cli/src/settings.h  |2 +
 libnm-glib/Makefile.am  |6 +
 libnm-glib/libnm-glib.ver   |4 +-
 libnm-glib/nm-device-adsl.c |  236 +++
 libnm-glib/nm-device-adsl.h |   62 +++
 libnm-glib/nm-device.c  |   10 ++-
 libnm-util/nm-connection.c  |   25 +-
 libnm-util/nm-connection.h  |2 +
 11 files changed, 451 insertions(+), 16 deletions(-)
 create mode 100644 libnm-glib/nm-device-adsl.c
 create mode 100644 libnm-glib/nm-device-adsl.h

diff --git a/cli/src/connections.c b/cli/src/connections.c
index 2646aa9..5308f04 100644
--- a/cli/src/connections.c
+++ b/cli/src/connections.c
@@ -34,6 +34,7 @@
 #include nm-client.h
 #include nm-setting-connection.h
 #include nm-setting-wired.h
+#include nm-setting-adsl.h
 #include nm-setting-pppoe.h
 #include nm-setting-wireless.h
 #include nm-setting-gsm.h
@@ -44,6 +45,7 @@
 #include nm-setting-wimax.h
 #endif
 #include nm-device-ethernet.h
+#include nm-device-adsl.h
 #include nm-device-wifi.h
 #if WITH_WIMAX
 #include nm-device-wimax.h
@@ -104,12 +106,13 @@ static NmcOutputField nmc_fields_settings_names[] = {
SETTING_FIELD (NM_SETTING_SERIAL_SETTING_NAME, 0),/* 7 
*/
SETTING_FIELD (NM_SETTING_PPP_SETTING_NAME, 0),   /* 8 
*/
SETTING_FIELD (NM_SETTING_PPPOE_SETTING_NAME, 0), /* 9 
*/
-   SETTING_FIELD (NM_SETTING_GSM_SETTING_NAME, 0),   /* 10 
*/
-   SETTING_FIELD (NM_SETTING_CDMA_SETTING_NAME, 0),  /* 11 
*/
-   SETTING_FIELD (NM_SETTING_BLUETOOTH_SETTING_NAME, 0), /* 12 
*/
-   SETTING_FIELD (NM_SETTING_OLPC_MESH_SETTING_NAME, 0), /* 13 
*/
-   SETTING_FIELD (NM_SETTING_VPN_SETTING_NAME, 0),   /* 14 
*/
-   SETTING_FIELD (NM_SETTING_WIMAX_SETTING_NAME, 0), /* 15 
*/
+   SETTING_FIELD (NM_SETTING_ADSL_SETTING_NAME, 0),  /* 10 
*/
+   SETTING_FIELD (NM_SETTING_GSM_SETTING_NAME, 0),   /* 11 
*/
+   SETTING_FIELD (NM_SETTING_CDMA_SETTING_NAME, 0),  /* 12 
*/
+   SETTING_FIELD (NM_SETTING_BLUETOOTH_SETTING_NAME, 0), /* 13 
*/
+   SETTING_FIELD (NM_SETTING_OLPC_MESH_SETTING_NAME, 0), /* 14 
*/
+   SETTING_FIELD (NM_SETTING_VPN_SETTING_NAME, 0),   /* 15 
*/
+   SETTING_FIELD (NM_SETTING_WIMAX_SETTING_NAME, 0), /* 16 
*/
{NULL, NULL, 0, NULL, 0}
 };
 #define NMC_FIELDS_SETTINGS_NAMES_ALL_X  NM_SETTING_CONNECTION_SETTING_NAME,\
@@ -122,6 +125,7 @@ static NmcOutputField nmc_fields_settings_names[] = {
  NM_SETTING_SERIAL_SETTING_NAME,\
  NM_SETTING_PPP_SETTING_NAME,\
  NM_SETTING_PPPOE_SETTING_NAME,\
+ NM_SETTING_ADSL_SETTING_NAME,\
  NM_SETTING_GSM_SETTING_NAME,\
  NM_SETTING_CDMA_SETTING_NAME,\
  NM_SETTING_BLUETOOTH_SETTING_NAME,\
@@ -331,6 +335,15 @@ nmc_connection_detail (NMConnection *connection, NmCli 
*nmc)
}
 
if (!strcasecmp (nmc_fields_settings_names[section_idx].name

[PATCH 0/3] [RFC] Support for ADSL modems

2011-05-06 Thread Pantelis Koukousoulas
Hi, before I leave for FOSSCOMM.gr, this patch series implements the initial
version of the support for ADSL modems in network manager.

Notes:
   * PPPoA-only for now. I hope that PPPoE can be added with not too much 
trouble
 as well, if it is possible to just create a new ethernet device for the 
nas0
 interface that br2684ctl creates and reuse the already existing wired 
device
 PPPoE support.

 This way the adsl part can manage the ATM part of the equation just like it
 does now for PPPoA.

   * This is the duct tape and gum implementation, according to the first 
make
 it work, then make it work right motto. There are lots of bugs/limitations
 duplicate code etc but at least it works for me (TM) now :P

   * My initial patch that added everything at once got bounced for moderation
 due to its size, so (for size and easier reviewing reasons) I split it to
 3 patches, in a bisect-friendly way (after each patch, NM builds and does
 something useful)

   * I 'm now happily waiting for your comments / advice / testing etc :) :)

Cheers,
Pantelis
 
Pantelis Koukousoulas (3):
  Settings and initial scaffolding
  Carrier Handling and PPP support
  Add libnm-glib and nmcli code

 cli/src/connections.c|   66 -
 cli/src/devices.c|4 +
 cli/src/settings.c   |   50 
 cli/src/settings.h   |2 +
 include/NetworkManager.h |   19 +-
 introspection/Makefile.am|1 +
 introspection/nm-device-adsl.xml |   15 +
 libnm-glib/Makefile.am   |6 +
 libnm-glib/libnm-glib.ver|4 +-
 libnm-glib/nm-device-adsl.c  |  236 +++
 libnm-glib/nm-device-adsl.h  |   62 
 libnm-glib/nm-device.c   |   10 +-
 libnm-util/Makefile.am   |2 +
 libnm-util/libnm-util.ver|   12 +-
 libnm-util/nm-connection.c   |   25 ++-
 libnm-util/nm-connection.h   |2 +
 libnm-util/nm-setting-adsl.c |  476 ++
 libnm-util/nm-setting-adsl.h |   97 ++
 src/Makefile.am  |6 +
 src/nm-device-adsl.c |  596 ++
 src/nm-device-adsl.h |   60 
 src/nm-udev-manager.c|   48 +++-
 src/ppp-manager/nm-ppp-manager.c |   31 ++-
 src/settings/nm-settings.c   |2 +
 24 files changed, 1804 insertions(+), 28 deletions(-)
 create mode 100644 introspection/nm-device-adsl.xml
 create mode 100644 libnm-glib/nm-device-adsl.c
 create mode 100644 libnm-glib/nm-device-adsl.h
 create mode 100644 libnm-util/nm-setting-adsl.c
 create mode 100644 libnm-util/nm-setting-adsl.h
 create mode 100644 src/nm-device-adsl.c
 create mode 100644 src/nm-device-adsl.h

-- 
1.7.4.1

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


[PATCH 2/3] Carrier Handling and PPP support

2011-05-06 Thread Pantelis Koukousoulas
This is the juice of the patch series. Initial cut at carrier handling
(by polling /sys/class/atm/$iface/carrier) and also support for calling
pppd with the proper command-line to achieve a connection.

Also implement the necessary boilerplate for the NM state machine to
be happy with our device.

With this patch, you can already test carrier management but not yet
make a complete connection.

Relevant extract from logs:
info (ueagle-atm0): carrier now ON (device state 20)
info (ueagle-atm0): device state change: unavailable - disconnected (reason 
'carrier-chagned') [20 30 40]

Signed-off-by: Pantelis Koukousoulas pkt...@gmail.com
---
 include/NetworkManager.h |1 +
 src/nm-device-adsl.c |  519 +-
 src/nm-device-adsl.h |5 +-
 src/ppp-manager/nm-ppp-manager.c |   31 +++-
 src/settings/nm-settings.c   |2 +
 5 files changed, 553 insertions(+), 5 deletions(-)

diff --git a/include/NetworkManager.h b/include/NetworkManager.h
index b007e1c..cfc61ee 100644
--- a/include/NetworkManager.h
+++ b/include/NetworkManager.h
@@ -34,6 +34,7 @@
 #defineNM_DBUS_INTERFACE   
org.freedesktop.NetworkManager
 #defineNM_DBUS_INTERFACE_DEVICENM_DBUS_INTERFACE .Device
 #define NM_DBUS_INTERFACE_DEVICE_WIRED  NM_DBUS_INTERFACE_DEVICE .Wired
+#define NM_DBUS_INTERFACE_DEVICE_ADSL   NM_DBUS_INTERFACE_DEVICE .Adsl
 #define NM_DBUS_INTERFACE_DEVICE_WIRELESS   NM_DBUS_INTERFACE_DEVICE 
.Wireless
 #define NM_DBUS_INTERFACE_DEVICE_BLUETOOTH  NM_DBUS_INTERFACE_DEVICE 
.Bluetooth
 #define NM_DBUS_PATH_ACCESS_POINT   NM_DBUS_PATH /AccessPoint
diff --git a/src/nm-device-adsl.c b/src/nm-device-adsl.c
index 212fec1..77e4d0a 100644
--- a/src/nm-device-adsl.c
+++ b/src/nm-device-adsl.c
@@ -1,5 +1,6 @@
 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
-/* NetworkManager -- Network link manager
+/*
+ * Pantelis Koukousoulas pkt...@gmail.com
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -15,26 +16,153 @@
  * with this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  *
- * Pantelis Koukousoulas pkt...@gmail.com
  */
 
 #include glib.h
+#include glib/gi18n.h
+#include stdlib.h
+#include string.h
 
 #include nm-glib-compat.h
 #include nm-device-adsl.h
 #include nm-device-interface.h
+#include nm-device-private.h
 #include nm-properties-changed-signal.h
+#include nm-glib-compat.h
+#include NetworkManagerUtils.h
+#include nm-logging.h
+
+#include ppp-manager/nm-ppp-manager.h
+#include nm-setting-adsl.h
 
 #include nm-device-adsl-glue.h
 
 G_DEFINE_TYPE (NMDeviceAdsl, nm_device_adsl, NM_TYPE_DEVICE)
 
+#define NM_DEVICE_ADSL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), 
NM_TYPE_DEVICE_ADSL, NMDeviceAdslPrivate))
+
+typedef enum
+{
+   NM_ADSL_ERROR_CONNECTION_NOT_ADSL = 0,
+   NM_ADSL_ERROR_CONNECTION_INVALID,
+   NM_ADSL_ERROR_CONNECTION_INCOMPATIBLE,
+} NMAdslError;
+
+#define NM_ADSL_ERROR (nm_adsl_error_quark ())
+#define NM_TYPE_ADSL_ERROR (nm_adsl_error_get_type ())
+
+static GQuark
+nm_adsl_error_quark (void)
+{
+   static GQuark quark = 0;
+   if (!quark)
+   quark = g_quark_from_static_string (nm-ethernet-error);
+   return quark;
+}
+
+typedef struct {
+   gbooleandisposed;
+   gbooleancarrier;
+   guint   carrier_poll_id;
+
+   /* PPP */
+   NMPPPManager *ppp_manager;
+   NMIP4Config  *pending_ip4_config;
+} NMDeviceAdslPrivate;
+
 enum {
PROPERTIES_CHANGED,
LAST_SIGNAL
 };
+
 static guint signals[LAST_SIGNAL] = { 0 };
 
+enum {
+   PROP_0,
+   PROP_CARRIER,
+
+   LAST_PROP
+};
+
+/* FIXME: Move it to nm-device.c and then get rid of all 
foo_device_get_setting() all around.
+   It's here now to keep the patch short. */
+static NMSetting *
+device_get_setting (NMDevice *device, GType setting_type)
+{
+   NMActRequest *req;
+   NMSetting *setting = NULL;
+
+   req = nm_device_get_act_request (device);
+   if (req) {
+   NMConnection *connection;
+
+   connection = nm_act_request_get_connection (req);
+   if (connection)
+   setting = nm_connection_get_setting (connection, 
setting_type);
+   }
+
+   return setting;
+}
+
+static void
+set_carrier(NMDeviceAdsl *self, const gboolean carrier)
+{
+   NMDeviceAdslPrivate *priv;
+   NMDeviceState state;
+
+   g_return_if_fail (NM_IS_DEVICE (self));
+
+   priv = NM_DEVICE_ADSL_GET_PRIVATE (self);
+
+   if (priv-carrier == carrier)
+   return;
+
+   priv-carrier = carrier;
+   g_object_notify (G_OBJECT (self), NM_DEVICE_ADSL_CARRIER);
+
+   state = nm_device_interface_get_state (NM_DEVICE_INTERFACE (self

[PATCH 1/3] Settings and initial scaffolding

2011-05-06 Thread Pantelis Koukousoulas
This patch adds the settings code (NMSettingAdsl) and the initial
scaffolding i.e., a tiny stub version of NMDeviceAdsl and the
udev handler code to get the device detected.

With this patch you should be able to see an atm device being detected
by networkmanager in the logs, although of course it doesn't
do anything useful yet.

Extract from the logs:

 [1304668252.341354] [nm-udev-manager.c:562] adsl_add(): adsl_add: ATM Device 
detected from udev. Adding ..
(ueagle-atm0): failed to look up interface index
(ueagle-atm0): new ADSL device (driver: 'ueagle-atm' ifindex: -1)
(ueagle-atm0): exported as /org/freedesktop/NetworkManager/Devices/2
(ueagle-atm0): now managed
(ueagle-atm0): device state change: unmanaged - unavailable (reason 'managed') 
[10 20 2]
(ueagle-atm0): deactivating device (reason: 2).
 [1304668252.345102] [nm-system.c:1349] flush_routes(): (ueagle-atm0) failed to 
lookup interface index
 [1304668252.347821] [nm-device.c:3912] nm_device_state_changed(): 
(ueagle-atm0): device is available,

Note:
nm-device.c:nm_device_get_priority()
  essentially returns the index of the Device Type in the NMDeviceType enum.
  So, since ADSL typically should have the best priority, it was placed above
  the ethernet device.

Signed-off-by: Pantelis Koukousoulas pkt...@gmail.com
---
 include/NetworkManager.h |   18 +-
 introspection/Makefile.am|1 +
 introspection/nm-device-adsl.xml |   15 ++
 libnm-util/Makefile.am   |2 +
 libnm-util/libnm-util.ver|   12 +-
 libnm-util/nm-setting-adsl.c |  476 ++
 libnm-util/nm-setting-adsl.h |   97 
 src/Makefile.am  |6 +
 src/nm-device-adsl.c |   83 +++
 src/nm-device-adsl.h |   57 +
 src/nm-udev-manager.c|   48 -
 11 files changed, 804 insertions(+), 11 deletions(-)
 create mode 100644 introspection/nm-device-adsl.xml
 create mode 100644 libnm-util/nm-setting-adsl.c
 create mode 100644 libnm-util/nm-setting-adsl.h
 create mode 100644 src/nm-device-adsl.c
 create mode 100644 src/nm-device-adsl.h

diff --git a/include/NetworkManager.h b/include/NetworkManager.h
index 17c3a11..b007e1c 100644
--- a/include/NetworkManager.h
+++ b/include/NetworkManager.h
@@ -92,6 +92,7 @@ typedef enum {
 /**
  * NMDeviceType:
  * @NM_DEVICE_TYPE_UNKNOWN: unknown device
+ * @NM_DEVICE_TYPE_ADSL: ADSL WAN device
  * @NM_DEVICE_TYPE_ETHERNET: a wired ethernet device
  * @NM_DEVICE_TYPE_WIFI: an 802.11 WiFi device
  * @NM_DEVICE_TYPE_UNUSED1: not used
@@ -106,14 +107,15 @@ typedef enum {
  */
 typedef enum {
NM_DEVICE_TYPE_UNKNOWN   = 0,
-   NM_DEVICE_TYPE_ETHERNET  = 1,
-   NM_DEVICE_TYPE_WIFI  = 2,
-   NM_DEVICE_TYPE_UNUSED1   = 3,
-   NM_DEVICE_TYPE_UNUSED2   = 4,
-   NM_DEVICE_TYPE_BT= 5,  /* Bluetooth */
-   NM_DEVICE_TYPE_OLPC_MESH = 6,
-   NM_DEVICE_TYPE_WIMAX = 7,
-   NM_DEVICE_TYPE_MODEM = 8,
+   NM_DEVICE_TYPE_ADSL  = 1,
+   NM_DEVICE_TYPE_ETHERNET  = 2,
+   NM_DEVICE_TYPE_WIFI  = 3,
+   NM_DEVICE_TYPE_UNUSED1   = 4,
+   NM_DEVICE_TYPE_UNUSED2   = 5,
+   NM_DEVICE_TYPE_BT= 6,  /* Bluetooth */
+   NM_DEVICE_TYPE_OLPC_MESH = 7,
+   NM_DEVICE_TYPE_WIMAX = 8,
+   NM_DEVICE_TYPE_MODEM = 9,
 } NMDeviceType;
 
 /* General device capability flags */
diff --git a/introspection/Makefile.am b/introspection/Makefile.am
index 320245e..4950e7d 100644
--- a/introspection/Makefile.am
+++ b/introspection/Makefile.am
@@ -8,6 +8,7 @@ EXTRA_DIST = \
nm-device-wifi.xml \
nm-device-olpc-mesh.xml \
nm-device-ethernet.xml \
+   nm-device-adsl.xml \
nm-device-modem.xml \
nm-device-wimax.xml \
nm-device.xml \
diff --git a/introspection/nm-device-adsl.xml b/introspection/nm-device-adsl.xml
new file mode 100644
index 000..9610f98
--- /dev/null
+++ b/introspection/nm-device-adsl.xml
@@ -0,0 +1,15 @@
+?xml version=1.0 encoding=UTF-8 ?
+
+node name=/ 
xmlns:tp=http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0;
+  interface name=org.freedesktop.NetworkManager.Device.Adsl
+
+signal name=PropertiesChanged
+arg name=properties type=a{sv} tp:type=String_Variant_Map
+tp:docstring
+A dictionary mapping property names to variant boxed values
+/tp:docstring
+/arg
+/signal
+
+  /interface
+/node
diff --git a/libnm-util/Makefile.am b/libnm-util/Makefile.am
index 0a29e9c..9f452a4 100644
--- a/libnm-util/Makefile.am
+++ b/libnm-util/Makefile.am
@@ -14,6 +14,7 @@ libnm_util_include_HEADERS =  \
nm-connection.h \
nm-setting.h\
nm-setting-8021x.h  \
+   nm-setting-adsl.h   \
nm-setting-bluetooth.h  \
nm-setting-connection.h \
nm-setting-ip4-config.h \
@@ -43,6 +44,7

Re: [PATCH 0/3] [RFC] Support for ADSL modems

2011-05-06 Thread Pantelis Koukousoulas
 Maybe this can be a little off-topic, but is there any intent to add support
 to PPPoE over wifi?

Maybe it is working already? When reading the source I think I saw that wired
is not required for PPPoE, but maybe I read wrong ...

Nevertheless, as an answer to this patch series it is indeed off topic, please
continue in a new thread :)

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


Re: Support for ADSL modems

2011-05-04 Thread Pantelis Koukousoulas
On Wed, May 4, 2011 at 11:18 PM, Dan Williams d...@redhat.com wrote:
 I personally have some random Zoom ueagle III based device, so I can at
 least help test the carrier stuff and device detection.

Cool, thanks :) For now I have a problem in the device detection path, it seems
NetworkManager needs an interface index otherwise it refuses to enable the
device. I can't find an interface index number for my ueagle-atm0 interface
so for now I have a hack that returns a fake one, but this will need to be fixed
in a better way.

 They are actually pretty stable at this point, though the change in the
 D-Bus API may cause you some issues.  But as code churn goes we're
 almost ready for a release of 0.9 so it's not going to change much.
 That said, I'd expect the work on either 0.8.x or 0.9 to port back and
 forth without much of a problem since those bits of the code haven't
 changed much.

Great, this has been my assessment as well :)

 Are there instructions for how to install the git versions of
 NetworkManager/nm-applet
 in parallel with the system-provided ones (e.g., under /opt) so that
 one can experiment
 with them without breaking existing networking functionality?

 Not really, you can certainly install the binaries and libraries into a
 different prefix (configure with --prefix, --libdir, --localstatedir, as
 appropriate) but of course you cannot run old NM + new NM at the same
 time because they would try to manage the same devices, plus the bus
 name is the same.  But it may work to just kill the old one and start
 the new one.

Ok, I made a blog post on the procedure I used myself under ubuntu
(it may look a little complex with the dpkg-diverts and all but this way
I can develop on my regular laptop, the security updates can modify
any of the files in the system-version of NM without problem and
I can script switching between the 2 versions of NM and the applet
without problem.

http://polytechnitis.blogspot.com/2011/05/compiling-latest-versions-of.html

 Let me know how things go, great to hear you're working on this.

Great, I will try to push code somewhere soonish.

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


Re: Configure options

2011-05-03 Thread Pantelis Koukousoulas
 On Sun, 2011-05-01 at 08:32 -0400, Super Bisquit wrote:
  Is it possible to add a none option to the --with-distro when
  building.

This patch (for a previous version of cross linux from scratch) could give you
an idea on where you would need to hack to add this option:
http://svn.cross-lfs.org/svn/repos/patches/NetworkManager/NetworkManager-0.7.2-clfs_support-1.patch
(it is pretty short).

Mind you, --with-distro=none is not --with-linux=none, it won't
disable the linuxisms
because without them NetworkManager just won't work right now.

Which means in practice that even with --distro=none you wouldn't be
able to even build
NM in FreeBSD.

  Let me at least try to make it work while everybody is waiting for the
  project to be finished. I have a laptop with the iwi|ipw2100/2200
  radio.

 At the moment NM is Linux-only, mainly due to usage of
 Linux-kernel-specific WiFi and Ethernet calls, hardware detection using
 udev, and IP/routing using netlink.

 What does netlink do? There may be a port of a similar application in the
 ports tree.

netlink is not an application but a protocol (RFC 3549) between the kernel
and userspace.

  While NM could be ported, somebody
 would have to explore the FreeBSD alternatives to stuff like udev
 I've mentioned devd.

You (or the other person doing the port) will probably have to write
nm-devd-manager.c to do what nm-udev-manager.c does, then.

 , and programmatically setting IP addresses and
 routes.

 See the manpages for each driver and for ifconfig.

If NM would have to do different things for different drivers,
that's not so nice. They need to support a common way to
get/set essential info, like what is done in Linux.

 Anyway, having the option of none for --with-distro would make it easier for
 the person doing the google project, myself, and others to be able to start
 working on porting. It won't hurt the build process. The gnome network
 manager team would see the changes and can work them into the code.

Instead of --with-distro=none (that probably won't help at all), why not
add --with-distro=freebsd (based on the patch shown above).

You can implement the FreeBSD backend (like the one for paldo linux
shown in the patch) and a FreeBSD-specific settings plugin (like the ifcfg
for redhat or ifupdown for debian) to get NM to recognize the already
setup network devices from system config file(s).

Then you can write nm-devd-manager.c to replace nm-udev-manager.c
for device detection etc (and disable udev at configure-time when
distro==freebsd).

Finally you can replace netlink stuff with freebsd-specific things as
a quick  dirty hack to see how much work would be needed to
get things done properly.

(netlink usage seems to be limited to
nm-netlink-monitor.{c,h}
and
nm-system.c
In NetworkManager.)

With these changes you would get a FreeBSD version of NM that
might be even semi-usable, although I know nothing about FreeBSD
and very few things about NM so I might well be wrong in my
assessment.

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


Support for ADSL modems

2011-05-03 Thread Pantelis Koukousoulas
Hi,

I just wanted to announce that I 'm going to be working on adding
support for ADSL
modems in NetworkManager for a while, as a nice project to learn NM
internals and
in order to finish what we started 2 years ago at Chania LUG's coding camp.
It also makes NetworkManager more complete (and if support for old dialup modems
is also added some time in the future by whatever means, NetworkManager can
finally become Linux one stop shop for client-side network
configuration, at least
for me).

Why ADSL modem support is useful?
Users have requested it (e.g.,
http://brainstorm.ubuntu.com/item/3853/) and it is also
among the items in NM TODO file.

What are you going to work on?
The initial effort will be for the only related device I already have
(Sagem FAST 800,
a USB ADSL modem) and PPPoA, I hope that PCI ADSL devices and PPPoE will
be supported as well in the future. I know that there is already some
PPPoE support,
it just remains to be seen if it can be reused mostly as-is by using the nas0
interface one gets from br2684 as just another ordinary ethernet device.

Initially I 'm going to work in NetworkManager and nm-applet. KDE support can be
written by someone else with my help, or I can write it myself as well
in the future.


Existing work
I have found https://github.com/hicham-haouari/NetworkManager-ADSL-Support
that has some initial libnm-util work (NMSettingAdsl), unfortunately
only after I
implemented this myself as well ( :/ ) so I will try to merge the 2 versions.

There is also http://live.gnome.org/NetworkManager/ADSL which I 'm using
as reference wrt suggested class names etc.

Is there any other documentation or preliminary implementation? Is anyone else
working on this so that we can collaborate?


Code
My initial experiments are implemented on top of whatever version of
NetworkManager
(0.8.x) is in ubuntu maverick since this made it possible to not care
at all about build
dependencies etc.

Are current git tips of NetworkManager/nm-applet stable enough to do the actual
development on, or are they in a  turbulence state right now?

Are there instructions for how to install the git versions of
NetworkManager/nm-applet
in parallel with the system-provided ones (e.g., under /opt) so that
one can experiment
with them without breaking existing networking functionality? (I will
try to do this myself
anyway, just asking in case I can save the 15 minutes required :P)


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