/******************************************************************************
* 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:
*  Peter Dimitrov- initial implementation and initial documentation
*  Adam Delic
*  Eduard Czimbalmos
*  Endre Kulcsar
*  Gabor Bettesch
*  Gabor Szalai
*  Tamas Buti
*  Zoltan Medve
******************************************************************************/
//
//  File:               SCTPasp_Types.ttcn
//  Description:        SCTP ASP definition file
//  Prodnr:             CNL 113 469
//


module SCTPasp_Types
{

//=========================================================================
// Data Types
//=========================================================================

type octetstring PDU_SCTP;

type record ASP_SCTP
{
  integer client_id optional,
  integer sinfo_stream,
  integer sinfo_ppid,
  PDU_SCTP data
}


type record ASP_SCTP_Connect
{
  charstring peer_hostname optional,
  integer peer_portnumber (1..65535) optional
}


type record ASP_SCTP_ConnectFrom
{
  charstring local_hostname optional,
  integer local_portnumber (1..65535),
  charstring peer_hostname optional,
  integer peer_portnumber (1..65535) optional
}


type record ASP_SCTP_Listen
{
  charstring local_hostname optional,
  integer local_portnumber (1..65535)
}


type record SCTP_INIT
{
  integer sinit_num_ostreams,
  integer sinit_max_instreams,
  integer sinit_max_attempts,
  integer sinit_max_init_timeo
}

type record SCTP_EVENTS
{
  boolean sctp_data_io_event,
  boolean sctp_association_event,
  boolean sctp_address_event,
  boolean sctp_send_failure_event,
  boolean sctp_peer_error_event,
  boolean sctp_shutdown_event,
  boolean sctp_partial_delivery_event,
  boolean sctp_adaption_layer_event
}

type record SO_LINGER
{
  integer  l_onoff,
  integer l_linger
}

type record SCTP_RTOINFO
{
  integer client_id,
  integer srto_initial,
  integer srto_max,
  integer srto_min
}

type union ASP_SCTP_SetSocketOptions
{
  SCTP_INIT Sctp_init,
  SCTP_EVENTS Sctp_events,
  SO_LINGER So_linger,
  SCTP_RTOINFO Sctp_rtoinfo
}


type record ASP_SCTP_Close
{
  integer client_id optional
}


type enumerated SAC_STATE
{
  SCTP_COMM_UP, SCTP_COMM_LOST, SCTP_RESTART, 
  SCTP_SHUTDOWN_COMP, SCTP_CANT_STR_ASSOC, SCTP_UNKNOWN_SAC_STATE
}

type record ASP_SCTP_ASSOC_CHANGE
{
  integer client_id,
  SAC_STATE sac_state
}


type enumerated SPC_STATE
{
  SCTP_ADDR_AVAILABLE, SCTP_ADDR_UNREACHABLE, SCTP_ADDR_REMOVED,
  SCTP_ADDR_ADDED, SCTP_ADDR_MADE_PRIM, SCTP_ADDR_CONFIRMED, SCTP_UNKNOWN_SPC_STATE
}

type record ASP_SCTP_PEER_ADDR_CHANGE
{
  integer client_id,
  SPC_STATE spc_state
}


type record ASP_SCTP_SEND_FAILED
{
  integer client_id
}


type record ASP_SCTP_REMOTE_ERROR
{
  integer client_id
}


type record ASP_SCTP_SHUTDOWN_EVENT
{
  integer client_id
}


type record ASP_SCTP_PARTIAL_DELIVERY_EVENT
{
  integer client_id
}


type record ASP_SCTP_ADAPTION_INDICATION
{
  integer client_id
}


type record ASP_SCTP_Connected
{
  integer     client_id,
  charstring  local_hostname,
  integer     local_portnumber (1..65535),
  charstring  peer_hostname,
  integer     peer_portnumber (1..65535)
}


type record ASP_SCTP_SENDMSG_ERROR
{
  integer client_id optional,
  integer sinfo_stream,
  integer sinfo_ppid,
  PDU_SCTP data
}

type record ASP_SCTP_RESULT
{
  integer client_id optional,
  boolean error_status,
  charstring error_message optional
}

}//end of module

