/******************************************************************************
* Copyright (c) 2000-2019 Ericsson Telecom AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
*
* Contributors:
*  Tibor Csondes  - initial implementation and initial documentation
*  Akos Cserveni
*  Elemer Lelik
*  Gabor Szalai
*  Gabor Tatarka
*  Gergely Futo
*  Istvan Sandor
*  Peter Dimitrov
*  Peter Kremer
*  Tibor Bende
*  Zoltan Medve
******************************************************************************/
//
//  File:               TELNETasp_PortType.ttcn
//  Description:        TELNET testport port definition file
//  Rev:                R9A
//  Prodnr:             CNL 113 320
//

module TELNETasp_PortType
{

 external function FindString(in charstring msg_ch, in charstring pattern_ch) return integer;

 type enumerated TelnetReadMode
	{
	 UNBUFFERED	(0),
	 BUFFERED	(1)
	}

 type record TelnetWindowSize
	{
	 integer	width	(0..65535),
	 integer	height	(0..65535)
	}

 type record TelnetPrompt
	{
	 integer        id,
	 charstring     prompt,
	 boolean        has_wildcards
	}

 type record of TelnetPrompt TelnetPrompts;

 type boolean TelnetEcho;

 type record ASP_TelnetPortParameters
	{
	 charstring	ctrl_hostname			optional,
	 integer	ctrl_portnum			optional,
	 charstring	ctrl_username			optional,
	 charstring	ctrl_password			optional,
	 charstring	ctrl_domain			optional,
	 TelnetReadMode	ctrl_readmode			optional,
	 boolean	ctrl_login_skipped		optional,
	 boolean	ctrl_detect_server_disconnected	optional,
	 TelnetPrompts	prompts				optional,
	 charstring	ctrl_terminal_type		optional,
	 TelnetEcho	ctrl_echo			optional,
	 boolean	ctrl_CRLF			optional,
	 TelnetWindowSize ctrl_window_size		optional
	}


 type union ASP_TelnetDynamicConfig
	{
	 TelnetReadMode		readmode,
	 TelnetWindowSize	window_size,
	 TelnetEcho		echo,
	 TelnetPrompt		prompt
	}

 type enumerated ASP_TelnetConnection
	{
	 CONNECT(0)
	}

 type record ASP_TelnetClose {}
 
 type record ASP_Get_portnum {}  // Querries the local port number
 type record ASP_Portnum{
   integer    local_port_num  // The listening port number.
 }
type port TELNETasp_PT message
	{
	 inout	charstring;
	 in	integer;
         in     ASP_Portnum;
	 out	ASP_TelnetPortParameters,
		ASP_TelnetDynamicConfig,
		ASP_TelnetConnection,
                ASP_TelnetClose,
                ASP_Get_portnum;
	}

}
