Skip to content
New issue

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

Report usage of unsupported display filter protocol #693

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

weshouman
Copy link

@weshouman weshouman commented Apr 5, 2024

Fix #692

@@ -344,6 +357,17 @@ async def _get_tshark_process(self, packet_count=None, stdin=None):
parameters = [self._get_tshark_path(), "-l", "-n", "-T", output_type] + \
self.get_parameters(packet_count=packet_count) + output_parameters

if not tshark_supports_protocol(self._display_filter):
suggestions = "or".join(self._suggest_protocol_name(self._display_filter))
if (suggestions == ""):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if not suggestions:?

suggestions = "or".join(self._suggest_protocol_name(self._display_filter))
if (suggestions == ""):
raise TSharkProtocolNotSupportedException(
f"Protocol {self._display_filter} is not supported by TShark. " + \
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for the + \ here, it'll be concatenated anyway

@@ -344,6 +357,17 @@ async def _get_tshark_process(self, packet_count=None, stdin=None):
parameters = [self._get_tshark_path(), "-l", "-n", "-T", output_type] + \
self.get_parameters(packet_count=packet_count) + output_parameters

if not tshark_supports_protocol(self._display_filter):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TBH this seems like overkill to check it every time we get the process, since it'll only fail very rarely. Maybe we can check it on a crash to explain it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inform the user of unsupported protocol usage
2 participants