2022-01-08 14:19:29 +01:00
|
|
|
#ifndef LIGHTNING_CONNECTD_MULTIPLEX_H
|
|
|
|
#define LIGHTNING_CONNECTD_MULTIPLEX_H
|
|
|
|
#include "config.h"
|
|
|
|
#include <ccan/short_types/short_types.h>
|
2022-01-08 14:24:29 +01:00
|
|
|
#include <common/crypto_state.h>
|
2022-01-08 14:19:29 +01:00
|
|
|
#include <common/msg_queue.h>
|
|
|
|
#include <common/node_id.h>
|
|
|
|
|
2022-01-08 14:28:29 +01:00
|
|
|
struct peer;
|
|
|
|
struct io_conn;
|
|
|
|
struct feature_set;
|
2022-01-08 14:19:29 +01:00
|
|
|
|
|
|
|
/* Take over peer_conn as peer->to_peer */
|
|
|
|
struct io_plan *multiplex_peer_setup(struct io_conn *peer_conn,
|
|
|
|
struct peer *peer);
|
|
|
|
|
|
|
|
/* Send this message to peer and disconnect. */
|
|
|
|
void multiplex_final_msg(struct peer *peer,
|
|
|
|
const u8 *final_msg TAKES);
|
2022-01-08 14:22:29 +01:00
|
|
|
|
2022-01-29 04:33:05 +01:00
|
|
|
/* Inject a message into the output stream. Unlike a raw msg_enqueue,
|
2022-02-07 04:32:32 +01:00
|
|
|
* this does io logging. */
|
2022-01-29 04:33:05 +01:00
|
|
|
void inject_peer_msg(struct peer *peer, const u8 *msg TAKES);
|
2022-01-08 14:22:29 +01:00
|
|
|
|
2022-01-08 14:28:29 +01:00
|
|
|
void setup_peer_gossip_store(struct peer *peer,
|
|
|
|
const struct feature_set *our_features,
|
|
|
|
const u8 *their_features);
|
2022-01-11 02:16:49 +01:00
|
|
|
|
2022-01-29 04:31:32 +01:00
|
|
|
/* When lightningd says to send a ping */
|
|
|
|
void send_manual_ping(struct daemon *daemon, const u8 *msg);
|
2022-01-29 04:33:05 +01:00
|
|
|
|
|
|
|
/* When lightningd says to send a custom message (from a plugin) */
|
|
|
|
void send_custommsg(struct daemon *daemon, const u8 *msg);
|
2022-03-22 21:27:29 +01:00
|
|
|
|
|
|
|
/* Lightningd wants to talk to you. */
|
2022-07-18 14:12:18 +02:00
|
|
|
void peer_connect_subd(struct daemon *daemon, const u8 *msg, int fd);
|
2022-01-08 14:19:29 +01:00
|
|
|
#endif /* LIGHTNING_CONNECTD_MULTIPLEX_H */
|