net/filter-mirror: implement filter-redirector
commitd46f75b2e95b664cd7ec9007daca933131b1de46
authorZhang Chen <zhangchen.fnst@cn.fujitsu.com>
Thu, 17 Mar 2016 08:16:26 +0000 (17 16:16 +0800)
committerJason Wang <jasowang@redhat.com>
Wed, 30 Mar 2016 00:57:28 +0000 (30 08:57 +0800)
treeca27a041f940bc300d17c1093356df5031fbf304
parentba8940dd8691f16c0180241dab0d1c0da35a71e3
net/filter-mirror: implement filter-redirector

Filter-redirector is a netfilter plugin.
It gives qemu the ability to redirect net packet.
redirector can redirect filter's net packet to outdev.
and redirect indev's packet to filter.

                      filter
                        +
            redirector  |
               +--------------+
               |        |     |
  indev +-----------+   +---------->  outdev
               |    |         |
               +--------------+
                    |
                    v
                  filter

usage:

-netdev user,id=hn0
-chardev socket,id=s0,host=ip_primary,port=X,server,nowait
-chardev socket,id=s1,host=ip_primary,port=Y,server,nowait
-filter-redirector,id=r0,netdev=hn0,queue=tx/rx/all,indev=s0,outdev=s1

Signed-off-by: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
net/filter-mirror.c
qemu-options.hx
vl.c