inet-framework / inet

INET Framework for the OMNeT++ discrete event simulator
https://inet.omnetpp.org
Other
431 stars 483 forks source link

Question about PacketFilterBase canPushPacket implementation #962

Closed haug-den-lucas closed 6 months ago

haug-den-lucas commented 6 months ago

Hello,

I'm currently working with some Per-Stream Filtering and Policing in INET and stumbled upon the following lines of code:

https://github.com/inet-framework/inet/blob/61410b46d87c5c4f337d70fa1b3c268425c7dd03/src/inet/queueing/base/PacketFilterBase.cc#L65-L71

In the no-backpressure case, this code accepts all packets in case its consumer accepts all packets. However, if the consumer does not accept packets, canPushPacket returns true iff the packet criteria does not match, meaning it accepts all packets it will immediately filter out. I cannot think about any scenario why this implementation would be useful.

Could you please clarify why it is implemented like this?