From owner-freebsd-net@FreeBSD.ORG Tue Dec 30 18:58:25 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 C360E106566B for ; Tue, 30 Dec 2008 18:58:25 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outU.internet-mail-service.net (outu.internet-mail-service.net [216.240.47.244]) by mx1.freebsd.org (Postfix) with ESMTP id A4AA28FC08 for ; Tue, 30 Dec 2008 18:58:25 +0000 (UTC) (envelope-from julian@elischer.org) Received: from idiom.com (mx0.idiom.com [216.240.32.160]) by out.internet-mail-service.net (Postfix) with ESMTP id 0A234242A; Tue, 30 Dec 2008 10:58:25 -0800 (PST) X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (home.elischer.org [216.240.48.38]) by idiom.com (Postfix) with ESMTP id 8E37D2D600E; Tue, 30 Dec 2008 10:58:24 -0800 (PST) Message-ID: <495A6F50.2070305@elischer.org> Date: Tue, 30 Dec 2008 10:58:24 -0800 From: Julian Elischer User-Agent: Thunderbird 2.0.0.18 (Macintosh/20081105) MIME-Version: 1.0 To: Ferner Cilloniz References: <1230637795.4966.20.camel@mobiliare.Belkin> In-Reply-To: <1230637795.4966.20.camel@mobiliare.Belkin> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-net@freebsd.org Subject: Re: kernel network 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: Tue, 30 Dec 2008 18:58:26 -0000 Ferner Cilloniz wrote: > Guys, > > I do not think I could ever be more tired of this topic but I cannot > seem to understand what to do. I have tried more about a month now to > send arbitrary UDP packets from a kernel module but cannot achieve it. I > have looked at udp_send but found that building a socket* was much to > tedious. Later i looked at in-kernel webservers > (http://openketa.sourceforge.net/) but could not find anything useful. > > Netgraph is a possibility, but there isn't any documentation on > accessing the network from kernel space. > > What do you all suggest? > where are your packets supposed to come from? I think I asked you this before so sorry if you answered it and I have forgotten. i.e. what is in them? start with /usr/src/sys/netgraph/ng_sample.c and ng_source.c and make a nolde that generates teh packets you want to send, and then attach it to an ng_ksocket node.. end of job