2017-08-28 18:06:01 +02:00
|
|
|
#ifndef LIGHTNING_COMMON_CRYPTO_SYNC_H
|
|
|
|
#define LIGHTNING_COMMON_CRYPTO_SYNC_H
|
2017-02-21 05:45:29 +01:00
|
|
|
#include "config.h"
|
|
|
|
#include <ccan/short_types/short_types.h>
|
|
|
|
#include <ccan/tal/tal.h>
|
|
|
|
|
|
|
|
struct crypto_state;
|
|
|
|
|
2018-08-02 08:49:55 +02:00
|
|
|
/* Exits with peer_failed_connection_lost() if write fails. */
|
|
|
|
void sync_crypto_write(struct crypto_state *cs, int fd, const void *msg TAKES);
|
|
|
|
|
2018-08-09 02:30:30 +02:00
|
|
|
/* Same, but disabled nagle for this message. */
|
|
|
|
void sync_crypto_write_no_delay(struct crypto_state *cs, int fd,
|
|
|
|
const void *msg TAKES);
|
|
|
|
|
2018-08-02 08:49:55 +02:00
|
|
|
/* Exits with peer_failed_connection_lost() if can't read packet. */
|
2017-02-21 05:45:29 +01:00
|
|
|
u8 *sync_crypto_read(const tal_t *ctx, struct crypto_state *cs, int fd);
|
|
|
|
|
2017-08-28 18:06:01 +02:00
|
|
|
#endif /* LIGHTNING_COMMON_CRYPTO_SYNC_H */
|