blob: ebd90fd3ed23117105cb223743765d66815ab14a [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_Daemon_Dynamic_Types.ttcn
// Description: SDD types
// Rev: <RnXnn>
// Prodnr: CNL 113 630
// Updated: 2012-01-20
// Contact: http://ttcn.ericsson.se
module SCTP_Daemon_Dynamic_Types
{
//=========================================================================
// Import Part
//=========================================================================
import from SCTP_Daemon_Dynamic_Interface_Definitions all;
import from IPL4asp_Types all;
import from IPL4asp_PortType all;
//=========================================================================
// Data Types
//=========================================================================
type record of integer IntegerList;
type record AssociationRuntimeAttributes {
IntegerList subscribedTestcases,
integer socket,
integer endpointIndex,
SAC_STATE associationState,
charstring userState
}
type record of AssociationRuntimeAttributes AssociationRuntimeAttributesList;
type record SDD_AssociationConfig {
boolean serverAssociation, // true := server, false: client
boolean autoReconnect,
SDD_Interface localInterface optional,
SDD_Interface remoteInterface optional
}
type record of SDD_AssociationConfig SDD_AssociationConfigList;
type record of integer TCP_connections_List; //xxx for added SGsAP functionality
type function Connection_Insert(octetstring pl_data, integer pl_id) runs on self; //xxx
type function Connection_Lookup(octetstring pl_data) runs on self return TCP_connections_List; //xxx
type function Connection_Delete(integer pl_id) runs on self; //xxx
//=========================================================================
//Port Types
//=========================================================================
// Insert port type defintions here if applicable!
// You can use the port_type skeleton!
//=========================================================================
//Component Types
//=========================================================================
type component SDD_CT {
port SDD_Interface_PT daemonPort;
port IPL4asp_PT SCTP_PCO;
var SDD_AssociationList vc_associationList := {};
var AssociationRuntimeAttributesList vc_associationRuntimeAttributesList := {};
var SDD_InterfaceList v_localEndpointList := {};
//var ASP_TCP_Connected vc_connected;
var SDD_Message_with_ClientId vc_daemonMessage;
timer vc_reconnectTimer;
timer vc_inactivityTimer;
var ASP_RecvFrom vc_asp_SCTP_ReceivedMessage;
var ASP_Event vc_asp_SCTP_Event;
var ASP_Event vc_asp_TCP_Event;
var ASP_Event vc_sctpResult;
var ASP_Event vc_tcpClose;
var RegisteredAutoReplyFunctionList vc_registeredAutoReplyFunctionList := {};
var RegisteredAutoStateChangeHandlerFunctionList vc_registeredAutoStateChangeHandlerFunctionList := {};
var Connection_Insert v_Connection_Insert:=null;
var Connection_Lookup v_Connection_Lookup:=null;
var Connection_Delete v_Connection_Delete:=null;
var TCP_connections_List v_TCP_connections_List;
}
//=========================================================================
// Signatures
//=========================================================================
// return true if the message should not be passed to TTCN but replied with the sctpReply
type function f_SDD_AutoReplyFunction(in integer associationIndex, in ASP_RecvFrom sctpReceived, out ASP_Send sctpReply)
runs on self return boolean;
type record of f_SDD_AutoReplyFunction RegisteredAutoReplyFunctionList;
// return true if the state should not be passed to TTCN, but sctpMsg has to be automatically sent on the association
type function f_SDD_AutoStateChangeHandlerFunction(in integer associationIndex, in SAC_STATE newState, out ASP_Send sctpMsg)
runs on self return boolean;
type record of f_SDD_AutoStateChangeHandlerFunction RegisteredAutoStateChangeHandlerFunctionList;
//=========================================================================
// Constants
//=========================================================================
const SDD_Association c_emptyAssociation := {
associationId := -1,
serverAssociation := false, // true := server, false: client
autoReconnect := true,
localInterfacePresent := false,
localInterface := omit,
remoteInterfacePresent := false,
remoteInterface := omit
}
const AssociationRuntimeAttributes c_emptyAssociationRuntimeAttribute := {
subscribedTestcases := {},
socket := -1,
endpointIndex := -1,
associationState := SCTP_COMM_LOST,
userState := ""
}
//=========================================================================
// Templates
//=========================================================================
template SDD_Message_with_ClientId t_SDD_Message_with_ClientId := {
client_id := ?,
msg := ?
}
template SDD_Message_with_ClientId t_queryAssociations modifies t_SDD_Message_with_ClientId := {
msg := {
queryAssociations := ?
}
}
template SDD_Message_with_ClientId t_connect modifies t_SDD_Message_with_ClientId := {
msg := {
sctpConnect := ?
}
}
template SDD_Message_with_ClientId t_listen modifies t_SDD_Message_with_ClientId := {
msg := {
sctpListen := ?
}
}
template SDD_Message_with_ClientId t_close modifies t_SDD_Message_with_ClientId := {
msg := {
sctpClose := ?
}
}
template SDD_Message_with_ClientId t_sctpData modifies t_SDD_Message_with_ClientId := {
msg := {
sctpData := ?
}
}
template SDD_Message_with_ClientId t_subscribeToAssociation modifies t_SDD_Message_with_ClientId := {
msg := {
subscribeToAssociation := ?
}
}
//SCTP Assoc Change
template ASP_Event tr_S_SCTP_AssocChange
( template integer pl_associationID,
template SAC_STATE pl_state
) :=
{
sctpEvent :=
{
sctpAssocChange :=
{
clientId := pl_associationID,
proto :=
{
sctp:=
{
sinfo_stream := *,
sinfo_ppid := *,
remSocks := *,
assocId := *
}
},
sac_state := pl_state
}
}
}
//SCTP ShutdownEvent
template ASP_Event tr_S_SCTP_ShutdownEvent:=
{
sctpEvent :=
{
sctpShutDownEvent :=
{
clientId := ?
}
}
}
//Result
template ASP_Event tr_ASP_Result :=
{
result :=
{
errorCode := *,
connId := *,
os_error_code := *,
os_error_text := *
}
}
//SCTP Connected
template ASP_Event tr_ASP_SCTP_Connected:=
{
connOpened :=
{
connId := ?,
remName := ?,
remPort := ?,
locName := ?,
locPort := ?,
proto :=
{
sctp:=
{
sinfo_stream := *,
sinfo_ppid := *,
remSocks := *,
assocId := *
}
},
userData := ?
}
}
template ASP_Event tr_ASP_SCTP_Closed :=
{
connClosed :=
{
connId := ?,
remName := ?,
remPort := ?,
locName := ?,
locPort := ?,
proto :=
{
sctp:=
{
sinfo_stream := *,
sinfo_ppid := *,
remSocks := *,
assocId := *
}
},
userData := ?
}
}
//SCTP Peer Address Change
template ASP_Event tr_S_SCTP_PeerAddressChange:=
{
sctpEvent :=
{
sctpPeerAddrChange :=
{
clientId :=?,
spc_state := ?
}
}
}
//TCP Connection Openned
template ASP_Event tr_ASP_TCP_Connected :=
{
connOpened :=
{
connId := ?,
remName := ?,
remPort := ?,
locName := ?,
locPort := ?,
proto :={tcp:={}},
userData := ?
}
}
//TCP Close Connection
template ASP_Event tr_ASP_TCP_Close:=
{
connClosed :=
{
connId := ?,
remName := ?,
remPort := ?,
locName := ?,
locPort := ?,
proto :={tcp:={}},
userData := ?
}
}
} // end of module