aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuis R. Rodriguez <mcgrof@winlab.rutgers.edu>2008-03-02 21:03:39 -0500
committerLuis R. Rodriguez <mcgrof@winlab.rutgers.edu>2008-03-02 21:03:39 -0500
commit1ec932d3e0b58145d6b93b236fc058e4512149f2 (patch)
tree4af6672fb128e43409a60d63a53e578147e9ef20
parent4c9e9ab453c8dd4c085abf6bda5b93b1d360d54b (diff)
downloadcompat-wireless-2.6-old-1ec932d3e0b58145d6b93b236fc058e4512149f2.tar.gz
In skb_network_header() make variable const, port ip_hdr(),
skb_copy_from_linear_data() and skb_copy_from_linear_data_offset(). Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Luis R. Rodriguez <mcgrof@winlab.rutgers.edu>
-rw-r--r--compat/compat.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/compat/compat.h b/compat/compat.h
index 5100963..ec966de 100644
--- a/compat/compat.h
+++ b/compat/compat.h
@@ -82,7 +82,7 @@ static inline unsigned char *skb_transport_header(struct sk_buff *skb)
return skb->h.raw;
}
-static inline unsigned char *skb_network_header(struct sk_buff *skb)
+static inline unsigned char *skb_network_header(const struct sk_buff *skb)
{
return skb->nh.raw;
}
@@ -92,6 +92,25 @@ static inline unsigned char *skb_tail_pointer(const struct sk_buff *skb)
return skb->tail;
}
+static inline struct iphdr *ip_hdr(const struct sk_buff *skb)
+{
+ return (struct iphdr *)skb_network_header(skb);
+}
+
+static inline void skb_copy_from_linear_data(const struct sk_buff *skb,
+ void *to,
+ const unsigned int len)
+{
+ memcpy(to, skb->data, len);
+}
+
+static inline void skb_copy_from_linear_data_offset(const struct sk_buff *skb,
+ const int offset, void *to,
+ const unsigned int len)
+{
+ memcpy(to, skb->data + offset, len);
+}
+
#define __maybe_unused __attribute__((unused))
#define uninitialized_var(x) x = x