network: Add network_new

This commit is contained in:
Denis Kenzior 2016-05-15 21:11:01 -05:00
parent 54e7cced8e
commit d1948c0233
2 changed files with 20 additions and 0 deletions

View File

@ -190,6 +190,22 @@ double network_rankmod(uint32_t type, const char *ssid)
return 0.0; return 0.0;
} }
struct network *network_create(struct netdev *device,
uint8_t *ssid, uint8_t ssid_len,
enum security security)
{
struct network *network;
network = l_new(struct network, 1);
network->netdev = device;
memcpy(network->ssid, ssid, ssid_len);
network->security = security;
network->bss_list = l_queue_new();
return network;
}
const char *network_get_ssid(struct network *network) const char *network_get_ssid(struct network *network)
{ {
return network->ssid; return network->ssid;

View File

@ -41,6 +41,10 @@ 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);
struct network *network_create(struct netdev *device,
uint8_t *ssid, uint8_t ssid_len,
enum security security);
bool __iwd_network_append_properties(const struct network *network, bool __iwd_network_append_properties(const struct network *network,
struct l_dbus_message_builder *builder); struct l_dbus_message_builder *builder);