1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-27 15:31:17 +01:00

gnrc_netif: provide PID-based version for netif ID

This commit is contained in:
Martine Lenders 2020-03-28 11:56:48 +01:00 committed by Martine S. Lenders
parent b8294f1ba0
commit 652276f00f
No known key found for this signature in database
GPG Key ID: CCD317364F63286F

View File

@ -34,6 +34,17 @@ int netif_get_name(netif_t *iface, char *name)
return res;
}
int16_t netif_get_id(const netif_t *netif)
{
const gnrc_netif_t *iface = (const gnrc_netif_t*)netif;
return iface->pid;
}
netif_t *netif_get_by_id(int16_t id)
{
return &gnrc_netif_get_by_pid((kernel_pid_t)id)->netif;
}
int netif_get_opt(netif_t *netif, netopt_t opt, uint16_t context,
void *value, size_t max_len)
{