mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-24 01:24:26 +01:00
gossip_getnodes_entry was used by gossipd for reporting nodes, and for reporting peers. But the local_features field is only available for peers, and most other fields are only available from node_announcement. Note that the connectd change actually means we get less information about peers: gossipd used to do the node lookup for peers and include the node_announcement information if it had it. Since generate_wire.py can't create arrays-of-arrays, we add a 'struct peer_features' to encapsulate the two feature arrays for each peer, and for convenience we add it to lightningd/gossip_msg. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
4.8 KiB
4.8 KiB
| 1 | #include <common/cryptomsg.h> |
|---|---|
| 2 | #include <common/wireaddr.h> |
| 3 | #include <lightningd/gossip_msg.h> |
| 4 | connectctl_init,2000 |
| 5 | connectctl_init,,id,struct pubkey |
| 6 | connectctl_init,,gflen,u16 |
| 7 | connectctl_init,,gfeatures,gflen*u8 |
| 8 | connectctl_init,,lflen,u16 |
| 9 | connectctl_init,,lfeatures,lflen*u8 |
| 10 | connectctl_init,,num_wireaddrs,u16 |
| 11 | connectctl_init,,wireaddrs,num_wireaddrs*struct wireaddr_internal |
| 12 | connectctl_init,,listen_announce,num_wireaddrs*enum addr_listen_announce |
| 13 | connectctl_init,,reconnect,bool |
| 14 | connectctl_init,,tor_proxyaddr,?struct wireaddr |
| 15 | connectctl_init,,use_tor_proxy_always,bool |
| 16 | connectctl_init,,dev_allow_localhost,bool |
| 17 | connectctl_init,,use_dns,bool |
| 18 | connectctl_init,,tor_password,wirestring |
| 19 | # Connectd->master, here are the addresses I bound, can announce. |
| 20 | connectctl_init_reply,2100 |
| 21 | connectctl_init_reply,,num_bindings,u16 |
| 22 | connectctl_init_reply,,bindings,num_bindings*struct wireaddr_internal |
| 23 | connectctl_init_reply,,num_announcable,u16 |
| 24 | connectctl_init_reply,,announcable,num_announcable*struct wireaddr |
| 25 | # Activate the connect daemon, so others can connect. |
| 26 | connectctl_activate,2025 |
| 27 | # Do we listen? |
| 28 | connectctl_activate,,listen,bool |
| 29 | # Connectd->master, I am ready. |
| 30 | connectctl_activate_reply,2125 |
| 31 | # connectd->master: disconnect this peer please (due to reconnect). |
| 32 | connect_reconnected,2112 |
| 33 | connect_reconnected,,id,struct pubkey |
| 34 | # Master -> connectd: Optional hint for where to find peer. |
| 35 | connectctl_peer_addrhint,2014 |
| 36 | connectctl_peer_addrhint,,id,struct pubkey |
| 37 | connectctl_peer_addrhint,,addr,struct wireaddr_internal |
| 38 | # Master -> connectd: connect to a peer. |
| 39 | connectctl_connect_to_peer,2001 |
| 40 | connectctl_connect_to_peer,,id,struct pubkey |
| 41 | # Connectd->master: result (not a reply since it can be out-of-order, but |
| 42 | # you will get one reply for every request). |
| 43 | connectctl_connect_to_peer_result,2020 |
| 44 | connectctl_connect_to_peer_result,,id,struct pubkey |
| 45 | # True it connected. |
| 46 | connectctl_connect_to_peer_result,,connected,bool |
| 47 | # Otherwise, why we can't reach them. |
| 48 | connectctl_connect_to_peer_result,,failreason,wirestring |
| 49 | # Master -> connectd: try to always maintain connection to this peer (or not) |
| 50 | connectctl_peer_important,2010 |
| 51 | connectctl_peer_important,,id,struct pubkey |
| 52 | connectctl_peer_important,,important,bool |
| 53 | # Connectd -> master: we got a peer. Two fds: peer and gossip |
| 54 | connect_peer_connected,2002 |
| 55 | connect_peer_connected,,id,struct pubkey |
| 56 | connect_peer_connected,,addr,struct wireaddr_internal |
| 57 | connect_peer_connected,,crypto_state,struct crypto_state |
| 58 | connect_peer_connected,,gflen,u16 |
| 59 | connect_peer_connected,,gfeatures,gflen*u8 |
| 60 | connect_peer_connected,,lflen,u16 |
| 61 | connect_peer_connected,,lfeatures,lflen*u8 |
| 62 | # Connectd -> master: peer sent non-gossip packet. Two fds: peer and gossip |
| 63 | connect_peer_nongossip,2003 |
| 64 | connect_peer_nongossip,,id,struct pubkey |
| 65 | connect_peer_nongossip,,addr,struct wireaddr_internal |
| 66 | connect_peer_nongossip,,crypto_state,struct crypto_state |
| 67 | connect_peer_nongossip,,gflen,u16 |
| 68 | connect_peer_nongossip,,gfeatures,gflen*u8 |
| 69 | connect_peer_nongossip,,lflen,u16 |
| 70 | connect_peer_nongossip,,lfeatures,lflen*u8 |
| 71 | connect_peer_nongossip,,len,u16 |
| 72 | connect_peer_nongossip,,msg,len*u8 |
| 73 | # Master -> connectd: release a peer (so we can open a channel) |
| 74 | connectctl_release_peer,2004 |
| 75 | connectctl_release_peer,,id,struct pubkey |
| 76 | # Connectd -> master: reply to connect_release_peer. Two fds: peer and gossip. |
| 77 | connectctl_release_peer_reply,2104 |
| 78 | connectctl_release_peer_reply,,addr,struct wireaddr_internal |
| 79 | connectctl_release_peer_reply,,crypto_state,struct crypto_state |
| 80 | connectctl_release_peer_reply,,gflen,u16 |
| 81 | connectctl_release_peer_reply,,gfeatures,gflen*u8 |
| 82 | connectctl_release_peer_reply,,lflen,u16 |
| 83 | connectctl_release_peer_reply,,lfeatures,lflen*u8 |
| 84 | # Connectd -> master: reply to connect_release_peer if we couldn't find the peer. |
| 85 | connectctl_release_peer_replyfail,2204 |
| 86 | # master -> connectd: take back peer, with optional msg. (+peer fd, +gossip fd) |
| 87 | connectctl_hand_back_peer,2013 |
| 88 | connectctl_hand_back_peer,,id,struct pubkey |
| 89 | connectctl_hand_back_peer,,crypto_state,struct crypto_state |
| 90 | connectctl_hand_back_peer,,len,u16 |
| 91 | connectctl_hand_back_peer,,msg,len*u8 |
| 92 | # master -> connectd: peer has disconnected. |
| 93 | connectctl_peer_disconnected,2015 |
| 94 | connectctl_peer_disconnected,,id,struct pubkey |
| 95 | # The main daemon asks for peers |
| 96 | connect_getpeers_request,2011 |
| 97 | connect_getpeers_request,,id,?struct pubkey |
| 98 | connect_getpeers_reply,2111 |
| 99 | connect_getpeers_reply,,num,u16 |
| 100 | connect_getpeers_reply,,id,num*struct pubkey |
| 101 | connect_getpeers_reply,,addr,num*struct wireaddr_internal |
| 102 | connect_getpeers_reply,,features,num*struct peer_features |
| 103 | # master->connectd: Request to disconnect from a peer. |
| 104 | connectctl_peer_disconnect,2023 |
| 105 | connectctl_peer_disconnect,,id,struct pubkey |
| 106 | # Connectd -> master: reply to connect_peer_disconnect with peer id. |
| 107 | connectctl_peer_disconnect_reply,2123 |
| 108 | # Connectd -> master: reply to connect_peer_disconnect if we couldn't find the peer. |
| 109 | connectctl_peer_disconnect_replyfail,2223 |
| 110 | connectctl_peer_disconnect_replyfail,,isconnected,bool |