From owner-freebsd-net@FreeBSD.ORG Wed Jun 17 05:16:17 2009 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 65648106564A for ; Wed, 17 Jun 2009 05:16:17 +0000 (UTC) (envelope-from bob@veznat.com) Received: from mail.ttora.com (mail.ttora.com [208.75.243.236]) by mx1.freebsd.org (Postfix) with ESMTP id 2F8FD8FC16 for ; Wed, 17 Jun 2009 05:16:17 +0000 (UTC) (envelope-from bob@veznat.com) DomainKey-Signature: s=two; d=veznat.com; c=nofws; q=dns; h=X-MID:X-IronPort-AV:X-IronPort-AV:Received:User-Agent: Date:Subject:From:To:Message-ID:Thread-Topic:Thread-Index: Mime-version:Content-type:Content-transfer-encoding; b=cj+bOzy7uUJXADnaAOX2aDkOnT1fzaW3P0fvDvzD0EmVqP6oVppsNcp2 FPZK5OOcKNdzLEVuooZ3nOa4z4+/4twk9AKSVR16nlgDAaSb83p0IKSfp uzU6HpD0CKid8BXVWyo5x4/vkaxNATNQNI8PyGQgpkRlQhWgPrIg50B1I c=; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=veznat.com; i=bob@veznat.com; q=dns/txt; s=one; t=1245215777; x=1276751777; h=from:sender:reply-to:subject:date:message-id:to:cc: mime-version:content-transfer-encoding:content-id: content-description:resent-date:resent-from:resent-sender: resent-to:resent-cc:resent-message-id:in-reply-to: references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:list-owner:list-archive; z=From:=20Bob=20Van=20Zant=20|Subject:=20D ebugging=20a=20netgraph=20node|Date:=20Tue,=2016=20Jun=20 2009=2021:47:21=20-0700|Message-ID:=20|To:=20 |Mime-version:=201.0|Content-transfer-encoding:=207bit; bh=oiG9hElQZhEbTCJjgohlBpzNB3XxkaBJvcMhs3Y2r7E=; b=QUWM1WnyP5rFECaGvNvaUfPNItofQ1iIc6JPQrNJdV7OVlDFUW/AFnU0 Xq01YVe4np+26wmi098Na5WF3d4IwlNvehpV8UNsU55fVmr7rgghD9fs7 a2pqOb3Vcpcz9zd24IuVeW8deRrukLZMQntBab1donD8TjapOnWJzs2Kw k=; X-MID: 1506126 X-IronPort-AV: E=McAfee;i="5300,2777,5648"; a="1506126" X-IronPort-AV: E=Sophos;i="4.42,234,1243839600"; d="scan'208";a="1506126" Received: from c-24-5-4-92.hsd1.ca.comcast.net (HELO [192.168.1.200]) ([24.5.4.92]) by mail.ttora.com with ESMTP/TLS/DES-CBC3-SHA; 16 Jun 2009 21:47:24 -0700 User-Agent: Microsoft-Entourage/12.15.0.081119 Date: Tue, 16 Jun 2009 21:47:21 -0700 From: Bob Van Zant To: Message-ID: Thread-Topic: Debugging a netgraph node Thread-Index: AcnvBrMTmY8hkrdTRkOTW9YaYT+XBQ== Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit Subject: Debugging a netgraph node 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: Wed, 17 Jun 2009 05:16:17 -0000 I'm experimenting with netgraph to try to implement an IPv6 -> IPv4 gateway, as specified here: http://tools.ietf.org/html/draft-xli-behave-ivi-02 This is my first time ever working with netgraph and I admit to being a bit lost. I have a netgraph node that gets wired up with an ng_ether node. My lower hook gets wired to the ng_ether lower hook and my upper to his upper. It's receiving IPv6 + UDP packets, creating IPv4 + UDP packets and then writing the new packets out with NG_FWD_NEW_DATA. I'm perfectly willing to waste time making stupid mistakes on this project, however, right now I'm stuck. I can't "find" the translated packets I'm writing anywhere to see what, if anything, is wrong with them. They don't show up in tcpdump on the local machine (I've tried writing to both the upper and lower hook). They don't show up in tcpdump on other machines on the network. I tried attaching nghook to the "orphans" hook of the ng_ether node but it doesn't appear to be seeing any data. netstat -s -p udp doesn't show any packets when my node is enabled (I think this means my node is effectively swallowing them). I've tried to figure out how to wire in an ng_tee node but I'm a little lost as to how to do this (I still haven't figured out the ngctl syntax). Any tips for figuring out what I'm doing wrong? Debug options to enable that will show me more information about what's happening after I call NG_FWD_NEW_DATA? If I got ng_tee wired in would it's tap hooks show me what I want? A better way to try to tee the data? Thanks, Bob