#!/bin/sh
#
# $Id: checktunnel.sh,v 1.6 2007/05/02 13:32:25 cnepveu Exp $
#
#  This source code copyright (c) Hexago Inc. 2005,2007.
#
#  LICENSE NOTICE: You may use and modify this source code only if you
#  have executed a valid license agreement with Hexago Inc. granting
#  you the right to do so, the said license agreement governing such
#  use and modifications.   Copyright or other intellectual property
#  notices are not to be removed from the source code.
#
#TAG : Display tunnel information
# <TSP_TUNNEL_INTERFACE> <TSP_CLIENT_ADDRESS_IPV4> <TSP_SERVER_ADDRESS_IPV4> <TSP_CLIENT_ADDRESS_IPV6> <TSP_SERVER_ADDRESS_IPV6> 
# <TSP_TUNNEL_PREFIXLEN> <TSP_HOME_INTERFACE>  <TSP_PREFIX> <TSP_PREFIXLEN>  <TSP_TUNNEL_MODE>
#
#
# Program localization 

cat <<EOT
Host type: [$TSP_HOST_TYPE]

Tunnel end-points:
Local interface: [$TSP_TUNNEL_INTERFACE]

Client:	v4[$TSP_CLIENT_ADDRESS_IPV4]
	v6[$TSP_CLIENT_ADDRESS_IPV6/$TSP_TUNNEL_PREFIXLEN]

Server:	v4[$TSP_SERVER_ADDRESS_IPV4]
	v6[$TSP_SERVER_ADDRESS_IPV6/$TSP_TUNNEL_PREFIXLEN]

Tunnel mode: [$TSP_TUNNEL_MODE]

EOT

if [ X"${TSP_HOST_TYPE}" = X"ROUTER" -o X"${TSP_HOST_TYPE}" = X"router" ]; then

cat <<EOT
Routing information:
Home network interface: [$TSP_HOME_INTERFACE]
  (for prefix advertisement)

Prefix: [$TSP_PREFIX/$TSP_PREFIXLEN]

EOT
fi

return 0
