[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 
---
 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 @@
+
+
+http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0";>
+  
+
+
+
+
+A dictionary mapping property names to variant boxed values
+
+
+
+
+  
+
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;
nm_connection_get_setting_wired;
+   nm_connection_get_setting_adsl;
nm_connection_get_setting_wireless;
nm_connection_get_setting_wireless_security;
nm_connection_get_type;
@@ -147,6 +148,17 @@ global:
nm_setting_802_1x_set_phase2_cl

[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 
---
 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 @@
+
+
+http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0";>
+  
+
+
+
+
+A dictionary mapping property names to variant boxed values
+
+
+
+
+  
+
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;
nm_connection_get_setting_wired;
+   nm_connection_get_setting_adsl;
nm_connection_get_setting_wireless;
nm_connection_get_setting_wireless_security;
nm_connection_get_type;
@@ -147,6 +148,17 @@ global:
nm_setting_802_1x_set_phase2_cl