blob: e589b646f4fa55d0cb1e9b051224c5d7f447f58f [file] [log] [blame]
///////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2000-2018 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
///////////////////////////////////////////////////////////////////////////////
//
// File: SCTP_Engine_PortTypes.ttcn
// Description: Test port definition of the SCTP Engine
// Rev: <RnXnn>
// Prodnr: CNL 113 840
//
module SCTP_Engine_PortTypes {
// Upper side test port. Provides the SCTP API
// Signature definition of the procedure calls
// Client -> SCTP Engine component
// If the requested operation was executed successfully all of the
// procedure returns SCTP_Engine_result
// If something went wrong an execption will be raised.
// The assoc-id of the listen port is returned.
// A separate assoc_id will be created for the accepted connections
signature S_SCTP_Listen(in SCTP_Listen_data pl_arg)
return SCTP_Engine_result
exception (SCTP_operation_execption)
signature S_SCTP_Connect(in SCTP_Connect_data pl_arg)
return SCTP_Engine_result
exception (SCTP_operation_execption)
// The shutdown procedure and the release of the assoc_id shoud be done as:
//
// User initiated shutdown is a 3 step procedure:
// call S_SCTP_Shutdown
// receive S_SCTP_Shutdown_ind
// call S_SCTP_Shutdown_conf
//
// Remote side initiated shutdown
// receive S_SCTP_Shutdown_ind
// call S_SCTP_Shutdown_conf
//
// The assoc_id is released only after the call of the S_SCTP_Shutdown_conf
signature S_SCTP_Shutdown(in SCTP_Shutdown_data pl_arg)
return SCTP_Engine_result
exception (SCTP_operation_execption)
signature S_SCTP_Shutdown_conf(in integer assoc_id)
return SCTP_Engine_result
exception (SCTP_operation_execption)
// Request the sending of user data
signature S_SCTP_Send_req(in SCTP_MSG_data pl_arg)
return SCTP_Engine_result
exception (SCTP_operation_execption)
// Set options
signature S_SCTP_options(in SCTP_Options_data pl_arg)
return SCTP_Engine_result
exception (SCTP_operation_execption)
// Reconfiguration request
signature S_SCTP_reconfig(in SCTP_Reconfiguration_req pl_arg)
return SCTP_Engine_result
exception (SCTP_operation_execption)
// SCTP engine -> Client
// Shutdown indication
signature S_SCTP_Shutdown_ind(in SCTP_Shutdown_data pl_arg)
// Connected indication.
// called by the SCTP engine, when accepting a new client connection
signature S_SCTP_Connected_ind(in SCTP_Connected_data pl_arg)
// Receive data indication
signature S_SCTP_Received_ind(in SCTP_MSG_data pl_arg)
// Notification indication
signature S_SCTP_Notification_ind(in SCTP_Notification_data pl_arg)
// API type definitions
type record SCTP_Notification_data {
integer assoc_id,
SCTP_Notification_union notification,
SCTP_Engine_Option_list options optional
}
type record SCTP_Notification_Comm_up{
}
type record SCTP_Notification_Comm_lost{
}
type union SCTP_Notification_union{
SCTP_Notification_Comm_up comm_up,
SCTP_Notification_Comm_lost comm_lost,
SCTP_Reconfiguration reconfig
}
type enumerated SCTP_Reconfig_result { RECONFIG_OK, RECONFIG_FAIL, RECONFIG_DENY }
type record SCTP_Reconfiguration { // RFC 6525
SCTP_Reconfig_result result,
SCTP_Reconfiguration_method method optional
}
type record SCTP_Reconfiguration_req {
integer assoc_id,
SCTP_Reconfiguration_method reconf_method
}
type union SCTP_Reconfiguration_method{ // RFC 6525
SCTP_Reconfig_Stream_Reset stream_reset,
SCTP_Reconfig_Assoc_Reset assoc_reset,
SCTP_Reconfig_Stream_Add add_stream
}
type record SCTP_Reconfig_Stream_Reset{
boolean incoming,
record of integer streams optional
}
type record SCTP_Reconfig_Assoc_Reset{
}
type record SCTP_Reconfig_Stream_Add{
boolean incoming,
integer new_streams
}
type record SCTP_Connected_data {
integer assoc_id,
integer local_sctp_port,
integer remote_sctp_port,
integer listen_assoc_id // assoc_id of the listen port
// Use it to direct the new assoc-id to the right place
}
type record SCTP_Options_data {
integer assoc_id,
SCTP_Engine_Option_list options
}
type record SCTP_MSG_data {
integer assoc_id,
integer ppid,
integer stream_id,
octetstring data,
SCTP_Engine_Option_list options optional
}
type record SCTP_Engine_result{
integer assoc_id
}
type enumerated SCTP_Engine_cause {
SCTP_ENG_WRONG_ASSOC_ID,
SCTP_ENG_PORT_ALREADY_USED,
SCTP_ENG_WRONG_PORT,
SCTP_ENG_WRONG_PARAMETERS,
SCTP_ENG_INTERNAL_ERROR,
SCTP_ENG_WRONG_ASSOC_STATE,
SCTP_ENG_RECONFIG_ONGOING
// More cause code will be added later
}
type record SCTP_operation_execption{
SCTP_Engine_cause cause,
charstring cause_text
}
type record SCTP_Shutdown_data{
integer assoc_id,
boolean graceful_shutdown, // true - initiate gracefull shutdown, false - send abort
charstring reason optional // if present sent as abort reason
}
type record SCTP_Listen_data {
integer local_sctp_port,
integer transport_id,
SCTP_Engine_Option_list options optional
}
type record SCTP_Connect_data {
integer local_sctp_port,
integer remote_sctp_port,
integer transport_id,
SCTP_Engine_Option_list options optional
}
// SCTP option definitions
type record of SCTP_Engine_Option SCTP_Engine_Option_list;
type union SCTP_Engine_Option {
boolean i_data_supported, // If true:
// Supplied for connection setup: negotiate iData support
boolean unordered, // Indicates that the MSG is unordered
SCTP_Reconfig_config reconfig_params,
boolean forward_tsn_supported, // indicates the support of RFC3758
float lifetime, // The relative lifetime of the message as RFC3758
integer max_retransmit_counter // See RFC 7496
// More will be added later
}
type record SCTP_Reconfig_config{
boolean is_supported,
boolean stream_reset_allowed,
boolean assoc_reset_allowed,
boolean stream_add_allowed
}
// Why procedure based?
// Because the each operation is a request to execute some operation:
// S_SCTP_Listen: means please start to
// listen for an incoming association request
//
// The result of the operation should be syncronized and paired with the
// request. The result should be available immediately without delay
//
// The procedure based port are represents a client-server connections
// That is why we need 2 port
// SCTP_Engine_API_request_PT : The SCTP user call the operation of the
// SCTP engine component
// SCTP_Engine_API_indication_PT: The SCTP engine notifies the user via this
//
// Using only one test port can mix up the result of ongoing operation and
// the incoming indication calls
// The SCTP API test port
type port SCTP_Engine_API_request_PT procedure {
inout S_SCTP_Listen, S_SCTP_Connect, S_SCTP_Shutdown,S_SCTP_Shutdown_conf
inout S_SCTP_Send_req, S_SCTP_options, S_SCTP_reconfig
} with {
extension "internal"
}
type port SCTP_Engine_API_indication_PT procedure {
inout S_SCTP_Shutdown_ind, S_SCTP_Connected_ind, S_SCTP_Received_ind
inout S_SCTP_Notification_ind
} with {
extension "internal"
}
//******************************************************************************
// Lower side port. Excahnges the encoded SCTP packets
// Used to represent a SCTP packet in encoded form
type record SCTP_Engine_packet {
integer transport_id, // The identifier used to identify the transport connection
// The identifier is specified in a Listen/Connect operation
// The associations using the same transport id are distinguished by the SCTP port numbers
octetstring sctp_packet // The SCTP packet
}
type record SCTP_Addr_change_notification{
integer transport_id // The identifier used to identify the transport connection
}
// used only between components
type port SCTP_Engine_packet_PT message {
inout SCTP_Engine_packet
inout SCTP_Addr_change_notification
} with {
extension "internal"
}
}