blob: 6912e24a6c775c6d86316878c90caf9aafd4944c [file] [log] [blame]
///////////////////////////////////////////////////////////////////////////////
// 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
///////////////////////////////////////////////////////////////////////////////
//
// File: SCTP_Daemon_Dynamic_Types.ttcn
// Description: IPDD types
// Rev: <RnXnn>
// Prodnr: CNL 113 630
// Updated: 2012-05-07
// Contact: http://ttcn.ericsson.se
module IP_Daemon_Dynamic_Types
{
//=========================================================================
// Import Part
//=========================================================================
import from IP_Daemon_Dynamic_Interface_Definitions all;
import from IPL4asp_Types all;
import from IPL4asp_PortType all;
//=========================================================================
// Data Types
//=========================================================================
type record of integer IntegerList;
type record ConnectionRuntimeAttributes {
IntegerList subscribedTestcases,
integer socket,
integer endpointIndex,
SAC_STATE sctpState,
charstring userState
}
type record of ConnectionRuntimeAttributes ConnectionRuntimeAttributesList;
type record IPDD_ConnectionConfig {
boolean serverConnection, // true := server, false: client
boolean autoReconnect,
IPDD_Interface localInterface optional,
IPDD_Interface remoteInterface optional,
ProtoTupleEnum proto
}
type record of IPDD_ConnectionConfig IPDD_ConnectionConfigList;
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
//=========================================================================
//Component Types
//=========================================================================
type component IPDD_CT {
port IPDD_Interface_PT daemonPort;
port IPL4asp_PT IP_PCO;
var IPDD_ConnectionList vc_connectionList := {};
var ConnectionRuntimeAttributesList vc_connectionRuntimeAttributesList := {};
var IPDD_InterfaceList v_localEndpointList := {};
//var ASP_TCP_Connected vc_connected;
var IPDD_Message_with_ClientId vc_daemonMessage;
timer vc_reconnectTimer;
timer vc_inactivityTimer;
var ASP_RecvFrom vc_asp_IP_ReceivedMessage;
var ASP_Event vc_asp_IP_Event;
var ASP_Event vc_asp_TCP_Event;
var ASP_Event vc_ipResult;
var ASP_Event vc_tcpClose;
var RegisteredAutoReplyFunctionList vc_registeredAutoReplyFunctionList := {};
var RegisteredAutoStateChangeHandlerFunctionList vc_registeredAutoStateChangeHandlerFunctionList := {};
var RegisteredAutoStartupFunctionList vc_registeredAutoStartupFunctionList := {};
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 ipReply
type function f_IPDD_AutoReplyFunction(in integer connectionIndex, in ASP_RecvFrom ipReceived, out ASP_Send ipReply)
runs on self return boolean;
type record of f_IPDD_AutoReplyFunction RegisteredAutoReplyFunctionList;
// return true if the state should not be passed to TTCN, but ipMsg has to be automatically sent on the connection
type function f_IPDD_AutoStateChangeHandlerFunction(in integer connectionIndex, in SAC_STATE newState, out ASP_Send ipMsg)
runs on self return boolean;
type record of f_IPDD_AutoStateChangeHandlerFunction RegisteredAutoStateChangeHandlerFunctionList;
// return true if the message should be sent to SUT and put the message in the ipMsg
type function f_IPDD_AutoStartupFunction(in integer connectionIndex, out ASP_Send ipMsg)
runs on self return boolean;
type record of f_IPDD_AutoStartupFunction RegisteredAutoStartupFunctionList;
//=========================================================================
// Constants
//=========================================================================
const IPDD_Connection c_emptyConnection := {
connectionId := -1,
serverConnection := false, // true := server, false: client
autoReconnect := true,
localInterfacePresent := false,
localInterface := omit,
remoteInterfacePresent := false,
remoteInterface := omit,
sctpProtoAttributesPresent := false,
sctpProtoAttributes := omit
}
const ConnectionRuntimeAttributes c_emptyConnectionRuntimeAttribute := {
subscribedTestcases := {},
socket := -1,
endpointIndex := -1,
sctpState := SCTP_COMM_LOST,
userState := ""
}
//=========================================================================
// Templates
//=========================================================================
template IPDD_Message_with_ClientId t_IPDD_Message_with_ClientId := {
client_id := ?,
msg := ?
}
template IPDD_Message_with_ClientId t_queryConnections modifies t_IPDD_Message_with_ClientId := {
msg := {
ipdd_queryConnections := ?
}
}
template IPDD_Message_with_ClientId t_connect modifies t_IPDD_Message_with_ClientId := {
msg := {
ipdd_connect := ?
}
}
template IPDD_Message_with_ClientId t_listen modifies t_IPDD_Message_with_ClientId := {
msg := {
ipdd_listen := ?
}
}
template IPDD_Message_with_ClientId t_close modifies t_IPDD_Message_with_ClientId := {
msg := {
ipdd_close := ?
}
}
template IPDD_Message_with_ClientId t_ipData modifies t_IPDD_Message_with_ClientId := {
msg := {
ipdd_data := ?
}
}
template IPDD_Message_with_ClientId t_subscribeToConnection modifies t_IPDD_Message_with_ClientId := {
msg := {
ipdd_subscribeToConnection := ?
}
}
//SCTP Assoc Change
template ASP_Event tr_sctpEvent
( template integer pl_connectionID,
template SAC_STATE pl_state
) :=
{
sctpEvent :=
{
sctpAssocChange :=
{
clientId := pl_connectionID,
proto :=
{
sctp := ?
},
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 := *
}
}
//IP Connected
template ASP_Event tr_ASP_IP_Connected:=
{
connOpened :=
{
connId := ?,
remName := ?,
remPort := ?,
locName := ?,
locPort := ?,
proto := ?,
userData := ?
}
}
//IP Closed
template ASP_Event tr_ASP_IP_Closed :=
{
connClosed :=
{
connId := ?,
remName := ?,
remPort := ?,
locName := ?,
locPort := ?,
proto := ?,
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