This email list is read-only.  Emails sent to this list will be discarded
----------------------------------
 doc/connman-docs.xml |    1 +
 include/driver.h     |    3 -
 include/element.h    |   39 +----
 include/property.h   |    3 -
 plugins/Makefile.am  |    4 +-
 plugins/fake.c       |   81 ++++-----
 plugins/ipv4.c       |  515 --------------------------------------------------
 src/Makefile.am      |    6 +-
 src/connection.c     |  433 ++++++++++++++++++++++++++++++++++++++++++
 src/connman.h        |   12 +-
 src/device.c         |   36 ++--
 src/element.c        |  413 +++-------------------------------------
 src/ipv4.c           |  234 +++++++++++++++++++++++
 src/main.c           |    6 +-
 src/network.c        |   46 +++--
 src/plugin.c         |    9 +-
 test/list-networks   |    7 +-
 17 files changed, 801 insertions(+), 1047 deletions(-)

New commits:
commit e10cccf70309a219f0068b636a5f466456008989
Author: Marcel Holtmann <[email protected]>
Date:   Mon Jan 5 23:45:55 2009 +0100

    Add support for connection type property

commit e0a71455440ba3ffd0c1403f5b146997f3ad936f
Author: Marcel Holtmann <[email protected]>
Date:   Mon Jan 5 23:18:45 2009 +0100

    Fix typo in debug message

commit b478e2b56edf6343685b8941e0320a5e1323110f
Author: Marcel Holtmann <[email protected]>
Date:   Mon Jan 5 23:04:15 2009 +0100

    Fix fake testing plugin

commit 47c19cde9956bd22b021dc90d115079ddd743521
Author: Marcel Holtmann <[email protected]>
Date:   Mon Jan 5 23:03:53 2009 +0100

    Handle cases for unknown network types

commit 4c4a43fea3872b69c695573def36b1c146ee6712
Author: Marcel Holtmann <[email protected]>
Date:   Mon Jan 5 23:03:35 2009 +0100

    Don't probe device drivers twice

commit d333a3b050767ef8b89b3a9e04ef7723cbcf8e0a
Author: Marcel Holtmann <[email protected]>
Date:   Mon Jan 5 22:36:59 2009 +0100

    Remove deprecated function prototype

commit 8a46c875866dbda9406c0bf738ce95d721626739
Author: Marcel Holtmann <[email protected]>
Date:   Mon Jan 5 22:34:59 2009 +0100

    Remove the unused devpath variable

commit 5ba62c7f31f6e5e4d6836b5df26bb9212452b893
Author: Marcel Holtmann <[email protected]>
Date:   Mon Jan 5 22:33:29 2009 +0100

    All WiFi properties are now part of network interface

commit 6012d11b6cebd5b7dbfce13a711141ef41742f43
Author: Marcel Holtmann <[email protected]>
Date:   Mon Jan 5 22:31:40 2009 +0100

    Remove the unused priority variable

commit c90bc95e4a15388be52e0240799238fa9d9c3bf5
Author: Marcel Holtmann <[email protected]>
Date:   Mon Jan 5 22:30:52 2009 +0100

    All policy is now part of devices and networks

commit 638b640f4bf4b731e0765d36b89682e428fb7a13
Author: Marcel Holtmann <[email protected]>
Date:   Mon Jan 5 22:29:15 2009 +0100

    All elements are fully stateless

commit 45ac2541f62eb93e4d58a42931c05e599e0bc23d
Author: Marcel Holtmann <[email protected]>
Date:   Mon Jan 5 22:28:05 2009 +0100

    Remove unused remember variable

commit 9de932200a6f5b7bce5015bd2faee005da77e225
Author: Marcel Holtmann <[email protected]>
Date:   Mon Jan 5 22:26:58 2009 +0100

    Add support for IPv4 details in connection interface

commit c60ffbfbfe8bfedb7b75f94f5f042a206fb7940f
Author: Marcel Holtmann <[email protected]>
Date:   Mon Jan 5 22:12:23 2009 +0100

    Add property to indicate default connections

commit 8c525f8122631321a7170ce9409baca706d1aea3
Author: Marcel Holtmann <[email protected]>
Date:   Mon Jan 5 22:09:48 2009 +0100

    Export interface name via connection

commit 14fb68d9c0aa7a19fd1424b4b2bc84af1caab594
Author: Marcel Holtmann <[email protected]>
Date:   Mon Jan 5 22:09:22 2009 +0100

    Apply plugin pattern only if specified

commit d829de8ea9a373bbc67ade2939102aedca50cd5f
Author: Marcel Holtmann <[email protected]>
Date:   Mon Jan 5 22:05:58 2009 +0100

    Add support for plugin pattern via command line

commit 22a16114452511c732e2d72bf11666145f87eca8
Author: Marcel Holtmann <[email protected]>
Date:   Mon Jan 5 21:57:20 2009 +0100

    Remove element subtype details

commit ef365b56fb876d1e02bbb7259f77c1945524df06
Author: Marcel Holtmann <[email protected]>
Date:   Mon Jan 5 18:15:15 2009 +0100

    Move IPv4 handling into daemon core

commit 63357f6bd54bb8ac0afd557ddd832c4085426897
Author: Marcel Holtmann <[email protected]>
Date:   Mon Jan 5 18:05:49 2009 +0100

    Add storage driver documentation

commit 46ba5103e9743547db0d67808883d83186e1934b
Author: Marcel Holtmann <[email protected]>
Date:   Mon Jan 5 18:04:25 2009 +0100

    Remove enable and disable element callbacks

commit 1524a8a44dcdd5d5d50243d31ce2c2e1aba98208
Author: Marcel Holtmann <[email protected]>
Date:   Mon Jan 5 17:56:20 2009 +0100

    Remove connection interface from element system

commit d68748fc6f4e5b87f88b73519e353d4c2f21f4ba
Author: Marcel Holtmann <[email protected]>
Date:   Mon Jan 5 17:50:04 2009 +0100

    Remove gateway setup into the core connection handling

commit f48005d81c0983c77740c16abde90e02d9505304
Author: Marcel Holtmann <[email protected]>
Date:   Mon Jan 5 17:34:02 2009 +0100

    Register connection interface

commit fb0fb9058f300222717a025e6f8a0c7a030bf303
Author: Marcel Holtmann <[email protected]>
Date:   Mon Jan 5 17:32:23 2009 +0100

    Reorder device, network and connection setup

commit 4f9a0637340e17790ad3c29546adc34ab6ce0362
Author: Marcel Holtmann <[email protected]>
Date:   Mon Jan 5 17:02:46 2009 +0100

    Add skeleton for core connection driver


Diff in this email is a maximum of 400 lines.
diff --git a/doc/connman-docs.xml b/doc/connman-docs.xml
index 518c6d1..d4059a4 100644
--- a/doc/connman-docs.xml
+++ b/doc/connman-docs.xml
@@ -101,6 +101,7 @@
     </partintro>
     <xi:include href="xml/log.xml" />
     <xi:include href="xml/plugin.xml" />
+    <xi:include href="xml/storage.xml" />
     <xi:include href="xml/security.xml" />
     <xi:include href="xml/resolver.xml" />
     <!-- <xi:include href="xml/device.xml" /> -->
diff --git a/include/driver.h b/include/driver.h
index 2932d4d..f4c6187 100644
--- a/include/driver.h
+++ b/include/driver.h
@@ -41,13 +41,10 @@ extern "C" {
 struct connman_driver {
        const char *name;
        enum connman_element_type type;
-       enum connman_element_subtype subtype;
        int priority;
        int (*probe) (struct connman_element *element);
        void (*remove) (struct connman_element *element);
        int (*update) (struct connman_element *element);
-       int (*enable) (struct connman_element *element);
-       int (*disable) (struct connman_element *element);
 };
 
 extern int connman_driver_register(struct connman_driver *driver);
diff --git a/include/element.h b/include/element.h
index fbd28f2..6f6aa69 100644
--- a/include/element.h
+++ b/include/element.h
@@ -30,6 +30,7 @@ extern "C" {
 #include <glib.h>
 
 #include <connman/property.h>
+#include <connman/ipv4.h>
 
 /**
  * SECTION:element
@@ -37,20 +38,6 @@ extern "C" {
  * @short_description: Functions for handling elements
  */
 
-enum connman_element_state {
-       CONNMAN_ELEMENT_STATE_UNKNOWN   = 0,
-       CONNMAN_ELEMENT_STATE_CONNECT   = 1,
-       CONNMAN_ELEMENT_STATE_CONNECTED = 2,
-       CONNMAN_ELEMENT_STATE_CLOSED    = 3,
-};
-
-enum connman_element_policy {
-       CONNMAN_ELEMENT_POLICY_UNKNOWN = 0,
-       CONNMAN_ELEMENT_POLICY_IGNORE  = 1,
-       CONNMAN_ELEMENT_POLICY_AUTO    = 2,
-       CONNMAN_ELEMENT_POLICY_ASK     = 3,
-};
-
 enum connman_element_type {
        CONNMAN_ELEMENT_TYPE_UNKNOWN    = 0,
        CONNMAN_ELEMENT_TYPE_ROOT       = 1,
@@ -68,16 +55,6 @@ enum connman_element_type {
        CONNMAN_ELEMENT_TYPE_VENDOR     = 10000,
 };
 
-enum connman_element_subtype {
-       CONNMAN_ELEMENT_SUBTYPE_UNKNOWN   = 0,
-       CONNMAN_ELEMENT_SUBTYPE_FAKE      = 1,
-       CONNMAN_ELEMENT_SUBTYPE_ETHERNET  = 3,
-       CONNMAN_ELEMENT_SUBTYPE_WIFI      = 4,
-       CONNMAN_ELEMENT_SUBTYPE_WIMAX     = 5,
-       CONNMAN_ELEMENT_SUBTYPE_CELLULAR  = 6,
-       CONNMAN_ELEMENT_SUBTYPE_BLUETOOTH = 7,
-};
-
 struct connman_driver;
 
 struct connman_element {
@@ -86,14 +63,8 @@ struct connman_element {
        gchar *name;
        gchar *path;
        enum connman_element_type type;
-       enum connman_element_subtype subtype;
-       enum connman_element_state state;
-       enum connman_element_policy policy;
        gboolean enabled;
-       gboolean remember;
-       guint16 priority;
        guint8 strength;
-       gchar *devpath;
        gchar *devname;
 
        struct connman_element *parent;
@@ -112,6 +83,7 @@ struct connman_element {
        GSList *properties;
 
        struct {
+               enum connman_ipv4_method method;
                gchar *address;
                gchar *netmask;
                gchar *gateway;
@@ -119,11 +91,6 @@ struct connman_element {
                gchar *broadcast;
                gchar *nameserver;
        } ipv4;
-
-       struct {
-               gchar *security;
-               gchar *passphrase;
-       } wifi;
 };
 
 extern struct connman_element *connman_element_create(const char *name);
@@ -158,8 +125,6 @@ extern void connman_element_update(struct connman_element 
*element);
 
 extern int connman_element_set_enabled(struct connman_element *element,
                                                        gboolean enabled);
-extern int connman_element_set_scanning(struct connman_element *element,
-                                                       gboolean scanning);
 
 static inline void *connman_element_get_data(struct connman_element *element)
 {
diff --git a/include/property.h b/include/property.h
index 35dbe5c..e792487 100644
--- a/include/property.h
+++ b/include/property.h
@@ -41,9 +41,6 @@ enum connman_property_id {
        CONNMAN_PROPERTY_ID_IPV4_GATEWAY,
        CONNMAN_PROPERTY_ID_IPV4_BROADCAST,
        CONNMAN_PROPERTY_ID_IPV4_NAMESERVER,
-
-       CONNMAN_PROPERTY_ID_WIFI_SECURITY,
-       CONNMAN_PROPERTY_ID_WIFI_PASSPHRASE,
 };
 
 /**
diff --git a/plugins/Makefile.am b/plugins/Makefile.am
index 71ae0cf..de4b58b 100644
--- a/plugins/Makefile.am
+++ b/plugins/Makefile.am
@@ -1,7 +1,7 @@
 
 plugindir = $(libdir)/connman/plugins
 
-plugin_LTLIBRARIES = ipv4.la
+plugin_LTLIBRARIES =
 
 if LOOPBACK
 plugin_LTLIBRARIES += loopback.la
@@ -53,8 +53,6 @@ plugin_LTLIBRARIES += hso.la
 hso_la_SOURCES = hso.c modem.h modem.c
 endif
 
-ipv4_la_SOURCES = ipv4.c inet.h inet.c
-
 if UDHCP
 plugin_LTLIBRARIES += udhcp.la
 
diff --git a/plugins/fake.c b/plugins/fake.c
index 1ea9cc5..4f57837 100644
--- a/plugins/fake.c
+++ b/plugins/fake.c
@@ -23,102 +23,87 @@
 #include <config.h>
 #endif
 
+#include <stdio.h>
+
 #define CONNMAN_API_SUBJECT_TO_CHANGE
 #include <connman/plugin.h>
-#include <connman/driver.h>
-#include <connman/element.h>
+#include <connman/device.h>
 #include <connman/log.h>
 
-static void create_network(struct connman_element *parent, const char *name)
+static void create_network(struct connman_device *device, const char *name)
 {
-       struct connman_element *element;
+       struct connman_network *network;
 
-       element = connman_element_create(name);
-       element->type = CONNMAN_ELEMENT_TYPE_NETWORK;
-       element->subtype = CONNMAN_ELEMENT_SUBTYPE_FAKE;
+       network = connman_network_create(name, CONNMAN_NETWORK_TYPE_VENDOR);
+       if (network == NULL)
+               return;
 
-       connman_element_register(element, parent);
-       connman_element_unref(element);
+       connman_device_add_network(device, network);
+       connman_network_unref(network);
 }
 
-static int fake_device_probe(struct connman_element *element)
+static int device_probe(struct connman_device *device)
 {
        DBG("");
 
        return 0;
 }
 
-static void fake_device_remove(struct connman_element *element)
+static void device_remove(struct connman_device *device)
 {
        DBG("");
 }
 
-static int fake_device_update(struct connman_element *element)
+static int device_enable(struct connman_device *device)
 {
        DBG("");
 
-       create_network(element, "network_new");
+       create_network(device, "network_one");
+       create_network(device, "network_two");
 
        return 0;
 }
 
-static int fake_device_enable(struct connman_element *element)
+static int device_disable(struct connman_device *device)
 {
        DBG("");
 
-       create_network(element, "network_one");
-       create_network(element, "network_two");
-
-       return 0;
-}
-
-static int fake_device_disable(struct connman_element *element)
-{
-       DBG("");
-
-       connman_element_unregister_children(element);
-
        return 0;
 }
 
-static struct connman_driver fake_device_driver = {
-       .name           = "fake-device",
-       .type           = CONNMAN_ELEMENT_TYPE_DEVICE,
-       .subtype        = CONNMAN_ELEMENT_SUBTYPE_FAKE,
-       .probe          = fake_device_probe,
-       .remove         = fake_device_remove,
-       .update         = fake_device_update,
-       .enable         = fake_device_enable,
-       .disable        = fake_device_disable,
+static struct connman_device_driver device_driver = {
+       .name           = "fake",
+       .type           = CONNMAN_DEVICE_TYPE_VENDOR,
+       .probe          = device_probe,
+       .remove         = device_remove,
+       .enable         = device_enable,
+       .disable        = device_disable,
 };
 
 static void create_device(const char *name)
 {
-       struct connman_element *element;
+       struct connman_device *device;
 
-       element = connman_element_create(name);
-       element->type = CONNMAN_ELEMENT_TYPE_DEVICE;
-       element->subtype = CONNMAN_ELEMENT_SUBTYPE_FAKE;
+       device = connman_device_create(name, CONNMAN_DEVICE_TYPE_VENDOR);
+       if (device == NULL)
+               return;
 
-       //connman_element_define_properties(element,
-       //                              CONNMAN_PROPERTY_ID_IPV4_METHOD,
-       //                              CONNMAN_PROPERTY_ID_INVALID);
+       connman_device_set_mode(device, CONNMAN_DEVICE_MODE_NETWORK_SINGLE);
 
-       connman_element_register(element, NULL);
-       connman_element_unref(element);
+       connman_device_register(device);
+       connman_device_unref(device);
 }
 
 static int fake_init(void)
 {
-       create_device("fakeone");
-       create_device("faketwo");
+       create_device("fake");
 
-       return connman_driver_register(&fake_device_driver);
+       return connman_device_driver_register(&device_driver);
 }
 
 static void fake_exit(void)
 {
-       connman_driver_unregister(&fake_device_driver);
+       connman_device_driver_unregister(&device_driver);
 }
 
 CONNMAN_PLUGIN_DEFINE(fake, "Tesing plugin", VERSION, fake_init, fake_exit)
diff --git a/plugins/ipv4.c b/plugins/ipv4.c
deleted file mode 100644
index b611fb0..0000000
--- a/plugins/ipv4.c
+++ /dev/null
@@ -1,515 +0,0 @@
-/*
- *
- *  Connection Manager
- *
- *  Copyright (C) 2007-2009  Intel Corporation. All rights reserved.
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 2 as
- *  published by the Free Software Foundation.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- *
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <unistd.h>
-#include <string.h>
-#include <sys/ioctl.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <net/if.h>
-#include <net/route.h>
-
-#include <linux/netlink.h>
-#include <linux/rtnetlink.h>
-
-#define CONNMAN_API_SUBJECT_TO_CHANGE
-#include <connman/plugin.h>
-#include <connman/driver.h>
-#include <connman/resolver.h>
-#include <connman/rtnl.h>
-#include <connman/log.h>
-
-#include "inet.h"
-
-enum connman_ipv4_method {
-       CONNMAN_IPV4_METHOD_UNKNOWN = 0,
-       CONNMAN_IPV4_METHOD_OFF     = 1,
-       CONNMAN_IPV4_METHOD_STATIC  = 2,
-       CONNMAN_IPV4_METHOD_DHCP    = 3,
-};
-
-struct connman_ipv4 {
-       enum connman_ipv4_method method;
-       struct in_addr address;
-       struct in_addr netmask;
-       struct in_addr broadcast;
-};
-
-struct gateway_data {
-       int index;
-       char *gateway;
-};
-
-static GSList *gateway_list = NULL;
-
-static struct gateway_data *find_gateway(int index, const char *gateway)
-{
-       GSList *list;
-
-       if (gateway == NULL)
-               return NULL;
-
-       for (list = gateway_list; list; list = list->next) {
-               struct gateway_data *data = list->data;
-
-               if (data->gateway == NULL)
-                       continue;
-
-               if (data->index == index &&
-                               g_str_equal(data->gateway, gateway) == TRUE)
-                       return data;
-       }
-
-       return NULL;
-}
-
-static int set_ipv4(struct connman_element *element,
-                       struct connman_ipv4 *ipv4, const char *nameserver)
-{
-       struct ifreq ifr;
-       struct sockaddr_in *addr;
-       int sk, err;
_______________________________________________
Commits mailing list
[email protected]
https://lists.moblin.org/mailman/listinfo/commits

Reply via email to