Skip to content
Snippets Groups Projects
Commit 7323b142 authored by Elemer Lelik's avatar Elemer Lelik
Browse files

Initial contribution

parent 1041cb09
No related branches found
No related tags found
No related merge requests found
# titan.TestPorts.Common_Components.Socket-API
Main project page:
https://projects.eclipse.org/projects/tools.titan
The source code of the TTCN-3 compiler and executor:
https://github.com/eclipse/titan.core
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2015 Ericsson
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
File: Socket_API_CNL113686.tpd
Description: tpd project file
Rev: R5A
Prodnr: CNL 113 686
-->
<TITAN_Project_File_Information version="1.0">
<ProjectName>Socket_API_CNL113686</ProjectName>
<Files>
<FileResource projectRelativePath="Socket_API_Definitions.ttcn" relativeURI="src/Socket_API_Definitions.ttcn"/>
</Files>
<ActiveConfiguration>Default</ActiveConfiguration>
<Configurations>
<Configuration name="Default">
<ProjectProperties>
<MakefileSettings>
<generateInternalMakefile>true</generateInternalMakefile>
<GNUMake>true</GNUMake>
<targetExecutable>bin/Socket_API_CNL113686</targetExecutable>
<buildLevel>Level 3 - Creating object files with dependency update</buildLevel>
</MakefileSettings>
<LocalBuildSettings>
<workingDirectory>bin</workingDirectory>
</LocalBuildSettings>
<NamingCoventions>
<enableProjectSpecificSettings>true</enableProjectSpecificSettings>
<globalConstant>c[g]?_.*</globalConstant>
<formalParameter>.*</formalParameter>
</NamingCoventions>
</ProjectProperties>
</Configuration>
</Configurations>
</TITAN_Project_File_Information>
File added
File added
<!--
/******************************************************************************
* Copyright (c) 2010, 2015 Ericsson AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Gabor Tatarka
* Gabor Szalai
* Jozsef Gyurusi
* Laszlo Skumat
******************************************************************************/
//
// File: Socket_API.grp
// Description: Socket API group file
// Rev: R5A
// Prodnr: CNL 113 686
//
-->
<!DOCTYPE TITAN_GUI_FileGroup_file>
<FileGroup TITAN_version="1.8.pl2" >
<File_Group name="Socket_API" >
<File path="Socket_API_Definitions.ttcn" />
</File_Group>
</FileGroup>
/******************************************************************************
* Copyright (c) 2010, 2015 Ericsson AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Gabor Tatarka
* Gabor Szalai
* Jozsef Gyurusi
* Laszlo Skumat
******************************************************************************/
//
// File: Socket_API_Definitions.ttcn
// Rev: R5A
// Prodnr: CNL 113 686
module Socket_API_Definitions {
/* The connection ID is a test port component level unique identifier of the
connection.
It is returned by the listen and connect functions and in the connOpened
event. It identifies the connection in subsequent function calls and in
sent or received events.
The SCTP protocol supports one-to-many connections on one socket,
which requires also an association ID besides the connection ID.
*/
type integer ConnectionId;
type record of ConnectionId ro_ConnectionId;
type integer AssociationId;
type record of AssociationId ro_AssociationId;
/* IP address version 4 or 6 is accepted in the dotted format.
Examples:
IPv4: 192.168.0.1
IPv6: fe80::211:d8ff:fe51:4cca
Host name can also be used instead of IP address.
*/
type charstring HostName;
type integer PortNumber;
type record Socket {
HostName hostName,
PortNumber portNumber
}
type record of Socket SocketList;
/* ANY_ADDR and ANY_PORT constants */
const HostName c_ipv4AnyAddr := "0.0.0.0";
const HostName c_ipv6AnyAddr := "::";
const PortNumber c_anyPort := 0;
const HostName c_defaultLocAddr := "";
const PortNumber c_defaultLocPort := -1;
/* The protocol (TCP, UDP, UDPLight or SCTP) has to be specified in the first
connection creation operation: either in listen or connect.
In subsequent operations the protocol is determined by the connection ID,
therefore it should be omitted, but it is accepted for backward
compatibility. If protocol is specified, then it is checked.
*/
type record UdpTuple {}
type record UdpLightTuple {}
type record TcpTuple {}
type record SctpTuple {
/* Specifies the stream number of the message. */
integer sinfo_stream optional,
/* Specifies the information that is passed by the upper layer in
the peer application. */
integer sinfo_ppid optional,
/* Multiple remote addresses can be given in case of one-to-many
connections. */
SocketList remSocks optional,
/* Association ID to identify one specific connection in case of
one-to-many connections. */
AssociationId assocId optional
}
type record SslTuple {}
// DTLS works over UDP or SCTP (Datagram TLS)
// SCTP is not supported -> CR if needed
type union DtlsTuple {
UdpTuple udp,
SctpTuple sctp
}
type record UnspecifiedTuple {}
type union ProtoTuple {
UdpTuple udp,
UdpLightTuple udpLight,
TcpTuple tcp,
SctpTuple sctp,
SslTuple ssl,
DtlsTuple dtls,
UnspecifiedTuple unspecified
}
type integer UserData;
/* PortEvent is used to inform the upper layer about asynchronous events.
Notification is sent if connection opened during listenning or when
connection is closed.
PortEvent is also used for notification about results of operations,
that need to be handled by the upper layer.
This can be a notification about an error or
a notification that an operation (connect or send) on a connection should
be retried later or that a deferred operation is no possible.
The result event contains the connection ID besides the error code.
*/
type enumerated PortError {
ERROR_GENERAL,
ERROR_INSUFFICIENT_MEMORY,
ERROR_INVALID_INPUT_PARAMETER,
ERROR_UNSUPPORTED_PROTOCOL,
ERROR_SOCKET,
ERROR_HOSTNAME,
ERROR_INVALID_CONNECTION,
ERROR_TEMPORARILY_UNAVAILABLE,
ERROR_AVAILABLE
}
type record Result {
PortError errorCode optional,
ConnectionId connId optional,
integer os_error_code optional,
charstring os_error_text optional
}
type record Extended_Result {
PortError errorCode optional,
ConnectionId connId optional,
integer os_error_code optional,
charstring os_error_text optional,
octetstring msg optional
}
type record ConnectionOpenedEvent {
ConnectionId connId,
HostName remName,
PortNumber remPort,
HostName locName,
PortNumber locPort,
ProtoTuple proto,
UserData userData
}
type ConnectionOpenedEvent ConnectionClosedEvent;
type union SctpEvent {
SctpAssocChange sctpAssocChange,
SctpPeerAddrChange sctpPeerAddrChange,
SctpSendFailed sctpSendFailed,
SctpRemoteError sctpRemoteError,
SctpShutDownEvent sctpShutDownEvent,
SctpPartialDeliveryEvent sctpPartialDeliveryEvent,
SctpAdaptationIndication sctpAdaptationIndication
}
type union PortEvent {
ConnectionOpenedEvent connOpened,
ConnectionClosedEvent connClosed,
Result result,
Extended_Result extended_result,
SctpEvent sctpEvent
}
/* SCTP type events */
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 SctpAssocChange {
integer clientId,
ProtoTuple proto,
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 SctpPeerAddrChange {
integer clientId,
SPC_STATE spc_state
}
type record SctpSendFailed {
integer clientId
}
type record SctpRemoteError {
integer clientId
}
type record SctpShutDownEvent {
integer clientId
}
type record SctpPartialDeliveryEvent {
integer clientId
}
type record SctpAdaptationIndication {
integer clientId
}
/* SCTP type events end*/
type record of integer ro_integer;
/* Type definition for the user defined function to determine the message
length (boundary) in a TCP data stream.
*/
type function f_getMsgLen(
in octetstring stream,
inout ro_integer args // variadic list of user defined parameters
)
runs on self
return integer;
type record of charstring ro_charstring;
/*
Type definition to query parameters.
*/
// type integer PortParam; // (PortParamMin..PortParamMax);
// const integer PortParamMin := 0
// const integer LOCALADDRESS := 0;
// const integer REMOTEADDRESS := 1;
// const integer PROTO := 2;
// const integer USERDATA := 3;
// const integer PARENTIDX := 4;
// const integer PortParamMax := 4;
//
// type union PortParamResult {
// Socket local,
// Socket remote,
// ProtoTuple proto,
// integer userData,
// ConnectionId parentIdx
// }
} // module Socket_API_Definitions
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment