1 --- linux-2.6.7/net/sched/proxydict.c.orig 2004-07-06 22:03:48.000000000 +0200
2 +++ linux-2.6.7/net/sched/proxydict.c 2004-07-07 01:20:29.238093104 +0200
4 // Size of hash table given maximal number of connections:
5 #define hash_size_max_con(max_con) (2*(max_con))
7 -// The memory area we maintain:
8 +// The __proxydict_memory area we maintain:
14 // The entries in next not allocated is also in linked list where
15 // the first free index is free_first.
17 +} __proxydict_memory;
19 -#define Memory(m) ((memory*)m)
20 -#define Hash_table(m) ((int*)(((char*)m)+sizeof(memory)))
21 -#define Next(m) ((int*)(((char*)m)+sizeof(memory)+ \
22 - sizeof(int)*((memory*)m)->hash_size))
23 +#define Memory(m) ((__proxydict_memory*)m)
24 +#define Hash_table(m) ((int*)(((char*)m)+sizeof(__proxydict_memory)))
25 +#define Next(m) ((int*)(((char*)m)+sizeof(__proxydict_memory)+ \
26 + sizeof(int)*((__proxydict_memory*)m)->hash_size))
27 #define Info(m) ((ProxyRemapBlock*)(((char*)m)+ \
29 - sizeof(int)*((memory*)m)->hash_size+\
30 - sizeof(int)*((memory*)m)->max_con \
31 + sizeof(__proxydict_memory)+ \
32 + sizeof(int)*((__proxydict_memory*)m)->hash_size+\
33 + sizeof(int)*((__proxydict_memory*)m)->max_con \
36 int proxyGetMemSize(int max_con) {
37 - return sizeof(memory)+
38 + return sizeof(__proxydict_memory)+
39 sizeof(int)*hash_size_max_con(max_con)+
41 sizeof(ProxyRemapBlock)*max_con;
44 void proxyInitMem(void* data, int max_con) {
46 - memory* m=Memory(data);
47 + __proxydict_memory* m=Memory(data);
50 m->hash_size=hash_size_max_con(max_con);
54 ProxyRemapBlock* proxyLookup(void* data, unsigned ipaddr, unsigned short port, char proto) {
55 - memory* m=Memory(data);
56 + __proxydict_memory* m=Memory(data);
57 int* hash_table=Hash_table(m);
59 ProxyRemapBlock* info=Info(m);
63 int proxyConsumeBlock(void* data, ProxyRemapBlock* blk) {
64 - memory* m=Memory(data);
65 + __proxydict_memory* m=Memory(data);
66 int* hash_table=Hash_table(m);
68 ProxyRemapBlock* info=Info(m);