2个条件在2个不同的layerKey [英] 2 conditions at 2 different layerKey

查看:116
本文介绍了2个条件在2个不同的layerKey的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

作为标题,我想根据2个不同的layerKeys的2个条件过滤数据包。

As title, I want to filter packet based on 2 conditions at 2 different layerKeys.

例如  FWPM_CONDITION_IP_REMOTE_ADDRESS at  FWPM_LAYER_INBOUND_TRANSPORT_V4

Such as FWPM_CONDITION_IP_REMOTE_ADDRESS at FWPM_LAYER_INBOUND_TRANSPORT_V4

FWPM_CONDITION_MAC_REMOTE_ADDRESS at  FWPM_LAYER_INBOUND_MAC_FRAME_ETHERNET

如何将这些条件添加到同一个过滤器中?

How do I add these condition into a same filter?

谢谢!




推荐答案

你不能。  ; 过滤器只能应用于1层。在这种情况下,您可以添加2个过滤器。

You can't.  A filter can apply to only 1 layer.  In this case you add 2 filters.

如果您需要组合逻辑,那么您将在FWPM_LAYER_INBOUND_MAC_FRAME_ETHERNET创建过滤器。 此过滤器需要一个内核标注,它会解析NBL的源IP地址。请注意,对于来自该远程MAC地址的每一帧,此解析都会产生

If you need to combine the logic, then you would create your filter at FWPM_LAYER_INBOUND_MAC_FRAME_ETHERNET.  This filter would need a kernel callout which would parse the NBL for the source IP address.  Note that this parsing would occur for every frame that came from that remote MAC address.

希望这有帮助,


这篇关于2个条件在2个不同的layerKey的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆