Alex Afanasyev wrote:
Junxiao, please try to more considerate statements.
@Ju, as Junxiao mentioned, one way is to do it by hand. If you want to just fix encoding of a certain block, you can write a small for loop that will print out values to std::cout/cerr and then you copy/paste. We used to have such for loops (commented out) in some of the test cases, but not sure if we still have.
Hey Alex, thanks for the explanation. Yes, there is a for loop to generate the plain hex (now sure if you are talking about this one):
for (Buffer::const_iterator it = wire.begin(); it != wire.end(); ++it) {
printf("0x%02x", *it);
}
but according to Juxiao's code review:
There's a guideline about improving readability. Whether you use block literal or HEX, I need to see comments about TLV structure:
- label every TLV-TYPE
- indent nested TLV
It seems we still need to handwrite the encoding according to the packet format for the formatting. Not sure if I understand it correctly.