mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-08 14:50:26 +01:00
f172be71dc
This fixes the only case where the master currently has to write directly to the peer: re-sending an error. We make gossipd do it, by adding a new gossipctl_fail_peer message. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
3.8 KiB
3.8 KiB
1 | # Peers can give a bad message, we close their fd, but no harm done. |
---|---|
2 | gossipstatus_peer_bad_msg,13000 |
3 | gossipstatus_peer_bad_msg,,unique_id,u64 |
4 | gossipstatus_peer_bad_msg,,len,u16 |
5 | gossipstatus_peer_bad_msg,,err,len*u8 |
6 | # Misc problems like opening control fd. |
7 | gossipstatus_peer_failed,13001 |
8 | gossipstatus_peer_failed,,unique_id,u64 |
9 | gossipstatus_peer_failed,,len,u16 |
10 | gossipstatus_peer_failed,,err,len*u8 |
11 | #include <common/cryptomsg.h> |
12 | # Initialize the gossip daemon |
13 | gossipctl_init,3000 |
14 | gossipctl_init,,broadcast_interval,u32 |
15 | gossipctl_init,,chain_hash,struct sha256_double |
16 | # These take an fd, but have no response |
17 | gossipctl_new_peer,3001 |
18 | gossipctl_new_peer,,unique_id,u64 |
19 | gossipctl_new_peer,,crypto_state,struct crypto_state |
20 | # Tell it to release a peer which has initialized. |
21 | gossipctl_release_peer,3002 |
22 | gossipctl_release_peer,,unique_id,u64 |
23 | # This releases the peer and returns the cryptostate (followed two fds: peer and gossip) |
24 | gossipctl_release_peer_reply,3102 |
25 | gossipctl_release_peer_reply,,crypto_state,struct crypto_state |
26 | # This is if we couldn't find the peer. |
27 | gossipctl_release_peer_replyfail,3202 |
28 | # This is where we save a peer's features. |
29 | #gossipstatus_peer_features,3001 |
30 | #gossipstatus_peer_features,,unique_id,u64 |
31 | #gossipstatus_peer_features,,gflen,u16 |
32 | #gossipstatus_peer_features,,globalfeatures,gflen*u8 |
33 | #gossipstatus_peer_features,,lflen,u16 |
34 | #gossipstatus_peer_features,,localfeatures,lflen*u8 |
35 | # Peer can send non-gossip packet (usually an open_channel) (followed two fds: peer and gossip) |
36 | gossipstatus_peer_nongossip,3004 |
37 | gossipstatus_peer_nongossip,,unique_id,u64 |
38 | gossipstatus_peer_nongossip,,crypto_state,struct crypto_state |
39 | gossipstatus_peer_nongossip,,len,u16 |
40 | gossipstatus_peer_nongossip,,msg,len*u8 |
41 | # Pass JSON-RPC getnodes call through |
42 | gossip_getnodes_request,3005 |
43 | #include <lightningd/gossip_msg.h> |
44 | gossip_getnodes_reply,3105 |
45 | gossip_getnodes_reply,,num_nodes,u16 |
46 | gossip_getnodes_reply,,nodes,num_nodes*struct gossip_getnodes_entry |
47 | # Pass JSON-RPC getroute call through |
48 | gossip_getroute_request,3006 |
49 | gossip_getroute_request,,source,struct pubkey |
50 | gossip_getroute_request,,destination,struct pubkey |
51 | gossip_getroute_request,,msatoshi,u32 |
52 | gossip_getroute_request,,riskfactor,u16 |
53 | gossip_getroute_reply,3106 |
54 | gossip_getroute_reply,,num_hops,u16 |
55 | gossip_getroute_reply,,hops,num_hops*struct route_hop |
56 | gossip_getchannels_request,3007 |
57 | gossip_getchannels_reply,3107 |
58 | gossip_getchannels_reply,,num_channels,u16 |
59 | gossip_getchannels_reply,,nodes,num_channels*struct gossip_getchannels_entry |
60 | # Ping/pong test. |
61 | gossip_ping,3008 |
62 | gossip_ping,,unique_id,u64 |
63 | gossip_ping,,num_pong_bytes,u16 |
64 | gossip_ping,,len,u16 |
65 | gossip_ping_reply,3108 |
66 | gossip_ping_reply,,totlen,u16 |
67 | # Given a short_channel_id, return the endpoints |
68 | gossip_resolve_channel_request,3009 |
69 | gossip_resolve_channel_request,,channel_id,struct short_channel_id |
70 | gossip_resolve_channel_reply,3109 |
71 | gossip_resolve_channel_reply,,num_keys,u16 |
72 | gossip_resolve_channel_reply,,keys,num_keys*struct pubkey |
73 | # The main daemon forward some gossip message to gossipd, allows injecting |
74 | # arbitrary gossip messages. |
75 | gossip_forwarded_msg,3010 |
76 | gossip_forwarded_msg,,msglen,u16 |
77 | gossip_forwarded_msg,,msg,msglen*u8 |
78 | # If peer is still connected, fail it (master does this for reconnect) |
79 | gossipctl_drop_peer,3011 |
80 | gossipctl_drop_peer,,unique_id,u64 |
81 | # Get a gossip fd for this peer (it has reconnected) |
82 | gossipctl_get_peer_gossipfd,3012 |
83 | gossipctl_get_peer_gossipfd,,unique_id,u64 |
84 | # Does it want a full dump of gossip? |
85 | gossipctl_get_peer_gossipfd,,sync,bool |
86 | # + fd. |
87 | gossipctl_get_peer_gossipfd_reply,3112 |
88 | # Failure (can't make new socket) |
89 | gossipctl_get_peer_gossipfd_replyfail,3212 |
90 | # Send canned message to peer and fail it. |
91 | gossipctl_fail_peer,3013 |
92 | gossipctl_fail_peer,,unique_id,u64 |
93 | gossipctl_fail_peer,,crypto_state,struct crypto_state |
94 | gossipctl_fail_peer,,len,u16 |
95 | gossipctl_fail_peer,,failmsg,len*u8 |