2 * Network Configuration Module
4 * Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
26 #include "network-state.h"
27 #include "network-statistics.h"
28 #include "signal-handler.h"
30 static GMainLoop *main_loop = NULL;
32 int main(int argc, char* argv[])
34 DBusGConnection *connection;
36 DBG("Network Configuration Module");
38 if (daemon(0, 0) != 0)
39 DBG("Cannot start daemon");
43 main_loop = g_main_loop_new(NULL, FALSE);
45 connection = netconfig_setup_dbus();
46 if (connection == NULL)
49 if (netconfig_network_state_create_and_init(connection) == NULL)
52 netconfig_register_signal();
54 if (netconfig_wifi_create_and_init(connection) == NULL)
57 if (netconfig_network_statistics_create_and_init(connection) == NULL)
60 /* If its environment uses Emulator, network configuration is set by emulator default */
61 netconfig_emulator_test_and_start();
63 g_main_loop_run(main_loop);
65 netconfig_wifi_state_notifier_cleanup();
66 netconfig_deregister_signal();