From owner-svn-src-projects@FreeBSD.ORG Wed Sep 15 17:25:09 2010 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D6C861065673; Wed, 15 Sep 2010 17:25:09 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C76768FC13; Wed, 15 Sep 2010 17:25:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o8FHP9Vc044181; Wed, 15 Sep 2010 17:25:09 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o8FHP98r044177; Wed, 15 Sep 2010 17:25:09 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201009151725.o8FHP98r044177@svn.freebsd.org> From: Attilio Rao Date: Wed, 15 Sep 2010 17:25:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r212677 - in projects/sv/sys: conf netinet X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2010 17:25:09 -0000 Author: attilio Date: Wed Sep 15 17:25:09 2010 New Revision: 212677 URL: http://svn.freebsd.org/changeset/base/212677 Log: Add the compiling options NETDUMP_CLIENT and NETDUMP_CLIENT_DEBUG and make them accessible via the opt_netdump.h header (NETDUMP_CLIENT also might be accessible because some devices may be willing to know if the option is in place). NETDUMP_CLIENT_DEBUG may be set to an higher value than 1 in order to get more diagnostic on netdump client itself. While here, fix a bug about a new sysctl node not correctly defined. Modified: projects/sv/sys/conf/files projects/sv/sys/conf/options projects/sv/sys/netinet/netdump_client.c Modified: projects/sv/sys/conf/files ============================================================================== --- projects/sv/sys/conf/files Wed Sep 15 17:11:15 2010 (r212676) +++ projects/sv/sys/conf/files Wed Sep 15 17:25:09 2010 (r212677) @@ -2577,7 +2577,7 @@ netinet/ip_ipsec.c optional inet ipsec netinet/ip_mroute.c optional mrouting inet | mrouting inet6 netinet/ip_options.c optional inet netinet/ip_output.c optional inet -netinet/netdump_client.c optional inet +netinet/netdump_client.c optional inet netdump_client netinet/raw_ip.c optional inet netinet/sctp_asconf.c optional inet sctp netinet/sctp_auth.c optional inet sctp Modified: projects/sv/sys/conf/options ============================================================================== --- projects/sv/sys/conf/options Wed Sep 15 17:11:15 2010 (r212676) +++ projects/sv/sys/conf/options Wed Sep 15 17:25:09 2010 (r212677) @@ -281,6 +281,10 @@ NFS_ROOT opt_nfsroot.h # SMB/CIFS requester NETSMB opt_netsmb.h +# Netdump client kernel support +NETDUMP_CLIENT opt_netdump.h +NETDUMP_CLIENT_DEBUG opt_netdump.h + # Options used only in subr_param.c. HZ opt_param.h MAXFILES opt_param.h Modified: projects/sv/sys/netinet/netdump_client.c ============================================================================== --- projects/sv/sys/netinet/netdump_client.c Wed Sep 15 17:11:15 2010 (r212676) +++ projects/sv/sys/netinet/netdump_client.c Wed Sep 15 17:25:09 2010 (r212677) @@ -34,9 +34,7 @@ #include "opt_ddb.h" #include "opt_device_polling.h" -#if 0 #include "opt_netdump.h" -#endif #include #include @@ -90,10 +88,10 @@ #error "Netdump kernel support cannot be compiled with VIMAGE option" #endif -#ifdef NETDUMP_DEBUG +#ifdef NETDUMP_CLIENT_DEBUG #define NETDDEBUG(f, ...) printf((f), ## __VA_ARGS__) #define NETDDEBUG_IF(i, f, ...) if_printf((i), (f), ## __VA_ARGS__) -#if NETDUMP_DEBUG > 1 +#if NETDUMP_CLIENT_DEBUG > 1 #define NETDDEBUGV(f, ...) printf((f), ## __VA_ARGS__) #define NETDDEBUGV_IF(i, f, ...) if_printf((i), (f), ## __VA_ARGS__) #else @@ -127,7 +125,7 @@ static int netdump_send_arp(void); static void netdump_trigger(void *arg, int howto); static int netdump_udp_output(struct mbuf *m); -#ifdef NETDUMP_DEBUG +#ifdef NETDUMP_CLIENT_DEBUG static int sysctl_force_crash(SYSCTL_HANDLER_ARGS); #endif static int sysctl_ip(SYSCTL_HANDLER_ARGS); @@ -273,7 +271,7 @@ sysctl_nic(SYSCTL_HANDLER_ARGS) return error; } -#ifdef NETDUMP_DEBUG +#ifdef NETDUMP_CLIENT_DEBUG static int sysctl_force_crash(SYSCTL_HANDLER_ARGS) { @@ -330,8 +328,8 @@ SYSCTL_INT(_net_dump, OID_AUTO, retries, SYSCTL_INT(_net_dump, OID_AUTO, enable, CTLTYPE_INT|CTLFLAG_RW, &nd_enable, 0, "enable network dump"); TUNABLE_INT("net.dump.enable", &nd_enable); -#ifdef NETDUMP_DEBUG -SYSCTL_DECL(_debug_netdump); +#ifdef NETDUMP_CLIENT_DEBUG +SYSCTL_NODE(_debug, OID_AUTO, netdump, CTLFLAG_RW, NULL, "Netdump debugging"); SYSCTL_PROC(_debug_netdump, OID_AUTO, crash, CTLTYPE_INT|CTLFLAG_RW, 0, sizeof(int), sysctl_force_crash, "I", "force crashing"); #endif @@ -1316,7 +1314,7 @@ netdump_modevent(module_t mod, int type, netdump_config_defaults(); -#ifdef NETDUMP_DEBUG +#ifdef NETDUMP_CLIENT_DEBUG if (!nd_nic) printf("netdump: Warning: No default interface " "found. Manual configuration required.\n");