cloudflare / wirefilter

An execution engine for Wireshark-like filters
https://blog.cloudflare.com/building-fast-interpreters-in-rust/
MIT License
958 stars 85 forks source link

Implement starts_with, ends_with operators for Bytes #72

Open amiremohamadi opened 3 years ago

amiremohamadi commented 3 years ago

Ping @marmeladema. Sorry for bothering, just wanted to know is this repo still under development? And is there a chance that this PR will be merged?

veeshi commented 3 years ago

Not part of the project but for our project we implemented startswith and endswith as functions instead of operators as it is more flexible approach.

RReverser commented 3 years ago

Yeah this kind of use-cases is exactly what functions are for, as it doesn't require any special syntax.

amiremohamadi commented 3 years ago

Right, but why we have contains as an operator?

RReverser commented 3 years ago

Because Wireshark has it and this library was designed to support similar syntax: https://www.wireshark.org/docs/wsug_html_chunked/ChWorkBuildDisplayFilterSection.html

If it wasn't for that, it could've been just a function too, yeah.