Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(210)

Side by Side Diff: src/main.c

Issue 6659006: flimflam: add support for multiple profiles (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/flimflam.git@master
Patch Set: rebase Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * 2 *
3 * Connection Manager 3 * Connection Manager
4 * 4 *
5 * Copyright (C) 2007-2009 Intel Corporation. All rights reserved. 5 * Copyright (C) 2007-2009 Intel Corporation. All rights reserved.
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as 8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation. 9 * published by the Free Software Foundation.
10 * 10 *
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 { 49 {
50 connman_error("D-Bus disconnect"); 50 connman_error("D-Bus disconnect");
51 51
52 g_main_loop_quit(main_loop); 52 g_main_loop_quit(main_loop);
53 } 53 }
54 54
55 static gchar **option_devices = NULL; 55 static gchar **option_devices = NULL;
56 static gchar **option_plugins = NULL; 56 static gchar **option_plugins = NULL;
57 static gchar **option_nodevices = NULL; 57 static gchar **option_nodevices = NULL;
58 static gchar **option_noplugins = NULL; 58 static gchar **option_noplugins = NULL;
59 static gchar **option_profiles = NULL;
59 static gchar *option_wifi = NULL; 60 static gchar *option_wifi = NULL;
60 static gchar *option_keymatter = NULL; 61 static gchar *option_keymatter = NULL;
61 static gchar *option_modemmanagers = NULL; 62 static gchar *option_modemmanagers = NULL;
62 static gchar *option_order = NULL; 63 static gchar *option_order = NULL;
63 static gboolean option_detach = TRUE; 64 static gboolean option_detach = TRUE;
64 static gboolean option_compat = FALSE; 65 static gboolean option_compat = FALSE;
65 static gboolean option_version = FALSE; 66 static gboolean option_version = FALSE;
66 67
67 static gboolean option_debug_callback(const gchar *option, 68 static gboolean option_debug_callback(const gchar *option,
68 const gchar *value, 69 const gchar *value,
(...skipping 18 matching lines...) Expand all
87 " (can be repeated)", 88 " (can be repeated)",
88 "DEV" }, 89 "DEV" },
89 { "plugin", 'p', 0, G_OPTION_ARG_STRING_ARRAY, &option_plugins, 90 { "plugin", 'p', 0, G_OPTION_ARG_STRING_ARRAY, &option_plugins,
90 "Specify plugins to load" 91 "Specify plugins to load"
91 " (can be repeated)", 92 " (can be repeated)",
92 "NAME" }, 93 "NAME" },
93 { "noplugin", 'P', 0, G_OPTION_ARG_STRING_ARRAY, &option_noplugins, 94 { "noplugin", 'P', 0, G_OPTION_ARG_STRING_ARRAY, &option_noplugins,
94 "Specify plugins not to load" 95 "Specify plugins not to load"
95 " (can be repeated)", 96 " (can be repeated)",
96 "NAME" }, 97 "NAME" },
98 { "push", 'u', 0, G_OPTION_ARG_STRING_ARRAY, &option_profiles,
99 "Specify profiles to push"
100 " (can be repeated)",
101 "NAME" },
97 { "keymatter", 'k', 0, G_OPTION_ARG_STRING, &option_keymatter, 102 { "keymatter", 'k', 0, G_OPTION_ARG_STRING, &option_keymatter,
98 "Specify file containing data to use when " 103 "Specify file containing data to use when "
99 "generating cryptographic keys.", "FILENAME" }, 104 "generating cryptographic keys.", "FILENAME" },
100 { "wifi", 'W', 0, G_OPTION_ARG_STRING, &option_wifi, 105 { "wifi", 'W', 0, G_OPTION_ARG_STRING, &option_wifi,
101 "Specify driver for WiFi/Supplicant", "NAME" }, 106 "Specify driver for WiFi/Supplicant", "NAME" },
102 { "modemmanagers", 'm', 0, G_OPTION_ARG_STRING, &option_modemmanagers, 107 { "modemmanagers", 'm', 0, G_OPTION_ARG_STRING, &option_modemmanagers,
103 "Comma separated list of DBUS modem manager " 108 "Comma separated list of DBUS modem manager "
104 "services", 109 "services",
105 "SERVICE_NAME:PATH,..." }, 110 "SERVICE_NAME:PATH,..." },
106 { "order", 'o', 0, G_OPTION_ARG_STRING, &option_order, 111 { "order", 'o', 0, G_OPTION_ARG_STRING, &option_order,
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 __connman_ipv4_init(); 262 __connman_ipv4_init();
258 __connman_ipv6_init(); 263 __connman_ipv6_init();
259 __connman_rtnl_init(); 264 __connman_rtnl_init();
260 __connman_udev_init(); 265 __connman_udev_init();
261 __connman_task_init(); 266 __connman_task_init();
262 267
263 __connman_plugin_init(option_plugins, option_noplugins); 268 __connman_plugin_init(option_plugins, option_noplugins);
264 269
265 __connman_element_start(); 270 __connman_element_start();
266 271
272 __connman_profile_push_batch(option_profiles);
273
267 g_strfreev(option_devices); 274 g_strfreev(option_devices);
268 g_strfreev(option_plugins); 275 g_strfreev(option_plugins);
269 g_strfreev(option_nodevices); 276 g_strfreev(option_nodevices);
270 g_strfreev(option_noplugins); 277 g_strfreev(option_noplugins);
278 g_strfreev(option_profiles);
271 279
272 memset(&sa, 0, sizeof(sa)); 280 memset(&sa, 0, sizeof(sa));
273 sa.sa_handler = sig_term; 281 sa.sa_handler = sig_term;
274 sigaction(SIGINT, &sa, NULL); 282 sigaction(SIGINT, &sa, NULL);
275 sigaction(SIGTERM, &sa, NULL); 283 sigaction(SIGTERM, &sa, NULL);
276 284
277 g_main_loop_run(main_loop); 285 g_main_loop_run(main_loop);
278 286
279 __connman_element_stop(); 287 __connman_element_stop();
280 288
(...skipping 18 matching lines...) Expand all
299 __connman_dbus_cleanup(); 307 __connman_dbus_cleanup();
300 308
301 __connman_log_cleanup(); 309 __connman_log_cleanup();
302 310
303 dbus_connection_unref(conn); 311 dbus_connection_unref(conn);
304 312
305 g_main_loop_unref(main_loop); 313 g_main_loop_unref(main_loop);
306 314
307 return 0; 315 return 0;
308 } 316 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698