From: Alexander Aring Date: Tue, 17 Dec 2013 13:21:21 +0000 (+0100) Subject: 6lowpan: introduce lowpan_push_hc_data function X-Git-Url: http://pileus.org/git/?a=commitdiff_plain;h=3109f2e28b0a3216e07d4933d28a8480c6520379;p=~andy%2Flinux 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: Alexander Aring Signed-off-by: Marcel Holtmann --- diff --git a/net/ieee802154/6lowpan.h b/net/ieee802154/6lowpan.h index 10909e58bb6..4981bf859e5 100644 --- a/net/ieee802154/6lowpan.h +++ b/net/ieee802154/6lowpan.h @@ -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,