diff options
| author | Alexander Aring <alex.aring@gmail.com> | 2013-12-17 08:21:21 -0500 |
|---|---|---|
| committer | Marcel Holtmann <marcel@holtmann.org> | 2013-12-17 09:16:47 -0500 |
| commit | 3109f2e28b0a3216e07d4933d28a8480c6520379 (patch) | |
| tree | c65c1fa607ed599a3922a1f820ede8270ad86fe8 | |
| parent | 787949039fcd87b58aabeb494d031912209086ae (diff) | |
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 <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| -rw-r--r-- | net/ieee802154/6lowpan.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/net/ieee802154/6lowpan.h b/net/ieee802154/6lowpan.h index 10909e58bb69..4981bf859e5b 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, | |||
| 298 | return false; | 298 | return false; |
| 299 | } | 299 | } |
| 300 | 300 | ||
| 301 | static inline void lowpan_push_hc_data(u8 **hc_ptr, const void *data, | ||
| 302 | const size_t len) | ||
| 303 | { | ||
| 304 | memcpy(*hc_ptr, data, len); | ||
| 305 | *hc_ptr += len; | ||
| 306 | } | ||
| 307 | |||
| 301 | typedef int (*skb_delivery_cb)(struct sk_buff *skb, struct net_device *dev); | 308 | typedef int (*skb_delivery_cb)(struct sk_buff *skb, struct net_device *dev); |
| 302 | 309 | ||
| 303 | int lowpan_process_data(struct sk_buff *skb, struct net_device *dev, | 310 | int lowpan_process_data(struct sk_buff *skb, struct net_device *dev, |
