mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-20 02:27:51 +01:00
d40d22b68e
Someone could try to announce an internal address, and we might probe it. This breaks tests, so we add '--dev-allow-localhost' for our tests, so we don't eliminate that one. Of course, now we need to skip some more tests in non-developer mode. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
8.8 KiB
8.8 KiB
1 | #include <common/cryptomsg.h> |
---|---|
2 | #include <common/wireaddr.h> |
3 | #include <wire/gen_onion_wire.h> |
4 | # Initialize the gossip daemon. |
5 | gossipctl_init,3000 |
6 | gossipctl_init,,broadcast_interval,u32 |
7 | gossipctl_init,,chain_hash,struct bitcoin_blkid |
8 | gossipctl_init,,id,struct pubkey |
9 | gossipctl_init,,gflen,u16 |
10 | gossipctl_init,,gfeatures,gflen*u8 |
11 | gossipctl_init,,lflen,u16 |
12 | gossipctl_init,,lfeatures,lflen*u8 |
13 | gossipctl_init,,num_wireaddrs,u16 |
14 | gossipctl_init,,wireaddrs,num_wireaddrs*struct wireaddr_internal |
15 | gossipctl_init,,listen_announce,num_wireaddrs*enum addr_listen_announce |
16 | gossipctl_init,,rgb,3*u8 |
17 | gossipctl_init,,alias,32*u8 |
18 | gossipctl_init,,update_channel_interval,u32 |
19 | gossipctl_init,,reconnect,bool |
20 | gossipctl_init,,dev_allow_localhost,bool |
21 | # Activate the gossip daemon, so others can connect. |
22 | gossipctl_activate,3025 |
23 | # Do we listen? |
24 | gossipctl_activate,,listen,bool |
25 | # Gossipd->master, I am ready, here's the addresses I bound, can announce. |
26 | gossipctl_activate_reply,3125 |
27 | gossipctl_activate_reply,,num_bindings,u16 |
28 | gossipctl_activate_reply,,bindings,num_bindings*struct wireaddr_internal |
29 | gossipctl_activate_reply,,num_announcable,u16 |
30 | gossipctl_activate_reply,,announcable,num_announcable*struct wireaddr |
31 | # Master -> gossipd: Optional hint for where to find peer. |
32 | gossipctl_peer_addrhint,3014 |
33 | gossipctl_peer_addrhint,,id,struct pubkey |
34 | gossipctl_peer_addrhint,,addr,struct wireaddr_internal |
35 | # Master -> gossipd: connect to a peer. |
36 | gossipctl_connect_to_peer,3001 |
37 | gossipctl_connect_to_peer,,id,struct pubkey |
38 | # Gossipd->master: result (not a reply since it can be out-of-order, but |
39 | # you will get one reply for every request). |
40 | gossipctl_connect_to_peer_result,3020 |
41 | gossipctl_connect_to_peer_result,,id,struct pubkey |
42 | # True it connected. |
43 | gossipctl_connect_to_peer_result,,connected,bool |
44 | # Otherwise, why we can't reach them. |
45 | gossipctl_connect_to_peer_result,,failreason,wirestring |
46 | # Master -> gossipd: try to always maintain connection to this peer (or not) |
47 | gossipctl_peer_important,3010 |
48 | gossipctl_peer_important,,id,struct pubkey |
49 | gossipctl_peer_important,,important,bool |
50 | # Gossipd -> master: we got a peer. Two fds: peer and gossip |
51 | gossip_peer_connected,3002 |
52 | gossip_peer_connected,,id,struct pubkey |
53 | gossip_peer_connected,,addr,struct wireaddr_internal |
54 | gossip_peer_connected,,crypto_state,struct crypto_state |
55 | gossip_peer_connected,,gflen,u16 |
56 | gossip_peer_connected,,gfeatures,gflen*u8 |
57 | gossip_peer_connected,,lflen,u16 |
58 | gossip_peer_connected,,lfeatures,lflen*u8 |
59 | # Gossipd -> master: peer sent non-gossip packet. Two fds: peer and gossip |
60 | gossip_peer_nongossip,3003 |
61 | gossip_peer_nongossip,,id,struct pubkey |
62 | gossip_peer_nongossip,,addr,struct wireaddr_internal |
63 | gossip_peer_nongossip,,crypto_state,struct crypto_state |
64 | gossip_peer_nongossip,,gflen,u16 |
65 | gossip_peer_nongossip,,gfeatures,gflen*u8 |
66 | gossip_peer_nongossip,,lflen,u16 |
67 | gossip_peer_nongossip,,lfeatures,lflen*u8 |
68 | gossip_peer_nongossip,,len,u16 |
69 | gossip_peer_nongossip,,msg,len*u8 |
70 | # Master -> gossipd: release a peer (so we can open a channel) |
71 | gossipctl_release_peer,3004 |
72 | gossipctl_release_peer,,id,struct pubkey |
73 | # Gossipd -> master: reply to gossip_release_peer. Two fds: peer and gossip. |
74 | gossipctl_release_peer_reply,3104 |
75 | gossipctl_release_peer_reply,,addr,struct wireaddr_internal |
76 | gossipctl_release_peer_reply,,crypto_state,struct crypto_state |
77 | gossipctl_release_peer_reply,,gflen,u16 |
78 | gossipctl_release_peer_reply,,gfeatures,gflen*u8 |
79 | gossipctl_release_peer_reply,,lflen,u16 |
80 | gossipctl_release_peer_reply,,lfeatures,lflen*u8 |
81 | # Gossipd -> master: reply to gossip_release_peer if we couldn't find the peer. |
82 | gossipctl_release_peer_replyfail,3204 |
83 | # master -> gossipd: take back peer, with optional msg. (+peer fd, +gossip fd) |
84 | gossipctl_hand_back_peer,3013 |
85 | gossipctl_hand_back_peer,,id,struct pubkey |
86 | gossipctl_hand_back_peer,,crypto_state,struct crypto_state |
87 | gossipctl_hand_back_peer,,len,u16 |
88 | gossipctl_hand_back_peer,,msg,len*u8 |
89 | # master -> gossipd: peer has disconnected. |
90 | gossipctl_peer_disconnected,3015 |
91 | gossipctl_peer_disconnected,,id,struct pubkey |
92 | # Pass JSON-RPC getnodes call through |
93 | gossip_getnodes_request,3005 |
94 | # Can be 0 or 1 currently |
95 | gossip_getnodes_request,,num,u16 |
96 | gossip_getnodes_request,,id,num*struct pubkey |
97 | #include <lightningd/gossip_msg.h> |
98 | gossip_getnodes_reply,3105 |
99 | gossip_getnodes_reply,,num_nodes,u16 |
100 | gossip_getnodes_reply,,nodes,num_nodes*struct gossip_getnodes_entry |
101 | # Pass JSON-RPC getroute call through |
102 | gossip_getroute_request,3006 |
103 | gossip_getroute_request,,source,struct pubkey |
104 | gossip_getroute_request,,destination,struct pubkey |
105 | gossip_getroute_request,,msatoshi,u64 |
106 | gossip_getroute_request,,riskfactor,u16 |
107 | gossip_getroute_request,,final_cltv,u32 |
108 | gossip_getroute_request,,fuzz,double |
109 | gossip_getroute_request,,seed,struct siphash_seed |
110 | gossip_getroute_reply,3106 |
111 | gossip_getroute_reply,,num_hops,u16 |
112 | gossip_getroute_reply,,hops,num_hops*struct route_hop |
113 | gossip_getchannels_request,3007 |
114 | # In practice, 0 or 1. |
115 | gossip_getchannels_request,,num,u16 |
116 | gossip_getchannels_request,,short_channel_id,num*struct short_channel_id |
117 | gossip_getchannels_reply,3107 |
118 | gossip_getchannels_reply,,num_channels,u16 |
119 | gossip_getchannels_reply,,nodes,num_channels*struct gossip_getchannels_entry |
120 | # Ping/pong test. Waits for a reply if it expects one. |
121 | gossip_ping,3008 |
122 | gossip_ping,,id,struct pubkey |
123 | gossip_ping,,num_pong_bytes,u16 |
124 | gossip_ping,,len,u16 |
125 | gossip_ping_reply,3108 |
126 | # False if id in gossip_ping was unknown. |
127 | gossip_ping_reply,,sent,bool |
128 | # 0 == no pong expected |
129 | gossip_ping_reply,,totlen,u16 |
130 | # Given a short_channel_id, return the endpoints |
131 | gossip_resolve_channel_request,3009 |
132 | gossip_resolve_channel_request,,channel_id,struct short_channel_id |
133 | gossip_resolve_channel_reply,3109 |
134 | gossip_resolve_channel_reply,,num_keys,u16 |
135 | gossip_resolve_channel_reply,,keys,num_keys*struct pubkey |
136 | # The main daemon asks for peers |
137 | gossip_getpeers_request,3011 |
138 | # 0 or 1 |
139 | gossip_getpeers_request,,num,u16 |
140 | gossip_getpeers_request,,id,num*struct pubkey |
141 | gossip_getpeers_reply,3111 |
142 | gossip_getpeers_reply,,num,u16 |
143 | gossip_getpeers_reply,,id,num*struct pubkey |
144 | gossip_getpeers_reply,,addr,num*struct wireaddr_internal |
145 | gossip_getpeers_reply,,numnodes,u16 |
146 | gossip_getpeers_reply,,nodes,numnodes*struct gossip_getnodes_entry |
147 | # Channel daemon can ask for updates for a specific channel, for sending |
148 | # errors. Must be distinct from WIRE_CHANNEL_ANNOUNCEMENT etc. gossip msgs! |
149 | gossip_get_update,3012 |
150 | gossip_get_update,,short_channel_id,struct short_channel_id |
151 | # If channel isn't known, update will be empty. |
152 | gossip_get_update_reply,3112 |
153 | gossip_get_update_reply,,len,u16 |
154 | gossip_get_update_reply,,update,len*u8 |
155 | # Gossipd can tell channeld etc about gossip to fwd. |
156 | gossip_send_gossip,3016 |
157 | gossip_send_gossip,,len,u16 |
158 | gossip_send_gossip,,gossip,len*u8 |
159 | # Both sides have seen the funding tx being locked, but we have not |
160 | # yet reached the announcement depth. So we add the channel locally so |
161 | # we can use it already. |
162 | gossip_local_add_channel,3017 |
163 | gossip_local_add_channel,,short_channel_id,struct short_channel_id |
164 | gossip_local_add_channel,,chain_hash,struct bitcoin_blkid |
165 | gossip_local_add_channel,,remote_node_id,struct pubkey |
166 | gossip_local_add_channel,,cltv_expiry_delta,u16 |
167 | gossip_local_add_channel,,htlc_minimum_msat,u64 |
168 | gossip_local_add_channel,,fee_base_msat,u32 |
169 | gossip_local_add_channel,,fee_proportional_millionths,u32 |
170 | # Gossipd->master get this tx output please. |
171 | gossip_get_txout,3018 |
172 | gossip_get_txout,,short_channel_id,struct short_channel_id |
173 | # master->gossipd here is the output, or empty if none. |
174 | gossip_get_txout_reply,3118 |
175 | gossip_get_txout_reply,,short_channel_id,struct short_channel_id |
176 | gossip_get_txout_reply,,satoshis,u64 |
177 | gossip_get_txout_reply,,len,u16 |
178 | gossip_get_txout_reply,,outscript,len*u8 |
179 | # client->gossipd: Disable the channel matching the short_channel_id |
180 | gossip_disable_channel,3019 |
181 | gossip_disable_channel,,short_channel_id,struct short_channel_id |
182 | gossip_disable_channel,,direction,u8 |
183 | gossip_disable_channel,,active,bool |
184 | # master->gossipd a routing failure occurred |
185 | gossip_routing_failure,3021 |
186 | gossip_routing_failure,,erring_node,struct pubkey |
187 | gossip_routing_failure,,erring_channel,struct short_channel_id |
188 | gossip_routing_failure,,failcode,u16 |
189 | gossip_routing_failure,,len,u16 |
190 | gossip_routing_failure,,channel_update,len*u8 |
191 | # master->gossipd temporarily mark a channel unroutable |
192 | # (used in case of unparseable onion reply) |
193 | gossip_mark_channel_unroutable,3022 |
194 | gossip_mark_channel_unroutable,,channel,struct short_channel_id |
195 | # master->gossipd: Request to disconnect from a peer. |
196 | gossipctl_peer_disconnect,3023 |
197 | gossipctl_peer_disconnect,,id,struct pubkey |
198 | # Gossipd -> master: reply to gossip_peer_disconnect with peer id. |
199 | gossipctl_peer_disconnect_reply,3123 |
200 | # Gossipd -> master: reply to gossip_peer_disconnect if we couldn't find the peer. |
201 | gossipctl_peer_disconnect_replyfail,3223 |
202 | gossipctl_peer_disconnect_replyfail,,isconnected,bool |
203 | # master -> gossipd: a potential funding outpoint was spent, please forget the eventual channel |
204 | gossip_outpoint_spent,3024 |
205 | gossip_outpoint_spent,,short_channel_id,struct short_channel_id |