From owner-freebsd-net Thu Nov 7 9:34:37 2002 Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A9B5C37B401; Thu, 7 Nov 2002 09:34:36 -0800 (PST) Received: from cisco.com (sword.cisco.com [161.44.208.100]) by mx1.FreeBSD.org (Postfix) with ESMTP id C44E843E42; Thu, 7 Nov 2002 09:34:35 -0800 (PST) (envelope-from sjt@cisco.com) Received: from sjt-u10.cisco.com (sjt-u10.cisco.com [10.85.30.63]) by cisco.com (8.8.5-Cisco.1/8.8.8) with ESMTP id MAA00571; Thu, 7 Nov 2002 12:34:34 -0500 (EST) Received: (sjt@localhost) by sjt-u10.cisco.com (8.8.5-Cisco.1/CISCO.WS.1.2) id MAA09490; Thu, 7 Nov 2002 12:34:34 -0500 (EST) Date: Thu, 7 Nov 2002 12:34:34 -0500 From: Steve Tremblett To: Maksim Yevmenkin Cc: freebsd-net@FreeBSD.ORG, freebsd-hackers@FreeBSD.ORG Subject: Re: input source for network application Message-ID: <20021107123434.G264@sjt-u10.cisco.com> References: <20021107121857.F264@sjt-u10.cisco.com> <3DCAA2C7.12D6ED3E@exodus.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <3DCAA2C7.12D6ED3E@exodus.net>; from myevmenk@exodus.net on Thu, Nov 07, 2002 at 09:28:39AM -0800 Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org +---- Maksim Yevmenkin wrote: | > I'm in a bit of a bind. I want a sequence of ethernet frames to send | > up through this framework. Hooking to ng_ether will give me this but I | > am restricted to taking ALL frames (thus taking the machine offline) or | > orphaned frames (where I will have to write some sort of traffic | > generator to make frames of an invalid type). The third option here is | > to hack ng_ether to deliver frames out the lower hook as well as up | > into the kernel IP stack, thus giving me a complete stream without | > taking the box offline. I've gotten libnet which seems to fit the bill | > to generate any orphans I want, but making a stream of frames by hand | > is a pain. | | why do you need ng_ether, ng_tee etc. at all? can't you just write | your code with assumption that there will be one (or few) input | hooks? can't you just connect *user-space* Ethernet/IP frame generator | to the input hook(s) and send frames? that's what i did in HCI/Bluetooth | stack when i had no *real* Bluetooth hardware. i just wrote simple | *user-space* Bluetooth device simulator and connected it to the stack. | then i run VMWare and debug my code. | | you can use tcpdump and save dumps to the file and then just read it | and re-inject them into your node. this way you can test at least | basic stuff, i.e. frame parsing etc. Thought of this just after I sent the email - d'oh! Thanks! -- Steve Tremblett To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message