CLASSIC
Modul: tcpip
Rolle: constitutive
Konfidenz: 95%
SNIP_CLASSIC_TCPIP_SECTION_8_4_2_2_TcpIp_Bind
Wortlaut
8.4.2.2 TcpIp_Bind
[SWS_TCPIP_00015] Definition of API function TcpIp_Bind ⌈
Service Name
TcpIp_Bind
Syntax
Std_ReturnType TcpIp_Bind (
TcpIp_SocketIdType SocketId,
TcpIp_LocalAddrIdType LocalAddrId,
uint16* PortPtr
)
Service ID [hex]
0x05
Sync/Async
Synchronous
Reentrancy
Reentrant for different SocketIds. Non reentrant for the same SocketId.
SocketId
Socket identifier of the related local socket resource.
Parameters (in)
LocalAddrId
IP address identifier representing the local IP address and EthIf
controller to bind the socket to.
Note: to listen to all EthIf controller, TCPIP_LOCALADDRID_ANY
has to be specified as LocalAddrId.
Note: to listen on any IP addresss of a EthIf controller, the
configuration parameter TcpIpStaticIpAddress referenced by
LocalAddrId must be set to "ANY". The remote IP address of an
incoming packet has no effect then.
In case the socket shall be used as client socket, the IP address
and EthIf controller represented by LocalAddrId is used for
transmission.
Note: for an automatic selection of the Local IP address and EthIf
Controller, TCPIP_LOCALADDRID_ANY has to be specified as
LocalAddrId.
Parameters (inout)
PortPtr
Pointer to memory where the local port to which the socket shall
be bound is specified. In case the parameter is specified as
TCPIP_PORT_ANY, the TCP/IP stack shall choose the local port
automatically from the range 49152 to 65535 and shall update
the parameter to the chosen value.
Parameters (out)
None
Return value
Std_ReturnType
Result of operation
E_OK The request has been accepted
E_NOT_OK The request has not been accepted (e.g. address in
use)
Description
By this API service the TCP/IP stack is requested to bind a UDP or TCP socket to a local
resource.
Available via
TcpIp.h
⌋
[SWS_TcpIp_00111] ⌈The service TcpIp_Bind() shall bind the socket specified by
parameter SocketId to the local resource specified by parameters LocalAddrId
and PortPtr.⌋
Note: Sockets that shall be switched in a listening state later on must be bound to a
local resource. Optionally this API can be used to specify the local IP address and port
used by later calls of TcpIp_TcpConnect() or TcpIp_UdpTransmit().
[SWS_TcpIp_00146] ⌈TcpIp_Bind() shall check if there is another socket already
bound to the same port, protocol and local address and if that is the case refuse the
request and return E_NOT_OK. If development error detection is enabled, the service
TcpIp_Bind() shall also raise the development error code TCPIP_E_ADDRINUSE.⌋
[SWS_TcpIp_00147]
Upstream requirements: SRS_BSW_00323
⌈If development error detection is enabled: TcpIp_Bind() shall check if the parameter
LocalAddrId is valid. If the check fails, TcpIp_Bind() shall refuse the request and
raise the development error code TCPIP_E_ADDRNOTAVAIL instead.⌋
[SWS_TcpIp_00254]
Upstream requirements: SRS_Eth_00045
⌈TcpIp_Bind() shall check if the local address specified by LocalAddrId is assigned and if that is not the case refuse the request and return E_NOT_OK⌋
Versionen & Provenienz · Zugeordnete Anforderungen
Diese Angaben zeigt der Versions-Explorer.
Begründung & Zuweisungs-Evidenz
Cited verbatim in the snippet (deterministic citation).
Dokumenten-Herkunft & Rückverfolgbarkeit
| Spezifikations-Dokument | SWS_TcpIp.pdf |
|---|---|
| Dokumentseite | Seite 85 |
| Ziel-Modul | tcpip (classic) |
| Ziel-Anforderung | SWS_TcpIp_00254 |
| Semantische Rolle | constitutive |
| Automatisierungs-Konfidenz | 0.95 |