mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 07:04:22 +01:00
Init commit to be able to create a tor static service on the fly.
We want to have a static Tor service created from a blob bound to our node on cmdline Changelog-added: persistent Tor address support Changelog-added: allow the Tor inbound service port differ from 9735 Signed-off-by: Saibato <saibato.naga@pm.me> Add base64 encode/decode to common We need this to encode the blob for the tor service Signed-off-by: Saibato <saibato.naga@pm.me>
This commit is contained in:
committed by
Christian Decker
parent
99ff86f6fe
commit
f6006f43a9
@@ -43,6 +43,8 @@ struct sockaddr_un;
|
||||
#define TOR_V2_ADDRLEN 10
|
||||
#define TOR_V3_ADDRLEN 35
|
||||
#define LARGEST_ADDRLEN TOR_V3_ADDRLEN
|
||||
#define TOR_V3_BLOBLEN 64
|
||||
#define STATIC_TOR_MAGIC_STRING "gen-default-toraddress"
|
||||
|
||||
enum wire_addr_type {
|
||||
ADDR_TYPE_IPV4 = 1,
|
||||
@@ -110,6 +112,7 @@ enum wireaddr_internal_type {
|
||||
ADDR_INTERNAL_AUTOTOR,
|
||||
ADDR_INTERNAL_FORPROXY,
|
||||
ADDR_INTERNAL_WIREADDR,
|
||||
ADDR_INTERNAL_STATICTOR,
|
||||
};
|
||||
|
||||
/* For internal use, where we can also supply a local socket, wildcard. */
|
||||
@@ -120,8 +123,13 @@ struct wireaddr_internal {
|
||||
struct wireaddr wireaddr;
|
||||
/* ADDR_INTERNAL_ALLPROTO */
|
||||
u16 port;
|
||||
/* ADDR_INTERNAL_AUTOTOR */
|
||||
struct wireaddr torservice;
|
||||
/* ADDR_INTERNAL_AUTOTOR
|
||||
* ADDR_INTERNAL_STATICTOR */
|
||||
struct torservice {
|
||||
struct wireaddr address;
|
||||
u16 port;
|
||||
u8 blob[TOR_V3_BLOBLEN + 1];
|
||||
} torservice;
|
||||
/* ADDR_INTERNAL_FORPROXY */
|
||||
struct unresolved {
|
||||
char name[256];
|
||||
|
||||
Reference in New Issue
Block a user