core-lightning/connectd/connectd_wire.csv
Rusty Russell b0d6996ed6 lightningd: get connection direction from connectd.
This matters: if we connected, the address is probably usable for future connections.
But if they connected, the port is probably not (but the IP address may be).

Changelog-Added: JSON-RPC: `connect` returns "direction" ("in": they iniatated, or "out": we initiated)
Changelog-Added: plugins: `peer_connected` hook and `connect` notifications have "direction" field.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-03-26 13:22:33 +10:30

2.7 KiB

1#include <common/cryptomsg.h>
2#include <common/features.h>
3#include <common/per_peer_state.h>
4#include <common/wireaddr.h>
5#include <lightningd/gossip_msg.h>
6msgtype,connectd_init,2000
7msgdata,connectd_init,chainparams,chainparams,
8msgdata,connectd_init,our_features,feature_set,
9msgdata,connectd_init,id,node_id,
10msgdata,connectd_init,num_wireaddrs,u16,
11msgdata,connectd_init,wireaddrs,wireaddr_internal,num_wireaddrs
12msgdata,connectd_init,listen_announce,enum addr_listen_announce,num_wireaddrs
13msgdata,connectd_init,tor_proxyaddr,?wireaddr,
14msgdata,connectd_init,use_tor_proxy_always,bool,
15msgdata,connectd_init,dev_allow_localhost,bool,
16msgdata,connectd_init,use_dns,bool,
17msgdata,connectd_init,tor_password,wirestring,
18msgdata,connectd_init,use_v3_autotor,bool,
19msgdata,connectd_init,timeout_secs,u32,
20# Connectd->master, here are the addresses I bound, can announce.
21msgtype,connectd_init_reply,2100
22msgdata,connectd_init_reply,num_bindings,u16,
23msgdata,connectd_init_reply,bindings,wireaddr_internal,num_bindings
24msgdata,connectd_init_reply,num_announcable,u16,
25msgdata,connectd_init_reply,announcable,wireaddr,num_announcable
26# Activate the connect daemon, so others can connect.
27msgtype,connectd_activate,2025
28# Do we listen?
29msgdata,connectd_activate,listen,bool,
30# Connectd->master, I am ready.
31msgtype,connectd_activate_reply,2125
32# connectd->master: disconnect this peer please (due to reconnect).
33msgtype,connectd_reconnected,2112
34msgdata,connectd_reconnected,id,node_id,
35# Master -> connectd: connect to a peer.
36msgtype,connectd_connect_to_peer,2001
37msgdata,connectd_connect_to_peer,id,node_id,
38msgdata,connectd_connect_to_peer,seconds_waited,u32,
39msgdata,connectd_connect_to_peer,addrhint,?wireaddr_internal,
40# Connectd->master: connect failed.
41msgtype,connectd_connect_failed,2020
42msgdata,connectd_connect_failed,id,node_id,
43msgdata,connectd_connect_failed,failcode,errcode_t,
44msgdata,connectd_connect_failed,failreason,wirestring,
45msgdata,connectd_connect_failed,seconds_to_delay,u32,
46msgdata,connectd_connect_failed,addrhint,?wireaddr_internal,
47# Connectd -> master: we got a peer. Three fds: peer, gossip and gossip_store
48msgtype,connectd_peer_connected,2002
49msgdata,connectd_peer_connected,id,node_id,
50msgdata,connectd_peer_connected,addr,wireaddr_internal,
51msgdata,connectd_peer_connected,incoming,bool,
52msgdata,connectd_peer_connected,pps,per_peer_state,
53msgdata,connectd_peer_connected,flen,u16,
54msgdata,connectd_peer_connected,features,u8,flen
55# master -> connectd: peer has disconnected.
56msgtype,connectd_peer_disconnected,2015
57msgdata,connectd_peer_disconnected,id,node_id,
58# master -> connectd: do you have a memleak?
59msgtype,connectd_dev_memleak,2033
60msgtype,connectd_dev_memleak_reply,2133
61msgdata,connectd_dev_memleak_reply,leak,bool,