include/notifier.h \
include/storage.h include/service.h \
include/resolver.h include/ipconfig.h \
- include/device.h include/network.h include/inet.h \
- include/ondemand.h
+ include/device.h include/network.h include/inet.h
nodist_include_HEADERS = include/version.h
src/utsname.c src/timeserver.c src/rfkill.c \
src/wifi.c src/storage.c src/dbus.c src/config.c \
src/technology.c src/counter.c src/location.c \
- src/session.c src/tethering.c src/ondemand.c \
- src/wpad.c src/wispr.c src/stats.c src/iptables.c \
- src/dnsproxy.c
+ src/session.c src/tethering.c src/wpad.c src/wispr.c \
+ src/stats.c src/iptables.c src/dnsproxy.c
src_connmand_LDADD = $(builtin_libadd) @GLIB_LIBS@ @DBUS_LIBS@ \
@CAPNG_LIBS@ @XTABLES_LIBS@ -lresolv -ldl
+++ /dev/null
-/*
- *
- * Connection Manager
- *
- * Copyright (C) 2007-2010 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_ONDEMAND_H
-#define __CONNMAN_ONDEMAND_H
-
-#include <glib.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-gboolean connman_ondemand_connected(void);
-int connman_ondemand_start(const char *pref_bearer, unsigned int idle_timeout);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __CONNMAN_ONDEMAND_H */
int __connman_session_init(void);
void __connman_session_cleanup(void);
-int __connman_ondemand_init(void);
-void __connman_ondemand_cleanup(void);
-
struct connman_stats_data {
unsigned int rx_packets;
unsigned int tx_packets;
#include <glib.h>
-#define CONNMAN_API_SUBJECT_TO_CHANGE
-#include <connman/ondemand.h>
-
#include "connman.h"
#if __BYTE_ORDER == __LITTLE_ENDIAN
DBG("Received %d bytes (id 0x%04x)", len, buf[2] | buf[3] << 8);
err = parse_request(buf + 2, len - 2, query, sizeof(query));
- if (err < 0 || (g_slist_length(server_list) == 0 &&
- connman_ondemand_connected())) {
+ if (err < 0 || (g_slist_length(server_list) == 0)) {
send_response(client_sk, buf, len, NULL, 0, IPPROTO_TCP);
return TRUE;
}
DBG("Received %d bytes (id 0x%04x)", len, buf[0] | buf[1] << 8);
err = parse_request(buf, len, query, sizeof(query));
- if (err < 0 || (g_slist_length(server_list) == 0 &&
- connman_ondemand_connected())) {
+ if (err < 0 || (g_slist_length(server_list) == 0)) {
send_response(sk, buf, len, (void *)&client_addr,
client_addr_len, IPPROTO_UDP);
return TRUE;
buf[0] = req->dstid & 0xff;
buf[1] = req->dstid >> 8;
- if (!connman_ondemand_connected()) {
- DBG("Starting on demand connection");
- /*
- * We're not connected, let's queue the request and start
- * an on-demand connection.
- */
- req->request = g_try_malloc0(req->request_len);
- if (req->request == NULL)
- return TRUE;
-
- memcpy(req->request, buf, req->request_len);
-
- req->name = g_try_malloc0(sizeof(query));
- if (req->name == NULL) {
- g_free(req->request);
- return TRUE;
- }
- memcpy(req->name, query, sizeof(query));
-
- request_pending_list = g_slist_append(request_pending_list,
- req);
-
- connman_ondemand_start("", 300);
-
- return TRUE;
- }
-
-
req->numserv = 0;
req->timeout = g_timeout_add_seconds(5, request_timeout, req);
request_list = g_slist_append(request_list, req);
__connman_iptables_init();
__connman_tethering_init();
__connman_counter_init();
- __connman_ondemand_init();
__connman_manager_init(option_compat);
__connman_profile_init();
__connman_config_init();
__connman_config_cleanup();
__connman_profile_cleanup();
__connman_manager_cleanup();
- __connman_ondemand_cleanup();
__connman_counter_cleanup();
__connman_agent_cleanup();
__connman_tethering_cleanup();
+++ /dev/null
-/*
- *
- * Connection Manager
- *
- * Copyright (C) 2007-2010 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 <connman/service.h>
-#include <connman/ondemand.h>
-#include <connman/notifier.h>
-#include <connman/log.h>
-
-#include "connman.h"
-
-static volatile gint started;
-static gboolean connected;
-struct connman_service *ondemand_service;
-
-static void ondemand_default_changed(struct connman_service *service)
-{
- DBG("service %p", service);
-
- if (service == NULL) {
- connected = FALSE;
- return;
- }
-
- connected = TRUE;
-}
-
-static struct connman_notifier ondemand_notifier = {
- .name = "ondemand",
- .default_changed = ondemand_default_changed,
-};
-
-gboolean connman_ondemand_connected(void)
-{
- DBG("connected %d", connected);
-
- return TRUE;
-// return connected;
-}
-
-int connman_ondemand_start(const char *bearer, unsigned int idle_timeout)
-{
- DBG("");
-
- if (g_atomic_int_get(&started) > 0)
- return 0;
-
- g_atomic_int_inc(&started);
-
- ondemand_service = __connman_session_request(bearer, "__ondemand__");
- if (ondemand_service == NULL)
- g_atomic_int_set(&started, 0);
-
- /* TODO:
- * 1) Set IDLETIMER target.
- * 2) Listen for the sysfs/netlink event.
- * 3) Stop the session.
- */
-
- return 0;
-}
-
-int __connman_ondemand_init(void)
-{
- DBG("");
-
- return connman_notifier_register(&ondemand_notifier);
-}
-
-void __connman_ondemand_cleanup(void)
-{
- DBG("");
-
- connman_notifier_unregister(&ondemand_notifier);
-}