This email list is read-only.  Emails sent to this list will be discarded
----------------------------------
 include/Makefile.am |    2 +-
 include/iface.h     |  176 ------
 include/ipv4.h      |   46 ++
 src/connman.h       |    5 +
 src/element.c       |   28 +
 src/iface-helper.c  |  136 -----
 src/iface.c         | 1522 ---------------------------------------------------
 7 files changed, 80 insertions(+), 1835 deletions(-)

New commits:
commit b149b69096a0efd9889ade2faef3c6ad83d73814
Author: Marcel Holtmann <[EMAIL PROTECTED]>
Date:   Thu Dec 11 17:17:37 2008 +0100

    Remove deprecated interface implementation

commit 373b7a179f8a5b861ed7f376d89e756d71a6a84c
Author: Marcel Holtmann <[EMAIL PROTECTED]>
Date:   Thu Dec 11 17:16:48 2008 +0100

    Remove deprecated interface declarations

commit 6a1f084d9ba7673c39cc901106d128840c27f942
Author: Marcel Holtmann <[EMAIL PROTECTED]>
Date:   Thu Dec 11 17:16:19 2008 +0100

    Remove deprecated interface helpers

commit bc9ec6ee5880b7301be327740fe693edaadeb229
Author: Marcel Holtmann <[EMAIL PROTECTED]>
Date:   Thu Dec 11 17:15:57 2008 +0100

    Add functions for IPv4 method conversion

commit 516bd979f71d8d1de1fb34e95345bcc3edd882fe
Author: Marcel Holtmann <[EMAIL PROTECTED]>
Date:   Thu Dec 11 17:14:34 2008 +0100

    Don't include ipv4.xml for now

commit 68cb90edd4b5b27813f937cca498c298305095cb
Author: Marcel Holtmann <[EMAIL PROTECTED]>
Date:   Thu Dec 11 17:12:27 2008 +0100

    Add definitions for IPv4 methods


Diff in this email is a maximum of 400 lines.
diff --git a/include/Makefile.am b/include/Makefile.am
index 704ac56..8c6617e 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -2,7 +2,7 @@
 includedir = @includedir@/connman
 
 include_HEADERS = log.h plugin.h security.h resolver.h driver.h \
-                               element.h property.h network.h rtnl.h dbus.h
+                       element.h property.h network.h ipv4.h rtnl.h dbus.h
 
 noinst_HEADERS = device.h
 
diff --git a/include/iface.h b/include/iface.h
deleted file mode 100644
index 3530f23..0000000
--- a/include/iface.h
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- *
- *  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
- *
- */
-
-#ifndef __CONNMAN_IFACE_H
-#define __CONNMAN_IFACE_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <netinet/in.h>
-
-enum connman_iface_type {
-       CONNMAN_IFACE_TYPE_UNKNOWN   = 0,
-       CONNMAN_IFACE_TYPE_80203     = 1,
-       CONNMAN_IFACE_TYPE_80211     = 2,
-       CONNMAN_IFACE_TYPE_WIMAX     = 3,
-       CONNMAN_IFACE_TYPE_MODEM     = 4,
-       CONNMAN_IFACE_TYPE_BLUETOOTH = 5,
-};
-
-enum connman_iface_flags {
-       CONNMAN_IFACE_FLAG_RTNL      = (1 << 0),
-       CONNMAN_IFACE_FLAG_IPV4      = (1 << 1),
-       CONNMAN_IFACE_FLAG_IPV6      = (1 << 2),
-       CONNMAN_IFACE_FLAG_SCANNING  = (1 << 3),
-       CONNMAN_IFACE_FLAG_NOCARRIER = (1 << 4),
-
-       CONNMAN_IFACE_FLAG_STARTED   = (1 << 16),
-       CONNMAN_IFACE_FLAG_RUNNING   = (1 << 17),
-       CONNMAN_IFACE_FLAG_DHCP      = (1 << 18),
-};
-
-enum connman_iface_state {
-       CONNMAN_IFACE_STATE_UNKNOWN   = 0,
-       CONNMAN_IFACE_STATE_OFF       = 1,
-       CONNMAN_IFACE_STATE_ENABLED   = 2,
-       CONNMAN_IFACE_STATE_SCANNING  = 3,
-       CONNMAN_IFACE_STATE_CONNECT   = 4,
-       CONNMAN_IFACE_STATE_CONNECTED = 5,
-       CONNMAN_IFACE_STATE_CARRIER   = 6,
-       CONNMAN_IFACE_STATE_CONFIGURE = 7,
-       CONNMAN_IFACE_STATE_READY     = 8,
-       CONNMAN_IFACE_STATE_SHUTDOWN  = 9,
-};
-
-enum connman_iface_policy {
-       CONNMAN_IFACE_POLICY_UNKNOWN = 0,
-       CONNMAN_IFACE_POLICY_OFF     = 1,
-       CONNMAN_IFACE_POLICY_IGNORE  = 2,
-       CONNMAN_IFACE_POLICY_AUTO    = 3,
-       CONNMAN_IFACE_POLICY_ASK     = 4,
-};
-
-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 gateway;
-       struct in_addr network;
-       struct in_addr broadcast;
-       struct in_addr nameserver;
-};
-
-struct connman_network {
-       struct connman_iface *iface;
-       char *path;
-       char *identifier;
-       char *passphrase;
-};
-
-struct connman_iface {
-       char *path;
-       char *udi;
-       char *sysfs;
-       char *identifier;
-       int index;
-       enum connman_iface_type type;
-       unsigned long flags;
-       enum connman_iface_state state;
-       enum connman_iface_policy policy;
-       struct connman_network network;
-       struct connman_ipv4 ipv4;
-
-       struct connman_iface_driver *driver;
-       void *driver_data;
-
-       void *rtnl_data;
-
-       struct {
-               char *driver;
-               char *vendor;
-               char *product;
-       } device;
-};
-
-struct connman_iface_driver {
-       const char *name;
-       const char *capability;
-
-       int (*probe) (struct connman_iface *iface);
-       void (*remove) (struct connman_iface *iface);
-
-       int (*start) (struct connman_iface *iface);
-       int (*stop) (struct connman_iface *iface);
-
-       int (*scan) (struct connman_iface *iface);
-       int (*connect) (struct connman_iface *iface,
-                                       struct connman_network *network);
-       int (*disconnect) (struct connman_iface *iface);
-
-       void (*rtnl_carrier) (struct connman_iface *iface, int carrier);
-       void (*rtnl_wireless) (struct connman_iface *iface,
-                                       void *data, unsigned short len);
-};
-
-extern int connman_iface_register(struct connman_iface_driver *driver);
-extern void connman_iface_unregister(struct connman_iface_driver *driver);
-
-static inline void *connman_iface_get_data(struct connman_iface *iface)
-{
-       return iface->driver_data;
-}
-
-static inline void connman_iface_set_data(struct connman_iface *iface,
-                                                               void *data)
-{
-       iface->driver_data = data;
-}
-
-extern void connman_iface_indicate_ifup(struct connman_iface *iface);
-extern void connman_iface_indicate_ifdown(struct connman_iface *iface);
-extern void connman_iface_indicate_connected(struct connman_iface *iface);
-extern void connman_iface_indicate_carrier_on(struct connman_iface *iface);
-extern void connman_iface_indicate_carrier_off(struct connman_iface *iface);
-extern void connman_iface_indicate_configured(struct connman_iface *iface);
-
-extern void connman_iface_indicate_station(struct connman_iface *iface,
-                               const char *name, int strength, int security);
-
-extern int connman_iface_get_ipv4(struct connman_iface *iface,
-                                               struct connman_ipv4 *ipv4);
-extern int connman_iface_set_ipv4(struct connman_iface *iface,
-                                               struct connman_ipv4 *ipv4);
-extern int connman_iface_clear_ipv4(struct connman_iface *iface);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __CONNMAN_IFACE_H */
diff --git a/include/ipv4.h b/include/ipv4.h
new file mode 100644
index 0000000..3cbf85b
--- /dev/null
+++ b/include/ipv4.h
@@ -0,0 +1,46 @@
+/*
+ *
+ *  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
+ *
+ */
+
+#ifndef __CONNMAN_IPV4_H
+#define __CONNMAN_IPV4_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * SECTION:ipv4
+ * @title: IPv4 premitives
+ * @short_description: Functions for handling IPv4
+ */
+
+enum connman_ipv4_method {
+       CONNMAN_IPV4_METHOD_UNKNOWN = 0,
+       CONNMAN_IPV4_METHOD_OFF     = 1,
+       CONNMAN_IPV4_METHOD_STATIC  = 2,
+       CONNMAN_IPV4_METHOD_DHCP    = 3,
+};
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __CONNMAN_IPV4_H */
diff --git a/src/connman.h b/src/connman.h
index 965a283..0275feb 100644
--- a/src/connman.h
+++ b/src/connman.h
@@ -62,6 +62,11 @@ void __connman_plugin_cleanup(void);
 
 int __connman_security_check_privileges(DBusMessage *message);
 
+#include <connman/ipv4.h>
+
+const char *__connman_ipv4_method2string(enum connman_ipv4_method method);
+enum connman_ipv4_method __connman_ipv4_string2method(const char *method);
+
 #include <connman/resolver.h>
 
 #include <connman/driver.h>
diff --git a/src/element.c b/src/element.c
index 7361eb2..16a7d27 100644
--- a/src/element.c
+++ b/src/element.c
@@ -180,6 +180,34 @@ enum connman_element_policy 
__connman_element_string2policy(const char *policy)
                return CONNMAN_ELEMENT_POLICY_UNKNOWN;
 }
 
+const char *__connman_ipv4_method2string(enum connman_ipv4_method method)
+{
+       switch (method) {
+       case CONNMAN_IPV4_METHOD_UNKNOWN:
+               return "unknown";
+       case CONNMAN_IPV4_METHOD_OFF:
+               return "off";
+       case CONNMAN_IPV4_METHOD_STATIC:
+               return "static";
+       case CONNMAN_IPV4_METHOD_DHCP:
+               return "dhcp";
+       }
+
+       return "unknown";
+}
+
+enum connman_ipv4_method __connman_ipv4_string2method(const char *method)
+{
+       if (strcasecmp(method, "off") == 0)
+               return CONNMAN_IPV4_METHOD_OFF;
+       else if (strcasecmp(method, "static") == 0)
+               return CONNMAN_IPV4_METHOD_STATIC;
+       else if (strcasecmp(method, "dhcp") == 0)
+               return CONNMAN_IPV4_METHOD_DHCP;
+       else
+               return CONNMAN_IPV4_METHOD_UNKNOWN;
+}
+
 static void append_property(DBusMessageIter *dict,
                                struct connman_property *property)
 {
diff --git a/src/iface-helper.c b/src/iface-helper.c
deleted file mode 100644
index 23c2605..0000000
--- a/src/iface-helper.c
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- *
- *  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
-
-#include <string.h>
-
-#include "connman.h"
-
-const char *__connman_iface_type2string(enum connman_iface_type type)
-{
-       switch (type) {
-       case CONNMAN_IFACE_TYPE_UNKNOWN:
-               return "unknown";
-       case CONNMAN_IFACE_TYPE_80203:
-               return "80203";
-       case CONNMAN_IFACE_TYPE_80211:
-               return "80211";
-       case CONNMAN_IFACE_TYPE_WIMAX:
-               return "wimax";
-       case CONNMAN_IFACE_TYPE_MODEM:
-               return "modem";
-       case CONNMAN_IFACE_TYPE_BLUETOOTH:
-               return "bluetooth";
-       }
-
-       return "unknown";
-}
-
-const char *__connman_iface_state2string(enum connman_iface_state state)
-{
-       switch (state) {
-       case CONNMAN_IFACE_STATE_UNKNOWN:
-               return "unknown";
-       case CONNMAN_IFACE_STATE_OFF:
-               return "off";
-       case CONNMAN_IFACE_STATE_ENABLED:
-               return "enabled";
-       case CONNMAN_IFACE_STATE_SCANNING:
-               return "scanning";
-       case CONNMAN_IFACE_STATE_CONNECT:
-               return "connect";
-       case CONNMAN_IFACE_STATE_CONNECTED:
-               return "connected";
-       case CONNMAN_IFACE_STATE_CARRIER:
-               return "carrier";
-       case CONNMAN_IFACE_STATE_CONFIGURE:
-               return "configure";
-       case CONNMAN_IFACE_STATE_READY:
-               return "ready";
-       case CONNMAN_IFACE_STATE_SHUTDOWN:
-               return "shutdown";
-       }
-
-       return "unknown";
-}
-
-const char *__connman_iface_policy2string(enum connman_iface_policy policy)
-{
-       switch (policy) {
-       case CONNMAN_IFACE_POLICY_UNKNOWN:
-               return "unknown";
-       case CONNMAN_IFACE_POLICY_OFF:
-               return "off";
-       case CONNMAN_IFACE_POLICY_IGNORE:
-               return "ignore";
-       case CONNMAN_IFACE_POLICY_AUTO:
-               return "auto";
-       case CONNMAN_IFACE_POLICY_ASK:
-               return "ask";
-       }
-
_______________________________________________
Commits mailing list
[email protected]
https://lists.moblin.org/mailman/listinfo/commits

Reply via email to