Commit c174bf0e authored by Bernd Paysan's avatar Bernd Paysan

hostname check, lightning network mentioned

parent bcefc563
......@@ -130,7 +130,7 @@ User dest-0key< \ pointer to obtained dest-0key
: +my-id ( -- )
config:prio# @ host-pri# !
config:host$ $@ host-id $!
host$ $@ host-id $!
my-0key @ IF my-0key sec@ host-key sec! THEN ;
: +my-addrs ( port o:addr -- )
......@@ -239,4 +239,4 @@ forth-local-indent-words:
(("net2o:" "+net2o:") (0 . 2) (0 . 2) non-immediate)
)
End:
[THEN]
\ No newline at end of file
[THEN]
......@@ -375,7 +375,7 @@ also net2o-base
pk@ $, dht-id dht-host? end-with ;
: my-host? ( addr u -- flag )
new-addr >o host-id $@ config:host$ $@ str= n2o:dispose-addr o> ;
new-addr >o host-id $@ host$ $@ str= n2o:dispose-addr o> ;
: my-addrs? ( addr u -- addr u flag )
false my-addr$ [: rot >r sigsize# - 2over str= r> or ;] $[]map ;
......
......@@ -41,10 +41,17 @@ Create nat64-ip4 $0064 w, $ff9b w, $0000 w, $0000 w, $0000 w, $0000 w,
\ Tags are kept sorted, so you'll get revocations first, then net2o and IPv6+4
\ Symbolic name may start with '@'+len followed by the name
Variable host$
: default-host ( -- )
pad $100 gethostname drop pad cstring>sstring config:host$ $!
config:host$ $@ s" .site" string-suffix? IF
config:host$ dup $@len 5 - 5 $del
pad $100 gethostname drop pad cstring>sstring host$ $!
host$ $@ s" .site" string-suffix? IF
host$ dup $@len 5 - 5 $del
THEN
config:orighost$ $@ host$ $@ str= IF
config:host$ $@ host$ $!
ELSE
config:host$ $free host$ $@ config:orighost$ $!
THEN
[IFDEF] android 20 [ELSE] 10 [THEN] \ mobile has lower prio
config:prio# ! ;
......@@ -53,10 +60,6 @@ default-host
:noname defers 'cold default-host ; is 'cold
: .myname ( -- )
config:prio# @ IF '0' emit config:prio# @ emit THEN
config:host$ $@len IF config:host$ $@ dup '@' + emit type THEN ;
Create ip6::0 here 16 dup allot erase
: .ip6::0 ( -- ) ip6::0 $10 type ;
: .ip4::0 ( -- ) ip6::0 4 type ;
......
......@@ -353,7 +353,8 @@ Variable logsize#
2Variable patchlimit&
Variable rootdirs$
Variable prio#
Variable host$
Variable host$ \g set host to this name
Variable orighost$ \g if the host is orighost$
Variable date#
$Variable objects$
$Variable chats$
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment