From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58929) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZKiAj-0002tx-SX for qemu-devel@nongnu.org; Thu, 30 Jul 2015 03:22:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZKiAf-00058k-Bs for qemu-devel@nongnu.org; Thu, 30 Jul 2015 03:22:33 -0400 Received: from [59.151.112.132] (port=16971 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZKiAe-000586-VM for qemu-devel@nongnu.org; Thu, 30 Jul 2015 03:22:29 -0400 Message-ID: <55B9D0AC.8070201@cn.fujitsu.com> Date: Thu, 30 Jul 2015 15:22:20 +0800 From: Yang Hongyang MIME-Version: 1.0 References: <1438167116-29270-1-git-send-email-yanghy@cn.fujitsu.com> <1438167116-29270-6-git-send-email-yanghy@cn.fujitsu.com> <55B9AD45.40103@redhat.com> In-Reply-To: <55B9AD45.40103@redhat.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 05/12] netfilter: hook packets before receive List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jason Wang , qemu-devel@nongnu.org Cc: thuth@redhat.com, mrhines@linux.vnet.ibm.com, stefanha@redhat.com, zhang.zhanghailiang@huawei.com On 07/30/2015 12:51 PM, Jason Wang wrote: > > > On 07/29/2015 06:51 PM, Yang Hongyang wrote: >> Capture packets that will be sent. >> >> Signed-off-by: Yang Hongyang >> --- >> include/net/filter.h | 16 +++++++++++++ >> net/net.c | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++- >> 2 files changed, 80 insertions(+), 1 deletion(-) >> >> diff --git a/include/net/filter.h b/include/net/filter.h >> index 1dd86cf..5292563 100644 >> --- a/include/net/filter.h >> +++ b/include/net/filter.h >> @@ -12,11 +12,27 @@ >> #include "qemu/typedefs.h" >> >> typedef void (FilterCleanup) (NetFilterState *); >> +/* >> + * Return: >> + * 0: finished handling the packet, we should continue >> + * size: filter stolen this packet, we stop pass this packet further >> + */ >> +typedef ssize_t (FilterReceive)(NetFilterState *, NetClientState *sender, >> + unsigned flags, const uint8_t *, size_t); > > Looks like there's no need for this. Just add a wrapper and pretend a > single iov should be ok? Yes, should be ok, will also make concrete filter implement simpler, only implement receive_iov is enough. > > . > -- Thanks, Yang.