* nfswatch / pfopen
@ 1996-01-09 5:00 Kevin Maguire
1996-01-10 5:00 ` Jeffrey Mogul
1996-01-12 5:00 ` Eric Werme
0 siblings, 2 replies; 3+ messages in thread
From: Kevin Maguire @ 1996-01-09 5:00 UTC (permalink / raw)
Hi
I'm trying to compile nfswatch4.1 (I got the pointer from
http://www.digital.com/info/misc/pub-domain-osf1.txt.html )
Code compiles fine until the link, when it tries
cc -o nfswatch dlpi.o logfile.o netaddr.o nfswatch.o nit.o pfilt.o
pktfilter.o rpcfilter.o rpcutil.o screen.o snoop.o util.o xdr.o
parsenfsfh.o -lcurses -ltermcap -lm pfopen.c /usr/lib/cmplrs/cc/cfe:
Error: pfopen.c: 1: Cannot open file /usr/examples/packetfilter/pfopen.c
for #include
This pfopen.c file doesn't exist on my DUnix 3.0 system. Taking this C
file out of the link the code links without error.
(If someone tells which package on the CD this file lives in then I
can try again.)
There is a fpopen function in libc:
~/nfswatch4.1 [146] nm /usr/lib/libc.a | grep pfopen
3091:/usr/lib/libc.a[pfopen.o]:
3099:__pfopen | 0000000000000016 | T | 0000000000000008
3102:pfopen | 0000000000000016 | T | 0000000000000008
I've no idea if the pfopen in "/usr/examples/packetfilter/pfopen.c" is any
different from that compiled into libc.
But then running nfswatch -all gives an error:
# ./nfswatch -all
./nfswatch: (null): No such file or directory
#
(There is plenty of nfs activity that should be reported incidentally).
Compiling on an IRIX5 system went fine.
Any Suggestions ? Am I missing something obvious ?
Kev
Some dbx output follows:
# dbx nfswatch
dbx version 3.11.6
Type 'help' for help.
main: 256 char *device = NULL;
(dbx) list
257 extern void nfswatch();
258
259 pname = *argv;
260
261 /*
262 * Get our host name. The default destination
263 * host is the one we're running on.
264 */
265 if (gethostname(myhost, sizeof(myhost)) < 0) {
266 error("gethostname");
267 finish(-1);
268 }
(dbx) stop at 265
[2] stop at "nfswatch.c":265
(dbx) run
[2] stopped at [main:265 ,0x120005d0c] if (gethostname(myhost, sizeof(myhost)) < 0) {
(dbx) step
[main:270 ,0x120005d54] (void) strcpy(dsthost, myhost);
(dbx) step
[main:275 ,0x120005d6c] while (--argc) {
(dbx) step
[main:487 ,0x1200064a0] switch (showwhich) {
(dbx) step
[main:489 ,0x1200064b8] showwhich = SHOWFILESYSTEM;
(dbx) step
[main:490 ,0x1200064c4] break;
(dbx) step
[main:503 ,0x120006514] (void) signal(SIGINT, finish);
(dbx) step
[main:504 ,0x12000652c] (void) signal(SIGQUIT, finish);
(dbx) step
[main:505 ,0x120006544] (void) signal(SIGTERM, finish);
(dbx) step
[main:581 ,0x12000655c] if (allintf) {
(dbx) step
[main:593 ,0x120006648] if_fd[0] = setup_pfilt_dev(&device);
(dbx) step
[setup_pfilt_dev:69 ,0x1200071a0] {
(dbx) step
[setup_pfilt_dev:73 ,0x1200071b4] short backlog = -1; /* request the most */
(dbx) step
[setup_pfilt_dev:80 ,0x1200071bc] if ((fd = pfopen(*device, 0)) < 0) {
(dbx) step
[setup_pfilt_dev:81 ,0x1200071e4] return(-1);
(dbx) step
[main:595 ,0x120006664] if (if_fd[0] < 0) {
(dbx) step
[main:596 ,0x120006670] error(device);
(dbx) step
[error:228 ,0x12000cd80] {
(dbx) step
[error:231 ,0x12000cd98] (void) sprintf(buf, "%s: %s", pname, str);
(dbx) step
[error:232 ,0x12000cdc0] (void) perror(buf);
(dbx) step
nfswatch: (null): No such file or directory
[error:233 ,0x12000cdd4] }
(dbx) where
> 0 error(str = (nil)) ["util.c":233, 0x12000cdd4]
1 main(argc = 0, argv = 0x11ffff9c8) ["nfswatch.c":596, 0x120006678]
(dbx) step
[main:597 ,0x120006684] finish(-1);
(dbx) step
[finish:241 ,0x12000cdf0] {
(dbx) step
[finish:247 ,0x12000ce04] for (i = 0; i < ninterfaces; i++) {
(dbx) step
[finish:255 ,0x12000ce6c] if (screen_inited) {
(dbx) step
[finish:269 ,0x12000cf00] if (logging) {
(dbx) step
[finish:274 ,0x12000cf44] (void) putchar('\n');
(dbx) step
[finish:276 ,0x12000cfac] if (code < 0)
(dbx) step
[finish:277 ,0x12000cfb4] (void) exit(-code);
(dbx) step
Program terminated by Trace/BPT trap
(dbx) step
program is not active
(dbx) quit
--
___________________________
_ / Kevin Maguire \ _
/ )| Higher Scientific Officer |( \
/ / | Daresbury Laboratory | \ \
_( (_ | K.Maguire@dl.ac.uk | _) )_
(((\ \> \/->____<-=-=-=-=->_____<-\/ </ /)))
(\\\\ \_/ / \ \_/ ////)
\ / \ /
\ _/ \_ /
/ / \ \
/___/ \___\
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: nfswatch / pfopen
1996-01-09 5:00 nfswatch / pfopen Kevin Maguire
@ 1996-01-10 5:00 ` Jeffrey Mogul
1996-01-12 5:00 ` Eric Werme
1 sibling, 0 replies; 3+ messages in thread
From: Jeffrey Mogul @ 1996-01-10 5:00 UTC (permalink / raw)
(1) If your version of Digital UNIX does not have pfopen.c in
/usr/examples, it's probably because the same module is now
in the standard C library. This has been true for several
versions by now.
(2) Recent versions of Digital UNIX (and DEC OSF/1) have included
a precompiled version of nfswatch in one of the subsets, so there
should be no need to compile it yourself.
(3) Remember to rebuild your kernel to include the packet filter,
and to create the necessary entries in /dev. See "man
packetfilter" for details.
-Jeff
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: nfswatch / pfopen
1996-01-09 5:00 nfswatch / pfopen Kevin Maguire
1996-01-10 5:00 ` Jeffrey Mogul
@ 1996-01-12 5:00 ` Eric Werme
1 sibling, 0 replies; 3+ messages in thread
From: Eric Werme @ 1996-01-12 5:00 UTC (permalink / raw)
kcm@tca1.dl.ac.uk (Kevin Maguire) writes:
># ./nfswatch -all
>./nfswatch: (null): No such file or directory
>#
Meguesses that you may not have the packet filter special devices. (And/or
you don't have the packetfilter option set in the kernel.) What do tcpdump
and pfconfig report?
Here are a couple hints:
1) Installing packet filter support
tcpdump relies on a kernel option that ordinarily isn't enabled. You can fix
this either by adding "options PACKETFILTER" to the system's configuration
file and rebuilding (via doconfig -c <FILE>) or by:
# doconfig
*** KERNEL CONFIGURATION AND BUILD PROCEDURE ***
Enter a name for the kernel configuration file. [ALINGO]: FILTER
You want to name the configuration file 'FILTER'
Is that correct? (y/n) [y]: y
*** KERNEL OPTION SELECTION ***
Selection Kernel Option
---------------------------------------------------------------
1 System V Devices
2 Logical Volume Manager (LVM)
3 Kernel Breakpoint Debugger (KDEBUG)
4 Packetfilter driver (PACKETFILTER)
5 STREAMS pckt module (PCKT)
6 Data Link Bridge (DLPI V2.0 Service Class 1)
7 X/Open Transport Interface (XTISO, TIMOD, TIRDWR)
8 File on File File System (FFM)
9 ISO 9660 Compact Disc File System (CDFS)
10 Audit Subsystem
11 Local Area Transport Support
12 All of the above
13 None of the above
---------------------------------------------------------------
Enter the selection number for each kernel option you want.
For example, 1 3 : 4
You selected the following kernel options:
Packetfilter driver (PACKETFILTER)
Is that correct? (y/n) [y]:
...
Rebuild and boot the new kernel.
2) Create the packetfilter devices:
# cd /dev
# ./MAKEDEV pfilt
MAKEDEV: special file(s) for pfilt:
pfilt0 pfilt1 pfilt2 pfilt3 pfilt4 pfilt5 pfilt6 ... pfilt63
3) Enable local copy promiscuous mode
# pfconfig +p +c ln0 (or tu0 or whatever)
At this point tcpdump should work, as will /usr/sbin/nfswatch (essentially
nfswatch 4.1, I think with a few changes to file handle handling).
--
Eric (Ric) Werme | werme@zk3.dec.com
Digital Equipment Corp. | This space intentionally left blank.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~1996-01-12 5:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1996-01-09 5:00 nfswatch / pfopen Kevin Maguire
1996-01-10 5:00 ` Jeffrey Mogul
1996-01-12 5:00 ` Eric Werme
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox