We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It’s fine to allow people to specify a Python expression per CLI, but a Python API should work with Python types.
The API should be changed so
read_pcap
read_har
E.g.:
reader.read_pcap('file.pcap', filter=lambda tcp: tcp.dst == '1.1.1.1')
This can easily be done:
from inspect import signature ... def filter_packet(self, filter, eth, ip=None, tcp=None): if not filter: return True if isinstance(filter, str): return eval(filter) if not callable(filter: raise TypeError('filter needs to be callable') sig = signature(filter) params = { k: v for k: v in dict(eth=eth, ip=ip, tcp=tcp).items() if v is not None and k in sig.parameters } filter(**params)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
It’s fine to allow people to specify a Python expression per CLI, but a Python API should work with Python types.
The API should be changed so
read_pcap
andread_har
take kwargs instead of a dict of paramsE.g.:
This can easily be done:
The text was updated successfully, but these errors were encountered: