chiark / gitweb /
server/admin.h: Consolidate address construction during resolution.
[tripe] / contrib / tripe-ipif.in
index 5a620faf4db9d8be8a8904ef73b3bc289e629613..d0118a457ed26f1ec17261031b08fde7a2fa24db 100755 (executable)
@@ -9,19 +9,18 @@
 ###
 ### This file is part of Trivial IP Encryption (TrIPE).
 ###
-### TrIPE is free software; you can redistribute it and/or modify
-### it under the terms of the GNU General Public License as published by
-### the Free Software Foundation; either version 2 of the License, or
-### (at your option) any later version.
+### TrIPE is free software: you can redistribute it and/or modify it under
+### the terms of the GNU General Public License as published by the Free
+### Software Foundation; either version 3 of the License, or (at your
+### option) any later version.
 ###
-### TrIPE is distributed in the hope that it will be useful,
-### but WITHOUT ANY WARRANTY; without even the implied warranty of
-### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-### GNU General Public License for more details.
+### TrIPE is distributed in the hope that it will be useful, but WITHOUT
+### ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+### FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+### for more details.
 ###
 ### You should have received a copy of the GNU General Public License
-### along with TrIPE; if not, write to the Free Software Foundation,
-### Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+### along with TrIPE.  If not, see <https://www.gnu.org/licenses/>.
 
 ###--------------------------------------------------------------------------
 ### Instructions.
@@ -90,19 +89,16 @@ esac
 echo "userv-$peer"
 
 ## Now we can interrogate the server without deadlocking it.
-algs=$(tripectl algs) tagsz=nil blksz=nil
+algs=$(tripectl algs) overhead=nil
 while read line; do
   for i in $line; do
-    case $i in
-      cipher-blksz=*) blksz=${i#*=} ;;
-      mac-tagsz=*) tagsz=${i#*=} ;;
-    esac
+    case $i in bulk-overhead=*) overhead=${i#*=} ;; esac
   done
 done <<EOF
 $algs
 EOF
-case ,$tagsz,$blksz, in
-  *,nil,*) echo >&2 "$quis[$$]: failed to discover cipher suite"; exit 1 ;;
+case $overhead in
+  nil) echo >&2 "$quis[$$]: failed to discover overhead"; exit 1 ;;
 esac
 
 ## Determine the remote address if none is specified; strip off a port number
@@ -123,7 +119,7 @@ esac
 
 ## Determine the MTU based on the path.
 pmtu=$(pathmtu $remote_ext)
-mtu=$(( $pmtu - 33 - $tagsz - $blksz ))
+mtu=$(( $pmtu - 29 - $overhead ))
 
 ## Obtain the tunnel and run it.
 now=$(date +"%Y-%m-%d %H:%M:%S")