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