
Generate ASCII RFC-like header diagrams for your own custom protocols - rbanffy
http://www.luismg.com/protocol/
======
zxcvgm
If you prefer, you could also draw ASCII diagrams manually with asciiflow. I
find this tool pretty handy from time to time.

[http://asciiflow.com/](http://asciiflow.com/)

------
rmetzler
This looks useful. I really like the nwdiag python package. This has and
packagediag which might be nice to get integrated with protocol.

[http://blockdiag.com/en/nwdiag/index.html](http://blockdiag.com/en/nwdiag/index.html)

------
ChuckMcM
Nice, I thought for a moment I could do SoC register diagrams with it as well
but not so much: ./protocol
"reserved:2,PLLSAI_RDY:1,PLLSAI_ON:1,PLI2S_RDY:1,PLL_RDY:1,PLL_ON:1,Reserved:4,CSS_ON:1,HSE_BYP:1,HSE_RDY:1,HSE_ON:1,HSICAL:8,HSITRIM:5,Reserved:1,HSI_RDY:1,HSI_ON:1"

0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|re.|P|P|P|P|P|Reserv.|C|H|H|H| HSICAL | HSITRIM |R|H|H|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

~~~
jwilk
You should indent text by two (or more spaces) to make HN preserve whitespace:
[https://news.ycombinator.com/formatdoc](https://news.ycombinator.com/formatdoc)

Let me fix it:

    
    
      $ protocol "reserved:2,PLLSAI_RDY:1,PLLSAI_ON:1,PLI2S_RDY:1,PLL_RDY:1,PLL_ON:1,Reserved:4,CSS_ON:1,HSE_BYP:1,HSE_RDY:1,HSE_ON:1,HSICAL:8,HSITRIM:5,Reserved:1,HSI_RDY:1,HSI_ON:1"
       0                   1                   2                   3  
       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |re.|P|P|P|P|P|Reserv.|C|H|H|H|     HSICAL    | HSITRIM |R|H|H|
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

------
contingencies
Cute output but terrible code. Unmaintained.

It would be a lot better if it could read from an established, broad, well
maintained database like Wireshark (formerly ethereal).

------
TheAdamist
Be careful when setting custom line widths, in the past i've run into
situations where the last row of fields gets cutoff, depending on the line
width.

------
rgacote
Looks like a nice reference, in addition to supporting custom protocols.

~~~
imglorp
It would be cool if it could also generate code to marshal and unmarshal a
protocol.

~~~
tyingq
As far as I can tell, it only deals with fixed width fields, and nothing of
the detail inside them. No, notion, for example, of whether a field is
big/little endian, protocols with delimited fields, variable length protocols
with "length" followed by "field", etc.

------
sguav
Looks neat. Now this needs to become a plugin for ST3!

~~~
jfim
> ST3

I'll take it that's not Scream Tracker 3 (1994), Seattle's Sound Transit 3
ballot measure, or the New Jersey tax form, right?

~~~
shawnz
Probably Sublime Text 3.

~~~
jfim
Makes sense, thanks!

------
Annatar
This information belongs in manual pages on the system. On GNU/Linux operating
systems, that's section 7; on illumos and SVR4 based systems, that'd be
section 5.

~~~
jwilk
What do you mean by "this information"?

~~~
Annatar
The information which the program presents.

------
majewsky
Honest question: Is there an audience for this besides network engineers?

For anything else, I'd prefer either a human-readable text-based protocol or
something like Protobuf that generates (de)serializing code from a schema
definition.

~~~
laveur
Absolutely. I've had to implement protocols from a spec using various guides
that had really bad diagrams of how the data is laid out. This tool could have
made them a lot better. And as others have pointed out its extremely useful
for binary file type diagrams.

