TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: Looking for tool/language to describe data/packet structures

19 pointsby tinktankover 2 years ago
I&#x27;m looking or a tool that will allow me to textually describe data&#x2F;packet structures for the purposes of creating visual representations of the structures. If it&#x27;s capable of expressing constraints or assertations that would be even better. Examples of constraints&#x2F;assertions:<p>- This field should always be n bits into the start of the structure - The size of this structure shouldn&#x27;t exceed B bits - This field should never be less than s bits<p>The capability to output image formats directly is preferred, but I&#x27;m not opposed to having to script it and tie it up to an image generation library.<p>I&#x27;d prefer a CLI tool so the flow is all on my local machine.

4 comments

jiveturkeyover 2 years ago
<a href="http:&#x2F;&#x2F;interactive.blockdiag.com&#x2F;packetdiag&#x2F;" rel="nofollow">http:&#x2F;&#x2F;interactive.blockdiag.com&#x2F;packetdiag&#x2F;</a><p><a href="https:&#x2F;&#x2F;github.com&#x2F;arnoldrobbins&#x2F;dformat">https:&#x2F;&#x2F;github.com&#x2F;arnoldrobbins&#x2F;dformat</a>
codegladiatorover 2 years ago
Checkout kaitai<p><a href="https:&#x2F;&#x2F;doc.kaitai.io&#x2F;" rel="nofollow">https:&#x2F;&#x2F;doc.kaitai.io&#x2F;</a><p>Its not for generating visual structure, but just defining the structure with the constraints like you mentioned
cookiengineerover 2 years ago
In the network security space there&#x27;s pcap-ng and yara that&#x27;s pretty common as a network filter ruleset generator.<p>There&#x27;s also a lof of visual IDEs for the creation of yara rules, which tend to break it down in a flow-based graph so that the logical conditions are easier to understand.<p>Yara is pretty flexible in what you can do with it, a lot of anti malware tools use it for detection, as well as more modern hex editors like ImHex.<p>Older-generation tech used to use snort and its rule format, especially in the Enterprise space it&#x27;s (sadly) still common.
renewiltordover 2 years ago
Protocol exists but is unmaintained (I think) <a href="https:&#x2F;&#x2F;www.luismg.com&#x2F;protocol&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.luismg.com&#x2F;protocol&#x2F;</a><p>Wavedrom and ascii wave is for tming <a href="https:&#x2F;&#x2F;github.com&#x2F;Wren6991&#x2F;asciiwave">https:&#x2F;&#x2F;github.com&#x2F;Wren6991&#x2F;asciiwave</a>