DA: Skip initializing failed_bssids list when eapol failure case
[platform/upstream/connman.git] / client / tethering.c
1 /*
2  *
3  *  Connection Manager
4  *
5  *  Copyright (C) 2014  Intel Corporation. All rights reserved.
6  *  Copyright (C) 2018 GlobalLogic. All rights reserved.
7  *
8  *  This program is free software; you can redistribute it and/or modify
9  *  it under the terms of the GNU General Public License as published by
10  *  the Free Software Foundation; either version 2 of the License, or
11  *  (at your option) any later version.
12  *
13  *  This program is distributed in the hope that it will be useful,
14  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  *  GNU General Public License for more details.
17  *
18  *  You should have received a copy of the GNU General Public License
19  *  along with this program; if not, write to the Free Software
20  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
21  *
22  */
23
24 #include <stdio.h>
25
26 #include "tethering.h"
27
28 void __connmanctl_tethering_clients_list(DBusMessageIter *iter)
29 {
30         DBusMessageIter array;
31         char *addr = NULL;
32
33         if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_ARRAY)
34                 return;
35
36         dbus_message_iter_recurse(iter, &array);
37         while (dbus_message_iter_get_arg_type(&array) == DBUS_TYPE_STRING) {
38                 dbus_message_iter_get_basic(&array, &addr);
39
40                 fprintf(stdout, "%s", addr);
41
42                 if (dbus_message_iter_has_next(&array))
43                         fprintf(stdout, "\n");
44
45                 dbus_message_iter_next(&array);
46         }
47
48         dbus_message_iter_next(iter);
49         if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_ARRAY)
50                 return;
51
52         dbus_message_iter_recurse(iter, &array);
53         while (dbus_message_iter_get_arg_type(&array) == DBUS_TYPE_STRING) {
54                 dbus_message_iter_get_basic(&array, &addr);
55
56                 fprintf(stdout, "\n%s %s", "removed", addr);
57
58                 if (dbus_message_iter_has_next(&array))
59                         fprintf(stdout, "\n");
60
61                 dbus_message_iter_next(&array);
62         }
63 }