From dc83e6400347d6e5fb591ad581ae79354f479a1c Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 3 Dec 2020 20:04:03 +1030 Subject: [PATCH] tools/generate-wire: don't use void * pointers for tlv fromwire. And fix up the one place which got it wrong. Signed-off-by: Rusty Russell --- channeld/channeld_wiregen.c | 2 +- channeld/channeld_wiregen.h | 2 +- closingd/closingd_wiregen.c | 2 +- closingd/closingd_wiregen.h | 2 +- common/peer_status_wiregen.c | 2 +- common/peer_status_wiregen.h | 2 +- common/status_wiregen.c | 2 +- common/status_wiregen.h | 2 +- connectd/connectd_gossipd_wiregen.c | 2 +- connectd/connectd_gossipd_wiregen.h | 2 +- connectd/connectd_wiregen.c | 2 +- connectd/connectd_wiregen.h | 2 +- devtools/blindedpath.c | 5 +++-- gossipd/gossip_store_wiregen.c | 2 +- gossipd/gossip_store_wiregen.h | 2 +- gossipd/gossipd_peerd_wiregen.c | 2 +- gossipd/gossipd_peerd_wiregen.h | 2 +- gossipd/gossipd_wiregen.c | 2 +- gossipd/gossipd_wiregen.h | 2 +- hsmd/hsmd_wiregen.c | 2 +- hsmd/hsmd_wiregen.h | 2 +- onchaind/onchaind_wiregen.c | 2 +- onchaind/onchaind_wiregen.h | 2 +- openingd/dualopend_wiregen.c | 2 +- openingd/dualopend_wiregen.h | 2 +- openingd/openingd_wiregen.c | 2 +- openingd/openingd_wiregen.h | 2 +- tools/gen/header_template | 2 +- tools/gen/impl_template | 3 +-- wire/common_wiregen.c | 2 +- wire/common_wiregen.h | 2 +- wire/onion_printgen.c | 2 +- wire/onion_printgen.h | 2 +- wire/onion_wiregen.c | 5 ++--- wire/onion_wiregen.h | 4 ++-- wire/peer_printgen.c | 2 +- wire/peer_printgen.h | 2 +- wire/peer_wiregen.c | 26 +++++++++----------------- wire/peer_wiregen.h | 18 +++++++++--------- 39 files changed, 59 insertions(+), 68 deletions(-) diff --git a/channeld/channeld_wiregen.c b/channeld/channeld_wiregen.c index 3e365f5f8..3737097f1 100644 --- a/channeld/channeld_wiregen.c +++ b/channeld/channeld_wiregen.c @@ -1248,4 +1248,4 @@ bool fromwire_send_onionmsg(const tal_t *ctx, const void *p, u8 onion[1366], str } return cursor != NULL; } -// SHA256STAMP:c520ab3f9f3c5e7a7b1cdd7535bd95ee82a7b352602da56eb37d603a1890fd46 +// SHA256STAMP:67432ca0aef376273ef2057a16fa75711b248eb33191ec4de63d8c9a537e2757 diff --git a/channeld/channeld_wiregen.h b/channeld/channeld_wiregen.h index 87c0985e1..c6199f655 100644 --- a/channeld/channeld_wiregen.h +++ b/channeld/channeld_wiregen.h @@ -246,4 +246,4 @@ bool fromwire_send_onionmsg(const tal_t *ctx, const void *p, u8 onion[1366], str #endif /* LIGHTNING_CHANNELD_CHANNELD_WIREGEN_H */ -// SHA256STAMP:c520ab3f9f3c5e7a7b1cdd7535bd95ee82a7b352602da56eb37d603a1890fd46 +// SHA256STAMP:67432ca0aef376273ef2057a16fa75711b248eb33191ec4de63d8c9a537e2757 diff --git a/closingd/closingd_wiregen.c b/closingd/closingd_wiregen.c index 74fae8e54..7aacf44df 100644 --- a/closingd/closingd_wiregen.c +++ b/closingd/closingd_wiregen.c @@ -201,4 +201,4 @@ bool fromwire_closingd_complete(const void *p) return false; return cursor != NULL; } -// SHA256STAMP:c9a8c207d4b03e4a8a63e24b8cf04bdcdce031f05ce238c23d66861736d38093 +// SHA256STAMP:e6800a03e1351462b19de79fdc56a2866bc5de80d229065dc6d2685b458b5611 diff --git a/closingd/closingd_wiregen.h b/closingd/closingd_wiregen.h index 38aad99f7..66f63dcb7 100644 --- a/closingd/closingd_wiregen.h +++ b/closingd/closingd_wiregen.h @@ -56,4 +56,4 @@ bool fromwire_closingd_complete(const void *p); #endif /* LIGHTNING_CLOSINGD_CLOSINGD_WIREGEN_H */ -// SHA256STAMP:c9a8c207d4b03e4a8a63e24b8cf04bdcdce031f05ce238c23d66861736d38093 +// SHA256STAMP:e6800a03e1351462b19de79fdc56a2866bc5de80d229065dc6d2685b458b5611 diff --git a/common/peer_status_wiregen.c b/common/peer_status_wiregen.c index c956e5718..94c7ad1aa 100644 --- a/common/peer_status_wiregen.c +++ b/common/peer_status_wiregen.c @@ -80,4 +80,4 @@ bool fromwire_status_peer_error(const tal_t *ctx, const void *p, struct channel_ fromwire_u8_array(&cursor, &plen, *error_for_them, len); return cursor != NULL; } -// SHA256STAMP:81ce8c48fa95942e161b6a69f86271f538f58e32c09ae4da068c4061d0cfcc87 +// SHA256STAMP:c422e1bdb12318ac77a581f0e23ef5f9b41c24524b01d9a786c47c5809eea76b diff --git a/common/peer_status_wiregen.h b/common/peer_status_wiregen.h index 2a287f616..72943ced2 100644 --- a/common/peer_status_wiregen.h +++ b/common/peer_status_wiregen.h @@ -34,4 +34,4 @@ bool fromwire_status_peer_error(const tal_t *ctx, const void *p, struct channel_ #endif /* LIGHTNING_COMMON_PEER_STATUS_WIREGEN_H */ -// SHA256STAMP:81ce8c48fa95942e161b6a69f86271f538f58e32c09ae4da068c4061d0cfcc87 +// SHA256STAMP:c422e1bdb12318ac77a581f0e23ef5f9b41c24524b01d9a786c47c5809eea76b diff --git a/common/status_wiregen.c b/common/status_wiregen.c index 910a19112..655498110 100644 --- a/common/status_wiregen.c +++ b/common/status_wiregen.c @@ -191,4 +191,4 @@ bool fromwire_status_peer_billboard(const tal_t *ctx, const void *p, bool *perm, *happenings = fromwire_wirestring(ctx, &cursor, &plen); return cursor != NULL; } -// SHA256STAMP:adfe96ff3b9661f179d937c93c5457c38f20d1caeaaa646326ca0c6d5496a35c +// SHA256STAMP:9d44fada024f78edb1b187537bbf25a5d2e830cff9c822086aa456eb37260926 diff --git a/common/status_wiregen.h b/common/status_wiregen.h index 87275e77f..72fa365df 100644 --- a/common/status_wiregen.h +++ b/common/status_wiregen.h @@ -53,4 +53,4 @@ bool fromwire_status_peer_billboard(const tal_t *ctx, const void *p, bool *perm, #endif /* LIGHTNING_COMMON_STATUS_WIREGEN_H */ -// SHA256STAMP:adfe96ff3b9661f179d937c93c5457c38f20d1caeaaa646326ca0c6d5496a35c +// SHA256STAMP:9d44fada024f78edb1b187537bbf25a5d2e830cff9c822086aa456eb37260926 diff --git a/connectd/connectd_gossipd_wiregen.c b/connectd/connectd_gossipd_wiregen.c index 83cdf5566..41a9ca445 100644 --- a/connectd/connectd_gossipd_wiregen.c +++ b/connectd/connectd_gossipd_wiregen.c @@ -161,4 +161,4 @@ bool fromwire_gossipd_get_addrs_reply(const tal_t *ctx, const void *p, struct wi fromwire_wireaddr(&cursor, &plen, *addrs + i); return cursor != NULL; } -// SHA256STAMP:4af15bf6b2957f298e162dd9b8f3a3d03057a417940827fbfaed5b72853bfe65 +// SHA256STAMP:5b1b8cca0deddcf16c20684b4e0088b488447e2cab3116477e0e3832d7c9309c diff --git a/connectd/connectd_gossipd_wiregen.h b/connectd/connectd_gossipd_wiregen.h index 52aa8aa8d..62543a8e3 100644 --- a/connectd/connectd_gossipd_wiregen.h +++ b/connectd/connectd_gossipd_wiregen.h @@ -54,4 +54,4 @@ bool fromwire_gossipd_get_addrs_reply(const tal_t *ctx, const void *p, struct wi #endif /* LIGHTNING_CONNECTD_CONNECTD_GOSSIPD_WIREGEN_H */ -// SHA256STAMP:4af15bf6b2957f298e162dd9b8f3a3d03057a417940827fbfaed5b72853bfe65 +// SHA256STAMP:5b1b8cca0deddcf16c20684b4e0088b488447e2cab3116477e0e3832d7c9309c diff --git a/connectd/connectd_wiregen.c b/connectd/connectd_wiregen.c index 957d9713d..90da2beb4 100644 --- a/connectd/connectd_wiregen.c +++ b/connectd/connectd_wiregen.c @@ -406,4 +406,4 @@ bool fromwire_connectd_dev_memleak_reply(const void *p, bool *leak) *leak = fromwire_bool(&cursor, &plen); return cursor != NULL; } -// SHA256STAMP:85f646a5218fd260c3e73d270ea8f59aa14cb3ca02d7805f23b988625ca4deee +// SHA256STAMP:05735b72da2bcd3e099ca9a3d48dba9b2bf3fd89f7bba8b58042b6ce8b0e8e2e diff --git a/connectd/connectd_wiregen.h b/connectd/connectd_wiregen.h index 4ed444e9e..171aaef05 100644 --- a/connectd/connectd_wiregen.h +++ b/connectd/connectd_wiregen.h @@ -103,4 +103,4 @@ bool fromwire_connectd_dev_memleak_reply(const void *p, bool *leak); #endif /* LIGHTNING_CONNECTD_CONNECTD_WIREGEN_H */ -// SHA256STAMP:85f646a5218fd260c3e73d270ea8f59aa14cb3ca02d7805f23b988625ca4deee +// SHA256STAMP:05735b72da2bcd3e099ca9a3d48dba9b2bf3fd89f7bba8b58042b6ce8b0e8e2e diff --git a/devtools/blindedpath.c b/devtools/blindedpath.c index 4e47bca47..38611ad99 100644 --- a/devtools/blindedpath.c +++ b/devtools/blindedpath.c @@ -147,11 +147,12 @@ int main(int argc, char **argv) u8 *p; u8 buf[BIGSIZE_MAX_LEN]; const unsigned char npub[crypto_aead_chacha20poly1305_ietf_NPUBBYTES] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; - struct tlv_onionmsg_payload *inner, *outer; + struct tlv_onionmsg_payload *outer; + struct tlv_encmsg_tlvs *inner; int ret; /* Inner is encrypted */ - inner = tlv_onionmsg_payload_new(tmpctx); + inner = tlv_encmsg_tlvs_new(tmpctx); /* Use scid if they provided one */ if (scids[i]) { inner->next_short_channel_id diff --git a/gossipd/gossip_store_wiregen.c b/gossipd/gossip_store_wiregen.c index bb894fd1c..0a98f4b13 100644 --- a/gossipd/gossip_store_wiregen.c +++ b/gossipd/gossip_store_wiregen.c @@ -187,4 +187,4 @@ bool fromwire_gossipd_local_add_channel_obs(const tal_t *ctx, const void *p, str fromwire_u8_array(&cursor, &plen, *features, flen); return cursor != NULL; } -// SHA256STAMP:41597b4d43114d650fc300cd4df2c4f7f993a09d9ff427f3f6c0c7248a4b47cd +// SHA256STAMP:c366132d32c26c52e94d122eb16df0b04f9a28bc8eaa437d11565da35ebdbc09 diff --git a/gossipd/gossip_store_wiregen.h b/gossipd/gossip_store_wiregen.h index dfda3102c..50515006a 100644 --- a/gossipd/gossip_store_wiregen.h +++ b/gossipd/gossip_store_wiregen.h @@ -58,4 +58,4 @@ bool fromwire_gossipd_local_add_channel_obs(const tal_t *ctx, const void *p, str #endif /* LIGHTNING_GOSSIPD_GOSSIP_STORE_WIREGEN_H */ -// SHA256STAMP:41597b4d43114d650fc300cd4df2c4f7f993a09d9ff427f3f6c0c7248a4b47cd +// SHA256STAMP:c366132d32c26c52e94d122eb16df0b04f9a28bc8eaa437d11565da35ebdbc09 diff --git a/gossipd/gossipd_peerd_wiregen.c b/gossipd/gossipd_peerd_wiregen.c index 61ccf6e2d..9130b35cb 100644 --- a/gossipd/gossipd_peerd_wiregen.c +++ b/gossipd/gossipd_peerd_wiregen.c @@ -187,4 +187,4 @@ bool fromwire_gossipd_local_channel_announcement(const tal_t *ctx, const void *p fromwire_u8_array(&cursor, &plen, *cannount, len); return cursor != NULL; } -// SHA256STAMP:c4575b41c403e4760d2a8674edfa45476e15fd8945be672b0e4c120d330e96aa +// SHA256STAMP:aa566d781788b1f286ed3e1a2f370aeeea3a20c2ef407e4f2260363b1b4e343e diff --git a/gossipd/gossipd_peerd_wiregen.h b/gossipd/gossipd_peerd_wiregen.h index fd95a91b2..34e8d2307 100644 --- a/gossipd/gossipd_peerd_wiregen.h +++ b/gossipd/gossipd_peerd_wiregen.h @@ -64,4 +64,4 @@ bool fromwire_gossipd_local_channel_announcement(const tal_t *ctx, const void *p #endif /* LIGHTNING_GOSSIPD_GOSSIPD_PEERD_WIREGEN_H */ -// SHA256STAMP:c4575b41c403e4760d2a8674edfa45476e15fd8945be672b0e4c120d330e96aa +// SHA256STAMP:aa566d781788b1f286ed3e1a2f370aeeea3a20c2ef407e4f2260363b1b4e343e diff --git a/gossipd/gossipd_wiregen.c b/gossipd/gossipd_wiregen.c index 1e3986d49..f6177cab2 100644 --- a/gossipd/gossipd_wiregen.c +++ b/gossipd/gossipd_wiregen.c @@ -857,4 +857,4 @@ bool fromwire_gossipd_new_blockheight(const void *p, u32 *blockheight) *blockheight = fromwire_u32(&cursor, &plen); return cursor != NULL; } -// SHA256STAMP:9b93deed184d5f5c0d5a9e649fae6449645501ded555b63350bfa3ce8eef70ba +// SHA256STAMP:9a3085a0900af1be982379d809293c95374675211d9b254f0471ac62ecc6a40c diff --git a/gossipd/gossipd_wiregen.h b/gossipd/gossipd_wiregen.h index 132f77305..c0960aea8 100644 --- a/gossipd/gossipd_wiregen.h +++ b/gossipd/gossipd_wiregen.h @@ -199,4 +199,4 @@ bool fromwire_gossipd_new_blockheight(const void *p, u32 *blockheight); #endif /* LIGHTNING_GOSSIPD_GOSSIPD_WIREGEN_H */ -// SHA256STAMP:9b93deed184d5f5c0d5a9e649fae6449645501ded555b63350bfa3ce8eef70ba +// SHA256STAMP:9a3085a0900af1be982379d809293c95374675211d9b254f0471ac62ecc6a40c diff --git a/hsmd/hsmd_wiregen.c b/hsmd/hsmd_wiregen.c index 2a02f0cd4..e42b3f653 100644 --- a/hsmd/hsmd_wiregen.c +++ b/hsmd/hsmd_wiregen.c @@ -1214,4 +1214,4 @@ bool fromwire_hsmd_get_output_scriptpubkey_reply(const tal_t *ctx, const void *p fromwire_u8_array(&cursor, &plen, *script, script_len); return cursor != NULL; } -// SHA256STAMP:9b185bdbec96768d072ab4f9aef455ff824ae1df85a4f036eb3e1dfe25a53482 +// SHA256STAMP:29a74e9db2d286909d13567701c2f6da7e3565d84cc8793f6c06c428f4fb1172 diff --git a/hsmd/hsmd_wiregen.h b/hsmd/hsmd_wiregen.h index 8636440d6..a45022d1f 100644 --- a/hsmd/hsmd_wiregen.h +++ b/hsmd/hsmd_wiregen.h @@ -271,4 +271,4 @@ bool fromwire_hsmd_get_output_scriptpubkey_reply(const tal_t *ctx, const void *p #endif /* LIGHTNING_HSMD_HSMD_WIREGEN_H */ -// SHA256STAMP:9b185bdbec96768d072ab4f9aef455ff824ae1df85a4f036eb3e1dfe25a53482 +// SHA256STAMP:29a74e9db2d286909d13567701c2f6da7e3565d84cc8793f6c06c428f4fb1172 diff --git a/onchaind/onchaind_wiregen.c b/onchaind/onchaind_wiregen.c index faa8cd183..a6359569d 100644 --- a/onchaind/onchaind_wiregen.c +++ b/onchaind/onchaind_wiregen.c @@ -635,4 +635,4 @@ bool fromwire_onchaind_notify_coin_mvt(const void *p, struct chain_coin_mvt *mvt fromwire_chain_coin_mvt(&cursor, &plen, mvt); return cursor != NULL; } -// SHA256STAMP:a7b7a9a01030d1a19fab69045268b63234ae9efb5129ec9282fb354015886759 +// SHA256STAMP:b839f62e9b25740472792b8876eabb51f0b8761c3ab175f163e445579dc87d38 diff --git a/onchaind/onchaind_wiregen.h b/onchaind/onchaind_wiregen.h index a52d274c9..f0a3a290e 100644 --- a/onchaind/onchaind_wiregen.h +++ b/onchaind/onchaind_wiregen.h @@ -161,4 +161,4 @@ bool fromwire_onchaind_notify_coin_mvt(const void *p, struct chain_coin_mvt *mvt #endif /* LIGHTNING_ONCHAIND_ONCHAIND_WIREGEN_H */ -// SHA256STAMP:a7b7a9a01030d1a19fab69045268b63234ae9efb5129ec9282fb354015886759 +// SHA256STAMP:b839f62e9b25740472792b8876eabb51f0b8761c3ab175f163e445579dc87d38 diff --git a/openingd/dualopend_wiregen.c b/openingd/dualopend_wiregen.c index c7be40bc6..f3a34ea1c 100644 --- a/openingd/dualopend_wiregen.c +++ b/openingd/dualopend_wiregen.c @@ -485,4 +485,4 @@ bool fromwire_dualopend_dev_memleak_reply(const void *p, bool *leak) *leak = fromwire_bool(&cursor, &plen); return cursor != NULL; } -// SHA256STAMP:c00536896059d3bd16cd8e1512674abcda83fd680e171dfc016a796f7b4be522 +// SHA256STAMP:880d3ebf21b58a7c545945c97269534c55cafe5583a21e3b6d6a441be01edd86 diff --git a/openingd/dualopend_wiregen.h b/openingd/dualopend_wiregen.h index c29f86a8f..47b6878fe 100644 --- a/openingd/dualopend_wiregen.h +++ b/openingd/dualopend_wiregen.h @@ -109,4 +109,4 @@ bool fromwire_dualopend_dev_memleak_reply(const void *p, bool *leak); #endif /* LIGHTNING_OPENINGD_DUALOPEND_WIREGEN_H */ -// SHA256STAMP:c00536896059d3bd16cd8e1512674abcda83fd680e171dfc016a796f7b4be522 +// SHA256STAMP:880d3ebf21b58a7c545945c97269534c55cafe5583a21e3b6d6a441be01edd86 diff --git a/openingd/openingd_wiregen.c b/openingd/openingd_wiregen.c index 13cc900a0..6ab5374b6 100644 --- a/openingd/openingd_wiregen.c +++ b/openingd/openingd_wiregen.c @@ -579,4 +579,4 @@ bool fromwire_openingd_dev_memleak_reply(const void *p, bool *leak) *leak = fromwire_bool(&cursor, &plen); return cursor != NULL; } -// SHA256STAMP:99ae0c1ae30e7a4f4d6a890665a6dafbb3f3900ab9f2a99a01a734fa968b2edf +// SHA256STAMP:1b4570bed9532371073012f9035708a41aab2d4db70e405561c0182e98a364d8 diff --git a/openingd/openingd_wiregen.h b/openingd/openingd_wiregen.h index 5c73687bc..52a267c95 100644 --- a/openingd/openingd_wiregen.h +++ b/openingd/openingd_wiregen.h @@ -121,4 +121,4 @@ bool fromwire_openingd_dev_memleak_reply(const void *p, bool *leak); #endif /* LIGHTNING_OPENINGD_OPENINGD_WIREGEN_H */ -// SHA256STAMP:99ae0c1ae30e7a4f4d6a890665a6dafbb3f3900ab9f2a99a01a734fa968b2edf +// SHA256STAMP:1b4570bed9532371073012f9035708a41aab2d4db70e405561c0182e98a364d8 diff --git a/tools/gen/header_template b/tools/gen/header_template index 15f95bf84..72e3acefd 100644 --- a/tools/gen/header_template +++ b/tools/gen/header_template @@ -104,7 +104,7 @@ bool fromwire_${tlv.name}(const u8 **cursor, size_t *max, * ensures that the resulting stream is valid according to * `${tlv.name}_is_valid`. */ -void towire_${tlv.name}(u8 **pptr, const void *record); +void towire_${tlv.name}(u8 **pptr, const struct ${tlv.struct_name()} *record); /** * Check that the TLV stream is valid. diff --git a/tools/gen/impl_template b/tools/gen/impl_template index ca02d0d4f..dc15b5673 100644 --- a/tools/gen/impl_template +++ b/tools/gen/impl_template @@ -257,8 +257,7 @@ ${static}const struct tlv_record_type tlvs_${tlv.name}[] = { % endfor }; -void towire_${tlv.name}(u8 **pptr, - const void *record) +void towire_${tlv.name}(u8 **pptr, const struct ${tlv.struct_name()} *record) { size_t num_types = ${len(tlv.messages)}; const struct tlv_record_type *types = tlvs_${tlv.name}; diff --git a/wire/common_wiregen.c b/wire/common_wiregen.c index 18db41a63..db548a1f8 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:c8a40362138ff8fcffde2285cda2c85cdfbf66a19591d4bd61066dbe21eda68c +// SHA256STAMP:fe62497ee0bd7740759a6486bfa924b7ababe84fc52a1bb73f4b447549f47613 diff --git a/wire/common_wiregen.h b/wire/common_wiregen.h index 4e2fcf05d..b1596a6fe 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:c8a40362138ff8fcffde2285cda2c85cdfbf66a19591d4bd61066dbe21eda68c +// SHA256STAMP:fe62497ee0bd7740759a6486bfa924b7ababe84fc52a1bb73f4b447549f47613 diff --git a/wire/onion_printgen.c b/wire/onion_printgen.c index 3c2917de5..73439f7dc 100644 --- a/wire/onion_printgen.c +++ b/wire/onion_printgen.c @@ -653,4 +653,4 @@ void printonion_wire_tlv_message(const char *tlv_name, const u8 *msg) { printwire_tlvs(tlv_name, &msg, &plen, print_tlvs_tlv_payload, ARRAY_SIZE(print_tlvs_tlv_payload)); } } -// SHA256STAMP:6f34c3287d2f8abec14ecd33fe8340b82298a34959e96a752f8dafc0762b8f65 +// SHA256STAMP:9e9fd8224814641537178262b21b7ea3c898d5d9282066228938f69236a9df2c diff --git a/wire/onion_printgen.h b/wire/onion_printgen.h index a420804d0..66f66b478 100644 --- a/wire/onion_printgen.h +++ b/wire/onion_printgen.h @@ -57,4 +57,4 @@ void printwire_mpp_timeout(const char *fieldname, const u8 *cursor); #endif /* LIGHTNING_WIRE_ONION_PRINTGEN_H */ -// SHA256STAMP:6f34c3287d2f8abec14ecd33fe8340b82298a34959e96a752f8dafc0762b8f65 +// SHA256STAMP:9e9fd8224814641537178262b21b7ea3c898d5d9282066228938f69236a9df2c diff --git a/wire/onion_wiregen.c b/wire/onion_wiregen.c index 5bf3d0d7f..1dc960439 100644 --- a/wire/onion_wiregen.c +++ b/wire/onion_wiregen.c @@ -194,8 +194,7 @@ const struct tlv_record_type tlvs_tlv_payload[] = { { 8, towire_tlv_tlv_payload_payment_data, fromwire_tlv_tlv_payload_payment_data }, }; -void towire_tlv_payload(u8 **pptr, - const void *record) +void towire_tlv_payload(u8 **pptr, const struct tlv_tlv_payload *record) { size_t num_types = 4; const struct tlv_record_type *types = tlvs_tlv_payload; @@ -837,4 +836,4 @@ bool fromwire_mpp_timeout(const void *p) return false; return cursor != NULL; } -// SHA256STAMP:6f34c3287d2f8abec14ecd33fe8340b82298a34959e96a752f8dafc0762b8f65 +// SHA256STAMP:9e9fd8224814641537178262b21b7ea3c898d5d9282066228938f69236a9df2c diff --git a/wire/onion_wiregen.h b/wire/onion_wiregen.h index f8add95bf..e1bdc99a1 100644 --- a/wire/onion_wiregen.h +++ b/wire/onion_wiregen.h @@ -88,7 +88,7 @@ bool fromwire_tlv_payload(const u8 **cursor, size_t *max, * ensures that the resulting stream is valid according to * `tlv_payload_is_valid`. */ -void towire_tlv_payload(u8 **pptr, const void *record); +void towire_tlv_payload(u8 **pptr, const struct tlv_tlv_payload *record); /** * Check that the TLV stream is valid. @@ -207,4 +207,4 @@ bool fromwire_mpp_timeout(const void *p); #endif /* LIGHTNING_WIRE_ONION_WIREGEN_H */ -// SHA256STAMP:6f34c3287d2f8abec14ecd33fe8340b82298a34959e96a752f8dafc0762b8f65 +// SHA256STAMP:9e9fd8224814641537178262b21b7ea3c898d5d9282066228938f69236a9df2c diff --git a/wire/peer_printgen.c b/wire/peer_printgen.c index f33929615..8ad533aac 100644 --- a/wire/peer_printgen.c +++ b/wire/peer_printgen.c @@ -2036,4 +2036,4 @@ void printpeer_wire_tlv_message(const char *tlv_name, const u8 *msg) { printwire_tlvs(tlv_name, &msg, &plen, print_tlvs_reply_channel_range_tlvs, ARRAY_SIZE(print_tlvs_reply_channel_range_tlvs)); } } -// SHA256STAMP:cb418f8296955fdcd26b9f06259a0c120007b543bc167f486989ac289a48c4af +// SHA256STAMP:c38a17eb3c7f3c12612754d5419f2ed44c0114be7252eece347fcb2902aaf9f4 diff --git a/wire/peer_printgen.h b/wire/peer_printgen.h index 9d3548ac8..29a71c5f5 100644 --- a/wire/peer_printgen.h +++ b/wire/peer_printgen.h @@ -70,4 +70,4 @@ void printwire_gossip_timestamp_filter(const char *fieldname, const u8 *cursor); void printwire_channel_update_checksums(const char *fieldname, const u8 **cursor, size_t *plen); void printwire_channel_update_timestamps(const char *fieldname, const u8 **cursor, size_t *plen); #endif /* LIGHTNING_WIRE_PEER_PRINTGEN_H */ -// SHA256STAMP:cb418f8296955fdcd26b9f06259a0c120007b543bc167f486989ac289a48c4af +// SHA256STAMP:c38a17eb3c7f3c12612754d5419f2ed44c0114be7252eece347fcb2902aaf9f4 diff --git a/wire/peer_wiregen.c b/wire/peer_wiregen.c index 6cfc2ff03..6679cd04e 100644 --- a/wire/peer_wiregen.c +++ b/wire/peer_wiregen.c @@ -164,8 +164,7 @@ static const struct tlv_record_type tlvs_init_tlvs[] = { { 1, towire_tlv_init_tlvs_networks, fromwire_tlv_init_tlvs_networks }, }; -void towire_init_tlvs(u8 **pptr, - const void *record) +void towire_init_tlvs(u8 **pptr, const struct tlv_init_tlvs *record) { size_t num_types = 1; const struct tlv_record_type *types = tlvs_init_tlvs; @@ -436,8 +435,7 @@ const struct tlv_record_type tlvs_n1[] = { { 254, towire_tlv_n1_tlv4, fromwire_tlv_n1_tlv4 }, }; -void towire_n1(u8 **pptr, - const void *record) +void towire_n1(u8 **pptr, const struct tlv_n1 *record) { size_t num_types = 4; const struct tlv_record_type *types = tlvs_n1; @@ -655,8 +653,7 @@ const struct tlv_record_type tlvs_n2[] = { { 11, towire_tlv_n2_tlv2, fromwire_tlv_n2_tlv2 }, }; -void towire_n2(u8 **pptr, - const void *record) +void towire_n2(u8 **pptr, const struct tlv_n2 *record) { size_t num_types = 2; const struct tlv_record_type *types = tlvs_n2; @@ -849,8 +846,7 @@ static const struct tlv_record_type tlvs_open_channel_tlvs[] = { { 0, towire_tlv_open_channel_tlvs_upfront_shutdown_script, fromwire_tlv_open_channel_tlvs_upfront_shutdown_script }, }; -void towire_open_channel_tlvs(u8 **pptr, - const void *record) +void towire_open_channel_tlvs(u8 **pptr, const struct tlv_open_channel_tlvs *record) { size_t num_types = 1; const struct tlv_record_type *types = tlvs_open_channel_tlvs; @@ -1043,8 +1039,7 @@ static const struct tlv_record_type tlvs_accept_channel_tlvs[] = { { 0, towire_tlv_accept_channel_tlvs_upfront_shutdown_script, fromwire_tlv_accept_channel_tlvs_upfront_shutdown_script }, }; -void towire_accept_channel_tlvs(u8 **pptr, - const void *record) +void towire_accept_channel_tlvs(u8 **pptr, const struct tlv_accept_channel_tlvs *record) { size_t num_types = 1; const struct tlv_record_type *types = tlvs_accept_channel_tlvs; @@ -1241,8 +1236,7 @@ static const struct tlv_record_type tlvs_query_short_channel_ids_tlvs[] = { { 1, towire_tlv_query_short_channel_ids_tlvs_query_flags, fromwire_tlv_query_short_channel_ids_tlvs_query_flags }, }; -void towire_query_short_channel_ids_tlvs(u8 **pptr, - const void *record) +void towire_query_short_channel_ids_tlvs(u8 **pptr, const struct tlv_query_short_channel_ids_tlvs *record) { size_t num_types = 1; const struct tlv_record_type *types = tlvs_query_short_channel_ids_tlvs; @@ -1436,8 +1430,7 @@ static const struct tlv_record_type tlvs_query_channel_range_tlvs[] = { { 1, towire_tlv_query_channel_range_tlvs_query_option, fromwire_tlv_query_channel_range_tlvs_query_option }, }; -void towire_query_channel_range_tlvs(u8 **pptr, - const void *record) +void towire_query_channel_range_tlvs(u8 **pptr, const struct tlv_query_channel_range_tlvs *record) { size_t num_types = 1; const struct tlv_record_type *types = tlvs_query_channel_range_tlvs; @@ -1662,8 +1655,7 @@ static const struct tlv_record_type tlvs_reply_channel_range_tlvs[] = { { 3, towire_tlv_reply_channel_range_tlvs_checksums_tlv, fromwire_tlv_reply_channel_range_tlvs_checksums_tlv }, }; -void towire_reply_channel_range_tlvs(u8 **pptr, - const void *record) +void towire_reply_channel_range_tlvs(u8 **pptr, const struct tlv_reply_channel_range_tlvs *record) { size_t num_types = 2; const struct tlv_record_type *types = tlvs_reply_channel_range_tlvs; @@ -2750,4 +2742,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:cb418f8296955fdcd26b9f06259a0c120007b543bc167f486989ac289a48c4af +// SHA256STAMP:c38a17eb3c7f3c12612754d5419f2ed44c0114be7252eece347fcb2902aaf9f4 diff --git a/wire/peer_wiregen.h b/wire/peer_wiregen.h index 56e96ff31..652316ee7 100644 --- a/wire/peer_wiregen.h +++ b/wire/peer_wiregen.h @@ -170,7 +170,7 @@ bool fromwire_init_tlvs(const u8 **cursor, size_t *max, * ensures that the resulting stream is valid according to * `init_tlvs_is_valid`. */ -void towire_init_tlvs(u8 **pptr, const void *record); +void towire_init_tlvs(u8 **pptr, const struct tlv_init_tlvs *record); /** * Check that the TLV stream is valid. @@ -207,7 +207,7 @@ bool fromwire_n1(const u8 **cursor, size_t *max, * ensures that the resulting stream is valid according to * `n1_is_valid`. */ -void towire_n1(u8 **pptr, const void *record); +void towire_n1(u8 **pptr, const struct tlv_n1 *record); /** * Check that the TLV stream is valid. @@ -257,7 +257,7 @@ bool fromwire_n2(const u8 **cursor, size_t *max, * ensures that the resulting stream is valid according to * `n2_is_valid`. */ -void towire_n2(u8 **pptr, const void *record); +void towire_n2(u8 **pptr, const struct tlv_n2 *record); /** * Check that the TLV stream is valid. @@ -305,7 +305,7 @@ bool fromwire_open_channel_tlvs(const u8 **cursor, size_t *max, * ensures that the resulting stream is valid according to * `open_channel_tlvs_is_valid`. */ -void towire_open_channel_tlvs(u8 **pptr, const void *record); +void towire_open_channel_tlvs(u8 **pptr, const struct tlv_open_channel_tlvs *record); /** * Check that the TLV stream is valid. @@ -342,7 +342,7 @@ bool fromwire_accept_channel_tlvs(const u8 **cursor, size_t *max, * ensures that the resulting stream is valid according to * `accept_channel_tlvs_is_valid`. */ -void towire_accept_channel_tlvs(u8 **pptr, const void *record); +void towire_accept_channel_tlvs(u8 **pptr, const struct tlv_accept_channel_tlvs *record); /** * Check that the TLV stream is valid. @@ -379,7 +379,7 @@ bool fromwire_query_short_channel_ids_tlvs(const u8 **cursor, size_t *max, * ensures that the resulting stream is valid according to * `query_short_channel_ids_tlvs_is_valid`. */ -void towire_query_short_channel_ids_tlvs(u8 **pptr, const void *record); +void towire_query_short_channel_ids_tlvs(u8 **pptr, const struct tlv_query_short_channel_ids_tlvs *record); /** * Check that the TLV stream is valid. @@ -416,7 +416,7 @@ bool fromwire_query_channel_range_tlvs(const u8 **cursor, size_t *max, * ensures that the resulting stream is valid according to * `query_channel_range_tlvs_is_valid`. */ -void towire_query_channel_range_tlvs(u8 **pptr, const void *record); +void towire_query_channel_range_tlvs(u8 **pptr, const struct tlv_query_channel_range_tlvs *record); /** * Check that the TLV stream is valid. @@ -453,7 +453,7 @@ bool fromwire_reply_channel_range_tlvs(const u8 **cursor, size_t *max, * ensures that the resulting stream is valid according to * `reply_channel_range_tlvs_is_valid`. */ -void towire_reply_channel_range_tlvs(u8 **pptr, const void *record); +void towire_reply_channel_range_tlvs(u8 **pptr, const struct tlv_reply_channel_range_tlvs *record); /** * Check that the TLV stream is valid. @@ -595,4 +595,4 @@ bool fromwire_channel_update_option_channel_htlc_max(const void *p, secp256k1_ec #endif /* LIGHTNING_WIRE_PEER_WIREGEN_H */ -// SHA256STAMP:cb418f8296955fdcd26b9f06259a0c120007b543bc167f486989ac289a48c4af +// SHA256STAMP:c38a17eb3c7f3c12612754d5419f2ed44c0114be7252eece347fcb2902aaf9f4