1 --- click-1.6.0-27/lib/ino.cc.orig 2007-09-11 15:39:22.000000000 -0400
2 +++ click-1.6.0-27/lib/ino.cc 2009-01-20 22:34:50.000000000 -0500
20 --- click-1.6.0-27/include/clicknet/ip.h.orig 2007-07-16 19:47:50.000000000 -0400
21 +++ click-1.6.0-27/include/clicknet/ip.h 2009-01-19 16:01:43.000000000 -0500
23 #include <click/cxxprotect.h>
26 +#include <linux/autoconf.h>
27 # include <net/checksum.h>
28 # include <linux/in.h>
30 --- click-1.6.0-27/include/click/packet.hh.orig 2007-09-07 16:11:26.000000000 -0400
31 +++ click-1.6.0-27/include/click/packet.hh 2009-01-27 10:13:43.000000000 -0500
33 Packet::mac_header() const
36 - return skb()->mac.raw;
37 + return skb_mac_header(skb());
42 Packet::network_header() const
45 - return skb()->nh.raw;
46 + return skb_network_header(skb());
51 Packet::transport_header() const
54 - return skb()->h.raw;
55 + return skb_transport_header(skb());
60 # if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 13)
61 memcpy(&skb()->stamp, ×tamp, 8);
63 - skb_set_timestamp(skb(), ×tamp.timeval());
64 + memcpy(&skb()->tstamp, ×tamp, 8);
67 _timestamp = timestamp;
69 Packet::set_mac_header(const unsigned char *h)
71 #if CLICK_LINUXMODULE /* Linux kernel module */
72 - skb()->mac.raw = const_cast<unsigned char *>(h);
73 + skb()->mac_header = const_cast<unsigned char *>(h);
74 #else /* User-space and BSD kernel module */
75 _mac = const_cast<unsigned char *>(h);
78 Packet::set_mac_header(const unsigned char *h, uint32_t len)
80 #if CLICK_LINUXMODULE /* Linux kernel module */
81 - skb()->mac.raw = const_cast<unsigned char *>(h);
82 - skb()->nh.raw = const_cast<unsigned char *>(h) + len;
83 + skb()->mac_header = const_cast<unsigned char *>(h);
84 + skb()->network_header = const_cast<unsigned char *>(h) + len;
85 #else /* User-space and BSD kernel module */
86 _mac = const_cast<unsigned char *>(h);
87 _nh = const_cast<unsigned char *>(h) + len;
89 Packet::set_network_header(const unsigned char *h, uint32_t len)
91 #if CLICK_LINUXMODULE /* Linux kernel module */
92 - skb()->nh.raw = const_cast<unsigned char *>(h);
93 - skb()->h.raw = const_cast<unsigned char *>(h) + len;
94 + skb()->network_header = const_cast<unsigned char *>(h);
95 + skb()->transport_header = const_cast<unsigned char *>(h) + len;
96 #else /* User-space and BSD kernel module */
97 _nh = const_cast<unsigned char *>(h);
98 _h = const_cast<unsigned char *>(h) + len;
100 Packet::set_network_header_length(uint32_t len)
102 #if CLICK_LINUXMODULE /* Linux kernel module */
103 - skb()->h.raw = skb()->nh.raw + len;
104 + skb()->transport_header = skb()->network_header + len;
105 #else /* User-space and BSD kernel module */
108 @@ -1076,9 +1076,9 @@
109 _h += (_h ? shift : 0);
111 struct sk_buff *mskb = skb();
112 - mskb->mac.raw += (mskb->mac.raw ? shift : 0);
113 - mskb->nh.raw += (mskb->nh.raw ? shift : 0);
114 - mskb->h.raw += (mskb->h.raw ? shift : 0);
115 + mskb->mac_header += (mskb->mac_header ? shift : 0);
116 + mskb->network_header += (mskb->network_header ? shift : 0);
117 + mskb->transport_header += (mskb->transport_header ? shift : 0);
121 --- click-1.6.0-27/include/click/config-linuxmodule.h.orig 2009-01-19 15:07:24.000000000 -0500
122 +++ click-1.6.0-27/include/click/config-linuxmodule.h 2009-01-28 16:05:44.000000000 -0500
124 #define HAVE_FAST_CHECKSUM 1
126 /* Define if 'int64_t' is typedefed to 'long' in linuxmodule. */
127 -#define HAVE_INT64_IS_LONG_LINUXMODULE 1
128 +/* #undef HAVE_INT64_IS_LONG_LINUXMODULE */
130 /* Define if 'int64_t' is typedefed to 'long long' in linuxmodule. */
131 #define HAVE_INT64_IS_LONG_LONG_LINUXMODULE 1
135 /* Include integer type definitions. */
136 -#if !HAVE_LINUXMODULE_2_6
137 # include <linux/autoconf.h>
139 #include <linux/types.h>
140 typedef ptrdiff_t intptr_t;
141 -typedef unsigned long uintptr_t; /* XXX? */
142 +//typedef unsigned long uintptr_t; /* XXX? */
144 /* Define HAVE_INT64_IS_LONG based on HAVE_INT64_IS_LONG_LINUXMODULE. */
145 #ifdef HAVE_INT64_IS_LONG_LINUXMODULE
146 --- click-1.6.0-27/linuxmodule/Makefile.orig 2009-01-19 15:15:55.000000000 -0500
147 +++ click-1.6.0-27/linuxmodule/Makefile 2009-01-28 16:15:43.000000000 -0500
149 subdir := linuxmodule
150 conf_auxdir = $(top_srcdir)
153 -exec_prefix = ${prefix}
154 -bindir = /usr/local/bin
155 -sbindir = /usr/local/sbin
156 -libdir = /usr/local/lib
157 -linuxdir = /d/kernels/linux-2.6.27.10-click
158 +prefix = /d/click/click-1.6.0-27/inst
159 +exec_prefix = /d/click/click-1.6.0-27/inst
160 +bindir = /d/click/click-1.6.0-27/inst/bin
161 +sbindir = /d/click/click-1.6.0-27/inst/sbin
162 +libdir = /d/click/click-1.6.0-27/inst/lib
163 +linuxdir = /d/kernels/linux-2.6.27.10-clickport
165 LIB_CXX_OBJS = string.o straccum.o nameinfo.o \
166 bitvector.o vectorv.o templatei.o bighashmap_arena.o \
168 ##########################################################################
171 -KERNELPATH = /d/kernels/linux-2.6.27.10-click
172 +KERNELPATH = /d/kernels/linux-2.6.27.10-clickport
174 ifeq ($(KBUILD_EXTMOD),)
178 CLICKDEFS = -DHAVE_CONFIG_H
179 CLICKINCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include \
180 - -I$(srcdir) -I$(top_srcdir) -I$(linuxdir)/include
181 + -I$(srcdir) -I$(top_srcdir) -I$(linuxdir)/include -I$(linuxdir)/include/asm/mach-default
183 CXXCOMPILE = $(CLICKCXX) $(LINUXCFLAGS) $(CLICKCPPFLAGS) $(CLICKCFLAGS) \
184 $(CLICKCXXFLAGS) $(CLICKDEFS) $(CLICKINCLUDES) $(CLICKDEPCFLAGS)
185 --- click-1.6.0-27/linuxmodule/sched.cc.orig 2007-08-28 19:01:58.000000000 -0400
186 +++ click-1.6.0-27/linuxmodule/sched.cc 2009-01-26 16:55:57.000000000 -0500
188 click_thread_priority = priority;
189 if (click_thread_pids)
190 for (int i = 0; i < click_thread_pids->size(); i++) {
191 - struct task_struct *task = find_task_by_pid((*click_thread_pids)[i]);
192 + struct task_struct *task = find_task_by_vpid((*click_thread_pids)[i]);
194 TASK_PRIO(task) = priority;
197 SOFT_SPIN_LOCK(&click_thread_lock);
198 for (int i = 0; i < click_thread_pids->size(); i++) {
199 printk("<1>click: router thread pid %d\n", (*click_thread_pids)[i]);
200 - struct task_struct *ct = find_task_by_pid((*click_thread_pids)[i]);
201 + struct task_struct *ct = find_task_by_vpid((*click_thread_pids)[i]);
203 printk("<1>click: state %d, EIP %08x\n", (int) ct->state, KSTK_EIP(ct));
205 --- click-1.6.0-27/linuxmodule/proclikefs.c.orig 2007-07-16 19:47:50.000000000 -0400
206 +++ click-1.6.0-27/linuxmodule/proclikefs.c 2009-01-26 17:17:09.000000000 -0500
208 #undef CLICK_LINUXMODULE
209 #include <linux/version.h>
210 #include <linux/autoconf.h>
211 +#include <linux/list.h>
212 #ifndef EXPORT_SYMTAB
213 # define EXPORT_SYMTAB
219 -static LIST_HEAD(fs_list);
220 +static struct list_head fs_list;
221 static spinlock_t fslist_lock;
222 extern spinlock_t inode_lock;
223 extern spinlock_t sb_lock;
225 fo->unlocked_ioctl = (void *) return_EIO;
226 fo->compat_ioctl = (void *) return_EIO;
227 fo->aio_fsync = (void *) return_EIO;
228 - fo->sendfile = (void *) return_EIO;
229 + //fo->sendfile = (void *) return_EIO;
230 fo->check_flags = (void *) return_EIO;
231 fo->flock = (void *) return_EIO;
233 @@ -533,10 +534,12 @@
237 - proclikefs_null_super_operations.read_inode = proclikefs_read_inode;
238 + //proclikefs_null_super_operations.read_inode = proclikefs_read_inode;
239 proclikefs_null_super_operations.put_super = proclikefs_put_super;
240 proclikefs_null_root_inode_operations.lookup = proclikefs_null_root_lookup;
241 spin_lock_init(&fslist_lock);
242 + INIT_LIST_HEAD(&fs_list);
243 + printk (KERN_CRIT "Initializing module\n");
247 --- click-1.6.0-27/linuxmodule/Makefile.in.orig 2007-09-12 18:26:17.000000000 -0400
248 +++ click-1.6.0-27/linuxmodule/Makefile.in 2009-01-27 12:21:27.000000000 -0500
252 CLICKINCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include \
253 - -I$(srcdir) -I$(top_srcdir) -I$(linuxdir)/include
254 + -I$(srcdir) -I$(top_srcdir) -I$(linuxdir)/include -I$(linuxdir)/include/asm/mach-default
256 CXXCOMPILE = $(CLICKCXX) $(LINUXCFLAGS) $(CLICKCPPFLAGS) $(CLICKCFLAGS) \
257 $(CLICKCXXFLAGS) $(CLICKDEFS) $(CLICKINCLUDES) $(CLICKDEPCFLAGS)
258 --- click-1.6.0-27/elements/linuxmodule/tohost.cc.orig 2007-08-31 11:21:55.000000000 -0400
259 +++ click-1.6.0-27/elements/linuxmodule/tohost.cc 2009-01-26 16:52:00.000000000 -0500
262 // do not call eth_type_trans; it changes pkt_type! Instead, do its work
264 - skb->mac.raw = skb->data;
265 + skb->mac_header = skb->data;
268 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
269 --- click-1.6.0-27/elements/linuxmodule/fromdevice.cc.orig 2007-08-29 04:01:48.000000000 -0400
270 +++ click-1.6.0-27/elements/linuxmodule/fromdevice.cc 2009-01-26 14:38:07.000000000 -0500
272 assert(skb_shared(skb) == 0); /* else skb = skb_clone(skb, GFP_ATOMIC); */
274 /* Retrieve the MAC header. */
275 - skb_push(skb, skb->data - skb->mac.raw);
276 + skb_push(skb, skb->data - skb_mac_header(skb));
278 Packet *p = Packet::make(skb);
279 _queue[_tail] = p; /* hand it to run_task */
280 --- click-1.6.0-27/elements/linuxmodule/fromhost.cc.orig 2007-07-16 19:47:50.000000000 -0400
281 +++ click-1.6.0-27/elements/linuxmodule/fromhost.cc 2009-01-26 15:16:05.000000000 -0500
285 // check for existing device
286 - _dev = dev_get_by_name(_devname.c_str());
287 + _dev = dev_get_by_name(&init_net, _devname.c_str());
289 if (_dev->open != fl_open) {
291 @@ -175,16 +175,16 @@
293 ifr.ifr_hwaddr.sa_family = _dev->type;
294 memcpy(ifr.ifr_hwaddr.sa_data, _macaddr.data(), 6);
295 - if ((res = dev_ioctl(SIOCSIFHWADDR, &ifr)) < 0)
296 + if ((res = dev_ioctl(&init_net, SIOCSIFHWADDR, &ifr)) < 0)
297 errh->error("error %d setting hardware address for device '%s'", res, _devname.c_str());
299 sin->sin_family = AF_INET;
300 sin->sin_addr = _destaddr;
301 - if (res >= 0 && (res = devinet_ioctl(SIOCSIFADDR, &ifr)) < 0)
302 + if (res >= 0 && (res = devinet_ioctl(&init_net,SIOCSIFADDR, &ifr)) < 0)
303 errh->error("error %d setting address for device '%s'", res, _devname.c_str());
305 sin->sin_addr = _destmask;
306 - if (res >= 0 && (res = devinet_ioctl(SIOCSIFNETMASK, &ifr)) < 0)
307 + if (res >= 0 && (res = devinet_ioctl(&init_net,SIOCSIFNETMASK, &ifr)) < 0)
308 errh->error("error %d setting netmask for device '%s'", res, _devname.c_str());
312 mm_segment_t oldfs = get_fs();
315 - (void) dev_ioctl(SIOCGIFFLAGS, &ifr);
316 + (void) dev_ioctl(&init_net, SIOCGIFFLAGS, &ifr);
317 ifr.ifr_flags = (up > 0 ? ifr.ifr_flags | flags : ifr.ifr_flags & ~flags);
318 - if ((res = dev_ioctl(SIOCSIFFLAGS, &ifr)) < 0 && errh)
319 + if ((res = dev_ioctl(&init_net, SIOCSIFFLAGS, &ifr)) < 0 && errh)
320 errh->error("error %d bringing %s device '%s'", res, (up > 0 ? "up" : "down"), dev->name);
323 --- click-1.6.0-27/elements/linuxmodule/anydevice.cc.orig 2007-08-29 04:03:55.000000000 -0400
324 +++ click-1.6.0-27/elements/linuxmodule/anydevice.cc 2009-01-21 14:44:39.000000000 -0500
327 AnyDevice::find_device(AnyDeviceMap *adm, ErrorHandler *errh)
329 - _dev = dev_get_by_name(_devname.c_str());
330 + _dev = dev_get_by_name(&init_net,_devname.c_str());
331 _devname_exists = (bool) _dev;
333 _dev = dev_get_by_ether_address(_devname, this);
336 read_lock(&dev_base_lock);
338 - for (dev = dev_base; dev; dev = dev->next)
339 + for_each_netdev(&init_net, dev)//for (dev = dev_base; dev; dev = dev->next)
340 if ((dev->type == ARPHRD_ETHER || dev->type == ARPHRD_80211)
341 && memcmp(en, dev->dev_addr, 6) == 0) {
342 dev_hold(dev); // dev_get_by_name does dev_hold; so
343 --- click-1.6.0-27/elements/linuxmodule/todevice.cc.orig 2007-09-14 12:19:28.000000000 -0400
344 +++ click-1.6.0-27/elements/linuxmodule/todevice.cc 2009-01-26 16:50:39.000000000 -0500
349 +#include <linux/autoconf.h>
350 +#include <linux/version.h>
351 #include <click/config.h>
352 #include <click/glue.hh>
353 #include "polldevice.hh"
354 @@ -243,12 +245,12 @@
358 - if (!spin_trylock(&_dev->xmit_lock)) {
359 + if (!spin_trylock(&_dev->_tx[0]._xmit_lock)) {
361 _task.fast_reschedule();
364 - _dev->xmit_lock_owner = smp_processor_id();
365 + _dev->_tx[0].xmit_lock_owner = smp_processor_id();
370 // (or until Linux sends another packet) unless we poke
371 // net_bh(), which calls qdisc_restart(). We are not allowed
372 // to call qdisc_restart() ourselves, outside of net_bh().
373 - if (is_polling && !busy && _dev->qdisc->q.qlen) {
374 + if (is_polling && !busy && _dev->_tx[0].qdisc->q.qlen) {
376 netif_wake_queue(_dev);
379 # if HAVE_NETIF_TX_LOCK
380 netif_tx_unlock_bh(_dev);
382 - _dev->xmit_lock_owner = -1;
383 - spin_unlock(&_dev->xmit_lock);
384 + _dev->_tx[0].xmit_lock_owner = -1;
385 + spin_unlock(&_dev->_tx[0]._xmit_lock);
389 --- click-1.6.0-27/elements/standard/addressinfo.cc.orig 2007-09-12 02:14:04.000000000 -0400
390 +++ click-1.6.0-27/elements/standard/addressinfo.cc 2009-01-21 13:08:40.000000000 -0500
392 // if it's a device name, return a primary IP address
393 #if CLICK_LINUXMODULE
394 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 0)
395 - net_device *dev = dev_get_by_name(s.c_str());
396 + net_device *dev = dev_get_by_name(&init_net,s.c_str());
399 in_device *in_dev = in_dev_get(dev);
401 # if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 0)
402 # define dev_put(dev) /* nada */
404 - net_device *dev = dev_get_by_name(s.c_str());
405 + net_device *dev = dev_get_by_name(&init_net,s.c_str());
406 if (dev && (dev->type == ARPHRD_ETHER || dev->type == ARPHRD_80211)) {
407 memcpy(store, dev->dev_addr, 6);
409 --- click-1.6.0-27/config-linuxmodule.h.in.orig 2007-09-18 16:24:46.000000000 -0400
410 +++ click-1.6.0-27/config-linuxmodule.h.in 2009-01-28 16:06:28.000000000 -0500
414 /* Include integer type definitions. */
415 -#if !HAVE_LINUXMODULE_2_6
416 # include <linux/autoconf.h>
418 #include <linux/types.h>
419 typedef ptrdiff_t intptr_t;
420 -typedef unsigned long uintptr_t; /* XXX? */
421 +//typedef unsigned long uintptr_t; /* XXX? */
423 /* Define HAVE_INT64_IS_LONG based on HAVE_INT64_IS_LONG_LINUXMODULE. */
424 #ifdef HAVE_INT64_IS_LONG_LINUXMODULE
425 --- click-1.6.0-27/configure.in.orig 2007-09-18 16:40:01.000000000 -0400
426 +++ click-1.6.0-27/configure.in 2009-01-27 12:14:10.000000000 -0500
430 AC_INIT(click, 1.6.0)
433 AC_CONFIG_HEADER(include/click/config.h:config.h.in include/click/pathvars.h:pathvars.h.in include/click/config-bsdmodule.h:config-bsdmodule.h.in include/click/config-linuxmodule.h:config-linuxmodule.h.in include/click/config-ns.h:config-ns.h.in include/click/config-userlevel.h:config-userlevel.h.in)
438 saveflags="$CPPFLAGS"
439 - CPPFLAGS="$saveflags -D__KERNEL__ -I$linuxdir/include $LINUX_CFLAGS"
441 + CPPFLAGS="$saveflags -D__KERNEL__ -I$linuxdir/include -I$linuxdir/include/asm/mach-default $LINUX_CFLAGS"
443 # CLICK_LINUXMODULE_PROLOGUE()
444 AC_DEFUN([CLICK_LINUXMODULE_PROLOGUE], [[#if HAVE_LINUXMODULE_2_6