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 #ifndef _SKBUFF_H
27 #define _SKBUFF_H
28 #include <linux/malloc.h>
29
30 #ifdef CONFIG_IPX
31 #include "ipx.h"
32 #endif
33
34 #define HAVE_ALLOC_SKB
35
36
37 #define FREE_READ 1
38 #define FREE_WRITE 0
39
40
41 struct sk_buff {
42 unsigned long magic_debug_cookie;
43 struct sk_buff *volatile next;
44 struct sk_buff *volatile prev;
45 struct sk_buff *volatile link3;
46 struct sk_buff *volatile* list;
47 struct sock *sk;
48 volatile unsigned long when;
49 struct device *dev;
50 void *mem_addr;
51 union {
52 struct tcphdr *th;
53 struct ethhdr *eth;
54 struct iphdr *iph;
55 struct udphdr *uh;
56 struct arphdr *arp;
57 unsigned char *raw;
58 unsigned long seq;
59 #ifdef CONFIG_IPX
60 ipx_packet *ipx;
61 #endif
62 } h;
63 struct iphdr *ip_hdr;
64 unsigned long mem_len;
65 unsigned long len;
66 unsigned long fraglen;
67 struct sk_buff *fraglist;
68 unsigned long truesize;
69 unsigned long saddr;
70 unsigned long daddr;
71 int magic;
72 volatile char acked,
73 used,
74 free,
75 arp;
76 unsigned char tries,lock;
77 unsigned short users;
78 unsigned long padding[0];
79 unsigned char data[0];
80 };
81
82 #define SK_WMEM_MAX 8192
83 #define SK_RMEM_MAX 32767
84
85 #define SK_FREED_SKB 0x0DE2C0DE
86 #define SK_GOOD_SKB 0xDEC0DED1
87
88 extern void print_skb(struct sk_buff *);
89 extern void kfree_skb(struct sk_buff *skb, int rw);
90 extern void skb_queue_head(struct sk_buff * volatile *list,struct sk_buff *buf);
91 extern void skb_queue_tail(struct sk_buff * volatile *list,struct sk_buff *buf);
92 extern struct sk_buff * skb_dequeue(struct sk_buff * volatile *list);
93 extern void skb_insert(struct sk_buff *old,struct sk_buff *newsk);
94 extern void skb_append(struct sk_buff *old,struct sk_buff *newsk);
95 extern void skb_unlink(struct sk_buff *buf);
96 extern void skb_new_list_head(struct sk_buff *volatile* list);
97 extern struct sk_buff * skb_peek(struct sk_buff * volatile *list);
98 extern struct sk_buff * skb_peek_copy(struct sk_buff * volatile *list);
99 extern struct sk_buff * alloc_skb(unsigned int size, int priority);
100 extern void kfree_skbmem(void *mem, unsigned size);
101 extern void skb_kept_by_device(struct sk_buff *skb);
102 extern void skb_device_release(struct sk_buff *skb, int mode);
103 extern int skb_device_locked(struct sk_buff *skb);
104 extern void skb_check(struct sk_buff *skb,int, char *);
105 #define IS_SKB(skb) skb_check((skb),__LINE__,__FILE__)
106
107 extern struct sk_buff * skb_recv_datagram(struct sock *sk,unsigned flags,int noblock, int *err);
108 extern int datagram_select(struct sock *sk, int sel_type, select_table *wait);
109 extern void skb_copy_datagram(struct sk_buff *from, int offset, char *to,int size);
110 extern void skb_free_datagram(struct sk_buff *skb);
111 #endif