Commit ee0dee24 authored by Bernd Paysan's avatar Bernd Paysan

Bump version number

parent 87d278d3
......@@ -64,11 +64,13 @@ in net2o : dispose-addr ( o:addr -- o:addr )
host:id $free host:anchor $free host:route $free host:revoke $free
host:key sec-free host:ekey sec-free
dispose ;
in net2o : dispose-punchs ( -- )
punch-addrs [: .net2o:dispose-addr ;] $[]o-map
punch-addrs $free ;
in net2o : dispose-addrs ( addr -- )
dup >r [: .net2o:dispose-addr ;] $[]o-map
r> $free ;
:noname ( -- )
net2o:dispose-punchs defers extra-dispose ; is extra-dispose
dest-addrs net2o:dispose-addrs
punch-addrs net2o:dispose-addrs
defers extra-dispose ; is extra-dispose
: new-addr ( addr u -- o ) \G create a new address object from string
net2o:new-addr n:>o nest-cmd-loop o n:o> ;
......
......@@ -237,6 +237,7 @@ drop
cmd-class class
\ callbacks
defer: send0-xt \ send out a stateless packet
defer: timeout-xt \ callback for timeout
defer: setip-xt \ callback for set-ip
defer: ack-xt \ callback for acknowledge
......@@ -255,11 +256,12 @@ cmd-class class
field: resend0
field: data-resend
field: pubkey \ other side official pubkey
field: punch-addrs
field: rqd-xts \ callbacks for request done (array)
field: my-error-id
field: beacon-hash
0 +field end-strings
field: dest-addrs \ list of destinations
field: punch-addrs \ list of punch destinations
field: request-gen \ pre-generated request number
field: perm-mask
\ secrets
......
......@@ -15,7 +15,7 @@ dnl Process this file with autoconf to produce a configure script.
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
AC_INIT([net2o], [0.9.1-20191003], [bernd@net2o.de], [net2o], [https://fossil.net2o.de/net2o/reportlist])
AC_INIT([net2o], [0.9.1-20191010], [bernd@net2o.de], [net2o], [https://fossil.net2o.de/net2o/reportlist])
AC_PREREQ([2.59])
AC_CONFIG_MACRO_DIR([m4])
AC_USE_SYSTEM_EXTENSIONS
......
......@@ -16,7 +16,7 @@
\ along with this program. If not, see <http://www.gnu.org/licenses/>.
Forward >invitations
in net2o Forward dispose-punchs
in net2o Forward dispose-addrs
Forward mynick$
Forward invite-me
Forward qr-invite-me
......@@ -53,8 +53,9 @@ $20 net2o: request-done ( ureq -- ) 64>n \g signal request is completed
+net2o: punch-load, ( $:string -- ) \g use for punch payload: nest it
$> $, nest o IF
nat( ." punch from: " return-address .addr-path forth:cr )
['] punchs code-reply is send-xt THEN
net2o:dispose-punchs ;
['] punchs code-reply is send-xt
punch-addrs net2o:dispose-addrs \ first punch load: empty addresses
THEN ;
+net2o: punch ( $:string -- ) \g punch NAT traversal hole
$> nat( ." punch to: " 2dup .addr$ forth:cr ) net2o:punch ;
+net2o: punch-done ( -- ) \g punch received
......
......@@ -2,7 +2,7 @@
echo "This script builds net2o from scratch"
GFORTH=gforth-0.7.9_20191003
GFORTH=gforth-0.7.9_20191010
if [ "$(uname -o)" = "Cygwin" ]
then
......
......@@ -57,13 +57,6 @@ require dhtroot.fs
dhtroot-addr$ $off
dhtroot-addr @ ?dup-IF net2o:dispose-addr THEN ;
: ins-ip ( -- net2oaddr )
net2o-host $@ net2o-port insert-ip ind-addr off ;
: ins-ip4 ( -- net2oaddr )
net2o-host $@ net2o-port insert-ip4 ind-addr off ;
: ins-ip6 ( -- net2oaddr )
net2o-host $@ net2o-port insert-ip6 ind-addr off ;
: pk:connect ( code data key u -- )
connect( [: .time ." Connect to: " dup hex. cr ;] $err )
net2o:new-context >o rdrop o to connection setup!
......@@ -72,6 +65,15 @@ require dhtroot.fs
+flow-control +resend
connect( [: .time ." Connected, o=" o hex. cr ;] $err ) ;
: pk-addr:connect ( code data key u addr -- )
connect( [: .time ." Connect to: " dup hex. cr ;] $err )
net2o:new-context >o rdrop o to connection setup!
['] dests is send0-xt dest-addrs >stack
dest-pk \ set our destination key
+resend-cmd net2o:connect
+flow-control +resend
connect( [: .time ." Connected, o=" o hex. cr ;] $err ) ;
Forward renat-all
event: :>renat ( -- ) renat-all ;
......@@ -86,7 +88,9 @@ event: :>disconnect ( addr -- ) .disconnect-me ;
dht-connection ?dup-IF >o o to connection rdrop EXIT THEN
tick-adjust 64@ 64-0= IF +get-time THEN
$8 $8 dhtnick $@ nick>pk dhtroot
online? IF +dht-beacon pk:connect o to dht-connection
online? IF
+dht-beacon
dhtroot-addr@ pk-addr:connect o to dht-connection
ELSE 2drop 2drop THEN ;
: dht-disconnect ( -- )
0 addr dht-connection !@ ?dup-IF
......
......@@ -1078,18 +1078,22 @@ in net2o : punch ( addr u o:connection -- )
return-address { ret[ $10 ] } catch
ret[ return-address $10 move throw ;
: punch-loop ( xt -- )
[{: xt :}l punch-addrs $@ bounds ?DO
: addrs-loop ( addrs xt -- )
[{: addrs xt :}l addrs $@ bounds ?DO
I @ xt addr>sock
cell +LOOP ;] punch-wrap ;
: pings ( o:connection -- )
\G ping all addresses (why except the first one?)
['] ping-addr1 punch-loop ;
punch-addrs ['] ping-addr1 addrs-loop ;
: punchs ( addr u o:connection -- )
\G send a reply to all addresses
['] send-punch punch-loop ;
punch-addrs ['] send-punch addrs-loop 2drop ;
: dests ( addr u o:connection -- )
\G send a reply to all addresses
dest-addrs ['] send-punch addrs-loop 2drop ;
\ send chunk
......
# Commands #
Version 0.9.1-20191003.
Version 0.9.1-20191010.
net2o separates data and commands. Data is passed through to higher
layers, commands are interpreted when they arrive. For connection
......
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