aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/skbuff.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/skbuff.h')
-rw-r--r--include/linux/skbuff.h36
1 files changed, 25 insertions, 11 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 93e4db221585..57d7d4965f9a 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -14,7 +14,6 @@
14#ifndef _LINUX_SKBUFF_H 14#ifndef _LINUX_SKBUFF_H
15#define _LINUX_SKBUFF_H 15#define _LINUX_SKBUFF_H
16 16
17#include <linux/config.h>
18#include <linux/kernel.h> 17#include <linux/kernel.h>
19#include <linux/compiler.h> 18#include <linux/compiler.h>
20#include <linux/time.h> 19#include <linux/time.h>
@@ -135,9 +134,10 @@ struct skb_frag_struct {
135struct skb_shared_info { 134struct skb_shared_info {
136 atomic_t dataref; 135 atomic_t dataref;
137 unsigned short nr_frags; 136 unsigned short nr_frags;
138 unsigned short tso_size; 137 unsigned short gso_size;
139 unsigned short tso_segs; 138 /* Warning: this field is not always filled in (UFO)! */
140 unsigned short ufo_size; 139 unsigned short gso_segs;
140 unsigned short gso_type;
141 unsigned int ip6_frag_id; 141 unsigned int ip6_frag_id;
142 struct sk_buff *frag_list; 142 struct sk_buff *frag_list;
143 skb_frag_t frags[MAX_SKB_FRAGS]; 143 skb_frag_t frags[MAX_SKB_FRAGS];
@@ -169,6 +169,19 @@ enum {
169 SKB_FCLONE_CLONE, 169 SKB_FCLONE_CLONE,
170}; 170};
171 171
172enum {
173 SKB_GSO_TCPV4 = 1 << 0,
174 SKB_GSO_UDP = 1 << 1,
175
176 /* This indicates the skb is from an untrusted source. */
177 SKB_GSO_DODGY = 1 << 2,
178
179 /* This indicates the tcp segment has CWR set. */
180 SKB_GSO_TCP_ECN = 1 << 3,
181
182 SKB_GSO_TCPV6 = 1 << 4,
183};
184
172/** 185/**
173 * struct sk_buff - socket buffer 186 * struct sk_buff - socket buffer
174 * @next: Next buffer in list 187 * @next: Next buffer in list
@@ -210,6 +223,8 @@ enum {
210 * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c 223 * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c
211 * @tc_index: Traffic control index 224 * @tc_index: Traffic control index
212 * @tc_verd: traffic control verdict 225 * @tc_verd: traffic control verdict
226 * @dma_cookie: a cookie to one of several possible DMA operations
227 * done by skb DMA functions
213 * @secmark: security marking 228 * @secmark: security marking
214 */ 229 */
215 230
@@ -346,7 +361,7 @@ extern struct sk_buff *skb_realloc_headroom(struct sk_buff *skb,
346extern struct sk_buff *skb_copy_expand(const struct sk_buff *skb, 361extern struct sk_buff *skb_copy_expand(const struct sk_buff *skb,
347 int newheadroom, int newtailroom, 362 int newheadroom, int newtailroom,
348 gfp_t priority); 363 gfp_t priority);
349extern struct sk_buff * skb_pad(struct sk_buff *skb, int pad); 364extern int skb_pad(struct sk_buff *skb, int pad);
350#define dev_kfree_skb(a) kfree_skb(a) 365#define dev_kfree_skb(a) kfree_skb(a)
351extern void skb_over_panic(struct sk_buff *skb, int len, 366extern void skb_over_panic(struct sk_buff *skb, int len,
352 void *here); 367 void *here);
@@ -1123,16 +1138,15 @@ static inline int skb_cow(struct sk_buff *skb, unsigned int headroom)
1123 * 1138 *
1124 * Pads up a buffer to ensure the trailing bytes exist and are 1139 * Pads up a buffer to ensure the trailing bytes exist and are
1125 * blanked. If the buffer already contains sufficient data it 1140 * blanked. If the buffer already contains sufficient data it
1126 * is untouched. Returns the buffer, which may be a replacement 1141 * is untouched. Otherwise it is extended. Returns zero on
1127 * for the original, or NULL for out of memory - in which case 1142 * success. The skb is freed on error.
1128 * the original buffer is still freed.
1129 */ 1143 */
1130 1144
1131static inline struct sk_buff *skb_padto(struct sk_buff *skb, unsigned int len) 1145static inline int skb_padto(struct sk_buff *skb, unsigned int len)
1132{ 1146{
1133 unsigned int size = skb->len; 1147 unsigned int size = skb->len;
1134 if (likely(size >= len)) 1148 if (likely(size >= len))
1135 return skb; 1149 return 0;
1136 return skb_pad(skb, len-size); 1150 return skb_pad(skb, len-size);
1137} 1151}
1138 1152
@@ -1292,7 +1306,7 @@ extern void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to);
1292extern void skb_split(struct sk_buff *skb, 1306extern void skb_split(struct sk_buff *skb,
1293 struct sk_buff *skb1, const u32 len); 1307 struct sk_buff *skb1, const u32 len);
1294 1308
1295extern void skb_release_data(struct sk_buff *skb); 1309extern struct sk_buff *skb_segment(struct sk_buff *skb, int features);
1296 1310
1297static inline void *skb_header_pointer(const struct sk_buff *skb, int offset, 1311static inline void *skb_header_pointer(const struct sk_buff *skb, int offset,
1298 int len, void *buffer) 1312 int len, void *buffer)