This email list is read-only. Emails sent to this list will be discarded ---------------------------------- Makefile.am | 1 + README | 20 ++++++++++++++++++++ bootstrap-configure | 1 + configure.ac | 22 ++++++++++++++++++++++ include/Makefile.am | 4 ++-- include/storage.h | 2 ++ plugins/Makefile.am | 4 +++- plugins/polkit.c | 2 +- src/Makefile.am | 8 ++++++-- src/connman.h | 2 ++ src/device.c | 10 ++++++++++ src/element.c | 2 ++ src/main.c | 14 +++++++++++--- src/network.c | 8 ++++++++ src/storage.c | 36 ++++++++++++++++++++++++++++++++++++ 15 files changed, 127 insertions(+), 9 deletions(-)
New commits: commit ee789c58f87dc413529f51342b75fef525604aac Author: Marcel Holtmann <[email protected]> Date: Thu Jan 8 21:57:51 2009 +0100 Add option to disable installation for data files commit b0799835aa141dd9f32d1d477e113507f8b47522 Author: Marcel Holtmann <[email protected]> Date: Thu Jan 8 21:40:58 2009 +0100 Use $PKG_CONFIG instead of pkg-config commit 0f3e594a00cbe7922640a4dc338fed62226c9243 Author: Marcel Holtmann <[email protected]> Date: Thu Jan 8 21:26:15 2009 +0100 Fix uninitialized action id variable commit 6b0565ed922f60d121a73f04444e58bc171e1a55 Author: Marcel Holtmann <[email protected]> Date: Thu Jan 8 21:17:41 2009 +0100 Add support for reading config directory from dbus-1.pc commit 049eae8ec20f0b3dd37d6f4b843da318966d4346 Author: Marcel Holtmann <[email protected]> Date: Thu Jan 8 21:09:18 2009 +0100 Add support for reading rules directory from libudev.pc commit 8e888241130e35ee140ba6c184d0ceff1598c430 Author: Marcel Holtmann <[email protected]> Date: Thu Jan 8 21:02:04 2009 +0100 Add support for reading policy directory from polkit.pc commit 6281c3a0f6026a77d68026c0e14c49b825fab2ef Author: Marcel Holtmann <[email protected]> Date: Thu Jan 8 18:38:19 2009 +0100 Add command line option to show version number commit 3df7e823d4476f56b86b809c80a1dfa57f7413bf Author: Marcel Holtmann <[email protected]> Date: Wed Jan 7 20:45:28 2009 +0100 Add general features section to documentation commit 33eca46278b1b3d17a3f966758cb03ec52cd414c Author: Marcel Holtmann <[email protected]> Date: Wed Jan 7 20:32:01 2009 +0100 Use symlinks instead of copying header files commit b1d822465166dba78f8ad54837f106c3ec513631 Author: Marcel Holtmann <[email protected]> Date: Wed Jan 7 20:24:16 2009 +0100 Add support for storage setup callbacks Diff in this email is a maximum of 400 lines. diff --git a/Makefile.am b/Makefile.am index 5f40b57..37bb4e0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -6,6 +6,7 @@ pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = connman.pc DISTCHECK_CONFIGURE_FLAGS = --disable-gtk-doc \ + --disable-datafiles \ --enable-loopback \ --enable-ethernet \ --enable-wifi \ diff --git a/README b/README index 989198c..37130dd 100644 --- a/README +++ b/README @@ -4,6 +4,26 @@ Connection Manager Copyright (C) 2007-2009 Intel Corporation. All rights reserved. +Functionality and features +========================== + +The following features are built-in into Connection Manager: + - Generic plugin infrastructure + - Device and network abstraction (with basic storage support) + - IPv4, routing and DNS configuration + +Various plugins can be enabled for networking support: + - Ethernet plugin + - WiFi plugin with WEP40/WEP128 and WPA/WPA2 (personal only) support + - Bluetooth plugin + +Also plugins with additional features are available: + - DHCP plugins (uDHCP and dhclient) + - Resolver plugins (resolvconf and DNS proxy) + - Loopback setup + - PolicyKit support + + Compilation and installation ============================ diff --git a/bootstrap-configure b/bootstrap-configure index 340d80b..3264b32 100755 --- a/bootstrap-configure +++ b/bootstrap-configure @@ -16,6 +16,7 @@ fi --mandir=/usr/share/man \ --localstatedir=/var \ --sysconfdir=/etc \ + --disable-datafiles \ --enable-loopback \ --enable-ethernet \ --enable-wifi \ diff --git a/configure.ac b/configure.ac index 1d8fc5e..8e85d33 100644 --- a/configure.ac +++ b/configure.ac @@ -167,6 +167,13 @@ PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.0, dummy=yes, AC_MSG_ERROR(libdbus is required)) AC_SUBST(DBUS_CFLAGS) AC_SUBST(DBUS_LIBS) +DBUS_DATADIR="`$PKG_CONFIG --variable=sysconfdir dbus-1`" +if (test -z "{DBUS_DATADIR}"); then + DBUS_DATADIR="${sysconfdir}/dbus-1/system.d" +else + DBUS_DATADIR="$DBUS_DATADIR/dbus-1/system.d" +fi +AC_SUBST(DBUS_DATADIR) AC_SUBST([GDBUS_CFLAGS], ['$(DBUS_CFLAGS) -I$(top_srcdir)/gdbus']) AC_SUBST([GDBUS_LIBS], ['$(top_builddir)/gdbus/libgdbus.la $(DBUS_LIBS)']) @@ -186,6 +193,11 @@ if (test "${enable_udev}" = "yes"); then [Define to 1 if you need the udev_device_get_parent_with_subsystem_devtype() function.])) + UDEV_DATADIR="`$PKG_CONFIG --variable=rulesdir libudev`" + if (test -z "${UDEV_DATADIR}"); then + UDEV_DATADIR="${sysconfdir}/udev/rules.d" + fi + AC_SUBST(UDEV_DATADIR) fi AC_SUBST(UDEV_CFLAGS) AC_SUBST(UDEV_LIBS) @@ -198,6 +210,11 @@ if (test "${enable_polkit}" = "yes"); then AC_MSG_ERROR(PolicyKit >= 0.7 is required)) AC_SUBST(POLKIT_CFLAGS) AC_SUBST(POLKIT_LIBS) + POLKIT_DATADIR="`$PKG_CONFIG --variable=policydir polkit`" + if (test -z "${POLKIT_DATADIR}"); then + POLKIT_DATADIR="${datadir}/PolicyKit/policy" + fi + AC_SUBST(POLKIT_DATADIR) fi AM_CONDITIONAL(POLKIT, test "${enable_polkit}" = "yes") @@ -209,6 +226,11 @@ AC_ARG_ENABLE(fake, AC_HELP_STRING([--enable-fake], [enable fake device support]), [enable_fake=${enableval}]) AM_CONDITIONAL(FAKE, test "${enable_fake}" = "yes") +AC_ARG_ENABLE(datafiles, AC_HELP_STRING([--disable-datafiles], + [don't install configuration and data files]), + [enable_datafiles=${enableval}]) +AM_CONDITIONAL(DATAFILES, test "${enable_datafiles}" != "no") + AC_OUTPUT(Makefile gdbus/Makefile include/Makefile include/version.h src/Makefile src/connman.service scripts/connman scripts/Makefile plugins/Makefile client/Makefile diff --git a/include/Makefile.am b/include/Makefile.am index 2db0249..f8e9e73 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -14,9 +14,9 @@ all-local: @if [ ! -e connman ]; then \ mkdir connman; \ list='$(include_HEADERS) $(noinst_HEADERS)'; for i in $$list; \ - do cp $(top_srcdir)/include/$$i connman/; done; \ + do $(LN_S) $(abs_top_srcdir)/include/$$i connman/$$i; done; \ list='$(nodist_include_HEADERS)'; for i in $$list; \ - do cp $(top_builddir)/include/$$i connman/; done; \ + do $(LN_S) $(abs_top_builddir)/include/$$i connman/$$i; done; \ fi clean-local: diff --git a/include/storage.h b/include/storage.h index 9182675..cd31b69 100644 --- a/include/storage.h +++ b/include/storage.h @@ -43,9 +43,11 @@ struct connman_storage { const char *name; int priority; enum connman_device_type device_type; + int (*device_init) (void); int (*device_load) (struct connman_device *device); int (*device_save) (struct connman_device *device); enum connman_network_type network_type; + int (*network_init) (struct connman_device *device); int (*network_load) (struct connman_network *network); int (*network_save) (struct connman_network *network); }; diff --git a/plugins/Makefile.am b/plugins/Makefile.am index b4c187b..0bda028 100644 --- a/plugins/Makefile.am +++ b/plugins/Makefile.am @@ -96,10 +96,12 @@ polkit_la_SOURCES = polkit.c polkit_la_LIBADD = @POLKIT_LIBS@ @GLIB_LIBS@ polkit_la_CFLAGS = @GLIB_CFLAGS@ @POLKIT_CFLAGS@ -policydir = $(datadir)/PolicyKit/policy +if DATAFILES +policydir = @POLKIT_DATADIR@ policy_DATA = connman.policy endif +endif if FAKE plugin_LTLIBRARIES += fake.la diff --git a/plugins/polkit.c b/plugins/polkit.c index de183a2..247721e 100644 --- a/plugins/polkit.c +++ b/plugins/polkit.c @@ -47,7 +47,7 @@ static int polkit_authorize(const char *sender, PolKitCaller *caller; PolKitAction *action; PolKitResult result; - const char *id; + const char *id = NULL; DBG("sender %s", sender); diff --git a/src/Makefile.am b/src/Makefile.am index a540bf1..4eda671 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,7 +1,9 @@ -dbusdir = $(sysconfdir)/dbus-1/system.d +if DATAFILES +dbusdir = @DBUS_DATADIR@ dbus_DATA = connman.conf +endif sbin_PROGRAMS = connmand @@ -13,10 +15,12 @@ connmand_SOURCES = main.c connman.h log.c selftest.c error.c plugin.c \ if UDEV connmand_SOURCES += udev.c -rulesdir = $(sysconfdir)/udev/rules.d +if DATAFILES +rulesdir = @UDEV_DATADIR@ rules_DATA = 92-connman.rules endif +endif connmand_LDADD = @GDBUS_LIBS@ @GLIB_LIBS@ @UDEV_LIBS@ -ldl diff --git a/src/connman.h b/src/connman.h index f98fc79..cca7ea8 100644 --- a/src/connman.h +++ b/src/connman.h @@ -87,8 +87,10 @@ int __connman_resolver_selftest(void); int __connman_storage_init(void); void __connman_storage_cleanup(void); +int __connman_storage_init_device(); int __connman_storage_load_device(struct connman_device *device); int __connman_storage_save_device(struct connman_device *device); +int __connman_storage_init_network(); int __connman_storage_load_network(struct connman_network *network); int __connman_storage_save_network(struct connman_network *network); diff --git a/src/device.c b/src/device.c index 4575dd2..2a65e69 100644 --- a/src/device.c +++ b/src/device.c @@ -1250,6 +1250,16 @@ int connman_device_register(struct connman_device *device) { __connman_storage_load_device(device); + switch (device->mode) { + case CONNMAN_DEVICE_MODE_UNKNOWN: + case CONNMAN_DEVICE_MODE_TRANSPORT_IP: + break; + case CONNMAN_DEVICE_MODE_NETWORK_SINGLE: + case CONNMAN_DEVICE_MODE_NETWORK_MULTIPLE: + __connman_storage_init_network(device); + break; + } + return connman_element_register(&device->element, NULL); } diff --git a/src/element.c b/src/element.c index 57c2566..fb11f79 100644 --- a/src/element.c +++ b/src/element.c @@ -1455,6 +1455,8 @@ void __connman_element_start(void) started = TRUE; + __connman_storage_init_device(); + __connman_connection_init(); __connman_ipv4_init(); __connman_detect_init(); diff --git a/src/main.c b/src/main.c index b895b1c..5da7c86 100644 --- a/src/main.c +++ b/src/main.c @@ -53,9 +53,10 @@ static void disconnect_callback(DBusConnection *conn, void *user_data) static gchar *option_device = NULL; static gchar *option_plugin = NULL; static gboolean option_detach = TRUE; -static gboolean option_selftest = FALSE; static gboolean option_compat = FALSE; static gboolean option_debug = FALSE; +static gboolean option_selftest = FALSE; +static gboolean option_version = FALSE; static GOptionEntry options[] = { { "device", 'i', 0, G_OPTION_ARG_STRING, &option_device, @@ -65,12 +66,14 @@ static GOptionEntry options[] = { { "nodaemon", 'n', G_OPTION_FLAG_REVERSE, G_OPTION_ARG_NONE, &option_detach, "Don't fork daemon to background" }, - { "selftest", 't', 0, G_OPTION_ARG_NONE, &option_selftest, - "Run self testing routines" }, { "compat", 'c', 0, G_OPTION_ARG_NONE, &option_compat, "Enable Network Manager compatibility" }, { "debug", 'd', 0, G_OPTION_ARG_NONE, &option_debug, "Enable debug information output" }, + { "selftest", 't', 0, G_OPTION_ARG_NONE, &option_selftest, + "Run self testing routines" }, + { "version", 'v', 0, G_OPTION_ARG_NONE, &option_version, + "Show version information and exit" }, { NULL }, }; @@ -101,6 +104,11 @@ int main(int argc, char *argv[]) g_option_context_free(context); + if (option_version == TRUE) { + printf("%s\n", VERSION); + exit(0); + } + if (option_detach == TRUE) { if (daemon(0, 0)) { perror("Can't start daemon"); diff --git a/src/network.c b/src/network.c index 2c6d6b8..7b3d49b 100644 --- a/src/network.c +++ b/src/network.c @@ -1008,6 +1008,13 @@ static struct connman_driver network_driver = { .remove = network_remove, }; +static int network_init(struct connman_device *device) +{ + DBG("device %p", device); + + return 0; +} + static int network_load(struct connman_network *network) { GKeyFile *keyfile; @@ -1131,6 +1138,7 @@ done: static struct connman_storage network_storage = { .name = "network", .priority = CONNMAN_STORAGE_PRIORITY_LOW, + .network_init = network_init, .network_load = network_load, .network_save = network_save, }; diff --git a/src/storage.c b/src/storage.c index d881a5c..b63c43b 100644 --- a/src/storage.c +++ b/src/storage.c @@ -66,6 +66,24 @@ void connman_storage_unregister(struct connman_storage *storage) storage_list = g_slist_remove(storage_list, storage); } +int __connman_storage_init_device(void) +{ + GSList *list; + + DBG(""); + + for (list = storage_list; list; list = list->next) { + struct connman_storage *storage = list->data; + + if (storage->device_init) { + if (storage->device_init() == 0) + return 0; + } + } + + return -ENOENT; +} + int __connman_storage_load_device(struct connman_device *device) { GSList *list; @@ -102,6 +120,24 @@ int __connman_storage_save_device(struct connman_device *device) return -ENOENT; } +int __connman_storage_init_network(struct connman_device *device) +{ + GSList *list; + + DBG("device %p", device); + + for (list = storage_list; list; list = list->next) { + struct connman_storage *storage = list->data; + + if (storage->network_init) { + if (storage->network_init(device) == 0) + return 0; + } + } + + return -ENOENT; +} + int __connman_storage_load_network(struct connman_network *network) { GSList *list; _______________________________________________ Commits mailing list [email protected] https://lists.moblin.org/mailman/listinfo/commits
