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

netdev: Add netdev attribute getters

This commit is contained in:
Denis Kenzior 2015-10-02 12:58:26 -05:00
parent 8a68ebd65b
commit 14e40f27e3
2 changed files with 13 additions and 0 deletions

View File

@ -49,5 +49,8 @@ bool netdev_watch_remove(uint32_t id);
void __netdev_watch_call_added(struct netdev *netdev);
void __netdev_watch_call_removed(struct netdev *netdev);
uint32_t netdev_get_ifindex(struct netdev *netdev);
const uint8_t *netdev_get_address(struct netdev *netdev);
bool netdev_init(void);
bool netdev_exit(void);

View File

@ -218,6 +218,16 @@ static const char *netdev_state_to_string(enum netdev_state state)
return "invalid";
}
uint32_t netdev_get_ifindex(struct netdev *netdev)
{
return netdev->index;
}
const uint8_t *netdev_get_address(struct netdev *netdev)
{
return netdev->addr;
}
static void netdev_enter_state(struct netdev *netdev, enum netdev_state state)
{
l_debug("Old State: %s, new state: %s",