2017-01-10 06:08:33 +01:00
|
|
|
#ifndef LIGHTNING_LIGHTNINGD_HSM_CONTROL_H
|
|
|
|
#define LIGHTNING_LIGHTNINGD_HSM_CONTROL_H
|
|
|
|
#include "config.h"
|
2017-06-24 08:50:23 +02:00
|
|
|
#include <ccan/short_types/short_types.h>
|
2017-01-10 06:08:33 +01:00
|
|
|
|
|
|
|
struct lightningd;
|
2019-04-08 11:58:32 +02:00
|
|
|
struct node_id;
|
2020-05-26 23:06:13 +02:00
|
|
|
struct ext_key;
|
2018-07-09 13:17:59 +02:00
|
|
|
|
|
|
|
/* Ask HSM for a new fd for a subdaemon to use. */
|
|
|
|
int hsm_get_client_fd(struct lightningd *ld,
|
2019-04-08 11:58:32 +02:00
|
|
|
const struct node_id *id,
|
2018-07-09 13:17:59 +02:00
|
|
|
u64 dbid,
|
|
|
|
int capabilities);
|
2017-01-10 06:08:33 +01:00
|
|
|
|
2018-09-20 05:07:41 +02:00
|
|
|
/* Ask HSM for an fd for a global subdaemon to use (gossipd, connectd) */
|
|
|
|
int hsm_get_global_fd(struct lightningd *ld, int capabilities);
|
|
|
|
|
2023-03-21 04:58:09 +01:00
|
|
|
/* Is this capability supported by the HSM? (So far, always a message
|
|
|
|
* number) */
|
|
|
|
bool hsm_capable(struct lightningd *ld, u32 msgtype);
|
|
|
|
|
2020-05-26 23:06:13 +02:00
|
|
|
struct ext_key *hsm_init(struct lightningd *ld);
|
2023-03-21 04:58:15 +01:00
|
|
|
|
2023-04-10 02:12:56 +02:00
|
|
|
/* Send request to hsmd, get response. */
|
|
|
|
const u8 *hsm_sync_req(const tal_t *ctx,
|
|
|
|
struct lightningd *ld,
|
|
|
|
const u8 *msg TAKES);
|
|
|
|
|
2023-03-21 04:58:15 +01:00
|
|
|
/* Get (and check!) a bip32 derived pubkey */
|
|
|
|
void bip32_pubkey(struct lightningd *ld, struct pubkey *pubkey, u32 index);
|
|
|
|
|
2017-01-10 06:08:33 +01:00
|
|
|
#endif /* LIGHTNING_LIGHTNINGD_HSM_CONTROL_H */
|