Home | History | Annotate | Download | only in linux
      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
     14 
     15 #include <linux/kernel.h>
     16 #include <linux/compiler.h>
     17 #include <linux/time.h>
     18 #include <linux/cache.h>
     19 
     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>
     30 
     31 #define HAVE_ALLOC_SKB
     32 #define HAVE_ALIGNABLE_SKB
     33 
     34 #define CHECKSUM_NONE 0
     35 #define CHECKSUM_HW 1
     36 #define CHECKSUM_UNNECESSARY 2
     37 
     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))
     42 
     43 struct net_device;
     44 
     45 struct sk_buff_head {
     46 
     47  struct sk_buff *next;
     48  struct sk_buff *prev;
     49 
     50  __u32 qlen;
     51  spinlock_t lock;
     52 };
     53 
     54 struct sk_buff;
     55 
     56 #define MAX_SKB_FRAGS (65536/PAGE_SIZE + 2)
     57 
     58 typedef struct skb_frag_struct skb_frag_t;
     59 
     60 struct skb_frag_struct {
     61  struct page *page;
     62  __u16 page_offset;
     63  __u16 size;
     64 };
     65 
     66 struct skb_shared_info {
     67  atomic_t dataref;
     68  unsigned short nr_frags;
     69  unsigned short gso_size;
     70 
     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 };
     77 
     78 #define SKB_DATAREF_SHIFT 16
     79 #define SKB_DATAREF_MASK ((1 << SKB_DATAREF_SHIFT) - 1)
     80 
     81 struct skb_timeval {
     82  u32 off_sec;
     83  u32 off_usec;
     84 };
     85 
     86 enum {
     87  SKB_FCLONE_UNAVAILABLE,
     88  SKB_FCLONE_ORIG,
     89  SKB_FCLONE_CLONE,
     90 };
     91 
     92 enum {
     93  SKB_GSO_TCPV4 = 1 << 0,
     94  SKB_GSO_UDP = 1 << 1,
     95 
     96  SKB_GSO_DODGY = 1 << 2,
     97 
     98  SKB_GSO_TCP_ECN = 1 << 3,
     99 
    100  SKB_GSO_TCPV6 = 1 << 4,
    101 };
    102 
    103 struct sk_buff {
    104 
    105  struct sk_buff *next;
    106  struct sk_buff *prev;
    107 
    108  struct sock *sk;
    109  struct skb_timeval tstamp;
    110  struct net_device *dev;
    111  struct net_device *input_dev;
    112 
    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;
    122 
    123  union {
    124  struct iphdr *iph;
    125  struct ipv6hdr *ipv6h;
    126  struct arphdr *arph;
    127  unsigned char *raw;
    128  } nh;
    129 
    130  union {
    131  unsigned char *raw;
    132  } mac;
    133 
    134  struct dst_entry *dst;
    135  struct sec_path *sp;
    136 
    137  char cb[48];
    138 
    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;
    153 
    154  void (*destructor)(struct sk_buff *skb);
    155 
    156  unsigned int truesize;
    157  atomic_t users;
    158  unsigned char *head,
    159  *data,
    160  *tail,
    161  *end;
    162 };
    163 
    164 #endif
    165