DEENESPTFRRUARHIKOZHNL

Socket Adaptor (SoAd)

ModulSoAd (Socket Adaptor)
BSW-Modul-ID56
Standard-Header#include "SoAd.h"
SWS-SpezifikationAUTOSAR_CP_SWS_SocketAdaptor.pdf, AUTOSAR_SWS_SocketAdaptor.pdf
Umfang295 Records · 40 Snippets
ClusterEthernet-Stack

Socket Adaptor (SoAd)

AUTOSAR Classic Communication Services-Modul Socket Adaptor (SoAd, Spezifikation: AUTOSAR_CP_SWS_SocketAdaptor.pdf, AUTOSAR_SWS_SocketAdaptor.pdf).

Funktionen — Übersicht

Typen — Übersicht

Anforderungen — Übersicht

Funktionen & Typen — Detailansicht

functie SoAd_GetAndResetMeasurementData [SWS_SoAd_00010] 📄 PDF

Std_ReturnType SoAd_GetAndResetMeasurementData(SoAd_MeasurementIdxType MeasurementIdx, boolean MeasurementResetNeeded, uint32* MeasurementDataPtr);

Allows to read and reset detailed measurement data for diagnostic purposes. Get all MeasurementIdx's at once is not supported. SOAD_MEAS_ALL shall only be used to reset all MeasurementIdx's at once. A NULL_PTR shall be provided for MeasurementDataPtr in this case.

functie SoAd_Init [SWS_SoAd_00093] 📄 PDF

void SoAd_Init(const SoAd_ConfigType* SoAdConfigPtr);

Initializes the Socket Adaptor.

functie SoAd_RxIndication [SWS_SoAd_00097] 📄 PDF

void SoAd_RxIndication(TcpIp_SocketIdType SocketId, const TcpIp_SockAddrType* RemoteAddrPtr, const uint8* BufPtr, uint16 Length);

The TCP/IP stack calls this primitive after the reception of data on a socket. The socket identifier along with configuration information determines which module is to be called.

functie SoAd_TxConfirmation [SWS_SoAd_00098] 📄 PDF

void SoAd_TxConfirmation(TcpIp_SocketIdType SocketId, uint16 Length);

The TCP/IP stack calls this function after the data has been acknowledged by the peer for TCP. Caveats: The upper layer might not be able to determine exactly which data bytes have been confirmed.

functie SoAd_TcpAccepted [SWS_SoAd_00099] 📄 PDF

Std_ReturnType SoAd_TcpAccepted(TcpIp_SocketIdType SocketId, TcpIp_SocketIdType SocketIdConnected, const TcpIp_SockAddrType* RemoteAddrPtr);

This service gets called if the stack put a socket into the listen mode before (as server) and a peer connected to it (as client). In detail: The TCP/IP stack calls this function after a socket was set into the listen state with TcpIp_TcpListen() and a TCP connection is requested by the peer.

functie SoAd_TcpConnected [SWS_SoAd_00100] 📄 PDF

void SoAd_TcpConnected(TcpIp_SocketIdType SocketId);

This service gets called if the stack initiated a TCP connection before (as client) and the peer (the server) acknowledged the connection set up. In detail: The TCP/IP stack calls this function after a socket was requested to connect with TcpIp_TcpConnect() and a TCP connection is confirmed by the peer. The parameter value of SocketId equals the SocketId value of the preceeding TcpIp_TcpConnect() call.

functie TxConfirmation [SWS_SoAd_00107] 📄 PDF

void <Up>_ [ SoAd ][ If ] TxConfirmation(PduIdType TxPduId, Std_ReturnType result);

The lower layer communication interface module confirms the transmission of a PDU, or the failure to transmit a PDU.

functie SoAd_MainFunction [SWS_SoAd_00121] 📄 PDF

void SoAd_MainFunction(void);

Schedules the Socket Adaptor. (Entry point for scheduling)

functie CopyTxData [SWS_SoAd_00137] 📄 PDF

BufReq_ReturnType <Up>_ [ SoAd ][ Tp ] CopyTxData(PduIdType id, const PduInfoType* info, const RetryInfoType* retry, PduLengthType* availableDataPtr);

This function is called to acquire the transmit data of an I-PDU segment (N-PDU). Each call to this function provides the next part of the I-PDU data unless retry->TpDataState is TP_ DATARETRY. In this case the function restarts to copy the data beginning at the offset from the current position indicated by retry->TxTpDataCnt. The size of the remaining data is written to the position indicated by availableDataPtr.

functie StartOfReception [SWS_SoAd_00138] 📄 PDF

BufReq_ReturnType <Up>_ [ SoAd ][ Tp ] StartOfReception(PduIdType id, const PduInfoType* info, PduLengthType TpSduLength, PduLengthType* bufferSizePtr);

This function is called at the start of receiving an N-SDU. The N-SDU might be fragmented into multiple N-PDUs (FF with one or more following CFs) or might consist of a single N-PDU (SF). The service shall provide the currently available maximum buffer size when invoked with TpSdu Length equal to 0.

functie CopyRxData [SWS_SoAd_00139] 📄 PDF

BufReq_ReturnType <Up>_ [ SoAd ][ Tp ] CopyRxData(PduIdType id, const PduInfoType* info, PduLengthType* bufferSizePtr);

This function is called to provide the received data of an I-PDU segment (N-PDU) to the upper layer. Each call to this function provides the next part of the I-PDU data. The size of the remaining buffer is written to the position indicated by bufferSizePtr.

functie SoAd_TcpIpEvent [SWS_SoAd_00146] 📄 PDF

void SoAd_TcpIpEvent(TcpIp_SocketIdType SocketId, TcpIp_EventType Event);

of the event just encountered. Parameters (inout) None Parameters (out) None Return value None Description This service gets called if the stack encounters a condition described by the values in Event.

functie TpRxIndication [SWS_SoAd_00180] 📄 PDF

void <Up>_ [ SoAd ][ Tp ] TpRxIndication(PduIdType id, Std_ReturnType result);

Called after an I-PDU has been received via the TP API, the result indicates whether the transmission was successful or not.

functie TpTxConfirmation [SWS_SoAd_00181] 📄 PDF

void <Up>_ [ SoAd ][ Tp ] TpTxConfirmation(PduIdType id, Std_ReturnType result);

This function is called after the I-PDU has been transmitted on its network, the result indicates whether the transmission was successful or not.

functie SoAd_GetPhysAddr [SWS_SoAd_00507] 📄 PDF

Std_ReturnType SoAd_GetPhysAddr(SoAd_SoConIdType SoConId, uint8* PhysAddrPtr);

Retrieves the physical source address of the EthIf controller used by the SoAd socket connection specified by SoConId.

functie <Up>_LocalIpAddrAssignmentChg [SWS_SoAd_00513] 📄 PDF

void <Up>_LocalIpAddrAssignmentChg(SoAd_SoConIdType SoConId, TcpIp_IpAddrStateType State);

This function gets called by the SoAd if an IP address assignment related to a socket connection changes (i.e. new address assigned or assigned address becomes invalid).

functie <Up>_SoConModeChg [SWS_SoAd_00514] 📄 PDF

void <Up>_SoConModeChg(SoAd_SoConIdType SoConId, SoAd_SoConModeType Mode);

Notification about a SoAd socket connection state change, e.g. socket connection gets online

functie SoAd_EnableRouting [SWS_SoAd_00516] 📄 PDF

Std_ReturnType SoAd_EnableRouting(SoAd_RoutingGroupIdType id);

Enables routing of a group of PDUs in the SoAd related to the RoutingGroup specified by parameter id. Routing of PDUs can be either forwarding of PDUs from the upper layer to a TCP or UDP socket of the TCP/IP stack specified by a PduRoute or the other way around specified by a SocketRoute.

functie SoAd_DisableRouting [SWS_SoAd_00517] 📄 PDF

Std_ReturnType SoAd_DisableRouting(SoAd_RoutingGroupIdType id);

Disables routing of a group of PDUs in the SoAd related to the RoutingGroup specified by parameter id. Routing of PDUs can be either forwarding of PDUs from the upper layer to a TCP or UDP socket of the TCP/IP stack specified by a PduRoute or the other way around specified by a SocketRoute.

functie SoAd_RequestIpAddrAssignment [SWS_SoAd_00520] 📄 PDF

Std_ReturnType SoAd_RequestIpAddrAssignment(SoAd_SoConIdType SoConId, TcpIp_IpAddrAssignmentTypeType, const TcpIp_SockAddrType* LocalIpAddrPtr, uint8 Netmask, const TcpIp_SockAddrType* DefaultRouterPtr);

By this API service the local IP address assignment which shall be used for the socket connection specified by SoConId is initiated.

functie SoAd_CopyTxData [SWS_SoAd_00523] 📄 PDF

BufReq_ReturnType SoAd_CopyTxData(TcpIp_SocketIdType SocketId, uint8* BufPtr, uint16 BufLength);

This service requests to copy data for transmission to the buffer indicated. This call is triggered by TcpIp_Transmit(). Note: The call to <Up>_CopyTxData() may happen in the context of Tcp Ip_Transmit().

functie SoAd_ReleaseIpAddrAssignment [SWS_SoAd_00536] 📄 PDF

Std_ReturnType SoAd_ReleaseIpAddrAssignment(SoAd_SoConIdType SoConId);

By this API service the local IP address assignment used for the socket connection specified by SoConId is released.

functie SoAd_IfRoutingGroupTransmit [SWS_SoAd_00656] 📄 PDF

Std_ReturnType SoAd_IfRoutingGroupTransmit(SoAd_RoutingGroupIdType id);

Triggers the transmission of all If-TxPDUs identified by the parameter id after requesting the data from the related upper layer.

functie TriggerTransmit [SWS_SoAd_00663] 📄 PDF

Std_ReturnType <Up>_ [ SoAd ][ If ] TriggerTransmit(PduIdType TxPduId, PduInfoType* PduInfoPtr);

Within this API, the upper layer module (called module) shall check whether the available data fits into the buffer size reported by PduInfoPtr->SduLength. If it fits, it shall copy its data into the buffer provided by PduInfoPtr->SduDataPtr and update the length of the actual copied data in PduInfoPtr->SduLength. If not, it returns E_NOT_OK without changing PduInfoPtr.

functie SoAd_SetUniqueRemoteAddr [SWS_SoAd_00671] 📄 PDF

Std_ReturnType SoAd_SetUniqueRemoteAddr(SoAd_SoConIdType SoConId, const TcpIp_SockAddrType* RemoteAddrPtr, SoAd_SoConIdType* AssignedSoConIdPtr);

This API service shall either return the socket connection index of the SoAdSocketConnection Group where the specified remote address (IP address and port) is set or assign the remote address to an unused socket connection from the same SoAdSocketConnectionGroup.

functie SoAd_WriteDhcpHostNameOption [SWS_SoAd_00679] 📄 PDF

Std_ReturnType SoAd_WriteDhcpHostNameOption(SoAd_SoConIdType SoConId, uint8 length, const uint8* data);

By this API service an upper layer of the SoAd can set the hostname, i.e. FQDN option in the DHCP submodule of the TCP/IP stack.

functie SoAd_ReadDhcpHostNameOption [SWS_SoAd_00681] 📄 PDF

Std_ReturnType SoAd_ReadDhcpHostNameOption(SoAd_SoConIdType SoConId, uint8* length, uint8* data);

By this API service an upper layer of the SoAd can read the currently configured hostname, i.e. FQDN option in the DHCP submodule of the TCP/IP stack.

functie SoAd_IfSpecificRoutingGroupTransmit [SWS_SoAd_00711] 📄 PDF

Std_ReturnType SoAd_IfSpecificRoutingGroupTransmit(SoAd_RoutingGroupIdType id, SoAd_SoConIdType SoConId);

Triggers the transmission of all If-TxPDUs identified by the parameter id on the socket connection specified by SoConId after requesting the data from the related upper layer.

functie SoAd_EnableSpecificRouting [SWS_SoAd_00714] 📄 PDF

Std_ReturnType SoAd_EnableSpecificRouting(SoAd_RoutingGroupIdType id, SoAd_SoConIdType SoConId);

Enables routing of a group of PDUs in the SoAd related to the RoutingGroup specified by parameter id only on the socket connection identified by SoConId.

functie SoAd_DisableSpecificRouting [SWS_SoAd_00717] 📄 PDF

Std_ReturnType SoAd_DisableSpecificRouting(SoAd_RoutingGroupIdType id, SoAd_SoConIdType SoConId);

Disables routing of a group of PDUs in the SoAd related to the RoutingGroup specified by parameter id only on the socket connection identified by SoConId.

functie SoAd_ReleaseRemoteAddr [SWS_SoAd_00733] 📄 PDF

void SoAd_ReleaseRemoteAddr(SoAd_SoConIdType SoConId);

By this API service the remote address (IP address and port) of the specified socket connection shall be released, i.e. set back to the configured remote address setting.

functie SoAd_GetSoConMode [SWS_SoAd_91001] 📄 PDF

void SoAd_GetSoConMode(SoAd_SoConIdType SoConId, SoAd_SoConModeType* ModePtr);

Returns current state of the socket connection specified by SoConId.

functie SoAd_IsConnectionReady [SWS_SoAd_91011] 📄 PDF

TcpIp_ReturnType SoAd_IsConnectionReady(SoAd_SoConIdType SoConId, const TcpIp_SockAddrType* RemoteAddrPtr);

API allows to check if a communication over this socket connection is possible for a dedicated remote address. It includes that the socket connection is bound to a socket, a physical address is available for the requested remote address and if a security association is configured that a secured connection is already established.

type SoAd_SoConIdType [SWS_SoAd_00518] 📄 PDF

SoCon identifier type for unique identification of a SoAd socket connection. The size of this type depends on the maximum number of socket connections which is specified by configuration parameter SoAdSoConMax.

type SoAd_RoutingGroupIdType [SWS_SoAd_00519] 📄 PDF

RoutingGroup identifier type for unique identification of a SoAd routing group. The size of this type depends on the maximum number of routing groups which is specified by configuration parameter SoAdRoutingGroupMax.

requirement SWS_SoAd_00001 [SWS_SoAd_00001] 📄 PDF

All configuration items shall be located outside the kernel of the module.

requirement SWS_SoAd_00101 [SWS_SoAd_00101] 📄 PDF

Type of error Related error code Error value API service called before initializing the module SOAD_E_UNINIT 0x01 API service called with NULL pointer SOAD_E_PARAM_POINTER 0x02 Invalid argument SOAD_E_INV_ARG 0x03 Invalid PDU ID SOAD_E_INV_PDUID 0x06 Invalid socket address SOAD_E_INV_SOCKETID 0x07 Invalid configuration set selection SOAD_E_INIT_FAILED 0x08 Type of error Related error code Error value Invalid meta data SOAD_E_INV_METADATA 0x09

requirement SWS_SoAd_00131 [SWS_SoAd_00131] 📄 PDF

The main function for scheduling the SoAd (Entry point for scheduling) shall be called by the Schedule Manager according to the configured call period.

requirement SWS_SoAd_00176 [SWS_SoAd_00176] 📄 PDF

The call period of the SoAd_MainFunction () shall be deter- mined by configuration parameter SoAdMainFunctionPeriod .

requirement SWS_SoAd_00197 [SWS_SoAd_00197] 📄 PDF

In case PDU header option is enabled ( SoAdPduHeaderEn- able is TRUE ) for a socket connection and PDU transmission, SoAd shall insert the PDU Header with the configured HeaderId and the actual PDU length directly before the PDU data, i.e. TcpIp_UdpTransmit () or TcpIp_TcpTransmit () shall be called with a TotalLength or AvailableLength increased by the PDU Header length, the PDU Header shall be copied before the PDU data to a SoAd UDP transmit buffer (if any) and a memory specified by TcpIp within SoAd_CopyTxData () requesting the be- gin of the PDU data.

requirement SWS_SoAd_00198 [SWS_SoAd_00198] 📄 PDF

The SoAd PDU header shall consist of a 4 byte ID field for unique identification of the PDU at the receiver and a 4 byte length field specifying the data length of the PDU. Both in BigEndian byte order.

requirement SWS_SoAd_00208 [SWS_SoAd_00208] 📄 PDF

All timing parameters given as EcucFloatParamDef in unit sec- onds in the configuration, shall be converted to integer multiples of the parameter SoAdMainFunctionPeriod .

requirement SWS_SoAd_00211 [SWS_SoAd_00211] 📄 PDF

SoAd_Init () shall store the access to the configuration struc- ture for subsequent API calls.

requirement SWS_SoAd_00213 [SWS_SoAd_00213] 📄 PDF

If development error detection is enabled: SoAd_IfTrans- mit () shall check that the service SoAd_Init () was previously called. If the check fails, SoAd_IfTransmit () shall raise the development error SOAD_E_UNINIT .

requirement SWS_SoAd_00214 [SWS_SoAd_00214] 📄 PDF

If development error detection is enabled: SoAd_IfTrans- mit () shall check parameter TxPduId for being valid. If the check fails, SoAd_If- Transmit () shall raise the development error SOAD_E_INV_PDUID .

requirement SWS_SoAd_00216 [SWS_SoAd_00216] 📄 PDF

If development error detection is enabled: SoAd_Init () shall check the parameter SoAdConfigPtr for containing a valid configuration. If the check fails, SoAd_Init () shall raise the development error SOAD_E_INIT_FAILED .

requirement SWS_SoAd_00224 [SWS_SoAd_00224] 📄 PDF

If development error detection is enabled: SoAd_TpTrans- mit () shall check that the service SoAd_Init () was previously called. If the check fails, SoAd_TpTransmit () shall raise the development error SOAD_E_UNINIT .

requirement SWS_SoAd_00237 [SWS_SoAd_00237] 📄 PDF

If development error detection is enabled: SoAd_TpTrans- mit () shall check parameter TxPduId for being valid. If the check fails, SoAd_Tp- Transmit () shall raise the development error SOAD_E_INV_PDUID .

requirement SWS_SoAd_00264 [SWS_SoAd_00264] 📄 PDF

If development error detection is enabled: SoAd_RxIndica- tion () shall check that the service SoAd_Init () was previously called. If the check fails, SoAd_RxIndication () shall raise the development error SOAD_E_UNINIT .

requirement SWS_SoAd_00267 [SWS_SoAd_00267] 📄 PDF

If development error detection is enabled: SoAd_RxIndica- tion () shall check parameter SocketId for being valid. If the check fails, SoAd_- RxIndication () shall raise the development error SOAD_E_INV_SOCKETID .

requirement SWS_SoAd_00268 [SWS_SoAd_00268] 📄 PDF

If development error detection is enabled: SoAd_RxIndica- tion () shall check parameter RemoteAddrPtr for being valid. If the check fails, SoAd_RxIndication () shall raise the development error SOAD_E_INV_ARG .

requirement SWS_SoAd_00269 [SWS_SoAd_00269] 📄 PDF

If development error detection is enabled: SoAd_TxConfir- mation () shall check that the service SoAd_Init () was previously called. If the check fails, SoAd_TxConfirmation () shall raise the development error SOAD_E_UNINIT .

requirement SWS_SoAd_00270 [SWS_SoAd_00270] 📄 PDF

If development error detection is enabled: SoAd_TxConfir- mation () shall check parameter SocketId for being valid. If the check fails, SoAd_- TxConfirmation () shall raise the development error SOAD_E_INV_SOCKETID .

requirement SWS_SoAd_00271 [SWS_SoAd_00271] 📄 PDF

If development error detection is enabled: SoAd_TxConfir- mation () shall check parameter Length for being valid. If the check fails, SoAd_Tx- Confirmation () shall raise the development error SOAD_E_INV_ARG .

requirement SWS_SoAd_00272 [SWS_SoAd_00272] 📄 PDF

If development error detection is enabled: SoAd_TcpAc- cepted () shall check that the service SoAd_Init () was previously called. If the check fails, SoAd_TcpAccepted () shall raise the development error SOAD_E_UNINIT .

requirement SWS_SoAd_00273 [SWS_SoAd_00273] 📄 PDF

If development error detection is enabled: SoAd_TcpAc- cepted () shall check parameter SocketId for being valid. If the check fails, SoAd_- TcpAccepted () shall raise the development error SOAD_E_INV_SOCKETID .

requirement SWS_SoAd_00274 [SWS_SoAd_00274] 📄 PDF

If development error detection is enabled: SoAd_TcpCon- nected () shall check that the service SoAd_Init () was previously called. If the check fails, SoAd_TcpConnected () shall raise the development error SOAD_E_UNINIT .

requirement SWS_SoAd_00275 [SWS_SoAd_00275] 📄 PDF

If development error detection is enabled: SoAd_TcpCon- nected () shall check parameter SocketId for being valid. If the check fails, SoAd_- TcpConnected () shall raise the development error SOAD_E_INV_SOCKETID .

requirement SWS_SoAd_00276 [SWS_SoAd_00276] 📄 PDF

If development error detection is enabled: SoAd_- TcpIpEvent () shall check that the service SoAd_Init () was previously called. If the check fails, SoAd_TcpIpEvent () shall raise the development error SOAD_E_UNINIT .

requirement SWS_SoAd_00277 [SWS_SoAd_00277] 📄 PDF

If development error detection is enabled: SoAd_- TcpIpEvent () shall check parameter SocketId for being valid. If the check fails, SoAd_TcpIpEvent () shall raise the development error SOAD_E_INV_SOCKETID .

requirement SWS_SoAd_00278 [SWS_SoAd_00278] 📄 PDF

If development error detection is enabled: SoAd_- TcpIpEvent () shall check parameter Event for being valid. If the check fails, SoAd_- TcpIpEvent () shall raise the development error SOAD_E_INV_ARG .

requirement SWS_SoAd_00279 [SWS_SoAd_00279] 📄 PDF

If development error detection is enabled: SoAd_LocalIpAd- drAssignmentChg () shall check that the service SoAd_Init () was previously called. If the check fails, SoAd_LocalIpAddrAssignmentChg () shall raise the development error SOAD_E_UNINIT .

requirement SWS_SoAd_00503 [SWS_SoAd_00503] 📄 PDF

Module Header File Imported Type ComStack_Types.h BufReq_ReturnType ComStack_Types.h PduIdType ComStack_Types.h PduInfoType ComStack_Types.h PduLengthType ComStack_Types.h RetryInfoType ComStack_Types.h TPParameterType ComStack_Types ComStack_Types.h TpDataStateType IdsM IdsM_Types.h IdsM_SecurityEventIdType Std_Types.h Std_ReturnType Std Std_Types.h Std_VersionInfoType TcpIp.h TcpIp_DomainType TcpIp.h TcpIp_EventType TcpIp.h TcpIp_IpAddrAssignmentType TcpIp.h TcpIp_IpAddrStateType TcpIp.h TcpIp_LocalAddrIdType TcpIp.h TcpIp_ParamIdType TcpIp.h TcpIp_ProtocolType TcpIp.h TcpIp_ReturnType TcpIp.h TcpIp_SockAddrType TcpIp.h TcpIp_SocketIdType TcpIp TcpIp.h TcpIp_StateType

requirement SWS_SoAd_00504 [SWS_SoAd_00504] 📄 PDF

Det_ReportRuntimeError Det.h Service to report runtime errors. If a callout has been configured then this callout shall be called. TcpIp_<Up>GetSocket TcpIp.h By this API service the TCP/IP stack is requested to allocate a new socket. Note: Each accepted incoming TCP connection also allocates a socket resource. TcpIp_Bind TcpIp.h By this API service the TCP/IP stack is requested to bind a UDP or TCP socket to a local resource. TcpIp_ChangeParameter TcpIp.h By this API service the TCP/IP stack is requested to change a parameter of a socket. E.g. the Nagle algorithm may be controlled by this API. TcpIp_Close TcpIp.h By this API service the TCP/IP stack is requested to close the socket and release all related resources. TcpIp_GetCtrlIdx TcpIp.h TcpIp_GetCtrlIdx returns the index of the controller related to LocalAddrId. TcpIp_GetIpAddr TcpIp.h Obtains the local IP address actually used by Local AddrId, the netmask and default router API Function Header File Description TcpIp_GetPhysAddr TcpIp.h Obtains the physical source address used by the EthIf controller implicitly specified via LocalAddrId. TcpIp_GetRemotePhysAddr TcpIp.h TcpIp_GetRemotePhysAddr queries the IP/physical address translation table specified by CtrlIdx and returns the physical address related to the IP address specified by IpAddrPtr. In case no physical address can be retrieved and parameter initRes is TRUE, address resolution for the specified IP address is initiated on the local network. TcpIp_ReleaseIpAddrAssignment TcpIp.h By this API service the local IP address assignment for the IP address specified by LocalAddrId shall be released. TcpIp_RequestComMode TcpIp.h By this API service the TCP/IP stack is requested to change the TcpIp state of the communication network identified by EthIf controller index. TcpIp_RequestIpAddrAssignment TcpIp.h By this API service the local IP address assignment for the IP address specified by LocalAddrId shall be initiated. TcpIp_TcpConnect TcpIp.h By this API service the TCP/IP stack is requested to establish a TCP connection to the configured peer. TcpIp_TcpListen TcpIp.h By this API service the TCP/IP stack is requested to listen on the TCP socket specified by the socket identifier. TcpIp_TcpReceived TcpIp.h By this API service the reception of socket data is confirmed to the TCP/IP stack. TcpIp_TcpTransmit TcpIp.h This service requests transmission of data via TCP to a remote node. The transmission of the data is decoupled. Note: The TCP segment(s) are sent dependent on runtime factors (e.g. receive window) and configuration parameter (e.g. Nagle algorithm) . TcpIp_UdpTransmit TcpIp.h This service transmits data via UDP to a remote node. The transmission of the data is immediately performed with this function call by forwarding it to EthIf.

requirement SWS_SoAd_00505 [SWS_SoAd_00505] 📄 PDF

The SoAd shall provide sufficient buffers to store received data which can't be forwarded to the upper layer within the context of SoAd_RxIndica- tion () as well as buffers for data which can (or should) not be forwarded to TcpIp.

requirement SWS_SoAd_00524 [SWS_SoAd_00524] 📄 PDF

If SoAdSocketMsgAcceptanceFilterEnabled is TRUE , SoAd shall only accept TCP connections or UDP datagrams from remote nodes with a source address that matches the remote address specified in the socket connec- tion (either via configuration parameters SoAdSocketRemoteIpAddress and SoAd- SocketRemotePort or set online with SoAd_SetRemoteAddr () API).

requirement SWS_SoAd_00525 [SWS_SoAd_00525] 📄 PDF

A remote address matches if both IP address and port match. The IP addresses match if they are identical or if the specified IP address is set to TCPIP_IPADDR_ANY ( TCPIP_IP6ADDR_ANY ). The port matches if they are identical or if the specified port is set to TCPIP_PORT_ANY .

requirement SWS_SoAd_00527 [SWS_SoAd_00527] 📄 PDF

SoAd shall reset the remote address to the configured remote address (or unset the remote address in case no remote address has been configured) within SoAd_MainFunction () when a socket connection is closed.

requirement SWS_SoAd_00528 [SWS_SoAd_00528] 📄 PDF

If development error detection is enabled: In case SoAd_OpenSoCon () is called for a socket connection with configuration param- eter SoAdSocketAutomaticSoConSetup set to " TRUE " the development error SOAD_E_INV_ARG shall be raised.

requirement SWS_SoAd_00529 [SWS_SoAd_00529] 📄 PDF

If development error detection is enabled: In case SoAd_Clos- eSoCon () is called for a socket connection with configuration parameter SoAdSock- etAutomaticSoConSetup set to " TRUE " the development error SOAD_E_INV_ARG shall be raised.

requirement SWS_SoAd_00531 [SWS_SoAd_00531] 📄 PDF

If development error detection is enabled and SoConId refers to a socket connection with configuration parameter SoAdSocketAutomaticSoCon- Setup set to TRUE , the function SoAd_SetRemoteAddr () shall raise the development error SOAD_E_INV_ARG .

requirement SWS_SoAd_00532 [SWS_SoAd_00532] 📄 PDF

The function SoAd_SetRemoteAddr () shall only proceed if SoConId refers to a socket connection which is not currently locked by the SoAd. If it is locked, the request shall be rejected and E_NOT_OK shall be returned.

requirement SWS_SoAd_00533 [SWS_SoAd_00533] 📄 PDF

The function SoAd_SetRemoteAddr () shall set the remote ad- dress of the socket connection referred by parameter SoConId according to the IP address and port specified by parameter RemoteAddrPtr.

requirement SWS_SoAd_00538 [SWS_SoAd_00538] 📄 PDF

For each configurable interface SoAd shall determine the func- tion name by replacing the tag <Up> with the module name abbreviation of the related upper layer module (as specified in the SoAdBSWModules container using the SoAd- BswModuleRef reference parameter) and using the two infix according to the configu- ration parameters SoAdUseCallerInfix and SoAdUseTypeInfix.

requirement SWS_SoAd_00539 [SWS_SoAd_00539] 📄 PDF

For the transmission of a PDU requested by an upper layer using the IF-API, the SoAd shall 1. Identify the related socket connection and PDU route by using the TxPduId pro- vided at SoAd_IfTransmit (). 2. Call the related TcpIp transmit function depending on the connection type if the PDU length > 0 or SoAdPduHeaderEnable is TRUE , otherwise SoAd shall Skip further processing and return with E_NOT_OK .

requirement SWS_SoAd_00540 [SWS_SoAd_00540] 📄 PDF

In case of a UDP socket connection the SoAd shall (if not speci- fied otherwise) call TcpIp_UdpTransmit () with SocketId and remote address spec- ified in the SocketConnection and the PDU length specified in the SoAd_IfTrans- mit () call as TotalLength .

requirement SWS_SoAd_00542 [SWS_SoAd_00542] 📄 PDF

In case of a TCP socket connection the SoAd shall call TcpIp_TcpTransmit () with SocketId specified in the SocketConnection, the PDU length specified in the SoAd_IfTransmit () call, as AvailableLength and ForceRetrieve set to TRUE .

requirement SWS_SoAd_00543 [SWS_SoAd_00543] 📄 PDF

The TcpIp module will retrieve the PDU data within the context of the TcpIp transmit call by using SoAd_CopyTxData () where the SoAd shall copy (the requested part of) the PDU to the memory specified by parameter BufPtr .

requirement SWS_SoAd_00544 [SWS_SoAd_00544] 📄 PDF

In case of a UDP socket connection the SoAd shall call the upper layer with the configured transmit confirmation function ( <Up>[SoAd][If]Tx- Confirmation ()) with result set to E_OK within the next SoAd_MainFunction () after the latest TcpIp_UdpTransmit () call returning successfully.

requirement SWS_SoAd_00545 [SWS_SoAd_00545] 📄 PDF

In case of a TCP socket connection the SoAd shall call the upper layer with the configured transmit confirmation function ( <Up>[SoAd][If]Tx- Confirmation ()) with result set to E_OK within the SoAd_TxConfirmation () call- back function after all PDU data (from one or multiple transmit requests) have been confirmed for transmission.

requirement SWS_SoAd_00546 [SWS_SoAd_00546] 📄 PDF

In case SoAdTxUdpTriggerMode is set to TRIGGER_NEVER for any PDU route ( SoAdPduRouteDest ) related to a socket connection and all upper layers belonging to the related socket connection have SoAdTxUpperLayerType set to "IF", SoAd shall use the nPdu feature for this socket connection.

requirement SWS_SoAd_00547 [SWS_SoAd_00547] 📄 PDF

In case the nPdu feature is used for a socket connection and SoAdTxUdpTriggerMode is set to TRIGGER_NEVER for the actual PDU ( SoAdP- duRouteDest ), SoAd shall store the PDU for the socket connection (instead of calling TcpIp_UdpTransmit ()).

requirement SWS_SoAd_00548 [SWS_SoAd_00548] 📄 PDF

In case the nPdu feature is used for a socket connection and SoAdTxUdpTriggerMode is set to TRIGGER_ALWAYS for the current PDU ( SoAdP- duRouteDest ) and the resulting PDU data and headers don't exceed SoAdSocket- nPduUdpTxBufferMin , SoAd shall transmit all PDUs stored for the socket connection (if any) and the current PDU by calling TcpIp_UdpTransmit ().

requirement SWS_SoAd_00549 [SWS_SoAd_00549] 📄 PDF

In case the nPdu feature is used for a socket connection and SoAdTxUdpTriggerMode is set to TRIGGER_NEVER for the current PDU ( SoAdP- duRouteDest ) and the resulting PDU data and headers would exceed SoAdSocket- nPduUdpTxBufferMin , SoAd shall first transmit all PDUs stored for the socket con- nection by calling TcpIp_UdpTransmit () and then store the PDU for the socket con- nection.

requirement SWS_SoAd_00550 [SWS_SoAd_00550] 📄 PDF

Within SoAd_MainFunction () SoAd shall transmit all PDUs stored for a socket connection (if any) by calling TcpIp_UdpTransmit () if the nPdu specific timer expired.

requirement SWS_SoAd_00551 [SWS_SoAd_00551] 📄 PDF

For the transmission of a PDU requested by an upper layer using the TP-API, the SoAd shall 1. Skip further processing and return with E_NOT_OK if the PDU length is 0. 2. Identify the related socket connection and PDU route by using the TxPduId pro- vided at SoAd_TpTransmit (). 3. Store the TP transmission request for further processing in the SoAd_Main- Function ().

requirement SWS_SoAd_00552 [SWS_SoAd_00552] 📄 PDF

In the SoAd_MainFunction () the SoAd shall check for pend- ing TP transmission requests and process a pending request as specified below: 1. Query the available amount of data at the upper layer by calling the configurable callback function <Up>_[SoAd][Tp]CopyTxData () with PduInfoType.Sdu- Length = 0. 2. Depending on the connection type: retrieve data and call the related TcpIp trans- mit function.

requirement SWS_SoAd_00553 [SWS_SoAd_00553] 📄 PDF

In case of a UDP socket connection the SoAd shall 1. retrieve all available data from the upper layer to a SoAd TP transmit buffer via the configurable callback function <Up>_[SoAd][Tp]CopyTxData () with PduIn- foType.SduLength set to the value returned by availableDataPtr of the previ- ous call and 2. call TcpIp_UdpTransmit () with SocketId and remote address specified in the SocketConnection and the PDU length specified in the SoAd_TpTransmit () call as TotalLength after all data have been successfully retrieved within one or multiple SoAd main function execution cycles.

requirement SWS_SoAd_00554 [SWS_SoAd_00554] 📄 PDF

In case of a TCP socket connection the SoAd shall call TcpIp_TcpTransmit () with SocketId specified in the SocketConnection, the PDU length set to the value returned by availableDataPtr of the previous call to <Up>_- [SoAd][Tp]CopyTxData () as AvailableLength and ForceRetrieve set to FALSE .

requirement SWS_SoAd_00555 [SWS_SoAd_00555] 📄 PDF

In case of a UDP socket connection the SoAd shall copy (the requested part of) the PDU from the SoAd TP transmit buffer to the memory specified by parameter BufPtr within SoAd_CopyTxData ().

requirement SWS_SoAd_00556 [SWS_SoAd_00556] 📄 PDF

In case of a TCP socket connection the SoAd shall forward the request to the related upper layer by calling <Up>_[SoAd][Tp]CopyTxData () to copy (the requested part of) the PDU to the memory specified by parameter BufPtr within SoAd_CopyTxData ().

requirement SWS_SoAd_00557 [SWS_SoAd_00557] 📄 PDF

In case of a UDP socket connection the SoAd shall call the upper layer with the configured transmit confirmation function <Up>_[SoAd][Tp] TxConfirmation () and E_OK as result within the SoAd_MainFunction () after TcpIp_UdpTransmit () returns with TCPIP_OK .

requirement SWS_SoAd_00558 [SWS_SoAd_00558] 📄 PDF

In case of a TCP socket connection configured with SoAdSock- etTcpImmediateTpTxConfirmation set to FALSE the SoAd shall call the upper layer with the configured transmit confirmation function <Up>_[SoAd][Tp]TxCon- firmation () and E_OK as result within the SoAd_TxConfirmation () callback func- tion after all TP PDU data have been confirmed for transmission.

requirement SWS_SoAd_00559 [SWS_SoAd_00559] 📄 PDF

In case PDU header option is enabled ( SoAdPduHeaderEn- able is TRUE ) for a socket connection, SoAd shall convert the message into a PDU within SoAd_RxIndication () according to the following: 1. assemble the PDU Header into a SoAd receive buffer if it is fragmented in multiple TCP segments 2. extract the PDU Header from the received message 3. select the related socket route according to the received PDU Header ID ( SoAd- RxPduHeaderId ); if no socket route can be found, simply discard the PDU and raise the runtime error SOAD_E_INV_PDUHEADER_ID . 4. use the length field of the PDU Header to identify the length of the actual PDU and the start of the next PDU to proceed with (2) until the end of the message is reached. If the remainder is smaller than a PDU Header or the indicated length within the header SoAd shall stop processing and ignore the rest of the message.

requirement SWS_SoAd_00560 [SWS_SoAd_00560] 📄 PDF

If SoAd_IfTransmit () is called with TxPduId specifying a SoAdPduRouteDest which belongs only to inactive RoutingGroups, SoAd shall al- ways skip the transmission for this SoAdPduRouteDest and shall consider the trans- mission as successful unless all SoAdPduRouteDest of a SoAdPduRoute belong only to inactive RoutingGroups. In the latter case SoAd shall return E_NOT_OK .

requirement SWS_SoAd_00561 [SWS_SoAd_00561] 📄 PDF

If SoAd_TpTransmit () is called with TxPduId specifying a SoAdPduRouteDest which belongs only to inactive RoutingGroups, SoAd shall al- ways skip the transmission for this SoAdPduRouteDest and shall consider the trans- mission as successful unless all SoAdPduRouteDest of a SoAdPduRoute belong only to inactive RoutingGroups. In the latter case SoAd shall return E_NOT_OK .

requirement SWS_SoAd_00562 [SWS_SoAd_00562] 📄 PDF

For the reception of a message from an UDP or TCP socket and forwarding of the received data as PDU to the related upper layer the SoAd shall 1. Identify the related socket connection and socket routes by using the SocketId provided at SoAd_RxIndication () 2. Filter messages according to the message acceptance policy 3. Convert the message into a PDU 4. Skip further processing if PDU length is 0 and ( SoAdPduHeaderEnable is FALSE or SoAdRxUpperLayerType is TP) 5. Call the upper layer type related reception functions of the configured upper layer module depending on the SoAdRxUpperLayerType specified in SoAdSock- etRouteDest configuration

requirement SWS_SoAd_00563 [SWS_SoAd_00563] 📄 PDF

In case PDU header option is disabled ( SoAdPduHeaderEn- able is FALSE ) for a socket connection, SoAd shall convert the received UDP or TCP message 1:1 into a PDU within SoAd_RxIndication (), i.e. each TCP segment and UDP message forms a separate PDU.

requirement SWS_SoAd_00564 [SWS_SoAd_00564] 📄 PDF

In case of a TCP socket connection the SoAd shall confirm the reception of all data either forwarded to the upper layer or finally handled by SoAd (e.g. discarded data or processed PDU Header) by calling TcpIp_TcpReceived () within SoAd_RxIndication () or SoAd_MainFunction () respectively.

requirement SWS_SoAd_00565 [SWS_SoAd_00565] 📄 PDF

SoAd shall process TP- and IF-PDUs independently and within each type according to the received order per socket connection.

requirement SWS_SoAd_00566 [SWS_SoAd_00566] 📄 PDF

SoAd shall preserve the order of received data when using a SoAd receive buffer.

requirement SWS_SoAd_00567 [SWS_SoAd_00567] 📄 PDF

SoAd shall perform the following further actions within the SoAd_RxIndication () function for reception of a PDU to an upper layer using the IF-API: 1. assemble all data of a fragmented IF-PDU into a SoAd receive buffer if PDU Header is used 2. call <Up>_[SoAd][If]RxIndication () of the related upper layer module (with RxPduId set to the ID specified by the upper layer module for the PDU referenced by SoAdRxPduRef) for each completely received PDU 3. dispatch the next IF-PDU (if any) if PDU Header mode is used

requirement SWS_SoAd_00568 [SWS_SoAd_00568] 📄 PDF

SoAd shall perform the following further actions within the SoAd_RxIndication () function for reception of a PDU from a socket connection with PDU Header mode disabled to an upper layer using the TP-API: 1. if the SoAd receive buffer does not contain any TP data for this socket connection (a) Query the available amount of data at the upper layer by calling the config- urable callback function <Up>_[SoAd][Tp]CopyRxData () with PduInfo- Type.SduLength = 0. (b) If not all data can be processed (i.e. forwarded to an upper layer or stored in a SoAd receive buffer), discard all received data and skip further processing. (c) Copy all received data which can be accepted by the upper layer module determined at (a) to the upper layer by calling <Up>_[SoAd][Tp]CopyRx- Data () (d) Copy all remaining data (i.e. data which are received but not delivered to the upper layer) to a SoAd receive buffer for later processing by SoAd_- MainFunction () 2. if the SoAd receive buffer already contains TP data for this socket connection and is able to store all (newley) received data: copy all received data to the SoAd receive buffer for later processing by SoAd_MainFunction ()

requirement SWS_SoAd_00569 [SWS_SoAd_00569] 📄 PDF

In the SoAd_MainFunction () the SoAd shall process as spec- ified below if the SoAd receive buffer contains TP data for a socket connection with PDU Header mode disabled: 1. Query the available amount of data at the upper layer by calling the configurable callback function <Up>_[SoAd][Tp]CopyRxData () with PduInfoType.Sdu- Length = 0. 2. Copy all data belonging to this socket connection from the SoAd receive buffer which can be accepted by the upper layer module determined at (1) to the upper layer by calling <Up>_[SoAd][Tp]CopyRxData ()

requirement SWS_SoAd_00570 [SWS_SoAd_00570] 📄 PDF

If <Up>_[SoAd][Tp]StartOfReception () or <Up>_- [SoAd][Tp]CopyRxData () return with BUFREQ_E_NOT_OK for a socket connection with PDU Header mode disabled, SoAd shall (a) disable further transmission or re- ception for this socket connection (i.e. new transmit requests shall be rejected with E_NOT_OK and received messages shall simply be discarded) and (b) close the socket connection in the next SoAd_MainFunction ().

requirement SWS_SoAd_00571 [SWS_SoAd_00571] 📄 PDF

SoAd shall perform the following further actions within the SoAd_RxIndication () function for reception of a PDU from a socket connection with PDU Header mode enabled to an upper layer using the TP-API: 1. if no TP reception is in progress for the related socket connection (a) After reception of a complete PDU Header, call <Up>_[SoAd][Tp] StartOfReception () of the related upper layer module with RxPduId set to the ID specified by the upper layer module for the PDU referenced by SoAdRxPduRef , set TpSduLength to the length specified in the PDU Header, and set PduInfoType.SduDataPtr and PduInfoType.Sdu- Length to provide already received PDU data to the upper layer. (b) if not all data can be processed (i.e. forwarded to an upper layer or stored in a SoAd receive buffer), discard all received data, call <Up>_[SoAd][Tp] RxIndication ()with the same RxPduId as used at <Up>_[SoAd][Tp] StartOfReception () and result set to E_NOT_OK and skip further pro- cessing (c) call <Up>_[SoAd][Tp]CopyRxData () of the related upper layer module with the same RxPduId as used at <Up>_[SoAd][Tp]StartOfRecep- tion () and PduInfoType.SduDataPtr pointing to the PDU data pro- vided by SoAd_RxIndication () and PduInfoType.SduLength set to minimum of the received PDU data and the available receive buffer in the upper layer module specified by bufferSizePtr at <Up>_[SoAd][Tp] StartOfReception ()) (d) call <Up>_[SoAd][Tp]RxIndication () if the complete PDU has been forwarded to the upper layer, otherwise copy all received data which could not be forwarded to the upper layer to a SoAd receive buffer for later pro- cessing by SoAd_MainFunction () 2. if a TP reception is in progress for the related socket connection and the related SoAd receive buffer is able to store all received data: copy all received data to the related SoAd receive buffer for later processing by SoAd_MainFunction ()

requirement SWS_SoAd_00572 [SWS_SoAd_00572] 📄 PDF

If <Up>_[SoAd][Tp]StartOfReception () does not return BUFREQ_OK for a socket connection with PDU Header mode enabled, SoAd shall sim- ply discard all data of the PDU.

requirement SWS_SoAd_00573 [SWS_SoAd_00573] 📄 PDF

If <Up>_[SoAd][Tp]CopyRxData () does not return BUFREQ_OK for a socket connection with PDU Header mode enabled, SoAd shall terminate the TP receive session, simply discard all data of the PDU and call <Up>_[SoAd][Tp]RxIndication () with E_NOT_OK .

requirement SWS_SoAd_00574 [SWS_SoAd_00574] 📄 PDF

In the SoAd_MainFunction () the SoAd shall process as spec- ified below if a TP reception is in progress for a socket connection with PDU Header mode enabled: 1. Query the available amount of data at the upper layer by calling the configurable callback function <Up>_[SoAd][Tp]CopyRxData () with PduInfoType.Sdu- Length = 0. 2. Copy all data belonging to this socket connection from the SoAd receive buffer which can be accepted by the upper layer module determined at (1) to the upper layer by calling <Up>_[SoAd][Tp]CopyRxData () 3. call <Up>_[SoAd][Tp]RxIndication () if the complete PDU has been for- warded to the upper layer and dispatch the next TP-PDU (if any)

requirement SWS_SoAd_00575 [SWS_SoAd_00575] 📄 PDF

SoAd shall store a cancellation request when called with SoAd_TpCancelReceive () and SoAd_TpCancelTransmit (), but handle the re- quest only in the SoAd_MainFunction () respecting the connection loss and recovery policy.

requirement SWS_SoAd_00576 [SWS_SoAd_00576] 📄 PDF

If SoAd_TpCancelReceive () or SoAd_TpCancelTrans- mit () is called for a PDU where TP reception or TP transmission is not in progress, SoAd shall ignore the request and return E_NOT_OK .

requirement SWS_SoAd_00577 [SWS_SoAd_00577] 📄 PDF

Within SoAd_MainFunction (), SoAd shall close the socket connection for any communication cancelation request related to an active TP trans- mission.

requirement SWS_SoAd_00581 [SWS_SoAd_00581] 📄 PDF

Within SoAd_MainFunction (), SoAd shall close the socket connection for any communication cancelation request related to an active TP recep- tion.

requirement SWS_SoAd_00582 [SWS_SoAd_00582] 📄 PDF

For a UDP socket connection of type automatic (i.e. config- uration parameter SoAdSocketAutomaticSoConSetup set to TRUE ) which uses a wildcard in the configured remote address (i.e. an ANY-String for IP address or port), SoAd shall (a) change the state of the socket connection to SOAD_SOCON_RECONNECT and (b) reset the remote address to the configured remote address after a PDU trans- mission, directly before the related transmit confirmation function is called (or would be called if such a function is not configured).

requirement SWS_SoAd_00586 [SWS_SoAd_00586] 📄 PDF

SoAd shall automatically reestablish a socket connection which is in the connection state SOAD_SOCON_RECONNECT within SoAd_MainFunction () - independent of the configuration parameter SoAdSocketAutomaticSoConSetup , i.e. connection shall be reestablished even if the parameter is set to FALSE . Recon- nection shall be done by considering configuration parameter SoAdSocketTcpIni- tiate .

requirement SWS_SoAd_00587 [SWS_SoAd_00587] 📄 PDF

SoAd shall return E_NOT_OK for TP-PDU Tx requests received at SoAd_TpTransmit () within connection reestablishment.

requirement SWS_SoAd_00588 [SWS_SoAd_00588] 📄 PDF

SoAd shall store a request to open or close a socket connection when called with SoAd_OpenSoCon () and SoAd_CloseSoCon () respectively, but han- dle the request only in the SoAd_MainFunction () respecting the connection setup and shutdown policy.

requirement SWS_SoAd_00589 [SWS_SoAd_00589] 📄 PDF

In the SoAd_MainFunction (), SoAd shall try to open each socket connection which fulfills all of the following criterias: 1. No TcpIp socket is assigned to the socket connection 2. Open is either (a) explicitly requested by a previous SoAd_OpenSoCon () call which has not been revoked by a following SoAd_CloseSoCon () call or (b) im- plicitly requested when SoAdSocketAutomaticSoConSetup is TRUE 3. remote address is set (either specified by configuration or set via the function SoAd_SetRemoteAddr ()) 4. local IP address is assigned, i.e. SoAd_LocalIpAddrAssign- mentChg () has been called with the related LocalAddrId and TCPIP_IPADDR_STATE_ASSIGNED as State.

requirement SWS_SoAd_00590 [SWS_SoAd_00590] 📄 PDF

SoAd shall perform the following actions within SoAd_Main- Function () to open either a UDP socket connection which is part of a socket con- nection group containing a single socket connection (i.e. there is only one socket connection in the socket connection group configuration container) or a TCP socket connection with SoAdSocketTcpInitiate set to TRUE : 1. Get an appropriate socket from TcpIp by calling TcpIp_SoAdGetSocket () with the TcpIp_DomainType implicitly specified by SoAdSocketLocalAddress- Ref , and the protocol type specified by SoAdSocketProtocol . 2. Change the socket specific parameters according to [SWS_SoAd_00689]. 3. Bind the socket to the local address and port by calling TcpIp_Bind () with the local address identifier specified by SoAdSocketLocalAddressRef and local port specified by SoAdSocketLocalPort . 4. In case of a TCP socket initiate the TCP connection by calling TcpIp_TcpCon- nect ().

requirement SWS_SoAd_00591 [SWS_SoAd_00591] 📄 PDF

Within SoAd_MainFunction () and after successfully perform- ing the open actions, SoAd shall change the state of the socket connection to SOAD_SOCON_ONLINE in case of a UDP socket and either SoAdSocketUdpLis- tenOnly is set to TRUE or a remote address is set by a value that does not contain any wildcards.

requirement SWS_SoAd_00592 [SWS_SoAd_00592] 📄 PDF

Within SoAd_RxIndication () and before analyzing or for- warding of any message data, SoAd shall (a) overwrite the remote address parts specified with wildcards (e.g. remote IP address set to TCPIP_IPADDR_ANY ) with the related source address parts of the received message and (b) change the state of the socket connection to SOAD_SOCON_ONLINE in case all of the following conditions are true: 1. Current connection state is not SOAD_SOCON_ONLINE 2. UDP socket 3. SoAdSocketUdpListenOnly is set to FALSE 4. SoAdSocketMsgAcceptanceFilterEnabled is set to TRUE 5. Remote address is set, but contains wildcards 6. Received message is accepted according to the message acceptance policy

requirement SWS_SoAd_00593 [SWS_SoAd_00593] 📄 PDF

Within SoAd_TcpConnected () SoAd shall change the state of the socket connection to SOAD_SOCON_ONLINE in case all of the following conditions are true: 1. Current connection state is not SOAD_SOCON_ONLINE 2. TCP socket 3. SoAdSocketTcpInitiate is set to TRUE

requirement SWS_SoAd_00594 [SWS_SoAd_00594] 📄 PDF

At SoAd_TcpAccepted (), SoAd shall perform the following ac- tions if the TCP SoAdSocketConnectionGroup related to SocketId has SoAd- SocketTcpInitiate set to FALSE : 1. choose one of the socket connections using the best match algorithm (see [SWS_SoAd_00680]), and either proceed with the selected socket connection or skip further processing and return with E_NOT_OK if no match can be found 2. overwrite the remote address parts specified with wildcards (e.g. remote IP ad- dress set to TCPIP_IPADDR_ANY ) with the related source address parts of the received message if the remote address set for the socket connection contains wildcards 3. assign the TcpIp socket used for the established connection and provided as parameter SocketIdConnected to the chosen socket connection, 4. change the state of this socket connection to SOAD_SOCON_ONLINE and return E_OK

requirement SWS_SoAd_00595 [SWS_SoAd_00595] 📄 PDF

For socket connection with PDU Header mode disabled ( SoAd- PduHeaderEnable = FALSE ) and an upper layer with TP-API, SoAd shall call <Up> _[SoAd][Tp]StartOfReception () with TpSduLength = 0 at the end of the con- nection setup.

requirement SWS_SoAd_00597 [SWS_SoAd_00597] 📄 PDF

Each time a socket connection state changes, SoAd shall notify the upper layer of a socket connection state change with the configured upper layer notification function <Up>_SoConModeChg () and the new state if SoAdSocketSo- ConModeChgNotification is set to TRUE for the socket connection.

requirement SWS_SoAd_00598 [SWS_SoAd_00598] 📄 PDF

Each time the IP address assignment related to a socket con- nection changes, SoAd shall notify the upper layer of the IP address assignment change with the configured upper layer notification function <Up>_LocalIpAddrAs- signmentChg () and the new address state if SoAdSocketIpAddrAssignmentChg- Notification is set to TRUE for the socket connection.

requirement SWS_SoAd_00599 [SWS_SoAd_00599] 📄 PDF

The SoAd shall provide sufficient buffers to store data which temporarily can't be forwarded to TcpIp, e.g. SoAd UDP TP transmit buffers or Udp- TxBuffer, nPduUdpTxBuffer.

requirement SWS_SoAd_00600 [SWS_SoAd_00600] 📄 PDF

If a PDU is received according to SoAdSocketRouteDest which belongs only to inactive RoutingGroups, SoAd shall simply discard the PDU.

requirement SWS_SoAd_00601 [SWS_SoAd_00601] 📄 PDF

SoAd shall maintain the state of each configured routing group and activate or deactivate the state at initialization depending on the configuration pa- rameter SoAdRoutingGroupIsEnabledAtInit .

requirement SWS_SoAd_00602 [SWS_SoAd_00602] 📄 PDF

SoAd shall support more than one SoAdPduRouteDest per SoAdPduRoute for upper layers of If-type, i.e. a single IF-PDU can be transmitted via multiple socket connections.

requirement SWS_SoAd_00604 [SWS_SoAd_00604] 📄 PDF

In the SoAd_MainFunction (), SoAd shall close each socket connection which fulfills all of the following criteria: 1. Current connection state is not SOAD_SOCON_OFFLINE 2. Close is explicitly requested by a previous SoAd_CloseSoCon () call 3. No upper layer requested to keep the socket connection open at the time of the SoAd_CloseSoCon () call (i.e. SoAd_CloseSoCon () has been called as often as SoAd_OpenSoCon ()) or SoAd_CloseSoCon () has been called with abort set to TRUE .

requirement SWS_SoAd_00605 [SWS_SoAd_00605] 📄 PDF

If development error detection is enabled: SoAd_TpCancel- Transmit () shall check that the service SoAd_Init () was previously called. If the check fails, SoAd_TpCancelTransmit () shall raise the development error SOAD_E_UNINIT .

requirement SWS_SoAd_00606 [SWS_SoAd_00606] 📄 PDF

If development error detection is enabled: SoAd_TpCancel- Transmit () shall check parameter TxPduId for being valid. If the check fails, SoAd_- TpCancelTransmit () shall raise the development error SOAD_E_INV_PDUID .

requirement SWS_SoAd_00607 [SWS_SoAd_00607] 📄 PDF

If development error detection is enabled: SoAd_TpCancel- Receive () shall check that the service SoAd_Init () was previously called. If the check fails, SoAd_TpCancelReceive () shall raise the development error SOAD_E_UNINIT .

requirement SWS_SoAd_00608 [SWS_SoAd_00608] 📄 PDF

If development error detection is enabled: SoAd_TpCancel- Receive () shall check parameter RxPduId for being valid. If the check fails, SoAd_- TpCancelReceive () shall raise the development error SOAD_E_INV_PDUID .

requirement SWS_SoAd_00609 [SWS_SoAd_00609] 📄 PDF

If development error detection is enabled: SoAd_GetSo- ConId () shall check that the service SoAd_Init () was previously called. If the check fails, SoAd_GetSoConId () shall raise the development error SOAD_E_UNINIT .

requirement SWS_SoAd_00610 [SWS_SoAd_00610] 📄 PDF

If development error detection is enabled: SoAd_GetSo- ConId () shall check parameter TxPduId for being valid. If the check fails, SoAd_- GetSoConId () shall raise the development error SOAD_E_INV_PDUID .

requirement SWS_SoAd_00611 [SWS_SoAd_00611] 📄 PDF

If development error detection is enabled: SoAd_OpenSoCon () shall check parameter SoConId for being valid. If the check fails, SoAd_OpenSoCon () shall raise the development error SOAD_E_INV_ARG .

requirement SWS_SoAd_00612 [SWS_SoAd_00612] 📄 PDF

If development error detection is enabled: SoAd_CloseSo- Con () shall check parameter SoConId for being valid. If the check fails, SoAd_Clos- eSoCon () shall raise the development error SOAD_E_INV_ARG .

requirement SWS_SoAd_00613 [SWS_SoAd_00613] 📄 PDF

If development error detection is enabled: SoAd_RequestI- pAddrAssignment () shall check that the service SoAd_Init () was previously called. If the check fails, SoAd_RequestIpAddrAssignment () shall raise the development error SOAD_E_UNINIT .

requirement SWS_SoAd_00615 [SWS_SoAd_00615] 📄 PDF

If development error detection is enabled: SoAd_OpenSoCon () shall check that the service SoAd_Init () was previously called. If the check fails, SoAd_OpenSoCon () shall raise the development error SOAD_E_UNINIT .

requirement SWS_SoAd_00616 [SWS_SoAd_00616] 📄 PDF

If development error detection is enabled: SoAd_CloseSo- Con () shall check that the service SoAd_Init () was previously called. If the check fails, SoAd_CloseSoCon () shall raise the development error SOAD_E_UNINIT .

requirement SWS_SoAd_00617 [SWS_SoAd_00617] 📄 PDF

If development error detection is enabled, SoAd_RequestI- pAddrAssignment () shall check parameter SoConId for being valid. If the check fails, SoAd_RequestIpAddrAssignment () shall raise the development error SOAD_E_INV_ARG .

requirement SWS_SoAd_00618 [SWS_SoAd_00618] 📄 PDF

If development error detection is enabled: SoAd_Relea- seIpAddrAssignment () shall check that the service SoAd_Init () was previously called. If the check fails, SoAd_ReleaseIpAddrAssignment () shall raise the devel- opment error SOAD_E_UNINIT .

requirement SWS_SoAd_00619 [SWS_SoAd_00619] 📄 PDF

If development error detection is enabled: SoAd_Relea- seIpAddrAssignment () shall check parameter SoConId for being valid. If the check fails, SoAd_ReleaseIpAddrAssignment () shall raise the development error SOAD_E_INV_ARG .

requirement SWS_SoAd_00620 [SWS_SoAd_00620] 📄 PDF

If development error detection is enabled: SoAd_GetLocal- Addr () shall check parameter SoConId for being valid. If the check fails, SoAd_Get- LocalAddr () shall raise the development error SOAD_E_INV_ARG .

requirement SWS_SoAd_00621 [SWS_SoAd_00621] 📄 PDF

If development error detection is enabled: SoAd_GetLocal- Addr () shall check that the service SoAd_Init () was previously called. If the check fails, SoAd_GetLocalAddr () shall raise the development error SOAD_E_UNINIT .

requirement SWS_SoAd_00622 [SWS_SoAd_00622] 📄 PDF

If development error detection is enabled: SoAd_Get- PhysAddr () shall check parameter SoConId for being valid. If the check fails, SoAd_- GetPhysAddr () shall raise the development error SOAD_E_INV_ARG .

requirement SWS_SoAd_00623 [SWS_SoAd_00623] 📄 PDF

If development error detection is enabled: SoAd_Get- PhysAddr () shall check that the service SoAd_Init () was previously called. If the check fails, SoAd_GetPhysAddr () shall raise the development error SOAD_E_UNINIT .

requirement SWS_SoAd_00624 [SWS_SoAd_00624] 📄 PDF

If development error detection is enabled: SoAd_EnableR- outing () shall check that the service SoAd_Init () was previously called. If the check fails, SoAd_EnableRouting () shall raise the development error SOAD_E_UNINIT .

requirement SWS_SoAd_00625 [SWS_SoAd_00625] 📄 PDF

If development error detection is enabled: SoAd_EnableR- outing () shall check parameter id for being valid. If the check fails, SoAd_EnableR- outing () shall raise the development error SOAD_E_INV_ARG .

requirement SWS_SoAd_00626 [SWS_SoAd_00626] 📄 PDF

If development error detection is enabled: SoAd_DisableR- outing () shall check parameter id for being valid. If the check fails, SoAd_DisableR- outing () shall raise the development error SOAD_E_INV_ARG .

requirement SWS_SoAd_00627 [SWS_SoAd_00627] 📄 PDF

If development error detection is enabled: SoAd_DisableR- outing () shall check that the service SoAd_Init () was previously called. If the check fails, SoAd_DisableRouting () shall raise the development error SOAD_E_UNINIT .

requirement SWS_SoAd_00628 [SWS_SoAd_00628] 📄 PDF

If development error detection is enabled: SoAd_Se- tRemoteAddr () shall check that the service SoAd_Init () was previously called. If the check fails, SoAd_SetRemoteAddr () shall raise the development error SOAD_E_UNINIT .

requirement SWS_SoAd_00632 [SWS_SoAd_00632] 📄 PDF

If development error detection is enabled: SoAd_CopyTx- Data () shall check that the service SoAd_Init () was previously called. If the check fails, SoAd_CopyTxData () shall raise the development error SOAD_E_UNINIT .

requirement SWS_SoAd_00633 [SWS_SoAd_00633] 📄 PDF

If development error detection is enabled: SoAd_CopyTx- Data () shall check parameter SocketId for being valid. If the check fails, SoAd_- CopyTxData () shall raise the development error SOAD_E_INV_SOCKETID .

requirement SWS_SoAd_00635 [SWS_SoAd_00635] 📄 PDF

If SoAdSocketMsgAcceptanceFilterEnabled is FALSE , SoAd shall accept all TCP connection or UDP datagrams from remote nodes.

requirement SWS_SoAd_00636 [SWS_SoAd_00636] 📄 PDF

At SoAd_TcpAccepted (), SoAd shall perform the following actions if the TCP SoAdSocketConnectionGroup related to SocketId has both SoAdSocketTcpInitiate and SoAdSocketMsgAcceptanceFilterEnabled set to FALSE and is not online (i.e. current connection state not SOAD_SOCON_ONLINE ): 1. assign the TcpIp socket used for the established connection and provided as parameter SocketIdConnected to the socket connection and 2. change the state of the socket connection to SOAD_SOCON_ONLINE and return E_OK .

requirement SWS_SoAd_00637 [SWS_SoAd_00637] 📄 PDF

SoAd shall perform the following actions within SoAd_Main- Function () to close a socket connection: 1. Terminate active TP sessions (if any) and notify the upper layer about the termi- nation 2. Disable further transmission or reception for this socket connection, i.e. new transmit requests shall be rejected with E_NOT_OK and received messages shall simply be discarded. 3. Close related TcpIp sockets 4. Change the state of the socket connection to SOAD_SOCON_OFFLINE if clos- ing of the socket connection results from a SoAd_CloseSoCon () request or to SOAD_SOCON_RECONNECT otherwise.

requirement SWS_SoAd_00638 [SWS_SoAd_00638] 📄 PDF

SoAd shall perform the following actions within SoAd_Main- Function () to open a TCP socket connection with SoAdSocketTcpInitiate set to FALSE : 1. In case no Listen-Socket is assigned to the socket connection: (a) Get an appropriate socket from TcpIp by calling TcpIp_SoAdGetSocket () with the TcpIp_DomainType implicitly specified by SoAdSocketLocal- AddressRef , and the protocol type specified by SoAdSocketProtocol . (b) Change the socket specific parameters according to [SWS_SoAd_00689]. (c) Bind the socket to the local address and port by calling TcpIp_Bind () with the local address identifier specified by SoAdSocketLocalAddressRef and local port specified by SoAdSocketLocalPort . (d) Assign the Listen-Socket to the socket connection group (e) Activate the socket connection to accept connections from remote nodes (f) Listen for a remote connection requests on the Listen-Socket by calling TcpIp_TcpListen () with MaxChannels set to the number of socket con- nections that are part of the TCP socket connection group 2. In case the Listen-Socket is already assigned to the socket connection: (a) Activate the socket connection to accept connections from remote nodes

requirement SWS_SoAd_00639 [SWS_SoAd_00639] 📄 PDF

SoAd shall perform the following actions within SoAd_Main- Function () to open a UDP socket connection which is part of a socket connection group containing multiple socket connections (i.e. there is more than one socket con- nection in the socket connection group configuration container): 1. In case no UDP socket is assigned to the socket connection group: (a) Get an appropriate socket from TcpIp by calling TcpIp_SoAdGetSocket () with the domain type implicitly specified by SoAdSocketLocalAddress- Ref , and the protocol type specified by SoAdSocketProtocol . (b) Change the socket specific parameters according to [SWS_SoAd_00689] (c) Bind the socket to the local address and port by calling TcpIp_Bind () with the local address identifier specified by SoAdSocketLocalAddressRef and local port specified by SoAdSocketLocalPort . (d) Assign the UDP socket to the socket connection group (e) Activate the socket connection for communication via the shared UDP socket of the socket connection group 2. In case the UDP socket is already assigned to the socket connection group: (a) Activate the socket connection for communication via the shared UDP socket of the socket connection group

requirement SWS_SoAd_00640 [SWS_SoAd_00640] 📄 PDF

To notify the upper layer about the termination of an active TP transmission on closing a socket connection within SoAd_MainFunction (), SoAd shall call <Up>_[SoAd][Tp]TxConfirmation () with parameter result set to 1. E_OK if disconnect is caused by SoAd_CloseSoCon () and all data was correctly transmitted, and 2. E_NOT_OK for any other cause.

requirement SWS_SoAd_00641 [SWS_SoAd_00641] 📄 PDF

To notify the upper layer about the termination of an active TP reception on closing a socket connection within SoAd_MainFunction (), SoAd shall call <Up>_[SoAd][Tp]RxIndication () with parameter result set to 1. E_OK if disconnection is caused by SoAd_CloseSoCon () and all received data was correctly delivered to the upper layer, and 2. E_NOT_OK for any other cause.

requirement SWS_SoAd_00642 [SWS_SoAd_00642] 📄 PDF

To close related TcpIp sockets on closing a socket connection within SoAd_MainFunction (), SoAd shall perform the following actions: 1. In case of a TCP socket connection: (a) Close the related socket by calling TcpIp_Close () with parameter abort set to the same value as provided by SoAd_CloseSoCon () or set to FALSE in case closing was not initiated by SoAd_CloseSoCon (). (b) If all socket connections of a TCP socket connection group have been closed by SoAd_CloseSoCon (): Close the related Listen-Socket by call- ing TcpIp_Close () with parameter abort set to the same value as provided by SoAd_CloseSoCon () or set to FALSE in case closing was not initiated by SoAd_CloseSoCon (). 2. In case of a UDP socket connection: (a) If the socket connection is NOT part of a socket connection group (i.e. there is only one socket connection in the socket connection group configuration container): Close the related socket by calling TcpIp_Close () with param- eter abort set to the same value as provided by SoAd_CloseSoCon () or set to FALSE in case closing was not initiated by SoAd_CloseSoCon (). (b) If all socket connections of a UDP socket connection group have been closed by SoAd_CloseSoCon (): Close the related UDP socket by calling TcpIp_- Close () with parameter abort set to the same value as provided by SoAd_- CloseSoCon ()or set to FALSE in case closing was not initiated by SoAd_- CloseSoCon ().

requirement SWS_SoAd_00643 [SWS_SoAd_00643] 📄 PDF

Within SoAd_TcpIpEvent () with Event set to TCPIP_UDP_CLOSED , SoAd shall 1. remove the assignment of the TcpIp socket identified by SocketId from the related UDP socket connection group and 2. close all socket connections of the related socket connection group that are in SOAD_SOCON_ONLINE (i.e. perform the specified closing actions with the excep- tion of closing related TcpIp sockets)

requirement SWS_SoAd_00644 [SWS_SoAd_00644] 📄 PDF

For a TCP socket connection of type automatic (i.e. configu- ration parameter SoAdSocketAutomaticSoConSetup set to TRUE ) which uses a wildcard in the configured remote address (i.e. an ANY-String for IP address or port), SoAd shall (a) disable further transmission or reception for this socket connection (i.e. new transmit requests shall be rejected with E_NOT_OK and received messages shall simply be discarded) after a PDU transmission, directly before the related transmit con- firmation function is called (or would be called if such a function is not configured) and (b) close the socket connection in the next SoAd_MainFunction ().

requirement SWS_SoAd_00645 [SWS_SoAd_00645] 📄 PDF

Within SoAd_TcpIpEvent () with Event set to TCPIP_TCP_CLOSED for a Listen-Socket, SoAd shall remove the assignment of the TcpIp socket identified by SocketId from the related TCP socket connection group.

requirement SWS_SoAd_00646 [SWS_SoAd_00646] 📄 PDF

Within SoAd_TcpIpEvent () with Event set to TCPIP_TCP_CLOSED or TCPIP_TCP_RESET , SoAd shall 1. remove the assignment of the TcpIp socket identified by SocketId from the related socket connection and 2. close the socket connection if it is in SOAD_SOCON_ONLINE (i.e. perform the specified closing actions with the exception of closing related TcpIp socket).

requirement SWS_SoAd_00647 [SWS_SoAd_00647] 📄 PDF

In case of multiple socket connections, SoAd shall call the up- per layer with the configured transmit confirmation function ( <Up>[SoAd][If]Tx- Confirmation ()) with result set to E_OK only once after transmission on all related socket connections succeded.

requirement SWS_SoAd_00648 [SWS_SoAd_00648] 📄 PDF

If a transmit request on any of multiple socket connections re- turns E_NOT_OK , SoAd shall return E_NOT_OK at SoAd_IfTransmit ().

requirement SWS_SoAd_00650 [SWS_SoAd_00650] 📄 PDF

The service SoAd_TpTransmit () shall skip the transmit re- quest and return E_NOT_OK if there is already an IF or TP transmission ongoing on the related socket identified by TxPduId .

requirement SWS_SoAd_00651 [SWS_SoAd_00651] 📄 PDF

If <Up>_[SoAd][Tp]CopyTxData () return with BUFREQ_E_NOT_OK for a TCP socket connection, SoAd shall (a) disable further transmission or reception for this socket connection (i.e. new transmit requests shall be rejected with E_NOT_OK and received messages shall simply be discarded) and (b) close the socket connection in the next SoAd_MainFunction ().

requirement SWS_SoAd_00652 [SWS_SoAd_00652] 📄 PDF

If <Up>_[SoAd][Tp]CopyTxData () return with BUFREQ_E_NOT_OK for a UDP socket connection, SoAd shall immediately ter- minate the TP transmit session and notify the upper layer with the configured transmit confirmation function <Up>_[SoAd][Tp]TxConfirmation () with E_NOT_OK as result. (Note: the related socket connection is not closed in this case.)

requirement SWS_SoAd_00653 [SWS_SoAd_00653] 📄 PDF

The service SoAd_IfTransmit () shall skip the transmit re- quest and return E_NOT_OK if there is already an IF or TP transmission ongoing on the related socket identified by TxPduId .

requirement SWS_SoAd_00657 [SWS_SoAd_00657] 📄 PDF

In case more than one socket connection belongs to a UDP socket connection group, a UDP socket is shared between all socket connections of the group and the related socket connection shall be selected according to the best match algorithm (see [SWS_SoAd_00680]).

requirement SWS_SoAd_00658 [SWS_SoAd_00658] 📄 PDF

If development error detection is enabled: SoAd_IfRouting- GroupTransmit () shall check parameter id for being valid (i.e. id refers a routing group that has configuration parameter SoAdRoutingGroupTxTriggerable set to TRUE ). If the check fails, SoAd_IfRoutingGroupTransmit () shall raise the devel- opment error SOAD_E_INV_ARG .

requirement SWS_SoAd_00659 [SWS_SoAd_00659] 📄 PDF

If development error detection is enabled: SoAd_Ge- tRemoteAddr () shall check that the service SoAd_Init () was previously called. If the check fails, SoAd_GetRemoteAddr () shall raise the development error SOAD_E_UNINIT .

requirement SWS_SoAd_00660 [SWS_SoAd_00660] 📄 PDF

If development error detection is enabled: SoAd_Ge- tRemoteAddr () shall check parameter SoConId for being valid. If the check fails, SoAd_GetRemoteAddr () shall raise the development error SOAD_E_INV_ARG .

requirement SWS_SoAd_00661 [SWS_SoAd_00661] 📄 PDF

If development error detection is enabled: SoAd_IfRouting- GroupTransmit () shall check that the service SoAd_Init () was previously called. If the check fails, SoAd_IfRoutingGroupTransmit () shall raise the development error SOAD_E_UNINIT .

requirement SWS_SoAd_00662 [SWS_SoAd_00662] 📄 PDF

At SoAd_IfRoutingGroupTransmit () SoAd shall store a trigger transmit request for each SoAdPduRouteDest that contains a reference to the routing group identified by the parameter id for transmission in the SoAd_Main- Function ().

requirement SWS_SoAd_00664 [SWS_SoAd_00664] 📄 PDF

At SoAd_GetRemoteAddr () SoAd shall retrieve the remote ad- dress (IP address and port) actually used for the socket connection specified by pa- rameter SoConId .

requirement SWS_SoAd_00665 [SWS_SoAd_00665] 📄 PDF

In the SoAd_MainFunction () the SoAd shall check for pend- ing triggered transmit request for SoAdPduRouteDest and identify all related IF- PDUs. For each identified IF-PDU SoAd shall process as specified below: 1. retrieve the data from the related upper layer by calling <Up>_[SoAd][If] TriggerTransmit () and 2. transmit the data via the related socket connection.

requirement SWS_SoAd_00666 [SWS_SoAd_00666] 📄 PDF

SoAd_GetRemoteAddr () shall immediately return E_NOT_OK if the remote address of the socket connection specified by parameter SoConId is not set.

requirement SWS_SoAd_00667 [SWS_SoAd_00667] 📄 PDF

In case of a TCP socket connection configured with SoAdSock- etTcpImmediateTpTxConfirmation set to TRUE the SoAd shall call the upper layer with the configured transmit confirmation function <Up>_[SoAd][Tp]TxCon- firmation () and E_OK as result within the SoAd_MainFunction () after TcpIp_- TcpTransmit () returns E_OK .

requirement SWS_SoAd_00670 [SWS_SoAd_00670] 📄 PDF

In case of a TCP socket connection the SoAd shall call the upper layer with the configured transmit confirmation function <Up>_[SoAd][Tp]Tx- Confirmation () and E_NOT_OK as result within the SoAd_MainFunction () after TcpIp_TcpTransmit () returns with E_NOT_OK .

requirement SWS_SoAd_00672 [SWS_SoAd_00672] 📄 PDF

If development error detection is enabled: SoAd_SetUni- queRemoteAddr () shall check that the service SoAd_Init () was previously called. If the check fails, SoAd_SetUniqueRemoteAddr () shall raise the development error SOAD_E_UNINIT .

requirement SWS_SoAd_00673 [SWS_SoAd_00673] 📄 PDF

If development error detection is enabled: SoAd_SetU- niqueRemoteAddr () shall check parameter SoConId for being valid. If the check fails, SoAd_SetUniqueRemoteAddr () shall raise the development error SOAD_E_INV_ARG

requirement SWS_SoAd_00675 [SWS_SoAd_00675] 📄 PDF

The function SoAd_SetUniqueRemoteAddr () shall check if one of the socket connections of the socket connection group, identified by SoConId , is already configured with the address specified by RemoteAddrPtr. In this case, it shall return the socket connection index via AssignedSoConIdPtr and return E_OK .

requirement SWS_SoAd_00676 [SWS_SoAd_00676] 📄 PDF

If no socket connection is already configured with the address specified by RemoteAddrPtr, SoAd_SetUniqueRemoteAddr () shall: 1. choose an unused socket connection using the best match algorithm described in [SWS_SoAd_00680] 2. set it to the remote address specified by RemoteAddrPtr 3. set AssignedSoConIdPtr to the index of the chosen socket connection and 4. return E_OK . A socket connection is "unused" if its actual remote address has an IP address wildcard and/or port wildcard.

requirement SWS_SoAd_00678 [SWS_SoAd_00678] 📄 PDF

SoAd_SetUniqueRemoteAddr () shall reject the request and return E_NOT_OK if there are no unused socket connections within the socket connec- tion group identified by SoConId .

requirement SWS_SoAd_00680 [SWS_SoAd_00680] 📄 PDF

SoAd shall use the following best match algorithm to select a socket connection of a socket connection group based on a provided (specific) remote address: 1. socket connections that have no (specific or wildcard) remote address set shall be ignored 2. the remote address of the remaining socket connections shall be compared with the provided remote address and the socket connection with the best match ac- cording to the following ordered list (item listed earlier has higher priority towards items listed later) shall be selected: (a) IP address and port match (b) IP address match (and wildcard set for port) (c) Port match (and wildcard set for IP address) (d) Wildcards are used for both IP address and port (e) No match (i.e. no socket connections can be selected)

requirement SWS_SoAd_00683 [SWS_SoAd_00683] 📄 PDF

If a PDU with SoAdTxUdpTriggerMode set to TRIG- GER_NEVER without a specific SoAdTxUdpTriggerTimeout get buffered SoAd shall set the the nPdu specific timer to the value of SoAdTxUdpTriggerTimeout if the timer is not running or if it is lower than the current nPdu specific timer value.

requirement SWS_SoAd_00684 [SWS_SoAd_00684] 📄 PDF

SoAd shall stop the nPdu specific timer when the PDUs stored for the socket connection have been sent

requirement SWS_SoAd_00685 [SWS_SoAd_00685] 📄 PDF

In case the nPdu feature is used for a socket connection and SoAdTxUdpTriggerMode is set to TRIGGER_ALWAYS for the current PDU ( SoAdP- duRouteDest ) and the resulting PDU data and headers would exceed SoAdSocket- nPduUdpTxBufferMin , SoAd shall first transmit all PDUs stored for the socket con- nection (if any) by calling TcpIp_UdpTransmit () and then the current PDU by calling TcpIp_UdpTransmit () once more.

requirement SWS_SoAd_00686 [SWS_SoAd_00686] 📄 PDF

Within SoAd_MainFunction () and after successfully perform- ing the open actions, SoAd shall change the state of the socket connection to SOAD_SOCON_RECONNECT in case of 1. a TCP socket connection or 2. a UDP socket connection that is configured with a remote address containing wildcards.

requirement SWS_SoAd_00687 [SWS_SoAd_00687] 📄 PDF

If the function SoAd_SetRemoteAddr () is used to set the re- mote address of a socket connection that is in the mode SOAD_SOCON_ONLINE to a value that contains wildcards, SoAd shall change the mode of the socket connection to SOAD_SOCON_RECONNECT .

requirement SWS_SoAd_00688 [SWS_SoAd_00688] 📄 PDF

Within SoAd_TcpIpEvent () with Event set to TCPIP_TCP_FIN_RECEIVED SoAd shall close the related socket by calling TcpIp_- Close () with parameter abort set FALSE .

requirement SWS_SoAd_00689 [SWS_SoAd_00689] 📄 PDF

In case socket related parameters shall be changed as part of allocating a new socket, SoAd shall change the parameters according to the configura- tion of the associated socket connection by calling TcpIp_ChangeParameter () with ParameterId and ParameterValue for each related clause as specified below: 1. In case of a TCP socket: TCPIP_PARAMID_TCP_RXWND_MAX and the value specified by SoAdSocketTpRxBufferMin if the optional parameter is enabled 2. TCPIP_PARAMID_FRAMEPRIO and the value specified by SoAdSocket- FramePriority if the optional parameter is enabled 3. In case of a TCP socket: TCPIP_PARAMID_TCP_NAGLE and the value 0x01 if the related optional parameter SoAdSocketTcpNoDelay is set to FALSE or 0x00 if the parameter is set to TRUE . 4. In case of a TCP socket: TCPIP_PARAMID_TCP_KEEPALIVE and the value specified by SoAdSocketTcpKeepAlive 5. In case of a TCP socket: TCPIP_PARAMID_TCP_KEEPALIVE_TIME and the value specified by SoAdSocketTcpKeepAliveTime if the optional parameter is enabled 6. In case of a TCP socket: TCPIP_PARAMID_TCP_KEEPALIVE_PROBES_MAX and the value specified by SoAdSocketTcpKeepAliveProbesMax if the op- tional parameter is enabled 7. In case of a TCP socket: TCPIP_PARAMID_TCP_KEEPALIVE_INTERVAL and the value specified by SoAdSocketTcpKeepAliveInterval if the optional pa- rameter is enabled. 8. In case of a TCP socket: TCPIP_PARAMID_TCP_OPTIONFILTER and the value of TcpIpTcpConfigOptionFilterId specified in TcpIpTcpCon- figOptionFilter referenced by SoAdSocketTCPOptionFilterRef if the optional parameter is enabled. 9. TCPIP_PARAMID_PATHMTU_ENABLE and the value specified by SoAdSocket- PathMTUEnable if the optional parameter is enabled. 10. TCPIP_PARAMID_FLOWLABEL and the value specified by SoAdSocket- FlowLabel if the optional parameter is enabled. 11. TCPIP_PARAMID_DSCP and the value specified by SoAdSocketDifferenti- atedServicesField if the optional parameter is enabled. 12. In case of a UDP socket: TCPIP_PARAMID_UDP_CHECKSUM and the value of SoAdSocketUdpChecksumEnabled . 13. In case of a TCP socket: If SoAdSocketTcpTlsConnection- Ref is defined the function shall be called with the parameter ID TCPIP_PARAMID_TLS_CONNECTION_ASSIGNMENT and the value from this reference as the parameter value to assign a TLS connection to this socket. 14. In case of a TCP socket: TCPIP_PARAMID_TCP_RETRANSMIT_TIMEOUT and the value specified by SoAdSocketTcpRetransmissionTimeout if the op- tional parameter is enabled. If SoAdSocketTcpRetransmissionTimeout is configured to INF , SoAd shall use the corresponding value representing INF from TcpIp module.

requirement SWS_SoAd_00690 [SWS_SoAd_00690] 📄 PDF

SoAd shall preserve the order of PDUs transmitted via a socket connection that uses the nPdu feature. Pdus collected on the sender side first shall be extracted and indicated to the receivers on the receiving side first as well.

requirement SWS_SoAd_00691 [SWS_SoAd_00691] 📄 PDF

In case the nPdu feature is used for a socket connection and and all PDUs are configured with SoAdTxPduCollectionSemantics set to SOAD_COLLECT_QUEUED , SoAd shall transmit all PDUs individually, also PDUs with the same PduId.

requirement SWS_SoAd_00692 [SWS_SoAd_00692] 📄 PDF

Det_ReportError Det.h Service to report development errors. IdsM_SetSecurityEvent IdsM.h This API is the application interface to report security events to the IdsM. IdsM_SetSecurityEventWithContext Data IdsM.h This API is the application interface to report security events with context data to the IdsM. API Function Header File Description PduR_SoAdTpCopyRxData PduR_SoAd.h This function is called to provide the received data of an I-PDU segment (N-PDU) to the upper layer. Each call to this function provides the next part of the I-PDU data. The size of the remaining buffer is written to the position indicated by bufferSizePtr. PduR_SoAdTpCopyTxData PduR_SoAd.h This function is called to acquire the transmit data of an I-PDU segment (N-PDU). Each call to this function provides the next part of the I-PDU data unless retry->TpDataState is TP_DATARETRY. In this case the function restarts to copy the data beginning at the offset from the current position indicated by retry->TxTpDataCnt. The size of the remaining data is written to the position indicated by availableDataPtr. TcpIp_DhcpReadOption TcpIp.h By this API service the TCP/IP stack retrieves DHCP option data identified by parameter option for already received DHCP options. TcpIp_DhcpV6ReadOption TcpIp.h By this API service the TCP/IP stack retrieves DHCPv6 option data identified by parameter option for already received DHCPv6 options. TcpIp_DhcpV6WriteOption TcpIp.h By this API service the TCP/IP stack writes the DHCPv6 option data identified by parameter option. TcpIp_DhcpWriteOption TcpIp.h By this API service the TCP/IP stack writes the DHCP option data identified by parameter option.

requirement SWS_SoAd_00693 [SWS_SoAd_00693] 📄 PDF

Whenever a PDU or a part of a PDU is received, that has to be stored in a SoAd receive buffer, is larger than the remaining available buffer size SoAd shall shall raise the runtime error SOAD_E_NOBUFS .

requirement SWS_SoAd_00694 [SWS_SoAd_00694] 📄 PDF

If a UDP socket connection is configured with a SoAdSocke- tUdpAliveSupervisionTimeout and the remote address was overwritten, as de- scribed in [SWS_SoAd_00592], the alive supervision timer for this socket connection shall be started with the value specified by the configuration parameter SoAdSocke- tUdpAliveSupervisionTimeout .

requirement SWS_SoAd_00695 [SWS_SoAd_00695] 📄 PDF

If a UDP socket connection is configured with a SoAdSocke- tUdpAliveSupervisionTimeout , the alive supervision timer runs out and the re- mote address was not set by the upper layer, SoAd shall 1. change the state of the socket connection to SOAD_SOCON_RECONNECT , 2. deactivate the alive supervision timer and 3. reset the remote address to the configured remote address at SoAd_MainFunc- tion ().

requirement SWS_SoAd_00696 [SWS_SoAd_00696] 📄 PDF

SoAd shall maintain a nPdu specific timer for each socket con- nection using the nPdu feature.

requirement SWS_SoAd_00697 [SWS_SoAd_00697] 📄 PDF

If a PDU with SoAdTxUdpTriggerMode set to TRIG- GER_NEVER with a specific SoAdTxUdpTriggerTimeout get buffered SoAd shall set the nPdu specific timer to the value of SoAdTxUdpTriggerTimeout if the timer is not running or if it is lower than the current nPdu specific timer value.

requirement SWS_SoAd_00698 [SWS_SoAd_00698] 📄 PDF

SoAd_GetRemoteAddr () shall refuse the request if the domain set in IpAddrPtr does not match the TcpIp_DomainType of the local address related to the socket connection identified by SoConId and return E_NOT_OK . If development error detection is enabled, the service SoAd_GetRemoteAddr () shall also raise the development error SOAD_E_INV_ARG .

requirement SWS_SoAd_00699 [SWS_SoAd_00699] 📄 PDF

SoAd_SetRemoteAddr () shall refuse the request if the domain set in RemoteAddrPtr does not match the TcpIp_DomainType of the local address related to the socket connection identified by SoConId and return E_NOT_OK . If de- velopment error detection is enabled, the service SoAd_SetRemoteAddr () shall also raise the development error SOAD_E_INV_ARG .

requirement SWS_SoAd_00700 [SWS_SoAd_00700] 📄 PDF

SoAd_SetUniqueRemoteAddr () shall refuse the request if the domain set in RemoteAddrPtr does not match the TcpIp_DomainType of the local ad- dress related to the socket connection identified by SoConId and return E_NOT_OK . If development error detection is enabled, the service SoAd_SetUniqueRemoteAddr () shall also raise the development error SOAD_E_INV_ARG .

requirement SWS_SoAd_00701 [SWS_SoAd_00701] 📄 PDF

If development error detection is enabled: SoAd_Read- DhcpHostNameOption () shall check that the service SoAd_Init () was previously called. If the check fails, SoAd_ReadDhcpHostNameOption () shall raise the devel- opment error SOAD_E_UNINIT .

requirement SWS_SoAd_00702 [SWS_SoAd_00702] 📄 PDF

If development error detection is enabled: SoAd_Read- DhcpHostNameOption () shall check parameter SoConId for being valid. If the check fails, SoAd_ReadDhcpHostNameOption () shall raise the development error SOAD_E_INV_ARG .

requirement SWS_SoAd_00703 [SWS_SoAd_00703] 📄 PDF

The service SoAd_ReadDhcpHostNameOption () shall for- ward the call to TcpIp_DhcpReadOption () with the parameter Option set to the op- tion code 81 according to IETF RFC 4702 [9], if the socket connection identified by SoConId is related to a local address of the TcpIp_DomainType TCPIP_AF_INET.

requirement SWS_SoAd_00704 [SWS_SoAd_00704] 📄 PDF

The service SoAd_ReadDhcpHostNameOption () shall for- ward the call to TcpIp_DhcpV6ReadOption () with the parameter Option set to the option code 39 according to IETF RFC 4704 [10], if the socket connection identified by SoConId is related to a local address of the TcpIp_DomainType TCPIP_AF_INET6.

requirement SWS_SoAd_00705 [SWS_SoAd_00705] 📄 PDF

If development error detection is enabled: SoAd_WriteD- hcpHostNameOption () shall check that the service SoAd_Init () was previously called. If the check fails, SoAd_WriteDhcpHostNameOption () shall raise the de- velopment error SOAD_E_UNINIT .

requirement SWS_SoAd_00706 [SWS_SoAd_00706] 📄 PDF

If development error detection is enabled: SoAd_WriteD- hcpHostNameOption () shall check parameter SoConId for being valid. If the check fails, SoAd_WriteDhcpHostNameOption () shall raise the development error SOAD_E_INV_ARG .

requirement SWS_SoAd_00707 [SWS_SoAd_00707] 📄 PDF

The service SoAd_WriteDhcpHostNameOption () shall for- ward the call to TcpIp_DhcpWriteOption () with the parameter Option set to the option code 81 according to IETF RFC 4702 [9], if the socket connection identified by SoConId is related to a local address of the TcpIp_DomainType TCPIP_AF_INET.

requirement SWS_SoAd_00708 [SWS_SoAd_00708] 📄 PDF

The service SoAd_WriteDhcpHostNameOption () shall for- ward the call to TcpIp_DhcpV6WriteOption () with the parameter Option set to the option code 39 according to IETF RFC 4704 [10], if the socket connection identified by SoConId is related to a local address of the TcpIp_DomainType TCPIP_AF_INET6.

requirement SWS_SoAd_00709 [SWS_SoAd_00709] 📄 PDF

If SoAdSocketUdpStrictHeaderLenCheckEnabled is en- abled SoAd shall check if the length of the received UDP message does match the accumulated length of all PDUs including their PDU headers prior to forwarding any data to an upper layer. If the their lengths are different SoAd shall silently drop the whole message without forwarding any data.

requirement SWS_SoAd_00710 [SWS_SoAd_00710] 📄 PDF

In case no valid PDU data was forwarded to an upper layer and the remote address of the socket connection was overwritten according to [SWS_SoAd_00592] in context of the same SoAd_RxIndication (), SoAd shall re- vert the remote address change and set the state of the socket connection back to SOAD_SOCON_RECONNECT .

requirement SWS_SoAd_00712 [SWS_SoAd_00712] 📄 PDF

If development error detection is enabled: SoAd_IfSpecifi- cRoutingGroupTransmit () shall check that the service SoAd_Init () was previ- ously called. If the check fails, SoAd_IfSpecificRoutingGroupTransmit () shall raise the development error SOAD_E_UNINIT .

requirement SWS_SoAd_00713 [SWS_SoAd_00713] 📄 PDF

If development error detection is enabled: SoAd_IfSpecifi- cRoutingGroupTransmit () shall check parameter id for being valid (i.e. id refers a routing group that has configuration parameter SoAdRoutingGroupTxTriggerable set to TRUE ). If the check fails, SoAd_IfSpecificRoutingGroupTransmit () shall raise the development error SOAD_E_INV_ARG .

requirement SWS_SoAd_00715 [SWS_SoAd_00715] 📄 PDF

If development error detection is enabled: SoAd_Enable- SpecificRouting () shall check that the service SoAd_Init () was previously called. If the check fails, SoAd_EnableSpecificRouting () shall raise the development er- ror SOAD_E_UNINIT .

requirement SWS_SoAd_00716 [SWS_SoAd_00716] 📄 PDF

If development error detection is enabled: SoAd_Ena- bleSpecificRouting () shall check parameter id for being valid. If the check fails, SoAd_EnableSpecificRouting () shall raise the development error SOAD_E_INV_ARG .

requirement SWS_SoAd_00718 [SWS_SoAd_00718] 📄 PDF

If development error detection is enabled: SoAd_Disable- SpecificRouting () shall check that the service SoAd_Init () was previously called. If the check fails, SoAd_DisableSpecificRouting () shall raise the development error SOAD_E_UNINIT .

requirement SWS_SoAd_00719 [SWS_SoAd_00719] 📄 PDF

If development error detection is enabled: SoAd_Dis- ableSpecificRouting () shall check parameter id for being valid. If the check fails, SoAd_DisableSpecificRouting () shall raise the development error SOAD_E_INV_ARG .

requirement SWS_SoAd_00720 [SWS_SoAd_00720] 📄 PDF

At SoAd_IfSpecificRoutingGroupTransmit () SoAd shall store a trigger transmit request for each SoAdPduRouteDest that contains a refer- ence to the routing group identified by the parameter id for transmission on the socket connection identified by the parameter SoConId in the SoAd_MainFunction ().

requirement SWS_SoAd_00721 [SWS_SoAd_00721] 📄 PDF

For RoutingGroups that are referenced by a SoAdPduRout- eDest that refers to a SoAdSocketConnectionGroup SoAd shall maintain inde- pendent states for each SocketConnection that is part of the referenced SoAdSock- etConnectionGroup and handle them as if they were separate RoutingGroups.

requirement SWS_SoAd_00722 [SWS_SoAd_00722] 📄 PDF

SoAd shall handle SoAdPduRoute with SoAdPduRouteDest referring to a SoAdSocketConnectionGroup as if they were separate SoAdP- duRouteDest referring to each SocketConnection of this Group.

requirement SWS_SoAd_00723 [SWS_SoAd_00723] 📄 PDF

SoAd_Init () initializes all global variables of a Socket Adaptor instance and puts all socket connections into the state SOAD_SOCON_OFFLINE .

requirement SWS_SoAd_00724 [SWS_SoAd_00724] 📄 PDF

In case SoAd_GetSoConId () is called with a TxPduId related to a SoAdPduRoute with a fan-out (i.e. multiple SoAdPduRouteDest specified), SoAd_GetSoConId () shall skip further processings and return E_NOT_OK .

requirement SWS_SoAd_00728 [SWS_SoAd_00728] 📄 PDF

To trigger PDU data from an upper layer SoAd shall set PduIn- foType.SduDataPtr to the location of the buffer where the data shall be copied, set PduInfoType.SduDataLength to the length of this buffer and then call <Up> _[SoAd][If]TriggerTransmit ().

requirement SWS_SoAd_00729 [SWS_SoAd_00729] 📄 PDF

If SoAd_LocalIpAddrAssignmentChg () is called with the parameter IpAddrId set to a local address which is not referenced by any SoAd- SocketConnectionGroup , SoAd shall ignore the notification and return without any further action.

requirement SWS_SoAd_00730 [SWS_SoAd_00730] 📄 PDF

SoAd_TpChangeParameter () shall always reject requests by returning E_NOT_OK .

requirement SWS_SoAd_00731 [SWS_SoAd_00731] 📄 PDF

If SoAd_IfTransmit () was called with PduInfoPtr->Sdu- DataPtr set to NULL_PTR , SoAd shall use <Up>[SoAd][If]TriggerTransmit () to retrieve the PDU data from the upper layer.

requirement SWS_SoAd_00732 [SWS_SoAd_00732] 📄 PDF

SoAd shall only consider PduInfoPtr->SduDataPtr set to NULL_PTR as valid if SoAdIfTriggerTransmit is set to TRUE for the respective upper layer.

requirement SWS_SoAd_00734 [SWS_SoAd_00734] 📄 PDF

In case the nPdu feature is used for a socket connec- tion, the related PDU parameter SoAdTxPduCollectionSemantics is set to SOAD_COLLECT_LAST_IS_BEST and the upper layer doesn't provide all the re- quested data via <Up>[SoAd][If]TriggerTransmit () in the context of SoAd_- CopyTxData (), SoAd shall abort the transmission and return E_NOT_OK .

requirement SWS_SoAd_00735 [SWS_SoAd_00735] 📄 PDF

In case the nPdu feature is used for a socket connec- tion and all PDUs are configured with SoAdTxPduCollectionSemantics set to SOAD_COLLECT_LAST_IS_BEST , SoAd shall only transmit the last instance of each PDU with the same PduId in the sequence their first instances were requested for transmission.

requirement SWS_SoAd_00736 [SWS_SoAd_00736] 📄 PDF

SoAd shall reject configurations in which the transmit prop- erties (see SoAdTxPduCollectionSemantics ) of the PDUs which are as- signed to a socket connection are mixed. Furthermore all socket connnec- tions of a socket connection group shall either be refered solely by PDUs with SOAD_COLLECT_LAST_IS_BEST or solely by PDUs with SOAD_COLLECT_QUEUED semantic.

requirement SWS_SoAd_00737 [SWS_SoAd_00737] 📄 PDF

For all PDUs that have been stored for a socket connection using the nPdu feature, SoAd shall call the upper layer with the related transmit con- firmation function ( <Up>[SoAd][If]TxConfirmation ()) within the context of the SoAd_MainFunction () and with result set to 1. E_OK if the related TcpIp_UdpTransmit () call was successful, 2. E_NOT_OK if the transmission was not successful or cancelled for any other rea- son.

requirement SWS_SoAd_00738 [SWS_SoAd_00738] 📄 PDF

If development error detection is enabled: In case of a transmit request for a SoAdPduRoute that refers to a global PDU structure configured with a MetaDataItem of the type SOCKET_CONNECTION_ID_16 and the contained SoAd- PduRouteDest refers to a socket connection group, SoAd shall raise the develop- ment error SOAD_E_INV_METADATA , if the socket connection identified by PduInfo- Type.MetaDataPtr is not part of the socket connection group of the related SoAd- PduRouteDest .

requirement SWS_SoAd_00739 [SWS_SoAd_00739] 📄 PDF

In case of a transmit request for a SoAdPduRoute that refers to a global PDU structure configured with a MetaDataItem of the type SOCKET_CONNECTION_ID_16 and the contained SoAdPduRouteDest refers to a socket connection group, SoAd shall only perform the transmission on the socket connection identified by PduInfoType.MetaDataPtr instead of the whole group.

requirement SWS_SoAd_00740 [SWS_SoAd_00740] 📄 PDF

In case of a reception related to a SoAdSocketRouteDest, that refers to a global PDU structure configured with a MetaDataItem of the type SOCKET_CONNECTION_ID_16 , which is contained in a SoAdSocketRoute that refers to a socket connection group, SoAd shall use PduInfoType.MetaDataPtr to provide the socket connection identifier ( SoConId ) where the PDU was received with <Up>_[SoAd][If]RxIndication ().

requirement SWS_SoAd_00741 [SWS_SoAd_00741] 📄 PDF

Each time a socket connection state changes, SoAd shall no- tify the upper layer specified by SoAdSocketSoConModeChgNotifUpperLayerRef with the configured upper layer notification function <Up>_SoConModeChg () and the new state if the optional reference is set for the socket connection.

requirement SWS_SoAd_00742 [SWS_SoAd_00742] 📄 PDF

If a UDP socket connection is configured with a SoAdSock- etUdpAliveSupervisionTimeout and a datagram is received that passes the message acceptance filter, the timer shall be restarted with the value specified by the configuration parameter SoAdSocketUdpAliveSupervisionTimeout .

requirement SWS_SoAd_00743 [SWS_SoAd_00743] 📄 PDF

SoAd shall lock the remote address during the following situa- tions: 1. TCP socket connections not in state SOAD_SOCON_OFFLINE , 2. active receptions, 3. pending receptions of TP-PDUs, 4. active transmissions, 5. pending transmissions of the nPdu feature, 6. pending transmissions initiated via SoAd_IfRoutingGroupTransmit () or SoAd_IfSpecificRoutingGroupTransmit (). A locked remote address can't be modified by upper layers.

requirement SWS_SoAd_00744 [SWS_SoAd_00744] 📄 PDF

If development error detection is enabled and SoConId refers to a socket connection with configuration parameter SoAdSocketAutomaticSoCon- Setup set to TRUE , the function SoAd_ReleaseRemoteAddr () shall raise the devel- opment error SOAD_E_INV_ARG .

requirement SWS_SoAd_00745 [SWS_SoAd_00745] 📄 PDF

The function SoAd_ReleaseRemoteAddr () shall only imme- diately proceed if the SoConId refers to a socket connection which is not currently locked by the SoAd. If it is locked, the request shall be postponed to the SoAd_Main- Function () and executed once the lock is released.

requirement SWS_SoAd_00746 [SWS_SoAd_00746] 📄 PDF

The function SoAd_ReleaseRemoteAddr () shall reset the re- mote address of the socket connection referred by parameter SoConId to the config- ured remote address setting.

requirement SWS_SoAd_00747 [SWS_SoAd_00747] 📄 PDF

In case the nPdu feature is used for a socket connec- tion and the related PDU parameter SoAdTxPduCollectionSemantics is set to SOAD_COLLECT_LAST_IS_BEST , SoAd shall only store the transmission request in- stead of the PDU data. When SoAd needs to provide the PDU data, SoAd shall retrieve the data from the upper layer by calling <Up>[SoAd][If]TriggerTrans- mit ().

requirement SWS_SoAd_00748 [SWS_SoAd_00748] 📄 PDF

SoAd_GetAndResetMeasurementData () shall return mea- surement data for selected measurement index.

requirement SWS_SoAd_00749 [SWS_SoAd_00749] 📄 PDF

For measurement index SOAD_MEAS_DROP_TCP SoAd_- GetAndResetMeasurementData () shall return the number of dropped TCP-Port PDUs.

requirement SWS_SoAd_00750 [SWS_SoAd_00750] 📄 PDF

For measurement index SOAD_MEAS_DROP_UDP SoAd_- GetAndResetMeasurementData () shall return the number of dropped UDP-Port PDUs.

requirement SWS_SoAd_00751 [SWS_SoAd_00751] 📄 PDF

SoAd_GetAndResetMeasurementData () shall return E_NOT_OK if the requested measurement index is not supported.

requirement SWS_SoAd_00752 [SWS_SoAd_00752] 📄 PDF

SoAd_GetAndResetMeasurementData () shall additionally reset the measurement data to 0 if the MeasurementResetNeeded is true. The reset shall be applied after measurement data has been read.

requirement SWS_SoAd_00753 [SWS_SoAd_00753] 📄 PDF

SoAd_GetAndResetMeasurementData () shall reset all exist- ing measurement data to 0, if MeasurementResetNeeded is true and measurement index is set to SOAD_MEAS_ALL .

requirement SWS_SoAd_00755 [SWS_SoAd_00755] 📄 PDF

SoAd_GetAndResetMeasurementData () shall accept Mea- surementDataPtr set to NULL_PTR . In this case the measurement data shall not be copied.

requirement SWS_SoAd_00756 [SWS_SoAd_00756] 📄 PDF

If development error detection is enabled: SoAd_GetAn- dResetMeasurementData () shall check that the service SoAd_Init () was previ- ously called. If the check fails, SoAd_GetAndResetMeasurementData () shall raise the development error SOAD_E_UNINIT .

requirement SWS_SoAd_00757 [SWS_SoAd_00757] 📄 PDF

The function SoAd_GetAndResetMeasurementData () shall be pre compile time configurable On/Off by the configuration parameter: SoAdGetAn- dResetMeasurementDataApi .

requirement SWS_SoAd_00758 [SWS_SoAd_00758] 📄 PDF

If the measurement data is enabled (see SoAdGetAndReset- MeasurementDataApi ), SoAd shall increment the corresponding measurement data whenever a received PDU is discarded.

requirement SWS_SoAd_00759 [SWS_SoAd_00759] 📄 PDF

Type of error Related error code Error value No buffer space available SOAD_E_NOBUFS 0x04 Unknown PduHeader ID SOAD_E_INV_PDUHEADER_ID 0x05 Automatic TCP connection failed SOAD_E_TCP_AUTOCONNECT_FAILED 0x10

requirement SWS_SoAd_00760 [SWS_SoAd_00760] 📄 PDF

For SoAdRoutingGroups that are referenced by a SoAdSock- etRouteDest that belongs to a SoAdSocketRoute referring to a SoAdSocketCon- nectionGroup , SoAd shall maintain independent states for each socket connection that is part of the referenced SoAdSocketConnectionGroup and handle them as if they were separate SoAdRoutingGroups.

requirement SWS_SoAd_00761 [SWS_SoAd_00761] 📄 PDF

If SoAd_EnableSpecificRouting () is called with SoConId belonging to a SoAdSocketConnectionGroup and for a SoAdRoutingGroup that is referenced by a SoAdSocketRouteDest that belongs to a SoAdSocketRoute referring to the same SoAdSocketConnectionGroup and that contains more than one SoAdSocketRouteDest , SoAd shall only enable the independent state for the socket connection if: 1. the same SoAdSocketRouteDest is not active for any other socket connection of the same SoAdSocketConnectionGroup (i.e. SoAdSocketRouteDest is not already mapped to another socket connection) and 2. no SoAdRoutingGroup is enabled on the socket connection which is referenced by another SoAdSocketRouteDest of the same SoAdSocketRoute (i.e. the socket connection is not mapped to another SoAdSocketRouteDest of the same SoAdSocketRoute ). Otherwise, E_NOT_OK shall be returned.

requirement SWS_SoAd_00762 [SWS_SoAd_00762] 📄 PDF

If the function SoAd_ReleaseRemoteAddr () resets the remote address of a socket connection to a configured remote address containing wildcards and socket connection is in mode SOAD_SOCON_ONLINE , SoAd shall change the mode of the socket connection to SOAD_SOCON_RECONNECT .

requirement SWS_SoAd_00763 [SWS_SoAd_00763] 📄 PDF

If security event reporting has been enabled for the SoAd module ( SoAdEnableSecurityEventReporting = true) the respective secu- rity events shall be reported to the IdsM via the interfaces defined in AU- TOSAR_SWS_BSWGeneral [2].

requirement SWS_SoAd_00764 [SWS_SoAd_00764] 📄 PDF

ID SOAD_SEV_DROP_PDU_RX_TCP SoAd dropped a PDU. The PDU violates stack configuration and was received via a TCP socket. 50 SOAD_SEV_DROP_PDU_RX_UDP SoAd dropped a PDU. The PDU violates stack configuration and was received via a UDP socket. 6 SOAD_SEV_DROP_MSG_RX_UDP_LENGTH SoAd dropped a message. The message contains at least one PDU which violates stack configuration and was received via a UDP socket. The violation relates to the length of the PDUs compared to the overall length of the message. 7 SOAD_SEV_DROP_MSG_RX_UDP_SOCKET SoAd received a UDP message which violates stack configuration and was dropped. No suitable socket connection matching to configuration was found. 8 SOAD_SEV_REJECTED_TCP_CONNECTION SoAd rejected a TCP connection. The connection request violates stack configuration. 9

requirement SWS_SoAd_00765 [SWS_SoAd_00765] 📄 PDF

If SoAdSocketTcpAutoConnectTimeout has been config- ured for that socket connection to a value > 0 SoAd shall repeat the invocation stated in [SWS_SoAd_00590] bullet (4) only for the time specified in SoAdSocketTcpAuto- ConnectTimeout .

requirement SWS_SoAd_00766 [SWS_SoAd_00766] 📄 PDF

If SoAdSocketTcpAutoConnectTimeout has elapsed for that socket connection and the socket connection has not yet reached SOAD_SOCON_ONLINE , then 1. the runtime error SOAD_E_TCP_AUTOCONNECT_FAILED shall be raised. 2. the socket connection shall close related TcpIp socket. 3. the socket connection shall be put into SOAD_SOCON_OFFLINE . 4. the socket connection shall stay in SOAD_SOCON_OFFLINE .

requirement SWS_SoAd_00767 [SWS_SoAd_00767] 📄 PDF

Each time a socket connection state changes, SoAd shall notify the BswM of the socket connection state change with the notification function BswM_- SoAd_SoConModeChg () and the new state if SoAdSocketSoConModeChgBswMNo- tification is set to TRUE for the socket connection.

requirement SWS_SoAd_00768 [SWS_SoAd_00768] 📄 PDF

If SoAd_IsConnectionReady () is called and the referred socket connection has no socket assigned, SoAd shall return TCPIP_E_NOT_OK .

requirement SWS_SoAd_00769 [SWS_SoAd_00769] 📄 PDF

If SoAd_IsConnectionReady () is called and the referred socket connection has a socket assigned, SoAd shall call TcpIp_IsConnection- Ready () to pass RemoteAddrPtr for the corresponding socket. The return value of TcpIp_IsConnectionReady () shall be forwarded to the caller.

requirement SWS_SoAd_00770 [SWS_SoAd_00770] 📄 PDF

If development error detection is enabled: SoAd_IsConnec- tionReady () shall check parameter SoConId for being valid. If the check fails, the function shall raise the development error SOAD_E_INV_ARG .

requirement SWS_SoAd_00771 [SWS_SoAd_00771] 📄 PDF

[SWS_SoAd_00771] ⌈In case PDU header option is enabled (SoAdPduHeaderEn- able is TRUE) for a TCP socket connection, SoAd shall convert the message into a PDU within SoAd_RxIndication() according to the following: 1. extract remaining PDU payload from the received TCP segment if the previous TCP segment contained fragmented PDU payload. If the end of the TCP segment is not reached continue with (3) 2. extract remaining PDU header from the received TCP segment if the previous TCP segment contained fragmented PDU header and continue with (4). 3. extract the PDU header from the received TCP segment. If the PDU header is fragmented over this and the next TCP segment, then store the received part of the PDU header and continue with (2) for the next TCP segment. 4. select the related socket route according to the received PDU Header ID (SoAd- RxPduHeaderId). If no socket route can be found, simply discard the PDU and raise the runtime error SOAD_E_INV_PDUHEADER_ID. 5. use the length field of the PDU header to identify the length of the actual PDU and the start of the next PDU to proceed with (3) until the end of the TCP fragment is reached. If at the end of the TCP segment the PDU header or payload is not completed, it shall be remembered for the next TCP segment. ⌋

requirement SWS_SoAd_00772 [SWS_SoAd_00772] 📄 PDF

[SWS_SoAd_00772] Status: DRAFT Upstream requirements: SRS_Eth_00163 ⌈If SoAdBswModuleRef is referencing Sd, then SoAd shall process incoming PDUs according to [SWS_SoAd_00773].⌋

requirement SWS_SoAd_00774 [SWS_SoAd_00774] 📄 PDF

[SWS_SoAd_00774] Status: DRAFT Upstream requirements: SRS_Eth_00163 ⌈If Sd_RequestRoutingGroupEnable() returns E_OK, SoAd shall forward the Pdu data to the related upper layer.⌋ Note: Within Sd_RequestRoutingGroupEnable() Sd performs the ACL check. In case of success, it enables the corresponding routing group for faster processing of consecutive PDUs coming from the same remote node and it returns E_OK.

requirement SWS_SoAd_00775 [SWS_SoAd_00775] 📄 PDF

[SWS_SoAd_00775] Status: DRAFT Upstream requirements: SRS_Eth_00163 ⌈If Sd_RequestRoutingGroupEnable() returns E_NOT_OK, SoAd shall drop the received PDU.⌋ Note: Within Sd_RequestRoutingGroupEnable() Sd performs the ACL check. In case of failure, the corresponding routing group stays disabled and it returns E_NOT_OK.

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/CP_MOD_SoAd
Status
unspecified
Version
AUTOSAR/AP/record/CP_MOD_SoAd@rel:R20-11#b3e7c25e
Content hash
b3e7c25e
Source
https://www.autosar.org/fileadmin/standards/R20-11/CP/AUTOSAR_SWS_SocketAdaptor.pdf#nameddest=SWS_SoAd_00010

Themakaart

Initialisatie en status

2

Eisen

243
SWS_SoAd_00001SWS_SoAd_00101SWS_SoAd_00131SWS_SoAd_00176SWS_SoAd_00197SWS_SoAd_00198SWS_SoAd_00208SWS_SoAd_00211SWS_SoAd_00213SWS_SoAd_00214SWS_SoAd_00216SWS_SoAd_00224SWS_SoAd_00237SWS_SoAd_00264SWS_SoAd_00267SWS_SoAd_00268SWS_SoAd_00269SWS_SoAd_00270SWS_SoAd_00271SWS_SoAd_00272SWS_SoAd_00273SWS_SoAd_00274SWS_SoAd_00275SWS_SoAd_00276SWS_SoAd_00277SWS_SoAd_00278SWS_SoAd_00279SWS_SoAd_00296SWS_SoAd_00503SWS_SoAd_00504SWS_SoAd_00505SWS_SoAd_00524SWS_SoAd_00525SWS_SoAd_00527SWS_SoAd_00528SWS_SoAd_00529SWS_SoAd_00531SWS_SoAd_00532SWS_SoAd_00533SWS_SoAd_00538SWS_SoAd_00539SWS_SoAd_00540SWS_SoAd_00542SWS_SoAd_00543SWS_SoAd_00544SWS_SoAd_00545SWS_SoAd_00546SWS_SoAd_00547SWS_SoAd_00548SWS_SoAd_00549SWS_SoAd_00550SWS_SoAd_00551SWS_SoAd_00552SWS_SoAd_00553SWS_SoAd_00554SWS_SoAd_00555SWS_SoAd_00556SWS_SoAd_00557SWS_SoAd_00558SWS_SoAd_00559SWS_SoAd_00560SWS_SoAd_00561SWS_SoAd_00562SWS_SoAd_00563SWS_SoAd_00564SWS_SoAd_00565SWS_SoAd_00566SWS_SoAd_00567SWS_SoAd_00568SWS_SoAd_00569SWS_SoAd_00570SWS_SoAd_00571SWS_SoAd_00572SWS_SoAd_00573SWS_SoAd_00574SWS_SoAd_00575SWS_SoAd_00576SWS_SoAd_00577SWS_SoAd_00581SWS_SoAd_00582SWS_SoAd_00586SWS_SoAd_00587SWS_SoAd_00588SWS_SoAd_00589SWS_SoAd_00590SWS_SoAd_00591SWS_SoAd_00592SWS_SoAd_00593SWS_SoAd_00594SWS_SoAd_00595SWS_SoAd_00597SWS_SoAd_00598SWS_SoAd_00599SWS_SoAd_00600SWS_SoAd_00601SWS_SoAd_00602SWS_SoAd_00604SWS_SoAd_00605SWS_SoAd_00606SWS_SoAd_00607SWS_SoAd_00608SWS_SoAd_00609SWS_SoAd_00610SWS_SoAd_00611SWS_SoAd_00612SWS_SoAd_00613SWS_SoAd_00615SWS_SoAd_00616SWS_SoAd_00617SWS_SoAd_00618SWS_SoAd_00619SWS_SoAd_00620SWS_SoAd_00621SWS_SoAd_00622SWS_SoAd_00623SWS_SoAd_00624SWS_SoAd_00625SWS_SoAd_00626SWS_SoAd_00627SWS_SoAd_00628SWS_SoAd_00632SWS_SoAd_00633SWS_SoAd_00635SWS_SoAd_00636SWS_SoAd_00637SWS_SoAd_00638SWS_SoAd_00639SWS_SoAd_00640SWS_SoAd_00641SWS_SoAd_00642SWS_SoAd_00643SWS_SoAd_00644SWS_SoAd_00645SWS_SoAd_00646SWS_SoAd_00647SWS_SoAd_00648SWS_SoAd_00650SWS_SoAd_00651SWS_SoAd_00652SWS_SoAd_00653SWS_SoAd_00657SWS_SoAd_00658SWS_SoAd_00659SWS_SoAd_00660SWS_SoAd_00661SWS_SoAd_00662SWS_SoAd_00664SWS_SoAd_00665SWS_SoAd_00666SWS_SoAd_00667SWS_SoAd_00670SWS_SoAd_00672SWS_SoAd_00673SWS_SoAd_00675SWS_SoAd_00676SWS_SoAd_00678SWS_SoAd_00680SWS_SoAd_00683SWS_SoAd_00684SWS_SoAd_00685SWS_SoAd_00686SWS_SoAd_00687SWS_SoAd_00688SWS_SoAd_00689SWS_SoAd_00690SWS_SoAd_00691SWS_SoAd_00692SWS_SoAd_00693SWS_SoAd_00694SWS_SoAd_00695SWS_SoAd_00696SWS_SoAd_00697SWS_SoAd_00698SWS_SoAd_00699SWS_SoAd_00700SWS_SoAd_00701SWS_SoAd_00702SWS_SoAd_00703SWS_SoAd_00704SWS_SoAd_00705SWS_SoAd_00706SWS_SoAd_00707SWS_SoAd_00708SWS_SoAd_00709SWS_SoAd_00710SWS_SoAd_00712SWS_SoAd_00713SWS_SoAd_00715SWS_SoAd_00716SWS_SoAd_00718SWS_SoAd_00719SWS_SoAd_00720SWS_SoAd_00721SWS_SoAd_00722SWS_SoAd_00723SWS_SoAd_00724SWS_SoAd_00728SWS_SoAd_00729SWS_SoAd_00730SWS_SoAd_00731SWS_SoAd_00732SWS_SoAd_00734SWS_SoAd_00735SWS_SoAd_00736SWS_SoAd_00737SWS_SoAd_00738SWS_SoAd_00739SWS_SoAd_00740SWS_SoAd_00741SWS_SoAd_00742SWS_SoAd_00743SWS_SoAd_00744SWS_SoAd_00745SWS_SoAd_00746SWS_SoAd_00747SWS_SoAd_00748SWS_SoAd_00749SWS_SoAd_00750SWS_SoAd_00751SWS_SoAd_00752SWS_SoAd_00753SWS_SoAd_00754SWS_SoAd_00755SWS_SoAd_00756SWS_SoAd_00757SWS_SoAd_00758SWS_SoAd_00759SWS_SoAd_00760SWS_SoAd_00761SWS_SoAd_00762SWS_SoAd_00763SWS_SoAd_00764SWS_SoAd_00765SWS_SoAd_00766SWS_SoAd_00767SWS_SoAd_00768SWS_SoAd_00769SWS_SoAd_00770SWS_SoAd_00771SWS_SoAd_00772SWS_SoAd_00773SWS_SoAd_00774SWS_SoAd_00775

Detailweergave

Kies een item in de inhoudsopgave.

Initialisatie en status

Returns the version information.

void SoAd_GetVersionInfo(Std_VersionInfoType* versioninfo);
SoAd_Init functie

Initializes the Socket Adaptor.

void SoAd_Init(const SoAd_ConfigType* SoAdConfigPtr);

Diensten

This service closes the socket connection specified by SoConId.

Std_ReturnType SoAd_CloseSoCon(SoAd_SoConIdType SoConId, boolean abort);

Disables routing of a group of PDUs in the SoAd related to the RoutingGroup specified by parameter id. Routing of PDUs can be either forwarding of PDUs from the upper layer to a TCP or UDP socket of the TCP/IP stack specified by a PduRoute or the other way around specified by a SocketRoute.

Std_ReturnType SoAd_DisableRouting(SoAd_RoutingGroupIdType id);

Disables routing of a group of PDUs in the SoAd related to the RoutingGroup specified by parameter id only on the socket connection identified by SoConId.

Std_ReturnType SoAd_DisableSpecificRouting(SoAd_RoutingGroupIdType id, SoAd_SoConIdType SoConId);

Enables routing of a group of PDUs in the SoAd related to the RoutingGroup specified by parameter id. Routing of PDUs can be either forwarding of PDUs from the upper layer to a TCP or UDP socket of the TCP/IP stack specified by a PduRoute or the other way around specified by a SocketRoute.

Std_ReturnType SoAd_EnableRouting(SoAd_RoutingGroupIdType id);

Enables routing of a group of PDUs in the SoAd related to the RoutingGroup specified by parameter id only on the socket connection identified by SoConId.

Std_ReturnType SoAd_EnableSpecificRouting(SoAd_RoutingGroupIdType id, SoAd_SoConIdType SoConId);

Allows to read and reset detailed measurement data for diagnostic purposes. Get all MeasurementIdx's at once is not supported. SOAD_MEAS_ALL shall only be used to reset all MeasurementIdx's at once. A NULL_PTR shall be provided for MeasurementDataPtr in this case.

Std_ReturnType SoAd_GetAndResetMeasurementData(SoAd_MeasurementIdxType MeasurementIdx, boolean MeasurementResetNeeded, uint32* MeasurementDataPtr);

Retrieves the local address (IP address and port) actually used for the SoAd socket connection specified by SoConId, the netmask and default router

Std_ReturnType SoAd_GetLocalAddr(SoAd_SoConIdType SoConId, TcpIp_SockAddrType* LocalAddrPtr, uint8* NetmaskPtr, TcpIp_SockAddrType* DefaultRouterPtr);

Retrieves the physical source address of the EthIf controller used by the SoAd socket connection specified by SoConId.

Std_ReturnType SoAd_GetPhysAddr(SoAd_SoConIdType SoConId, uint8* PhysAddrPtr);

Retrieves the remote address (IP address and port) actually used for the SoAd socket connection specified by SoConId

Std_ReturnType SoAd_GetRemoteAddr(SoAd_SoConIdType SoConId, TcpIp_SockAddrType* IpAddrPtr);

Returns socket connection index related to the specified TxPduId.

Std_ReturnType SoAd_GetSoConId(PduIdType TxPduId, SoAd_SoConIdType* SoConIdPtr);

Returns current state of the socket connection specified by SoConId.

void SoAd_GetSoConMode(SoAd_SoConIdType SoConId, SoAd_SoConModeType* ModePtr);

Triggers the transmission of all If-TxPDUs identified by the parameter id after requesting the data from the related upper layer.

Std_ReturnType SoAd_IfRoutingGroupTransmit(SoAd_RoutingGroupIdType id);

Triggers the transmission of all If-TxPDUs identified by the parameter id on the socket connection specified by SoConId after requesting the data from the related upper layer.

Std_ReturnType SoAd_IfSpecificRoutingGroupTransmit(SoAd_RoutingGroupIdType id, SoAd_SoConIdType SoConId);

Requests transmission of a PDU.

Std_ReturnType SoAd_IfTransmit(PduIdType TxPduId, const PduInfoType* PduInfoPtr);

API allows to check if a communication over this socket connection is possible for a dedicated remote address. It includes that the socket connection is bound to a socket, a physical address is available for the requested remote address and if a security association is configured that a secured connection is already established.

TcpIp_ReturnType SoAd_IsConnectionReady(SoAd_SoConIdType SoConId, const TcpIp_SockAddrType* RemoteAddrPtr);

This service gets called by the TCP/IP stack if an IP address assignment changes (i.e. new address assigned or assigned address becomes invalid).

void SoAd_LocalIpAddrAssignmentChg(TcpIp_LocalAddrIdType IpAddrId, TcpIp_IpAddrStateType State);

This service opens the socket connection specified by SoConId.

Std_ReturnType SoAd_OpenSoCon(SoAd_SoConIdType SoConId);

By this API service an upper layer of the SoAd can read the currently configured hostname, i.e. FQDN option in the DHCP submodule of the TCP/IP stack.

Std_ReturnType SoAd_ReadDhcpHostNameOption(SoAd_SoConIdType SoConId, uint8* length, uint8* data);

By this API service the local IP address assignment used for the socket connection specified by SoConId is released.

Std_ReturnType SoAd_ReleaseIpAddrAssignment(SoAd_SoConIdType SoConId);

By this API service the remote address (IP address and port) of the specified socket connection shall be released, i.e. set back to the configured remote address setting.

void SoAd_ReleaseRemoteAddr(SoAd_SoConIdType SoConId);

By this API service the local IP address assignment which shall be used for the socket connection specified by SoConId is initiated.

Std_ReturnType SoAd_RequestIpAddrAssignment(SoAd_SoConIdType SoConId, TcpIp_IpAddrAssignmentTypeType, const TcpIp_SockAddrType* LocalIpAddrPtr, uint8 Netmask, const TcpIp_SockAddrType* DefaultRouterPtr);

By this API service the remote address (IP address and port) of the specified socket connection shall be set.

Std_ReturnType SoAd_SetRemoteAddr(SoAd_SoConIdType SoConId, const TcpIp_SockAddrType* RemoteAddrPtr);

This API service shall either return the socket connection index of the SoAdSocketConnection Group where the specified remote address (IP address and port) is set or assign the remote address to an unused socket connection from the same SoAdSocketConnectionGroup.

Std_ReturnType SoAd_SetUniqueRemoteAddr(SoAd_SoConIdType SoConId, const TcpIp_SockAddrType* RemoteAddrPtr, SoAd_SoConIdType* AssignedSoConIdPtr);

This service gets called if the stack put a socket into the listen mode before (as server) and a peer connected to it (as client). In detail: The TCP/IP stack calls this function after a socket was set into the listen state with TcpIp_TcpListen() and a TCP connection is requested by the peer.

Std_ReturnType SoAd_TcpAccepted(TcpIp_SocketIdType SocketId, TcpIp_SocketIdType SocketIdConnected, const TcpIp_SockAddrType* RemoteAddrPtr);

This service gets called if the stack initiated a TCP connection before (as client) and the peer (the server) acknowledged the connection set up. In detail: The TCP/IP stack calls this function after a socket was requested to connect with TcpIp_TcpConnect() and a TCP connection is confirmed by the peer. The parameter value of SocketId equals the SocketId value of the preceeding TcpIp_TcpConnect() call.

void SoAd_TcpConnected(TcpIp_SocketIdType SocketId);

of the event just encountered. Parameters (inout) None Parameters (out) None Return value None Description This service gets called if the stack encounters a condition described by the values in Event.

void SoAd_TcpIpEvent(TcpIp_SocketIdType SocketId, TcpIp_EventType Event);

Requests cancellation of an ongoing reception of a PDU in a lower layer transport protocol module.

Std_ReturnType SoAd_TpCancelReceive(PduIdType RxPduId);

Requests cancellation of an ongoing transmission of a PDU in a lower layer communication module.

Std_ReturnType SoAd_TpCancelTransmit(PduIdType TxPduId);

Request to change a specific transport protocol parameter (e.g. block size).

Std_ReturnType SoAd_TpChangeParameter(PduIdType id, TPParameterType parameter, uint16 value);

Requests transmission of a PDU.

Std_ReturnType SoAd_TpTransmit(PduIdType TxPduId, const PduInfoType* PduInfoPtr);

By this API service an upper layer of the SoAd can set the hostname, i.e. FQDN option in the DHCP submodule of the TCP/IP stack.

Std_ReturnType SoAd_WriteDhcpHostNameOption(SoAd_SoConIdType SoConId, uint8 length, const uint8* data);

Indication of a received PDU from a lower layer communication interface module.

void <Up>_ [ SoAd ][ If ] RxIndication(PduIdType RxPduId, const PduInfoType* PduInfoPtr);

Within this API, the upper layer module (called module) shall check whether the available data fits into the buffer size reported by PduInfoPtr->SduLength. If it fits, it shall copy its data into the buffer provided by PduInfoPtr->SduDataPtr and update the length of the actual copied data in PduInfoPtr->SduLength. If not, it returns E_NOT_OK without changing PduInfoPtr.

Std_ReturnType <Up>_ [ SoAd ][ If ] TriggerTransmit(PduIdType TxPduId, PduInfoType* PduInfoPtr);

The lower layer communication interface module confirms the transmission of a PDU, or the failure to transmit a PDU.

void <Up>_ [ SoAd ][ If ] TxConfirmation(PduIdType TxPduId, Std_ReturnType result);

This function is called to provide the received data of an I-PDU segment (N-PDU) to the upper layer. Each call to this function provides the next part of the I-PDU data. The size of the remaining buffer is written to the position indicated by bufferSizePtr.

BufReq_ReturnType <Up>_ [ SoAd ][ Tp ] CopyRxData(PduIdType id, const PduInfoType* info, PduLengthType* bufferSizePtr);

This function is called to acquire the transmit data of an I-PDU segment (N-PDU). Each call to this function provides the next part of the I-PDU data unless retry->TpDataState is TP_ DATARETRY. In this case the function restarts to copy the data beginning at the offset from the current position indicated by retry->TxTpDataCnt. The size of the remaining data is written to the position indicated by availableDataPtr.

BufReq_ReturnType <Up>_ [ SoAd ][ Tp ] CopyTxData(PduIdType id, const PduInfoType* info, const RetryInfoType* retry, PduLengthType* availableDataPtr);

This function is called at the start of receiving an N-SDU. The N-SDU might be fragmented into multiple N-PDUs (FF with one or more following CFs) or might consist of a single N-PDU (SF). The service shall provide the currently available maximum buffer size when invoked with TpSdu Length equal to 0.

BufReq_ReturnType <Up>_ [ SoAd ][ Tp ] StartOfReception(PduIdType id, const PduInfoType* info, PduLengthType TpSduLength, PduLengthType* bufferSizePtr);

Called after an I-PDU has been received via the TP API, the result indicates whether the transmission was successful or not.

void <Up>_ [ SoAd ][ Tp ] TpRxIndication(PduIdType id, Std_ReturnType result);

This function is called after the I-PDU has been transmitted on its network, the result indicates whether the transmission was successful or not.

void <Up>_ [ SoAd ][ Tp ] TpTxConfirmation(PduIdType id, Std_ReturnType result);

This function gets called by the SoAd if an IP address assignment related to a socket connection changes (i.e. new address assigned or assigned address becomes invalid).

void <Up>_LocalIpAddrAssignmentChg(SoAd_SoConIdType SoConId, TcpIp_IpAddrStateType State);

Notification about a SoAd socket connection state change, e.g. socket connection gets online

void <Up>_SoConModeChg(SoAd_SoConIdType SoConId, SoAd_SoConModeType Mode);

Callbacks

This service requests to copy data for transmission to the buffer indicated. This call is triggered by TcpIp_Transmit(). Note: The call to <Up>_CopyTxData() may happen in the context of Tcp Ip_Transmit().

BufReq_ReturnType SoAd_CopyTxData(TcpIp_SocketIdType SocketId, uint8* BufPtr, uint16 BufLength);

The TCP/IP stack calls this primitive after the reception of data on a socket. The socket identifier along with configuration information determines which module is to be called.

void SoAd_RxIndication(TcpIp_SocketIdType SocketId, const TcpIp_SockAddrType* RemoteAddrPtr, const uint8* BufPtr, uint16 Length);

The TCP/IP stack calls this function after the data has been acknowledged by the peer for TCP. Caveats: The upper layer might not be able to determine exactly which data bytes have been confirmed.

void SoAd_TxConfirmation(TcpIp_SocketIdType SocketId, uint16 Length);

Cyclisch

Schedules the Socket Adaptor. (Entry point for scheduling)

void SoAd_MainFunction(void);

Typen

Configuration data structure of the SoAd module.

Index to select specific measurement data

RoutingGroup identifier type for unique identification of a SoAd routing group. The size of this type depends on the maximum number of routing groups which is specified by configuration parameter SoAdRoutingGroupMax.

SoCon identifier type for unique identification of a SoAd socket connection. The size of this type depends on the maximum number of socket connections which is specified by configuration parameter SoAdSoConMax.

type to specify the state of a SoAd socket connection.

Eisen

SWS_SoAd_00001 requirement

All configuration items shall be located outside the kernel of the module.

SWS_SoAd_00101 requirement

Type of error Related error code Error value API service called before initializing the module SOAD_E_UNINIT 0x01 API service called with NULL pointer SOAD_E_PARAM_POINTER 0x02 Invalid argument SOAD_E_INV_ARG 0x03 Invalid PDU ID SOAD_E_INV_PDUID 0x06 Invalid socket address SOAD_E_INV_SOCKETID 0x07 Invalid configuration set selection SOAD_E_INIT_FAILED 0x08 Type of error Related error code Error value Invalid meta data SOAD_E_INV_METADATA 0x09

SWS_SoAd_00131 requirement

The main function for scheduling the SoAd (Entry point for scheduling) shall be called by the Schedule Manager according to the configured call period.

SWS_SoAd_00176 requirement

The call period of the SoAd_MainFunction () shall be deter- mined by configuration parameter SoAdMainFunctionPeriod .

SWS_SoAd_00197 requirement

In case PDU header option is enabled ( SoAdPduHeaderEn- able is TRUE ) for a socket connection and PDU transmission, SoAd shall insert the PDU Header with the configured HeaderId and the actual PDU length directly before the PDU data, i.e. TcpIp_UdpTransmit () or TcpIp_TcpTransmit () shall be called with a TotalLength or AvailableLength increased by the PDU Header length, the PDU Header shall be copied before the PDU data to a SoAd UDP transmit buffer (if any) and a memory specified by TcpIp within SoAd_CopyTxData () requesting the be- gin of the PDU data.

SWS_SoAd_00198 requirement

The SoAd PDU header shall consist of a 4 byte ID field for unique identification of the PDU at the receiver and a 4 byte length field specifying the data length of the PDU. Both in BigEndian byte order.

SWS_SoAd_00208 requirement

All timing parameters given as EcucFloatParamDef in unit sec- onds in the configuration, shall be converted to integer multiples of the parameter SoAdMainFunctionPeriod .

SWS_SoAd_00211 requirement

SoAd_Init () shall store the access to the configuration struc- ture for subsequent API calls.

SWS_SoAd_00213 requirement

If development error detection is enabled: SoAd_IfTrans- mit () shall check that the service SoAd_Init () was previously called. If the check fails, SoAd_IfTransmit () shall raise the development error SOAD_E_UNINIT .

SWS_SoAd_00214 requirement

If development error detection is enabled: SoAd_IfTrans- mit () shall check parameter TxPduId for being valid. If the check fails, SoAd_If- Transmit () shall raise the development error SOAD_E_INV_PDUID .

SWS_SoAd_00216 requirement

If development error detection is enabled: SoAd_Init () shall check the parameter SoAdConfigPtr for containing a valid configuration. If the check fails, SoAd_Init () shall raise the development error SOAD_E_INIT_FAILED .

SWS_SoAd_00224 requirement

If development error detection is enabled: SoAd_TpTrans- mit () shall check that the service SoAd_Init () was previously called. If the check fails, SoAd_TpTransmit () shall raise the development error SOAD_E_UNINIT .

SWS_SoAd_00237 requirement

If development error detection is enabled: SoAd_TpTrans- mit () shall check parameter TxPduId for being valid. If the check fails, SoAd_Tp- Transmit () shall raise the development error SOAD_E_INV_PDUID .

SWS_SoAd_00264 requirement

If development error detection is enabled: SoAd_RxIndica- tion () shall check that the service SoAd_Init () was previously called. If the check fails, SoAd_RxIndication () shall raise the development error SOAD_E_UNINIT .

SWS_SoAd_00267 requirement

If development error detection is enabled: SoAd_RxIndica- tion () shall check parameter SocketId for being valid. If the check fails, SoAd_- RxIndication () shall raise the development error SOAD_E_INV_SOCKETID .

SWS_SoAd_00268 requirement

If development error detection is enabled: SoAd_RxIndica- tion () shall check parameter RemoteAddrPtr for being valid. If the check fails, SoAd_RxIndication () shall raise the development error SOAD_E_INV_ARG .

SWS_SoAd_00269 requirement

If development error detection is enabled: SoAd_TxConfir- mation () shall check that the service SoAd_Init () was previously called. If the check fails, SoAd_TxConfirmation () shall raise the development error SOAD_E_UNINIT .

SWS_SoAd_00270 requirement

If development error detection is enabled: SoAd_TxConfir- mation () shall check parameter SocketId for being valid. If the check fails, SoAd_- TxConfirmation () shall raise the development error SOAD_E_INV_SOCKETID .

SWS_SoAd_00271 requirement

If development error detection is enabled: SoAd_TxConfir- mation () shall check parameter Length for being valid. If the check fails, SoAd_Tx- Confirmation () shall raise the development error SOAD_E_INV_ARG .

SWS_SoAd_00272 requirement

If development error detection is enabled: SoAd_TcpAc- cepted () shall check that the service SoAd_Init () was previously called. If the check fails, SoAd_TcpAccepted () shall raise the development error SOAD_E_UNINIT .

SWS_SoAd_00273 requirement

If development error detection is enabled: SoAd_TcpAc- cepted () shall check parameter SocketId for being valid. If the check fails, SoAd_- TcpAccepted () shall raise the development error SOAD_E_INV_SOCKETID .

SWS_SoAd_00274 requirement

If development error detection is enabled: SoAd_TcpCon- nected () shall check that the service SoAd_Init () was previously called. If the check fails, SoAd_TcpConnected () shall raise the development error SOAD_E_UNINIT .

SWS_SoAd_00275 requirement

If development error detection is enabled: SoAd_TcpCon- nected () shall check parameter SocketId for being valid. If the check fails, SoAd_- TcpConnected () shall raise the development error SOAD_E_INV_SOCKETID .

SWS_SoAd_00276 requirement

If development error detection is enabled: SoAd_- TcpIpEvent () shall check that the service SoAd_Init () was previously called. If the check fails, SoAd_TcpIpEvent () shall raise the development error SOAD_E_UNINIT .

SWS_SoAd_00277 requirement

If development error detection is enabled: SoAd_- TcpIpEvent () shall check parameter SocketId for being valid. If the check fails, SoAd_TcpIpEvent () shall raise the development error SOAD_E_INV_SOCKETID .

SWS_SoAd_00278 requirement

If development error detection is enabled: SoAd_- TcpIpEvent () shall check parameter Event for being valid. If the check fails, SoAd_- TcpIpEvent () shall raise the development error SOAD_E_INV_ARG .

SWS_SoAd_00279 requirement

If development error detection is enabled: SoAd_LocalIpAd- drAssignmentChg () shall check that the service SoAd_Init () was previously called. If the check fails, SoAd_LocalIpAddrAssignmentChg () shall raise the development error SOAD_E_UNINIT .

SWS_SoAd_00296 requirement

These requirements are not applicable to this specifica- tion.

SWS_SoAd_00503 requirement

Module Header File Imported Type ComStack_Types.h BufReq_ReturnType ComStack_Types.h PduIdType ComStack_Types.h PduInfoType ComStack_Types.h PduLengthType ComStack_Types.h RetryInfoType ComStack_Types.h TPParameterType ComStack_Types ComStack_Types.h TpDataStateType IdsM IdsM_Types.h IdsM_SecurityEventIdType Std_Types.h Std_ReturnType Std Std_Types.h Std_VersionInfoType TcpIp.h TcpIp_DomainType TcpIp.h TcpIp_EventType TcpIp.h TcpIp_IpAddrAssignmentType TcpIp.h TcpIp_IpAddrStateType TcpIp.h TcpIp_LocalAddrIdType TcpIp.h TcpIp_ParamIdType TcpIp.h TcpIp_ProtocolType TcpIp.h TcpIp_ReturnType TcpIp.h TcpIp_SockAddrType TcpIp.h TcpIp_SocketIdType TcpIp TcpIp.h TcpIp_StateType

SWS_SoAd_00504 requirement

Det_ReportRuntimeError Det.h Service to report runtime errors. If a callout has been configured then this callout shall be called. TcpIp_<Up>GetSocket TcpIp.h By this API service the TCP/IP stack is requested to allocate a new socket. Note: Each accepted incoming TCP connection also allocates a socket resource. TcpIp_Bind TcpIp.h By this API service the TCP/IP stack is requested to bind a UDP or TCP socket to a local resource. TcpIp_ChangeParameter TcpIp.h By this API service the TCP/IP stack is requested to change a parameter of a socket. E.g. the Nagle algorithm may be controlled by this API. TcpIp_Close TcpIp.h By this API service the TCP/IP stack is requested to close the socket and release all related resources. TcpIp_GetCtrlIdx TcpIp.h TcpIp_GetCtrlIdx returns the index of the controller related to LocalAddrId. TcpIp_GetIpAddr TcpIp.h Obtains the local IP address actually used by Local AddrId, the netmask and default router API Function Header File Description TcpIp_GetPhysAddr TcpIp.h Obtains the physical source address used by the EthIf controller implicitly specified via LocalAddrId. TcpIp_GetRemotePhysAddr TcpIp.h TcpIp_GetRemotePhysAddr queries the IP/physical address translation table specified by CtrlIdx and returns the physical address related to the IP address specified by IpAddrPtr. In case no physical address can be retrieved and parameter initRes is TRUE, address resolution for the specified IP address is initiated on the local network. TcpIp_ReleaseIpAddrAssignment TcpIp.h By this API service the local IP address assignment for the IP address specified by LocalAddrId shall be released. TcpIp_RequestComMode TcpIp.h By this API service the TCP/IP stack is requested to change the TcpIp state of the communication network identified by EthIf controller index. TcpIp_RequestIpAddrAssignment TcpIp.h By this API service the local IP address assignment for the IP address specified by LocalAddrId shall be initiated. TcpIp_TcpConnect TcpIp.h By this API service the TCP/IP stack is requested to establish a TCP connection to the configured peer. TcpIp_TcpListen TcpIp.h By this API service the TCP/IP stack is requested to listen on the TCP socket specified by the socket identifier. TcpIp_TcpReceived TcpIp.h By this API service the reception of socket data is confirmed to the TCP/IP stack. TcpIp_TcpTransmit TcpIp.h This service requests transmission of data via TCP to a remote node. The transmission of the data is decoupled. Note: The TCP segment(s) are sent dependent on runtime factors (e.g. receive window) and configuration parameter (e.g. Nagle algorithm) . TcpIp_UdpTransmit TcpIp.h This service transmits data via UDP to a remote node. The transmission of the data is immediately performed with this function call by forwarding it to EthIf.

SWS_SoAd_00505 requirement

The SoAd shall provide sufficient buffers to store received data which can't be forwarded to the upper layer within the context of SoAd_RxIndica- tion () as well as buffers for data which can (or should) not be forwarded to TcpIp.

SWS_SoAd_00524 requirement

If SoAdSocketMsgAcceptanceFilterEnabled is TRUE , SoAd shall only accept TCP connections or UDP datagrams from remote nodes with a source address that matches the remote address specified in the socket connec- tion (either via configuration parameters SoAdSocketRemoteIpAddress and SoAd- SocketRemotePort or set online with SoAd_SetRemoteAddr () API).

SWS_SoAd_00525 requirement

A remote address matches if both IP address and port match. The IP addresses match if they are identical or if the specified IP address is set to TCPIP_IPADDR_ANY ( TCPIP_IP6ADDR_ANY ). The port matches if they are identical or if the specified port is set to TCPIP_PORT_ANY .

SWS_SoAd_00527 requirement

SoAd shall reset the remote address to the configured remote address (or unset the remote address in case no remote address has been configured) within SoAd_MainFunction () when a socket connection is closed.

SWS_SoAd_00528 requirement

If development error detection is enabled: In case SoAd_OpenSoCon () is called for a socket connection with configuration param- eter SoAdSocketAutomaticSoConSetup set to " TRUE " the development error SOAD_E_INV_ARG shall be raised.

SWS_SoAd_00529 requirement

If development error detection is enabled: In case SoAd_Clos- eSoCon () is called for a socket connection with configuration parameter SoAdSock- etAutomaticSoConSetup set to " TRUE " the development error SOAD_E_INV_ARG shall be raised.

SWS_SoAd_00531 requirement

If development error detection is enabled and SoConId refers to a socket connection with configuration parameter SoAdSocketAutomaticSoCon- Setup set to TRUE , the function SoAd_SetRemoteAddr () shall raise the development error SOAD_E_INV_ARG .

SWS_SoAd_00532 requirement

The function SoAd_SetRemoteAddr () shall only proceed if SoConId refers to a socket connection which is not currently locked by the SoAd. If it is locked, the request shall be rejected and E_NOT_OK shall be returned.

SWS_SoAd_00533 requirement

The function SoAd_SetRemoteAddr () shall set the remote ad- dress of the socket connection referred by parameter SoConId according to the IP address and port specified by parameter RemoteAddrPtr.

SWS_SoAd_00538 requirement

For each configurable interface SoAd shall determine the func- tion name by replacing the tag <Up> with the module name abbreviation of the related upper layer module (as specified in the SoAdBSWModules container using the SoAd- BswModuleRef reference parameter) and using the two infix according to the configu- ration parameters SoAdUseCallerInfix and SoAdUseTypeInfix.

SWS_SoAd_00539 requirement

For the transmission of a PDU requested by an upper layer using the IF-API, the SoAd shall 1. Identify the related socket connection and PDU route by using the TxPduId pro- vided at SoAd_IfTransmit (). 2. Call the related TcpIp transmit function depending on the connection type if the PDU length > 0 or SoAdPduHeaderEnable is TRUE , otherwise SoAd shall Skip further processing and return with E_NOT_OK .

SWS_SoAd_00540 requirement

In case of a UDP socket connection the SoAd shall (if not speci- fied otherwise) call TcpIp_UdpTransmit () with SocketId and remote address spec- ified in the SocketConnection and the PDU length specified in the SoAd_IfTrans- mit () call as TotalLength .

SWS_SoAd_00542 requirement

In case of a TCP socket connection the SoAd shall call TcpIp_TcpTransmit () with SocketId specified in the SocketConnection, the PDU length specified in the SoAd_IfTransmit () call, as AvailableLength and ForceRetrieve set to TRUE .

SWS_SoAd_00543 requirement

The TcpIp module will retrieve the PDU data within the context of the TcpIp transmit call by using SoAd_CopyTxData () where the SoAd shall copy (the requested part of) the PDU to the memory specified by parameter BufPtr .

SWS_SoAd_00544 requirement

In case of a UDP socket connection the SoAd shall call the upper layer with the configured transmit confirmation function ( <Up>[SoAd][If]Tx- Confirmation ()) with result set to E_OK within the next SoAd_MainFunction () after the latest TcpIp_UdpTransmit () call returning successfully.

SWS_SoAd_00545 requirement

In case of a TCP socket connection the SoAd shall call the upper layer with the configured transmit confirmation function ( <Up>[SoAd][If]Tx- Confirmation ()) with result set to E_OK within the SoAd_TxConfirmation () call- back function after all PDU data (from one or multiple transmit requests) have been confirmed for transmission.

SWS_SoAd_00546 requirement

In case SoAdTxUdpTriggerMode is set to TRIGGER_NEVER for any PDU route ( SoAdPduRouteDest ) related to a socket connection and all upper layers belonging to the related socket connection have SoAdTxUpperLayerType set to "IF", SoAd shall use the nPdu feature for this socket connection.

SWS_SoAd_00547 requirement

In case the nPdu feature is used for a socket connection and SoAdTxUdpTriggerMode is set to TRIGGER_NEVER for the actual PDU ( SoAdP- duRouteDest ), SoAd shall store the PDU for the socket connection (instead of calling TcpIp_UdpTransmit ()).

SWS_SoAd_00548 requirement

In case the nPdu feature is used for a socket connection and SoAdTxUdpTriggerMode is set to TRIGGER_ALWAYS for the current PDU ( SoAdP- duRouteDest ) and the resulting PDU data and headers don't exceed SoAdSocket- nPduUdpTxBufferMin , SoAd shall transmit all PDUs stored for the socket connection (if any) and the current PDU by calling TcpIp_UdpTransmit ().

SWS_SoAd_00549 requirement

In case the nPdu feature is used for a socket connection and SoAdTxUdpTriggerMode is set to TRIGGER_NEVER for the current PDU ( SoAdP- duRouteDest ) and the resulting PDU data and headers would exceed SoAdSocket- nPduUdpTxBufferMin , SoAd shall first transmit all PDUs stored for the socket con- nection by calling TcpIp_UdpTransmit () and then store the PDU for the socket con- nection.

SWS_SoAd_00550 requirement

Within SoAd_MainFunction () SoAd shall transmit all PDUs stored for a socket connection (if any) by calling TcpIp_UdpTransmit () if the nPdu specific timer expired.

SWS_SoAd_00551 requirement

For the transmission of a PDU requested by an upper layer using the TP-API, the SoAd shall 1. Skip further processing and return with E_NOT_OK if the PDU length is 0. 2. Identify the related socket connection and PDU route by using the TxPduId pro- vided at SoAd_TpTransmit (). 3. Store the TP transmission request for further processing in the SoAd_Main- Function ().

SWS_SoAd_00552 requirement

In the SoAd_MainFunction () the SoAd shall check for pend- ing TP transmission requests and process a pending request as specified below: 1. Query the available amount of data at the upper layer by calling the configurable callback function <Up>_[SoAd][Tp]CopyTxData () with PduInfoType.Sdu- Length = 0. 2. Depending on the connection type: retrieve data and call the related TcpIp trans- mit function.

SWS_SoAd_00553 requirement

In case of a UDP socket connection the SoAd shall 1. retrieve all available data from the upper layer to a SoAd TP transmit buffer via the configurable callback function <Up>_[SoAd][Tp]CopyTxData () with PduIn- foType.SduLength set to the value returned by availableDataPtr of the previ- ous call and 2. call TcpIp_UdpTransmit () with SocketId and remote address specified in the SocketConnection and the PDU length specified in the SoAd_TpTransmit () call as TotalLength after all data have been successfully retrieved within one or multiple SoAd main function execution cycles.

SWS_SoAd_00554 requirement

In case of a TCP socket connection the SoAd shall call TcpIp_TcpTransmit () with SocketId specified in the SocketConnection, the PDU length set to the value returned by availableDataPtr of the previous call to <Up>_- [SoAd][Tp]CopyTxData () as AvailableLength and ForceRetrieve set to FALSE .

SWS_SoAd_00555 requirement

In case of a UDP socket connection the SoAd shall copy (the requested part of) the PDU from the SoAd TP transmit buffer to the memory specified by parameter BufPtr within SoAd_CopyTxData ().

SWS_SoAd_00556 requirement

In case of a TCP socket connection the SoAd shall forward the request to the related upper layer by calling <Up>_[SoAd][Tp]CopyTxData () to copy (the requested part of) the PDU to the memory specified by parameter BufPtr within SoAd_CopyTxData ().

SWS_SoAd_00557 requirement

In case of a UDP socket connection the SoAd shall call the upper layer with the configured transmit confirmation function <Up>_[SoAd][Tp] TxConfirmation () and E_OK as result within the SoAd_MainFunction () after TcpIp_UdpTransmit () returns with TCPIP_OK .

SWS_SoAd_00558 requirement

In case of a TCP socket connection configured with SoAdSock- etTcpImmediateTpTxConfirmation set to FALSE the SoAd shall call the upper layer with the configured transmit confirmation function <Up>_[SoAd][Tp]TxCon- firmation () and E_OK as result within the SoAd_TxConfirmation () callback func- tion after all TP PDU data have been confirmed for transmission.

SWS_SoAd_00559 requirement

In case PDU header option is enabled ( SoAdPduHeaderEn- able is TRUE ) for a socket connection, SoAd shall convert the message into a PDU within SoAd_RxIndication () according to the following: 1. assemble the PDU Header into a SoAd receive buffer if it is fragmented in multiple TCP segments 2. extract the PDU Header from the received message 3. select the related socket route according to the received PDU Header ID ( SoAd- RxPduHeaderId ); if no socket route can be found, simply discard the PDU and raise the runtime error SOAD_E_INV_PDUHEADER_ID . 4. use the length field of the PDU Header to identify the length of the actual PDU and the start of the next PDU to proceed with (2) until the end of the message is reached. If the remainder is smaller than a PDU Header or the indicated length within the header SoAd shall stop processing and ignore the rest of the message.

SWS_SoAd_00560 requirement

If SoAd_IfTransmit () is called with TxPduId specifying a SoAdPduRouteDest which belongs only to inactive RoutingGroups, SoAd shall al- ways skip the transmission for this SoAdPduRouteDest and shall consider the trans- mission as successful unless all SoAdPduRouteDest of a SoAdPduRoute belong only to inactive RoutingGroups. In the latter case SoAd shall return E_NOT_OK .

SWS_SoAd_00561 requirement

If SoAd_TpTransmit () is called with TxPduId specifying a SoAdPduRouteDest which belongs only to inactive RoutingGroups, SoAd shall al- ways skip the transmission for this SoAdPduRouteDest and shall consider the trans- mission as successful unless all SoAdPduRouteDest of a SoAdPduRoute belong only to inactive RoutingGroups. In the latter case SoAd shall return E_NOT_OK .

SWS_SoAd_00562 requirement

For the reception of a message from an UDP or TCP socket and forwarding of the received data as PDU to the related upper layer the SoAd shall 1. Identify the related socket connection and socket routes by using the SocketId provided at SoAd_RxIndication () 2. Filter messages according to the message acceptance policy 3. Convert the message into a PDU 4. Skip further processing if PDU length is 0 and ( SoAdPduHeaderEnable is FALSE or SoAdRxUpperLayerType is TP) 5. Call the upper layer type related reception functions of the configured upper layer module depending on the SoAdRxUpperLayerType specified in SoAdSock- etRouteDest configuration

SWS_SoAd_00563 requirement

In case PDU header option is disabled ( SoAdPduHeaderEn- able is FALSE ) for a socket connection, SoAd shall convert the received UDP or TCP message 1:1 into a PDU within SoAd_RxIndication (), i.e. each TCP segment and UDP message forms a separate PDU.

SWS_SoAd_00564 requirement

In case of a TCP socket connection the SoAd shall confirm the reception of all data either forwarded to the upper layer or finally handled by SoAd (e.g. discarded data or processed PDU Header) by calling TcpIp_TcpReceived () within SoAd_RxIndication () or SoAd_MainFunction () respectively.

SWS_SoAd_00565 requirement

SoAd shall process TP- and IF-PDUs independently and within each type according to the received order per socket connection.

SWS_SoAd_00566 requirement

SoAd shall preserve the order of received data when using a SoAd receive buffer.

SWS_SoAd_00567 requirement

SoAd shall perform the following further actions within the SoAd_RxIndication () function for reception of a PDU to an upper layer using the IF-API: 1. assemble all data of a fragmented IF-PDU into a SoAd receive buffer if PDU Header is used 2. call <Up>_[SoAd][If]RxIndication () of the related upper layer module (with RxPduId set to the ID specified by the upper layer module for the PDU referenced by SoAdRxPduRef) for each completely received PDU 3. dispatch the next IF-PDU (if any) if PDU Header mode is used

SWS_SoAd_00568 requirement

SoAd shall perform the following further actions within the SoAd_RxIndication () function for reception of a PDU from a socket connection with PDU Header mode disabled to an upper layer using the TP-API: 1. if the SoAd receive buffer does not contain any TP data for this socket connection (a) Query the available amount of data at the upper layer by calling the config- urable callback function <Up>_[SoAd][Tp]CopyRxData () with PduInfo- Type.SduLength = 0. (b) If not all data can be processed (i.e. forwarded to an upper layer or stored in a SoAd receive buffer), discard all received data and skip further processing. (c) Copy all received data which can be accepted by the upper layer module determined at (a) to the upper layer by calling <Up>_[SoAd][Tp]CopyRx- Data () (d) Copy all remaining data (i.e. data which are received but not delivered to the upper layer) to a SoAd receive buffer for later processing by SoAd_- MainFunction () 2. if the SoAd receive buffer already contains TP data for this socket connection and is able to store all (newley) received data: copy all received data to the SoAd receive buffer for later processing by SoAd_MainFunction ()

SWS_SoAd_00569 requirement

In the SoAd_MainFunction () the SoAd shall process as spec- ified below if the SoAd receive buffer contains TP data for a socket connection with PDU Header mode disabled: 1. Query the available amount of data at the upper layer by calling the configurable callback function <Up>_[SoAd][Tp]CopyRxData () with PduInfoType.Sdu- Length = 0. 2. Copy all data belonging to this socket connection from the SoAd receive buffer which can be accepted by the upper layer module determined at (1) to the upper layer by calling <Up>_[SoAd][Tp]CopyRxData ()

SWS_SoAd_00570 requirement

If <Up>_[SoAd][Tp]StartOfReception () or <Up>_- [SoAd][Tp]CopyRxData () return with BUFREQ_E_NOT_OK for a socket connection with PDU Header mode disabled, SoAd shall (a) disable further transmission or re- ception for this socket connection (i.e. new transmit requests shall be rejected with E_NOT_OK and received messages shall simply be discarded) and (b) close the socket connection in the next SoAd_MainFunction ().

SWS_SoAd_00571 requirement

SoAd shall perform the following further actions within the SoAd_RxIndication () function for reception of a PDU from a socket connection with PDU Header mode enabled to an upper layer using the TP-API: 1. if no TP reception is in progress for the related socket connection (a) After reception of a complete PDU Header, call <Up>_[SoAd][Tp] StartOfReception () of the related upper layer module with RxPduId set to the ID specified by the upper layer module for the PDU referenced by SoAdRxPduRef , set TpSduLength to the length specified in the PDU Header, and set PduInfoType.SduDataPtr and PduInfoType.Sdu- Length to provide already received PDU data to the upper layer. (b) if not all data can be processed (i.e. forwarded to an upper layer or stored in a SoAd receive buffer), discard all received data, call <Up>_[SoAd][Tp] RxIndication ()with the same RxPduId as used at <Up>_[SoAd][Tp] StartOfReception () and result set to E_NOT_OK and skip further pro- cessing (c) call <Up>_[SoAd][Tp]CopyRxData () of the related upper layer module with the same RxPduId as used at <Up>_[SoAd][Tp]StartOfRecep- tion () and PduInfoType.SduDataPtr pointing to the PDU data pro- vided by SoAd_RxIndication () and PduInfoType.SduLength set to minimum of the received PDU data and the available receive buffer in the upper layer module specified by bufferSizePtr at <Up>_[SoAd][Tp] StartOfReception ()) (d) call <Up>_[SoAd][Tp]RxIndication () if the complete PDU has been forwarded to the upper layer, otherwise copy all received data which could not be forwarded to the upper layer to a SoAd receive buffer for later pro- cessing by SoAd_MainFunction () 2. if a TP reception is in progress for the related socket connection and the related SoAd receive buffer is able to store all received data: copy all received data to the related SoAd receive buffer for later processing by SoAd_MainFunction ()

SWS_SoAd_00572 requirement

If <Up>_[SoAd][Tp]StartOfReception () does not return BUFREQ_OK for a socket connection with PDU Header mode enabled, SoAd shall sim- ply discard all data of the PDU.

SWS_SoAd_00573 requirement

If <Up>_[SoAd][Tp]CopyRxData () does not return BUFREQ_OK for a socket connection with PDU Header mode enabled, SoAd shall terminate the TP receive session, simply discard all data of the PDU and call <Up>_[SoAd][Tp]RxIndication () with E_NOT_OK .

SWS_SoAd_00574 requirement

In the SoAd_MainFunction () the SoAd shall process as spec- ified below if a TP reception is in progress for a socket connection with PDU Header mode enabled: 1. Query the available amount of data at the upper layer by calling the configurable callback function <Up>_[SoAd][Tp]CopyRxData () with PduInfoType.Sdu- Length = 0. 2. Copy all data belonging to this socket connection from the SoAd receive buffer which can be accepted by the upper layer module determined at (1) to the upper layer by calling <Up>_[SoAd][Tp]CopyRxData () 3. call <Up>_[SoAd][Tp]RxIndication () if the complete PDU has been for- warded to the upper layer and dispatch the next TP-PDU (if any)

SWS_SoAd_00575 requirement

SoAd shall store a cancellation request when called with SoAd_TpCancelReceive () and SoAd_TpCancelTransmit (), but handle the re- quest only in the SoAd_MainFunction () respecting the connection loss and recovery policy.

SWS_SoAd_00576 requirement

If SoAd_TpCancelReceive () or SoAd_TpCancelTrans- mit () is called for a PDU where TP reception or TP transmission is not in progress, SoAd shall ignore the request and return E_NOT_OK .

SWS_SoAd_00577 requirement

Within SoAd_MainFunction (), SoAd shall close the socket connection for any communication cancelation request related to an active TP trans- mission.

SWS_SoAd_00581 requirement

Within SoAd_MainFunction (), SoAd shall close the socket connection for any communication cancelation request related to an active TP recep- tion.

SWS_SoAd_00582 requirement

For a UDP socket connection of type automatic (i.e. config- uration parameter SoAdSocketAutomaticSoConSetup set to TRUE ) which uses a wildcard in the configured remote address (i.e. an ANY-String for IP address or port), SoAd shall (a) change the state of the socket connection to SOAD_SOCON_RECONNECT and (b) reset the remote address to the configured remote address after a PDU trans- mission, directly before the related transmit confirmation function is called (or would be called if such a function is not configured).

SWS_SoAd_00586 requirement

SoAd shall automatically reestablish a socket connection which is in the connection state SOAD_SOCON_RECONNECT within SoAd_MainFunction () - independent of the configuration parameter SoAdSocketAutomaticSoConSetup , i.e. connection shall be reestablished even if the parameter is set to FALSE . Recon- nection shall be done by considering configuration parameter SoAdSocketTcpIni- tiate .

SWS_SoAd_00587 requirement

SoAd shall return E_NOT_OK for TP-PDU Tx requests received at SoAd_TpTransmit () within connection reestablishment.

SWS_SoAd_00588 requirement

SoAd shall store a request to open or close a socket connection when called with SoAd_OpenSoCon () and SoAd_CloseSoCon () respectively, but han- dle the request only in the SoAd_MainFunction () respecting the connection setup and shutdown policy.

SWS_SoAd_00589 requirement

In the SoAd_MainFunction (), SoAd shall try to open each socket connection which fulfills all of the following criterias: 1. No TcpIp socket is assigned to the socket connection 2. Open is either (a) explicitly requested by a previous SoAd_OpenSoCon () call which has not been revoked by a following SoAd_CloseSoCon () call or (b) im- plicitly requested when SoAdSocketAutomaticSoConSetup is TRUE 3. remote address is set (either specified by configuration or set via the function SoAd_SetRemoteAddr ()) 4. local IP address is assigned, i.e. SoAd_LocalIpAddrAssign- mentChg () has been called with the related LocalAddrId and TCPIP_IPADDR_STATE_ASSIGNED as State.

SWS_SoAd_00590 requirement

SoAd shall perform the following actions within SoAd_Main- Function () to open either a UDP socket connection which is part of a socket con- nection group containing a single socket connection (i.e. there is only one socket connection in the socket connection group configuration container) or a TCP socket connection with SoAdSocketTcpInitiate set to TRUE : 1. Get an appropriate socket from TcpIp by calling TcpIp_SoAdGetSocket () with the TcpIp_DomainType implicitly specified by SoAdSocketLocalAddress- Ref , and the protocol type specified by SoAdSocketProtocol . 2. Change the socket specific parameters according to [SWS_SoAd_00689]. 3. Bind the socket to the local address and port by calling TcpIp_Bind () with the local address identifier specified by SoAdSocketLocalAddressRef and local port specified by SoAdSocketLocalPort . 4. In case of a TCP socket initiate the TCP connection by calling TcpIp_TcpCon- nect ().

SWS_SoAd_00591 requirement

Within SoAd_MainFunction () and after successfully perform- ing the open actions, SoAd shall change the state of the socket connection to SOAD_SOCON_ONLINE in case of a UDP socket and either SoAdSocketUdpLis- tenOnly is set to TRUE or a remote address is set by a value that does not contain any wildcards.

SWS_SoAd_00592 requirement

Within SoAd_RxIndication () and before analyzing or for- warding of any message data, SoAd shall (a) overwrite the remote address parts specified with wildcards (e.g. remote IP address set to TCPIP_IPADDR_ANY ) with the related source address parts of the received message and (b) change the state of the socket connection to SOAD_SOCON_ONLINE in case all of the following conditions are true: 1. Current connection state is not SOAD_SOCON_ONLINE 2. UDP socket 3. SoAdSocketUdpListenOnly is set to FALSE 4. SoAdSocketMsgAcceptanceFilterEnabled is set to TRUE 5. Remote address is set, but contains wildcards 6. Received message is accepted according to the message acceptance policy

SWS_SoAd_00593 requirement

Within SoAd_TcpConnected () SoAd shall change the state of the socket connection to SOAD_SOCON_ONLINE in case all of the following conditions are true: 1. Current connection state is not SOAD_SOCON_ONLINE 2. TCP socket 3. SoAdSocketTcpInitiate is set to TRUE

SWS_SoAd_00594 requirement

At SoAd_TcpAccepted (), SoAd shall perform the following ac- tions if the TCP SoAdSocketConnectionGroup related to SocketId has SoAd- SocketTcpInitiate set to FALSE : 1. choose one of the socket connections using the best match algorithm (see [SWS_SoAd_00680]), and either proceed with the selected socket connection or skip further processing and return with E_NOT_OK if no match can be found 2. overwrite the remote address parts specified with wildcards (e.g. remote IP ad- dress set to TCPIP_IPADDR_ANY ) with the related source address parts of the received message if the remote address set for the socket connection contains wildcards 3. assign the TcpIp socket used for the established connection and provided as parameter SocketIdConnected to the chosen socket connection, 4. change the state of this socket connection to SOAD_SOCON_ONLINE and return E_OK

SWS_SoAd_00595 requirement

For socket connection with PDU Header mode disabled ( SoAd- PduHeaderEnable = FALSE ) and an upper layer with TP-API, SoAd shall call <Up> _[SoAd][Tp]StartOfReception () with TpSduLength = 0 at the end of the con- nection setup.

SWS_SoAd_00597 requirement

Each time a socket connection state changes, SoAd shall notify the upper layer of a socket connection state change with the configured upper layer notification function <Up>_SoConModeChg () and the new state if SoAdSocketSo- ConModeChgNotification is set to TRUE for the socket connection.

SWS_SoAd_00598 requirement

Each time the IP address assignment related to a socket con- nection changes, SoAd shall notify the upper layer of the IP address assignment change with the configured upper layer notification function <Up>_LocalIpAddrAs- signmentChg () and the new address state if SoAdSocketIpAddrAssignmentChg- Notification is set to TRUE for the socket connection.

SWS_SoAd_00599 requirement

The SoAd shall provide sufficient buffers to store data which temporarily can't be forwarded to TcpIp, e.g. SoAd UDP TP transmit buffers or Udp- TxBuffer, nPduUdpTxBuffer.

SWS_SoAd_00600 requirement

If a PDU is received according to SoAdSocketRouteDest which belongs only to inactive RoutingGroups, SoAd shall simply discard the PDU.

SWS_SoAd_00601 requirement

SoAd shall maintain the state of each configured routing group and activate or deactivate the state at initialization depending on the configuration pa- rameter SoAdRoutingGroupIsEnabledAtInit .

SWS_SoAd_00602 requirement

SoAd shall support more than one SoAdPduRouteDest per SoAdPduRoute for upper layers of If-type, i.e. a single IF-PDU can be transmitted via multiple socket connections.

SWS_SoAd_00604 requirement

In the SoAd_MainFunction (), SoAd shall close each socket connection which fulfills all of the following criteria: 1. Current connection state is not SOAD_SOCON_OFFLINE 2. Close is explicitly requested by a previous SoAd_CloseSoCon () call 3. No upper layer requested to keep the socket connection open at the time of the SoAd_CloseSoCon () call (i.e. SoAd_CloseSoCon () has been called as often as SoAd_OpenSoCon ()) or SoAd_CloseSoCon () has been called with abort set to TRUE .

SWS_SoAd_00605 requirement

If development error detection is enabled: SoAd_TpCancel- Transmit () shall check that the service SoAd_Init () was previously called. If the check fails, SoAd_TpCancelTransmit () shall raise the development error SOAD_E_UNINIT .

SWS_SoAd_00606 requirement

If development error detection is enabled: SoAd_TpCancel- Transmit () shall check parameter TxPduId for being valid. If the check fails, SoAd_- TpCancelTransmit () shall raise the development error SOAD_E_INV_PDUID .

SWS_SoAd_00607 requirement

If development error detection is enabled: SoAd_TpCancel- Receive () shall check that the service SoAd_Init () was previously called. If the check fails, SoAd_TpCancelReceive () shall raise the development error SOAD_E_UNINIT .

SWS_SoAd_00608 requirement

If development error detection is enabled: SoAd_TpCancel- Receive () shall check parameter RxPduId for being valid. If the check fails, SoAd_- TpCancelReceive () shall raise the development error SOAD_E_INV_PDUID .

SWS_SoAd_00609 requirement

If development error detection is enabled: SoAd_GetSo- ConId () shall check that the service SoAd_Init () was previously called. If the check fails, SoAd_GetSoConId () shall raise the development error SOAD_E_UNINIT .

SWS_SoAd_00610 requirement

If development error detection is enabled: SoAd_GetSo- ConId () shall check parameter TxPduId for being valid. If the check fails, SoAd_- GetSoConId () shall raise the development error SOAD_E_INV_PDUID .

SWS_SoAd_00611 requirement

If development error detection is enabled: SoAd_OpenSoCon () shall check parameter SoConId for being valid. If the check fails, SoAd_OpenSoCon () shall raise the development error SOAD_E_INV_ARG .

SWS_SoAd_00612 requirement

If development error detection is enabled: SoAd_CloseSo- Con () shall check parameter SoConId for being valid. If the check fails, SoAd_Clos- eSoCon () shall raise the development error SOAD_E_INV_ARG .

SWS_SoAd_00613 requirement

If development error detection is enabled: SoAd_RequestI- pAddrAssignment () shall check that the service SoAd_Init () was previously called. If the check fails, SoAd_RequestIpAddrAssignment () shall raise the development error SOAD_E_UNINIT .

SWS_SoAd_00615 requirement

If development error detection is enabled: SoAd_OpenSoCon () shall check that the service SoAd_Init () was previously called. If the check fails, SoAd_OpenSoCon () shall raise the development error SOAD_E_UNINIT .

SWS_SoAd_00616 requirement

If development error detection is enabled: SoAd_CloseSo- Con () shall check that the service SoAd_Init () was previously called. If the check fails, SoAd_CloseSoCon () shall raise the development error SOAD_E_UNINIT .

SWS_SoAd_00617 requirement

If development error detection is enabled, SoAd_RequestI- pAddrAssignment () shall check parameter SoConId for being valid. If the check fails, SoAd_RequestIpAddrAssignment () shall raise the development error SOAD_E_INV_ARG .

SWS_SoAd_00618 requirement

If development error detection is enabled: SoAd_Relea- seIpAddrAssignment () shall check that the service SoAd_Init () was previously called. If the check fails, SoAd_ReleaseIpAddrAssignment () shall raise the devel- opment error SOAD_E_UNINIT .

SWS_SoAd_00619 requirement

If development error detection is enabled: SoAd_Relea- seIpAddrAssignment () shall check parameter SoConId for being valid. If the check fails, SoAd_ReleaseIpAddrAssignment () shall raise the development error SOAD_E_INV_ARG .

SWS_SoAd_00620 requirement

If development error detection is enabled: SoAd_GetLocal- Addr () shall check parameter SoConId for being valid. If the check fails, SoAd_Get- LocalAddr () shall raise the development error SOAD_E_INV_ARG .

SWS_SoAd_00621 requirement

If development error detection is enabled: SoAd_GetLocal- Addr () shall check that the service SoAd_Init () was previously called. If the check fails, SoAd_GetLocalAddr () shall raise the development error SOAD_E_UNINIT .

SWS_SoAd_00622 requirement

If development error detection is enabled: SoAd_Get- PhysAddr () shall check parameter SoConId for being valid. If the check fails, SoAd_- GetPhysAddr () shall raise the development error SOAD_E_INV_ARG .

SWS_SoAd_00623 requirement

If development error detection is enabled: SoAd_Get- PhysAddr () shall check that the service SoAd_Init () was previously called. If the check fails, SoAd_GetPhysAddr () shall raise the development error SOAD_E_UNINIT .

SWS_SoAd_00624 requirement

If development error detection is enabled: SoAd_EnableR- outing () shall check that the service SoAd_Init () was previously called. If the check fails, SoAd_EnableRouting () shall raise the development error SOAD_E_UNINIT .

SWS_SoAd_00625 requirement

If development error detection is enabled: SoAd_EnableR- outing () shall check parameter id for being valid. If the check fails, SoAd_EnableR- outing () shall raise the development error SOAD_E_INV_ARG .

SWS_SoAd_00626 requirement

If development error detection is enabled: SoAd_DisableR- outing () shall check parameter id for being valid. If the check fails, SoAd_DisableR- outing () shall raise the development error SOAD_E_INV_ARG .

SWS_SoAd_00627 requirement

If development error detection is enabled: SoAd_DisableR- outing () shall check that the service SoAd_Init () was previously called. If the check fails, SoAd_DisableRouting () shall raise the development error SOAD_E_UNINIT .

SWS_SoAd_00628 requirement

If development error detection is enabled: SoAd_Se- tRemoteAddr () shall check that the service SoAd_Init () was previously called. If the check fails, SoAd_SetRemoteAddr () shall raise the development error SOAD_E_UNINIT .

SWS_SoAd_00632 requirement

If development error detection is enabled: SoAd_CopyTx- Data () shall check that the service SoAd_Init () was previously called. If the check fails, SoAd_CopyTxData () shall raise the development error SOAD_E_UNINIT .

SWS_SoAd_00633 requirement

If development error detection is enabled: SoAd_CopyTx- Data () shall check parameter SocketId for being valid. If the check fails, SoAd_- CopyTxData () shall raise the development error SOAD_E_INV_SOCKETID .

SWS_SoAd_00635 requirement

If SoAdSocketMsgAcceptanceFilterEnabled is FALSE , SoAd shall accept all TCP connection or UDP datagrams from remote nodes.

SWS_SoAd_00636 requirement

At SoAd_TcpAccepted (), SoAd shall perform the following actions if the TCP SoAdSocketConnectionGroup related to SocketId has both SoAdSocketTcpInitiate and SoAdSocketMsgAcceptanceFilterEnabled set to FALSE and is not online (i.e. current connection state not SOAD_SOCON_ONLINE ): 1. assign the TcpIp socket used for the established connection and provided as parameter SocketIdConnected to the socket connection and 2. change the state of the socket connection to SOAD_SOCON_ONLINE and return E_OK .

SWS_SoAd_00637 requirement

SoAd shall perform the following actions within SoAd_Main- Function () to close a socket connection: 1. Terminate active TP sessions (if any) and notify the upper layer about the termi- nation 2. Disable further transmission or reception for this socket connection, i.e. new transmit requests shall be rejected with E_NOT_OK and received messages shall simply be discarded. 3. Close related TcpIp sockets 4. Change the state of the socket connection to SOAD_SOCON_OFFLINE if clos- ing of the socket connection results from a SoAd_CloseSoCon () request or to SOAD_SOCON_RECONNECT otherwise.

SWS_SoAd_00638 requirement

SoAd shall perform the following actions within SoAd_Main- Function () to open a TCP socket connection with SoAdSocketTcpInitiate set to FALSE : 1. In case no Listen-Socket is assigned to the socket connection: (a) Get an appropriate socket from TcpIp by calling TcpIp_SoAdGetSocket () with the TcpIp_DomainType implicitly specified by SoAdSocketLocal- AddressRef , and the protocol type specified by SoAdSocketProtocol . (b) Change the socket specific parameters according to [SWS_SoAd_00689]. (c) Bind the socket to the local address and port by calling TcpIp_Bind () with the local address identifier specified by SoAdSocketLocalAddressRef and local port specified by SoAdSocketLocalPort . (d) Assign the Listen-Socket to the socket connection group (e) Activate the socket connection to accept connections from remote nodes (f) Listen for a remote connection requests on the Listen-Socket by calling TcpIp_TcpListen () with MaxChannels set to the number of socket con- nections that are part of the TCP socket connection group 2. In case the Listen-Socket is already assigned to the socket connection: (a) Activate the socket connection to accept connections from remote nodes

SWS_SoAd_00639 requirement

SoAd shall perform the following actions within SoAd_Main- Function () to open a UDP socket connection which is part of a socket connection group containing multiple socket connections (i.e. there is more than one socket con- nection in the socket connection group configuration container): 1. In case no UDP socket is assigned to the socket connection group: (a) Get an appropriate socket from TcpIp by calling TcpIp_SoAdGetSocket () with the domain type implicitly specified by SoAdSocketLocalAddress- Ref , and the protocol type specified by SoAdSocketProtocol . (b) Change the socket specific parameters according to [SWS_SoAd_00689] (c) Bind the socket to the local address and port by calling TcpIp_Bind () with the local address identifier specified by SoAdSocketLocalAddressRef and local port specified by SoAdSocketLocalPort . (d) Assign the UDP socket to the socket connection group (e) Activate the socket connection for communication via the shared UDP socket of the socket connection group 2. In case the UDP socket is already assigned to the socket connection group: (a) Activate the socket connection for communication via the shared UDP socket of the socket connection group

SWS_SoAd_00640 requirement

To notify the upper layer about the termination of an active TP transmission on closing a socket connection within SoAd_MainFunction (), SoAd shall call <Up>_[SoAd][Tp]TxConfirmation () with parameter result set to 1. E_OK if disconnect is caused by SoAd_CloseSoCon () and all data was correctly transmitted, and 2. E_NOT_OK for any other cause.

SWS_SoAd_00641 requirement

To notify the upper layer about the termination of an active TP reception on closing a socket connection within SoAd_MainFunction (), SoAd shall call <Up>_[SoAd][Tp]RxIndication () with parameter result set to 1. E_OK if disconnection is caused by SoAd_CloseSoCon () and all received data was correctly delivered to the upper layer, and 2. E_NOT_OK for any other cause.

SWS_SoAd_00642 requirement

To close related TcpIp sockets on closing a socket connection within SoAd_MainFunction (), SoAd shall perform the following actions: 1. In case of a TCP socket connection: (a) Close the related socket by calling TcpIp_Close () with parameter abort set to the same value as provided by SoAd_CloseSoCon () or set to FALSE in case closing was not initiated by SoAd_CloseSoCon (). (b) If all socket connections of a TCP socket connection group have been closed by SoAd_CloseSoCon (): Close the related Listen-Socket by call- ing TcpIp_Close () with parameter abort set to the same value as provided by SoAd_CloseSoCon () or set to FALSE in case closing was not initiated by SoAd_CloseSoCon (). 2. In case of a UDP socket connection: (a) If the socket connection is NOT part of a socket connection group (i.e. there is only one socket connection in the socket connection group configuration container): Close the related socket by calling TcpIp_Close () with param- eter abort set to the same value as provided by SoAd_CloseSoCon () or set to FALSE in case closing was not initiated by SoAd_CloseSoCon (). (b) If all socket connections of a UDP socket connection group have been closed by SoAd_CloseSoCon (): Close the related UDP socket by calling TcpIp_- Close () with parameter abort set to the same value as provided by SoAd_- CloseSoCon ()or set to FALSE in case closing was not initiated by SoAd_- CloseSoCon ().

SWS_SoAd_00643 requirement

Within SoAd_TcpIpEvent () with Event set to TCPIP_UDP_CLOSED , SoAd shall 1. remove the assignment of the TcpIp socket identified by SocketId from the related UDP socket connection group and 2. close all socket connections of the related socket connection group that are in SOAD_SOCON_ONLINE (i.e. perform the specified closing actions with the excep- tion of closing related TcpIp sockets)

SWS_SoAd_00644 requirement

For a TCP socket connection of type automatic (i.e. configu- ration parameter SoAdSocketAutomaticSoConSetup set to TRUE ) which uses a wildcard in the configured remote address (i.e. an ANY-String for IP address or port), SoAd shall (a) disable further transmission or reception for this socket connection (i.e. new transmit requests shall be rejected with E_NOT_OK and received messages shall simply be discarded) after a PDU transmission, directly before the related transmit con- firmation function is called (or would be called if such a function is not configured) and (b) close the socket connection in the next SoAd_MainFunction ().

SWS_SoAd_00645 requirement

Within SoAd_TcpIpEvent () with Event set to TCPIP_TCP_CLOSED for a Listen-Socket, SoAd shall remove the assignment of the TcpIp socket identified by SocketId from the related TCP socket connection group.

SWS_SoAd_00646 requirement

Within SoAd_TcpIpEvent () with Event set to TCPIP_TCP_CLOSED or TCPIP_TCP_RESET , SoAd shall 1. remove the assignment of the TcpIp socket identified by SocketId from the related socket connection and 2. close the socket connection if it is in SOAD_SOCON_ONLINE (i.e. perform the specified closing actions with the exception of closing related TcpIp socket).

SWS_SoAd_00647 requirement

In case of multiple socket connections, SoAd shall call the up- per layer with the configured transmit confirmation function ( <Up>[SoAd][If]Tx- Confirmation ()) with result set to E_OK only once after transmission on all related socket connections succeded.

SWS_SoAd_00648 requirement

If a transmit request on any of multiple socket connections re- turns E_NOT_OK , SoAd shall return E_NOT_OK at SoAd_IfTransmit ().

SWS_SoAd_00650 requirement

The service SoAd_TpTransmit () shall skip the transmit re- quest and return E_NOT_OK if there is already an IF or TP transmission ongoing on the related socket identified by TxPduId .

SWS_SoAd_00651 requirement

If <Up>_[SoAd][Tp]CopyTxData () return with BUFREQ_E_NOT_OK for a TCP socket connection, SoAd shall (a) disable further transmission or reception for this socket connection (i.e. new transmit requests shall be rejected with E_NOT_OK and received messages shall simply be discarded) and (b) close the socket connection in the next SoAd_MainFunction ().

SWS_SoAd_00652 requirement

If <Up>_[SoAd][Tp]CopyTxData () return with BUFREQ_E_NOT_OK for a UDP socket connection, SoAd shall immediately ter- minate the TP transmit session and notify the upper layer with the configured transmit confirmation function <Up>_[SoAd][Tp]TxConfirmation () with E_NOT_OK as result. (Note: the related socket connection is not closed in this case.)

SWS_SoAd_00653 requirement

The service SoAd_IfTransmit () shall skip the transmit re- quest and return E_NOT_OK if there is already an IF or TP transmission ongoing on the related socket identified by TxPduId .

SWS_SoAd_00657 requirement

In case more than one socket connection belongs to a UDP socket connection group, a UDP socket is shared between all socket connections of the group and the related socket connection shall be selected according to the best match algorithm (see [SWS_SoAd_00680]).

SWS_SoAd_00658 requirement

If development error detection is enabled: SoAd_IfRouting- GroupTransmit () shall check parameter id for being valid (i.e. id refers a routing group that has configuration parameter SoAdRoutingGroupTxTriggerable set to TRUE ). If the check fails, SoAd_IfRoutingGroupTransmit () shall raise the devel- opment error SOAD_E_INV_ARG .

SWS_SoAd_00659 requirement

If development error detection is enabled: SoAd_Ge- tRemoteAddr () shall check that the service SoAd_Init () was previously called. If the check fails, SoAd_GetRemoteAddr () shall raise the development error SOAD_E_UNINIT .

SWS_SoAd_00660 requirement

If development error detection is enabled: SoAd_Ge- tRemoteAddr () shall check parameter SoConId for being valid. If the check fails, SoAd_GetRemoteAddr () shall raise the development error SOAD_E_INV_ARG .

SWS_SoAd_00661 requirement

If development error detection is enabled: SoAd_IfRouting- GroupTransmit () shall check that the service SoAd_Init () was previously called. If the check fails, SoAd_IfRoutingGroupTransmit () shall raise the development error SOAD_E_UNINIT .

SWS_SoAd_00662 requirement

At SoAd_IfRoutingGroupTransmit () SoAd shall store a trigger transmit request for each SoAdPduRouteDest that contains a reference to the routing group identified by the parameter id for transmission in the SoAd_Main- Function ().

SWS_SoAd_00664 requirement

At SoAd_GetRemoteAddr () SoAd shall retrieve the remote ad- dress (IP address and port) actually used for the socket connection specified by pa- rameter SoConId .

SWS_SoAd_00665 requirement

In the SoAd_MainFunction () the SoAd shall check for pend- ing triggered transmit request for SoAdPduRouteDest and identify all related IF- PDUs. For each identified IF-PDU SoAd shall process as specified below: 1. retrieve the data from the related upper layer by calling <Up>_[SoAd][If] TriggerTransmit () and 2. transmit the data via the related socket connection.

SWS_SoAd_00666 requirement

SoAd_GetRemoteAddr () shall immediately return E_NOT_OK if the remote address of the socket connection specified by parameter SoConId is not set.

SWS_SoAd_00667 requirement

In case of a TCP socket connection configured with SoAdSock- etTcpImmediateTpTxConfirmation set to TRUE the SoAd shall call the upper layer with the configured transmit confirmation function <Up>_[SoAd][Tp]TxCon- firmation () and E_OK as result within the SoAd_MainFunction () after TcpIp_- TcpTransmit () returns E_OK .

SWS_SoAd_00670 requirement

In case of a TCP socket connection the SoAd shall call the upper layer with the configured transmit confirmation function <Up>_[SoAd][Tp]Tx- Confirmation () and E_NOT_OK as result within the SoAd_MainFunction () after TcpIp_TcpTransmit () returns with E_NOT_OK .

SWS_SoAd_00672 requirement

If development error detection is enabled: SoAd_SetUni- queRemoteAddr () shall check that the service SoAd_Init () was previously called. If the check fails, SoAd_SetUniqueRemoteAddr () shall raise the development error SOAD_E_UNINIT .

SWS_SoAd_00673 requirement

If development error detection is enabled: SoAd_SetU- niqueRemoteAddr () shall check parameter SoConId for being valid. If the check fails, SoAd_SetUniqueRemoteAddr () shall raise the development error SOAD_E_INV_ARG

SWS_SoAd_00675 requirement

The function SoAd_SetUniqueRemoteAddr () shall check if one of the socket connections of the socket connection group, identified by SoConId , is already configured with the address specified by RemoteAddrPtr. In this case, it shall return the socket connection index via AssignedSoConIdPtr and return E_OK .

SWS_SoAd_00676 requirement

If no socket connection is already configured with the address specified by RemoteAddrPtr, SoAd_SetUniqueRemoteAddr () shall: 1. choose an unused socket connection using the best match algorithm described in [SWS_SoAd_00680] 2. set it to the remote address specified by RemoteAddrPtr 3. set AssignedSoConIdPtr to the index of the chosen socket connection and 4. return E_OK . A socket connection is "unused" if its actual remote address has an IP address wildcard and/or port wildcard.

SWS_SoAd_00678 requirement

SoAd_SetUniqueRemoteAddr () shall reject the request and return E_NOT_OK if there are no unused socket connections within the socket connec- tion group identified by SoConId .

SWS_SoAd_00680 requirement

SoAd shall use the following best match algorithm to select a socket connection of a socket connection group based on a provided (specific) remote address: 1. socket connections that have no (specific or wildcard) remote address set shall be ignored 2. the remote address of the remaining socket connections shall be compared with the provided remote address and the socket connection with the best match ac- cording to the following ordered list (item listed earlier has higher priority towards items listed later) shall be selected: (a) IP address and port match (b) IP address match (and wildcard set for port) (c) Port match (and wildcard set for IP address) (d) Wildcards are used for both IP address and port (e) No match (i.e. no socket connections can be selected)

SWS_SoAd_00683 requirement

If a PDU with SoAdTxUdpTriggerMode set to TRIG- GER_NEVER without a specific SoAdTxUdpTriggerTimeout get buffered SoAd shall set the the nPdu specific timer to the value of SoAdTxUdpTriggerTimeout if the timer is not running or if it is lower than the current nPdu specific timer value.

SWS_SoAd_00684 requirement

SoAd shall stop the nPdu specific timer when the PDUs stored for the socket connection have been sent

SWS_SoAd_00685 requirement

In case the nPdu feature is used for a socket connection and SoAdTxUdpTriggerMode is set to TRIGGER_ALWAYS for the current PDU ( SoAdP- duRouteDest ) and the resulting PDU data and headers would exceed SoAdSocket- nPduUdpTxBufferMin , SoAd shall first transmit all PDUs stored for the socket con- nection (if any) by calling TcpIp_UdpTransmit () and then the current PDU by calling TcpIp_UdpTransmit () once more.

SWS_SoAd_00686 requirement

Within SoAd_MainFunction () and after successfully perform- ing the open actions, SoAd shall change the state of the socket connection to SOAD_SOCON_RECONNECT in case of 1. a TCP socket connection or 2. a UDP socket connection that is configured with a remote address containing wildcards.

SWS_SoAd_00687 requirement

If the function SoAd_SetRemoteAddr () is used to set the re- mote address of a socket connection that is in the mode SOAD_SOCON_ONLINE to a value that contains wildcards, SoAd shall change the mode of the socket connection to SOAD_SOCON_RECONNECT .

SWS_SoAd_00688 requirement

Within SoAd_TcpIpEvent () with Event set to TCPIP_TCP_FIN_RECEIVED SoAd shall close the related socket by calling TcpIp_- Close () with parameter abort set FALSE .

SWS_SoAd_00689 requirement

In case socket related parameters shall be changed as part of allocating a new socket, SoAd shall change the parameters according to the configura- tion of the associated socket connection by calling TcpIp_ChangeParameter () with ParameterId and ParameterValue for each related clause as specified below: 1. In case of a TCP socket: TCPIP_PARAMID_TCP_RXWND_MAX and the value specified by SoAdSocketTpRxBufferMin if the optional parameter is enabled 2. TCPIP_PARAMID_FRAMEPRIO and the value specified by SoAdSocket- FramePriority if the optional parameter is enabled 3. In case of a TCP socket: TCPIP_PARAMID_TCP_NAGLE and the value 0x01 if the related optional parameter SoAdSocketTcpNoDelay is set to FALSE or 0x00 if the parameter is set to TRUE . 4. In case of a TCP socket: TCPIP_PARAMID_TCP_KEEPALIVE and the value specified by SoAdSocketTcpKeepAlive 5. In case of a TCP socket: TCPIP_PARAMID_TCP_KEEPALIVE_TIME and the value specified by SoAdSocketTcpKeepAliveTime if the optional parameter is enabled 6. In case of a TCP socket: TCPIP_PARAMID_TCP_KEEPALIVE_PROBES_MAX and the value specified by SoAdSocketTcpKeepAliveProbesMax if the op- tional parameter is enabled 7. In case of a TCP socket: TCPIP_PARAMID_TCP_KEEPALIVE_INTERVAL and the value specified by SoAdSocketTcpKeepAliveInterval if the optional pa- rameter is enabled. 8. In case of a TCP socket: TCPIP_PARAMID_TCP_OPTIONFILTER and the value of TcpIpTcpConfigOptionFilterId specified in TcpIpTcpCon- figOptionFilter referenced by SoAdSocketTCPOptionFilterRef if the optional parameter is enabled. 9. TCPIP_PARAMID_PATHMTU_ENABLE and the value specified by SoAdSocket- PathMTUEnable if the optional parameter is enabled. 10. TCPIP_PARAMID_FLOWLABEL and the value specified by SoAdSocket- FlowLabel if the optional parameter is enabled. 11. TCPIP_PARAMID_DSCP and the value specified by SoAdSocketDifferenti- atedServicesField if the optional parameter is enabled. 12. In case of a UDP socket: TCPIP_PARAMID_UDP_CHECKSUM and the value of SoAdSocketUdpChecksumEnabled . 13. In case of a TCP socket: If SoAdSocketTcpTlsConnection- Ref is defined the function shall be called with the parameter ID TCPIP_PARAMID_TLS_CONNECTION_ASSIGNMENT and the value from this reference as the parameter value to assign a TLS connection to this socket. 14. In case of a TCP socket: TCPIP_PARAMID_TCP_RETRANSMIT_TIMEOUT and the value specified by SoAdSocketTcpRetransmissionTimeout if the op- tional parameter is enabled. If SoAdSocketTcpRetransmissionTimeout is configured to INF , SoAd shall use the corresponding value representing INF from TcpIp module.

SWS_SoAd_00690 requirement

SoAd shall preserve the order of PDUs transmitted via a socket connection that uses the nPdu feature. Pdus collected on the sender side first shall be extracted and indicated to the receivers on the receiving side first as well.

SWS_SoAd_00691 requirement

In case the nPdu feature is used for a socket connection and and all PDUs are configured with SoAdTxPduCollectionSemantics set to SOAD_COLLECT_QUEUED , SoAd shall transmit all PDUs individually, also PDUs with the same PduId.

SWS_SoAd_00692 requirement

Det_ReportError Det.h Service to report development errors. IdsM_SetSecurityEvent IdsM.h This API is the application interface to report security events to the IdsM. IdsM_SetSecurityEventWithContext Data IdsM.h This API is the application interface to report security events with context data to the IdsM. API Function Header File Description PduR_SoAdTpCopyRxData PduR_SoAd.h This function is called to provide the received data of an I-PDU segment (N-PDU) to the upper layer. Each call to this function provides the next part of the I-PDU data. The size of the remaining buffer is written to the position indicated by bufferSizePtr. PduR_SoAdTpCopyTxData PduR_SoAd.h This function is called to acquire the transmit data of an I-PDU segment (N-PDU). Each call to this function provides the next part of the I-PDU data unless retry->TpDataState is TP_DATARETRY. In this case the function restarts to copy the data beginning at the offset from the current position indicated by retry->TxTpDataCnt. The size of the remaining data is written to the position indicated by availableDataPtr. TcpIp_DhcpReadOption TcpIp.h By this API service the TCP/IP stack retrieves DHCP option data identified by parameter option for already received DHCP options. TcpIp_DhcpV6ReadOption TcpIp.h By this API service the TCP/IP stack retrieves DHCPv6 option data identified by parameter option for already received DHCPv6 options. TcpIp_DhcpV6WriteOption TcpIp.h By this API service the TCP/IP stack writes the DHCPv6 option data identified by parameter option. TcpIp_DhcpWriteOption TcpIp.h By this API service the TCP/IP stack writes the DHCP option data identified by parameter option.

SWS_SoAd_00693 requirement

Whenever a PDU or a part of a PDU is received, that has to be stored in a SoAd receive buffer, is larger than the remaining available buffer size SoAd shall shall raise the runtime error SOAD_E_NOBUFS .

SWS_SoAd_00694 requirement

If a UDP socket connection is configured with a SoAdSocke- tUdpAliveSupervisionTimeout and the remote address was overwritten, as de- scribed in [SWS_SoAd_00592], the alive supervision timer for this socket connection shall be started with the value specified by the configuration parameter SoAdSocke- tUdpAliveSupervisionTimeout .

SWS_SoAd_00695 requirement

If a UDP socket connection is configured with a SoAdSocke- tUdpAliveSupervisionTimeout , the alive supervision timer runs out and the re- mote address was not set by the upper layer, SoAd shall 1. change the state of the socket connection to SOAD_SOCON_RECONNECT , 2. deactivate the alive supervision timer and 3. reset the remote address to the configured remote address at SoAd_MainFunc- tion ().

SWS_SoAd_00696 requirement

SoAd shall maintain a nPdu specific timer for each socket con- nection using the nPdu feature.

SWS_SoAd_00697 requirement

If a PDU with SoAdTxUdpTriggerMode set to TRIG- GER_NEVER with a specific SoAdTxUdpTriggerTimeout get buffered SoAd shall set the nPdu specific timer to the value of SoAdTxUdpTriggerTimeout if the timer is not running or if it is lower than the current nPdu specific timer value.

SWS_SoAd_00698 requirement

SoAd_GetRemoteAddr () shall refuse the request if the domain set in IpAddrPtr does not match the TcpIp_DomainType of the local address related to the socket connection identified by SoConId and return E_NOT_OK . If development error detection is enabled, the service SoAd_GetRemoteAddr () shall also raise the development error SOAD_E_INV_ARG .

SWS_SoAd_00699 requirement

SoAd_SetRemoteAddr () shall refuse the request if the domain set in RemoteAddrPtr does not match the TcpIp_DomainType of the local address related to the socket connection identified by SoConId and return E_NOT_OK . If de- velopment error detection is enabled, the service SoAd_SetRemoteAddr () shall also raise the development error SOAD_E_INV_ARG .

SWS_SoAd_00700 requirement

SoAd_SetUniqueRemoteAddr () shall refuse the request if the domain set in RemoteAddrPtr does not match the TcpIp_DomainType of the local ad- dress related to the socket connection identified by SoConId and return E_NOT_OK . If development error detection is enabled, the service SoAd_SetUniqueRemoteAddr () shall also raise the development error SOAD_E_INV_ARG .

SWS_SoAd_00701 requirement

If development error detection is enabled: SoAd_Read- DhcpHostNameOption () shall check that the service SoAd_Init () was previously called. If the check fails, SoAd_ReadDhcpHostNameOption () shall raise the devel- opment error SOAD_E_UNINIT .

SWS_SoAd_00702 requirement

If development error detection is enabled: SoAd_Read- DhcpHostNameOption () shall check parameter SoConId for being valid. If the check fails, SoAd_ReadDhcpHostNameOption () shall raise the development error SOAD_E_INV_ARG .

SWS_SoAd_00703 requirement

The service SoAd_ReadDhcpHostNameOption () shall for- ward the call to TcpIp_DhcpReadOption () with the parameter Option set to the op- tion code 81 according to IETF RFC 4702 [9], if the socket connection identified by SoConId is related to a local address of the TcpIp_DomainType TCPIP_AF_INET.

SWS_SoAd_00704 requirement

The service SoAd_ReadDhcpHostNameOption () shall for- ward the call to TcpIp_DhcpV6ReadOption () with the parameter Option set to the option code 39 according to IETF RFC 4704 [10], if the socket connection identified by SoConId is related to a local address of the TcpIp_DomainType TCPIP_AF_INET6.

SWS_SoAd_00705 requirement

If development error detection is enabled: SoAd_WriteD- hcpHostNameOption () shall check that the service SoAd_Init () was previously called. If the check fails, SoAd_WriteDhcpHostNameOption () shall raise the de- velopment error SOAD_E_UNINIT .

SWS_SoAd_00706 requirement

If development error detection is enabled: SoAd_WriteD- hcpHostNameOption () shall check parameter SoConId for being valid. If the check fails, SoAd_WriteDhcpHostNameOption () shall raise the development error SOAD_E_INV_ARG .

SWS_SoAd_00707 requirement

The service SoAd_WriteDhcpHostNameOption () shall for- ward the call to TcpIp_DhcpWriteOption () with the parameter Option set to the option code 81 according to IETF RFC 4702 [9], if the socket connection identified by SoConId is related to a local address of the TcpIp_DomainType TCPIP_AF_INET.

SWS_SoAd_00708 requirement

The service SoAd_WriteDhcpHostNameOption () shall for- ward the call to TcpIp_DhcpV6WriteOption () with the parameter Option set to the option code 39 according to IETF RFC 4704 [10], if the socket connection identified by SoConId is related to a local address of the TcpIp_DomainType TCPIP_AF_INET6.

SWS_SoAd_00709 requirement

If SoAdSocketUdpStrictHeaderLenCheckEnabled is en- abled SoAd shall check if the length of the received UDP message does match the accumulated length of all PDUs including their PDU headers prior to forwarding any data to an upper layer. If the their lengths are different SoAd shall silently drop the whole message without forwarding any data.

SWS_SoAd_00710 requirement

In case no valid PDU data was forwarded to an upper layer and the remote address of the socket connection was overwritten according to [SWS_SoAd_00592] in context of the same SoAd_RxIndication (), SoAd shall re- vert the remote address change and set the state of the socket connection back to SOAD_SOCON_RECONNECT .

SWS_SoAd_00712 requirement

If development error detection is enabled: SoAd_IfSpecifi- cRoutingGroupTransmit () shall check that the service SoAd_Init () was previ- ously called. If the check fails, SoAd_IfSpecificRoutingGroupTransmit () shall raise the development error SOAD_E_UNINIT .

SWS_SoAd_00713 requirement

If development error detection is enabled: SoAd_IfSpecifi- cRoutingGroupTransmit () shall check parameter id for being valid (i.e. id refers a routing group that has configuration parameter SoAdRoutingGroupTxTriggerable set to TRUE ). If the check fails, SoAd_IfSpecificRoutingGroupTransmit () shall raise the development error SOAD_E_INV_ARG .

SWS_SoAd_00715 requirement

If development error detection is enabled: SoAd_Enable- SpecificRouting () shall check that the service SoAd_Init () was previously called. If the check fails, SoAd_EnableSpecificRouting () shall raise the development er- ror SOAD_E_UNINIT .

SWS_SoAd_00716 requirement

If development error detection is enabled: SoAd_Ena- bleSpecificRouting () shall check parameter id for being valid. If the check fails, SoAd_EnableSpecificRouting () shall raise the development error SOAD_E_INV_ARG .

SWS_SoAd_00718 requirement

If development error detection is enabled: SoAd_Disable- SpecificRouting () shall check that the service SoAd_Init () was previously called. If the check fails, SoAd_DisableSpecificRouting () shall raise the development error SOAD_E_UNINIT .

SWS_SoAd_00719 requirement

If development error detection is enabled: SoAd_Dis- ableSpecificRouting () shall check parameter id for being valid. If the check fails, SoAd_DisableSpecificRouting () shall raise the development error SOAD_E_INV_ARG .

SWS_SoAd_00720 requirement

At SoAd_IfSpecificRoutingGroupTransmit () SoAd shall store a trigger transmit request for each SoAdPduRouteDest that contains a refer- ence to the routing group identified by the parameter id for transmission on the socket connection identified by the parameter SoConId in the SoAd_MainFunction ().

SWS_SoAd_00721 requirement

For RoutingGroups that are referenced by a SoAdPduRout- eDest that refers to a SoAdSocketConnectionGroup SoAd shall maintain inde- pendent states for each SocketConnection that is part of the referenced SoAdSock- etConnectionGroup and handle them as if they were separate RoutingGroups.

SWS_SoAd_00722 requirement

SoAd shall handle SoAdPduRoute with SoAdPduRouteDest referring to a SoAdSocketConnectionGroup as if they were separate SoAdP- duRouteDest referring to each SocketConnection of this Group.

SWS_SoAd_00723 requirement

SoAd_Init () initializes all global variables of a Socket Adaptor instance and puts all socket connections into the state SOAD_SOCON_OFFLINE .

SWS_SoAd_00724 requirement

In case SoAd_GetSoConId () is called with a TxPduId related to a SoAdPduRoute with a fan-out (i.e. multiple SoAdPduRouteDest specified), SoAd_GetSoConId () shall skip further processings and return E_NOT_OK .

SWS_SoAd_00728 requirement

To trigger PDU data from an upper layer SoAd shall set PduIn- foType.SduDataPtr to the location of the buffer where the data shall be copied, set PduInfoType.SduDataLength to the length of this buffer and then call <Up> _[SoAd][If]TriggerTransmit ().

SWS_SoAd_00729 requirement

If SoAd_LocalIpAddrAssignmentChg () is called with the parameter IpAddrId set to a local address which is not referenced by any SoAd- SocketConnectionGroup , SoAd shall ignore the notification and return without any further action.

SWS_SoAd_00730 requirement

SoAd_TpChangeParameter () shall always reject requests by returning E_NOT_OK .

SWS_SoAd_00731 requirement

If SoAd_IfTransmit () was called with PduInfoPtr->Sdu- DataPtr set to NULL_PTR , SoAd shall use <Up>[SoAd][If]TriggerTransmit () to retrieve the PDU data from the upper layer.

SWS_SoAd_00732 requirement

SoAd shall only consider PduInfoPtr->SduDataPtr set to NULL_PTR as valid if SoAdIfTriggerTransmit is set to TRUE for the respective upper layer.

SWS_SoAd_00734 requirement

In case the nPdu feature is used for a socket connec- tion, the related PDU parameter SoAdTxPduCollectionSemantics is set to SOAD_COLLECT_LAST_IS_BEST and the upper layer doesn't provide all the re- quested data via <Up>[SoAd][If]TriggerTransmit () in the context of SoAd_- CopyTxData (), SoAd shall abort the transmission and return E_NOT_OK .

SWS_SoAd_00735 requirement

In case the nPdu feature is used for a socket connec- tion and all PDUs are configured with SoAdTxPduCollectionSemantics set to SOAD_COLLECT_LAST_IS_BEST , SoAd shall only transmit the last instance of each PDU with the same PduId in the sequence their first instances were requested for transmission.

SWS_SoAd_00736 requirement

SoAd shall reject configurations in which the transmit prop- erties (see SoAdTxPduCollectionSemantics ) of the PDUs which are as- signed to a socket connection are mixed. Furthermore all socket connnec- tions of a socket connection group shall either be refered solely by PDUs with SOAD_COLLECT_LAST_IS_BEST or solely by PDUs with SOAD_COLLECT_QUEUED semantic.

SWS_SoAd_00737 requirement

For all PDUs that have been stored for a socket connection using the nPdu feature, SoAd shall call the upper layer with the related transmit con- firmation function ( <Up>[SoAd][If]TxConfirmation ()) within the context of the SoAd_MainFunction () and with result set to 1. E_OK if the related TcpIp_UdpTransmit () call was successful, 2. E_NOT_OK if the transmission was not successful or cancelled for any other rea- son.

SWS_SoAd_00738 requirement

If development error detection is enabled: In case of a transmit request for a SoAdPduRoute that refers to a global PDU structure configured with a MetaDataItem of the type SOCKET_CONNECTION_ID_16 and the contained SoAd- PduRouteDest refers to a socket connection group, SoAd shall raise the develop- ment error SOAD_E_INV_METADATA , if the socket connection identified by PduInfo- Type.MetaDataPtr is not part of the socket connection group of the related SoAd- PduRouteDest .

SWS_SoAd_00739 requirement

In case of a transmit request for a SoAdPduRoute that refers to a global PDU structure configured with a MetaDataItem of the type SOCKET_CONNECTION_ID_16 and the contained SoAdPduRouteDest refers to a socket connection group, SoAd shall only perform the transmission on the socket connection identified by PduInfoType.MetaDataPtr instead of the whole group.

SWS_SoAd_00740 requirement

In case of a reception related to a SoAdSocketRouteDest, that refers to a global PDU structure configured with a MetaDataItem of the type SOCKET_CONNECTION_ID_16 , which is contained in a SoAdSocketRoute that refers to a socket connection group, SoAd shall use PduInfoType.MetaDataPtr to provide the socket connection identifier ( SoConId ) where the PDU was received with <Up>_[SoAd][If]RxIndication ().

SWS_SoAd_00741 requirement

Each time a socket connection state changes, SoAd shall no- tify the upper layer specified by SoAdSocketSoConModeChgNotifUpperLayerRef with the configured upper layer notification function <Up>_SoConModeChg () and the new state if the optional reference is set for the socket connection.

SWS_SoAd_00742 requirement

If a UDP socket connection is configured with a SoAdSock- etUdpAliveSupervisionTimeout and a datagram is received that passes the message acceptance filter, the timer shall be restarted with the value specified by the configuration parameter SoAdSocketUdpAliveSupervisionTimeout .

SWS_SoAd_00743 requirement

SoAd shall lock the remote address during the following situa- tions: 1. TCP socket connections not in state SOAD_SOCON_OFFLINE , 2. active receptions, 3. pending receptions of TP-PDUs, 4. active transmissions, 5. pending transmissions of the nPdu feature, 6. pending transmissions initiated via SoAd_IfRoutingGroupTransmit () or SoAd_IfSpecificRoutingGroupTransmit (). A locked remote address can't be modified by upper layers.

SWS_SoAd_00744 requirement

If development error detection is enabled and SoConId refers to a socket connection with configuration parameter SoAdSocketAutomaticSoCon- Setup set to TRUE , the function SoAd_ReleaseRemoteAddr () shall raise the devel- opment error SOAD_E_INV_ARG .

SWS_SoAd_00745 requirement

The function SoAd_ReleaseRemoteAddr () shall only imme- diately proceed if the SoConId refers to a socket connection which is not currently locked by the SoAd. If it is locked, the request shall be postponed to the SoAd_Main- Function () and executed once the lock is released.

SWS_SoAd_00746 requirement

The function SoAd_ReleaseRemoteAddr () shall reset the re- mote address of the socket connection referred by parameter SoConId to the config- ured remote address setting.

SWS_SoAd_00747 requirement

In case the nPdu feature is used for a socket connec- tion and the related PDU parameter SoAdTxPduCollectionSemantics is set to SOAD_COLLECT_LAST_IS_BEST , SoAd shall only store the transmission request in- stead of the PDU data. When SoAd needs to provide the PDU data, SoAd shall retrieve the data from the upper layer by calling <Up>[SoAd][If]TriggerTrans- mit ().

SWS_SoAd_00748 requirement

SoAd_GetAndResetMeasurementData () shall return mea- surement data for selected measurement index.

SWS_SoAd_00749 requirement

For measurement index SOAD_MEAS_DROP_TCP SoAd_- GetAndResetMeasurementData () shall return the number of dropped TCP-Port PDUs.

SWS_SoAd_00750 requirement

For measurement index SOAD_MEAS_DROP_UDP SoAd_- GetAndResetMeasurementData () shall return the number of dropped UDP-Port PDUs.

SWS_SoAd_00751 requirement

SoAd_GetAndResetMeasurementData () shall return E_NOT_OK if the requested measurement index is not supported.

SWS_SoAd_00752 requirement

SoAd_GetAndResetMeasurementData () shall additionally reset the measurement data to 0 if the MeasurementResetNeeded is true. The reset shall be applied after measurement data has been read.

SWS_SoAd_00753 requirement

SoAd_GetAndResetMeasurementData () shall reset all exist- ing measurement data to 0, if MeasurementResetNeeded is true and measurement index is set to SOAD_MEAS_ALL .

SWS_SoAd_00754 requirement

All measurement data which counts data shall not overrun.

SWS_SoAd_00755 requirement

SoAd_GetAndResetMeasurementData () shall accept Mea- surementDataPtr set to NULL_PTR . In this case the measurement data shall not be copied.

SWS_SoAd_00756 requirement

If development error detection is enabled: SoAd_GetAn- dResetMeasurementData () shall check that the service SoAd_Init () was previ- ously called. If the check fails, SoAd_GetAndResetMeasurementData () shall raise the development error SOAD_E_UNINIT .

SWS_SoAd_00757 requirement

The function SoAd_GetAndResetMeasurementData () shall be pre compile time configurable On/Off by the configuration parameter: SoAdGetAn- dResetMeasurementDataApi .

SWS_SoAd_00758 requirement

If the measurement data is enabled (see SoAdGetAndReset- MeasurementDataApi ), SoAd shall increment the corresponding measurement data whenever a received PDU is discarded.

SWS_SoAd_00759 requirement

Type of error Related error code Error value No buffer space available SOAD_E_NOBUFS 0x04 Unknown PduHeader ID SOAD_E_INV_PDUHEADER_ID 0x05 Automatic TCP connection failed SOAD_E_TCP_AUTOCONNECT_FAILED 0x10

SWS_SoAd_00760 requirement

For SoAdRoutingGroups that are referenced by a SoAdSock- etRouteDest that belongs to a SoAdSocketRoute referring to a SoAdSocketCon- nectionGroup , SoAd shall maintain independent states for each socket connection that is part of the referenced SoAdSocketConnectionGroup and handle them as if they were separate SoAdRoutingGroups.

SWS_SoAd_00761 requirement

If SoAd_EnableSpecificRouting () is called with SoConId belonging to a SoAdSocketConnectionGroup and for a SoAdRoutingGroup that is referenced by a SoAdSocketRouteDest that belongs to a SoAdSocketRoute referring to the same SoAdSocketConnectionGroup and that contains more than one SoAdSocketRouteDest , SoAd shall only enable the independent state for the socket connection if: 1. the same SoAdSocketRouteDest is not active for any other socket connection of the same SoAdSocketConnectionGroup (i.e. SoAdSocketRouteDest is not already mapped to another socket connection) and 2. no SoAdRoutingGroup is enabled on the socket connection which is referenced by another SoAdSocketRouteDest of the same SoAdSocketRoute (i.e. the socket connection is not mapped to another SoAdSocketRouteDest of the same SoAdSocketRoute ). Otherwise, E_NOT_OK shall be returned.

SWS_SoAd_00762 requirement

If the function SoAd_ReleaseRemoteAddr () resets the remote address of a socket connection to a configured remote address containing wildcards and socket connection is in mode SOAD_SOCON_ONLINE , SoAd shall change the mode of the socket connection to SOAD_SOCON_RECONNECT .

SWS_SoAd_00763 requirement

If security event reporting has been enabled for the SoAd module ( SoAdEnableSecurityEventReporting = true) the respective secu- rity events shall be reported to the IdsM via the interfaces defined in AU- TOSAR_SWS_BSWGeneral [2].

SWS_SoAd_00764 requirement

ID SOAD_SEV_DROP_PDU_RX_TCP SoAd dropped a PDU. The PDU violates stack configuration and was received via a TCP socket. 50 SOAD_SEV_DROP_PDU_RX_UDP SoAd dropped a PDU. The PDU violates stack configuration and was received via a UDP socket. 6 SOAD_SEV_DROP_MSG_RX_UDP_LENGTH SoAd dropped a message. The message contains at least one PDU which violates stack configuration and was received via a UDP socket. The violation relates to the length of the PDUs compared to the overall length of the message. 7 SOAD_SEV_DROP_MSG_RX_UDP_SOCKET SoAd received a UDP message which violates stack configuration and was dropped. No suitable socket connection matching to configuration was found. 8 SOAD_SEV_REJECTED_TCP_CONNECTION SoAd rejected a TCP connection. The connection request violates stack configuration. 9

SWS_SoAd_00765 requirement

If SoAdSocketTcpAutoConnectTimeout has been config- ured for that socket connection to a value > 0 SoAd shall repeat the invocation stated in [SWS_SoAd_00590] bullet (4) only for the time specified in SoAdSocketTcpAuto- ConnectTimeout .

SWS_SoAd_00766 requirement

If SoAdSocketTcpAutoConnectTimeout has elapsed for that socket connection and the socket connection has not yet reached SOAD_SOCON_ONLINE , then 1. the runtime error SOAD_E_TCP_AUTOCONNECT_FAILED shall be raised. 2. the socket connection shall close related TcpIp socket. 3. the socket connection shall be put into SOAD_SOCON_OFFLINE . 4. the socket connection shall stay in SOAD_SOCON_OFFLINE .

SWS_SoAd_00767 requirement

Each time a socket connection state changes, SoAd shall notify the BswM of the socket connection state change with the notification function BswM_- SoAd_SoConModeChg () and the new state if SoAdSocketSoConModeChgBswMNo- tification is set to TRUE for the socket connection.

SWS_SoAd_00768 requirement

If SoAd_IsConnectionReady () is called and the referred socket connection has no socket assigned, SoAd shall return TCPIP_E_NOT_OK .

SWS_SoAd_00769 requirement

If SoAd_IsConnectionReady () is called and the referred socket connection has a socket assigned, SoAd shall call TcpIp_IsConnection- Ready () to pass RemoteAddrPtr for the corresponding socket. The return value of TcpIp_IsConnectionReady () shall be forwarded to the caller.

SWS_SoAd_00770 requirement

If development error detection is enabled: SoAd_IsConnec- tionReady () shall check parameter SoConId for being valid. If the check fails, the function shall raise the development error SOAD_E_INV_ARG .

SWS_SoAd_00771 requirement

[SWS_SoAd_00771] ⌈In case PDU header option is enabled (SoAdPduHeaderEn- able is TRUE) for a TCP socket connection, SoAd shall convert the message into a PDU within SoAd_RxIndication() according to the following: 1. extract remaining PDU payload from the received TCP segment if the previous TCP segment contained fragmented PDU payload. If the end of the TCP segment is not reached continue with (3) 2. extract remaining PDU header from the received TCP segment if the previous TCP segment contained fragmented PDU header and continue with (4). 3. extract the PDU header from the received TCP segment. If the PDU header is fragmented over this and the next TCP segment, then store the received part of the PDU header and continue with (2) for the next TCP segment. 4. select the related socket route according to the received PDU Header ID (SoAd- RxPduHeaderId). If no socket route can be found, simply discard the PDU and raise the runtime error SOAD_E_INV_PDUHEADER_ID. 5. use the length field of the PDU header to identify the length of the actual PDU and the start of the next PDU to proceed with (3) until the end of the TCP fragment is reached. If at the end of the TCP segment the PDU header or payload is not completed, it shall be remembered for the next TCP segment. ⌋

SWS_SoAd_00772 requirement

[SWS_SoAd_00772] Status: DRAFT Upstream requirements: SRS_Eth_00163 ⌈If SoAdBswModuleRef is referencing Sd, then SoAd shall process incoming PDUs according to [SWS_SoAd_00773].⌋

SWS_SoAd_00773 requirement

[SWS_SoAd_00773].⌋

SWS_SoAd_00774 requirement

[SWS_SoAd_00774] Status: DRAFT Upstream requirements: SRS_Eth_00163 ⌈If Sd_RequestRoutingGroupEnable() returns E_OK, SoAd shall forward the Pdu data to the related upper layer.⌋ Note: Within Sd_RequestRoutingGroupEnable() Sd performs the ACL check. In case of success, it enables the corresponding routing group for faster processing of consecutive PDUs coming from the same remote node and it returns E_OK.

SWS_SoAd_00775 requirement

[SWS_SoAd_00775] Status: DRAFT Upstream requirements: SRS_Eth_00163 ⌈If Sd_RequestRoutingGroupEnable() returns E_NOT_OK, SoAd shall drop the received PDU.⌋ Note: Within Sd_RequestRoutingGroupEnable() Sd performs the ACL check. In case of failure, the corresponding routing group stays disabled and it returns E_NOT_OK.