3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-26 18:59:22 +01:00

wiphy: Move __iwd_network_append_properties

to network.c
This commit is contained in:
Denis Kenzior 2016-05-11 22:30:10 -05:00
parent 23fe106cc5
commit ae1dc10c0c
3 changed files with 21 additions and 16 deletions

View File

@ -30,9 +30,11 @@
#include "src/iwd.h" #include "src/iwd.h"
#include "src/common.h" #include "src/common.h"
#include "src/network.h"
#include "src/storage.h" #include "src/storage.h"
#include "src/scan.h" #include "src/scan.h"
#include "src/dbus.h"
#include "src/device.h"
#include "src/network.h"
struct network_info { struct network_info {
char ssid[33]; char ssid[33];
@ -208,6 +210,21 @@ enum security network_get_security(struct network *network)
return network->security; return network->security;
} }
bool __iwd_network_append_properties(const struct network *network,
struct l_dbus_message_builder *builder)
{
bool connected;
l_dbus_message_builder_enter_array(builder, "{sv}");
dbus_dict_append_string(builder, "Name", network->ssid);
connected = device_get_connected_network(network->netdev) == network;
dbus_dict_append_bool(builder, "Connected", connected);
l_dbus_message_builder_leave_array(builder);
return true;
}
void network_init() void network_init()
{ {
networks = l_queue_new(); networks = l_queue_new();

View File

@ -41,6 +41,9 @@ bool network_seen(uint32_t type, const char *ssid);
bool network_connected(uint32_t type, const char *ssid); bool network_connected(uint32_t type, const char *ssid);
double network_rankmod(uint32_t type, const char *ssid); double network_rankmod(uint32_t type, const char *ssid);
bool __iwd_network_append_properties(const struct network *network,
struct l_dbus_message_builder *builder);
const char *network_get_ssid(struct network *network); const char *network_get_ssid(struct network *network);
struct netdev *network_get_netdev(struct network *network); struct netdev *network_get_netdev(struct network *network);
const char *network_get_path(struct network *network); const char *network_get_path(struct network *network);

View File

@ -151,21 +151,6 @@ static const char *iwd_network_get_path(struct netdev *netdev,
return path; return path;
} }
static bool __iwd_network_append_properties(const struct network *network,
struct l_dbus_message_builder *builder)
{
bool connected;
l_dbus_message_builder_enter_array(builder, "{sv}");
dbus_dict_append_string(builder, "Name", network->ssid);
connected = network->netdev->connected_network == network;
dbus_dict_append_bool(builder, "Connected", connected);
l_dbus_message_builder_leave_array(builder);
return true;
}
static const char *device_state_to_string(enum device_state state) static const char *device_state_to_string(enum device_state state)
{ {
switch (state) { switch (state) {