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

@@ -184,8 +184,8 @@ ALL_GEN_HEADERS += gen_version.h
CDUMP_OBJS := ccan-cdump.o ccan-strmap.o
WIRE_GEN := tools/generate-wire.py
BOLT_GEN := tools/generate-bolts.py
WIRE_GEN := $(BOLT_GEN)
BOLT_DEPS := $(BOLT_GEN)
ALL_PROGRAMS =

View File

@@ -103,10 +103,10 @@ channeld/gen_full_channel_error_names.h: channeld/full_channel_error.h ccan/ccan
$(LIGHTNINGD_CHANNEL_OBJS): $(LIGHTNINGD_HEADERS) $(LIGHTNINGD_GOSSIP_CONTROL_HEADERS)
channeld/gen_channel_wire.h: $(WIRE_GEN) channeld/channel_wire.csv
$(WIRE_GEN) --header $@ channel_wire_type < channeld/channel_wire.csv > $@
$(WIRE_GEN) --page header $@ channel_wire_type < channeld/channel_wire.csv > $@
channeld/gen_channel_wire.c: $(WIRE_GEN) channeld/channel_wire.csv
$(WIRE_GEN) ${@:.c=.h} channel_wire_type < channeld/channel_wire.csv > $@
$(WIRE_GEN) --page impl ${@:.c=.h} channel_wire_type < channeld/channel_wire.csv > $@
LIGHTNINGD_CHANNEL_OBJS := $(LIGHTNINGD_CHANNEL_SRC:.c=.o)

View File

@@ -4,192 +4,192 @@
#include <common/per_peer_state.h>
# Begin! (passes gossipd-client fd)
channel_init,1000
channel_init,,chain_hash,struct bitcoin_blkid
channel_init,,funding_txid,struct bitcoin_txid
channel_init,,funding_txout,u16
channel_init,,funding_satoshi,struct amount_sat
channel_init,,minimum_depth,u32
channel_init,,our_config,struct channel_config
channel_init,,their_config,struct channel_config
# FIXME: Fix generate-wire.py to allow NUM_SIDES*u32 here.
channel_init,,feerate_per_kw,2*u32
channel_init,,feerate_min,u32
channel_init,,feerate_max,u32
channel_init,,first_commit_sig,struct bitcoin_signature
channel_init,,per_peer_state,struct per_peer_state
channel_init,,remote_fundingkey,struct pubkey
channel_init,,remote_basepoints,struct basepoints
channel_init,,remote_per_commit,struct pubkey
channel_init,,old_remote_per_commit,struct pubkey
channel_init,,funder,enum side
channel_init,,fee_base,u32
channel_init,,fee_proportional,u32
channel_init,,local_msatoshi,struct amount_msat
channel_init,,our_basepoints,struct basepoints
channel_init,,our_funding_pubkey,struct pubkey
channel_init,,local_node_id,struct node_id
channel_init,,remote_node_id,struct node_id
channel_init,,commit_msec,u32
channel_init,,cltv_delta,u16
channel_init,,last_was_revoke,bool
channel_init,,num_last_sent_commit,u16
channel_init,,last_sent_commit,num_last_sent_commit*struct changed_htlc
channel_init,,next_index_local,u64
channel_init,,next_index_remote,u64
channel_init,,revocations_received,u64
channel_init,,next_htlc_id,u64
channel_init,,num_htlcs,u16
channel_init,,htlcs,num_htlcs*struct added_htlc
channel_init,,htlc_states,num_htlcs*enum htlc_state
channel_init,,num_fulfilled,u16
channel_init,,fulfilled,num_fulfilled*struct fulfilled_htlc
channel_init,,fulfilled_sides,num_fulfilled*enum side
channel_init,,num_failed,u16
channel_init,,failed,num_failed*struct failed_htlc
channel_init,,failed_sides,num_failed*enum side
channel_init,,local_funding_locked,bool
channel_init,,remote_funding_locked,bool
channel_init,,funding_short_id,struct short_channel_id
channel_init,,reestablish,bool
channel_init,,send_shutdown,bool
channel_init,,remote_shutdown_received,bool
channel_init,,final_scriptpubkey_len,u16
channel_init,,final_scriptpubkey,final_scriptpubkey_len*u8
channel_init,,flags,u8
channel_init,,init_peer_pkt_len,u16
channel_init,,init_peer_pkt,init_peer_pkt_len*u8
channel_init,,reached_announce_depth,bool
channel_init,,last_remote_secret,struct secret
channel_init,,lflen,u16
channel_init,,localfeatures,lflen*u8
channel_init,,upfront_shutdown_script_len,u16
channel_init,,upfront_shutdown_script,upfront_shutdown_script_len*u8
channel_init,,remote_ann_node_sig,?secp256k1_ecdsa_signature
channel_init,,remote_ann_bitcoin_sig,?secp256k1_ecdsa_signature
msgtype,channel_init,1000
msgdata,channel_init,chain_hash,bitcoin_blkid,
msgdata,channel_init,funding_txid,bitcoin_txid,
msgdata,channel_init,funding_txout,u16,
msgdata,channel_init,funding_satoshi,amount_sat,
msgdata,channel_init,minimum_depth,u32,
msgdata,channel_init,our_config,channel_config,
msgdata,channel_init,their_config,channel_config,
# FIXME: Fix generate-wire.py to allow NUM_SIDES*u32 here.,
msgdata,channel_init,feerate_per_kw,u32,2
msgdata,channel_init,feerate_min,u32,
msgdata,channel_init,feerate_max,u32,
msgdata,channel_init,first_commit_sig,bitcoin_signature,
msgdata,channel_init,per_peer_state,per_peer_state,
msgdata,channel_init,remote_fundingkey,pubkey,
msgdata,channel_init,remote_basepoints,basepoints,
msgdata,channel_init,remote_per_commit,pubkey,
msgdata,channel_init,old_remote_per_commit,pubkey,
msgdata,channel_init,funder,e:side,
msgdata,channel_init,fee_base,u32,
msgdata,channel_init,fee_proportional,u32,
msgdata,channel_init,local_msatoshi,amount_msat,
msgdata,channel_init,our_basepoints,basepoints,
msgdata,channel_init,our_funding_pubkey,pubkey,
msgdata,channel_init,local_node_id,node_id,
msgdata,channel_init,remote_node_id,node_id,
msgdata,channel_init,commit_msec,u32,
msgdata,channel_init,cltv_delta,u16,
msgdata,channel_init,last_was_revoke,bool,
msgdata,channel_init,num_last_sent_commit,u16,
msgdata,channel_init,last_sent_commit,changed_htlc,num_last_sent_commit
msgdata,channel_init,next_index_local,u64,
msgdata,channel_init,next_index_remote,u64,
msgdata,channel_init,revocations_received,u64,
msgdata,channel_init,next_htlc_id,u64,
msgdata,channel_init,num_htlcs,u16,
msgdata,channel_init,htlcs,added_htlc,num_htlcs
msgdata,channel_init,htlc_states,e:htlc_state,num_htlcs
msgdata,channel_init,num_fulfilled,u16,
msgdata,channel_init,fulfilled,fulfilled_htlc,num_fulfilled
msgdata,channel_init,fulfilled_sides,e:side,num_fulfilled
msgdata,channel_init,num_failed,u16,
msgdata,channel_init,failed,failed_htlc,num_failed
msgdata,channel_init,failed_sides,e:side,num_failed
msgdata,channel_init,local_funding_locked,bool,
msgdata,channel_init,remote_funding_locked,bool,
msgdata,channel_init,funding_short_id,short_channel_id,
msgdata,channel_init,reestablish,bool,
msgdata,channel_init,send_shutdown,bool,
msgdata,channel_init,remote_shutdown_received,bool,
msgdata,channel_init,final_scriptpubkey_len,u16,
msgdata,channel_init,final_scriptpubkey,u8,final_scriptpubkey_len
msgdata,channel_init,flags,u8,
msgdata,channel_init,init_peer_pkt_len,u16,
msgdata,channel_init,init_peer_pkt,u8,init_peer_pkt_len
msgdata,channel_init,reached_announce_depth,bool,
msgdata,channel_init,last_remote_secret,secret,
msgdata,channel_init,lflen,u16,
msgdata,channel_init,localfeatures,u8,lflen
msgdata,channel_init,upfront_shutdown_script_len,u16,
msgdata,channel_init,upfront_shutdown_script,u8,upfront_shutdown_script_len
msgdata,channel_init,remote_ann_node_sig,?secp256k1_ecdsa_signature,
msgdata,channel_init,remote_ann_bitcoin_sig,?secp256k1_ecdsa_signature,
# master->channeld funding hit new depth(funding locked if >= lock depth)
channel_funding_depth,1002
channel_funding_depth,,short_channel_id,?struct short_channel_id
channel_funding_depth,,depth,u32
msgtype,channel_funding_depth,1002
msgdata,channel_funding_depth,short_channel_id,?short_channel_id,
msgdata,channel_funding_depth,depth,u32,
# Tell channel to offer this htlc
channel_offer_htlc,1004
channel_offer_htlc,,amount_msat,struct amount_msat
channel_offer_htlc,,cltv_expiry,u32
channel_offer_htlc,,payment_hash,struct sha256
channel_offer_htlc,,onion_routing_packet,1366*u8
msgtype,channel_offer_htlc,1004
msgdata,channel_offer_htlc,amount_msat,amount_msat,
msgdata,channel_offer_htlc,cltv_expiry,u32,
msgdata,channel_offer_htlc,payment_hash,sha256,
msgdata,channel_offer_htlc,onion_routing_packet,u8,1366
# Reply; synchronous since IDs have to increment.
channel_offer_htlc_reply,1104
channel_offer_htlc_reply,,id,u64
# Zero failure code means success.
channel_offer_htlc_reply,,failure_code,u16
channel_offer_htlc_reply,,failurestrlen,u16
channel_offer_htlc_reply,,failurestr,failurestrlen*u8
msgtype,channel_offer_htlc_reply,1104
msgdata,channel_offer_htlc_reply,id,u64,
# Zero failure code means success.,
msgdata,channel_offer_htlc_reply,failure_code,u16,
msgdata,channel_offer_htlc_reply,failurestrlen,u16,
msgdata,channel_offer_htlc_reply,failurestr,u8,failurestrlen
# Main daemon found out the preimage for an HTLC
#include <bitcoin/preimage.h>
channel_fulfill_htlc,1005
channel_fulfill_htlc,,fulfilled_htlc,struct fulfilled_htlc
msgtype,channel_fulfill_htlc,1005
msgdata,channel_fulfill_htlc,fulfilled_htlc,fulfilled_htlc,
# Main daemon says HTLC failed
channel_fail_htlc,1006
channel_fail_htlc,,failed_htlc,struct failed_htlc
msgtype,channel_fail_htlc,1006
msgdata,channel_fail_htlc,failed_htlc,failed_htlc,
# When we receive funding_locked.
channel_got_funding_locked,1019
channel_got_funding_locked,,next_per_commit_point,struct pubkey
msgtype,channel_got_funding_locked,1019
msgdata,channel_got_funding_locked,next_per_commit_point,pubkey,
# When we send a commitment_signed message, tell master.
channel_sending_commitsig,1020
channel_sending_commitsig,,commitnum,u64
channel_sending_commitsig,,feerate,u32
msgtype,channel_sending_commitsig,1020
msgdata,channel_sending_commitsig,commitnum,u64,
msgdata,channel_sending_commitsig,feerate,u32,
# SENT_ADD_COMMIT, SENT_REMOVE_ACK_COMMIT, SENT_ADD_ACK_COMMIT, SENT_REMOVE_COMMIT
channel_sending_commitsig,,num_changed,u16
channel_sending_commitsig,,changed,num_changed*struct changed_htlc
channel_sending_commitsig,,commit_sig,struct bitcoin_signature
channel_sending_commitsig,,num_htlc_sigs,u16
channel_sending_commitsig,,htlc_sigs,num_htlc_sigs*secp256k1_ecdsa_signature
msgdata,channel_sending_commitsig,num_changed,u16,
msgdata,channel_sending_commitsig,changed,changed_htlc,num_changed
msgdata,channel_sending_commitsig,commit_sig,bitcoin_signature,
msgdata,channel_sending_commitsig,num_htlc_sigs,u16,
msgdata,channel_sending_commitsig,htlc_sigs,secp256k1_ecdsa_signature,num_htlc_sigs
# Wait for reply, to make sure it's on disk before we send commit.
channel_sending_commitsig_reply,1120
msgtype,channel_sending_commitsig_reply,1120
# When we have a commitment_signed message, tell master to remember.
channel_got_commitsig,1021
channel_got_commitsig,,commitnum,u64
channel_got_commitsig,,feerate,u32
channel_got_commitsig,,signature,struct bitcoin_signature
channel_got_commitsig,,num_htlcs,u16
channel_got_commitsig,,htlc_signature,num_htlcs*secp256k1_ecdsa_signature
msgtype,channel_got_commitsig,1021
msgdata,channel_got_commitsig,commitnum,u64,
msgdata,channel_got_commitsig,feerate,u32,
msgdata,channel_got_commitsig,signature,bitcoin_signature,
msgdata,channel_got_commitsig,num_htlcs,u16,
msgdata,channel_got_commitsig,htlc_signature,secp256k1_ecdsa_signature,num_htlcs
# RCVD_ADD_COMMIT: we're now committed to their new offered HTLCs.
channel_got_commitsig,,num_added,u16
channel_got_commitsig,,added,num_added*struct added_htlc
channel_got_commitsig,,shared_secret,num_added*struct secret
msgdata,channel_got_commitsig,num_added,u16,
msgdata,channel_got_commitsig,added,added_htlc,num_added
msgdata,channel_got_commitsig,shared_secret,secret,num_added
# RCVD_REMOVE_COMMIT: we're now no longer committed to these HTLCs.
channel_got_commitsig,,num_fulfilled,u16
channel_got_commitsig,,fulfilled,num_fulfilled*struct fulfilled_htlc
channel_got_commitsig,,num_failed,u16
channel_got_commitsig,,failed,num_failed*struct failed_htlc
msgdata,channel_got_commitsig,num_fulfilled,u16,
msgdata,channel_got_commitsig,fulfilled,fulfilled_htlc,num_fulfilled
msgdata,channel_got_commitsig,num_failed,u16,
msgdata,channel_got_commitsig,failed,failed_htlc,num_failed
# RCVD_ADD_ACK_COMMIT, RCVD_REMOVE_ACK_COMMIT
channel_got_commitsig,,num_changed,u16
channel_got_commitsig,,changed,num_changed*struct changed_htlc
channel_got_commitsig,,tx,struct bitcoin_tx
msgdata,channel_got_commitsig,num_changed,u16,
msgdata,channel_got_commitsig,changed,changed_htlc,num_changed
msgdata,channel_got_commitsig,tx,bitcoin_tx,
# Wait for reply, to make sure it's on disk before we send revocation.
channel_got_commitsig_reply,1121
msgtype,channel_got_commitsig_reply,1121
#include <common/htlc_wire.h>
channel_got_revoke,1022
channel_got_revoke,,revokenum,u64
channel_got_revoke,,per_commitment_secret,struct secret
channel_got_revoke,,next_per_commit_point,struct pubkey
msgtype,channel_got_revoke,1022
msgdata,channel_got_revoke,revokenum,u64,
msgdata,channel_got_revoke,per_commitment_secret,secret,
msgdata,channel_got_revoke,next_per_commit_point,pubkey,
# RCVD_ADD_ACK_REVOCATION, RCVD_REMOVE_ACK_REVOCATION, RCVD_ADD_REVOCATION, RCVD_REMOVE_REVOCATION
channel_got_revoke,,feerate,u32
channel_got_revoke,,num_changed,u16
channel_got_revoke,,changed,num_changed*struct changed_htlc
msgdata,channel_got_revoke,feerate,u32,
msgdata,channel_got_revoke,num_changed,u16,
msgdata,channel_got_revoke,changed,changed_htlc,num_changed
# Wait for reply, to make sure it's on disk before we continue
# (eg. if we sent another commitment_signed, that would implicitly ack).
channel_got_revoke_reply,1122
msgtype,channel_got_revoke_reply,1122
# Tell peer to shut down channel.
channel_send_shutdown,1023
msgtype,channel_send_shutdown,1023
# Peer told us that channel is shutting down
channel_got_shutdown,1024
channel_got_shutdown,,scriptpubkey_len,u16
channel_got_shutdown,,scriptpubkey,scriptpubkey_len*u8
msgtype,channel_got_shutdown,1024
msgdata,channel_got_shutdown,scriptpubkey_len,u16,
msgdata,channel_got_shutdown,scriptpubkey,u8,scriptpubkey_len
# Shutdown is complete, ready for closing negotiation. + peer_fd & gossip_fd.
channel_shutdown_complete,1025
channel_shutdown_complete,,per_peer_state,struct per_peer_state
msgtype,channel_shutdown_complete,1025
msgdata,channel_shutdown_complete,per_peer_state,per_peer_state,
# Re-enable commit timer.
channel_dev_reenable_commit,1026
channel_dev_reenable_commit_reply,1126
msgtype,channel_dev_reenable_commit,1026
msgtype,channel_dev_reenable_commit_reply,1126,
channel_feerates,1027
channel_feerates,,feerate,u32
channel_feerates,,min_feerate,u32
channel_feerates,,max_feerate,u32
msgtype,channel_feerates,1027
msgdata,channel_feerates,feerate,u32,
msgdata,channel_feerates,min_feerate,u32,
msgdata,channel_feerates,max_feerate,u32,
# master -> channeld: do you have a memleak?
channel_dev_memleak,1033
msgtype,channel_dev_memleak,1033
channel_dev_memleak_reply,1133
channel_dev_memleak_reply,,leak,bool
msgtype,channel_dev_memleak_reply,1133
msgdata,channel_dev_memleak_reply,leak,bool,
# Peer presented proof it was from the future.
channel_fail_fallen_behind,1028
channel_fail_fallen_behind,,remote_per_commitment_point,struct pubkey
msgtype,channel_fail_fallen_behind,1028
msgdata,channel_fail_fallen_behind,remote_per_commitment_point,pubkey,
# Handle a channel specific feerate base ppm configuration
channel_specific_feerates,1029
channel_specific_feerates,,feerate_base,u32
channel_specific_feerates,,feerate_ppm,u32
msgtype,channel_specific_feerates,1029
msgdata,channel_specific_feerates,feerate_base,u32,
msgdata,channel_specific_feerates,feerate_ppm,u32,
# When we receive announcement_signatures for channel announce
channel_got_announcement,1017
channel_got_announcement,,remote_ann_node_sig,secp256k1_ecdsa_signature
channel_got_announcement,,remote_ann_bitcoin_sig,secp256k1_ecdsa_signature
msgtype,channel_got_announcement,1017
msgdata,channel_got_announcement,remote_ann_node_sig,secp256k1_ecdsa_signature,
msgdata,channel_got_announcement,remote_ann_bitcoin_sig,secp256k1_ecdsa_signature,
1 #include <common/cryptomsg.h>
4 #include <common/per_peer_state.h>
5 # Begin! (passes gossipd-client fd)
6 channel_init,1000 msgtype,channel_init,1000
7 channel_init,,chain_hash,struct bitcoin_blkid msgdata,channel_init,chain_hash,bitcoin_blkid,
8 channel_init,,funding_txid,struct bitcoin_txid msgdata,channel_init,funding_txid,bitcoin_txid,
9 channel_init,,funding_txout,u16 msgdata,channel_init,funding_txout,u16,
10 channel_init,,funding_satoshi,struct amount_sat msgdata,channel_init,funding_satoshi,amount_sat,
11 channel_init,,minimum_depth,u32 msgdata,channel_init,minimum_depth,u32,
12 channel_init,,our_config,struct channel_config msgdata,channel_init,our_config,channel_config,
13 channel_init,,their_config,struct channel_config msgdata,channel_init,their_config,channel_config,
14 # FIXME: Fix generate-wire.py to allow NUM_SIDES*u32 here. # FIXME: Fix generate-wire.py to allow NUM_SIDES*u32 here.,
15 channel_init,,feerate_per_kw,2*u32 msgdata,channel_init,feerate_per_kw,u32,2
16 channel_init,,feerate_min,u32 msgdata,channel_init,feerate_min,u32,
17 channel_init,,feerate_max,u32 msgdata,channel_init,feerate_max,u32,
18 channel_init,,first_commit_sig,struct bitcoin_signature msgdata,channel_init,first_commit_sig,bitcoin_signature,
19 channel_init,,per_peer_state,struct per_peer_state msgdata,channel_init,per_peer_state,per_peer_state,
20 channel_init,,remote_fundingkey,struct pubkey msgdata,channel_init,remote_fundingkey,pubkey,
21 channel_init,,remote_basepoints,struct basepoints msgdata,channel_init,remote_basepoints,basepoints,
22 channel_init,,remote_per_commit,struct pubkey msgdata,channel_init,remote_per_commit,pubkey,
23 channel_init,,old_remote_per_commit,struct pubkey msgdata,channel_init,old_remote_per_commit,pubkey,
24 channel_init,,funder,enum side msgdata,channel_init,funder,e:side,
25 channel_init,,fee_base,u32 msgdata,channel_init,fee_base,u32,
26 channel_init,,fee_proportional,u32 msgdata,channel_init,fee_proportional,u32,
27 channel_init,,local_msatoshi,struct amount_msat msgdata,channel_init,local_msatoshi,amount_msat,
28 channel_init,,our_basepoints,struct basepoints msgdata,channel_init,our_basepoints,basepoints,
29 channel_init,,our_funding_pubkey,struct pubkey msgdata,channel_init,our_funding_pubkey,pubkey,
30 channel_init,,local_node_id,struct node_id msgdata,channel_init,local_node_id,node_id,
31 channel_init,,remote_node_id,struct node_id msgdata,channel_init,remote_node_id,node_id,
32 channel_init,,commit_msec,u32 msgdata,channel_init,commit_msec,u32,
33 channel_init,,cltv_delta,u16 msgdata,channel_init,cltv_delta,u16,
34 channel_init,,last_was_revoke,bool msgdata,channel_init,last_was_revoke,bool,
35 channel_init,,num_last_sent_commit,u16 msgdata,channel_init,num_last_sent_commit,u16,
36 channel_init,,last_sent_commit,num_last_sent_commit*struct changed_htlc msgdata,channel_init,last_sent_commit,changed_htlc,num_last_sent_commit
37 channel_init,,next_index_local,u64 msgdata,channel_init,next_index_local,u64,
38 channel_init,,next_index_remote,u64 msgdata,channel_init,next_index_remote,u64,
39 channel_init,,revocations_received,u64 msgdata,channel_init,revocations_received,u64,
40 channel_init,,next_htlc_id,u64 msgdata,channel_init,next_htlc_id,u64,
41 channel_init,,num_htlcs,u16 msgdata,channel_init,num_htlcs,u16,
42 channel_init,,htlcs,num_htlcs*struct added_htlc msgdata,channel_init,htlcs,added_htlc,num_htlcs
43 channel_init,,htlc_states,num_htlcs*enum htlc_state msgdata,channel_init,htlc_states,e:htlc_state,num_htlcs
44 channel_init,,num_fulfilled,u16 msgdata,channel_init,num_fulfilled,u16,
45 channel_init,,fulfilled,num_fulfilled*struct fulfilled_htlc msgdata,channel_init,fulfilled,fulfilled_htlc,num_fulfilled
46 channel_init,,fulfilled_sides,num_fulfilled*enum side msgdata,channel_init,fulfilled_sides,e:side,num_fulfilled
47 channel_init,,num_failed,u16 msgdata,channel_init,num_failed,u16,
48 channel_init,,failed,num_failed*struct failed_htlc msgdata,channel_init,failed,failed_htlc,num_failed
49 channel_init,,failed_sides,num_failed*enum side msgdata,channel_init,failed_sides,e:side,num_failed
50 channel_init,,local_funding_locked,bool msgdata,channel_init,local_funding_locked,bool,
51 channel_init,,remote_funding_locked,bool msgdata,channel_init,remote_funding_locked,bool,
52 channel_init,,funding_short_id,struct short_channel_id msgdata,channel_init,funding_short_id,short_channel_id,
53 channel_init,,reestablish,bool msgdata,channel_init,reestablish,bool,
54 channel_init,,send_shutdown,bool msgdata,channel_init,send_shutdown,bool,
55 channel_init,,remote_shutdown_received,bool msgdata,channel_init,remote_shutdown_received,bool,
56 channel_init,,final_scriptpubkey_len,u16 msgdata,channel_init,final_scriptpubkey_len,u16,
57 channel_init,,final_scriptpubkey,final_scriptpubkey_len*u8 msgdata,channel_init,final_scriptpubkey,u8,final_scriptpubkey_len
58 channel_init,,flags,u8 msgdata,channel_init,flags,u8,
59 channel_init,,init_peer_pkt_len,u16 msgdata,channel_init,init_peer_pkt_len,u16,
60 channel_init,,init_peer_pkt,init_peer_pkt_len*u8 msgdata,channel_init,init_peer_pkt,u8,init_peer_pkt_len
61 channel_init,,reached_announce_depth,bool msgdata,channel_init,reached_announce_depth,bool,
62 channel_init,,last_remote_secret,struct secret msgdata,channel_init,last_remote_secret,secret,
63 channel_init,,lflen,u16 msgdata,channel_init,lflen,u16,
64 channel_init,,localfeatures,lflen*u8 msgdata,channel_init,localfeatures,u8,lflen
65 channel_init,,upfront_shutdown_script_len,u16 msgdata,channel_init,upfront_shutdown_script_len,u16,
66 channel_init,,upfront_shutdown_script,upfront_shutdown_script_len*u8 msgdata,channel_init,upfront_shutdown_script,u8,upfront_shutdown_script_len
67 channel_init,,remote_ann_node_sig,?secp256k1_ecdsa_signature msgdata,channel_init,remote_ann_node_sig,?secp256k1_ecdsa_signature,
68 channel_init,,remote_ann_bitcoin_sig,?secp256k1_ecdsa_signature msgdata,channel_init,remote_ann_bitcoin_sig,?secp256k1_ecdsa_signature,
69 # master->channeld funding hit new depth(funding locked if >= lock depth)
70 channel_funding_depth,1002 msgtype,channel_funding_depth,1002
71 channel_funding_depth,,short_channel_id,?struct short_channel_id msgdata,channel_funding_depth,short_channel_id,?short_channel_id,
72 channel_funding_depth,,depth,u32 msgdata,channel_funding_depth,depth,u32,
73 # Tell channel to offer this htlc
74 channel_offer_htlc,1004 msgtype,channel_offer_htlc,1004
75 channel_offer_htlc,,amount_msat,struct amount_msat msgdata,channel_offer_htlc,amount_msat,amount_msat,
76 channel_offer_htlc,,cltv_expiry,u32 msgdata,channel_offer_htlc,cltv_expiry,u32,
77 channel_offer_htlc,,payment_hash,struct sha256 msgdata,channel_offer_htlc,payment_hash,sha256,
78 channel_offer_htlc,,onion_routing_packet,1366*u8 msgdata,channel_offer_htlc,onion_routing_packet,u8,1366
79 # Reply; synchronous since IDs have to increment.
80 channel_offer_htlc_reply,1104 msgtype,channel_offer_htlc_reply,1104
81 channel_offer_htlc_reply,,id,u64 msgdata,channel_offer_htlc_reply,id,u64,
82 # Zero failure code means success. # Zero failure code means success.,
83 channel_offer_htlc_reply,,failure_code,u16 msgdata,channel_offer_htlc_reply,failure_code,u16,
84 channel_offer_htlc_reply,,failurestrlen,u16 msgdata,channel_offer_htlc_reply,failurestrlen,u16,
85 channel_offer_htlc_reply,,failurestr,failurestrlen*u8 msgdata,channel_offer_htlc_reply,failurestr,u8,failurestrlen
86 # Main daemon found out the preimage for an HTLC
87 #include <bitcoin/preimage.h>
88 channel_fulfill_htlc,1005 msgtype,channel_fulfill_htlc,1005
89 channel_fulfill_htlc,,fulfilled_htlc,struct fulfilled_htlc msgdata,channel_fulfill_htlc,fulfilled_htlc,fulfilled_htlc,
90 # Main daemon says HTLC failed
91 channel_fail_htlc,1006 msgtype,channel_fail_htlc,1006
92 channel_fail_htlc,,failed_htlc,struct failed_htlc msgdata,channel_fail_htlc,failed_htlc,failed_htlc,
93 # When we receive funding_locked.
94 channel_got_funding_locked,1019 msgtype,channel_got_funding_locked,1019
95 channel_got_funding_locked,,next_per_commit_point,struct pubkey msgdata,channel_got_funding_locked,next_per_commit_point,pubkey,
96 # When we send a commitment_signed message, tell master.
97 channel_sending_commitsig,1020 msgtype,channel_sending_commitsig,1020
98 channel_sending_commitsig,,commitnum,u64 msgdata,channel_sending_commitsig,commitnum,u64,
99 channel_sending_commitsig,,feerate,u32 msgdata,channel_sending_commitsig,feerate,u32,
100 # SENT_ADD_COMMIT, SENT_REMOVE_ACK_COMMIT, SENT_ADD_ACK_COMMIT, SENT_REMOVE_COMMIT
101 channel_sending_commitsig,,num_changed,u16 msgdata,channel_sending_commitsig,num_changed,u16,
102 channel_sending_commitsig,,changed,num_changed*struct changed_htlc msgdata,channel_sending_commitsig,changed,changed_htlc,num_changed
103 channel_sending_commitsig,,commit_sig,struct bitcoin_signature msgdata,channel_sending_commitsig,commit_sig,bitcoin_signature,
104 channel_sending_commitsig,,num_htlc_sigs,u16 msgdata,channel_sending_commitsig,num_htlc_sigs,u16,
105 channel_sending_commitsig,,htlc_sigs,num_htlc_sigs*secp256k1_ecdsa_signature msgdata,channel_sending_commitsig,htlc_sigs,secp256k1_ecdsa_signature,num_htlc_sigs
106 # Wait for reply, to make sure it's on disk before we send commit.
107 channel_sending_commitsig_reply,1120 msgtype,channel_sending_commitsig_reply,1120
108 # When we have a commitment_signed message, tell master to remember.
109 channel_got_commitsig,1021 msgtype,channel_got_commitsig,1021
110 channel_got_commitsig,,commitnum,u64 msgdata,channel_got_commitsig,commitnum,u64,
111 channel_got_commitsig,,feerate,u32 msgdata,channel_got_commitsig,feerate,u32,
112 channel_got_commitsig,,signature,struct bitcoin_signature msgdata,channel_got_commitsig,signature,bitcoin_signature,
113 channel_got_commitsig,,num_htlcs,u16 msgdata,channel_got_commitsig,num_htlcs,u16,
114 channel_got_commitsig,,htlc_signature,num_htlcs*secp256k1_ecdsa_signature msgdata,channel_got_commitsig,htlc_signature,secp256k1_ecdsa_signature,num_htlcs
115 # RCVD_ADD_COMMIT: we're now committed to their new offered HTLCs.
116 channel_got_commitsig,,num_added,u16 msgdata,channel_got_commitsig,num_added,u16,
117 channel_got_commitsig,,added,num_added*struct added_htlc msgdata,channel_got_commitsig,added,added_htlc,num_added
118 channel_got_commitsig,,shared_secret,num_added*struct secret msgdata,channel_got_commitsig,shared_secret,secret,num_added
119 # RCVD_REMOVE_COMMIT: we're now no longer committed to these HTLCs.
120 channel_got_commitsig,,num_fulfilled,u16 msgdata,channel_got_commitsig,num_fulfilled,u16,
121 channel_got_commitsig,,fulfilled,num_fulfilled*struct fulfilled_htlc msgdata,channel_got_commitsig,fulfilled,fulfilled_htlc,num_fulfilled
122 channel_got_commitsig,,num_failed,u16 msgdata,channel_got_commitsig,num_failed,u16,
123 channel_got_commitsig,,failed,num_failed*struct failed_htlc msgdata,channel_got_commitsig,failed,failed_htlc,num_failed
124 # RCVD_ADD_ACK_COMMIT, RCVD_REMOVE_ACK_COMMIT
125 channel_got_commitsig,,num_changed,u16 msgdata,channel_got_commitsig,num_changed,u16,
126 channel_got_commitsig,,changed,num_changed*struct changed_htlc msgdata,channel_got_commitsig,changed,changed_htlc,num_changed
127 channel_got_commitsig,,tx,struct bitcoin_tx msgdata,channel_got_commitsig,tx,bitcoin_tx,
128 # Wait for reply, to make sure it's on disk before we send revocation.
129 channel_got_commitsig_reply,1121 msgtype,channel_got_commitsig_reply,1121
130 #include <common/htlc_wire.h>
131 channel_got_revoke,1022 msgtype,channel_got_revoke,1022
132 channel_got_revoke,,revokenum,u64 msgdata,channel_got_revoke,revokenum,u64,
133 channel_got_revoke,,per_commitment_secret,struct secret msgdata,channel_got_revoke,per_commitment_secret,secret,
134 channel_got_revoke,,next_per_commit_point,struct pubkey msgdata,channel_got_revoke,next_per_commit_point,pubkey,
135 # RCVD_ADD_ACK_REVOCATION, RCVD_REMOVE_ACK_REVOCATION, RCVD_ADD_REVOCATION, RCVD_REMOVE_REVOCATION
136 channel_got_revoke,,feerate,u32 msgdata,channel_got_revoke,feerate,u32,
137 channel_got_revoke,,num_changed,u16 msgdata,channel_got_revoke,num_changed,u16,
138 channel_got_revoke,,changed,num_changed*struct changed_htlc msgdata,channel_got_revoke,changed,changed_htlc,num_changed
139 # Wait for reply, to make sure it's on disk before we continue
140 # (eg. if we sent another commitment_signed, that would implicitly ack).
141 channel_got_revoke_reply,1122 msgtype,channel_got_revoke_reply,1122
142 # Tell peer to shut down channel.
143 channel_send_shutdown,1023 msgtype,channel_send_shutdown,1023
144 # Peer told us that channel is shutting down
145 channel_got_shutdown,1024 msgtype,channel_got_shutdown,1024
146 channel_got_shutdown,,scriptpubkey_len,u16 msgdata,channel_got_shutdown,scriptpubkey_len,u16,
147 channel_got_shutdown,,scriptpubkey,scriptpubkey_len*u8 msgdata,channel_got_shutdown,scriptpubkey,u8,scriptpubkey_len
148 # Shutdown is complete, ready for closing negotiation. + peer_fd & gossip_fd.
149 channel_shutdown_complete,1025 msgtype,channel_shutdown_complete,1025
150 channel_shutdown_complete,,per_peer_state,struct per_peer_state msgdata,channel_shutdown_complete,per_peer_state,per_peer_state,
151 # Re-enable commit timer.
152 channel_dev_reenable_commit,1026 msgtype,channel_dev_reenable_commit,1026
153 channel_dev_reenable_commit_reply,1126 msgtype,channel_dev_reenable_commit_reply,1126,
154 channel_feerates,1027 msgtype,channel_feerates,1027
155 channel_feerates,,feerate,u32 msgdata,channel_feerates,feerate,u32,
156 channel_feerates,,min_feerate,u32 msgdata,channel_feerates,min_feerate,u32,
157 channel_feerates,,max_feerate,u32 msgdata,channel_feerates,max_feerate,u32,
158 # master -> channeld: do you have a memleak?
159 channel_dev_memleak,1033 msgtype,channel_dev_memleak,1033
160 channel_dev_memleak_reply,1133 msgtype,channel_dev_memleak_reply,1133
161 channel_dev_memleak_reply,,leak,bool msgdata,channel_dev_memleak_reply,leak,bool,
162 # Peer presented proof it was from the future.
163 channel_fail_fallen_behind,1028 msgtype,channel_fail_fallen_behind,1028
164 channel_fail_fallen_behind,,remote_per_commitment_point,struct pubkey msgdata,channel_fail_fallen_behind,remote_per_commitment_point,pubkey,
165 # Handle a channel specific feerate base ppm configuration
166 channel_specific_feerates,1029 msgtype,channel_specific_feerates,1029
167 channel_specific_feerates,,feerate_base,u32 msgdata,channel_specific_feerates,feerate_base,u32,
168 channel_specific_feerates,,feerate_ppm,u32 msgdata,channel_specific_feerates,feerate_ppm,u32,
169 # When we receive announcement_signatures for channel announce
170 channel_got_announcement,1017 msgtype,channel_got_announcement,1017
171 channel_got_announcement,,remote_ann_node_sig,secp256k1_ecdsa_signature msgdata,channel_got_announcement,remote_ann_node_sig,secp256k1_ecdsa_signature,
172 channel_got_announcement,,remote_ann_bitcoin_sig,secp256k1_ecdsa_signature msgdata,channel_got_announcement,remote_ann_bitcoin_sig,secp256k1_ecdsa_signature,
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195

View File

@@ -80,10 +80,10 @@ CLOSINGD_COMMON_OBJS := \
hsmd/gen_hsm_wire.o
closingd/gen_closing_wire.h: $(WIRE_GEN) closingd/closing_wire.csv
$(WIRE_GEN) --header $@ closing_wire_type < closingd/closing_wire.csv > $@
$(WIRE_GEN) --page header $@ closing_wire_type < closingd/closing_wire.csv > $@
closingd/gen_closing_wire.c: $(WIRE_GEN) closingd/closing_wire.csv
$(WIRE_GEN) ${@:.c=.h} closing_wire_type < closingd/closing_wire.csv > $@
$(WIRE_GEN) --page impl ${@:.c=.h} closing_wire_type < closingd/closing_wire.csv > $@
LIGHTNINGD_CLOSING_OBJS := $(LIGHTNINGD_CLOSING_SRC:.c=.o) $(LIGHTNINGD_CLOSING_GEN_SRC:.c=.o)

View File

@@ -2,41 +2,41 @@
#include <common/htlc_wire.h>
#include <common/per_peer_state.h>
# Begin! (passes peer fd, gossipd-client fd)
closing_init,2001
closing_init,,pps,struct per_peer_state
closing_init,,funding_txid,struct bitcoin_txid
closing_init,,funding_txout,u16
closing_init,,funding_satoshi,struct amount_sat
closing_init,,local_fundingkey,struct pubkey
closing_init,,remote_fundingkey,struct pubkey
closing_init,,funder,enum side
closing_init,,local_sat,struct amount_sat
closing_init,,remote_sat,struct amount_sat
closing_init,,our_dust_limit,struct amount_sat
closing_init,,min_fee_satoshi,struct amount_sat
closing_init,,fee_limit_satoshi,struct amount_sat
closing_init,,initial_fee_satoshi,struct amount_sat
closing_init,,local_scriptpubkey_len,u16
closing_init,,local_scriptpubkey,local_scriptpubkey_len*u8
closing_init,,remote_scriptpubkey_len,u16
closing_init,,remote_scriptpubkey,remote_scriptpubkey_len*u8
closing_init,,reconnected,bool
closing_init,,next_index_local,u64
closing_init,,next_index_remote,u64
closing_init,,revocations_received,u64
closing_init,,channel_reestablish_len,u16
closing_init,,channel_reestablish,channel_reestablish_len*u8
closing_init,,final_scriptpubkey_len,u16
closing_init,,final_scriptpubkey,final_scriptpubkey_len*u8
closing_init,,last_remote_secret,struct secret
msgtype,closing_init,2001
msgdata,closing_init,pps,per_peer_state,
msgdata,closing_init,funding_txid,bitcoin_txid,
msgdata,closing_init,funding_txout,u16,
msgdata,closing_init,funding_satoshi,amount_sat,
msgdata,closing_init,local_fundingkey,pubkey,
msgdata,closing_init,remote_fundingkey,pubkey,
msgdata,closing_init,funder,e:side,
msgdata,closing_init,local_sat,amount_sat,
msgdata,closing_init,remote_sat,amount_sat,
msgdata,closing_init,our_dust_limit,amount_sat,
msgdata,closing_init,min_fee_satoshi,amount_sat,
msgdata,closing_init,fee_limit_satoshi,amount_sat,
msgdata,closing_init,initial_fee_satoshi,amount_sat,
msgdata,closing_init,local_scriptpubkey_len,u16,
msgdata,closing_init,local_scriptpubkey,u8,local_scriptpubkey_len
msgdata,closing_init,remote_scriptpubkey_len,u16,
msgdata,closing_init,remote_scriptpubkey,u8,remote_scriptpubkey_len
msgdata,closing_init,reconnected,bool,
msgdata,closing_init,next_index_local,u64,
msgdata,closing_init,next_index_remote,u64,
msgdata,closing_init,revocations_received,u64,
msgdata,closing_init,channel_reestablish_len,u16,
msgdata,closing_init,channel_reestablish,u8,channel_reestablish_len
msgdata,closing_init,final_scriptpubkey_len,u16,
msgdata,closing_init,final_scriptpubkey,u8,final_scriptpubkey_len
msgdata,closing_init,last_remote_secret,secret,
# We received an offer, save signature.
closing_received_signature,2002
closing_received_signature,,signature,struct bitcoin_signature
closing_received_signature,,tx,struct bitcoin_tx
msgtype,closing_received_signature,2002
msgdata,closing_received_signature,signature,bitcoin_signature,
msgdata,closing_received_signature,tx,bitcoin_tx,
closing_received_signature_reply,2102
closing_received_signature_reply,,closing_txid,struct bitcoin_txid
msgtype,closing_received_signature_reply,2102
msgdata,closing_received_signature_reply,closing_txid,bitcoin_txid,
# Negotiations complete, we're exiting.
closing_complete,2004
msgtype,closing_complete,2004
1 #include <common/cryptomsg.h>
2 #include <common/htlc_wire.h>
3 #include <common/per_peer_state.h>
4 # Begin! (passes peer fd, gossipd-client fd)
5 closing_init,2001 msgtype,closing_init,2001
6 closing_init,,pps,struct per_peer_state msgdata,closing_init,pps,per_peer_state,
7 closing_init,,funding_txid,struct bitcoin_txid msgdata,closing_init,funding_txid,bitcoin_txid,
8 closing_init,,funding_txout,u16 msgdata,closing_init,funding_txout,u16,
9 closing_init,,funding_satoshi,struct amount_sat msgdata,closing_init,funding_satoshi,amount_sat,
10 closing_init,,local_fundingkey,struct pubkey msgdata,closing_init,local_fundingkey,pubkey,
11 closing_init,,remote_fundingkey,struct pubkey msgdata,closing_init,remote_fundingkey,pubkey,
12 closing_init,,funder,enum side msgdata,closing_init,funder,e:side,
13 closing_init,,local_sat,struct amount_sat msgdata,closing_init,local_sat,amount_sat,
14 closing_init,,remote_sat,struct amount_sat msgdata,closing_init,remote_sat,amount_sat,
15 closing_init,,our_dust_limit,struct amount_sat msgdata,closing_init,our_dust_limit,amount_sat,
16 closing_init,,min_fee_satoshi,struct amount_sat msgdata,closing_init,min_fee_satoshi,amount_sat,
17 closing_init,,fee_limit_satoshi,struct amount_sat msgdata,closing_init,fee_limit_satoshi,amount_sat,
18 closing_init,,initial_fee_satoshi,struct amount_sat msgdata,closing_init,initial_fee_satoshi,amount_sat,
19 closing_init,,local_scriptpubkey_len,u16 msgdata,closing_init,local_scriptpubkey_len,u16,
20 closing_init,,local_scriptpubkey,local_scriptpubkey_len*u8 msgdata,closing_init,local_scriptpubkey,u8,local_scriptpubkey_len
21 closing_init,,remote_scriptpubkey_len,u16 msgdata,closing_init,remote_scriptpubkey_len,u16,
22 closing_init,,remote_scriptpubkey,remote_scriptpubkey_len*u8 msgdata,closing_init,remote_scriptpubkey,u8,remote_scriptpubkey_len
23 closing_init,,reconnected,bool msgdata,closing_init,reconnected,bool,
24 closing_init,,next_index_local,u64 msgdata,closing_init,next_index_local,u64,
25 closing_init,,next_index_remote,u64 msgdata,closing_init,next_index_remote,u64,
26 closing_init,,revocations_received,u64 msgdata,closing_init,revocations_received,u64,
27 closing_init,,channel_reestablish_len,u16 msgdata,closing_init,channel_reestablish_len,u16,
28 closing_init,,channel_reestablish,channel_reestablish_len*u8 msgdata,closing_init,channel_reestablish,u8,channel_reestablish_len
29 closing_init,,final_scriptpubkey_len,u16 msgdata,closing_init,final_scriptpubkey_len,u16,
30 closing_init,,final_scriptpubkey,final_scriptpubkey_len*u8 msgdata,closing_init,final_scriptpubkey,u8,final_scriptpubkey_len
31 closing_init,,last_remote_secret,struct secret msgdata,closing_init,last_remote_secret,secret,
32 # We received an offer, save signature.
33 closing_received_signature,2002 msgtype,closing_received_signature,2002
34 closing_received_signature,,signature,struct bitcoin_signature msgdata,closing_received_signature,signature,bitcoin_signature,
35 closing_received_signature,,tx,struct bitcoin_tx msgdata,closing_received_signature,tx,bitcoin_tx,
36 closing_received_signature_reply,2102 msgtype,closing_received_signature_reply,2102
37 closing_received_signature_reply,,closing_txid,struct bitcoin_txid msgdata,closing_received_signature_reply,closing_txid,bitcoin_txid,
38 # Negotiations complete, we're exiting.
39 closing_complete,2004 msgtype,closing_complete,2004
40
41
42

View File

@@ -80,16 +80,16 @@ common/gen_htlc_state_names.h: common/htlc_state.h ccan/ccan/cdump/tools/cdump-e
ccan/ccan/cdump/tools/cdump-enumstr common/htlc_state.h > $@
common/gen_status_wire.h: $(WIRE_GEN) common/status_wire.csv
$(WIRE_GEN) --header $@ status < common/status_wire.csv > $@
$(WIRE_GEN) --page header $@ status < common/status_wire.csv > $@
common/gen_status_wire.c: $(WIRE_GEN) common/status_wire.csv
$(WIRE_GEN) ${@:.c=.h} status < common/status_wire.csv > $@
$(WIRE_GEN) --page impl ${@:.c=.h} status < common/status_wire.csv > $@
common/gen_peer_status_wire.h: $(WIRE_GEN) common/peer_status_wire.csv
$(WIRE_GEN) --header $@ peer_status < common/peer_status_wire.csv > $@
$(WIRE_GEN) --page header $@ peer_status < common/peer_status_wire.csv > $@
common/gen_peer_status_wire.c: $(WIRE_GEN) common/peer_status_wire.csv
$(WIRE_GEN) ${@:.c=.h} peer_status < common/peer_status_wire.csv > $@
$(WIRE_GEN) --page impl ${@:.c=.h} peer_status < common/peer_status_wire.csv > $@
check-makefile: check-common-makefile

View File

@@ -1,10 +1,10 @@
#include <common/per_peer_state.h>
# An error occurred: if error_for_them, that to go to them.
status_peer_error,0xFFF4
msgtype,status_peer_error,0xFFF4
# This is implied if error_for_them, but master tries not to parse packets.
status_peer_error,,channel,struct channel_id
status_peer_error,,desc,wirestring
status_peer_error,,pps,struct per_peer_state
status_peer_error,,len,u16
status_peer_error,,error_for_them,len*u8
msgdata,status_peer_error,channel,channel_id,
msgdata,status_peer_error,desc,wirestring,
msgdata,status_peer_error,pps,per_peer_state,
msgdata,status_peer_error,len,u16,
msgdata,status_peer_error,error_for_them,u8,len
1 #include <common/per_peer_state.h>
2 # An error occurred: if error_for_them, that to go to them.
3 status_peer_error,0xFFF4 msgtype,status_peer_error,0xFFF4
4 # This is implied if error_for_them, but master tries not to parse packets.
5 status_peer_error,,channel,struct channel_id msgdata,status_peer_error,channel,channel_id,
6 status_peer_error,,desc,wirestring msgdata,status_peer_error,desc,wirestring,
7 status_peer_error,,pps,struct per_peer_state msgdata,status_peer_error,pps,per_peer_state,
8 status_peer_error,,len,u16 msgdata,status_peer_error,len,u16,
9 status_peer_error,,error_for_them,len*u8 msgdata,status_peer_error,error_for_them,u8,len
10

View File

@@ -1,23 +1,23 @@
#include <common/per_peer_state.h>
#include <common/status_wire.h>
status_log,0xFFF0
status_log,,level,enum log_level
status_log,,entry,wirestring
msgtype,status_log,0xFFF0
msgdata,status_log,level,e:log_level,
msgdata,status_log,entry,wirestring,
status_io,0xFFF1
status_io,,iodir,enum log_level
status_io,,who,wirestring
status_io,,len,u16
status_io,,data,len*u8
msgtype,status_io,0xFFF1
msgdata,status_io,iodir,e:log_level,
msgdata,status_io,who,wirestring,
msgdata,status_io,len,u16,
msgdata,status_io,data,u8,len
status_fail,0xFFF2
status_fail,,failreason,enum status_failreason
status_fail,,desc,wirestring
msgtype,status_fail,0xFFF2
msgdata,status_fail,failreason,e:status_failreason,
msgdata,status_fail,desc,wirestring,
status_peer_connection_lost,0xFFF3
msgtype,status_peer_connection_lost,0xFFF3
status_peer_billboard,0xFFF5
status_peer_billboard,,perm,bool
status_peer_billboard,,happenings,wirestring
msgtype,status_peer_billboard,0xFFF5
msgdata,status_peer_billboard,perm,bool,
msgdata,status_peer_billboard,happenings,wirestring,
# Note: 0xFFFF is reserved for MSG_PASS_FD!
1 #include <common/per_peer_state.h>
2 #include <common/status_wire.h>
3 status_log,0xFFF0 msgtype,status_log,0xFFF0
4 status_log,,level,enum log_level msgdata,status_log,level,e:log_level,
5 status_log,,entry,wirestring msgdata,status_log,entry,wirestring,
6 status_io,0xFFF1 msgtype,status_io,0xFFF1
7 status_io,,iodir,enum log_level msgdata,status_io,iodir,e:log_level,
8 status_io,,who,wirestring msgdata,status_io,who,wirestring,
9 status_io,,len,u16 msgdata,status_io,len,u16,
10 status_io,,data,len*u8 msgdata,status_io,data,u8,len
11 status_fail,0xFFF2 msgtype,status_fail,0xFFF2
12 status_fail,,failreason,enum status_failreason msgdata,status_fail,failreason,e:status_failreason,
13 status_fail,,desc,wirestring msgdata,status_fail,desc,wirestring,
14 status_peer_connection_lost,0xFFF3 msgtype,status_peer_connection_lost,0xFFF3
15 status_peer_billboard,0xFFF5 msgtype,status_peer_billboard,0xFFF5
16 status_peer_billboard,,perm,bool msgdata,status_peer_billboard,perm,bool,
17 status_peer_billboard,,happenings,wirestring msgdata,status_peer_billboard,happenings,wirestring,
18 # Note: 0xFFFF is reserved for MSG_PASS_FD!
19
20
21
22
23

View File

@@ -80,16 +80,16 @@ connectd-all: lightningd/lightning_connectd
lightningd/lightning_connectd: $(LIGHTNINGD_CONNECT_OBJS) $(CONNECTD_COMMON_OBJS) $(BITCOIN_OBJS) $(WIRE_OBJS)
connectd/gen_connect_wire.h: $(WIRE_GEN) connectd/connect_wire.csv
$(WIRE_GEN) --header $@ connect_wire_type < connectd/connect_wire.csv > $@
$(WIRE_GEN) --page header $@ connect_wire_type < connectd/connect_wire.csv > $@
connectd/gen_connect_wire.c: $(WIRE_GEN) connectd/connect_wire.csv
$(WIRE_GEN) ${@:.c=.h} connect_wire_type < connectd/connect_wire.csv > $@
$(WIRE_GEN) --page impl ${@:.c=.h} connect_wire_type < connectd/connect_wire.csv > $@
connectd/gen_connect_gossip_wire.h: $(WIRE_GEN) connectd/connect_gossip_wire.csv
$(WIRE_GEN) --header $@ connect_gossip_wire_type < connectd/connect_gossip_wire.csv > $@
$(WIRE_GEN) --page header $@ connect_gossip_wire_type < connectd/connect_gossip_wire.csv > $@
connectd/gen_connect_gossip_wire.c: $(WIRE_GEN) connectd/connect_gossip_wire.csv
$(WIRE_GEN) ${@:.c=.h} connect_gossip_wire_type < connectd/connect_gossip_wire.csv > $@
$(WIRE_GEN) --page impl ${@:.c=.h} connect_gossip_wire_type < connectd/connect_gossip_wire.csv > $@
check-source: $(LIGHTNINGD_CONNECT_ALLSRC_NOGEN:%=check-src-include-order/%) $(LIGHTNINGD_CONNECT_ALLHEADERS_NOGEN:%=check-hdr-include-order/%)
check-source-bolt: $(LIGHTNINGD_CONNECT_SRC:%=bolt-check/%) $(LIGHTNINGD_CONNECT_HEADERS:%=bolt-check/%)

View File

@@ -2,22 +2,22 @@
#include <common/wireaddr.h>
# Communication between gossipd and connectd.
gossip_new_peer,4000
gossip_new_peer,,id,struct node_id
msgtype,gossip_new_peer,4000
msgdata,gossip_new_peer,id,node_id,
# Did we negotiate LOCAL_GOSSIP_QUERIES?
gossip_new_peer,,gossip_queries_feature,bool
msgdata,gossip_new_peer,gossip_queries_feature,bool,
# Did they offer LOCAL_INITIAL_ROUTING_SYNC?
gossip_new_peer,,initial_routing_sync,bool
msgdata,gossip_new_peer,initial_routing_sync,bool,
# if success: + gossip fd and gossip_store fd
gossip_new_peer_reply,4100
gossip_new_peer_reply,,success,bool
gossip_new_peer_reply,,gs,?struct gossip_state
msgtype,gossip_new_peer_reply,4100
msgdata,gossip_new_peer_reply,success,bool,
msgdata,gossip_new_peer_reply,gs,?gossip_state,
# Connectd asks gossipd for any known addresses for that node.
gossip_get_addrs,4001
gossip_get_addrs,,id,struct node_id
msgtype,gossip_get_addrs,4001
msgdata,gossip_get_addrs,id,node_id,
gossip_get_addrs_reply,4101
gossip_get_addrs_reply,,num,u16
gossip_get_addrs_reply,,addrs,num*struct wireaddr
msgtype,gossip_get_addrs_reply,4101
msgdata,gossip_get_addrs_reply,num,u16,
msgdata,gossip_get_addrs_reply,addrs,wireaddr,num
1 #include <common/per_peer_state.h>
2 #include <common/wireaddr.h>
3 # Communication between gossipd and connectd.
4 gossip_new_peer,4000 msgtype,gossip_new_peer,4000
5 gossip_new_peer,,id,struct node_id msgdata,gossip_new_peer,id,node_id,
6 # Did we negotiate LOCAL_GOSSIP_QUERIES?
7 gossip_new_peer,,gossip_queries_feature,bool msgdata,gossip_new_peer,gossip_queries_feature,bool,
8 # Did they offer LOCAL_INITIAL_ROUTING_SYNC?
9 gossip_new_peer,,initial_routing_sync,bool msgdata,gossip_new_peer,initial_routing_sync,bool,
10 # if success: + gossip fd and gossip_store fd
11 gossip_new_peer_reply,4100 msgtype,gossip_new_peer_reply,4100
12 gossip_new_peer_reply,,success,bool msgdata,gossip_new_peer_reply,success,bool,
13 gossip_new_peer_reply,,gs,?struct gossip_state msgdata,gossip_new_peer_reply,gs,?gossip_state,
14 # Connectd asks gossipd for any known addresses for that node.
15 gossip_get_addrs,4001 msgtype,gossip_get_addrs,4001
16 gossip_get_addrs,,id,struct node_id msgdata,gossip_get_addrs,id,node_id,
17 gossip_get_addrs_reply,4101 msgtype,gossip_get_addrs_reply,4101
18 gossip_get_addrs_reply,,num,u16 msgdata,gossip_get_addrs_reply,num,u16,
19 gossip_get_addrs_reply,,addrs,num*struct wireaddr msgdata,gossip_get_addrs_reply,addrs,wireaddr,num
20
21
22
23

View File

@@ -3,65 +3,65 @@
#include <common/wireaddr.h>
#include <lightningd/gossip_msg.h>
connectctl_init,2000
connectctl_init,,id,struct node_id
connectctl_init,,num_wireaddrs,u16
connectctl_init,,wireaddrs,num_wireaddrs*struct wireaddr_internal
connectctl_init,,listen_announce,num_wireaddrs*enum addr_listen_announce
connectctl_init,,tor_proxyaddr,?struct wireaddr
connectctl_init,,use_tor_proxy_always,bool
connectctl_init,,dev_allow_localhost,bool
connectctl_init,,use_dns,bool
connectctl_init,,tor_password,wirestring
msgtype,connectctl_init,2000
msgdata,connectctl_init,id,node_id,
msgdata,connectctl_init,num_wireaddrs,u16,
msgdata,connectctl_init,wireaddrs,wireaddr_internal,num_wireaddrs
msgdata,connectctl_init,listen_announce,e:addr_listen_announce,num_wireaddrs
msgdata,connectctl_init,tor_proxyaddr,?wireaddr,
msgdata,connectctl_init,use_tor_proxy_always,bool,
msgdata,connectctl_init,dev_allow_localhost,bool,
msgdata,connectctl_init,use_dns,bool,
msgdata,connectctl_init,tor_password,wirestring,
# Connectd->master, here are the addresses I bound, can announce.
connectctl_init_reply,2100
connectctl_init_reply,,num_bindings,u16
connectctl_init_reply,,bindings,num_bindings*struct wireaddr_internal
connectctl_init_reply,,num_announcable,u16
connectctl_init_reply,,announcable,num_announcable*struct wireaddr
msgtype,connectctl_init_reply,2100
msgdata,connectctl_init_reply,num_bindings,u16,
msgdata,connectctl_init_reply,bindings,wireaddr_internal,num_bindings
msgdata,connectctl_init_reply,num_announcable,u16,
msgdata,connectctl_init_reply,announcable,wireaddr,num_announcable
# Activate the connect daemon, so others can connect.
connectctl_activate,2025
msgtype,connectctl_activate,2025
# Do we listen?
connectctl_activate,,listen,bool
msgdata,connectctl_activate,listen,bool,
# Connectd->master, I am ready.
connectctl_activate_reply,2125
msgtype,connectctl_activate_reply,2125
# connectd->master: disconnect this peer please (due to reconnect).
connect_reconnected,2112
connect_reconnected,,id,struct node_id
msgtype,connect_reconnected,2112
msgdata,connect_reconnected,id,node_id,
# Master -> connectd: connect to a peer.
connectctl_connect_to_peer,2001
connectctl_connect_to_peer,,id,struct node_id
connectctl_connect_to_peer,,seconds_waited,u32
connectctl_connect_to_peer,,addrhint,?struct wireaddr_internal
msgtype,connectctl_connect_to_peer,2001
msgdata,connectctl_connect_to_peer,id,node_id,
msgdata,connectctl_connect_to_peer,seconds_waited,u32,
msgdata,connectctl_connect_to_peer,addrhint,?wireaddr_internal,
# Connectd->master: connect failed.
connectctl_connect_failed,2020
connectctl_connect_failed,,id,struct node_id
connectctl_connect_failed,,failreason,wirestring
connectctl_connect_failed,,seconds_to_delay,u32
connectctl_connect_failed,,addrhint,?struct wireaddr_internal
msgtype,connectctl_connect_failed,2020
msgdata,connectctl_connect_failed,id,node_id,
msgdata,connectctl_connect_failed,failreason,wirestring,
msgdata,connectctl_connect_failed,seconds_to_delay,u32,
msgdata,connectctl_connect_failed,addrhint,?wireaddr_internal,
# Connectd -> master: we got a peer. Three fds: peer, gossip and gossip_store
connect_peer_connected,2002
connect_peer_connected,,id,struct node_id
connect_peer_connected,,addr,struct wireaddr_internal
connect_peer_connected,,pps,struct per_peer_state
connect_peer_connected,,gflen,u16
connect_peer_connected,,globalfeatures,gflen*u8
connect_peer_connected,,lflen,u16
connect_peer_connected,,localfeatures,lflen*u8
msgtype,connect_peer_connected,2002
msgdata,connect_peer_connected,id,node_id,
msgdata,connect_peer_connected,addr,wireaddr_internal,
msgdata,connect_peer_connected,pps,per_peer_state,
msgdata,connect_peer_connected,gflen,u16,
msgdata,connect_peer_connected,globalfeatures,u8,gflen
msgdata,connect_peer_connected,lflen,u16,
msgdata,connect_peer_connected,localfeatures,u8,lflen
# master -> connectd: peer has disconnected.
connectctl_peer_disconnected,2015
connectctl_peer_disconnected,,id,struct node_id
msgtype,connectctl_peer_disconnected,2015
msgdata,connectctl_peer_disconnected,id,node_id,
# master -> connectd: do you have a memleak?
connect_dev_memleak,2033
msgtype,connect_dev_memleak,2033
connect_dev_memleak_reply,2133
connect_dev_memleak_reply,,leak,bool
msgtype,connect_dev_memleak_reply,2133
msgdata,connect_dev_memleak_reply,leak,bool,
1 #include <common/cryptomsg.h>
3 #include <common/wireaddr.h>
4 #include <lightningd/gossip_msg.h>
5 connectctl_init,2000 msgtype,connectctl_init,2000
6 connectctl_init,,id,struct node_id msgdata,connectctl_init,id,node_id,
7 connectctl_init,,num_wireaddrs,u16 msgdata,connectctl_init,num_wireaddrs,u16,
8 connectctl_init,,wireaddrs,num_wireaddrs*struct wireaddr_internal msgdata,connectctl_init,wireaddrs,wireaddr_internal,num_wireaddrs
9 connectctl_init,,listen_announce,num_wireaddrs*enum addr_listen_announce msgdata,connectctl_init,listen_announce,e:addr_listen_announce,num_wireaddrs
10 connectctl_init,,tor_proxyaddr,?struct wireaddr msgdata,connectctl_init,tor_proxyaddr,?wireaddr,
11 connectctl_init,,use_tor_proxy_always,bool msgdata,connectctl_init,use_tor_proxy_always,bool,
12 connectctl_init,,dev_allow_localhost,bool msgdata,connectctl_init,dev_allow_localhost,bool,
13 connectctl_init,,use_dns,bool msgdata,connectctl_init,use_dns,bool,
14 connectctl_init,,tor_password,wirestring msgdata,connectctl_init,tor_password,wirestring,
15 # Connectd->master, here are the addresses I bound, can announce.
16 connectctl_init_reply,2100 msgtype,connectctl_init_reply,2100
17 connectctl_init_reply,,num_bindings,u16 msgdata,connectctl_init_reply,num_bindings,u16,
18 connectctl_init_reply,,bindings,num_bindings*struct wireaddr_internal msgdata,connectctl_init_reply,bindings,wireaddr_internal,num_bindings
19 connectctl_init_reply,,num_announcable,u16 msgdata,connectctl_init_reply,num_announcable,u16,
20 connectctl_init_reply,,announcable,num_announcable*struct wireaddr msgdata,connectctl_init_reply,announcable,wireaddr,num_announcable
21 # Activate the connect daemon, so others can connect.
22 connectctl_activate,2025 msgtype,connectctl_activate,2025
23 # Do we listen?
24 connectctl_activate,,listen,bool msgdata,connectctl_activate,listen,bool,
25 # Connectd->master, I am ready.
26 connectctl_activate_reply,2125 msgtype,connectctl_activate_reply,2125
27 # connectd->master: disconnect this peer please (due to reconnect).
28 connect_reconnected,2112 msgtype,connect_reconnected,2112
29 connect_reconnected,,id,struct node_id msgdata,connect_reconnected,id,node_id,
30 # Master -> connectd: connect to a peer.
31 connectctl_connect_to_peer,2001 msgtype,connectctl_connect_to_peer,2001
32 connectctl_connect_to_peer,,id,struct node_id msgdata,connectctl_connect_to_peer,id,node_id,
33 connectctl_connect_to_peer,,seconds_waited,u32 msgdata,connectctl_connect_to_peer,seconds_waited,u32,
34 connectctl_connect_to_peer,,addrhint,?struct wireaddr_internal msgdata,connectctl_connect_to_peer,addrhint,?wireaddr_internal,
35 # Connectd->master: connect failed.
36 connectctl_connect_failed,2020 msgtype,connectctl_connect_failed,2020
37 connectctl_connect_failed,,id,struct node_id msgdata,connectctl_connect_failed,id,node_id,
38 connectctl_connect_failed,,failreason,wirestring msgdata,connectctl_connect_failed,failreason,wirestring,
39 connectctl_connect_failed,,seconds_to_delay,u32 msgdata,connectctl_connect_failed,seconds_to_delay,u32,
40 connectctl_connect_failed,,addrhint,?struct wireaddr_internal msgdata,connectctl_connect_failed,addrhint,?wireaddr_internal,
41 # Connectd -> master: we got a peer. Three fds: peer, gossip and gossip_store
42 connect_peer_connected,2002 msgtype,connect_peer_connected,2002
43 connect_peer_connected,,id,struct node_id msgdata,connect_peer_connected,id,node_id,
44 connect_peer_connected,,addr,struct wireaddr_internal msgdata,connect_peer_connected,addr,wireaddr_internal,
45 connect_peer_connected,,pps,struct per_peer_state msgdata,connect_peer_connected,pps,per_peer_state,
46 connect_peer_connected,,gflen,u16 msgdata,connect_peer_connected,gflen,u16,
47 connect_peer_connected,,globalfeatures,gflen*u8 msgdata,connect_peer_connected,globalfeatures,u8,gflen
48 connect_peer_connected,,lflen,u16 msgdata,connect_peer_connected,lflen,u16,
49 connect_peer_connected,,localfeatures,lflen*u8 msgdata,connect_peer_connected,localfeatures,u8,lflen
50 # master -> connectd: peer has disconnected.
51 connectctl_peer_disconnected,2015 msgtype,connectctl_peer_disconnected,2015
52 connectctl_peer_disconnected,,id,struct node_id msgdata,connectctl_peer_disconnected,id,node_id,
53 # master -> connectd: do you have a memleak?
54 connect_dev_memleak,2033 msgtype,connect_dev_memleak,2033
55 connect_dev_memleak_reply,2133 msgtype,connect_dev_memleak_reply,2133
56 connect_dev_memleak_reply,,leak,bool msgdata,connect_dev_memleak_reply,leak,bool,
57
58
59
60
61
62
63
64
65
66
67

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.

View File

@@ -51,10 +51,10 @@ hsmd-all: lightningd/lightning_hsmd
lightningd/lightning_hsmd: $(LIGHTNINGD_HSM_OBJS) $(LIGHTNINGD_LIB_OBJS) $(HSMD_COMMON_OBJS) $(BITCOIN_OBJS) $(WIRE_OBJS)
hsmd/gen_hsm_wire.h: $(WIRE_GEN) hsmd/hsm_wire.csv
$(WIRE_GEN) --header $@ hsm_wire_type < hsmd/hsm_wire.csv > $@
$(WIRE_GEN) --page header $@ hsm_wire_type < hsmd/hsm_wire.csv > $@
hsmd/gen_hsm_wire.c: $(WIRE_GEN) hsmd/hsm_wire.csv
$(WIRE_GEN) ${@:.c=.h} hsm_wire_type < hsmd/hsm_wire.csv > $@
$(WIRE_GEN) --page impl ${@:.c=.h} hsm_wire_type < hsmd/hsm_wire.csv > $@
check-source: $(LIGHTNINGD_HSM_ALLSRC_NOGEN:%=check-src-include-order/%) $(LIGHTNINGD_HSM_ALLHEADERS_NOGEN:%=check-hdr-include-order/%)
check-source-bolt: $(LIGHTNINGD_HSM_SRC:%=bolt-check/%)

View File

@@ -1,197 +1,198 @@
# Clients should not give a bad request but not the HSM's decision to crash.
hsmstatus_client_bad_request,1000
hsmstatus_client_bad_request,,id,struct node_id
hsmstatus_client_bad_request,,description,wirestring
hsmstatus_client_bad_request,,len,u16
hsmstatus_client_bad_request,,msg,len*u8
msgtype,hsmstatus_client_bad_request,1000
msgdata,hsmstatus_client_bad_request,id,node_id,
msgdata,hsmstatus_client_bad_request,description,wirestring,
msgdata,hsmstatus_client_bad_request,len,u16,
msgdata,hsmstatus_client_bad_request,msg,u8,len
#include <bitcoin/chainparams.h>
# Start the HSM.
hsm_init,11
hsm_init,,bip32_key_version,struct bip32_key_version
hsm_init,,dev_force_privkey,?struct privkey
hsm_init,,dev_force_bip32_seed,?struct secret
hsm_init,,dev_force_channel_secrets,?struct secrets
hsm_init,,dev_force_channel_secrets_shaseed,?struct sha256
msgtype,hsm_init,11
msgdata,hsm_init,bip32_key_version,bip32_key_version,
msgdata,hsm_init,dev_force_privkey,?privkey,
msgdata,hsm_init,dev_force_bip32_seed,?secret,
msgdata,hsm_init,dev_force_channel_secrets,?secrets,
msgdata,hsm_init,dev_force_channel_secrets_shaseed,?sha256,
#include <common/bip32.h>
hsm_init_reply,111
hsm_init_reply,,node_id,struct node_id
hsm_init_reply,,bip32,struct ext_key
msgtype,hsm_init_reply,111
msgdata,hsm_init_reply,node_id,node_id,
msgdata,hsm_init_reply,bip32,ext_key,
# Get a new HSM FD, with the specified capabilities
hsm_client_hsmfd,9
hsm_client_hsmfd,,id,struct node_id # Which identity to use for requests
msgtype,hsm_client_hsmfd,9
# Which identity to use for requests
msgdata,hsm_client_hsmfd,id,node_id,
# Database id for this client, if any.
hsm_client_hsmfd,,dbid,u64
hsm_client_hsmfd,,capabilities,u64
msgdata,hsm_client_hsmfd,dbid,u64,
msgdata,hsm_client_hsmfd,capabilities,u64,
# No content, just an fd.
hsm_client_hsmfd_reply,109
msgtype,hsm_client_hsmfd_reply,109
#include <common/derive_basepoints.h>
# Get the basepoints and funding key for this specific channel.
hsm_get_channel_basepoints,10
hsm_get_channel_basepoints,,peerid,struct node_id
hsm_get_channel_basepoints,,dbid,u64
msgtype,hsm_get_channel_basepoints,10
msgdata,hsm_get_channel_basepoints,peerid,node_id,
msgdata,hsm_get_channel_basepoints,dbid,u64,
hsm_get_channel_basepoints_reply,110
hsm_get_channel_basepoints_reply,,basepoints,struct basepoints
hsm_get_channel_basepoints_reply,,funding_pubkey,struct pubkey
msgtype,hsm_get_channel_basepoints_reply,110
msgdata,hsm_get_channel_basepoints_reply,basepoints,basepoints,
msgdata,hsm_get_channel_basepoints_reply,funding_pubkey,pubkey,
# Return signature for a funding tx.
#include <common/utxo.h>
# FIXME: This should also take their commit sig & details, to verify.
hsm_sign_funding,4
hsm_sign_funding,,satoshi_out,struct amount_sat
hsm_sign_funding,,change_out,struct amount_sat
hsm_sign_funding,,change_keyindex,u32
hsm_sign_funding,,our_pubkey,struct pubkey
hsm_sign_funding,,their_pubkey,struct pubkey
hsm_sign_funding,,num_inputs,u16
hsm_sign_funding,,inputs,num_inputs*struct utxo
msgtype,hsm_sign_funding,4
msgdata,hsm_sign_funding,satoshi_out,amount_sat,
msgdata,hsm_sign_funding,change_out,amount_sat,
msgdata,hsm_sign_funding,change_keyindex,u32,
msgdata,hsm_sign_funding,our_pubkey,pubkey,
msgdata,hsm_sign_funding,their_pubkey,pubkey,
msgdata,hsm_sign_funding,num_inputs,u16,
msgdata,hsm_sign_funding,inputs,utxo,num_inputs
hsm_sign_funding_reply,104
hsm_sign_funding_reply,,tx,struct bitcoin_tx
msgtype,hsm_sign_funding_reply,104
msgdata,hsm_sign_funding_reply,tx,bitcoin_tx,
# Master asks the HSM to sign a node_announcement
hsm_node_announcement_sig_req,6
hsm_node_announcement_sig_req,,annlen,u16
hsm_node_announcement_sig_req,,announcement,annlen*u8
msgtype,hsm_node_announcement_sig_req,6
msgdata,hsm_node_announcement_sig_req,annlen,u16,
msgdata,hsm_node_announcement_sig_req,announcement,u8,annlen
hsm_node_announcement_sig_reply,106
hsm_node_announcement_sig_reply,,signature,secp256k1_ecdsa_signature
msgtype,hsm_node_announcement_sig_reply,106
msgdata,hsm_node_announcement_sig_reply,signature,secp256k1_ecdsa_signature,
# Sign a withdrawal request
hsm_sign_withdrawal,7
hsm_sign_withdrawal,,satoshi_out,struct amount_sat
hsm_sign_withdrawal,,change_out,struct amount_sat
hsm_sign_withdrawal,,change_keyindex,u32
hsm_sign_withdrawal,,scriptpubkey_len,u16
hsm_sign_withdrawal,,scriptpubkey,scriptpubkey_len*u8
hsm_sign_withdrawal,,num_inputs,u16
hsm_sign_withdrawal,,inputs,num_inputs*struct utxo
msgtype,hsm_sign_withdrawal,7
msgdata,hsm_sign_withdrawal,satoshi_out,amount_sat,
msgdata,hsm_sign_withdrawal,change_out,amount_sat,
msgdata,hsm_sign_withdrawal,change_keyindex,u32,
msgdata,hsm_sign_withdrawal,scriptpubkey_len,u16,
msgdata,hsm_sign_withdrawal,scriptpubkey,u8,scriptpubkey_len
msgdata,hsm_sign_withdrawal,num_inputs,u16,
msgdata,hsm_sign_withdrawal,inputs,utxo,num_inputs
hsm_sign_withdrawal_reply,107
hsm_sign_withdrawal_reply,,tx,struct bitcoin_tx
msgtype,hsm_sign_withdrawal_reply,107
msgdata,hsm_sign_withdrawal_reply,tx,bitcoin_tx,
# Sign an invoice
hsm_sign_invoice,8
hsm_sign_invoice,,len,u16
hsm_sign_invoice,,u5bytes,len*u8
hsm_sign_invoice,,hrplen,u16
hsm_sign_invoice,,hrp,hrplen*u8
msgtype,hsm_sign_invoice,8
msgdata,hsm_sign_invoice,len,u16,
msgdata,hsm_sign_invoice,u5bytes,u8,len
msgdata,hsm_sign_invoice,hrplen,u16,
msgdata,hsm_sign_invoice,hrp,u8,hrplen
hsm_sign_invoice_reply,108
hsm_sign_invoice_reply,,sig,secp256k1_ecdsa_recoverable_signature
msgtype,hsm_sign_invoice_reply,108
msgdata,hsm_sign_invoice_reply,sig,secp256k1_ecdsa_recoverable_signature,
# Give me ECDH(node-id-secret,point)
hsm_ecdh_req,1
hsm_ecdh_req,,point,struct pubkey
hsm_ecdh_resp,100
hsm_ecdh_resp,,ss,struct secret
msgtype,hsm_ecdh_req,1
msgdata,hsm_ecdh_req,point,pubkey,
msgtype,hsm_ecdh_resp,100
msgdata,hsm_ecdh_resp,ss,secret,
hsm_cannouncement_sig_req,2
hsm_cannouncement_sig_req,,calen,u16
hsm_cannouncement_sig_req,,ca,calen*u8
msgtype,hsm_cannouncement_sig_req,2
msgdata,hsm_cannouncement_sig_req,calen,u16,
msgdata,hsm_cannouncement_sig_req,ca,u8,calen
hsm_cannouncement_sig_reply,102
hsm_cannouncement_sig_reply,,node_signature,secp256k1_ecdsa_signature
hsm_cannouncement_sig_reply,,bitcoin_signature,secp256k1_ecdsa_signature
msgtype,hsm_cannouncement_sig_reply,102
msgdata,hsm_cannouncement_sig_reply,node_signature,secp256k1_ecdsa_signature,
msgdata,hsm_cannouncement_sig_reply,bitcoin_signature,secp256k1_ecdsa_signature,
hsm_cupdate_sig_req,3
hsm_cupdate_sig_req,,culen,u16
hsm_cupdate_sig_req,,cu,culen*u8
msgtype,hsm_cupdate_sig_req,3
msgdata,hsm_cupdate_sig_req,culen,u16,
msgdata,hsm_cupdate_sig_req,cu,u8,culen
hsm_cupdate_sig_reply,103
hsm_cupdate_sig_reply,,culen,u16
hsm_cupdate_sig_reply,,cu,culen*u8
msgtype,hsm_cupdate_sig_reply,103
msgdata,hsm_cupdate_sig_reply,culen,u16,
msgdata,hsm_cupdate_sig_reply,cu,u8,culen
# Master asks HSM to sign a commitment transaction.
hsm_sign_commitment_tx,5
hsm_sign_commitment_tx,,peer_id,struct node_id
hsm_sign_commitment_tx,,channel_dbid,u64
hsm_sign_commitment_tx,,tx,struct bitcoin_tx
hsm_sign_commitment_tx,,remote_funding_key,struct pubkey
hsm_sign_commitment_tx,,funding_amount,struct amount_sat
msgtype,hsm_sign_commitment_tx,5
msgdata,hsm_sign_commitment_tx,peer_id,node_id,
msgdata,hsm_sign_commitment_tx,channel_dbid,u64,
msgdata,hsm_sign_commitment_tx,tx,bitcoin_tx,
msgdata,hsm_sign_commitment_tx,remote_funding_key,pubkey,
msgdata,hsm_sign_commitment_tx,funding_amount,amount_sat,
hsm_sign_commitment_tx_reply,105
hsm_sign_commitment_tx_reply,,sig,struct bitcoin_signature
msgtype,hsm_sign_commitment_tx_reply,105
msgdata,hsm_sign_commitment_tx_reply,sig,bitcoin_signature,
# Onchaind asks HSM to sign a spend to-us. Four variants, since each set
# of keys is derived differently...
# FIXME: Have master tell hsmd the keyindex, so it can validate output!
hsm_sign_delayed_payment_to_us,12
hsm_sign_delayed_payment_to_us,,commit_num,u64
hsm_sign_delayed_payment_to_us,,tx,struct bitcoin_tx
hsm_sign_delayed_payment_to_us,,wscript_len,u16
hsm_sign_delayed_payment_to_us,,wscript,wscript_len*u8
hsm_sign_delayed_payment_to_us,,input_amount,struct amount_sat
msgtype,hsm_sign_delayed_payment_to_us,12
msgdata,hsm_sign_delayed_payment_to_us,commit_num,u64,
msgdata,hsm_sign_delayed_payment_to_us,tx,bitcoin_tx,
msgdata,hsm_sign_delayed_payment_to_us,wscript_len,u16,
msgdata,hsm_sign_delayed_payment_to_us,wscript,u8,wscript_len
msgdata,hsm_sign_delayed_payment_to_us,input_amount,amount_sat,
hsm_sign_remote_htlc_to_us,13
hsm_sign_remote_htlc_to_us,,remote_per_commitment_point,struct pubkey
hsm_sign_remote_htlc_to_us,,tx,struct bitcoin_tx
hsm_sign_remote_htlc_to_us,,wscript_len,u16
hsm_sign_remote_htlc_to_us,,wscript,wscript_len*u8
hsm_sign_remote_htlc_to_us,,input_amount,struct amount_sat
msgtype,hsm_sign_remote_htlc_to_us,13
msgdata,hsm_sign_remote_htlc_to_us,remote_per_commitment_point,pubkey,
msgdata,hsm_sign_remote_htlc_to_us,tx,bitcoin_tx,
msgdata,hsm_sign_remote_htlc_to_us,wscript_len,u16,
msgdata,hsm_sign_remote_htlc_to_us,wscript,u8,wscript_len
msgdata,hsm_sign_remote_htlc_to_us,input_amount,amount_sat,
hsm_sign_penalty_to_us,14
hsm_sign_penalty_to_us,,revocation_secret,struct secret
hsm_sign_penalty_to_us,,tx,struct bitcoin_tx
hsm_sign_penalty_to_us,,wscript_len,u16
hsm_sign_penalty_to_us,,wscript,wscript_len*u8
hsm_sign_penalty_to_us,,input_amount,struct amount_sat
msgtype,hsm_sign_penalty_to_us,14
msgdata,hsm_sign_penalty_to_us,revocation_secret,secret,
msgdata,hsm_sign_penalty_to_us,tx,bitcoin_tx,
msgdata,hsm_sign_penalty_to_us,wscript_len,u16,
msgdata,hsm_sign_penalty_to_us,wscript,u8,wscript_len
msgdata,hsm_sign_penalty_to_us,input_amount,amount_sat,
# Onchaind asks HSM to sign a local HTLC success or HTLC timeout tx.
hsm_sign_local_htlc_tx,16
hsm_sign_local_htlc_tx,,commit_num,u64
hsm_sign_local_htlc_tx,,tx,struct bitcoin_tx
hsm_sign_local_htlc_tx,,wscript_len,u16
hsm_sign_local_htlc_tx,,wscript,wscript_len*u8
hsm_sign_local_htlc_tx,,input_amount,struct amount_sat
msgtype,hsm_sign_local_htlc_tx,16
msgdata,hsm_sign_local_htlc_tx,commit_num,u64,
msgdata,hsm_sign_local_htlc_tx,tx,bitcoin_tx,
msgdata,hsm_sign_local_htlc_tx,wscript_len,u16,
msgdata,hsm_sign_local_htlc_tx,wscript,u8,wscript_len
msgdata,hsm_sign_local_htlc_tx,input_amount,amount_sat,
# Openingd/channeld asks HSM to sign the other sides' commitment tx.
hsm_sign_remote_commitment_tx,19
hsm_sign_remote_commitment_tx,,tx,struct bitcoin_tx
hsm_sign_remote_commitment_tx,,remote_funding_key,struct pubkey
hsm_sign_remote_commitment_tx,,funding_amount,struct amount_sat
msgtype,hsm_sign_remote_commitment_tx,19
msgdata,hsm_sign_remote_commitment_tx,tx,bitcoin_tx,
msgdata,hsm_sign_remote_commitment_tx,remote_funding_key,pubkey,
msgdata,hsm_sign_remote_commitment_tx,funding_amount,amount_sat,
# channeld asks HSM to sign remote HTLC tx.
hsm_sign_remote_htlc_tx,20
hsm_sign_remote_htlc_tx,,tx,struct bitcoin_tx
hsm_sign_remote_htlc_tx,,len,u16
hsm_sign_remote_htlc_tx,,wscript,len*u8
hsm_sign_remote_htlc_tx,,amounts_satoshi,struct amount_sat
hsm_sign_remote_htlc_tx,,remote_per_commit_point,struct pubkey
msgtype,hsm_sign_remote_htlc_tx,20
msgdata,hsm_sign_remote_htlc_tx,tx,bitcoin_tx,
msgdata,hsm_sign_remote_htlc_tx,len,u16,
msgdata,hsm_sign_remote_htlc_tx,wscript,u8,len
msgdata,hsm_sign_remote_htlc_tx,amounts_satoshi,amount_sat,
msgdata,hsm_sign_remote_htlc_tx,remote_per_commit_point,pubkey,
# closingd asks HSM to sign mutual close tx.
hsm_sign_mutual_close_tx,21
hsm_sign_mutual_close_tx,,tx,struct bitcoin_tx
hsm_sign_mutual_close_tx,,remote_funding_key,struct pubkey
hsm_sign_mutual_close_tx,,funding,struct amount_sat
msgtype,hsm_sign_mutual_close_tx,21
msgdata,hsm_sign_mutual_close_tx,tx,bitcoin_tx,
msgdata,hsm_sign_mutual_close_tx,remote_funding_key,pubkey,
msgdata,hsm_sign_mutual_close_tx,funding,amount_sat,
# Reply for all the above requests.
hsm_sign_tx_reply,112
hsm_sign_tx_reply,,sig,struct bitcoin_signature
msgtype,hsm_sign_tx_reply,112
msgdata,hsm_sign_tx_reply,sig,bitcoin_signature,
# Openingd/channeld/onchaind asks for Nth per_commitment_point, if > 2, gets N-2 secret.
hsm_get_per_commitment_point,18
hsm_get_per_commitment_point,,n,u64
msgtype,hsm_get_per_commitment_point,18
msgdata,hsm_get_per_commitment_point,n,u64,
hsm_get_per_commitment_point_reply,118
hsm_get_per_commitment_point_reply,,per_commitment_point,struct pubkey
hsm_get_per_commitment_point_reply,,old_commitment_secret,?struct secret
msgtype,hsm_get_per_commitment_point_reply,118
msgdata,hsm_get_per_commitment_point_reply,per_commitment_point,pubkey,
msgdata,hsm_get_per_commitment_point_reply,old_commitment_secret,?secret,
# master -> hsmd: do you have a memleak?
hsm_dev_memleak,33
msgtype,hsm_dev_memleak,33
hsm_dev_memleak_reply,133
hsm_dev_memleak_reply,,leak,bool
msgtype,hsm_dev_memleak_reply,133
msgdata,hsm_dev_memleak_reply,leak,bool,
# channeld asks to check if claimed future commitment_secret is correct.
hsm_check_future_secret,22
hsm_check_future_secret,,n,u64
hsm_check_future_secret,,commitment_secret,struct secret
msgtype,hsm_check_future_secret,22
msgdata,hsm_check_future_secret,n,u64,
msgdata,hsm_check_future_secret,commitment_secret,secret,
hsm_check_future_secret_reply,122
hsm_check_future_secret_reply,,correct,bool
msgtype,hsm_check_future_secret_reply,122
msgdata,hsm_check_future_secret_reply,correct,bool,
1 # Clients should not give a bad request but not the HSM's decision to crash.
2 hsmstatus_client_bad_request,1000 msgtype,hsmstatus_client_bad_request,1000
3 hsmstatus_client_bad_request,,id,struct node_id msgdata,hsmstatus_client_bad_request,id,node_id,
4 hsmstatus_client_bad_request,,description,wirestring msgdata,hsmstatus_client_bad_request,description,wirestring,
5 hsmstatus_client_bad_request,,len,u16 msgdata,hsmstatus_client_bad_request,len,u16,
6 hsmstatus_client_bad_request,,msg,len*u8 msgdata,hsmstatus_client_bad_request,msg,u8,len
7 #include <bitcoin/chainparams.h>
8 # Start the HSM.
9 hsm_init,11 msgtype,hsm_init,11
10 hsm_init,,bip32_key_version,struct bip32_key_version msgdata,hsm_init,bip32_key_version,bip32_key_version,
11 hsm_init,,dev_force_privkey,?struct privkey msgdata,hsm_init,dev_force_privkey,?privkey,
12 hsm_init,,dev_force_bip32_seed,?struct secret msgdata,hsm_init,dev_force_bip32_seed,?secret,
13 hsm_init,,dev_force_channel_secrets,?struct secrets msgdata,hsm_init,dev_force_channel_secrets,?secrets,
14 hsm_init,,dev_force_channel_secrets_shaseed,?struct sha256 msgdata,hsm_init,dev_force_channel_secrets_shaseed,?sha256,
15 #include <common/bip32.h>
16 hsm_init_reply,111 msgtype,hsm_init_reply,111
17 hsm_init_reply,,node_id,struct node_id msgdata,hsm_init_reply,node_id,node_id,
18 hsm_init_reply,,bip32,struct ext_key msgdata,hsm_init_reply,bip32,ext_key,
19 # Get a new HSM FD, with the specified capabilities
20 hsm_client_hsmfd,9 msgtype,hsm_client_hsmfd,9
21 hsm_client_hsmfd,,id,struct node_id # Which identity to use for requests # Which identity to use for requests
22 # Database id for this client, if any. msgdata,hsm_client_hsmfd,id,node_id,
23 hsm_client_hsmfd,,dbid,u64 # Database id for this client, if any.
24 hsm_client_hsmfd,,capabilities,u64 msgdata,hsm_client_hsmfd,dbid,u64,
25 msgdata,hsm_client_hsmfd,capabilities,u64,
26 # No content, just an fd.
27 hsm_client_hsmfd_reply,109 msgtype,hsm_client_hsmfd_reply,109
28 #include <common/derive_basepoints.h>
29 # Get the basepoints and funding key for this specific channel.
30 hsm_get_channel_basepoints,10 msgtype,hsm_get_channel_basepoints,10
31 hsm_get_channel_basepoints,,peerid,struct node_id msgdata,hsm_get_channel_basepoints,peerid,node_id,
32 hsm_get_channel_basepoints,,dbid,u64 msgdata,hsm_get_channel_basepoints,dbid,u64,
33 hsm_get_channel_basepoints_reply,110 msgtype,hsm_get_channel_basepoints_reply,110
34 hsm_get_channel_basepoints_reply,,basepoints,struct basepoints msgdata,hsm_get_channel_basepoints_reply,basepoints,basepoints,
35 hsm_get_channel_basepoints_reply,,funding_pubkey,struct pubkey msgdata,hsm_get_channel_basepoints_reply,funding_pubkey,pubkey,
36 # Return signature for a funding tx.
37 #include <common/utxo.h>
38 # FIXME: This should also take their commit sig & details, to verify.
39 hsm_sign_funding,4 msgtype,hsm_sign_funding,4
40 hsm_sign_funding,,satoshi_out,struct amount_sat msgdata,hsm_sign_funding,satoshi_out,amount_sat,
41 hsm_sign_funding,,change_out,struct amount_sat msgdata,hsm_sign_funding,change_out,amount_sat,
42 hsm_sign_funding,,change_keyindex,u32 msgdata,hsm_sign_funding,change_keyindex,u32,
43 hsm_sign_funding,,our_pubkey,struct pubkey msgdata,hsm_sign_funding,our_pubkey,pubkey,
44 hsm_sign_funding,,their_pubkey,struct pubkey msgdata,hsm_sign_funding,their_pubkey,pubkey,
45 hsm_sign_funding,,num_inputs,u16 msgdata,hsm_sign_funding,num_inputs,u16,
46 hsm_sign_funding,,inputs,num_inputs*struct utxo msgdata,hsm_sign_funding,inputs,utxo,num_inputs
47 hsm_sign_funding_reply,104 msgtype,hsm_sign_funding_reply,104
48 hsm_sign_funding_reply,,tx,struct bitcoin_tx msgdata,hsm_sign_funding_reply,tx,bitcoin_tx,
49 # Master asks the HSM to sign a node_announcement
50 hsm_node_announcement_sig_req,6 msgtype,hsm_node_announcement_sig_req,6
51 hsm_node_announcement_sig_req,,annlen,u16 msgdata,hsm_node_announcement_sig_req,annlen,u16,
52 hsm_node_announcement_sig_req,,announcement,annlen*u8 msgdata,hsm_node_announcement_sig_req,announcement,u8,annlen
53 hsm_node_announcement_sig_reply,106 msgtype,hsm_node_announcement_sig_reply,106
54 hsm_node_announcement_sig_reply,,signature,secp256k1_ecdsa_signature msgdata,hsm_node_announcement_sig_reply,signature,secp256k1_ecdsa_signature,
55 # Sign a withdrawal request
56 hsm_sign_withdrawal,7 msgtype,hsm_sign_withdrawal,7
57 hsm_sign_withdrawal,,satoshi_out,struct amount_sat msgdata,hsm_sign_withdrawal,satoshi_out,amount_sat,
58 hsm_sign_withdrawal,,change_out,struct amount_sat msgdata,hsm_sign_withdrawal,change_out,amount_sat,
59 hsm_sign_withdrawal,,change_keyindex,u32 msgdata,hsm_sign_withdrawal,change_keyindex,u32,
60 hsm_sign_withdrawal,,scriptpubkey_len,u16 msgdata,hsm_sign_withdrawal,scriptpubkey_len,u16,
61 hsm_sign_withdrawal,,scriptpubkey,scriptpubkey_len*u8 msgdata,hsm_sign_withdrawal,scriptpubkey,u8,scriptpubkey_len
62 hsm_sign_withdrawal,,num_inputs,u16 msgdata,hsm_sign_withdrawal,num_inputs,u16,
63 hsm_sign_withdrawal,,inputs,num_inputs*struct utxo msgdata,hsm_sign_withdrawal,inputs,utxo,num_inputs
64 hsm_sign_withdrawal_reply,107 msgtype,hsm_sign_withdrawal_reply,107
65 hsm_sign_withdrawal_reply,,tx,struct bitcoin_tx msgdata,hsm_sign_withdrawal_reply,tx,bitcoin_tx,
66 # Sign an invoice
67 hsm_sign_invoice,8 msgtype,hsm_sign_invoice,8
68 hsm_sign_invoice,,len,u16 msgdata,hsm_sign_invoice,len,u16,
69 hsm_sign_invoice,,u5bytes,len*u8 msgdata,hsm_sign_invoice,u5bytes,u8,len
70 hsm_sign_invoice,,hrplen,u16 msgdata,hsm_sign_invoice,hrplen,u16,
71 hsm_sign_invoice,,hrp,hrplen*u8 msgdata,hsm_sign_invoice,hrp,u8,hrplen
72 hsm_sign_invoice_reply,108 msgtype,hsm_sign_invoice_reply,108
73 hsm_sign_invoice_reply,,sig,secp256k1_ecdsa_recoverable_signature msgdata,hsm_sign_invoice_reply,sig,secp256k1_ecdsa_recoverable_signature,
74 # Give me ECDH(node-id-secret,point)
75 hsm_ecdh_req,1 msgtype,hsm_ecdh_req,1
76 hsm_ecdh_req,,point,struct pubkey msgdata,hsm_ecdh_req,point,pubkey,
77 hsm_ecdh_resp,100 msgtype,hsm_ecdh_resp,100
78 hsm_ecdh_resp,,ss,struct secret msgdata,hsm_ecdh_resp,ss,secret,
79 hsm_cannouncement_sig_req,2 msgtype,hsm_cannouncement_sig_req,2
80 hsm_cannouncement_sig_req,,calen,u16 msgdata,hsm_cannouncement_sig_req,calen,u16,
81 hsm_cannouncement_sig_req,,ca,calen*u8 msgdata,hsm_cannouncement_sig_req,ca,u8,calen
82 hsm_cannouncement_sig_reply,102 msgtype,hsm_cannouncement_sig_reply,102
83 hsm_cannouncement_sig_reply,,node_signature,secp256k1_ecdsa_signature msgdata,hsm_cannouncement_sig_reply,node_signature,secp256k1_ecdsa_signature,
84 hsm_cannouncement_sig_reply,,bitcoin_signature,secp256k1_ecdsa_signature msgdata,hsm_cannouncement_sig_reply,bitcoin_signature,secp256k1_ecdsa_signature,
85 hsm_cupdate_sig_req,3 msgtype,hsm_cupdate_sig_req,3
86 hsm_cupdate_sig_req,,culen,u16 msgdata,hsm_cupdate_sig_req,culen,u16,
87 hsm_cupdate_sig_req,,cu,culen*u8 msgdata,hsm_cupdate_sig_req,cu,u8,culen
88 hsm_cupdate_sig_reply,103 msgtype,hsm_cupdate_sig_reply,103
89 hsm_cupdate_sig_reply,,culen,u16 msgdata,hsm_cupdate_sig_reply,culen,u16,
90 hsm_cupdate_sig_reply,,cu,culen*u8 msgdata,hsm_cupdate_sig_reply,cu,u8,culen
91 # Master asks HSM to sign a commitment transaction.
92 hsm_sign_commitment_tx,5 msgtype,hsm_sign_commitment_tx,5
93 hsm_sign_commitment_tx,,peer_id,struct node_id msgdata,hsm_sign_commitment_tx,peer_id,node_id,
94 hsm_sign_commitment_tx,,channel_dbid,u64 msgdata,hsm_sign_commitment_tx,channel_dbid,u64,
95 hsm_sign_commitment_tx,,tx,struct bitcoin_tx msgdata,hsm_sign_commitment_tx,tx,bitcoin_tx,
96 hsm_sign_commitment_tx,,remote_funding_key,struct pubkey msgdata,hsm_sign_commitment_tx,remote_funding_key,pubkey,
97 hsm_sign_commitment_tx,,funding_amount,struct amount_sat msgdata,hsm_sign_commitment_tx,funding_amount,amount_sat,
98 hsm_sign_commitment_tx_reply,105 msgtype,hsm_sign_commitment_tx_reply,105
99 hsm_sign_commitment_tx_reply,,sig,struct bitcoin_signature msgdata,hsm_sign_commitment_tx_reply,sig,bitcoin_signature,
100 # Onchaind asks HSM to sign a spend to-us. Four variants, since each set
101 # of keys is derived differently...
102 # FIXME: Have master tell hsmd the keyindex, so it can validate output!
103 hsm_sign_delayed_payment_to_us,12 msgtype,hsm_sign_delayed_payment_to_us,12
104 hsm_sign_delayed_payment_to_us,,commit_num,u64 msgdata,hsm_sign_delayed_payment_to_us,commit_num,u64,
105 hsm_sign_delayed_payment_to_us,,tx,struct bitcoin_tx msgdata,hsm_sign_delayed_payment_to_us,tx,bitcoin_tx,
106 hsm_sign_delayed_payment_to_us,,wscript_len,u16 msgdata,hsm_sign_delayed_payment_to_us,wscript_len,u16,
107 hsm_sign_delayed_payment_to_us,,wscript,wscript_len*u8 msgdata,hsm_sign_delayed_payment_to_us,wscript,u8,wscript_len
108 hsm_sign_delayed_payment_to_us,,input_amount,struct amount_sat msgdata,hsm_sign_delayed_payment_to_us,input_amount,amount_sat,
109 hsm_sign_remote_htlc_to_us,13 msgtype,hsm_sign_remote_htlc_to_us,13
110 hsm_sign_remote_htlc_to_us,,remote_per_commitment_point,struct pubkey msgdata,hsm_sign_remote_htlc_to_us,remote_per_commitment_point,pubkey,
111 hsm_sign_remote_htlc_to_us,,tx,struct bitcoin_tx msgdata,hsm_sign_remote_htlc_to_us,tx,bitcoin_tx,
112 hsm_sign_remote_htlc_to_us,,wscript_len,u16 msgdata,hsm_sign_remote_htlc_to_us,wscript_len,u16,
113 hsm_sign_remote_htlc_to_us,,wscript,wscript_len*u8 msgdata,hsm_sign_remote_htlc_to_us,wscript,u8,wscript_len
114 hsm_sign_remote_htlc_to_us,,input_amount,struct amount_sat msgdata,hsm_sign_remote_htlc_to_us,input_amount,amount_sat,
115 hsm_sign_penalty_to_us,14 msgtype,hsm_sign_penalty_to_us,14
116 hsm_sign_penalty_to_us,,revocation_secret,struct secret msgdata,hsm_sign_penalty_to_us,revocation_secret,secret,
117 hsm_sign_penalty_to_us,,tx,struct bitcoin_tx msgdata,hsm_sign_penalty_to_us,tx,bitcoin_tx,
118 hsm_sign_penalty_to_us,,wscript_len,u16 msgdata,hsm_sign_penalty_to_us,wscript_len,u16,
119 hsm_sign_penalty_to_us,,wscript,wscript_len*u8 msgdata,hsm_sign_penalty_to_us,wscript,u8,wscript_len
120 hsm_sign_penalty_to_us,,input_amount,struct amount_sat msgdata,hsm_sign_penalty_to_us,input_amount,amount_sat,
121 # Onchaind asks HSM to sign a local HTLC success or HTLC timeout tx.
122 hsm_sign_local_htlc_tx,16 msgtype,hsm_sign_local_htlc_tx,16
123 hsm_sign_local_htlc_tx,,commit_num,u64 msgdata,hsm_sign_local_htlc_tx,commit_num,u64,
124 hsm_sign_local_htlc_tx,,tx,struct bitcoin_tx msgdata,hsm_sign_local_htlc_tx,tx,bitcoin_tx,
125 hsm_sign_local_htlc_tx,,wscript_len,u16 msgdata,hsm_sign_local_htlc_tx,wscript_len,u16,
126 hsm_sign_local_htlc_tx,,wscript,wscript_len*u8 msgdata,hsm_sign_local_htlc_tx,wscript,u8,wscript_len
127 hsm_sign_local_htlc_tx,,input_amount,struct amount_sat msgdata,hsm_sign_local_htlc_tx,input_amount,amount_sat,
128 # Openingd/channeld asks HSM to sign the other sides' commitment tx.
129 hsm_sign_remote_commitment_tx,19 msgtype,hsm_sign_remote_commitment_tx,19
130 hsm_sign_remote_commitment_tx,,tx,struct bitcoin_tx msgdata,hsm_sign_remote_commitment_tx,tx,bitcoin_tx,
131 hsm_sign_remote_commitment_tx,,remote_funding_key,struct pubkey msgdata,hsm_sign_remote_commitment_tx,remote_funding_key,pubkey,
132 hsm_sign_remote_commitment_tx,,funding_amount,struct amount_sat msgdata,hsm_sign_remote_commitment_tx,funding_amount,amount_sat,
133 # channeld asks HSM to sign remote HTLC tx.
134 hsm_sign_remote_htlc_tx,20 msgtype,hsm_sign_remote_htlc_tx,20
135 hsm_sign_remote_htlc_tx,,tx,struct bitcoin_tx msgdata,hsm_sign_remote_htlc_tx,tx,bitcoin_tx,
136 hsm_sign_remote_htlc_tx,,len,u16 msgdata,hsm_sign_remote_htlc_tx,len,u16,
137 hsm_sign_remote_htlc_tx,,wscript,len*u8 msgdata,hsm_sign_remote_htlc_tx,wscript,u8,len
138 hsm_sign_remote_htlc_tx,,amounts_satoshi,struct amount_sat msgdata,hsm_sign_remote_htlc_tx,amounts_satoshi,amount_sat,
139 hsm_sign_remote_htlc_tx,,remote_per_commit_point,struct pubkey msgdata,hsm_sign_remote_htlc_tx,remote_per_commit_point,pubkey,
140 # closingd asks HSM to sign mutual close tx.
141 hsm_sign_mutual_close_tx,21 msgtype,hsm_sign_mutual_close_tx,21
142 hsm_sign_mutual_close_tx,,tx,struct bitcoin_tx msgdata,hsm_sign_mutual_close_tx,tx,bitcoin_tx,
143 hsm_sign_mutual_close_tx,,remote_funding_key,struct pubkey msgdata,hsm_sign_mutual_close_tx,remote_funding_key,pubkey,
144 hsm_sign_mutual_close_tx,,funding,struct amount_sat msgdata,hsm_sign_mutual_close_tx,funding,amount_sat,
145 # Reply for all the above requests.
146 hsm_sign_tx_reply,112 msgtype,hsm_sign_tx_reply,112
147 hsm_sign_tx_reply,,sig,struct bitcoin_signature msgdata,hsm_sign_tx_reply,sig,bitcoin_signature,
148 # Openingd/channeld/onchaind asks for Nth per_commitment_point, if > 2, gets N-2 secret.
149 hsm_get_per_commitment_point,18 msgtype,hsm_get_per_commitment_point,18
150 hsm_get_per_commitment_point,,n,u64 msgdata,hsm_get_per_commitment_point,n,u64,
151 hsm_get_per_commitment_point_reply,118 msgtype,hsm_get_per_commitment_point_reply,118
152 hsm_get_per_commitment_point_reply,,per_commitment_point,struct pubkey msgdata,hsm_get_per_commitment_point_reply,per_commitment_point,pubkey,
153 hsm_get_per_commitment_point_reply,,old_commitment_secret,?struct secret msgdata,hsm_get_per_commitment_point_reply,old_commitment_secret,?secret,
154 # master -> hsmd: do you have a memleak?
155 hsm_dev_memleak,33 msgtype,hsm_dev_memleak,33
156 hsm_dev_memleak_reply,133 msgtype,hsm_dev_memleak_reply,133
157 hsm_dev_memleak_reply,,leak,bool msgdata,hsm_dev_memleak_reply,leak,bool,
158 # channeld asks to check if claimed future commitment_secret is correct.
159 hsm_check_future_secret,22 msgtype,hsm_check_future_secret,22
160 hsm_check_future_secret,,n,u64 msgdata,hsm_check_future_secret,n,u64,
161 hsm_check_future_secret,,commitment_secret,struct secret msgdata,hsm_check_future_secret,commitment_secret,secret,
162 hsm_check_future_secret_reply,122 msgtype,hsm_check_future_secret_reply,122
163 hsm_check_future_secret_reply,,correct,bool msgdata,hsm_check_future_secret_reply,correct,bool,
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198

View File

@@ -441,7 +441,7 @@ u8 *towire_errorfmt(const tal_t *ctx UNNEEDED,
const char *fmt UNNEEDED, ...)
{ fprintf(stderr, "towire_errorfmt called!\n"); abort(); }
/* Generated stub for towire_gossip_get_incoming_channels */
u8 *towire_gossip_get_incoming_channels(const tal_t *ctx UNNEEDED, const bool *private_too UNNEEDED)
u8 *towire_gossip_get_incoming_channels(const tal_t *ctx UNNEEDED, bool *private_too UNNEEDED)
{ fprintf(stderr, "towire_gossip_get_incoming_channels called!\n"); abort(); }
/* Generated stub for towire_hsm_get_channel_basepoints */
u8 *towire_hsm_get_channel_basepoints(const tal_t *ctx UNNEEDED, const struct node_id *peerid UNNEEDED, u64 dbid UNNEEDED)

View File

@@ -74,10 +74,10 @@ ONCHAIND_COMMON_OBJS := \
hsmd/gen_hsm_wire.o
onchaind/gen_onchain_wire.h: $(WIRE_GEN) onchaind/onchain_wire.csv
$(WIRE_GEN) --header $@ onchain_wire_type < onchaind/onchain_wire.csv > $@
$(WIRE_GEN) --page header $@ onchain_wire_type < onchaind/onchain_wire.csv > $@
onchaind/gen_onchain_wire.c: $(WIRE_GEN) onchaind/onchain_wire.csv
$(WIRE_GEN) ${@:.c=.h} onchain_wire_type < onchaind/onchain_wire.csv > $@
$(WIRE_GEN) --page impl ${@:.c=.h} onchain_wire_type < onchaind/onchain_wire.csv > $@
LIGHTNINGD_ONCHAIN_OBJS := $(LIGHTNINGD_ONCHAIN_SRC:.c=.o) $(LIGHTNINGD_ONCHAIN_GEN_SRC:.c=.o)

View File

@@ -3,107 +3,107 @@
#include <common/wallet.h>
# Begin! Here's the onchain tx which spends funding tx, followed by all HTLCs.
onchain_init,5001
onchain_init,,shachain,struct shachain
onchain_init,,funding_amount_satoshi,struct amount_sat
msgtype,onchain_init,5001
msgdata,onchain_init,shachain,shachain,
msgdata,onchain_init,funding_amount_satoshi,amount_sat,
# Remote per commit point for committed tx.
onchain_init,,old_remote_per_commitment_point,struct pubkey
msgdata,onchain_init,old_remote_per_commitment_point,pubkey,
# Remote per commit point for current tx (needed if we haven't got revoke_and_ack yet).
onchain_init,,remote_per_commitment_point,struct pubkey
onchain_init,,local_to_self_delay,u32
onchain_init,,remote_to_self_delay,u32
onchain_init,,feerate_per_kw,u32
onchain_init,,local_dust_limit_satoshi,struct amount_sat
msgdata,onchain_init,remote_per_commitment_point,pubkey,
msgdata,onchain_init,local_to_self_delay,u32,
msgdata,onchain_init,remote_to_self_delay,u32,
msgdata,onchain_init,feerate_per_kw,u32,
msgdata,onchain_init,local_dust_limit_satoshi,amount_sat,
# Gives an easy way to tell if it's our unilateral close or theirs...
onchain_init,,our_broadcast_txid,struct bitcoin_txid
onchain_init,,local_scriptpubkey_len,u16
onchain_init,,local_scriptpubkey,local_scriptpubkey_len*u8
onchain_init,,remote_scriptpubkey_len,u16
onchain_init,,remote_scriptpubkey,remote_scriptpubkey_len*u8
onchain_init,,ourwallet_pubkey,struct pubkey
msgdata,onchain_init,our_broadcast_txid,bitcoin_txid,
msgdata,onchain_init,local_scriptpubkey_len,u16,
msgdata,onchain_init,local_scriptpubkey,u8,local_scriptpubkey_len
msgdata,onchain_init,remote_scriptpubkey_len,u16,
msgdata,onchain_init,remote_scriptpubkey,u8,remote_scriptpubkey_len
msgdata,onchain_init,ourwallet_pubkey,pubkey,
# We need these two for commit number obscurer
onchain_init,,funder,enum side
onchain_init,,local_basepoints,struct basepoints
onchain_init,,remote_basepoints,struct basepoints
onchain_init,,tx,struct bitcoin_tx
onchain_init,,tx_blockheight,u32
onchain_init,,reasonable_depth,u32
onchain_init,,num_htlc_sigs,u16
onchain_init,,htlc_signature,num_htlc_sigs*secp256k1_ecdsa_signature
onchain_init,,num_htlcs,u64
onchain_init,,min_possible_feerate,u32
onchain_init,,max_possible_feerate,u32
onchain_init,,possible_remote_per_commit_point,?struct pubkey
msgdata,onchain_init,funder,e:side,
msgdata,onchain_init,local_basepoints,basepoints,
msgdata,onchain_init,remote_basepoints,basepoints,
msgdata,onchain_init,tx,bitcoin_tx,
msgdata,onchain_init,tx_blockheight,u32,
msgdata,onchain_init,reasonable_depth,u32,
msgdata,onchain_init,num_htlc_sigs,u16,
msgdata,onchain_init,htlc_signature,secp256k1_ecdsa_signature,num_htlc_sigs
msgdata,onchain_init,num_htlcs,u64,
msgdata,onchain_init,min_possible_feerate,u32,
msgdata,onchain_init,max_possible_feerate,u32,
msgdata,onchain_init,possible_remote_per_commit_point,?pubkey,
#include <onchaind/onchain_wire.h>
# This is all the HTLCs: one per message
onchain_htlc,5002
onchain_htlc,,htlc,struct htlc_stub
msgtype,onchain_htlc,5002
msgdata,onchain_htlc,htlc,htlc_stub,
# If it's not in the commitment tx, tell us (immediately or htlc_missing_depth)
onchain_htlc,,tell_if_missing,bool
onchain_htlc,,tell_immediately,bool
msgdata,onchain_htlc,tell_if_missing,bool,
msgdata,onchain_htlc,tell_immediately,bool,
# This says we're ready; give us preimages.
onchain_init_reply,5101
msgtype,onchain_init_reply,5101
# onchaind->master: Send out a tx.
onchain_broadcast_tx,5003
onchain_broadcast_tx,,tx,struct bitcoin_tx
onchain_broadcast_tx,,type,enum wallet_tx_type
msgtype,onchain_broadcast_tx,5003
msgdata,onchain_broadcast_tx,tx,bitcoin_tx,
msgdata,onchain_broadcast_tx,type,e:wallet_tx_type,
# master->onchaind: Notifier that an output has been spent by input_num of tx.
onchain_spent,5004
onchain_spent,,tx,struct bitcoin_tx
onchain_spent,,input_num,u32
onchain_spent,,blockheight,u32
msgtype,onchain_spent,5004
msgdata,onchain_spent,tx,bitcoin_tx,
msgdata,onchain_spent,input_num,u32,
msgdata,onchain_spent,blockheight,u32,
# master->onchaind: We will receive more than one of these, as depth changes.
onchain_depth,5005
onchain_depth,,txid,struct bitcoin_txid
onchain_depth,,depth,u32
msgtype,onchain_depth,5005
msgdata,onchain_depth,txid,bitcoin_txid,
msgdata,onchain_depth,depth,u32,
# onchaind->master: We don't want to watch this tx, or its outputs
onchain_unwatch_tx,5006
onchain_unwatch_tx,,txid,struct bitcoin_txid
msgtype,onchain_unwatch_tx,5006
msgdata,onchain_unwatch_tx,txid,bitcoin_txid,
# master->onchaind: We know HTLC preimage
onchain_known_preimage,5007
onchain_known_preimage,,preimage,struct preimage
msgtype,onchain_known_preimage,5007
msgdata,onchain_known_preimage,preimage,preimage,
# onchaind->master: We discovered HTLC preimage
onchain_extracted_preimage,5008
onchain_extracted_preimage,,preimage,struct preimage
msgtype,onchain_extracted_preimage,5008
msgdata,onchain_extracted_preimage,preimage,preimage,
# onchaind->master: this HTLC was missing from commit tx.
onchain_missing_htlc_output,5009
onchain_missing_htlc_output,,htlc,struct htlc_stub
msgtype,onchain_missing_htlc_output,5009
msgdata,onchain_missing_htlc_output,htlc,htlc_stub,
# onchaind->master: this HTLC has timed out (after reasonable_depth)
onchain_htlc_timeout,5010
onchain_htlc_timeout,,htlc,struct htlc_stub
msgtype,onchain_htlc_timeout,5010
msgdata,onchain_htlc_timeout,htlc,htlc_stub,
# onchaind->master: this peer can be forgotten
onchain_all_irrevocably_resolved,5011
msgtype,onchain_all_irrevocably_resolved,5011
# onchaind->master: hey, I identified an UTXO you'll want to track
onchain_add_utxo,5012
onchain_add_utxo,,prev_out_tx,struct bitcoin_txid
onchain_add_utxo,,prev_out_index,u32
onchain_add_utxo,,per_commit_point,struct pubkey
onchain_add_utxo,,value,struct amount_sat
onchain_add_utxo,,blockheight,u32
onchain_add_utxo,,len,u16
onchain_add_utxo,,scriptpubkey,len*u8
msgtype,onchain_add_utxo,5012
msgdata,onchain_add_utxo,prev_out_tx,bitcoin_txid,
msgdata,onchain_add_utxo,prev_out_index,u32,
msgdata,onchain_add_utxo,per_commit_point,pubkey,
msgdata,onchain_add_utxo,value,amount_sat,
msgdata,onchain_add_utxo,blockheight,u32,
msgdata,onchain_add_utxo,len,u16,
msgdata,onchain_add_utxo,scriptpubkey,u8,len
# master -> onchaind: do you have a memleak?
onchain_dev_memleak,5033
msgtype,onchain_dev_memleak,5033
onchain_dev_memleak_reply,5133
onchain_dev_memleak_reply,,leak,bool
msgtype,onchain_dev_memleak_reply,5133
msgdata,onchain_dev_memleak_reply,leak,bool,
# Tell the main daemon what we've been watching, mainly used for transactions
# that we tracked automatically but only onchaind knows how to classify their
# transactions.
onchain_transaction_annotate,5034
onchain_transaction_annotate,,txid,struct bitcoin_txid
onchain_transaction_annotate,,type,enum wallet_tx_type
msgtype,onchain_transaction_annotate,5034
msgdata,onchain_transaction_annotate,txid,bitcoin_txid,
msgdata,onchain_transaction_annotate,type,e:wallet_tx_type,
1 #include <common/derive_basepoints.h>
3 #include <common/wallet.h>
4 # Begin! Here's the onchain tx which spends funding tx, followed by all HTLCs.
5 onchain_init,5001 msgtype,onchain_init,5001
6 onchain_init,,shachain,struct shachain msgdata,onchain_init,shachain,shachain,
7 onchain_init,,funding_amount_satoshi,struct amount_sat msgdata,onchain_init,funding_amount_satoshi,amount_sat,
8 # Remote per commit point for committed tx.
9 onchain_init,,old_remote_per_commitment_point,struct pubkey msgdata,onchain_init,old_remote_per_commitment_point,pubkey,
10 # Remote per commit point for current tx (needed if we haven't got revoke_and_ack yet).
11 onchain_init,,remote_per_commitment_point,struct pubkey msgdata,onchain_init,remote_per_commitment_point,pubkey,
12 onchain_init,,local_to_self_delay,u32 msgdata,onchain_init,local_to_self_delay,u32,
13 onchain_init,,remote_to_self_delay,u32 msgdata,onchain_init,remote_to_self_delay,u32,
14 onchain_init,,feerate_per_kw,u32 msgdata,onchain_init,feerate_per_kw,u32,
15 onchain_init,,local_dust_limit_satoshi,struct amount_sat msgdata,onchain_init,local_dust_limit_satoshi,amount_sat,
16 # Gives an easy way to tell if it's our unilateral close or theirs...
17 onchain_init,,our_broadcast_txid,struct bitcoin_txid msgdata,onchain_init,our_broadcast_txid,bitcoin_txid,
18 onchain_init,,local_scriptpubkey_len,u16 msgdata,onchain_init,local_scriptpubkey_len,u16,
19 onchain_init,,local_scriptpubkey,local_scriptpubkey_len*u8 msgdata,onchain_init,local_scriptpubkey,u8,local_scriptpubkey_len
20 onchain_init,,remote_scriptpubkey_len,u16 msgdata,onchain_init,remote_scriptpubkey_len,u16,
21 onchain_init,,remote_scriptpubkey,remote_scriptpubkey_len*u8 msgdata,onchain_init,remote_scriptpubkey,u8,remote_scriptpubkey_len
22 onchain_init,,ourwallet_pubkey,struct pubkey msgdata,onchain_init,ourwallet_pubkey,pubkey,
23 # We need these two for commit number obscurer
24 onchain_init,,funder,enum side msgdata,onchain_init,funder,e:side,
25 onchain_init,,local_basepoints,struct basepoints msgdata,onchain_init,local_basepoints,basepoints,
26 onchain_init,,remote_basepoints,struct basepoints msgdata,onchain_init,remote_basepoints,basepoints,
27 onchain_init,,tx,struct bitcoin_tx msgdata,onchain_init,tx,bitcoin_tx,
28 onchain_init,,tx_blockheight,u32 msgdata,onchain_init,tx_blockheight,u32,
29 onchain_init,,reasonable_depth,u32 msgdata,onchain_init,reasonable_depth,u32,
30 onchain_init,,num_htlc_sigs,u16 msgdata,onchain_init,num_htlc_sigs,u16,
31 onchain_init,,htlc_signature,num_htlc_sigs*secp256k1_ecdsa_signature msgdata,onchain_init,htlc_signature,secp256k1_ecdsa_signature,num_htlc_sigs
32 onchain_init,,num_htlcs,u64 msgdata,onchain_init,num_htlcs,u64,
33 onchain_init,,min_possible_feerate,u32 msgdata,onchain_init,min_possible_feerate,u32,
34 onchain_init,,max_possible_feerate,u32 msgdata,onchain_init,max_possible_feerate,u32,
35 onchain_init,,possible_remote_per_commit_point,?struct pubkey msgdata,onchain_init,possible_remote_per_commit_point,?pubkey,
36 #include <onchaind/onchain_wire.h>
37 # This is all the HTLCs: one per message
38 onchain_htlc,5002 msgtype,onchain_htlc,5002
39 onchain_htlc,,htlc,struct htlc_stub msgdata,onchain_htlc,htlc,htlc_stub,
40 # If it's not in the commitment tx, tell us (immediately or htlc_missing_depth)
41 onchain_htlc,,tell_if_missing,bool msgdata,onchain_htlc,tell_if_missing,bool,
42 onchain_htlc,,tell_immediately,bool msgdata,onchain_htlc,tell_immediately,bool,
43 # This says we're ready; give us preimages.
44 onchain_init_reply,5101 msgtype,onchain_init_reply,5101
45 # onchaind->master: Send out a tx.
46 onchain_broadcast_tx,5003 msgtype,onchain_broadcast_tx,5003
47 onchain_broadcast_tx,,tx,struct bitcoin_tx msgdata,onchain_broadcast_tx,tx,bitcoin_tx,
48 onchain_broadcast_tx,,type,enum wallet_tx_type msgdata,onchain_broadcast_tx,type,e:wallet_tx_type,
49 # master->onchaind: Notifier that an output has been spent by input_num of tx.
50 onchain_spent,5004 msgtype,onchain_spent,5004
51 onchain_spent,,tx,struct bitcoin_tx msgdata,onchain_spent,tx,bitcoin_tx,
52 onchain_spent,,input_num,u32 msgdata,onchain_spent,input_num,u32,
53 onchain_spent,,blockheight,u32 msgdata,onchain_spent,blockheight,u32,
54 # master->onchaind: We will receive more than one of these, as depth changes.
55 onchain_depth,5005 msgtype,onchain_depth,5005
56 onchain_depth,,txid,struct bitcoin_txid msgdata,onchain_depth,txid,bitcoin_txid,
57 onchain_depth,,depth,u32 msgdata,onchain_depth,depth,u32,
58 # onchaind->master: We don't want to watch this tx, or its outputs
59 onchain_unwatch_tx,5006 msgtype,onchain_unwatch_tx,5006
60 onchain_unwatch_tx,,txid,struct bitcoin_txid msgdata,onchain_unwatch_tx,txid,bitcoin_txid,
61 # master->onchaind: We know HTLC preimage
62 onchain_known_preimage,5007 msgtype,onchain_known_preimage,5007
63 onchain_known_preimage,,preimage,struct preimage msgdata,onchain_known_preimage,preimage,preimage,
64 # onchaind->master: We discovered HTLC preimage
65 onchain_extracted_preimage,5008 msgtype,onchain_extracted_preimage,5008
66 onchain_extracted_preimage,,preimage,struct preimage msgdata,onchain_extracted_preimage,preimage,preimage,
67 # onchaind->master: this HTLC was missing from commit tx.
68 onchain_missing_htlc_output,5009 msgtype,onchain_missing_htlc_output,5009
69 onchain_missing_htlc_output,,htlc,struct htlc_stub msgdata,onchain_missing_htlc_output,htlc,htlc_stub,
70 # onchaind->master: this HTLC has timed out (after reasonable_depth)
71 onchain_htlc_timeout,5010 msgtype,onchain_htlc_timeout,5010
72 onchain_htlc_timeout,,htlc,struct htlc_stub msgdata,onchain_htlc_timeout,htlc,htlc_stub,
73 # onchaind->master: this peer can be forgotten
74 onchain_all_irrevocably_resolved,5011 msgtype,onchain_all_irrevocably_resolved,5011
75 # onchaind->master: hey, I identified an UTXO you'll want to track
76 onchain_add_utxo,5012 msgtype,onchain_add_utxo,5012
77 onchain_add_utxo,,prev_out_tx,struct bitcoin_txid msgdata,onchain_add_utxo,prev_out_tx,bitcoin_txid,
78 onchain_add_utxo,,prev_out_index,u32 msgdata,onchain_add_utxo,prev_out_index,u32,
79 onchain_add_utxo,,per_commit_point,struct pubkey msgdata,onchain_add_utxo,per_commit_point,pubkey,
80 onchain_add_utxo,,value,struct amount_sat msgdata,onchain_add_utxo,value,amount_sat,
81 onchain_add_utxo,,blockheight,u32 msgdata,onchain_add_utxo,blockheight,u32,
82 onchain_add_utxo,,len,u16 msgdata,onchain_add_utxo,len,u16,
83 onchain_add_utxo,,scriptpubkey,len*u8 msgdata,onchain_add_utxo,scriptpubkey,u8,len
84 # master -> onchaind: do you have a memleak?
85 onchain_dev_memleak,5033 msgtype,onchain_dev_memleak,5033
86 onchain_dev_memleak_reply,5133 msgtype,onchain_dev_memleak_reply,5133
87 onchain_dev_memleak_reply,,leak,bool msgdata,onchain_dev_memleak_reply,leak,bool,
88 # Tell the main daemon what we've been watching, mainly used for transactions
89 # that we tracked automatically but only onchaind knows how to classify their
90 # transactions.
91 onchain_transaction_annotate,5034 msgtype,onchain_transaction_annotate,5034
92 onchain_transaction_annotate,,txid,struct bitcoin_txid msgdata,onchain_transaction_annotate,txid,bitcoin_txid,
93 onchain_transaction_annotate,,type,enum wallet_tx_type msgdata,onchain_transaction_annotate,type,e:wallet_tx_type,
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109

View File

@@ -80,10 +80,10 @@ OPENINGD_COMMON_OBJS := \
$(LIGHTNINGD_OPENING_OBJS): $(LIGHTNINGD_HEADERS)
openingd/gen_opening_wire.h: $(WIRE_GEN) openingd/opening_wire.csv
$(WIRE_GEN) --header $@ opening_wire_type < openingd/opening_wire.csv > $@
$(WIRE_GEN) --page header $@ opening_wire_type < openingd/opening_wire.csv > $@
openingd/gen_opening_wire.c: $(WIRE_GEN) openingd/opening_wire.csv
$(WIRE_GEN) ${@:.c=.h} opening_wire_type < openingd/opening_wire.csv > $@
$(WIRE_GEN) --page impl ${@:.c=.h} opening_wire_type < openingd/opening_wire.csv > $@
LIGHTNINGD_OPENING_OBJS := $(LIGHTNINGD_OPENING_SRC:.c=.o) $(LIGHTNINGD_OPENING_GEN_SRC:.c=.o)

View File

@@ -3,136 +3,136 @@
#include <common/derive_basepoints.h>
#include <common/per_peer_state.h>
opening_init,6000
msgtype,opening_init,6000
# Which network are we configured for?
opening_init,,chain_hash,struct bitcoin_blkid
msgdata,opening_init,chain_hash,bitcoin_blkid,
# Base configuration we'll offer (channel reserve will vary with amount)
opening_init,,our_config,struct channel_config
msgdata,opening_init,our_config,channel_config,
# Minimum/maximum configuration values we'll accept
opening_init,,max_to_self_delay,u32
opening_init,,min_effective_htlc_capacity_msat,struct amount_msat
opening_init,,pps,struct per_peer_state
opening_init,,our_basepoints,struct basepoints
opening_init,,our_funding_pubkey,struct pubkey
msgdata,opening_init,max_to_self_delay,u32,
msgdata,opening_init,min_effective_htlc_capacity_msat,amount_msat,
msgdata,opening_init,pps,per_peer_state,
msgdata,opening_init,our_basepoints,basepoints,
msgdata,opening_init,our_funding_pubkey,pubkey,
# Constraints in case the other end tries to open a channel.
opening_init,,minimum_depth,u32
opening_init,,min_feerate,u32
opening_init,,max_feerate,u32
opening_init,,lfeatures_len,u16
opening_init,,lfeatures,lfeatures_len*u8
msgdata,opening_init,minimum_depth,u32,
msgdata,opening_init,min_feerate,u32,
msgdata,opening_init,max_feerate,u32,
msgdata,opening_init,lfeatures_len,u16,
msgdata,opening_init,lfeatures,u8,lfeatures_len
# Optional msg to send.
opening_init,,len,u16
opening_init,,msg,len*u8
msgdata,opening_init,len,u16,
msgdata,opening_init,msg,u8,len
# Openingd->master: they offered channel, should we continue?
opening_got_offer,6005
opening_got_offer,,funding_satoshis,struct amount_sat
opening_got_offer,,push_msat,struct amount_msat
opening_got_offer,,dust_limit_satoshis,struct amount_sat
opening_got_offer,,max_htlc_value_in_flight_msat,struct amount_msat
opening_got_offer,,channel_reserve_satoshis,struct amount_sat
opening_got_offer,,htlc_minimum_msat,struct amount_msat
opening_got_offer,,feerate_per_kw,u32
opening_got_offer,,to_self_delay,u16
opening_got_offer,,max_accepted_htlcs,u16
opening_got_offer,,channel_flags,u8
opening_got_offer,,shutdown_len,u16
opening_got_offer,,shutdown_scriptpubkey,shutdown_len*u8
msgtype,opening_got_offer,6005
msgdata,opening_got_offer,funding_satoshis,amount_sat,
msgdata,opening_got_offer,push_msat,amount_msat,
msgdata,opening_got_offer,dust_limit_satoshis,amount_sat,
msgdata,opening_got_offer,max_htlc_value_in_flight_msat,amount_msat,
msgdata,opening_got_offer,channel_reserve_satoshis,amount_sat,
msgdata,opening_got_offer,htlc_minimum_msat,amount_msat,
msgdata,opening_got_offer,feerate_per_kw,u32,
msgdata,opening_got_offer,to_self_delay,u16,
msgdata,opening_got_offer,max_accepted_htlcs,u16,
msgdata,opening_got_offer,channel_flags,u8,
msgdata,opening_got_offer,shutdown_len,u16,
msgdata,opening_got_offer,shutdown_scriptpubkey,u8,shutdown_len
# master->openingd: optional rejection message
opening_got_offer_reply,6105
opening_got_offer_reply,,rejection,?wirestring
msgtype,opening_got_offer_reply,6105
msgdata,opening_got_offer_reply,rejection,?wirestring,
#include <common/bip32.h>
#include <common/htlc_wire.h>
# Master->openingd: please fund a channel.
opening_funder,6001
opening_funder,,funding_satoshis,struct amount_sat
opening_funder,,push_msat,struct amount_msat
opening_funder,,feerate_per_kw,u32
opening_funder,,change_satoshis,struct amount_sat
opening_funder,,change_keyindex,u32
opening_funder,,channel_flags,u8
msgtype,opening_funder,6001
msgdata,opening_funder,funding_satoshis,amount_sat,
msgdata,opening_funder,push_msat,amount_msat,
msgdata,opening_funder,feerate_per_kw,u32,
msgdata,opening_funder,change_satoshis,amount_sat,
msgdata,opening_funder,change_keyindex,u32,
msgdata,opening_funder,channel_flags,u8,
#include <common/utxo.h>
opening_funder,,num_inputs,u16
opening_funder,,inputs,num_inputs*struct utxo
opening_funder,,bip32,struct ext_key
msgdata,opening_funder,num_inputs,u16,
msgdata,opening_funder,inputs,utxo,num_inputs
msgdata,opening_funder,bip32,ext_key,
# Openingd->master: we've successfully offered channel.
# This gives their sig, means we can broadcast tx: we're done.
opening_funder_reply,6101
opening_funder_reply,,their_config,struct channel_config
opening_funder_reply,,first_commit,struct bitcoin_tx
opening_funder_reply,,first_commit_sig,struct bitcoin_signature
opening_funder_reply,,pps,struct per_peer_state
opening_funder_reply,,revocation_basepoint,struct pubkey
opening_funder_reply,,payment_basepoint,struct pubkey
opening_funder_reply,,htlc_basepoint,struct pubkey
opening_funder_reply,,delayed_payment_basepoint,struct pubkey
opening_funder_reply,,their_per_commit_point,struct pubkey
opening_funder_reply,,minimum_depth,u32
opening_funder_reply,,remote_fundingkey,struct pubkey
opening_funder_reply,,funding_txid,struct bitcoin_txid
opening_funder_reply,,funding_txout,u16
opening_funder_reply,,feerate_per_kw,u32
opening_funder_reply,,our_channel_reserve_satoshis,struct amount_sat
opening_funder_reply,,shutdown_len,u16
opening_funder_reply,,shutdown_scriptpubkey,shutdown_len*u8
msgtype,opening_funder_reply,6101
msgdata,opening_funder_reply,their_config,channel_config,
msgdata,opening_funder_reply,first_commit,bitcoin_tx,
msgdata,opening_funder_reply,first_commit_sig,bitcoin_signature,
msgdata,opening_funder_reply,pps,per_peer_state,
msgdata,opening_funder_reply,revocation_basepoint,pubkey,
msgdata,opening_funder_reply,payment_basepoint,pubkey,
msgdata,opening_funder_reply,htlc_basepoint,pubkey,
msgdata,opening_funder_reply,delayed_payment_basepoint,pubkey,
msgdata,opening_funder_reply,their_per_commit_point,pubkey,
msgdata,opening_funder_reply,minimum_depth,u32,
msgdata,opening_funder_reply,remote_fundingkey,pubkey,
msgdata,opening_funder_reply,funding_txid,bitcoin_txid,
msgdata,opening_funder_reply,funding_txout,u16,
msgdata,opening_funder_reply,feerate_per_kw,u32,
msgdata,opening_funder_reply,our_channel_reserve_satoshis,amount_sat,
msgdata,opening_funder_reply,shutdown_len,u16,
msgdata,opening_funder_reply,shutdown_scriptpubkey,u8,shutdown_len
# master->openingd: start channel establishment for a funding
# tx that will be paid for by an external wallet
opening_funder_start,6002
opening_funder_start,,funding_satoshis,struct amount_sat
opening_funder_start,,push_msat,struct amount_msat
opening_funder_start,,feerate_per_kw,u32
opening_funder_start,,channel_flags,u8
msgtype,opening_funder_start,6002
msgdata,opening_funder_start,funding_satoshis,amount_sat,
msgdata,opening_funder_start,push_msat,amount_msat,
msgdata,opening_funder_start,feerate_per_kw,u32,
msgdata,opening_funder_start,channel_flags,u8,
# openingd->master: send back output script for 2-of-2 funding output
opening_funder_start_reply,6102
opening_funder_start_reply,,script_len,u8
opening_funder_start_reply,,scriptpubkey,script_len*u8
msgtype,opening_funder_start_reply,6102
msgdata,opening_funder_start_reply,script_len,u8,
msgdata,opening_funder_start_reply,scriptpubkey,u8,script_len
# master->openingd: complete channel establishment for a funding
# tx that will be paid for by an external wallet
# response to this is a normal `opening_funder_reply` ??
opening_funder_complete,6012
opening_funder_complete,,funding_txid,struct bitcoin_txid
opening_funder_complete,,funding_txout,u16
msgtype,opening_funder_complete,6012
msgdata,opening_funder_complete,funding_txid,bitcoin_txid,
msgdata,opening_funder_complete,funding_txout,u16,
#master->openingd: cancel channel establishment for a funding
opening_funder_cancel,6013
msgtype,opening_funder_cancel,6013
# Openingd->master: we failed to negotiation channel
opening_funder_failed,6004
opening_funder_failed,,reason,wirestring
msgtype,opening_funder_failed,6004
msgdata,opening_funder_failed,reason,wirestring,
# Openingd->master: they offered channel.
# This gives their txid and info, means we can send funding_signed: we're done.
opening_fundee,6003
opening_fundee,,their_config,struct channel_config
opening_fundee,,first_commit,struct bitcoin_tx
opening_fundee,,first_commit_sig,struct bitcoin_signature
opening_fundee,,pps,struct per_peer_state
opening_fundee,,revocation_basepoint,struct pubkey
opening_fundee,,payment_basepoint,struct pubkey
opening_fundee,,htlc_basepoint,struct pubkey
opening_fundee,,delayed_payment_basepoint,struct pubkey
opening_fundee,,their_per_commit_point,struct pubkey
opening_fundee,,remote_fundingkey,struct pubkey
opening_fundee,,funding_txid,struct bitcoin_txid
opening_fundee,,funding_txout,u16
opening_fundee,,funding_satoshis,struct amount_sat
opening_fundee,,push_msat,struct amount_msat
opening_fundee,,channel_flags,u8
opening_fundee,,feerate_per_kw,u32
msgtype,opening_fundee,6003
msgdata,opening_fundee,their_config,channel_config,
msgdata,opening_fundee,first_commit,bitcoin_tx,
msgdata,opening_fundee,first_commit_sig,bitcoin_signature,
msgdata,opening_fundee,pps,per_peer_state,
msgdata,opening_fundee,revocation_basepoint,pubkey,
msgdata,opening_fundee,payment_basepoint,pubkey,
msgdata,opening_fundee,htlc_basepoint,pubkey,
msgdata,opening_fundee,delayed_payment_basepoint,pubkey,
msgdata,opening_fundee,their_per_commit_point,pubkey,
msgdata,opening_fundee,remote_fundingkey,pubkey,
msgdata,opening_fundee,funding_txid,bitcoin_txid,
msgdata,opening_fundee,funding_txout,u16,
msgdata,opening_fundee,funding_satoshis,amount_sat,
msgdata,opening_fundee,push_msat,amount_msat,
msgdata,opening_fundee,channel_flags,u8,
msgdata,opening_fundee,feerate_per_kw,u32,
# The funding signed message: send this and we're committed.
opening_fundee,,msglen,u16
opening_fundee,,funding_signed_msg,msglen*u8
opening_fundee,,our_channel_reserve_satoshis,struct amount_sat
opening_fundee,,shutdown_len,u16
opening_fundee,,shutdown_scriptpubkey,shutdown_len*u8
msgdata,opening_fundee,msglen,u16,
msgdata,opening_fundee,funding_signed_msg,u8,msglen
msgdata,opening_fundee,our_channel_reserve_satoshis,amount_sat,
msgdata,opening_fundee,shutdown_len,u16,
msgdata,opening_fundee,shutdown_scriptpubkey,u8,shutdown_len
# master -> openingd: do you have a memleak?
opening_dev_memleak,6033
msgtype,opening_dev_memleak,6033
opening_dev_memleak_reply,6133
opening_dev_memleak_reply,,leak,bool
msgtype,opening_dev_memleak_reply,6133
msgdata,opening_dev_memleak_reply,leak,bool,
1 #include <common/cryptomsg.h>
3 #include <common/derive_basepoints.h>
4 #include <common/per_peer_state.h>
5 opening_init,6000 msgtype,opening_init,6000
6 # Which network are we configured for?
7 opening_init,,chain_hash,struct bitcoin_blkid msgdata,opening_init,chain_hash,bitcoin_blkid,
8 # Base configuration we'll offer (channel reserve will vary with amount)
9 opening_init,,our_config,struct channel_config msgdata,opening_init,our_config,channel_config,
10 # Minimum/maximum configuration values we'll accept
11 opening_init,,max_to_self_delay,u32 msgdata,opening_init,max_to_self_delay,u32,
12 opening_init,,min_effective_htlc_capacity_msat,struct amount_msat msgdata,opening_init,min_effective_htlc_capacity_msat,amount_msat,
13 opening_init,,pps,struct per_peer_state msgdata,opening_init,pps,per_peer_state,
14 opening_init,,our_basepoints,struct basepoints msgdata,opening_init,our_basepoints,basepoints,
15 opening_init,,our_funding_pubkey,struct pubkey msgdata,opening_init,our_funding_pubkey,pubkey,
16 # Constraints in case the other end tries to open a channel.
17 opening_init,,minimum_depth,u32 msgdata,opening_init,minimum_depth,u32,
18 opening_init,,min_feerate,u32 msgdata,opening_init,min_feerate,u32,
19 opening_init,,max_feerate,u32 msgdata,opening_init,max_feerate,u32,
20 opening_init,,lfeatures_len,u16 msgdata,opening_init,lfeatures_len,u16,
21 opening_init,,lfeatures,lfeatures_len*u8 msgdata,opening_init,lfeatures,u8,lfeatures_len
22 # Optional msg to send.
23 opening_init,,len,u16 msgdata,opening_init,len,u16,
24 opening_init,,msg,len*u8 msgdata,opening_init,msg,u8,len
25 # Openingd->master: they offered channel, should we continue?
26 opening_got_offer,6005 msgtype,opening_got_offer,6005
27 opening_got_offer,,funding_satoshis,struct amount_sat msgdata,opening_got_offer,funding_satoshis,amount_sat,
28 opening_got_offer,,push_msat,struct amount_msat msgdata,opening_got_offer,push_msat,amount_msat,
29 opening_got_offer,,dust_limit_satoshis,struct amount_sat msgdata,opening_got_offer,dust_limit_satoshis,amount_sat,
30 opening_got_offer,,max_htlc_value_in_flight_msat,struct amount_msat msgdata,opening_got_offer,max_htlc_value_in_flight_msat,amount_msat,
31 opening_got_offer,,channel_reserve_satoshis,struct amount_sat msgdata,opening_got_offer,channel_reserve_satoshis,amount_sat,
32 opening_got_offer,,htlc_minimum_msat,struct amount_msat msgdata,opening_got_offer,htlc_minimum_msat,amount_msat,
33 opening_got_offer,,feerate_per_kw,u32 msgdata,opening_got_offer,feerate_per_kw,u32,
34 opening_got_offer,,to_self_delay,u16 msgdata,opening_got_offer,to_self_delay,u16,
35 opening_got_offer,,max_accepted_htlcs,u16 msgdata,opening_got_offer,max_accepted_htlcs,u16,
36 opening_got_offer,,channel_flags,u8 msgdata,opening_got_offer,channel_flags,u8,
37 opening_got_offer,,shutdown_len,u16 msgdata,opening_got_offer,shutdown_len,u16,
38 opening_got_offer,,shutdown_scriptpubkey,shutdown_len*u8 msgdata,opening_got_offer,shutdown_scriptpubkey,u8,shutdown_len
39 # master->openingd: optional rejection message
40 opening_got_offer_reply,6105 msgtype,opening_got_offer_reply,6105
41 opening_got_offer_reply,,rejection,?wirestring msgdata,opening_got_offer_reply,rejection,?wirestring,
42 #include <common/bip32.h>
43 #include <common/htlc_wire.h>
44 # Master->openingd: please fund a channel.
45 opening_funder,6001 msgtype,opening_funder,6001
46 opening_funder,,funding_satoshis,struct amount_sat msgdata,opening_funder,funding_satoshis,amount_sat,
47 opening_funder,,push_msat,struct amount_msat msgdata,opening_funder,push_msat,amount_msat,
48 opening_funder,,feerate_per_kw,u32 msgdata,opening_funder,feerate_per_kw,u32,
49 opening_funder,,change_satoshis,struct amount_sat msgdata,opening_funder,change_satoshis,amount_sat,
50 opening_funder,,change_keyindex,u32 msgdata,opening_funder,change_keyindex,u32,
51 opening_funder,,channel_flags,u8 msgdata,opening_funder,channel_flags,u8,
52 #include <common/utxo.h>
53 opening_funder,,num_inputs,u16 msgdata,opening_funder,num_inputs,u16,
54 opening_funder,,inputs,num_inputs*struct utxo msgdata,opening_funder,inputs,utxo,num_inputs
55 opening_funder,,bip32,struct ext_key msgdata,opening_funder,bip32,ext_key,
56 # Openingd->master: we've successfully offered channel.
57 # This gives their sig, means we can broadcast tx: we're done.
58 opening_funder_reply,6101 msgtype,opening_funder_reply,6101
59 opening_funder_reply,,their_config,struct channel_config msgdata,opening_funder_reply,their_config,channel_config,
60 opening_funder_reply,,first_commit,struct bitcoin_tx msgdata,opening_funder_reply,first_commit,bitcoin_tx,
61 opening_funder_reply,,first_commit_sig,struct bitcoin_signature msgdata,opening_funder_reply,first_commit_sig,bitcoin_signature,
62 opening_funder_reply,,pps,struct per_peer_state msgdata,opening_funder_reply,pps,per_peer_state,
63 opening_funder_reply,,revocation_basepoint,struct pubkey msgdata,opening_funder_reply,revocation_basepoint,pubkey,
64 opening_funder_reply,,payment_basepoint,struct pubkey msgdata,opening_funder_reply,payment_basepoint,pubkey,
65 opening_funder_reply,,htlc_basepoint,struct pubkey msgdata,opening_funder_reply,htlc_basepoint,pubkey,
66 opening_funder_reply,,delayed_payment_basepoint,struct pubkey msgdata,opening_funder_reply,delayed_payment_basepoint,pubkey,
67 opening_funder_reply,,their_per_commit_point,struct pubkey msgdata,opening_funder_reply,their_per_commit_point,pubkey,
68 opening_funder_reply,,minimum_depth,u32 msgdata,opening_funder_reply,minimum_depth,u32,
69 opening_funder_reply,,remote_fundingkey,struct pubkey msgdata,opening_funder_reply,remote_fundingkey,pubkey,
70 opening_funder_reply,,funding_txid,struct bitcoin_txid msgdata,opening_funder_reply,funding_txid,bitcoin_txid,
71 opening_funder_reply,,funding_txout,u16 msgdata,opening_funder_reply,funding_txout,u16,
72 opening_funder_reply,,feerate_per_kw,u32 msgdata,opening_funder_reply,feerate_per_kw,u32,
73 opening_funder_reply,,our_channel_reserve_satoshis,struct amount_sat msgdata,opening_funder_reply,our_channel_reserve_satoshis,amount_sat,
74 opening_funder_reply,,shutdown_len,u16 msgdata,opening_funder_reply,shutdown_len,u16,
75 opening_funder_reply,,shutdown_scriptpubkey,shutdown_len*u8 msgdata,opening_funder_reply,shutdown_scriptpubkey,u8,shutdown_len
76 # master->openingd: start channel establishment for a funding
77 # tx that will be paid for by an external wallet
78 opening_funder_start,6002 msgtype,opening_funder_start,6002
79 opening_funder_start,,funding_satoshis,struct amount_sat msgdata,opening_funder_start,funding_satoshis,amount_sat,
80 opening_funder_start,,push_msat,struct amount_msat msgdata,opening_funder_start,push_msat,amount_msat,
81 opening_funder_start,,feerate_per_kw,u32 msgdata,opening_funder_start,feerate_per_kw,u32,
82 opening_funder_start,,channel_flags,u8 msgdata,opening_funder_start,channel_flags,u8,
83 # openingd->master: send back output script for 2-of-2 funding output
84 opening_funder_start_reply,6102 msgtype,opening_funder_start_reply,6102
85 opening_funder_start_reply,,script_len,u8 msgdata,opening_funder_start_reply,script_len,u8,
86 opening_funder_start_reply,,scriptpubkey,script_len*u8 msgdata,opening_funder_start_reply,scriptpubkey,u8,script_len
87 # master->openingd: complete channel establishment for a funding
88 # tx that will be paid for by an external wallet
89 # response to this is a normal `opening_funder_reply` ??
90 opening_funder_complete,6012 msgtype,opening_funder_complete,6012
91 opening_funder_complete,,funding_txid,struct bitcoin_txid msgdata,opening_funder_complete,funding_txid,bitcoin_txid,
92 opening_funder_complete,,funding_txout,u16 msgdata,opening_funder_complete,funding_txout,u16,
93 #master->openingd: cancel channel establishment for a funding
94 opening_funder_cancel,6013 msgtype,opening_funder_cancel,6013
95 # Openingd->master: we failed to negotiation channel
96 opening_funder_failed,6004 msgtype,opening_funder_failed,6004
97 opening_funder_failed,,reason,wirestring msgdata,opening_funder_failed,reason,wirestring,
98 # Openingd->master: they offered channel.
99 # This gives their txid and info, means we can send funding_signed: we're done.
100 opening_fundee,6003 msgtype,opening_fundee,6003
101 opening_fundee,,their_config,struct channel_config msgdata,opening_fundee,their_config,channel_config,
102 opening_fundee,,first_commit,struct bitcoin_tx msgdata,opening_fundee,first_commit,bitcoin_tx,
103 opening_fundee,,first_commit_sig,struct bitcoin_signature msgdata,opening_fundee,first_commit_sig,bitcoin_signature,
104 opening_fundee,,pps,struct per_peer_state msgdata,opening_fundee,pps,per_peer_state,
105 opening_fundee,,revocation_basepoint,struct pubkey msgdata,opening_fundee,revocation_basepoint,pubkey,
106 opening_fundee,,payment_basepoint,struct pubkey msgdata,opening_fundee,payment_basepoint,pubkey,
107 opening_fundee,,htlc_basepoint,struct pubkey msgdata,opening_fundee,htlc_basepoint,pubkey,
108 opening_fundee,,delayed_payment_basepoint,struct pubkey msgdata,opening_fundee,delayed_payment_basepoint,pubkey,
109 opening_fundee,,their_per_commit_point,struct pubkey msgdata,opening_fundee,their_per_commit_point,pubkey,
110 opening_fundee,,remote_fundingkey,struct pubkey msgdata,opening_fundee,remote_fundingkey,pubkey,
111 opening_fundee,,funding_txid,struct bitcoin_txid msgdata,opening_fundee,funding_txid,bitcoin_txid,
112 opening_fundee,,funding_txout,u16 msgdata,opening_fundee,funding_txout,u16,
113 opening_fundee,,funding_satoshis,struct amount_sat msgdata,opening_fundee,funding_satoshis,amount_sat,
114 opening_fundee,,push_msat,struct amount_msat msgdata,opening_fundee,push_msat,amount_msat,
115 opening_fundee,,channel_flags,u8 msgdata,opening_fundee,channel_flags,u8,
116 opening_fundee,,feerate_per_kw,u32 msgdata,opening_fundee,feerate_per_kw,u32,
117 # The funding signed message: send this and we're committed.
118 opening_fundee,,msglen,u16 msgdata,opening_fundee,msglen,u16,
119 opening_fundee,,funding_signed_msg,msglen*u8 msgdata,opening_fundee,funding_signed_msg,u8,msglen
120 opening_fundee,,our_channel_reserve_satoshis,struct amount_sat msgdata,opening_fundee,our_channel_reserve_satoshis,amount_sat,
121 opening_fundee,,shutdown_len,u16 msgdata,opening_fundee,shutdown_len,u16,
122 opening_fundee,,shutdown_scriptpubkey,shutdown_len*u8 msgdata,opening_fundee,shutdown_scriptpubkey,u8,shutdown_len
123 # master -> openingd: do you have a memleak?
124 opening_dev_memleak,6033 msgtype,opening_dev_memleak,6033
125 opening_dev_memleak_reply,6133 msgtype,opening_dev_memleak_reply,6133
126 opening_dev_memleak_reply,,leak,bool msgdata,opening_dev_memleak_reply,leak,bool,
127
128
129
130
131
132
133
134
135
136
137
138

View File

@@ -169,6 +169,9 @@ class Type(FieldSet):
'u64',
'bool',
'secp256k1_ecdsa_signature',
'secp256k1_ecdsa_recoverable_signature',
'wirestring',
'double',
]
truncated_typedefs = [
@@ -576,6 +579,7 @@ def main(options, args=None, output=sys.stdout, lines=None):
msg.add_data_field(tokens[2], type_obj, count, comments=list(comment_set),
optional=optional)
comment_set = []
elif token_type.startswith('#include'):
master.add_include(token_type)