Hi all,

This is my very first attempt at updating any kind of open source code,
so apologies in advance. I struggled to get my head around how to patch
against the source tree properly. 

I am not sure how to roll up all of the changes into one patch file so I
hope someone can do this part (and I would like to know what you do to
make it into 1 file).

Instructions:

This patch updates iftop from 0.7 to 1.0pre1

1. In the directory - "feeds/packages/net/iftop/" Makefile.diff is the
changes to the Makefile
2. In the directory - "feeds/packages/net/iftop/patches" Delete all
patches and add the following patch files to 
    001-libpcap.patch
    002-debian_frozen_order.patch
    003-counter-hash.patch

Tested on a DIR-825 with trunk r26056 and working great!

Thanks,

Glenn.


--- Makefile	2011-03-12 16:10:31.096442048 +1100
+++ Makefile2	2011-03-12 16:11:39.585014262 +1100
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=iftop
-PKG_VERSION:=0.17
-PKG_RELEASE:=2
+PKG_VERSION:=1.0pre1
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.ex-parrot.com/~pdw/iftop/download
-PKG_MD5SUM:=062bc8fb3856580319857326e0b8752d
+PKG_MD5SUM:=99f5c7a8ec242eeba98d57af3df69d6e
 
 include $(INCLUDE_DIR)/package.mk
 
--- a/iftop.c
+++ b/iftop.c

@@ -19,7 +19,7 @@
 #include <sys/ioctl.h>
 #include <sys/socket.h>
 #include <net/if.h>
-#include <net/bpf.h>
+#include <pcap-bpf.h>
 
 #include <pthread.h>
 #include <curses.h>

--- a/ui.c
+++ b/ui.c
@@ -467,6 +467,7 @@
     while(hash_next_item(screen_hash, &n) == HASH_STATUS_OK) {
         host_pair_line* hpl = (host_pair_line*)n->rec;
         hpl->total_recv = hpl->total_sent = 0;
+	hpl->total_recv = hpl->total_sent = 0;
         memset(hpl->recv, 0, sizeof(hpl->recv));
         memset(hpl->sent, 0, sizeof(hpl->sent));
     }

+++ a/counter_hash.h

@@ -0,0 +1,23 @@
+/*
+ * addr_hash.h:
+ *
+ */
+
+#ifndef __ADDR_HASH_H_ /* include guard */
+#define __ADDR_HASH_H_
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include "hash.h"
+
+typedef struct {
+  unsigned long long sent;
+  unsigned long long recv;
+} counter_type;
+
+typedef counter_type key_type;      /* index into hash table */
+
+hash_type* counter_hash_create(void);
+
+#endif /* __ADDR_HASH_H_ */

_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to