Commit fc51a106 authored by chris's avatar chris
Browse files

""

parent 40dc2c58
......@@ -43,154 +43,3 @@ nodepend:
rm -f depend
# DO NOT DELETE
iftop.o: /usr/include/pcap/pcap.h /usr/include/sys/types.h
iftop.o: /usr/include/features.h /usr/include/sys/cdefs.h
iftop.o: /usr/include/gnu/stubs.h /usr/include/bits/types.h
iftop.o: /usr/lib/gcc-lib/i386-redhat-linux/2.96/include/stddef.h
iftop.o: /usr/include/time.h /usr/include/sys/time.h /usr/include/bits/time.h
iftop.o: /usr/include/sys/select.h /usr/include/bits/select.h
iftop.o: /usr/include/bits/sigset.h /usr/include/pcap/net/bpf.h
iftop.o: /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h
iftop.o: /usr/include/wchar.h /usr/include/bits/wchar.h /usr/include/gconv.h
iftop.o: /usr/lib/gcc-lib/i386-redhat-linux/2.96/include/stdarg.h
iftop.o: /usr/include/bits/stdio_lim.h /usr/include/stdlib.h
iftop.o: /usr/include/sys/ioctl.h /usr/include/bits/ioctls.h
iftop.o: /usr/include/asm/ioctls.h /usr/include/asm/ioctl.h
iftop.o: /usr/include/bits/ioctl-types.h /usr/include/sys/ttydefaults.h
iftop.o: /usr/include/net/if.h /usr/include/net/ethernet.h
iftop.o: /usr/include/linux/if_ether.h /usr/include/netinet/ip.h
iftop.o: /usr/include/netinet/in.h /usr/include/stdint.h
iftop.o: /usr/include/bits/wordsize.h /usr/include/bits/socket.h
iftop.o: /usr/include/limits.h
iftop.o: /usr/lib/gcc-lib/i386-redhat-linux/2.96/include/limits.h
iftop.o: /usr/include/bits/sockaddr.h /usr/include/asm/socket.h
iftop.o: /usr/include/asm/sockios.h /usr/include/bits/in.h
iftop.o: /usr/include/endian.h /usr/include/bits/endian.h
iftop.o: /usr/include/bits/byteswap.h /usr/include/pthread.h
iftop.o: /usr/include/sched.h /usr/include/bits/sched.h /usr/include/signal.h
iftop.o: /usr/include/bits/pthreadtypes.h /usr/include/bits/initspin.h
iftop.o: /usr/include/bits/sigthread.h /usr/include/curses.h
iftop.o: /usr/include/ncurses/unctrl.h /usr/include/ncurses/curses.h
iftop.o: /usr/include/string.h /usr/include/unistd.h
iftop.o: /usr/include/bits/posix_opt.h /usr/include/bits/confname.h iftop.h
iftop.o: addr_hash.h /usr/include/sys/socket.h /usr/include/sys/uio.h
iftop.o: /usr/include/bits/uio.h /usr/include/arpa/inet.h hash.h resolver.h
iftop.o: ui.h
addr_hash.o: /usr/include/stdio.h /usr/include/features.h
addr_hash.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
addr_hash.o: /usr/lib/gcc-lib/i386-redhat-linux/2.96/include/stddef.h
addr_hash.o: /usr/include/bits/types.h /usr/include/libio.h
addr_hash.o: /usr/include/_G_config.h /usr/include/wchar.h
addr_hash.o: /usr/include/bits/wchar.h /usr/include/gconv.h
addr_hash.o: /usr/lib/gcc-lib/i386-redhat-linux/2.96/include/stdarg.h
addr_hash.o: /usr/include/bits/stdio_lim.h /usr/include/stdlib.h addr_hash.h
addr_hash.o: /usr/include/sys/socket.h /usr/include/sys/uio.h
addr_hash.o: /usr/include/sys/types.h /usr/include/time.h
addr_hash.o: /usr/include/bits/uio.h /usr/include/bits/socket.h
addr_hash.o: /usr/include/limits.h
addr_hash.o: /usr/lib/gcc-lib/i386-redhat-linux/2.96/include/limits.h
addr_hash.o: /usr/include/bits/sockaddr.h /usr/include/asm/socket.h
addr_hash.o: /usr/include/asm/sockios.h /usr/include/netinet/in.h
addr_hash.o: /usr/include/stdint.h /usr/include/bits/wordsize.h
addr_hash.o: /usr/include/bits/in.h /usr/include/endian.h
addr_hash.o: /usr/include/bits/endian.h /usr/include/bits/byteswap.h
addr_hash.o: /usr/include/arpa/inet.h hash.h iftop.h
hash.o: /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h
hash.o: /usr/include/gnu/stubs.h
hash.o: /usr/lib/gcc-lib/i386-redhat-linux/2.96/include/stddef.h
hash.o: /usr/include/bits/types.h /usr/include/libio.h
hash.o: /usr/include/_G_config.h /usr/include/wchar.h
hash.o: /usr/include/bits/wchar.h /usr/include/gconv.h
hash.o: /usr/lib/gcc-lib/i386-redhat-linux/2.96/include/stdarg.h
hash.o: /usr/include/bits/stdio_lim.h /usr/include/stdlib.h hash.h iftop.h
ns_hash.o: /usr/include/stdio.h /usr/include/features.h
ns_hash.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
ns_hash.o: /usr/lib/gcc-lib/i386-redhat-linux/2.96/include/stddef.h
ns_hash.o: /usr/include/bits/types.h /usr/include/libio.h
ns_hash.o: /usr/include/_G_config.h /usr/include/wchar.h
ns_hash.o: /usr/include/bits/wchar.h /usr/include/gconv.h
ns_hash.o: /usr/lib/gcc-lib/i386-redhat-linux/2.96/include/stdarg.h
ns_hash.o: /usr/include/bits/stdio_lim.h /usr/include/stdlib.h
ns_hash.o: /usr/include/sys/socket.h /usr/include/sys/uio.h
ns_hash.o: /usr/include/sys/types.h /usr/include/time.h
ns_hash.o: /usr/include/bits/uio.h /usr/include/bits/socket.h
ns_hash.o: /usr/include/limits.h
ns_hash.o: /usr/lib/gcc-lib/i386-redhat-linux/2.96/include/limits.h
ns_hash.o: /usr/include/bits/sockaddr.h /usr/include/asm/socket.h
ns_hash.o: /usr/include/asm/sockios.h /usr/include/netinet/in.h
ns_hash.o: /usr/include/stdint.h /usr/include/bits/wordsize.h
ns_hash.o: /usr/include/bits/in.h /usr/include/endian.h
ns_hash.o: /usr/include/bits/endian.h /usr/include/bits/byteswap.h
ns_hash.o: /usr/include/arpa/inet.h ns_hash.h hash.h iftop.h
resolver.o: /usr/include/netinet/in.h /usr/include/features.h
resolver.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
resolver.o: /usr/include/stdint.h /usr/include/bits/wchar.h
resolver.o: /usr/include/bits/wordsize.h /usr/include/bits/types.h
resolver.o: /usr/lib/gcc-lib/i386-redhat-linux/2.96/include/stddef.h
resolver.o: /usr/include/bits/socket.h /usr/include/limits.h
resolver.o: /usr/lib/gcc-lib/i386-redhat-linux/2.96/include/limits.h
resolver.o: /usr/include/sys/types.h /usr/include/time.h
resolver.o: /usr/include/bits/sockaddr.h /usr/include/asm/socket.h
resolver.o: /usr/include/asm/sockios.h /usr/include/bits/in.h
resolver.o: /usr/include/endian.h /usr/include/bits/endian.h
resolver.o: /usr/include/bits/byteswap.h /usr/include/sys/socket.h
resolver.o: /usr/include/sys/uio.h /usr/include/bits/uio.h
resolver.o: /usr/include/arpa/inet.h /usr/include/pthread.h
resolver.o: /usr/include/sched.h /usr/include/bits/sched.h
resolver.o: /usr/include/signal.h /usr/include/bits/sigset.h
resolver.o: /usr/include/bits/pthreadtypes.h /usr/include/bits/initspin.h
resolver.o: /usr/include/bits/sigthread.h /usr/include/stdio.h
resolver.o: /usr/include/libio.h /usr/include/_G_config.h
resolver.o: /usr/include/wchar.h /usr/include/gconv.h
resolver.o: /usr/lib/gcc-lib/i386-redhat-linux/2.96/include/stdarg.h
resolver.o: /usr/include/bits/stdio_lim.h /usr/include/stdlib.h
resolver.o: /usr/include/netdb.h /usr/include/bits/netdb.h
resolver.o: /usr/include/errno.h /usr/include/bits/errno.h
resolver.o: /usr/include/linux/errno.h /usr/include/asm/errno.h
resolver.o: /usr/include/string.h ns_hash.h hash.h iftop.h
ui.o: /usr/include/ctype.h /usr/include/features.h /usr/include/sys/cdefs.h
ui.o: /usr/include/gnu/stubs.h /usr/include/bits/types.h
ui.o: /usr/lib/gcc-lib/i386-redhat-linux/2.96/include/stddef.h
ui.o: /usr/include/endian.h /usr/include/bits/endian.h /usr/include/curses.h
ui.o: /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h
ui.o: /usr/include/wchar.h /usr/include/bits/wchar.h /usr/include/gconv.h
ui.o: /usr/lib/gcc-lib/i386-redhat-linux/2.96/include/stdarg.h
ui.o: /usr/include/bits/stdio_lim.h /usr/include/ncurses/unctrl.h
ui.o: /usr/include/ncurses/curses.h /usr/include/string.h /usr/include/math.h
ui.o: /usr/include/bits/huge_val.h /usr/include/bits/mathdef.h
ui.o: /usr/include/bits/mathcalls.h /usr/include/pthread.h
ui.o: /usr/include/sched.h /usr/include/time.h /usr/include/bits/sched.h
ui.o: /usr/include/signal.h /usr/include/bits/sigset.h
ui.o: /usr/include/bits/pthreadtypes.h /usr/include/bits/initspin.h
ui.o: /usr/include/bits/sigthread.h /usr/include/stdlib.h addr_hash.h
ui.o: /usr/include/sys/socket.h /usr/include/sys/uio.h
ui.o: /usr/include/sys/types.h /usr/include/bits/uio.h
ui.o: /usr/include/bits/socket.h /usr/include/limits.h
ui.o: /usr/lib/gcc-lib/i386-redhat-linux/2.96/include/limits.h
ui.o: /usr/include/bits/sockaddr.h /usr/include/asm/socket.h
ui.o: /usr/include/asm/sockios.h /usr/include/netinet/in.h
ui.o: /usr/include/stdint.h /usr/include/bits/wordsize.h
ui.o: /usr/include/bits/in.h /usr/include/bits/byteswap.h
ui.o: /usr/include/arpa/inet.h hash.h iftop.h resolver.h sorted_list.h
util.o: /usr/include/sys/types.h /usr/include/features.h
util.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
util.o: /usr/include/bits/types.h
util.o: /usr/lib/gcc-lib/i386-redhat-linux/2.96/include/stddef.h
util.o: /usr/include/time.h /usr/include/errno.h /usr/include/bits/errno.h
util.o: /usr/include/linux/errno.h /usr/include/asm/errno.h
util.o: /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h
util.o: /usr/include/wchar.h /usr/include/bits/wchar.h /usr/include/gconv.h
util.o: /usr/lib/gcc-lib/i386-redhat-linux/2.96/include/stdarg.h
util.o: /usr/include/bits/stdio_lim.h /usr/include/stdlib.h
util.o: /usr/include/string.h /usr/include/unistd.h
util.o: /usr/include/bits/posix_opt.h /usr/include/bits/confname.h iftop.h
sorted_list.o: /usr/include/stdlib.h /usr/include/features.h
sorted_list.o: /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h
sorted_list.o: /usr/lib/gcc-lib/i386-redhat-linux/2.96/include/stddef.h
sorted_list.o: /usr/include/stdio.h /usr/include/bits/types.h
sorted_list.o: /usr/include/libio.h /usr/include/_G_config.h
sorted_list.o: /usr/include/wchar.h /usr/include/bits/wchar.h
sorted_list.o: /usr/include/gconv.h
sorted_list.o: /usr/lib/gcc-lib/i386-redhat-linux/2.96/include/stdarg.h
sorted_list.o: /usr/include/bits/stdio_lim.h sorted_list.h iftop.h
......@@ -48,6 +48,10 @@ Print a summary of usage.
.B -d
Don't do hostname lookups. This setting may be altered at run time.
.B -p
Run in promiscuous mode, so that traffic which does not pass directly through
the specified interface is also counted.
.TP
\fB-i\fP \fIinterface\fP
Listen to packets on \fIinterface\fP.
......
......@@ -34,6 +34,8 @@ int history_pos = 0;
int history_len = 1;
pthread_mutex_t tick_mutex;
/* Open non-promiscuous by default since this is intended to be run on a
* router. */
int promiscuous = 0;
sig_atomic_t foad;
......@@ -187,7 +189,6 @@ void packet_loop(void* ptr) {
resolver_initialise();
/* Open non-promiscuous since this is intended to be run on a router. */
pd = pcap_open_live(interface, CAPTURE_LENGTH, promiscuous, 1000, errbuf);
if(pd == NULL) {
fprintf(stderr, "pcap_open_live(%s): %s\n", interface, errbuf);
......
......@@ -30,14 +30,13 @@ int tail;
void resolver_worker(void* ptr) {
struct timespec delay;
int thread_number = *(int*)ptr;
/* int thread_number = *(int*)ptr;*/
delay.tv_sec = 0;
delay.tv_nsec = 500;
pthread_mutex_lock(&resolver_queue_mutex);
while(1) {
/* Wait until we are told that an address has been added to the
* queue
*/
* queue. */
pthread_cond_wait(&resolver_queue_cond, &resolver_queue_mutex);
/* Keep resolving until the queue is empty */
......@@ -110,7 +109,7 @@ void resolver_initialise() {
pthread_cond_init(&resolver_queue_cond, NULL);
for(i = 0; i < 2; i++) {
n = (int*)xmalloc(sizeof n);
n = (int*)xmalloc(sizeof *n);
*n = i;
pthread_create(&thread, NULL, (void*)&resolver_worker, (void*)n);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment