From owner-freebsd-net@FreeBSD.ORG Sat Aug 26 15:16:29 2006 Return-Path: X-Original-To: freebsd-net@freebsd.org 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 2C06C16A541 for ; Sat, 26 Aug 2006 15:16:29 +0000 (UTC) (envelope-from ru@rambler-co.ru) Received: from relay0.rambler.ru (relay0.rambler.ru [81.19.66.187]) by mx1.FreeBSD.org (Postfix) with ESMTP id 76BA4447EC for ; Sat, 26 Aug 2006 14:44:08 +0000 (GMT) (envelope-from ru@rambler-co.ru) Received: from relay0.rambler.ru (localhost [127.0.0.1]) by relay0.rambler.ru (Postfix) with ESMTP id 5C5C85E59; Sat, 26 Aug 2006 18:44:07 +0400 (MSD) Received: from edoofus.park.rambler.ru (unknown [81.19.65.108]) by relay0.rambler.ru (Postfix) with ESMTP id 3BCEA5E58; Sat, 26 Aug 2006 18:44:07 +0400 (MSD) Received: (from ru@localhost) by edoofus.park.rambler.ru (8.13.6/8.13.6) id k7QEiO5L030529; Sat, 26 Aug 2006 18:44:24 +0400 (MSD) (envelope-from ru) Date: Sat, 26 Aug 2006 18:44:24 +0400 From: Ruslan Ermilov To: Rajkumar S Message-ID: <20060826144424.GC30165@rambler-co.ru> References: <64de5c8b0608250849p2912457cs84c227cc914d1f10@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jq0ap7NbKX2Kqbes" Content-Disposition: inline In-Reply-To: <64de5c8b0608250849p2912457cs84c227cc914d1f10@mail.gmail.com> User-Agent: Mutt/1.5.12-2006-07-14 X-Virus-Scanned: No virus found Cc: freebsd-net@freebsd.org Subject: Re: Netgraph plumbing question 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: Sat, 26 Aug 2006 15:16:29 -0000 --jq0ap7NbKX2Kqbes Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Aug 25, 2006 at 09:19:04PM +0530, Rajkumar S wrote: > In the ng_split node is it possible to merge 2 incoming streams into > mixed, while all packets received at mixed goes via out? If merge node > does not support that, is there any other way to get the same result? > No, but it's trivial to set up ng_bpf(4) to do it. Since the default BPF program will be non-matching, "ifNotMatch" action should be used. # ngctl [...] + mkpeer bpf mixed mixed + name mixed bpf + conn bpf: in1 in1 + conn bpf: in2 in2 + conn bpf: out out + msg bpf: setprogram { thisHook=3D"in1" ifNotMatch=3D"mixed" } + msg bpf: setprogram { thisHook=3D"in2" ifNotMatch=3D"mixed" } + msg bpf: setprogram { thisHook=3D"mixed" ifNotMatch=3D"out" } + write in1 33 Rec'd data packet on hook "mixed": 0000: 21 ! + write in2 33 Rec'd data packet on hook "mixed": 0000: 21 ! + write mixed 33 Rec'd data packet on hook "out": 0000: 21 ! Cheers, --=20 Ruslan Ermilov ru@FreeBSD.org FreeBSD committer --jq0ap7NbKX2Kqbes Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (FreeBSD) iD8DBQFE8F5IqRfpzJluFF4RArghAJwPb2mkdQqQzd+dFLM+q61CX1/gHQCeKMkN zd5mz5mgHsFmYL+gtSrMBNw= =C12K -----END PGP SIGNATURE----- --jq0ap7NbKX2Kqbes--