diff --git a/wire/Makefile b/wire/Makefile index 345fa8326..9651eaf1e 100644 --- a/wire/Makefile +++ b/wire/Makefile @@ -155,6 +155,7 @@ clean: wire-clean wire-clean: $(RM) wire/*.csv.* + $(RM) wire/channel_type_*gen* wire-maintainer-clean: wire-clean $(RM) wire/gen_*_csv wire/extracted_*_experimental_csv diff --git a/wire/bolt12_wiregen.c b/wire/bolt12_wiregen.c index 03785df6d..42aa6ae88 100644 --- a/wire/bolt12_wiregen.c +++ b/wire/bolt12_wiregen.c @@ -1684,4 +1684,4 @@ bool invoice_error_is_valid(const struct tlv_invoice_error *record, size_t *err_ return tlv_fields_valid(record->fields, NULL, err_index); } -// SHA256STAMP:a2c41aa239904c7cbfe50e576e6724eedb50fff1e1014ac80912aa195ed8e912 +// SHA256STAMP:040e24ba1c955e65d81d184dac635c72fe8af10aa1795411d6ec2e7ed76c6224 diff --git a/wire/bolt12_wiregen.h b/wire/bolt12_wiregen.h index d5ce091bc..ddfe63e23 100644 --- a/wire/bolt12_wiregen.h +++ b/wire/bolt12_wiregen.h @@ -323,4 +323,4 @@ struct fallback_address *fromwire_fallback_address(const tal_t *ctx, const u8 ** #endif /* LIGHTNING_WIRE_BOLT12_WIREGEN_H */ -// SHA256STAMP:a2c41aa239904c7cbfe50e576e6724eedb50fff1e1014ac80912aa195ed8e912 +// SHA256STAMP:040e24ba1c955e65d81d184dac635c72fe8af10aa1795411d6ec2e7ed76c6224 diff --git a/wire/channel_type_printgen.c b/wire/channel_type_printgen.c new file mode 100644 index 000000000..b51d1d4ce --- /dev/null +++ b/wire/channel_type_printgen.c @@ -0,0 +1,32 @@ +/* This file was generated by generate-wire.py */ +/* Do not modify this file! Modify the .csv file it was generated from. */ + +#include +#include +#include +#include +#include +#include +#include + + + +void printwire_channel_type(const char *fieldname, const u8 **cursor, size_t *plen) +{ + + u16 len = fromwire_u16(cursor, plen); + if (!*cursor) { + printf("**TRUNCATED**\n"); + return; + } + printf("features="); + printwire_u8_array(tal_fmt(NULL, "%s.features", fieldname), cursor, plen, len); + + if (!*cursor) { + printf("**TRUNCATED**\n"); + return; + } + +} + +// SHA256STAMP:8639d78101a54a07ac8be72bc33df8d2c974b52452786fb5a898f0a83a7837a7 diff --git a/wire/channel_type_printgen.h b/wire/channel_type_printgen.h new file mode 100644 index 000000000..91ed961ef --- /dev/null +++ b/wire/channel_type_printgen.h @@ -0,0 +1,16 @@ +/* This file was generated by generate-wire.py */ +/* Do not modify this file! Modify the .csv file it was generated from. */ +/* Template located at tools/gen/print_header_template */ +#ifndef LIGHTNING_WIRE_CHANNEL_TYPE_PRINTGEN_H +#define LIGHTNING_WIRE_CHANNEL_TYPE_PRINTGEN_H +#include +#include + +void printchannel_type_wire_message(const u8 *msg); + +void printchannel_type_wire_tlv_message(const char *tlv_name, const u8 *msg); + + +void printwire_channel_type(const char *fieldname, const u8 **cursor, size_t *plen); +#endif /* LIGHTNING_WIRE_CHANNEL_TYPE_PRINTGEN_H */ +// SHA256STAMP:8639d78101a54a07ac8be72bc33df8d2c974b52452786fb5a898f0a83a7837a7 diff --git a/wire/channel_type_wiregen.c b/wire/channel_type_wiregen.c new file mode 100644 index 000000000..144a289da --- /dev/null +++ b/wire/channel_type_wiregen.c @@ -0,0 +1,42 @@ +/* This file was generated by generate-wire.py */ +/* Do not modify this file! Modify the .csv file it was generated from. */ +/* Original template can be found at tools/gen/impl_template */ + +#include +#include +#include +#include +#include +#include +#include + +#ifndef SUPERVERBOSE +#define SUPERVERBOSE(...) +#endif + + + + +/* SUBTYPE: CHANNEL_TYPE */ +/* Why not let our generator generate this too? */ +void towire_channel_type(u8 **p, const struct channel_type *channel_type) +{ + u16 len = tal_count(channel_type->features); + + towire_u16(p, len); + towire_u8_array(p, channel_type->features, len); +} +struct channel_type * +fromwire_channel_type(const tal_t *ctx, const u8 **cursor, size_t *plen) +{ + struct channel_type *channel_type = tal(ctx, struct channel_type); + u16 len; + + len = fromwire_u16(cursor, plen); + channel_type->features = tal_arr(channel_type, u8, len); +fromwire_u8_array(cursor, plen, channel_type->features, len); + + return channel_type; +} + +// SHA256STAMP:8639d78101a54a07ac8be72bc33df8d2c974b52452786fb5a898f0a83a7837a7 diff --git a/wire/channel_type_wiregen.h b/wire/channel_type_wiregen.h new file mode 100644 index 000000000..3c73a585d --- /dev/null +++ b/wire/channel_type_wiregen.h @@ -0,0 +1,23 @@ +/* This file was generated by generate-wire.py */ +/* Do not modify this file! Modify the _csv file it was generated from. */ +/* Original template can be found at tools/gen/header_template */ + +#ifndef LIGHTNING_WIRE_CHANNEL_TYPE_WIREGEN_H +#define LIGHTNING_WIRE_CHANNEL_TYPE_WIREGEN_H +#include +#include +#include + + +struct channel_type { + u8 *features; +}; + +/* SUBTYPE: CHANNEL_TYPE */ +/* Why not let our generator generate this too? */ +void towire_channel_type(u8 **p, const struct channel_type *channel_type); +struct channel_type *fromwire_channel_type(const tal_t *ctx, const u8 **cursor, size_t *plen); + + +#endif /* LIGHTNING_WIRE_CHANNEL_TYPE_WIREGEN_H */ +// SHA256STAMP:8639d78101a54a07ac8be72bc33df8d2c974b52452786fb5a898f0a83a7837a7 diff --git a/wire/common_wiregen.c b/wire/common_wiregen.c index 7886bd4fe..3032ec26e 100644 --- a/wire/common_wiregen.c +++ b/wire/common_wiregen.c @@ -100,4 +100,4 @@ bool fromwire_custommsg_out(const tal_t *ctx, const void *p, u8 **msg) fromwire_u8_array(&cursor, &plen, *msg, msg_len); return cursor != NULL; } -// SHA256STAMP:c605fef4b00d9d261397e1e1decd2b59ee06e64cec4fc0d175c56aa598e0fc31 +// SHA256STAMP:a0d8998b1f9bd46677f237471545a49b8009e41b8b3afedf0007adeabf98b440 diff --git a/wire/common_wiregen.h b/wire/common_wiregen.h index 8b2fb400b..8f0282bcd 100644 --- a/wire/common_wiregen.h +++ b/wire/common_wiregen.h @@ -41,4 +41,4 @@ bool fromwire_custommsg_out(const tal_t *ctx, const void *p, u8 **msg); #endif /* LIGHTNING_WIRE_COMMON_WIREGEN_H */ -// SHA256STAMP:c605fef4b00d9d261397e1e1decd2b59ee06e64cec4fc0d175c56aa598e0fc31 +// SHA256STAMP:a0d8998b1f9bd46677f237471545a49b8009e41b8b3afedf0007adeabf98b440 diff --git a/wire/onion_printgen.c b/wire/onion_printgen.c index 5f15b2167..e4409c947 100644 --- a/wire/onion_printgen.c +++ b/wire/onion_printgen.c @@ -859,4 +859,4 @@ void printonion_wire_tlv_message(const char *tlv_name, const u8 *msg) { printwire_tlvs(tlv_name, &msg, &plen, print_tlvs_encmsg_tlvs, ARRAY_SIZE(print_tlvs_encmsg_tlvs)); } } -// SHA256STAMP:1425ef44095bc90c4b405497ade727e41d6cde27c1f6e64c8d7239036410dd30 +// SHA256STAMP:5ef4b9da2deee24db844109a2b461c65ad3dbc262da673a304d15082484398e0 diff --git a/wire/onion_printgen.h b/wire/onion_printgen.h index 06b1c4585..9879006cb 100644 --- a/wire/onion_printgen.h +++ b/wire/onion_printgen.h @@ -3,7 +3,9 @@ /* Template located at tools/gen/print_header_template */ #ifndef LIGHTNING_WIRE_ONION_PRINTGEN_H #define LIGHTNING_WIRE_ONION_PRINTGEN_H +#include #include +#include void printonion_wire_message(const u8 *msg); @@ -56,4 +58,4 @@ void printwire_mpp_timeout(const char *fieldname, const u8 *cursor); void printwire_onionmsg_path(const char *fieldname, const u8 **cursor, size_t *plen); #endif /* LIGHTNING_WIRE_ONION_PRINTGEN_H */ -// SHA256STAMP:1425ef44095bc90c4b405497ade727e41d6cde27c1f6e64c8d7239036410dd30 +// SHA256STAMP:5ef4b9da2deee24db844109a2b461c65ad3dbc262da673a304d15082484398e0 diff --git a/wire/onion_wiregen.c b/wire/onion_wiregen.c index c916c9461..16f419ef3 100644 --- a/wire/onion_wiregen.c +++ b/wire/onion_wiregen.c @@ -1026,4 +1026,4 @@ bool fromwire_mpp_timeout(const void *p) return false; return cursor != NULL; } -// SHA256STAMP:1425ef44095bc90c4b405497ade727e41d6cde27c1f6e64c8d7239036410dd30 +// SHA256STAMP:5ef4b9da2deee24db844109a2b461c65ad3dbc262da673a304d15082484398e0 diff --git a/wire/onion_wiregen.h b/wire/onion_wiregen.h index 4f6fa5279..bec3e5abb 100644 --- a/wire/onion_wiregen.h +++ b/wire/onion_wiregen.h @@ -317,4 +317,4 @@ bool fromwire_mpp_timeout(const void *p); #endif /* LIGHTNING_WIRE_ONION_WIREGEN_H */ -// SHA256STAMP:1425ef44095bc90c4b405497ade727e41d6cde27c1f6e64c8d7239036410dd30 +// SHA256STAMP:5ef4b9da2deee24db844109a2b461c65ad3dbc262da673a304d15082484398e0 diff --git a/wire/peer_printgen.c b/wire/peer_printgen.c index e76382fc5..60b93bf54 100644 --- a/wire/peer_printgen.c +++ b/wire/peer_printgen.c @@ -3139,4 +3139,4 @@ void printpeer_wire_tlv_message(const char *tlv_name, const u8 *msg) { printwire_tlvs(tlv_name, &msg, &plen, print_tlvs_onion_message_tlvs, ARRAY_SIZE(print_tlvs_onion_message_tlvs)); } } -// SHA256STAMP:80b32650a8208ef15d83ebecbb3bae3c321fdc8594802de10847ae95f2169952 +// SHA256STAMP:30dc0f24cedd3001a2f330446f89575d68b80a2f0c33563bf07093b7bf4196b3 diff --git a/wire/peer_printgen.h b/wire/peer_printgen.h index 737aceebf..78888e1d3 100644 --- a/wire/peer_printgen.h +++ b/wire/peer_printgen.h @@ -3,6 +3,7 @@ /* Template located at tools/gen/print_header_template */ #ifndef LIGHTNING_WIRE_PEER_PRINTGEN_H #define LIGHTNING_WIRE_PEER_PRINTGEN_H +#include #include void printpeer_wire_message(const u8 *msg); @@ -98,4 +99,4 @@ void printwire_channel_update_checksums(const char *fieldname, const u8 **cursor void printwire_channel_update_timestamps(const char *fieldname, const u8 **cursor, size_t *plen); void printwire_witness_stack(const char *fieldname, const u8 **cursor, size_t *plen); #endif /* LIGHTNING_WIRE_PEER_PRINTGEN_H */ -// SHA256STAMP:80b32650a8208ef15d83ebecbb3bae3c321fdc8594802de10847ae95f2169952 +// SHA256STAMP:30dc0f24cedd3001a2f330446f89575d68b80a2f0c33563bf07093b7bf4196b3 diff --git a/wire/peer_wiregen.c b/wire/peer_wiregen.c index bf6422ada..44cd6334c 100644 --- a/wire/peer_wiregen.c +++ b/wire/peer_wiregen.c @@ -2589,4 +2589,4 @@ bool fromwire_channel_update_option_channel_htlc_max(const void *p, secp256k1_ec *htlc_maximum_msat = fromwire_amount_msat(&cursor, &plen); return cursor != NULL; } -// SHA256STAMP:80b32650a8208ef15d83ebecbb3bae3c321fdc8594802de10847ae95f2169952 +// SHA256STAMP:30dc0f24cedd3001a2f330446f89575d68b80a2f0c33563bf07093b7bf4196b3 diff --git a/wire/peer_wiregen.h b/wire/peer_wiregen.h index dd39cd001..6a80a78b4 100644 --- a/wire/peer_wiregen.h +++ b/wire/peer_wiregen.h @@ -981,4 +981,4 @@ bool fromwire_channel_update_option_channel_htlc_max(const void *p, secp256k1_ec #endif /* LIGHTNING_WIRE_PEER_WIREGEN_H */ -// SHA256STAMP:80b32650a8208ef15d83ebecbb3bae3c321fdc8594802de10847ae95f2169952 +// SHA256STAMP:30dc0f24cedd3001a2f330446f89575d68b80a2f0c33563bf07093b7bf4196b3