Add compile mode which executes rump system calls. This is useful

when figuring out Where In The Kernel Is Carmen Sandiego's ioctl
for an ifconfig command line, since we can simply single-step into
the kernel.

Activated by "make RUMP_ACTION=1".  No changes to normal case.
This commit is contained in:
pooka 2009-05-26 16:03:24 +00:00
parent c50e4e4fff
commit 162ca8ac83
3 changed files with 28 additions and 3 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.41 2009/04/11 07:58:12 lukem Exp $
# $NetBSD: Makefile,v 1.42 2009/05/26 16:03:24 pooka Exp $
# @(#)Makefile 8.1 (Berkeley) 6/5/93
# when making a change to this file, please check if the change is
@ -22,4 +22,16 @@ SRCS+= af_inet6.c
COPTS.ifconfig.c+= -fno-loop-optimize
.endif
#
# Compile-time debug flag. If compiled with "make RUMP_ACTION=1",
# make rump system calls. This allows to single-step ioctl commands
# to figure out where ioctl's go in the kernel.
#
.ifdef RUMP_ACTION
CPPFLAGS+= -DRUMP_SYS_NETWORKING -DRUMP_SYS_IOCTL -DRUMP_ACTION
LDADD+= -lrumpnet_virtif -lrumpnet_netinet -lrumpnet_net -lrumpnet
LDADD+= -lrump -lrumpuser -lpthread
DBG= -g
.endif
.include <bsd.prog.mk>

View File

@ -11,4 +11,14 @@ int getifflags(prop_dictionary_t, prop_dictionary_t, unsigned short *);
const char *getifinfo(prop_dictionary_t, prop_dictionary_t, unsigned short *);
prop_dictionary_t prop_dictionary_augment(prop_dictionary_t, prop_dictionary_t);
/*
* XXX: this really doesn't belong in here, but env.h is conveniently
* included from all source modules *after* system headers, so it
* allows us to be lazy. See Makefile for more details.
*/
#ifdef RUMP_ACTION
#include <rump/rump.h>
#include <rump/rump_syscalls.h>
#endif /* RUMP_ACTION */
#endif /* _IFCONFIG_ENV_H */

View File

@ -1,4 +1,4 @@
/* $NetBSD: ifconfig.c,v 1.218 2009/04/21 22:46:39 dyoung Exp $ */
/* $NetBSD: ifconfig.c,v 1.219 2009/05/26 16:03:24 pooka Exp $ */
/*-
* Copyright (c) 1997, 1998, 2000 The NetBSD Foundation, Inc.
@ -63,7 +63,7 @@
#ifndef lint
__COPYRIGHT("@(#) Copyright (c) 1983, 1993\
The Regents of the University of California. All rights reserved.");
__RCSID("$NetBSD: ifconfig.c,v 1.218 2009/04/21 22:46:39 dyoung Exp $");
__RCSID("$NetBSD: ifconfig.c,v 1.219 2009/05/26 16:03:24 pooka Exp $");
#endif /* not lint */
#include <sys/param.h>
@ -540,6 +540,9 @@ main(int argc, char **argv)
prop_dictionary_t env, oenv;
const char *ifname;
#ifdef RUMP_ACTION
rump_init();
#endif
memset(match, 0, sizeof(match));
init_afs();