This email list is read-only.  Emails sent to this list will be discarded
----------------------------------
 configure.ac        |    2 +-
 include/network.h   |    9 +++++++
 plugins/Makefile.am |    6 +++++
 plugins/pppd.c      |   61 +++++++++++++++++++++++++++++++++++++++++++++++++++
 src/network.c       |   14 +++++++++++
 5 files changed, 91 insertions(+), 1 deletions(-)

New commits:
commit 5be6dc3d4b22d736bb47e6fd6d4d5c8c11f70364
Author: Marcel Holtmann <[email protected]>
Date:   Thu Jan 1 02:04:35 2009 +0100

    Add skeleton for PPP plugin

commit e77d5b6ca6caf487af324e7ebc1f2d7384c39ad4
Author: Marcel Holtmann <[email protected]>
Date:   Thu Jan 1 02:04:05 2009 +0100

    Fix broken check for pppd header files

commit f883e5a75d0746b045a53cdeb9b82b645bdfcfee
Author: Marcel Holtmann <[email protected]>
Date:   Thu Jan 1 01:53:18 2009 +0100

    Add option for network protocol


Diff in this email is a maximum of 400 lines.
diff --git a/configure.ac b/configure.ac
index a22b82a..ad37741 100644
--- a/configure.ac
+++ b/configure.ac
@@ -49,7 +49,7 @@ AC_PATH_PROG(RESOLVCONF, [resolvconf], ,$PATH:/sbin:/usr/sbin)
 AC_PATH_PROG(WPASUPPLICANT, [wpa_supplicant], ,$PATH:/sbin:/usr/sbin)
 AC_PATH_PROG(PPPD, [pppd], ,$PATH:/sbin:/usr/sbin)
 
-AC_CHECK_HEADERS(pppd/pppd.h, pppd_found=no, pppd_found=yes)
+AC_CHECK_HEADERS(pppd/pppd.h, pppd_found=yes, pppd_found=no)
 AM_CONDITIONAL(PPPD, test "${pppd_found}" = "yes")
 
 AC_CHECK_LIB(dl, dlopen, dummy=yes,
diff --git a/include/network.h b/include/network.h
index 3fd266e..8dab190 100644
--- a/include/network.h
+++ b/include/network.h
@@ -43,6 +43,12 @@ enum connman_network_type {
        CONNMAN_NETWORK_TYPE_HSO           = 23,
 };
 
+enum connman_network_protocol {
+       CONNMAN_NETWORK_PROTOCOL_UNKNOWN = 0,
+       CONNMAN_NETWORK_PROTOCOL_IP      = 1,
+       CONNMAN_NETWORK_PROTOCOL_PPP     = 2,
+};
+
 struct connman_network;
 
 extern struct connman_network *connman_network_create(const char *identifier,
@@ -59,6 +65,9 @@ extern void connman_network_set_index(struct connman_network 
*network,
                                                                int index);
 extern int connman_network_get_index(struct connman_network *network);
 
+extern void connman_network_set_protocol(struct connman_network *network,
+                                       enum connman_network_protocol protocol);
+
 extern int connman_network_set_connected(struct connman_network *network,
                                                connman_bool_t connected);
 
diff --git a/plugins/Makefile.am b/plugins/Makefile.am
index e663e14..045c3f0 100644
--- a/plugins/Makefile.am
+++ b/plugins/Makefile.am
@@ -27,6 +27,12 @@ dhclient_la_SOURCES = dhclient.c inet.h inet.c
 dhclient_la_CFLAGS = @GLIB_CFLAGS@ @GDBUS_CFLAGS@ -DDHCLIENT=\"@dhcli...@\" \
                -DSTATEDIR=\""$(statedir)"\" -DSCRIPTDIR=\""$(scriptdir)"\"
 
+if PPPD
+plugin_LTLIBRARIES += pppd.la
+
+pppd_la_SOURCES = pppd.c
+endif
+
 ipv4_la_SOURCES = ipv4.c inet.h inet.c
 
 dnsproxy_la_SOURCES = dnsproxy.c
diff --git a/plugins/pppd.c b/plugins/pppd.c
new file mode 100644
index 0000000..1cf304f
--- /dev/null
+++ b/plugins/pppd.c
@@ -0,0 +1,61 @@
+/*
+ *
+ *  Connection Manager
+ *
+ *  Copyright (C) 2007-2008  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
+
+#define CONNMAN_API_SUBJECT_TO_CHANGE
+#include <connman/plugin.h>
+#include <connman/driver.h>
+#include <connman/log.h>
+
+static int pppd_probe(struct connman_element *element)
+{
+       DBG("element %p name %s", element, element->name);
+
+       return -ENODEV;
+}
+
+static void pppd_remove(struct connman_element *element)
+{
+       DBG("element %p name %s", element, element->name);
+}
+
+static struct connman_driver pppd_driver = {
+       .name           = "pppd",
+       .type           = CONNMAN_ELEMENT_TYPE_PPP,
+       .probe          = pppd_probe,
+       .remove         = pppd_remove,
+};
+
+static int pppd_init(void)
+{
+       return connman_driver_register(&pppd_driver);
+}
+
+static void pppd_exit(void)
+{
+       connman_driver_unregister(&pppd_driver);
+}
+
+CONNMAN_PLUGIN_DEFINE(pppd, "Point-to-point protocol plugin", VERSION,
+                                                       pppd_init, pppd_exit)
diff --git a/src/network.c b/src/network.c
index a54049b..69b6190 100644
--- a/src/network.c
+++ b/src/network.c
@@ -30,6 +30,7 @@
 struct connman_network {
        struct connman_element element;
        enum connman_network_type type;
+       enum connman_network_protocol protocol;
        gboolean connected;
        char *identifier;
        char *path;
@@ -365,6 +366,19 @@ int connman_network_get_index(struct connman_network 
*network)
 }
 
 /**
+ * connman_network_set_protocol:
+ * @network: network structure
+ * @protocol: network protocol
+ *
+ * Change protocol of network
+ */
+void connman_network_set_protocol(struct connman_network *network,
+                                       enum connman_network_protocol protocol)
+{
+       network->protocol = protocol;
+}
+
+/**
  * connman_network_set_connected:
  * @network: network structure
  * @connected: connected state
_______________________________________________
Commits mailing list
[email protected]
https://lists.moblin.org/mailman/listinfo/commits

Reply via email to