<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><BR><DIV><DIV>On Jul 11, 2007, at 1:25, Clint Webb wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; ">What I prefer is:<BR> * Magic byte / version<BR> * Cmd byte<BR> * 4 byte opaque id.<BR> * Key len byte (if no key, 0)<BR> * key, if key length above is non-zero.<BR> * 4 byte body length (not including reserved byte at the end)<SPAN class="Apple-converted-space"> </SPAN><BR> * [ cmd-specific fixed-width fields ]<BR> * [ cmd-specific variable-width field ]<BR> * Reserved byte (should be 0)<BR></SPAN></BLOCKQUOTE></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN>Byte alignment is important to some people. Currently, all bytes are guaranteed before the variable length data begins.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN>My suggestion to take over the reserved byte doesn't actually make much of a difference. The command specific fixed-width fields is a constant for a given command. Effectively, instead of hard-coding 0, you'd hard-code a specific value for a given command.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN>Generally, it doesn't matter because we know the number of fixed-length fields for defined commands. It's only valuable when you don't know what the command is you're processing. For example, in a wireshark plugin you can display the key for a command that the plugin doesn't know about yet. Or in the case of my test server, I can split the chunks up before handing it up to the higher level handler.</DIV><BR><DIV> <SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><DIV>-- </DIV><DIV>Dustin Sallings</DIV><BR class="Apple-interchange-newline"></SPAN> </DIV><BR></BODY></HTML>