Netgraph plumbing question

Ruslan Ermilov ru at freebsd.org
Sat Aug 26 15:16:29 UTC 2006


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="in1" ifNotMatch="mixed" }
+ msg bpf: setprogram { thisHook="in2" ifNotMatch="mixed" }
+ msg bpf: setprogram { thisHook="mixed" ifNotMatch="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,
-- 
Ruslan Ermilov
ru at FreeBSD.org
FreeBSD committer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-net/attachments/20060826/54abe3c1/attachment.pgp


More information about the freebsd-net mailing list