From owner-freebsd-net@FreeBSD.ORG Thu Dec 30 13:47:36 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3EF3D1065679; Thu, 30 Dec 2010 13:47:36 +0000 (UTC) (envelope-from monthadar@gmail.com) Received: from mail-qy0-f175.google.com (mail-qy0-f175.google.com [209.85.216.175]) by mx1.freebsd.org (Postfix) with ESMTP id DC5498FC17; Thu, 30 Dec 2010 13:47:35 +0000 (UTC) Received: by qyk8 with SMTP id 8so11303468qyk.13 for ; Thu, 30 Dec 2010 05:47:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:cc:content-type; bh=mWwMlvwq+R5655lsW1yppiOCMcRMt1pE2eHJJXpVFKk=; b=BlKgP7c6arxWObDyN/ky8muvSoy8rUZ6k56z9RIUn9N55XJOhbzX9rADmmDDZu2+Eg f3TDEg3rm+nda4U5+Eiff/daaeKoqL3/Ey3LqSk8Kkop88wXQZHSYmiPMFP8msQhrK47 j7UNz+JdwYjh0IEXZIerfk1KaJAN6IIeoCqnQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:cc:content-type; b=rhWSBe3c/E2mUf4K5dFc+/U3IDUfC3c0h8OVwknMnXym+hYCXqW2wIDEn0uf3Gq7q9 wAyKw4o9LqSvWkd52OMPR0zQw7AACQXM13P1wDpiz+YtFeJnrh8ElsTTM8aqvNbqG9p1 uJM52OoWCN7/UwIIMXiqXpReDostyZl7hbOm0= MIME-Version: 1.0 Received: by 10.229.251.139 with SMTP id ms11mr14244056qcb.198.1293716855179; Thu, 30 Dec 2010 05:47:35 -0800 (PST) Received: by 10.229.118.83 with HTTP; Thu, 30 Dec 2010 05:47:35 -0800 (PST) Date: Thu, 30 Dec 2010 14:47:35 +0100 Message-ID: From: Monthadar Al Jaberi To: freebsd-net@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Cc: Subject: capturing packet from wlan0 with netgraph? X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Dec 2010 13:47:36 -0000 Hi, I have an idea in my head and would like to know if it is possible. I want to simulate and test the net80211 mesh code in FreeBSD Current. I have an RSPRO board with 3 atheros cards. My basic idea is to run three jails each having its own network stack, and redirect all data packets coming out/in of the wlan driver to a Server running a home brew application that simulates the medium. That would be great, right? Realtime unchanged code to test, running different application in their own jails. So first I started to test netgraph with a simple test case, I want to receive all packets from one wireless card and see the data in wireshark or tcpdump... This is my netgraph code: mkpeer wlan0: hub lower hook0 name wlan0:lower hub connect hub: wlan0: hook1 upper connect hub: arge0: hook2 lower So if I understood man ng_ether correct, this should capture everything from wlan and redirect to ethernet cable. But I get a panic after a couple of seconds: Trap cause = 4 (address error (load or I-fetch) - kernel mode) [ thread pid 11 tid 100037 ] Stopped at ip_input+0xd8: lw v0,0(s0) I suspect that data flows to all hooks of the hub, and that is a bad thing right? Need to create a special hub node to filter data? Or maybe use two ethernet cables for out resp. in? Is it even possible to do what I want? Or am I thinking wrong? And is there a simpler way? What I want is to test mesh code in a bunch of FreeBSD systems without moving the hardware, one could just stack RSPROs and connected them a big switch and a PC. Hope was I clear in my thoughts. Best regards, -- //Monthadar Al Jaberi