Verified Commit 8cc90eff authored by Bernd Paysan's avatar Bernd Paysan
Browse files

add port declaration to config

parent 0d061c3d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -568,7 +568,7 @@ in net2o : ok? ( -- ) o?
    tag( ." tag: " tag-addr dup hex. 2@ swap hex. hex. forth:cr )
    code-vdest r@ reply-dest 64!
    r> code-reply dup off  to reply-tag ;
in net2o : ok ( tag -- ) 'o' forth:emit  \ ." ok" forth:cr
in net2o : ok ( tag -- ) \ ." ok" forth:cr
\    timeout( ." ok: " dup hex. forth:cr )
    o 0= IF  drop EXIT  THEN
    request( ." request acked: " dup . cr )
+2 −2
Original line number Diff line number Diff line
@@ -111,7 +111,7 @@ Forward insert-addr ( o -- )
	      THEN
	  cell +LOOP o>
      cell +LOOP
    ;] #map ;
    ;] #map #0. n2o:nat ;

\ notification for address changes

@@ -143,7 +143,7 @@ event: :>renat ( -- ) renat-all ;
    beacon( ." done renat" cr ) ;

scope{ /chat
: renat ( addr u -- ) 2drop renat-all ;
: renat ( addr u -- ) renat-all nat ;
}scope

\ beacon handling
+1 −2
Original line number Diff line number Diff line
@@ -313,8 +313,7 @@ Forward !my-addr ( -- )

\ Create udp socket

4242 Value net2o-port
0    Value net2o-client-port \ client port by default unassigned
4242 Value net2o-port \ fix server port

Variable net2o-host "net2o.de" net2o-host $!

+1 −1
Original line number Diff line number Diff line
@@ -446,7 +446,7 @@ warnings !
    \G -port: sets port to a fixed number for reachability from outside,
    \G -port: allows to define port forwarding rules in the firewall
    \G -port: only for client; server-side port is different
    ?nextarg 0= ?EXIT  s>number drop to net2o-client-port
    ?nextarg 0= ?EXIT  s>number drop config:port# !
    next-cmd ;

: -otr ( --- )
+3 −3
Original line number Diff line number Diff line
@@ -1422,7 +1422,7 @@ Variable timeout-tasks
: +next-timeouts ( -- timeout )
    rtdelay 64@ timeouts @ >timeout ticks 64+ ;
: +timeouts ( -- timeout ) 
    +next-timeouts 1 timeouts +! '+' forth:emit ( @ ." TO inc: " . cr ) ;
    +next-timeouts 1 timeouts +! ( @ ." TO inc: " . cr ) ;
: +timeout0 ( -- timeout )
    rtdelay 64@ ticker 64@ 64+ ;
: 0timeout ( -- )
@@ -1827,9 +1827,9 @@ Defer init-rest
Variable initialized

: init-client ( -- )  true initialized !@ 0= IF
	init-dirs  net2o-client-port  init-rest  THEN ;
	init-dirs  config:port# @  init-rest  THEN ;
: init-server ( -- )  true initialized !@ 0= IF
	init-dirs  net2o-port  init-rest  THEN ;
	init-dirs  config:port# @ net2o-port over select  init-rest  THEN ;

\ connection cookies

Loading