From owner-freebsd-net@FreeBSD.ORG Tue Feb 16 17:04:09 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 C7DFF106566B for ; Tue, 16 Feb 2010 17:04:09 +0000 (UTC) (envelope-from serena.zanetta@guest.telecomitalia.it) Received: from GRFEDG702BA020.telecomitalia.it (grfedg702ba020.telecomitalia.it [156.54.233.201]) by mx1.freebsd.org (Postfix) with ESMTP id 516BB8FC12 for ; Tue, 16 Feb 2010 17:04:09 +0000 (UTC) Received: from GRFHUB701BA020.griffon.local (10.188.101.111) by GRFEDG702BA020.telecomitalia.it (10.188.45.101) with Microsoft SMTP Server (TLS) id 8.2.176.0; Tue, 16 Feb 2010 17:53:17 +0100 Received: from GRFMBX706BA020.griffon.local ([10.188.101.19]) by grfhub701ba020.griffon.local ([10.188.101.111]) with mapi; Tue, 16 Feb 2010 17:53:17 +0100 From: Zanetta Serena To: "'freebsd-net@freebsd.org'" Date: Tue, 16 Feb 2010 17:53:16 +0100 Thread-Topic: RAW socket under netgraph Thread-Index: AcqvKJRGrMcJvnydRamEUvChCuSkDw== Message-ID: <67B1924593CA5A4AB2C1BEE195D24F97AB1F4AD5@GRFMBX706BA020.griffon.local> Accept-Language: it-IT, en-US Content-Language: it-IT X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: it-IT, en-US MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: RAW socket under 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: Tue, 16 Feb 2010 17:04:09 -0000 Hi, I am trying to implement the raw socket mechanism under Netgraph by setting= the ng_ksocket node type as a raw socket. My purpose is to fill "by hand" = the IP and UDP headers and then forward the so created packet to the raw so= cket to be delivered to the appropriate next hop. I suppose I need to set the socket options as: setsockopt(sd,IPPROTO_IP,IP_HDRINCL,...). I found that the equivalent in the Netgraph is the control message "setopt"= . I've tried to set the options as: ngctl msg node_name: setopt {level=3DIPPROTO_IP name=3DIP_HDRINCL value=3D= } but it doesn't work. Also I don't know exactly which is the value of the "v= alue" parameter. I would ask you how to set the options for the raw socket = and if it is correct to type that command line. Thank you, Serena