Subject: bin/13404: Add support for "state top" feature of "ipfstat".
To: None <gnats-bugs@gnats.netbsd.org>
From: Frederick Bruckman <fredb@immanent.net>
List: netbsd-bugs
Date: 07/07/2001 15:29:03
>Number:         13404
>Category:       bin
>Synopsis:       Native curses can support "state top" feature of "ipfstat".
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sat Jul 07 13:27:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Frederick Bruckman
>Release:        NetBSD 1.5.1
>Organization:

Frederick
>Environment:
	
System: NetBSD tautology.immanent.net 1.5.1 NetBSD 1.5.1 (TAUTOLOGY) #1:
Tue Jul 3 15:41:22 CDT 2001
fredb@tautology.immanent.net: /usr/src/sys/arch/i386/compile/TAUTOLOGY i386


>Description:
	
	Native curses in NetBSD 1.5.1 can now evidently support the nifty
	"state top" feature of "ipfstat".
>How-To-Repeat:
	
	Wonder what your firewall is up to, and realize that "ipfstat -ios"
	provides too much information, in an unattractive format. Apply patch
	(below), build and install ipfstat, run "ipfstat -t", enjoy!
>Fix:
Index: dist/ipf/fils.c
===================================================================
RCS file: /cvsroot/basesrc/dist/ipf/fils.c,v
retrieving revision 1.9.4.1
diff -c -r1.9.4.1 fils.c
*** dist/ipf/fils.c	2000/08/31 14:49:46	1.9.4.1
--- dist/ipf/fils.c	2001/07/07 20:09:21
***************
*** 28,35 ****
  #include <stddef.h>
  #include <nlist.h>
  #ifdef STATETOP
! #include <ctype.h>
! #include <ncurses.h>
  #endif
  #include <sys/socket.h>
  #include <sys/ioctl.h>
--- 28,39 ----
  #include <stddef.h>
  #include <nlist.h>
  #ifdef STATETOP
! # include <ctype.h>
! # ifdef __NetBSD__
! #  include <curses.h>
! # else
! #  include <ncurses.h>
! # endif
  #endif
  #include <sys/socket.h>
  #include <sys/ioctl.h>
Index: usr.sbin/ipf/ipfstat/Makefile
===================================================================
RCS file: /cvsroot/basesrc/usr.sbin/ipf/ipfstat/Makefile,v
retrieving revision 1.13
diff -c -r1.13 Makefile
*** usr.sbin/ipf/ipfstat/Makefile	2000/05/03 11:40:55	1.13
--- usr.sbin/ipf/ipfstat/Makefile	2001/07/07 20:09:21
***************
*** 4,7 ****
--- 4,12 ----
  SRCS=	fils.c parse.c kmem.c opt.c facpri.c common.c
  MAN=	ipfstat.8
  
+ CPPFLAGS+= -DSTATETOP
+ 
+ LDADD+=	-lcurses
+ DPADD+=	${LIBCURSES}
+ 
  .include <bsd.prog.mk>
>Release-Note:
>Audit-Trail:
>Unformatted: