wire-gen: move in-house wire delcarations to new format

tidying things up!
This commit is contained in:
lisa neigut
2019-07-23 17:51:11 -05:00
committed by Rusty Russell
parent 236d26308f
commit 32eaae0cb9
23 changed files with 703 additions and 698 deletions

View File

@@ -81,22 +81,22 @@ gossipd-all: lightningd/lightning_gossipd $(LIGHTNINGD_GOSSIP_CLIENT_OBJS)
lightningd/lightning_gossipd: $(LIGHTNINGD_GOSSIP_OBJS) $(GOSSIPD_COMMON_OBJS) $(BITCOIN_OBJS) $(WIRE_OBJS) $(LIGHTNINGD_HSM_CLIENT_OBJS)
gossipd/gen_gossip_wire.h: $(WIRE_GEN) gossipd/gossip_wire.csv
$(WIRE_GEN) --header $@ gossip_wire_type < gossipd/gossip_wire.csv > $@
$(WIRE_GEN) --page header $@ gossip_wire_type < gossipd/gossip_wire.csv > $@
gossipd/gen_gossip_wire.c: $(WIRE_GEN) gossipd/gossip_wire.csv
$(WIRE_GEN) ${@:.c=.h} gossip_wire_type < gossipd/gossip_wire.csv > $@
$(WIRE_GEN) --page impl ${@:.c=.h} gossip_wire_type < gossipd/gossip_wire.csv > $@
gossipd/gen_gossip_peerd_wire.h: $(WIRE_GEN) gossipd/gossip_peerd_wire.csv
$(WIRE_GEN) --header $@ gossip_peerd_wire_type < gossipd/gossip_peerd_wire.csv > $@
$(WIRE_GEN) --page header $@ gossip_peerd_wire_type < gossipd/gossip_peerd_wire.csv > $@
gossipd/gen_gossip_peerd_wire.c: $(WIRE_GEN) gossipd/gossip_peerd_wire.csv
$(WIRE_GEN) ${@:.c=.h} gossip_peerd_wire_type < gossipd/gossip_peerd_wire.csv > $@
$(WIRE_GEN) --page impl ${@:.c=.h} gossip_peerd_wire_type < gossipd/gossip_peerd_wire.csv > $@
gossipd/gen_gossip_store.h: $(WIRE_GEN) gossipd/gossip_store.csv
$(WIRE_GEN) --header $@ gossip_store_type < gossipd/gossip_store.csv > $@
$(WIRE_GEN) --page header $@ gossip_store_type < gossipd/gossip_store.csv > $@
gossipd/gen_gossip_store.c: $(WIRE_GEN) gossipd/gossip_store.csv
$(WIRE_GEN) ${@:.c=.h} gossip_store_type < gossipd/gossip_store.csv > $@
$(WIRE_GEN) --page impl ${@:.c=.h} gossip_store_type < gossipd/gossip_store.csv > $@
check-source: $(LIGHTNINGD_GOSSIP_ALLSRC_NOGEN:%=check-src-include-order/%) $(LIGHTNINGD_GOSSIP_ALLHEADERS_NOGEN:%=check-hdr-include-order/%)

View File

@@ -1,33 +1,33 @@
# These must be distinct from WIRE_CHANNEL_ANNOUNCEMENT etc. gossip msgs!
# Channel daemon can ask for updates for a specific channel, for sending
# errors.
gossipd_get_update,3501
gossipd_get_update,,short_channel_id,struct short_channel_id
msgtype,gossipd_get_update,3501
msgdata,gossipd_get_update,short_channel_id,short_channel_id,
# If channel isn't known, update will be empty.
gossipd_get_update_reply,3601
gossipd_get_update_reply,,len,u16
gossipd_get_update_reply,,update,len*u8
msgtype,gossipd_get_update_reply,3601
msgdata,gossipd_get_update_reply,len,u16,
msgdata,gossipd_get_update_reply,update,u8,len
# Both sides have seen the funding tx being locked, but we have not
# yet reached the announcement depth. So we add the channel locally so
# we (and peer) can update it already.
gossipd_local_add_channel,3503
gossipd_local_add_channel,,short_channel_id,struct short_channel_id
gossipd_local_add_channel,,remote_node_id,struct node_id
gossipd_local_add_channel,,satoshis,struct amount_sat
msgtype,gossipd_local_add_channel,3503
msgdata,gossipd_local_add_channel,short_channel_id,short_channel_id,
msgdata,gossipd_local_add_channel,remote_node_id,node_id,
msgdata,gossipd_local_add_channel,satoshis,amount_sat,
# Send this channel_update.
gossipd_local_channel_update,3504
gossipd_local_channel_update,,short_channel_id,struct short_channel_id
gossipd_local_channel_update,,disable,bool
gossipd_local_channel_update,,cltv_expiry_delta,u16
gossipd_local_channel_update,,htlc_minimum_msat,struct amount_msat
gossipd_local_channel_update,,fee_base_msat,u32
gossipd_local_channel_update,,fee_proportional_millionths,u32
gossipd_local_channel_update,,htlc_maximum_msat,struct amount_msat
msgtype,gossipd_local_channel_update,3504
msgdata,gossipd_local_channel_update,short_channel_id,short_channel_id,
msgdata,gossipd_local_channel_update,disable,bool,
msgdata,gossipd_local_channel_update,cltv_expiry_delta,u16,
msgdata,gossipd_local_channel_update,htlc_minimum_msat,amount_msat,
msgdata,gossipd_local_channel_update,fee_base_msat,u32,
msgdata,gossipd_local_channel_update,fee_proportional_millionths,u32,
msgdata,gossipd_local_channel_update,htlc_maximum_msat,amount_msat,
# Update your gossip_store fd: + gossip_store_fd
gossipd_new_store_fd,3505
msgtype,gossipd_new_store_fd,3505
# How much shorter the new store is, so you can offset streaming.
gossipd_new_store_fd,,offset_shorter,u64
msgdata,gossipd_new_store_fd,offset_shorter,u64,
1 # These must be distinct from WIRE_CHANNEL_ANNOUNCEMENT etc. gossip msgs!
2 # Channel daemon can ask for updates for a specific channel, for sending
3 # errors.
4 gossipd_get_update,3501 msgtype,gossipd_get_update,3501
5 gossipd_get_update,,short_channel_id,struct short_channel_id msgdata,gossipd_get_update,short_channel_id,short_channel_id,
6 # If channel isn't known, update will be empty.
7 gossipd_get_update_reply,3601 msgtype,gossipd_get_update_reply,3601
8 gossipd_get_update_reply,,len,u16 msgdata,gossipd_get_update_reply,len,u16,
9 gossipd_get_update_reply,,update,len*u8 msgdata,gossipd_get_update_reply,update,u8,len
10 # Both sides have seen the funding tx being locked, but we have not
11 # yet reached the announcement depth. So we add the channel locally so
12 # we (and peer) can update it already.
13 gossipd_local_add_channel,3503 msgtype,gossipd_local_add_channel,3503
14 gossipd_local_add_channel,,short_channel_id,struct short_channel_id msgdata,gossipd_local_add_channel,short_channel_id,short_channel_id,
15 gossipd_local_add_channel,,remote_node_id,struct node_id msgdata,gossipd_local_add_channel,remote_node_id,node_id,
16 gossipd_local_add_channel,,satoshis,struct amount_sat msgdata,gossipd_local_add_channel,satoshis,amount_sat,
17 # Send this channel_update.
18 gossipd_local_channel_update,3504 msgtype,gossipd_local_channel_update,3504
19 gossipd_local_channel_update,,short_channel_id,struct short_channel_id msgdata,gossipd_local_channel_update,short_channel_id,short_channel_id,
20 gossipd_local_channel_update,,disable,bool msgdata,gossipd_local_channel_update,disable,bool,
21 gossipd_local_channel_update,,cltv_expiry_delta,u16 msgdata,gossipd_local_channel_update,cltv_expiry_delta,u16,
22 gossipd_local_channel_update,,htlc_minimum_msat,struct amount_msat msgdata,gossipd_local_channel_update,htlc_minimum_msat,amount_msat,
23 gossipd_local_channel_update,,fee_base_msat,u32 msgdata,gossipd_local_channel_update,fee_base_msat,u32,
24 gossipd_local_channel_update,,fee_proportional_millionths,u32 msgdata,gossipd_local_channel_update,fee_proportional_millionths,u32,
25 gossipd_local_channel_update,,htlc_maximum_msat,struct amount_msat msgdata,gossipd_local_channel_update,htlc_maximum_msat,amount_msat,
26 # Update your gossip_store fd: + gossip_store_fd
27 gossipd_new_store_fd,3505 msgtype,gossipd_new_store_fd,3505
28 # How much shorter the new store is, so you can offset streaming.
29 gossipd_new_store_fd,,offset_shorter,u64 msgdata,gossipd_new_store_fd,offset_shorter,u64,
30
31
32
33

View File

@@ -3,9 +3,9 @@
# 256/257/258 or gossipd_local_add_channel (3503)
# This always follows the channel_announce.
gossip_store_channel_amount,4101
gossip_store_channel_amount,,satoshis,struct amount_sat
msgtype,gossip_store_channel_amount,4101
msgdata,gossip_store_channel_amount,satoshis,amount_sat,
gossip_store_private_update,4102
gossip_store_private_update,,len,u16
gossip_store_private_update,,update,len*u8
msgtype,gossip_store_private_update,4102
msgdata,gossip_store_private_update,len,u16,
msgdata,gossip_store_private_update,update,u8,len
1 # gossip_store messages: messages persisted in the gossip_store
3 # 256/257/258 or gossipd_local_add_channel (3503)
4 # This always follows the channel_announce.
5 gossip_store_channel_amount,4101 msgtype,gossip_store_channel_amount,4101
6 gossip_store_channel_amount,,satoshis,struct amount_sat msgdata,gossip_store_channel_amount,satoshis,amount_sat,
7 gossip_store_private_update,4102 msgtype,gossip_store_private_update,4102
8 gossip_store_private_update,,len,u16 msgdata,gossip_store_private_update,len,u16,
9 gossip_store_private_update,,update,len*u8 msgdata,gossip_store_private_update,update,u8,len
10
11

View File

@@ -3,160 +3,160 @@
#include <wire/gen_onion_wire.h>
# Initialize the gossip daemon.
gossipctl_init,3000
gossipctl_init,,chain_hash,struct bitcoin_blkid
gossipctl_init,,id,struct node_id
gossipctl_init,,gflen,u16
gossipctl_init,,globalfeatures,gflen*u8
gossipctl_init,,rgb,3*u8
gossipctl_init,,alias,32*u8
gossipctl_init,,update_channel_interval,u32
gossipctl_init,,num_announcable,u16
gossipctl_init,,announcable,num_announcable*struct wireaddr
gossipctl_init,,dev_gossip_time,?u32
msgtype,gossipctl_init,3000
msgdata,gossipctl_init,chain_hash,bitcoin_blkid,
msgdata,gossipctl_init,id,node_id,
msgdata,gossipctl_init,gflen,u16,
msgdata,gossipctl_init,globalfeatures,u8,gflen
msgdata,gossipctl_init,rgb,u8,3
msgdata,gossipctl_init,alias,u8,32
msgdata,gossipctl_init,update_channel_interval,u32,
msgdata,gossipctl_init,num_announcable,u16,
msgdata,gossipctl_init,announcable,wireaddr,num_announcable
msgdata,gossipctl_init,dev_gossip_time,?u32,
# Pass JSON-RPC getnodes call through
gossip_getnodes_request,3005
gossip_getnodes_request,,id,?struct node_id
msgtype,gossip_getnodes_request,3005
msgdata,gossip_getnodes_request,id,?node_id,
#include <lightningd/gossip_msg.h>
gossip_getnodes_reply,3105
gossip_getnodes_reply,,num_nodes,u32
gossip_getnodes_reply,,nodes,num_nodes*struct gossip_getnodes_entry
msgtype,gossip_getnodes_reply,3105
msgdata,gossip_getnodes_reply,num_nodes,u32,
msgdata,gossip_getnodes_reply,nodes,gossip_getnodes_entry,num_nodes
# Pass JSON-RPC getroute call through
gossip_getroute_request,3006
msgtype,gossip_getroute_request,3006
# Source defaults to "us", and means we don't consider first-hop channel fees
gossip_getroute_request,,source,?struct node_id
gossip_getroute_request,,destination,struct node_id
gossip_getroute_request,,msatoshi,struct amount_msat
# We don't pass doubles, so pass riskfactor * 1000000.
gossip_getroute_request,,riskfactor_by_million,u64
gossip_getroute_request,,final_cltv,u32
gossip_getroute_request,,fuzz,double
gossip_getroute_request,,num_excluded,u16
gossip_getroute_request,,excluded,num_excluded*struct short_channel_id_dir
gossip_getroute_request,,max_hops,u32
msgdata,gossip_getroute_request,source,?node_id,
msgdata,gossip_getroute_request,destination,node_id,
msgdata,gossip_getroute_request,msatoshi,amount_msat,
# We don't pass doubles, so pass riskfactor 1000000.
msgdata,gossip_getroute_request,riskfactor_by_million,u64,
msgdata,gossip_getroute_request,final_cltv,u32,
msgdata,gossip_getroute_request,fuzz,double,
msgdata,gossip_getroute_request,num_excluded,u16,
msgdata,gossip_getroute_request,excluded,short_channel_id_dir,num_excluded
msgdata,gossip_getroute_request,max_hops,u32,
gossip_getroute_reply,3106
gossip_getroute_reply,,num_hops,u16
gossip_getroute_reply,,hops,num_hops*struct route_hop
msgtype,gossip_getroute_reply,3106
msgdata,gossip_getroute_reply,num_hops,u16,
msgdata,gossip_getroute_reply,hops,route_hop,num_hops
gossip_getchannels_request,3007
gossip_getchannels_request,,short_channel_id,?struct short_channel_id
gossip_getchannels_request,,source,?struct node_id
gossip_getchannels_request,,prev,?struct short_channel_id
msgtype,gossip_getchannels_request,3007
msgdata,gossip_getchannels_request,short_channel_id,?short_channel_id,
msgdata,gossip_getchannels_request,source,?node_id,
msgdata,gossip_getchannels_request,prev,?short_channel_id,
gossip_getchannels_reply,3107
gossip_getchannels_reply,,complete,bool
gossip_getchannels_reply,,num_channels,u32
gossip_getchannels_reply,,nodes,num_channels*struct gossip_getchannels_entry
msgtype,gossip_getchannels_reply,3107
msgdata,gossip_getchannels_reply,complete,bool,
msgdata,gossip_getchannels_reply,num_channels,u32,
msgdata,gossip_getchannels_reply,nodes,gossip_getchannels_entry,num_channels
# Ping/pong test. Waits for a reply if it expects one.
gossip_ping,3008
gossip_ping,,id,struct node_id
gossip_ping,,num_pong_bytes,u16
gossip_ping,,len,u16
msgtype,gossip_ping,3008
msgdata,gossip_ping,id,node_id,
msgdata,gossip_ping,num_pong_bytes,u16,
msgdata,gossip_ping,len,u16,
gossip_ping_reply,3108
gossip_ping_reply,,id,struct node_id
msgtype,gossip_ping_reply,3108
msgdata,gossip_ping_reply,id,node_id,
# False if id in gossip_ping was unknown.
gossip_ping_reply,,sent,bool
msgdata,gossip_ping_reply,sent,bool,
# 0 == no pong expected
gossip_ping_reply,,totlen,u16
msgdata,gossip_ping_reply,totlen,u16,
# Test of query_short_channel_ids. Master->gossipd
gossip_query_scids,3031
gossip_query_scids,,id,struct node_id
gossip_query_scids,,num_ids,u16
gossip_query_scids,,ids,num_ids*struct short_channel_id
msgtype,gossip_query_scids,3031
msgdata,gossip_query_scids,id,node_id,
msgdata,gossip_query_scids,num_ids,u16,
msgdata,gossip_query_scids,ids,short_channel_id,num_ids
# Gossipd -> master
gossip_scids_reply,3131
gossip_scids_reply,,ok,bool
gossip_scids_reply,,complete,bool
msgtype,gossip_scids_reply,3131
msgdata,gossip_scids_reply,ok,bool,
msgdata,gossip_scids_reply,complete,bool,
# Test gossip timestamp filtering.
gossip_send_timestamp_filter,3028
gossip_send_timestamp_filter,,id,struct node_id
gossip_send_timestamp_filter,,first_timestamp,u32
gossip_send_timestamp_filter,,timestamp_range,u32
msgtype,gossip_send_timestamp_filter,3028
msgdata,gossip_send_timestamp_filter,id,node_id,
msgdata,gossip_send_timestamp_filter,first_timestamp,u32,
msgdata,gossip_send_timestamp_filter,timestamp_range,u32,
# Test of query_channel_range. Master->gossipd
gossip_query_channel_range,3029
gossip_query_channel_range,,id,struct node_id
gossip_query_channel_range,,first_blocknum,u32
gossip_query_channel_range,,number_of_blocks,u32
msgtype,gossip_query_channel_range,3029
msgdata,gossip_query_channel_range,id,node_id,
msgdata,gossip_query_channel_range,first_blocknum,u32,
msgdata,gossip_query_channel_range,number_of_blocks,u32,
# Gossipd -> master
gossip_query_channel_range_reply,3129
gossip_query_channel_range_reply,,final_first_block,u32
gossip_query_channel_range_reply,,final_num_blocks,u32
gossip_query_channel_range_reply,,final_complete,bool
gossip_query_channel_range_reply,,num,u16
gossip_query_channel_range_reply,,scids,num*struct short_channel_id
msgtype,gossip_query_channel_range_reply,3129
msgdata,gossip_query_channel_range_reply,final_first_block,u32,
msgdata,gossip_query_channel_range_reply,final_num_blocks,u32,
msgdata,gossip_query_channel_range_reply,final_complete,bool,
msgdata,gossip_query_channel_range_reply,num,u16,
msgdata,gossip_query_channel_range_reply,scids,short_channel_id,num
# Set artificial maximum reply_channel_range size. Master->gossipd
gossip_dev_set_max_scids_encode_size,3030
gossip_dev_set_max_scids_encode_size,,max,u32
msgtype,gossip_dev_set_max_scids_encode_size,3030
msgdata,gossip_dev_set_max_scids_encode_size,max,u32,
# Given a short_channel_id, return the other endpoint (or none if DNE)
gossip_get_channel_peer,3009
gossip_get_channel_peer,,channel_id,struct short_channel_id
msgtype,gossip_get_channel_peer,3009
msgdata,gossip_get_channel_peer,channel_id,short_channel_id,
gossip_get_channel_peer_reply,3109
gossip_get_channel_peer_reply,,peer_id,?struct node_id
msgtype,gossip_get_channel_peer_reply,3109
msgdata,gossip_get_channel_peer_reply,peer_id,?node_id,
# gossipd->master: we're closing this channel.
gossip_local_channel_close,3027
gossip_local_channel_close,,short_channel_id,struct short_channel_id
msgtype,gossip_local_channel_close,3027
msgdata,gossip_local_channel_close,short_channel_id,short_channel_id,
# Gossipd->master get this tx output please.
gossip_get_txout,3018
gossip_get_txout,,short_channel_id,struct short_channel_id
msgtype,gossip_get_txout,3018
msgdata,gossip_get_txout,short_channel_id,short_channel_id,
# master->gossipd here is the output, or empty if none.
gossip_get_txout_reply,3118
gossip_get_txout_reply,,short_channel_id,struct short_channel_id
gossip_get_txout_reply,,satoshis,struct amount_sat
gossip_get_txout_reply,,len,u16
gossip_get_txout_reply,,outscript,len*u8
msgtype,gossip_get_txout_reply,3118
msgdata,gossip_get_txout_reply,short_channel_id,short_channel_id,
msgdata,gossip_get_txout_reply,satoshis,amount_sat,
msgdata,gossip_get_txout_reply,len,u16,
msgdata,gossip_get_txout_reply,outscript,u8,len
# master->gossipd an htlc failed with this onion error.
gossip_payment_failure,3021
gossip_payment_failure,,erring_node,struct node_id
gossip_payment_failure,,erring_channel,struct short_channel_id
gossip_payment_failure,,erring_channel_direction,u8
gossip_payment_failure,,len,u16
gossip_payment_failure,,error,len*u8
msgtype,gossip_payment_failure,3021
msgdata,gossip_payment_failure,erring_node,node_id,
msgdata,gossip_payment_failure,erring_channel,short_channel_id,
msgdata,gossip_payment_failure,erring_channel_direction,u8,
msgdata,gossip_payment_failure,len,u16,
msgdata,gossip_payment_failure,error,u8,len
# master -> gossipd: a potential funding outpoint was spent, please forget the eventual channel
gossip_outpoint_spent,3024
gossip_outpoint_spent,,short_channel_id,struct short_channel_id
msgtype,gossip_outpoint_spent,3024
msgdata,gossip_outpoint_spent,short_channel_id,short_channel_id,
# master -> gossipd: stop gossip timers.
gossip_dev_suppress,3032
msgtype,gossip_dev_suppress,3032
# master -> gossipd: do you have a memleak?
gossip_dev_memleak,3033
msgtype,gossip_dev_memleak,3033
gossip_dev_memleak_reply,3133
gossip_dev_memleak_reply,,leak,bool
msgtype,gossip_dev_memleak_reply,3133
msgdata,gossip_dev_memleak_reply,leak,bool,
# master -> gossipd: please rewrite the gossip_store
gossip_dev_compact_store,3034
msgtype,gossip_dev_compact_store,3034
# gossipd -> master: ok
gossip_dev_compact_store_reply,3134
gossip_dev_compact_store_reply,,success,bool
msgtype,gossip_dev_compact_store_reply,3134
msgdata,gossip_dev_compact_store_reply,success,bool,
#include <common/bolt11.h>
# master -> gossipd: get route_info for our incoming channels
gossip_get_incoming_channels,3025
gossip_get_incoming_channels,,private_too,?bool
msgtype,gossip_get_incoming_channels,3025
msgdata,gossip_get_incoming_channels,private_too,?bool,
# gossipd -> master: here they are.
gossip_get_incoming_channels_reply,3125
gossip_get_incoming_channels_reply,,num,u16
gossip_get_incoming_channels_reply,,route_info,num*struct route_info
msgtype,gossip_get_incoming_channels_reply,3125
msgdata,gossip_get_incoming_channels_reply,num,u16,
msgdata,gossip_get_incoming_channels_reply,route_info,route_info,num
Can't render this file because it has a wrong number of fields in line 6.