devtools/decodemsg: add --onion option for decoding onion errors.

This requires a tweak to generate-wire.py too, since it always called the
top-level routine 'print_message'.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2018-07-27 06:50:37 +09:30
committed by Christian Decker
parent ef33dd2998
commit 93cf28553d
3 changed files with 29 additions and 14 deletions

View File

@@ -718,7 +718,7 @@ print_header_template = """/* This file was generated by generate-wire.py */
#include <devtools/print_wire.h>
{includes}
void print_message(const u8 *msg);
void print{enumname}_message(const u8 *msg);
{func_decls}
#endif /* LIGHTNING_{idem} */
@@ -732,7 +732,7 @@ print_template = """/* This file was generated by generate-wire.py */
#include <common/utils.h>
#include <stdio.h>
void print_message(const u8 *msg)
void print{enumname}_message(const u8 *msg)
{{
\tswitch ((enum {enumname})fromwire_peektype(msg)) {{
\t{printcases}