mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 09:54:16 +01:00
deecedb033
This avoids races in our tests where we assume it's sync (and is kind of nicer). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
5.5 KiB
5.5 KiB
1 | #include <bitcoin/block.h> |
---|---|
2 | #include <common/cryptomsg.h> |
3 | #include <common/features.h> |
4 | #include <common/node_id.h> |
5 | #include <common/wireaddr.h> |
6 | #include <wire/onion_wire.h> |
7 | msgtype,connectd_init,2000 |
8 | msgdata,connectd_init,chainparams,chainparams, |
9 | msgdata,connectd_init,our_features,feature_set, |
10 | msgdata,connectd_init,id,node_id, |
11 | msgdata,connectd_init,num_wireaddrs,u16, |
12 | msgdata,connectd_init,wireaddrs,wireaddr_internal,num_wireaddrs |
13 | msgdata,connectd_init,listen_announce,enum addr_listen_announce,num_wireaddrs |
14 | msgdata,connectd_init,tor_proxyaddr,?wireaddr, |
15 | msgdata,connectd_init,use_tor_proxy_always,bool, |
16 | msgdata,connectd_init,dev_allow_localhost,bool, |
17 | msgdata,connectd_init,use_dns,bool, |
18 | msgdata,connectd_init,tor_password,wirestring, |
19 | msgdata,connectd_init,use_v3_autotor,bool, |
20 | msgdata,connectd_init,timeout_secs,u32, |
21 | msgdata,connectd_init,websocket_helper,wirestring, |
22 | msgdata,connectd_init,websocket_port,u16, |
23 | msgdata,connectd_init,dev_fast_gossip,bool, |
24 | # If this is set, then fd 5 is dev_disconnect_fd. |
25 | msgdata,connectd_init,dev_disconnect,bool, |
26 | # Connectd->master, here are the addresses I bound, can announce. |
27 | msgtype,connectd_init_reply,2100 |
28 | msgdata,connectd_init_reply,num_bindings,u16, |
29 | msgdata,connectd_init_reply,bindings,wireaddr_internal,num_bindings |
30 | msgdata,connectd_init_reply,num_announceable,u16, |
31 | msgdata,connectd_init_reply,announceable,wireaddr,num_announceable |
32 | msgdata,connectd_init_reply,failmsg,?wirestring, |
33 | # Activate the connect daemon, so others can connect. |
34 | msgtype,connectd_activate,2025 |
35 | # Do we listen? |
36 | msgdata,connectd_activate,listen,bool, |
37 | # Connectd->master, I am ready. |
38 | msgtype,connectd_activate_reply,2125 |
39 | msgdata,connectd_activate_reply,failmsg,?wirestring, |
40 | # connectd->master: disconnect this peer please (due to reconnect). |
41 | msgtype,connectd_reconnected,2112 |
42 | msgdata,connectd_reconnected,id,node_id, |
43 | # Master -> connectd: connect to a peer. |
44 | msgtype,connectd_connect_to_peer,2001 |
45 | msgdata,connectd_connect_to_peer,id,node_id, |
46 | msgdata,connectd_connect_to_peer,seconds_waited,u32, |
47 | msgdata,connectd_connect_to_peer,len,u32, |
48 | msgdata,connectd_connect_to_peer,addrs,wireaddr,len |
49 | msgdata,connectd_connect_to_peer,addrhint,?wireaddr_internal, |
50 | # Connectd->master: connect failed. |
51 | msgtype,connectd_connect_failed,2020 |
52 | msgdata,connectd_connect_failed,id,node_id, |
53 | msgdata,connectd_connect_failed,failcode,errcode_t, |
54 | msgdata,connectd_connect_failed,failreason,wirestring, |
55 | msgdata,connectd_connect_failed,seconds_to_delay,u32, |
56 | msgdata,connectd_connect_failed,addrhint,?wireaddr_internal, |
57 | # Connectd -> master: we got a peer. Plus fd for peer daemon |
58 | msgtype,connectd_peer_connected,2002 |
59 | msgdata,connectd_peer_connected,id,node_id, |
60 | msgdata,connectd_peer_connected,addr,wireaddr_internal, |
61 | msgdata,connectd_peer_connected,remote_addr,?wireaddr, |
62 | msgdata,connectd_peer_connected,incoming,bool, |
63 | msgdata,connectd_peer_connected,flen,u16, |
64 | msgdata,connectd_peer_connected,features,u8,flen |
65 | # connectd -> master: peer disconnected. |
66 | msgtype,connectd_peer_disconnect_done,2006 |
67 | msgdata,connectd_peer_disconnect_done,id,node_id, |
68 | # master -> connectd: peer no longer wanted, you can disconnect. |
69 | msgtype,connectd_discard_peer,2015 |
70 | msgdata,connectd_discard_peer,id,node_id, |
71 | # master -> connectd: give message to peer and disconnect. |
72 | msgtype,connectd_peer_final_msg,2003 |
73 | msgdata,connectd_peer_final_msg,id,node_id, |
74 | msgdata,connectd_peer_final_msg,len,u16, |
75 | msgdata,connectd_peer_final_msg,msg,u8,len |
76 | # connectd->master: You said to connect, but we already were. |
77 | msgtype,connectd_peer_already_connected,2007 |
78 | msgdata,connectd_peer_already_connected,id,node_id, |
79 | # master -> connectd: do you have a memleak? |
80 | msgtype,connectd_dev_memleak,2033 |
81 | msgtype,connectd_dev_memleak_reply,2133 |
82 | msgdata,connectd_dev_memleak_reply,leak,bool, |
83 | # Ping/pong test. Waits for a reply if it expects one. |
84 | msgtype,connectd_ping,2030 |
85 | msgdata,connectd_ping,id,node_id, |
86 | msgdata,connectd_ping,num_pong_bytes,u16, |
87 | msgdata,connectd_ping,len,u16, |
88 | msgtype,connectd_ping_reply,2130 |
89 | # False if we there was already a ping in progress. |
90 | msgdata,connectd_ping_reply,sent,bool, |
91 | # 0 == no pong expected, otherwise length of pong. |
92 | msgdata,connectd_ping_reply,totlen,u16, |
93 | # We tell lightningd we got an onionmsg |
94 | msgtype,connectd_got_onionmsg_to_us,2145 |
95 | msgdata,connectd_got_onionmsg_to_us,obs2,bool, |
96 | msgdata,connectd_got_onionmsg_to_us,node_alias,pubkey, |
97 | msgdata,connectd_got_onionmsg_to_us,self_id,?secret, |
98 | msgdata,connectd_got_onionmsg_to_us,reply_blinding,?pubkey, |
99 | msgdata,connectd_got_onionmsg_to_us,reply_first_node,?pubkey, |
100 | msgdata,connectd_got_onionmsg_to_us,reply_path_len,u16, |
101 | msgdata,connectd_got_onionmsg_to_us,reply_path,onionmsg_path,reply_path_len |
102 | msgdata,connectd_got_onionmsg_to_us,rawmsg_len,u16, |
103 | msgdata,connectd_got_onionmsg_to_us,rawmsg,u8,rawmsg_len |
104 | # Lightningd tells us to send an onion message. |
105 | msgtype,connectd_send_onionmsg,2041 |
106 | msgdata,connectd_send_onionmsg,obs2,bool, |
107 | msgdata,connectd_send_onionmsg,id,node_id, |
108 | msgdata,connectd_send_onionmsg,onion_len,u16, |
109 | msgdata,connectd_send_onionmsg,onion,u8,onion_len |
110 | msgdata,connectd_send_onionmsg,blinding,pubkey, |
111 | # A custom message that we got from a peer and don't know how to handle, so we |
112 | # forward it to the master for further handling. |
113 | msgtype,connectd_custommsg_in,2110 |
114 | msgdata,connectd_custommsg_in,id,node_id, |
115 | msgdata,connectd_custommsg_in,msg_len,u16, |
116 | msgdata,connectd_custommsg_in,msg,u8,msg_len |
117 | # A custom message that the lightningd tells us to send to the peer. |
118 | msgtype,connectd_custommsg_out,2011 |
119 | msgdata,connectd_custommsg_out,id,node_id, |
120 | msgdata,connectd_custommsg_out,msg_len,u16, |
121 | msgdata,connectd_custommsg_out,msg,u8,msg_len |