Browse Source

common: convert to new wire generation style.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
bump-pyln-proto
Rusty Russell 4 years ago
parent
commit
3e52d4100d
  1. 4
      channeld/Makefile
  2. 4
      closingd/Makefile
  3. 18
      common/Makefile
  4. 2
      common/peer_billboard.c
  5. 4
      common/peer_failed.c
  6. 2
      common/status.c
  7. 2
      connectd/Makefile
  8. 2
      gossipd/Makefile
  9. 2
      hsmd/Makefile
  10. 4
      lightningd/Makefile
  11. 2
      lightningd/log_status.c
  12. 8
      lightningd/subd.c
  13. 2
      onchaind/Makefile
  14. 4
      openingd/Makefile
  15. 2
      openingd/openingd.c

4
channeld/Makefile

@ -53,8 +53,8 @@ CHANNELD_COMMON_OBJS := \
common/ecdh_hsmd.o \
common/features.o \
common/fee_states.o \
common/gen_status_wire.o \
common/gen_peer_status_wire.o \
common/status_wiregen.o \
common/peer_status_wiregen.o \
common/gossip_rcvd_filter.o \
common/gossip_store.o \
common/hmac.o \

4
closingd/Makefile

@ -55,8 +55,8 @@ CLOSINGD_COMMON_OBJS := \
common/daemon_conn.o \
common/dev_disconnect.o \
common/derive_basepoints.o \
common/gen_peer_status_wire.o \
common/gen_status_wire.o \
common/peer_status_wiregen.o \
common/status_wiregen.o \
common/gossip_rcvd_filter.o \
common/gossip_store.o \
common/htlc_wire.o \

18
common/Makefile

@ -75,7 +75,7 @@ COMMON_SRC_NOGEN := \
common/wire_error.c \
common/withdraw_tx.c
COMMON_SRC_GEN := common/gen_status_wire.c common/gen_peer_status_wire.c
COMMON_SRC_GEN := common/status_wiregen.c common/peer_status_wiregen.c
COMMON_HEADERS_NOGEN := $(COMMON_SRC_NOGEN:.c=.h) \
common/closing_fee.h \
@ -87,7 +87,7 @@ COMMON_HEADERS_NOGEN := $(COMMON_SRC_NOGEN:.c=.h) \
common/jsonrpc_errors.h \
common/overflows.h \
common/status_levels.h
COMMON_HEADERS_GEN := common/gen_htlc_state_names.h common/gen_status_wire.h common/gen_peer_status_wire.h
COMMON_HEADERS_GEN := common/gen_htlc_state_names.h common/status_wiregen.h common/peer_status_wiregen.h
COMMON_HEADERS := $(COMMON_HEADERS_GEN) $(COMMON_HEADERS_NOGEN)
COMMON_SRC := $(COMMON_SRC_NOGEN) $(COMMON_SRC_GEN)
@ -106,22 +106,10 @@ ALL_OBJS += $(COMMON_OBJS)
common/gen_htlc_state_names.h: common/htlc_state.h ccan/ccan/cdump/tools/cdump-enumstr
ccan/ccan/cdump/tools/cdump-enumstr common/htlc_state.h > $@
common/gen_status_wire.h: $(WIRE_GEN) common/status_wire.csv
$(WIRE_GEN) --page header $@ status < common/status_wire.csv > $@
common/gen_status_wire.c: $(WIRE_GEN) common/status_wire.csv
$(WIRE_GEN) --page impl ${@:.c=.h} status < common/status_wire.csv > $@
common/gen_peer_status_wire.h: $(WIRE_GEN) common/peer_status_wire.csv
$(WIRE_GEN) --page header $@ peer_status < common/peer_status_wire.csv > $@
common/gen_peer_status_wire.c: $(WIRE_GEN) common/peer_status_wire.csv
$(WIRE_GEN) --page impl ${@:.c=.h} peer_status < common/peer_status_wire.csv > $@
check-makefile: check-common-makefile
check-common-makefile:
if [ x"`LC_ALL=C ls common/*.h | grep -v ^common/gen_`" != x"`echo $(COMMON_HEADERS_NOGEN) | tr ' ' '\n' | LC_ALL=C sort`" ]; then echo COMMON_HEADERS_NOGEN incorrect; exit 1; fi
if [ x"`LC_ALL=C ls common/*.h | grep -v ^common/gen_ | grep -v '^common/.*wiregen'`" != x"`echo $(COMMON_HEADERS_NOGEN) | tr ' ' '\n' | LC_ALL=C sort`" ]; then echo COMMON_HEADERS_NOGEN incorrect; exit 1; fi
check-source-bolt: $(COMMON_SRC_NOGEN:%=bolt-check/%) $(COMMON_HEADERS:%=bolt-check/%)
check-whitespace: $(COMMON_SRC_NOGEN:%=check-whitespace/%) $(COMMON_HEADERS:%=check-whitespace/%)

2
common/peer_billboard.c

@ -1,7 +1,7 @@
#include <ccan/tal/str/str.h>
#include <common/gen_status_wire.h>
#include <common/peer_billboard.h>
#include <common/status.h>
#include <common/status_wiregen.h>
void peer_billboard(bool perm, const char *fmt, ...)
{

4
common/peer_failed.c

@ -1,11 +1,11 @@
#include <ccan/breakpoint/breakpoint.h>
#include <ccan/tal/str/str.h>
#include <common/crypto_sync.h>
#include <common/gen_peer_status_wire.h>
#include <common/gen_status_wire.h>
#include <common/peer_billboard.h>
#include <common/peer_failed.h>
#include <common/peer_status_wiregen.h>
#include <common/status.h>
#include <common/status_wiregen.h>
#include <common/wire_error.h>
#include <stdarg.h>

2
common/status.c

@ -7,8 +7,8 @@
#include <ccan/tal/str/str.h>
#include <common/daemon.h>
#include <common/daemon_conn.h>
#include <common/gen_status_wire.h>
#include <common/status.h>
#include <common/status_wiregen.h>
#include <common/utils.h>
#include <errno.h>
#include <signal.h>

2
connectd/Makefile

@ -53,7 +53,7 @@ CONNECTD_COMMON_OBJS := \
common/dev_disconnect.o \
common/ecdh_hsmd.o \
common/features.o \
common/gen_status_wire.o \
common/status_wiregen.o \
common/gossip_rcvd_filter.o \
common/key_derive.o \
common/memleak.o \

2
gossipd/Makefile

@ -55,7 +55,7 @@ GOSSIPD_COMMON_OBJS := \
common/derive_basepoints.o \
common/dev_disconnect.o \
common/features.o \
common/gen_status_wire.o \
common/status_wiregen.o \
common/gossip_rcvd_filter.o \
common/key_derive.o \
common/memleak.o \

2
hsmd/Makefile

@ -21,7 +21,7 @@ HSMD_COMMON_OBJS := \
common/daemon_conn.o \
common/derive_basepoints.o \
common/funding_tx.o \
common/gen_status_wire.o \
common/status_wiregen.o \
common/hash_u5.o \
common/key_derive.o \
common/memleak.o \

4
lightningd/Makefile

@ -35,8 +35,8 @@ LIGHTNINGD_COMMON_OBJS := \
common/features.o \
common/fee_states.o \
common/funding_tx.o \
common/gen_peer_status_wire.o \
common/gen_status_wire.o \
common/peer_status_wiregen.o \
common/status_wiregen.o \
common/gossip_rcvd_filter.o \
common/hash_u5.o \
common/hmac.o \

2
lightningd/log_status.c

@ -1,4 +1,4 @@
#include <common/gen_status_wire.h>
#include <common/status_wiregen.h>
#include <lightningd/log_status.h>
bool log_status_msg(struct log *log,

8
lightningd/subd.c

@ -8,10 +8,10 @@
#include <ccan/tal/path/path.h>
#include <ccan/tal/str/str.h>
#include <common/crypto_state.h>
#include <common/gen_peer_status_wire.h>
#include <common/gen_status_wire.h>
#include <common/memleak.h>
#include <common/peer_status_wiregen.h>
#include <common/per_peer_state.h>
#include <common/status_wiregen.h>
#include <errno.h>
#include <fcntl.h>
#include <lightningd/lightningd.h>
@ -434,7 +434,7 @@ static struct io_plan *sd_msg_read(struct io_conn *conn, struct subd *sd)
tal_steal(tmpctx, sd->msg_in);
/* We handle status messages ourselves. */
switch ((enum status)type) {
switch ((enum status_wire)type) {
case WIRE_STATUS_LOG:
case WIRE_STATUS_IO:
if (!log_status_msg(sd->log, sd->node_id, sd->msg_in))
@ -458,7 +458,7 @@ static struct io_plan *sd_msg_read(struct io_conn *conn, struct subd *sd)
}
if (sd->channel) {
switch ((enum peer_status)type) {
switch ((enum peer_status_wire)type) {
case WIRE_STATUS_PEER_ERROR:
/* We expect 3 fds after this */
if (!sd->fds_in) {

2
onchaind/Makefile

@ -56,7 +56,7 @@ ONCHAIND_COMMON_OBJS := \
common/daemon_conn.o \
common/derive_basepoints.o \
common/dev_disconnect.o \
common/gen_status_wire.o \
common/status_wiregen.o \
common/htlc_tx.o \
common/htlc_wire.o \
common/initial_commit_tx.o \

4
openingd/Makefile

@ -51,8 +51,8 @@ OPENINGD_COMMON_OBJS := \
common/features.o \
common/fee_states.o \
common/funding_tx.o \
common/gen_status_wire.o \
common/gen_peer_status_wire.o \
common/status_wiregen.o \
common/peer_status_wiregen.o \
common/gossip_rcvd_filter.o \
common/gossip_store.o \
common/htlc_state.o \

2
openingd/openingd.c

@ -23,7 +23,6 @@
#include <common/features.h>
#include <common/fee_states.h>
#include <common/funding_tx.h>
#include <common/gen_peer_status_wire.h>
#include <common/gossip_rcvd_filter.h>
#include <common/gossip_store.h>
#include <common/initial_channel.h>
@ -32,6 +31,7 @@
#include <common/overflows.h>
#include <common/peer_billboard.h>
#include <common/peer_failed.h>
#include <common/peer_status_wiregen.h>
#include <common/penalty_base.h>
#include <common/pseudorand.h>
#include <common/read_peer_msg.h>

Loading…
Cancel
Save