summaryrefslogtreecommitdiffstats
path: root/9/platforms/android-19/arch-mips/usr/include/linux/skbuff.h
blob: 82140a62517e15ddeea193f37b9927ee19e29c9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
/****************************************************************************
 ****************************************************************************
 ***
 ***   This header was automatically generated from a Linux kernel header
 ***   of the same name, to make information necessary for userspace to
 ***   call into the kernel available to libc.  It contains only constants,
 ***   structures, and macros generated from the original header, and thus,
 ***   contains no copyrightable information.
 ***
 ****************************************************************************
 ****************************************************************************/
#ifndef _LINUX_SKBUFF_H
#define _LINUX_SKBUFF_H

#include <linux/kernel.h>
#include <linux/compiler.h>
#include <linux/time.h>
#include <linux/cache.h>

#include <asm/atomic.h>
#include <asm/types.h>
#include <linux/spinlock.h>
#include <linux/mm.h>
#include <linux/highmem.h>
#include <linux/poll.h>
#include <linux/net.h>
#include <linux/textsearch.h>
#include <net/checksum.h>
#include <linux/dmaengine.h>

#define HAVE_ALLOC_SKB  
#define HAVE_ALIGNABLE_SKB  

#define CHECKSUM_NONE 0
#define CHECKSUM_HW 1
#define CHECKSUM_UNNECESSARY 2

#define SKB_DATA_ALIGN(X) (((X) + (SMP_CACHE_BYTES - 1)) &   ~(SMP_CACHE_BYTES - 1))
#define SKB_MAX_ORDER(X, ORDER) (((PAGE_SIZE << (ORDER)) - (X) -   sizeof(struct skb_shared_info)) &   ~(SMP_CACHE_BYTES - 1))
#define SKB_MAX_HEAD(X) (SKB_MAX_ORDER((X), 0))
#define SKB_MAX_ALLOC (SKB_MAX_ORDER(0, 2))

struct net_device;

struct sk_buff_head {

 struct sk_buff *next;
 struct sk_buff *prev;

 __u32 qlen;
 spinlock_t lock;
};

struct sk_buff;

#define MAX_SKB_FRAGS (65536/PAGE_SIZE + 2)

typedef struct skb_frag_struct skb_frag_t;

struct skb_frag_struct {
 struct page *page;
 __u16 page_offset;
 __u16 size;
};

struct skb_shared_info {
 atomic_t dataref;
 unsigned short nr_frags;
 unsigned short gso_size;

 unsigned short gso_segs;
 unsigned short gso_type;
 unsigned int ip6_frag_id;
 struct sk_buff *frag_list;
 skb_frag_t frags[MAX_SKB_FRAGS];
};

#define SKB_DATAREF_SHIFT 16
#define SKB_DATAREF_MASK ((1 << SKB_DATAREF_SHIFT) - 1)

struct skb_timeval {
 u32 off_sec;
 u32 off_usec;
};

enum {
 SKB_FCLONE_UNAVAILABLE,
 SKB_FCLONE_ORIG,
 SKB_FCLONE_CLONE,
};

enum {
 SKB_GSO_TCPV4 = 1 << 0,
 SKB_GSO_UDP = 1 << 1,

 SKB_GSO_DODGY = 1 << 2,

 SKB_GSO_TCP_ECN = 1 << 3,

 SKB_GSO_TCPV6 = 1 << 4,
};

struct sk_buff {

 struct sk_buff *next;
 struct sk_buff *prev;

 struct sock *sk;
 struct skb_timeval tstamp;
 struct net_device *dev;
 struct net_device *input_dev;

 union {
 struct tcphdr *th;
 struct udphdr *uh;
 struct icmphdr *icmph;
 struct igmphdr *igmph;
 struct iphdr *ipiph;
 struct ipv6hdr *ipv6h;
 unsigned char *raw;
 } h;

 union {
 struct iphdr *iph;
 struct ipv6hdr *ipv6h;
 struct arphdr *arph;
 unsigned char *raw;
 } nh;

 union {
 unsigned char *raw;
 } mac;

 struct dst_entry *dst;
 struct sec_path *sp;

 char cb[48];

 unsigned int len,
 data_len,
 mac_len,
 csum;
 __u32 priority;
 __u8 local_df:1,
 cloned:1,
 ip_summed:2,
 nohdr:1,
 nfctinfo:3;
 __u8 pkt_type:3,
 fclone:2,
 ipvs_property:1;
 __be16 protocol;

 void (*destructor)(struct sk_buff *skb);

 unsigned int truesize;
 atomic_t users;
 unsigned char *head,
 *data,
 *tail,
 *end;
};

#endif