Browse Source

gossipd: move files into connectd.

These source files are only used for peer-related things, so move them.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ppa-0.6.1
Rusty Russell 6 years ago
parent
commit
0d442b5ff2
  1. 8
      connectd/Makefile
  2. 8
      connectd/connect.c
  3. 2
      connectd/handshake.c
  4. 6
      connectd/handshake.h
  5. 2
      connectd/netaddress.c
  6. 6
      connectd/netaddress.h
  7. 26
      connectd/test/Makefile
  8. 0
      connectd/test/run-initiator-success.c
  9. 0
      connectd/test/run-responder-success.c
  10. 4
      connectd/tor.c
  11. 6
      connectd/tor.h
  12. 2
      connectd/tor_autoservice.c
  13. 6
      connectd/tor_autoservice.h
  14. 4
      gossipd/gossip.c

8
connectd/Makefile

@ -15,10 +15,10 @@ LIGHTNINGD_CONNECT_CONTROL_OBJS := $(LIGHTNINGD_CONNECT_CONTROL_SRC:.c=.o)
LIGHTNINGD_CONNECT_HEADERS := connectd/gen_connect_wire.h \
connectd/gen_connect_gossip_wire.h \
connectd/connect.h \
gossipd/handshake.h \
gossipd/netaddress.h \
gossipd/tor_autoservice.h \
gossipd/tor.h
connectd/handshake.h \
connectd/netaddress.h \
connectd/tor_autoservice.h \
connectd/tor.h
LIGHTNINGD_CONNECT_SRC := $(LIGHTNINGD_CONNECT_HEADERS:.h=.c)
LIGHTNINGD_CONNECT_OBJS := $(LIGHTNINGD_CONNECT_SRC:.c=.o)

8
connectd/connect.c

@ -33,12 +33,12 @@
#include <connectd/connect.h>
#include <connectd/gen_connect_gossip_wire.h>
#include <connectd/gen_connect_wire.h>
#include <connectd/handshake.h>
#include <connectd/netaddress.h>
#include <connectd/tor.h>
#include <connectd/tor_autoservice.h>
#include <errno.h>
#include <gossipd/gen_gossip_wire.h>
#include <gossipd/handshake.h>
#include <gossipd/netaddress.h>
#include <gossipd/tor.h>
#include <gossipd/tor_autoservice.h>
#include <hsmd/client.h>
#include <hsmd/gen_hsm_client_wire.h>
#include <inttypes.h>

2
gossipd/handshake.c → connectd/handshake.c

@ -11,8 +11,8 @@
#include <common/type_to_string.h>
#include <common/utils.h>
#include <common/wireaddr.h>
#include <connectd/handshake.h>
#include <errno.h>
#include <gossipd/handshake.h>
#include <hsmd/client.h>
#include <secp256k1.h>
#include <secp256k1_ecdh.h>

6
gossipd/handshake.h → connectd/handshake.h

@ -1,5 +1,5 @@
#ifndef LIGHTNING_GOSSIPD_HANDSHAKE_H
#define LIGHTNING_GOSSIPD_HANDSHAKE_H
#ifndef LIGHTNING_CONNECTD_HANDSHAKE_H
#define LIGHTNING_CONNECTD_HANDSHAKE_H
#include "config.h"
#include <ccan/typesafe_cb/typesafe_cb.h>
@ -51,4 +51,4 @@ struct io_plan *responder_handshake_(struct io_conn *conn,
void *cbarg),
void *cbarg);
#endif /* LIGHTNING_GOSSIPD_HANDSHAKE_H */
#endif /* LIGHTNING_CONNECTD_HANDSHAKE_H */

2
gossipd/netaddress.c → connectd/netaddress.c

@ -2,8 +2,8 @@
#include <assert.h>
#include <common/status.h>
#include <common/type_to_string.h>
#include <connectd/netaddress.h>
#include <errno.h>
#include <gossipd/netaddress.h>
#include <netinet/in.h>
#include <stdbool.h>
#include <sys/socket.h>

6
gossipd/netaddress.h → connectd/netaddress.h

@ -1,5 +1,5 @@
#ifndef LIGHTNING_GOSSIPD_NETADDRESS_H
#define LIGHTNING_GOSSIPD_NETADDRESS_H
#ifndef LIGHTNING_CONNECTD_NETADDRESS_H
#define LIGHTNING_CONNECTD_NETADDRESS_H
#include "config.h"
#include <ccan/short_types/short_types.h>
#include <common/wireaddr.h>
@ -11,4 +11,4 @@ bool guess_address(struct wireaddr *wireaddr);
bool address_routable(const struct wireaddr *wireaddr,
bool allow_localhost);
#endif /* LIGHTNING_GOSSIPD_NETADDRESS_H */
#endif /* LIGHTNING_CONNECTD_NETADDRESS_H */

26
connectd/test/Makefile

@ -0,0 +1,26 @@
check: connectd-tests
# Note that these actually #include everything they need, except ccan/ and bitcoin/.
# That allows for unit testing of statics, and special effects.
CONNECTD_TEST_SRC := $(wildcard connectd/test/run-*.c)
CONNECTD_TEST_OBJS := $(CONNECTD_TEST_SRC:.c=.o)
CONNECTD_TEST_PROGRAMS := $(CONNECTD_TEST_OBJS:.o=)
CONNECTD_TEST_COMMON_OBJS := \
common/features.o \
common/pseudorand.o \
common/type_to_string.o \
common/utils.o
update-mocks: $(CONNECTD_TEST_SRC:%=update-mocks/%)
$(CONNECTD_TEST_PROGRAMS): $(CONNECTD_TEST_COMMON_OBJS) $(BITCOIN_OBJS)
# Test objects depend on ../ src and headers.
$(CONNECTD_TEST_OBJS): $(LIGHTNINGD_CONNECT_HEADERS) $(LIGHTNINGD_CONNECT_SRC)
ALL_OBJS += $(CONNECTD_TEST_OBJS)
ALL_TEST_PROGRAMS += $(CONNECTD_TEST_PROGRAMS)
connectd-tests: $(CONNECTD_TEST_PROGRAMS:%=unittest/%)

0
gossipd/test/run-initiator-success.c → connectd/test/run-initiator-success.c

0
gossipd/test/run-responder-success.c → connectd/test/run-responder-success.c

4
gossipd/tor.c → connectd/tor.c

@ -4,8 +4,8 @@
#include <common/status.h>
#include <common/utils.h>
#include <common/wireaddr.h>
#include <gossipd/gossip.h>
#include <gossipd/tor.h>
#include <connectd/connect.h>
#include <connectd/tor.h>
#include <netdb.h>
#include <netinet/in.h>
#include <sys/socket.h>

6
gossipd/tor.h → connectd/tor.h

@ -1,5 +1,5 @@
#ifndef LIGHTNING_GOSSIPD_TOR_H
#define LIGHTNING_GOSSIPD_TOR_H
#ifndef LIGHTNING_CONNECTD_TOR_H
#define LIGHTNING_CONNECTD_TOR_H
#include "config.h"
#include <stdbool.h>
@ -13,4 +13,4 @@ struct io_plan *io_tor_connect(struct io_conn *conn,
const char *host, u16 port,
struct reaching *reach);
#endif /* LIGHTNING_GOSSIPD_TOR_H */
#endif /* LIGHTNING_CONNECTD_TOR_H */

2
gossipd/tor_autoservice.c → connectd/tor_autoservice.c

@ -10,9 +10,9 @@
#include <common/type_to_string.h>
#include <common/utils.h>
#include <common/wireaddr.h>
#include <connectd/tor_autoservice.h>
#include <errno.h>
#include <fcntl.h>
#include <gossipd/tor_autoservice.h>
#include <lightningd/log.h>
#include <netdb.h>
#include <netinet/in.h>

6
gossipd/tor_autoservice.h → connectd/tor_autoservice.h

@ -1,5 +1,5 @@
#ifndef LIGHTNING_GOSSIPD_TOR_AUTOSERVICE_H
#define LIGHTNING_GOSSIPD_TOR_AUTOSERVICE_H
#ifndef LIGHTNING_CONNECTD_TOR_AUTOSERVICE_H
#define LIGHTNING_CONNECTD_TOR_AUTOSERVICE_H
#include "config.h"
#include <ccan/short_types/short_types.h>
#include <ccan/tal/tal.h>
@ -11,4 +11,4 @@ struct wireaddr *tor_autoservice(const tal_t *ctx,
const char *tor_password,
const struct wireaddr_internal *bindings);
#endif /* LIGHTNING_GOSSIPD_TOR_AUTOSERVICE_H */
#endif /* LIGHTNING_CONNECTD_TOR_AUTOSERVICE_H */

4
gossipd/gossip.c

@ -36,11 +36,7 @@
#include <gossipd/broadcast.h>
#include <gossipd/gen_gossip_wire.h>
#include <gossipd/gossip.h>
#include <gossipd/handshake.h>
#include <gossipd/netaddress.h>
#include <gossipd/routing.h>
#include <gossipd/tor.h>
#include <gossipd/tor_autoservice.h>
#include <hsmd/client.h>
#include <hsmd/gen_hsm_client_wire.h>
#include <inttypes.h>

Loading…
Cancel
Save