2018-02-21 07:29:09 +10:30
|
|
|
#ifndef LIGHTNING_LIGHTNINGD_CONNECT_CONTROL_H
|
|
|
|
#define LIGHTNING_LIGHTNINGD_CONNECT_CONTROL_H
|
|
|
|
#include "config.h"
|
2022-03-23 07:00:59 +10:30
|
|
|
#include <ccan/short_types/short_types.h>
|
|
|
|
#include <ccan/tal/tal.h>
|
2022-07-23 11:21:31 -05:00
|
|
|
#include <common/utils.h>
|
2018-02-21 07:29:09 +10:30
|
|
|
|
|
|
|
struct lightningd;
|
2022-03-23 07:00:59 +10:30
|
|
|
struct peer;
|
2018-02-21 07:29:09 +10:30
|
|
|
struct pubkey;
|
2018-08-09 09:55:29 +09:30
|
|
|
struct wireaddr_internal;
|
2018-02-21 07:29:09 +10:30
|
|
|
|
2018-07-24 15:48:58 +09:30
|
|
|
/* Returns fd for gossipd to talk to connectd */
|
2022-01-29 14:03:05 +10:30
|
|
|
int connectd_init(struct lightningd *ld);
|
2018-07-24 15:48:58 +09:30
|
|
|
void connectd_activate(struct lightningd *ld);
|
2023-02-04 15:46:24 +10:30
|
|
|
void connectd_start_shutdown(struct subd *connectd);
|
2018-07-24 15:48:58 +09:30
|
|
|
|
2024-11-25 11:38:15 +10:30
|
|
|
/* Tell connectd to connect to peer: give it what we know. */
|
|
|
|
void connectd_connect_to_peer(struct lightningd *ld,
|
|
|
|
const struct peer *peer,
|
|
|
|
bool is_important);
|
|
|
|
|
2023-10-22 14:37:31 +10:30
|
|
|
/* Kill subds, tell connectd to disconnect once they're drained. */
|
|
|
|
void force_peer_disconnect(struct lightningd *ld,
|
|
|
|
const struct peer *peer,
|
|
|
|
const char *why);
|
|
|
|
|
2021-03-16 14:14:36 +10:30
|
|
|
void connect_succeeded(struct lightningd *ld, const struct peer *peer,
|
2021-03-25 14:23:31 +10:30
|
|
|
bool incoming,
|
2021-03-16 14:14:36 +10:30
|
|
|
const struct wireaddr_internal *addr);
|
2022-07-18 21:42:28 +09:30
|
|
|
void connect_failed_disconnect(struct lightningd *ld,
|
|
|
|
const struct node_id *id,
|
|
|
|
const struct wireaddr_internal *addr);
|
2018-02-21 07:29:09 +10:30
|
|
|
|
2022-09-13 06:49:12 +09:30
|
|
|
/* Get the id of any connect cmd which applies, to feed to hooks */
|
|
|
|
const char *connect_any_cmd_id(const tal_t *ctx,
|
|
|
|
struct lightningd *ld, const struct peer *peer);
|
|
|
|
|
2024-07-10 12:25:49 +09:30
|
|
|
/* Tell connectd about an scid->peer mapping, so it can fwd onion
|
|
|
|
* messages. Redundant sends are OK. */
|
|
|
|
void tell_connectd_scid(struct lightningd *ld,
|
|
|
|
struct short_channel_id scid,
|
|
|
|
const struct node_id *peer_id);
|
|
|
|
|
2024-11-25 11:38:15 +10:30
|
|
|
/* Peer importance may have changed: if it has, tell connectd. */
|
|
|
|
void tell_connectd_peer_importance(struct peer *peer,
|
|
|
|
bool was_important);
|
2018-02-21 07:29:09 +10:30
|
|
|
#endif /* LIGHTNING_LIGHTNINGD_CONNECT_CONTROL_H */
|