Rev 3 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2 | pj | 1 | #ifndef __SKBUFF__ |
2 | #define __SKBUFF__ |
||
3 | |||
4 | #include <linux/compatib.h> |
||
80 | pj | 5 | #include "ll/sys/cdefs.h" |
2 | pj | 6 | |
80 | pj | 7 | __BEGIN_DECLS |
8 | |||
2 | pj | 9 | #define HAVE_ALLOC_SKB /* For the drivers to know */ |
10 | #define HAVE_ALIGNABLE_SKB /* Ditto 8) */ |
||
11 | |||
12 | |||
13 | #define FREE_READ 1 |
||
14 | #define FREE_WRITE 0 |
||
15 | |||
16 | #define CHECKSUM_NONE 0 |
||
17 | #define CHECKSUM_HW 1 |
||
18 | #define CHECKSUM_UNNECESSARY 2 |
||
19 | |||
20 | |||
21 | struct sk_buff_head |
||
22 | { |
||
23 | struct sk_buff * next; |
||
24 | struct sk_buff * prev; |
||
25 | __u32 qlen; /* Must be same length as a pointer |
||
26 | for using debugging */ |
||
27 | #if CONFIG_SKB_CHECK |
||
28 | int magic_debug_cookie; |
||
29 | #endif |
||
30 | }; |
||
31 | |||
32 | |||
33 | struct sk_buff |
||
34 | { |
||
35 | struct sk_buff * next; /* Next buffer in list */ |
||
36 | struct sk_buff * prev; /* Previous buffer in list */ |
||
37 | struct sk_buff_head * list; /* List we are on */ |
||
38 | #if CONFIG_SKB_CHECK |
||
39 | int magic_debug_cookie; |
||
40 | #endif |
||
41 | #if 0 |
||
42 | struct sk_buff *link3; /* Link for IP protocol level buffer chains */ |
||
43 | #endif |
||
44 | |||
45 | #if 0 |
||
46 | struct sock *sk; /* Socket we are owned by */ |
||
47 | #endif |
||
48 | struct device *dev; /* Device we arrived on/are leaving by */ |
||
49 | #ifdef NOTWORK |
||
50 | unsigned long when; /* used to compute rtt's */ |
||
51 | struct timeval stamp; /* Time we arrived */ |
||
52 | union |
||
53 | { |
||
54 | struct tcphdr *th; |
||
55 | struct ethhdr *eth; |
||
56 | struct iphdr *iph; |
||
57 | struct udphdr *uh; |
||
58 | unsigned char *raw; |
||
59 | /* for passing file handles in a unix domain socket */ |
||
60 | void *filp; |
||
61 | } h; |
||
62 | |||
63 | union |
||
64 | { |
||
65 | /* As yet incomplete physical layer views */ |
||
66 | unsigned char *raw; |
||
67 | struct ethhdr *ethernet; |
||
68 | } mac; |
||
69 | |||
70 | struct iphdr *ip_hdr; /* For IPPROTO_RAW */ |
||
71 | |||
72 | #endif /*NOTWORK*/ |
||
73 | |||
74 | |||
75 | unsigned long len; /* Length of actual data */ |
||
76 | #if 0 |
||
77 | unsigned long csum; /* Checksum */ |
||
78 | __u32 saddr; /* IP source address */ |
||
79 | __u32 daddr; /* IP target address */ |
||
80 | __u32 raddr; /* IP next hop address */ |
||
81 | __u32 seq; /* TCP sequence number */ |
||
82 | __u32 end_seq; /* seq [+ fin] [+ syn] + datalen */ |
||
83 | __u32 ack_seq; /* TCP ack sequence number */ |
||
84 | unsigned char proto_priv[16]; /* Protocol private data */ |
||
85 | #endif |
||
86 | volatile char acked, /* Are we acked ? */ |
||
87 | used, /* Are we in use ? */ |
||
88 | free, /* How to free this buffer */ |
||
89 | arp; /* Has IP/ARP resolution finished */ |
||
90 | #if 0 |
||
91 | unsigned char tries, /* Times tried */ |
||
92 | lock, /* Are we locked ? */ |
||
93 | localroute, /* Local routing asserted for this frame */ |
||
94 | pkt_type, /* Packet class */ |
||
95 | pkt_bridged, /* Tracker for bridging */ |
||
96 | #endif |
||
97 | unsigned char ip_summed; /* Driver fed us an IP checksum */ |
||
98 | #if 0 |
||
99 | #define PACKET_HOST 0 /* To us */ |
||
100 | #define PACKET_BROADCAST 1 /* To all */ |
||
101 | #define PACKET_MULTICAST 2 /* To group */ |
||
102 | #define PACKET_OTHERHOST 3 /* To someone else */ |
||
103 | unsigned short users; /* User count - see datagram.c,tcp.c */ |
||
104 | #endif |
||
105 | unsigned short protocol; /* Packet protocol from driver. */ |
||
106 | #if 0 |
||
107 | unsigned int truesize; /* Buffer size */ |
||
108 | |||
109 | |||
110 | |||
111 | atomic_t count; /* reference count */ |
||
112 | |||
113 | |||
114 | struct sk_buff *data_skb; /* Link to the actual data skb */ |
||
115 | #endif |
||
116 | unsigned char *head; /* Head of buffer */ |
||
117 | unsigned char *data; /* Data head pointer */ |
||
118 | unsigned char *tail; /* Tail pointer */ |
||
119 | #if 0 |
||
120 | unsigned char *end; /* End pointer */ |
||
121 | void (*destructor)(struct sk_buff *); /* Destruct function */ |
||
122 | __u16 redirport; /* Redirect port */ |
||
123 | #endif |
||
124 | }; |
||
125 | |||
126 | #define dev_kfree_skb(a) |
||
127 | #define alloc_skb(a,b) dev_alloc_skb(a) |
||
128 | /* #define skb_device_unlock(skb); */ |
||
129 | extern struct sk_buff * dev_alloc_skb(unsigned int size); |
||
130 | extern unsigned char * skb_put(struct sk_buff *skb, int len); |
||
131 | extern void skb_queue_head_init(struct sk_buff_head *list); |
||
132 | extern struct sk_buff * skb_clone(struct sk_buff *skb, int priority); |
||
133 | extern void skb_reserve(struct sk_buff *skb, int len); |
||
80 | pj | 134 | __END_DECLS |
2 | pj | 135 | #endif |