mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
Merge pull request #11048 from miri64/gnrc_netif_hdr/enh/in-params-const
gnrc_netif_hdr: make in parameters const
This commit is contained in:
commit
e804d784d5
@ -158,8 +158,9 @@ static inline uint8_t *gnrc_netif_hdr_get_src_addr(const gnrc_netif_hdr_t *hdr)
|
||||
* @param[in] addr new source address
|
||||
* @param[in] addr_len *addr* length
|
||||
*/
|
||||
static inline void gnrc_netif_hdr_set_src_addr(gnrc_netif_hdr_t *hdr, uint8_t *addr,
|
||||
uint8_t addr_len)
|
||||
static inline void gnrc_netif_hdr_set_src_addr(gnrc_netif_hdr_t *hdr,
|
||||
const uint8_t *addr,
|
||||
uint8_t addr_len)
|
||||
{
|
||||
if (addr_len != hdr->src_l2addr_len) {
|
||||
return;
|
||||
@ -189,8 +190,9 @@ static inline uint8_t *gnrc_netif_hdr_get_dst_addr(const gnrc_netif_hdr_t *hdr)
|
||||
* @param[in] addr new destination address
|
||||
* @param[in] addr_len *addr* length
|
||||
*/
|
||||
static inline void gnrc_netif_hdr_set_dst_addr(gnrc_netif_hdr_t *hdr, uint8_t *addr,
|
||||
uint8_t addr_len)
|
||||
static inline void gnrc_netif_hdr_set_dst_addr(gnrc_netif_hdr_t *hdr,
|
||||
const uint8_t *addr,
|
||||
uint8_t addr_len)
|
||||
{
|
||||
if (addr_len != hdr->dst_l2addr_len) {
|
||||
return;
|
||||
@ -272,7 +274,8 @@ static inline int gnrc_netif_hdr_ipv6_iid_from_dst(const gnrc_netif_t *netif,
|
||||
* @return The generic network layer header on success.
|
||||
* @return NULL on error.
|
||||
*/
|
||||
gnrc_pktsnip_t *gnrc_netif_hdr_build(uint8_t *src, uint8_t src_len, uint8_t *dst, uint8_t dst_len);
|
||||
gnrc_pktsnip_t *gnrc_netif_hdr_build(const uint8_t *src, uint8_t src_len,
|
||||
const uint8_t *dst, uint8_t dst_len);
|
||||
|
||||
/**
|
||||
* @brief Convenience function to get the corresponding interface struct for
|
||||
|
@ -15,7 +15,8 @@
|
||||
|
||||
#include "net/gnrc/netif/hdr.h"
|
||||
|
||||
gnrc_pktsnip_t *gnrc_netif_hdr_build(uint8_t *src, uint8_t src_len, uint8_t *dst, uint8_t dst_len)
|
||||
gnrc_pktsnip_t *gnrc_netif_hdr_build(const uint8_t *src, uint8_t src_len,
|
||||
const uint8_t *dst, uint8_t dst_len)
|
||||
{
|
||||
gnrc_pktsnip_t *pkt = gnrc_pktbuf_add(NULL, NULL,
|
||||
sizeof(gnrc_netif_hdr_t) + src_len + dst_len,
|
||||
|
Loading…
Reference in New Issue
Block a user