/******************************************************************************
 * Copyright (c) 2000-2021 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:
 *   Balasko, Jeno
 *   Baranyi, Botond
 *
 ******************************************************************************/
//
//  File:         PIPEasp_Types.ttcn
//  Description:  PIPE (ASP) definitions
//  Reference:    Based on SCS PIPE testport
//  Rev:          <RnXnn>
//  Prodnr:       CNL 113 334
//  Updated:      2008-06-03
//  Contact:      http://ttcn.ericsson.se
//

module PIPEasp_Types
{//start of the module

// *************************************************************************
// *  Type Definitions Part                                                *
// *************************************************************************

// This ASP can be used to execute the given command with given standard input.
// The PResult ASP is sent as an answer, unless there is already a process
// executing which results in the ASP PError being sent.
//
// This ASP can only be sent from the test suite: $DIRECTION OUT
  type record ASP_PExecute {
    charstring command,
    charstring stdin
  };

// This ASP is sent as an answer to the PExecute ASP. It provides
// information about the standard output and error of the executed command,
// as well as the exit code of the command.
// 
// This ASP can only be received by the test suite: $DIRECTION IN
  type record ASP_PResult {
    charstring stdout,
    charstring stderr,
    integer    code
  };
  
// This ASP is similar to the PExecute ASP, except that binary data is
// sent instead of a string as the contents of standard input. This means that
// the data can be, for instance, the encode form of a PDU.
// 
// This ASP can only be sent from the test suite: $DIRECTION OUT
  type record ASP_PExecuteBinary {
    charstring  command,
    octetstring stdin
  };
  
// This ASP is similar to the PResult ASP, except that the outputs are
// given as binary data.
// 
// This ASP can only be received by the test suite: $DIRECTION IN
  type record ASP_PResultBinary {
    octetstring stdout,
    octetstring stderr,
    integer     code
  };
  
// This ASP can be used to start a background process with the command
// given in the parameters. The PStdin, PStdinBinary, PStdout, PStdoutBinary,
// PStderr, and PStderrBinary ASPs can then be used to send and receive input
// and output to and from the process.
// 
// This ASP can only be sent by the test suite: $DIRECTION OUT
  type record ASP_PExecuteBackground {
    charstring command
  };

// This ASP sends input to the process started with PExecuteBackground.
// After the usage of the PStdin ASP, all outputs are sent back to the
// test suite by the PStdout and PStderr ASPs.
// 
// This ASP can only be sent by the test suite: $DIRECTION OUT
  type record ASP_PStdin {
    charstring stdin
  };

// This ASP is sent to the test suite when the background process started
// by PExecuteBackground outputs something to its standard output.
// 
// This ASP can only be received by the test suite: $DIRECTION IN
  type record ASP_PStdout {
    charstring stdout
  };
  
// This ASP is sent to the test suite when the background process started
// by PExecuteBackground outputs something to its standard error.
// 
// This ASP can only be received by the test suite: $DIRECTION IN
  type record ASP_PStderr {
    charstring stderr
  };

// This ASP is similar to the PStdin ASP, except that the inputs are in
// binary format. After sending this ASP, all the outputs produced by the
// background process are sent back to the test suite in the PStdoutBinary
// and PStderrBinary ASPs.
// 
// This ASP can only be sent by the test suite: $DIRECTION OUT
  type record ASP_PStdinBinary {
    octetstring stdin
  };

// This ASP is similar to PStdout, except that it carries binary data.
// 
// This ASP can only be received by the test suite: $DIRECTION IN
  type record ASP_PStdoutBinary {
    octetstring stdout
  };

// This ASP is similar to PStderr, except that it carries binary data.
// 
// This ASP can only be received by the test suite: $DIRECTION IN
  type record ASP_PStderrBinary {
    octetstring stderr
  };

// This ASP can be used to send a signal to the process started by
// PExecuteBackground. The parameter value is the signal number.
// 
// This ASP can only be sent by the test suite: $DIRECTION OUT
  type record ASP_PKill {
    integer signal
  };

// This ASP informs the test suite about the death of the process started
// by PExecuteBackground. The parameter value is the exit code of the process.
// 
// This ASP can only be received by the test suite: $DIRECTION IN
  type record ASP_PExit {
    integer code
  };

// This ASP determines the meaning of the strings representing the standard
// input, output, and error in the ASPs PExecute, PResult, PStdin, PStdout,
// and PStderr.  In the first two ASPs, it determines if a newline is added to
// the end of the inputs and a newline is taken away from the end of the outputs.
// TRUE determines that these changes take place, and FALSE that they do not.
// 
// In the three other ASPs, TRUE means that a newline is added to the end of
// each input string, and that the outputs are sent in separate ASPs each
// containing only one line of text (without the newline).
// 
// By default, the PIPE test port functions as if the PLineMode ASP would have
// been sent with the parameter values TRUE.
// 
// This ASP can only be sent by the test suite: $DIRECTION OUT
  type record ASP_PLineMode {
    boolean lineMode
  };

// This ASP is sent to the test suite when the PIPE test port is used
// in a wrong manner.
// 
// This ASP can only be received by the test suite: $DIRECTION IN
  type record ASP_PError {
    charstring errorMessage
  };

// This ASP can be used to notify the test port that the end of input
// is reached. Makes sense for processes started by PExecuteBackground.
// After this ASP is sent to the background process no more input can be sent
// to its stdin using PStdin(Binary)
// Note, that for processes started by PExecute(Binary) the input is
// closed automatically.
// 
// This ASP can only be sent by the test suite: $DIRECTION OUT
  type record ASP_PEndOfInput {
  };

}//end module


