Files
lightning/gossipd/gossip_wire.csv
Rusty Russell 73cd009a4c gossipd/lightningd: use wireaddr_internal.
This replacement is a little menial, but it explicitly catches all
the places where we allow a local socket.  The actual implementation of
opening a AF_UNIX socket is almost hidden in the patch.

The detection of "valid address" is now more complex:

	p->addr.itype != ADDR_INTERNAL_WIREADDR || p->addr.u.wireaddr.type != ADDR_TYPE_PADDING

But most places we do this, we should audit: I'm pretty sure we can't
get an invalid address any more from gossipd (they may be in db, but
we should fix that too).

Closes: #1323
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-05-07 22:37:28 +02:00

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