mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 18:11:28 +01:00
9b1d240c1f
We use a file descriptor, so when we consume an entry, we move past it (and everyone shares a file offset, so this works). The file contains packet names prefixed by - (treat fd as closed when we try to write this packet), + (write the packet then ensure the file descriptor fails), or @ ("lose" the packet then ensure the file descriptor fails). The sync and async peer-write functions hook this in automatically. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Header from folded patch 'test-run-cryptomsg__fix_compilation.patch': test/run-cryptomsg: fix compilation. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
21 lines
582 B
C
21 lines
582 B
C
#ifndef LIGHTNING_LIGHTNINGD_DEV_DISCONNECT_H
|
|
#define LIGHTNING_LIGHTNINGD_DEV_DISCONNECT_H
|
|
#include "config.h"
|
|
#include <stdbool.h>
|
|
|
|
#define DEV_DISCONNECT_BEFORE '-'
|
|
#define DEV_DISCONNECT_AFTER '+'
|
|
#define DEV_DISCONNECT_DROPPKT '@'
|
|
#define DEV_DISCONNECT_NORMAL 0
|
|
|
|
/* Force a close fd before or after a certain packet type */
|
|
char dev_disconnect(int pkt_type);
|
|
|
|
/* Make next write on fd fail as if they'd disconnected. */
|
|
void dev_sabotage_fd(int fd);
|
|
|
|
/* For debug code to set in daemon. */
|
|
void dev_disconnect_init(int fd);
|
|
|
|
#endif /* LIGHTNING_LIGHTNINGD_DEV_DISCONNECT_H */
|