Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3109f2e2 authored by Alexander Aring's avatar Alexander Aring Committed by Marcel Holtmann
Browse files

6lowpan: introduce lowpan_push_hc_data function



This patch introduce the lowpan_push_hc_data function to set data in
the iphc buffer.

It's a common case to set data and increase the buffer pointer. This
helper function can be used many times in header_compress function to
generate the iphc header.

Signed-off-by: default avatarAlexander Aring <alex.aring@gmail.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 78794903
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -298,6 +298,13 @@ static inline bool lowpan_fetch_skb(struct sk_buff *skb,
	return false;
}

static inline void lowpan_push_hc_data(u8 **hc_ptr, const void *data,
				       const size_t len)
{
	memcpy(*hc_ptr, data, len);
	*hc_ptr += len;
}

typedef int (*skb_delivery_cb)(struct sk_buff *skb, struct net_device *dev);

int lowpan_process_data(struct sk_buff *skb, struct net_device *dev,