The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 1 | /**************************************************************************** |
| 2 | **************************************************************************** |
| 3 | *** |
| 4 | *** This header was automatically generated from a Linux kernel header |
| 5 | *** of the same name, to make information necessary for userspace to |
| 6 | *** call into the kernel available to libc. It contains only constants, |
| 7 | *** structures, and macros generated from the original header, and thus, |
| 8 | *** contains no copyrightable information. |
| 9 | *** |
| 10 | **************************************************************************** |
| 11 | ****************************************************************************/ |
| 12 | #ifndef _LINUX_SKBUFF_H |
| 13 | #define _LINUX_SKBUFF_H |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 14 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 15 | #include <linux/kernel.h> |
| 16 | #include <linux/compiler.h> |
| 17 | #include <linux/time.h> |
| 18 | #include <linux/cache.h> |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 19 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 20 | #include <asm/atomic.h> |
| 21 | #include <asm/types.h> |
| 22 | #include <linux/spinlock.h> |
| 23 | #include <linux/mm.h> |
| 24 | #include <linux/highmem.h> |
| 25 | #include <linux/poll.h> |
| 26 | #include <linux/net.h> |
| 27 | #include <linux/textsearch.h> |
| 28 | #include <net/checksum.h> |
| 29 | #include <linux/dmaengine.h> |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 30 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 31 | #define HAVE_ALLOC_SKB |
| 32 | #define HAVE_ALIGNABLE_SKB |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 33 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 34 | #define CHECKSUM_NONE 0 |
| 35 | #define CHECKSUM_HW 1 |
| 36 | #define CHECKSUM_UNNECESSARY 2 |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 37 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 38 | #define SKB_DATA_ALIGN(X) (((X) + (SMP_CACHE_BYTES - 1)) & ~(SMP_CACHE_BYTES - 1)) |
| 39 | #define SKB_MAX_ORDER(X, ORDER) (((PAGE_SIZE << (ORDER)) - (X) - sizeof(struct skb_shared_info)) & ~(SMP_CACHE_BYTES - 1)) |
| 40 | #define SKB_MAX_HEAD(X) (SKB_MAX_ORDER((X), 0)) |
| 41 | #define SKB_MAX_ALLOC (SKB_MAX_ORDER(0, 2)) |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 42 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 43 | struct net_device; |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 44 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 45 | struct sk_buff_head { |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 46 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 47 | struct sk_buff *next; |
| 48 | struct sk_buff *prev; |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 49 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 50 | __u32 qlen; |
| 51 | spinlock_t lock; |
| 52 | }; |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 53 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 54 | struct sk_buff; |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 55 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 56 | #define MAX_SKB_FRAGS (65536/PAGE_SIZE + 2) |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 57 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 58 | typedef struct skb_frag_struct skb_frag_t; |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 59 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 60 | struct skb_frag_struct { |
| 61 | struct page *page; |
| 62 | __u16 page_offset; |
| 63 | __u16 size; |
| 64 | }; |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 65 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 66 | struct skb_shared_info { |
| 67 | atomic_t dataref; |
| 68 | unsigned short nr_frags; |
| 69 | unsigned short gso_size; |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 70 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 71 | unsigned short gso_segs; |
| 72 | unsigned short gso_type; |
| 73 | unsigned int ip6_frag_id; |
| 74 | struct sk_buff *frag_list; |
| 75 | skb_frag_t frags[MAX_SKB_FRAGS]; |
| 76 | }; |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 77 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 78 | #define SKB_DATAREF_SHIFT 16 |
| 79 | #define SKB_DATAREF_MASK ((1 << SKB_DATAREF_SHIFT) - 1) |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 80 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 81 | struct skb_timeval { |
| 82 | u32 off_sec; |
| 83 | u32 off_usec; |
| 84 | }; |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 85 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 86 | enum { |
| 87 | SKB_FCLONE_UNAVAILABLE, |
| 88 | SKB_FCLONE_ORIG, |
| 89 | SKB_FCLONE_CLONE, |
| 90 | }; |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 91 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 92 | enum { |
| 93 | SKB_GSO_TCPV4 = 1 << 0, |
| 94 | SKB_GSO_UDP = 1 << 1, |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 95 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 96 | SKB_GSO_DODGY = 1 << 2, |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 97 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 98 | SKB_GSO_TCP_ECN = 1 << 3, |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 99 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 100 | SKB_GSO_TCPV6 = 1 << 4, |
| 101 | }; |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 102 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 103 | struct sk_buff { |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 104 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 105 | struct sk_buff *next; |
| 106 | struct sk_buff *prev; |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 107 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 108 | struct sock *sk; |
| 109 | struct skb_timeval tstamp; |
| 110 | struct net_device *dev; |
| 111 | struct net_device *input_dev; |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 112 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 113 | union { |
| 114 | struct tcphdr *th; |
| 115 | struct udphdr *uh; |
| 116 | struct icmphdr *icmph; |
| 117 | struct igmphdr *igmph; |
| 118 | struct iphdr *ipiph; |
| 119 | struct ipv6hdr *ipv6h; |
| 120 | unsigned char *raw; |
| 121 | } h; |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 122 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 123 | union { |
| 124 | struct iphdr *iph; |
| 125 | struct ipv6hdr *ipv6h; |
| 126 | struct arphdr *arph; |
| 127 | unsigned char *raw; |
| 128 | } nh; |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 129 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 130 | union { |
| 131 | unsigned char *raw; |
| 132 | } mac; |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 133 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 134 | struct dst_entry *dst; |
| 135 | struct sec_path *sp; |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 136 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 137 | char cb[48]; |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 138 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 139 | unsigned int len, |
| 140 | data_len, |
| 141 | mac_len, |
| 142 | csum; |
| 143 | __u32 priority; |
| 144 | __u8 local_df:1, |
| 145 | cloned:1, |
| 146 | ip_summed:2, |
| 147 | nohdr:1, |
| 148 | nfctinfo:3; |
| 149 | __u8 pkt_type:3, |
| 150 | fclone:2, |
| 151 | ipvs_property:1; |
| 152 | __be16 protocol; |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 153 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 154 | void (*destructor)(struct sk_buff *skb); |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 155 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 156 | unsigned int truesize; |
| 157 | atomic_t users; |
| 158 | unsigned char *head, |
| 159 | *data, |
| 160 | *tail, |
| 161 | *end; |
| 162 | }; |
Ben Cheng | 4b29af0 | 2012-03-07 16:14:53 -0800 | [diff] [blame] | 163 | |
The Android Open Source Project | 1dc9e47 | 2009-03-03 19:28:35 -0800 | [diff] [blame] | 164 | #endif |