gnrc_netif_hdr: add setter for netif
This eases the refactoring to a pointer-based approach for network interfaces.
This commit is contained in:
parent
2261aa9115
commit
c3fe882cfe
@ -294,6 +294,19 @@ static inline gnrc_netif_t *gnrc_netif_hdr_get_netif(const gnrc_netif_hdr_t *hdr
|
|||||||
return gnrc_netif_get_by_pid(hdr->if_pid);
|
return gnrc_netif_get_by_pid(hdr->if_pid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Convenience function to set the interface of an interface header,
|
||||||
|
* given the network interface
|
||||||
|
*
|
||||||
|
* @param[out] hdr Header to set the interface for.
|
||||||
|
* @param[in] netif Network interface to set for @p hdr.
|
||||||
|
*/
|
||||||
|
static inline void gnrc_netif_hdr_set_netif(gnrc_netif_hdr_t *hdr,
|
||||||
|
const gnrc_netif_t *netif)
|
||||||
|
{
|
||||||
|
hdr->if_pid = (netif != NULL) ? netif->pid : KERNEL_PID_UNDEF;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Outputs a generic interface header to stdout.
|
* @brief Outputs a generic interface header to stdout.
|
||||||
*
|
*
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user