Skip to content

Conversation

@jsilveradga
Copy link

To run the dis logger from ./examples/dis-logger, run python main.py

It currently looks for DIS traffic on port 3000 and will display the message if sniffed for. It also is currently only looking for EntityStatePdu; however, it can be configured to accept other types, this is just what is being used with the project I'm working on.

@leif81 leif81 self-assigned this Oct 29, 2024
@leif81
Copy link
Member

leif81 commented Oct 29, 2024

Thank-you for the contribution @jsilveradga . I will circle back to review soon.

@leif81 leif81 self-requested a review October 29, 2024 15:31
@leif81 leif81 removed their assignment Oct 29, 2024
@leif81
Copy link
Member

leif81 commented Nov 25, 2025

@ngjunsiang given you're one of the most active python contributors right now, would you be interested in helping review this PR?

@ngjunsiang
Copy link
Contributor

A few immediate things that need addressing first:

  • A number of major changes have been merged into master since this PR was created and it needs to sync upstream changes. Fortunately, this PR primarily adds two files, so the changes should be easy to rebase.
  • The dis-logger module depends on scapy, and this dependency is not added to pyproject.toml. How comfortable are we with adding another external dependency to the codebase? If the logger is not used, scapy is not necessary; we might consider adding it as a [group dependency](https://packaging.python.org/en/latest/specifications/dependency-

Testability

The dis-logger module is not easy to test as-is; configuration is hardcoded and does not work well with dis_sender.py. dis_sender.py sends UDP on port 3001 while dis-logger listens on 3000; dis-logger also listens for multicast packets which dis_sender does not send. If testing locally, line 113 needs to be changed:

Current:
https://github.com/open-dis/open-dis-python/pull/63/files#diff-a90c74944938164d2390468353173da77ef54ba1aada2ca63c1d8ec69649ab4eR112

Required:

sniff(filter="udp and port 3001", iface="lo", prn=process_packet, stop_filter=stop_sniffing)

Should this be the default hardcoded config for easier testing?

There are also no unit tests written for the dis-logger, because it is at present a GUI. Do we want a CLI version as well, and should the GUI and CLI share a common base logic?

Fixes

A minor change is needed to make dis-logger work, due to upstream changes; see review suggestion.

Co-authored-by: JS Ng <ngjunsiang@gmail.com>
@leif81
Copy link
Member

leif81 commented Nov 29, 2025

dis_sender.py sends UDP on port 3001 while dis-logger listens on 3000;

Good catch. 3000 is the closest thing to a standard DIS port. I recommend we update dis sender to that.

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.

3 participants