This email list is read-only.  Emails sent to this list will be discarded
----------------------------------
 doc/connection-api.txt |    7 +++++++
 plugins/Makefile.am    |    2 +-
 plugins/ipv4.c         |    5 +++--
 src/element.c          |    4 ++++
 4 files changed, 15 insertions(+), 3 deletions(-)

New commits:
commit 897f9876936ce0a3f0ae6798725e1162a3e62ff9
Author: Marcel Holtmann <[email protected]>
Date:   Wed Dec 31 09:08:50 2008 +0100

    Set interface name for connection objects

commit c9fb635620bd63ed64b9af6d61828cbc7592971c
Author: Marcel Holtmann <[email protected]>
Date:   Wed Dec 31 09:07:53 2008 +0100

    Add Interface property for connections


Diff in this email is a maximum of 400 lines.
diff --git a/doc/connection-api.txt b/doc/connection-api.txt
index c39c6d2..a0c97da 100644
--- a/doc/connection-api.txt
+++ b/doc/connection-api.txt
@@ -21,6 +21,13 @@ Properties   string Type [readonly]
 
                        The connection type (for example wifi etc.)
 
+               string Interface [readonly]
+
+                       The connection interface (for example "eth0" etc.)
+
+                       This value is for pure informational purposes. It
+                       is not guaranteed that it is always present.
+
                uint8 Strength [readonly]
 
                        Indicates the signal strength of the connection.
diff --git a/plugins/Makefile.am b/plugins/Makefile.am
index efcb5b7..e663e14 100644
--- a/plugins/Makefile.am
+++ b/plugins/Makefile.am
@@ -27,7 +27,7 @@ dhclient_la_SOURCES = dhclient.c inet.h inet.c
 dhclient_la_CFLAGS = @GLIB_CFLAGS@ @GDBUS_CFLAGS@ -DDHCLIENT=\"@dhcli...@\" \
                -DSTATEDIR=\""$(statedir)"\" -DSCRIPTDIR=\""$(scriptdir)"\"
 
-ipv4_la_SOURCES = ipv4.c
+ipv4_la_SOURCES = ipv4.c inet.h inet.c
 
 dnsproxy_la_SOURCES = dnsproxy.c
 
diff --git a/plugins/ipv4.c b/plugins/ipv4.c
index 33c73a4..5e19cbb 100644
--- a/plugins/ipv4.c
+++ b/plugins/ipv4.c
@@ -397,8 +397,9 @@ static int ipv4_probe(struct connman_element *element)
 
        connection = connman_element_create(NULL);
 
-       connection->type = CONNMAN_ELEMENT_TYPE_CONNECTION;
-       connection->index = element->index;
+       connection->type    = CONNMAN_ELEMENT_TYPE_CONNECTION;
+       connection->index   = element->index;
+       connection->devname = inet_index2name(element->index);
 
        if (connman_element_register(connection, element) < 0)
                connman_element_unref(connection);
diff --git a/src/element.c b/src/element.c
index 5e79589..0271107 100644
--- a/src/element.c
+++ b/src/element.c
@@ -539,6 +539,10 @@ static DBusMessage 
*connection_get_properties(DBusConnection *conn,
                connman_dbus_dict_append_variant(&dict, "Type",
                                                DBUS_TYPE_STRING, &str);
 
+       if (element->devname != NULL)
+               connman_dbus_dict_append_variant(&dict, "Interface",
+                                       DBUS_TYPE_STRING, &element->devname);
+
        if (element->subtype == CONNMAN_ELEMENT_SUBTYPE_WIFI ||
                        element->subtype == CONNMAN_ELEMENT_SUBTYPE_WIMAX)
                connman_dbus_dict_append_variant(&dict, "Strength",
_______________________________________________
Commits mailing list
[email protected]
https://lists.moblin.org/mailman/listinfo/commits

Reply via email to