Skip to content

Commit

Permalink
hsmd: rename hsm_client_wire_csv to hsm_wire.csv
Browse files Browse the repository at this point in the history
That matches the other CSV names (HSM was the first, so it was written
before the pattern emerged).

Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell authored and cdecker committed Sep 20, 2018
1 parent 8f1f178 commit e012e94
Show file tree
Hide file tree
Showing 27 changed files with 33 additions and 39 deletions.
2 changes: 1 addition & 1 deletion channeld/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ CHANNELD_COMMON_OBJS := \
common/wire_error.o \
common/wireaddr.o \
gossipd/gen_gossip_wire.o \
hsmd/gen_hsm_client_wire.o \
hsmd/gen_hsm_wire.o \
lightningd/gossip_msg.o \
wire/fromwire.o \
wire/towire.o
Expand Down
6 changes: 3 additions & 3 deletions channeld/channeld.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
#include <fcntl.h>
#include <gossipd/gen_gossip_wire.h>
#include <gossipd/gossip_constants.h>
#include <hsmd/gen_hsm_client_wire.h>
#include <hsmd/gen_hsm_wire.h>
#include <inttypes.h>
#include <secp256k1.h>
#include <stdio.h>
Expand Down Expand Up @@ -223,14 +223,14 @@ static const u8 *hsm_req(const tal_t *ctx, const u8 *req TAKES)
if (!wire_sync_write(HSM_FD, req))
status_failed(STATUS_FAIL_HSM_IO,
"Writing %s to HSM: %s",
hsm_client_wire_type_name(type),
hsm_wire_type_name(type),
strerror(errno));

msg = wire_sync_read(ctx, HSM_FD);
if (!msg)
status_failed(STATUS_FAIL_HSM_IO,
"Reading resp to %s: %s",
hsm_client_wire_type_name(type),
hsm_wire_type_name(type),
strerror(errno));

return msg;
Expand Down
2 changes: 1 addition & 1 deletion closingd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ CLOSINGD_COMMON_OBJS := \
common/wire_error.o \
common/wireaddr.o \
gossipd/gen_gossip_wire.o \
hsmd/gen_hsm_client_wire.o \
hsmd/gen_hsm_wire.o \
lightningd/gossip_msg.o

closingd/gen_closing_wire.h: $(WIRE_GEN) closingd/closing_wire.csv
Expand Down
2 changes: 1 addition & 1 deletion closingd/closingd.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include <common/version.h>
#include <common/wire_error.h>
#include <errno.h>
#include <hsmd/gen_hsm_client_wire.h>
#include <hsmd/gen_hsm_wire.h>
#include <inttypes.h>
#include <stdio.h>
#include <unistd.h>
Expand Down
2 changes: 1 addition & 1 deletion common/bolt11.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include <common/bolt11.h>
#include <common/utils.h>
#include <errno.h>
#include <hsmd/gen_hsm_client_wire.h>
#include <hsmd/gen_hsm_wire.h>
#include <inttypes.h>
#include <lightningd/hsm_control.h>
#include <lightningd/jsonrpc.h>
Expand Down
2 changes: 1 addition & 1 deletion connectd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ CONNECTD_COMMON_OBJS := \
common/wireaddr.o \
common/wire_error.o \
gossipd/gen_gossip_wire.o \
hsmd/gen_hsm_client_wire.o \
hsmd/gen_hsm_wire.o \
lightningd/gossip_msg.o \
wire/gen_onion_wire.o

Expand Down
2 changes: 1 addition & 1 deletion connectd/connectd.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#include <connectd/tor_autoservice.h>
#include <errno.h>
#include <gossipd/gen_gossip_wire.h>
#include <hsmd/gen_hsm_client_wire.h>
#include <hsmd/gen_hsm_wire.h>
#include <inttypes.h>
#include <lightningd/gossip_msg.h>
#include <netdb.h>
Expand Down
2 changes: 1 addition & 1 deletion gossipd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ GOSSIPD_COMMON_OBJS := \
common/wireaddr.o \
common/wire_error.o \
connectd/gen_connect_gossip_wire.o \
hsmd/gen_hsm_client_wire.o \
hsmd/gen_hsm_wire.o \
lightningd/gossip_msg.o \
wire/gen_onion_wire.o

Expand Down
2 changes: 1 addition & 1 deletion gossipd/gossipd.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#include <gossipd/broadcast.h>
#include <gossipd/gen_gossip_wire.h>
#include <gossipd/routing.h>
#include <hsmd/gen_hsm_client_wire.h>
#include <hsmd/gen_hsm_wire.h>
#include <inttypes.h>
#include <lightningd/gossip_msg.h>
#include <netdb.h>
Expand Down
12 changes: 3 additions & 9 deletions hsmd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ hsmd-wrongdir:
default: hsmd-all

LIGHTNINGD_HSM_SRC := hsmd/hsmd.c \
hsmd/gen_hsm_client_wire.c
LIGHTNINGD_HSM_HEADERS := hsmd/gen_hsm_client_wire.h
hsmd/gen_hsm_wire.c
LIGHTNINGD_HSM_HEADERS := hsmd/gen_hsm_wire.h
LIGHTNINGD_HSM_OBJS := $(LIGHTNINGD_HSM_SRC:.c=.o)

# Common source we use.
Expand Down Expand Up @@ -41,18 +41,12 @@ $(LIGHTNINGD_HSM_OBJS): $(LIGHTNINGD_HEADERS)
# Make sure these depend on everything.
ALL_OBJS += $(LIGHTNINGD_HSM_OBJS)
ALL_PROGRAMS += lightningd/lightning_hsmd
ALL_GEN_HEADERS += hsmd/gen_hsm_client_wire.h
ALL_GEN_HEADERS += hsmd/gen_hsm_wire.h

hsmd-all: lightningd/lightning_hsmd

lightningd/lightning_hsmd: $(LIGHTNINGD_HSM_OBJS) $(LIGHTNINGD_LIB_OBJS) $(HSMD_COMMON_OBJS) $(BITCOIN_OBJS) $(WIRE_OBJS)

hsmd/gen_hsm_client_wire.h: $(WIRE_GEN) hsmd/hsm_client_wire_csv
$(WIRE_GEN) --header $@ hsm_client_wire_type < hsmd/hsm_client_wire_csv > $@

hsmd/gen_hsm_client_wire.c: $(WIRE_GEN) hsmd/hsm_client_wire_csv
$(WIRE_GEN) ${@:.c=.h} hsm_client_wire_type< hsmd/hsm_client_wire_csv > $@

hsmd/gen_hsm_wire.h: $(WIRE_GEN) hsmd/hsm_wire.csv
$(WIRE_GEN) --header $@ hsm_wire_type < hsmd/hsm_wire.csv > $@

Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions hsmd/hsmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include <errno.h>
#include <fcntl.h>
#include <hsmd/capabilities.h>
#include <hsmd/gen_hsm_client_wire.h>
#include <hsmd/gen_hsm_wire.h>
#include <inttypes.h>
#include <secp256k1_ecdh.h>
#include <sodium/randombytes.h>
Expand Down Expand Up @@ -1131,7 +1131,7 @@ static struct io_plan *handle_sign_node_announcement(struct io_conn *conn,
}

static bool check_client_capabilities(struct client *client,
enum hsm_client_wire_type t)
enum hsm_wire_type t)
{
switch (t) {
case WIRE_HSM_ECDH_REQ:
Expand Down Expand Up @@ -1193,7 +1193,7 @@ static struct io_plan *handle_client(struct io_conn *conn,
struct daemon_conn *dc)
{
struct client *c = container_of(dc, struct client, dc);
enum hsm_client_wire_type t = fromwire_peektype(dc->msg_in);
enum hsm_wire_type t = fromwire_peektype(dc->msg_in);

status_debug("Client: Received message %d from client", t);

Expand Down
2 changes: 1 addition & 1 deletion lightningd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ LIGHTNINGD_COMMON_OBJS := \
common/wire_error.o \
common/wireaddr.o \
common/withdraw_tx.o \
hsmd/gen_hsm_client_wire.o
hsmd/gen_hsm_wire.o

LIGHTNINGD_SRC := \
lightningd/bitcoind.c \
Expand Down
2 changes: 1 addition & 1 deletion lightningd/channel.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <common/wire_error.h>
#include <connectd/gen_connect_wire.h>
#include <errno.h>
#include <hsmd/gen_hsm_client_wire.h>
#include <hsmd/gen_hsm_wire.h>
#include <inttypes.h>
#include <lightningd/channel.h>
#include <lightningd/connect_control.h>
Expand Down
2 changes: 1 addition & 1 deletion lightningd/channel_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <common/wire_error.h>
#include <errno.h>
#include <gossipd/gossip_constants.h>
#include <hsmd/gen_hsm_client_wire.h>
#include <hsmd/gen_hsm_wire.h>
#include <inttypes.h>
#include <lightningd/channel_control.h>
#include <lightningd/closing_control.h>
Expand Down
2 changes: 1 addition & 1 deletion lightningd/connect_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include <connectd/gen_connect_wire.h>
#include <errno.h>
#include <hsmd/capabilities.h>
#include <hsmd/gen_hsm_client_wire.h>
#include <hsmd/gen_hsm_wire.h>
#include <lightningd/channel.h>
#include <lightningd/connect_control.h>
#include <lightningd/json.h>
Expand Down
2 changes: 1 addition & 1 deletion lightningd/gossip_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include <errno.h>
#include <gossipd/gen_gossip_wire.h>
#include <hsmd/capabilities.h>
#include <hsmd/gen_hsm_client_wire.h>
#include <hsmd/gen_hsm_wire.h>
#include <inttypes.h>
#include <lightningd/connect_control.h>
#include <lightningd/gossip_msg.h>
Expand Down
4 changes: 2 additions & 2 deletions lightningd/hsm_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <common/status.h>
#include <common/utils.h>
#include <errno.h>
#include <hsmd/gen_hsm_client_wire.h>
#include <hsmd/gen_hsm_wire.h>
#include <inttypes.h>
#include <lightningd/hsm_control.h>
#include <lightningd/log.h>
Expand Down Expand Up @@ -71,7 +71,7 @@ void hsm_init(struct lightningd *ld)
err(1, "Could not create hsm socketpair");

ld->hsm = new_global_subd(ld, "lightning_hsmd",
hsm_client_wire_type_name,
hsm_wire_type_name,
hsm_msg,
take(&fds[1]), NULL);
if (!ld->hsm)
Expand Down
2 changes: 1 addition & 1 deletion lightningd/invoice.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <common/json_escaped.h>
#include <common/utils.h>
#include <errno.h>
#include <hsmd/gen_hsm_client_wire.h>
#include <hsmd/gen_hsm_wire.h>
#include <inttypes.h>
#include <lightningd/hsm_control.h>
#include <lightningd/jsonrpc_errors.h>
Expand Down
2 changes: 1 addition & 1 deletion lightningd/onchain_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include <bitcoin/script.h>
#include <common/key_derive.h>
#include <errno.h>
#include <hsmd/gen_hsm_client_wire.h>
#include <hsmd/gen_hsm_wire.h>
#include <inttypes.h>
#include <lightningd/chaintopology.h>
#include <lightningd/hsm_control.h>
Expand Down
2 changes: 1 addition & 1 deletion lightningd/opening_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <common/wire_error.h>
#include <connectd/gen_connect_wire.h>
#include <errno.h>
#include <hsmd/gen_hsm_client_wire.h>
#include <hsmd/gen_hsm_wire.h>
#include <lightningd/chaintopology.h>
#include <lightningd/channel_control.h>
#include <lightningd/closing_control.h>
Expand Down
2 changes: 1 addition & 1 deletion lightningd/peer_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <connectd/gen_connect_wire.h>
#include <errno.h>
#include <fcntl.h>
#include <hsmd/gen_hsm_client_wire.h>
#include <hsmd/gen_hsm_wire.h>
#include <inttypes.h>
#include <lightningd/bitcoind.h>
#include <lightningd/chaintopology.h>
Expand Down
2 changes: 1 addition & 1 deletion onchaind/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ ONCHAIND_COMMON_OBJS := \
common/utils.o \
common/utxo.o \
common/version.o \
hsmd/gen_hsm_client_wire.o
hsmd/gen_hsm_wire.o

onchaind/gen_onchain_wire.h: $(WIRE_GEN) onchaind/onchain_wire.csv
$(WIRE_GEN) --header $@ onchain_wire_type < onchaind/onchain_wire.csv > $@
Expand Down
2 changes: 1 addition & 1 deletion onchaind/onchaind.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include <common/utils.h>
#include <common/version.h>
#include <errno.h>
#include <hsmd/gen_hsm_client_wire.h>
#include <hsmd/gen_hsm_wire.h>
#include <inttypes.h>
#include <lightningd/channel_state.h>
#include <onchaind/gen_onchain_wire.h>
Expand Down
2 changes: 1 addition & 1 deletion openingd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ OPENINGD_COMMON_OBJS := \
common/wire_error.o \
common/wireaddr.o \
gossipd/gen_gossip_wire.o \
hsmd/gen_hsm_client_wire.o \
hsmd/gen_hsm_wire.o \
lightningd/gossip_msg.o

$(LIGHTNINGD_OPENING_OBJS): $(LIGHTNINGD_HEADERS)
Expand Down
2 changes: 1 addition & 1 deletion openingd/openingd.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <common/version.h>
#include <common/wire_error.h>
#include <errno.h>
#include <hsmd/gen_hsm_client_wire.h>
#include <hsmd/gen_hsm_wire.h>
#include <inttypes.h>
#include <openingd/gen_opening_wire.h>
#include <poll.h>
Expand Down
2 changes: 1 addition & 1 deletion wallet/walletrpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <common/wallet_tx.h>
#include <common/withdraw_tx.h>
#include <errno.h>
#include <hsmd/gen_hsm_client_wire.h>
#include <hsmd/gen_hsm_wire.h>
#include <inttypes.h>
#include <lightningd/bitcoind.h>
#include <lightningd/chaintopology.h>
Expand Down

0 comments on commit e012e94

Please sign in to comment.