2018-02-20 20:59:09 +00:00
|
|
|
#ifndef LIGHTNING_LIGHTNINGD_CONNECT_CONTROL_H
|
|
|
|
#define LIGHTNING_LIGHTNINGD_CONNECT_CONTROL_H
|
|
|
|
#include "config.h"
|
2022-03-22 20:30:59 +00:00
|
|
|
#include <ccan/short_types/short_types.h>
|
|
|
|
#include <ccan/tal/tal.h>
|
2022-07-23 17:21:31 +01:00
|
|
|
#include <common/utils.h>
|
2018-02-20 20:59:09 +00:00
|
|
|
|
|
|
|
struct lightningd;
|
2022-03-22 20:30:59 +00:00
|
|
|
struct peer;
|
2018-02-20 20:59:09 +00:00
|
|
|
struct pubkey;
|
2018-08-09 01:25:29 +01:00
|
|
|
struct wireaddr_internal;
|
2018-02-20 20:59:09 +00:00
|
|
|
|
2018-07-24 07:18:58 +01:00
|
|
|
/* Returns fd for gossipd to talk to connectd */
|
2022-01-29 03:33:05 +00:00
|
|
|
int connectd_init(struct lightningd *ld);
|
2018-07-24 07:18:58 +01:00
|
|
|
void connectd_activate(struct lightningd *ld);
|
2023-02-04 05:16:24 +00:00
|
|
|
void connectd_start_shutdown(struct subd *connectd);
|
2018-07-24 07:18:58 +01:00
|
|
|
|
2023-10-22 05:07:31 +01:00
|
|
|
/* Kill subds, tell connectd to disconnect once they're drained. */
|
|
|
|
void force_peer_disconnect(struct lightningd *ld,
|
|
|
|
const struct peer *peer,
|
|
|
|
const char *why);
|
|
|
|
|
2022-03-22 20:30:59 +00:00
|
|
|
void try_reconnect(const tal_t *ctx,
|
|
|
|
struct peer *peer,
|
|
|
|
const struct wireaddr_internal *addrhint);
|
2021-03-16 03:44:36 +00:00
|
|
|
void connect_succeeded(struct lightningd *ld, const struct peer *peer,
|
2021-03-25 03:53:31 +00:00
|
|
|
bool incoming,
|
2021-03-16 03:44:36 +00:00
|
|
|
const struct wireaddr_internal *addr);
|
2022-07-18 13:12:28 +01:00
|
|
|
void connect_failed_disconnect(struct lightningd *ld,
|
|
|
|
const struct node_id *id,
|
|
|
|
const struct wireaddr_internal *addr);
|
2018-02-20 20:59:09 +00:00
|
|
|
|
2022-09-12 22:19:12 +01:00
|
|
|
/* 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);
|
|
|
|
|
2018-02-20 20:59:09 +00:00
|
|
|
#endif /* LIGHTNING_LIGHTNINGD_CONNECT_CONTROL_H */
|