On Sep 14, 2016, at 7:13 AM, Jonathan Brucker <jonathan.bru...@gmail.com> wrote:

> Actually, I have a small dilemma regarding the offset words (the last 4 
> bytes):
> 
> Does it make more sense to define an enum (0..7) instead of ASCII symbols?

Either one would work.

A switch statement switching on the offset word value would generate slightly 
less code if the values were a dense set of integral values rather than a 
sparse set of integral values (which is what the ASCII characters are).

So I'm OK with changing it - but let's do it quickly.  It's not on the 
tcpdump.org site yet, so it's not really "published", so we could change it, 
but I'd rather get it done ASAP before it does get published.

> I noticed that VLC project defines RDS blocks (internally) using an
> enum, starting from 0:
> 
> #define V4L2_RDS_BLOCK_A 0
> #define V4L2_RDS_BLOCK_B 1
> #define V4L2_RDS_BLOCK_C 2
> #define V4L2_RDS_BLOCK_D 3
> #define V4L2_RDS_BLOCK_C_ALT 4
> #define V4L2_RDS_BLOCK_INVALID 7
> 
> Should we do the same?

There's "do the same" as in "using 0 through 5" (is there any need to have a 
value for "invalid"?  Will there ever be a block with an invalid offset word?), 
and there's "do the same" as in "add #defines to libpcap".

I don't see any need to do the latter; a dissector for tcpdump/Wireshark/etc. 
could define them itself.
_______________________________________________
tcpdump-workers mailing list
tcpdump-workers@lists.tcpdump.org
https://lists.sandelman.ca/mailman/listinfo/tcpdump-workers

Reply via email to