From owner-freebsd-net@FreeBSD.ORG Mon Dec 22 01:05:33 2008 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 59B55106564A for ; Mon, 22 Dec 2008 01:05:33 +0000 (UTC) (envelope-from bms@incunabulum.net) Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by mx1.freebsd.org (Postfix) with ESMTP id 2F7FA8FC08 for ; Mon, 22 Dec 2008 01:05:33 +0000 (UTC) (envelope-from bms@incunabulum.net) Received: from compute2.internal (compute2.internal [10.202.2.42]) by out1.messagingengine.com (Postfix) with ESMTP id 220561EAEFD; Sun, 21 Dec 2008 20:05:32 -0500 (EST) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute2.internal (MEProxy); Sun, 21 Dec 2008 20:05:32 -0500 X-Sasl-enc: pacEfdmy6eKXY87WQ/9cxtMjPGHn9LKKAYGwBdrcFvBw 1229907931 Received: from anglepoise.lon.incunabulum.net (82-35-112-254.cable.ubr07.dals.blueyonder.co.uk [82.35.112.254]) by mail.messagingengine.com (Postfix) with ESMTPSA id 975864664F; Sun, 21 Dec 2008 20:05:31 -0500 (EST) Message-ID: <494EE7D9.5060000@incunabulum.net> Date: Mon, 22 Dec 2008 01:05:29 +0000 From: Bruce Simpson User-Agent: Thunderbird 2.0.0.18 (X11/20081204) MIME-Version: 1.0 To: Ferner Cilloniz References: <1229738406.5614.17.camel@mobiliare.Belkin> In-Reply-To: <1229738406.5614.17.camel@mobiliare.Belkin> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-net@freebsd.org Subject: Re: sending arbitrary UDP packets from kernel module 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: Mon, 22 Dec 2008 01:05:33 -0000 Ferner Cilloniz wrote: > So i have done some research and reading and found that i need to call > either udp_send or udp_output. Can anyone help me out with providing the > proper arguments to these functions so i may call them and send > arbitrary UDP packets from a kernel module? > The NFS and BOOTP code would be the first place to look, it has a rather shonky way of creating a socket in-kernel so that an INPCB will be created, allowing you to send and receive UDP datagrams. Fire up KScope or similar and look at how it does it. cheers BMS