DEENESPTFRRUARHIKOZHNL

TCP/IP Stack (TcpIp)

ModulTcpIp (TCP/IP Stack)
BSW-Modul-ID170
Standard-Header#include "TcpIp.h"
SWS-SpezifikationAUTOSAR_SWS_TcpIp.pdf
ClusterEthernet Services

Modul-GuideKI-GENERIERT

Stellt im Ethernet-Stack IP-Kommunikation über TCP und UDP samt Adressverwaltung für obere Schichten bereit.
KI-GENERIERT ungeprüft Modell: claude-opus-5-5 · Aufwand: high · Temperatur: nicht steuerbar · Prompt: 0a4cda5ef1d2 Herkunft Offene Fragen (3)
Kausaler Anker: R20-11 Gültig ab R20-11 Neu synthetisiert für diesen Spezifikationsstand.
KI-generiertclaude-opus-5-5 · 2026-10-13

Stellt im Ethernet-Stack IP-Kommunikation über TCP und UDP samt Adressverwaltung für obere Schichten bereit.

TcpIp stellt im Classic-Ethernet-Stack IPv4 und IPv6 mit ARP, NDP, ICMP und DHCP sowie UDP und TCP bereit und bedient damit Socket-Owner wie den SoAd [SWS_TCPIP_00052]. Der EthSM steuert für jeden EthIf-Controller die Zustände ONLINE, ONHOLD und OFFLINE. ONLINE wird ein Controller erst, wenn ihm eine lokale Adresse zugewiesen ist [SWS_TCPIP_00085]. Sockets werden angefordert, gebunden und bei TCP aktiv oder passiv verbunden, die Daten laufen über Sendedienste und Callbacks. Wichtigste Randbedingung: Neue TCP-Verbindungen nimmt TcpIp nur im Zustand ONLINE an, und in ONHOLD weist es neue Sendeaufträge ab.

Im Classic-Ethernet-Stack ist TcpIp für die IP-Kommunikation zuständig. Es besteht aus Teilmodulen für IPv4 (mit ARP, ICMP, DHCP und Auto-IP), für IPv6 (mit NDP, ICMPv6 und DHCPv6) sowie für UDP, TCP und TLS ([SWS_TCPIP_00052], [SWS_TCPIP_00150]). Nach oben bedient es Socket-Owner, also den SoAd oder CDDs, mit eigenen TcpIp_<Up>GetSocket-Funktionen und Callbacks ([SWS_TCPIP_00220], [SWS_TCPIP_00222]). Nach unten tauscht es Rahmen mit EthIf aus [SWS_TCPIP_00029].

kontext EthSM EthSM TcpIp TcpIp IPv4 / ARP / ICMP / DHCP / Auto-IP IPv6 / NDP / ICMPv6 / DHCPv6 UDP / TCP / TLS / IPsec EthSM->TcpIp TcpIp_RequestComMode SoAd SoAd (Socket-Owner SOAD) SoAd->TcpIp TcpIp_SoAdGetSocket, TcpIp_Bind, TcpIp_TcpTransmit, TcpIp_UdpTransmit CDD CDD (Socket-Owner CDD) CDD->TcpIp TcpIp_<Up>GetSocket, Transmit-Dienste TcpIp->SoAd SoAd_RxIndication, SoAd_TxConfirmation, SoAd_TcpAccepted, SoAd_LocalIpAddrAssignmentChg TcpIp->CDD konfigurierte Callback-Namen EthIf EthIf TcpIp->EthIf EthIf_ProvideTxBuffer, EthIf_Transmit Det DET TcpIp->Det Entwicklungs- und Laufzeitfehler Csm CSM (optional) TcpIp->Csm Krypto-Dienste (TLS) IdsM IdsM (optional) TcpIp->IdsM Sicherheitsereignisse NvM NvM-Block (TCPIP_STORE) TcpIp->NvM gespeicherte IP-Adressen EthIf->TcpIp TcpIp_RxIndication

Kontextdiagramm: TcpIp liegt zwischen den Socket-Ownern und EthIf, wird vom EthSM gesteuert und meldet an DET und IdsM. Quellen: [SWS_TCPIP_00220], [SWS_TCPIP_00070], [SWS_TCPIP_00361], SWS TcpIp S. 17

Den Kommunikationszustand führt TcpIp für jeden EthIf-Controller getrennt [SWS_TCPIP_00083]. Der EthSM fordert per TcpIp_RequestComMode einen der Zustände ONLINE, ONHOLD oder OFFLINE an [SWS_TCPIP_00070]. STARTUP und SHUTDOWN sind Durchgangszustände und können nicht angefordert werden [SWS_TCPIP_00089]. ONLINE startet die Adresszuweisung. ONHOLD behält Sockets und Adressen, nimmt aber keine Sendeaufträge an. OFFLINE schließt die Sockets ([SWS_TCPIP_00075], [SWS_TCPIP_00074], [SWS_TCPIP_00072]).

zustand Start Start OFFLINE TCPIP_STATE_OFFLINE Start->OFFLINE TcpIp_Init() STARTUP TCPIP_STATE_STARTUP OFFLINE->STARTUP RequestComMode(ONLINE) / Adresszuweisungen aktivieren STARTUP->OFFLINE RequestComMode(OFFLINE) / Zuweisungen abbrechen ONLINE TCPIP_STATE_ONLINE STARTUP->ONLINE erste Adresse zugewiesen / <Up>_LocalIpAddrAssignmentChg(ASSIGNED) ONHOLD TCPIP_STATE_ONHOLD ONLINE->ONHOLD RequestComMode(ONHOLD) / ...(ONHOLD), Kommunikation deaktivieren SHUTDOWN TCPIP_STATE_SHUTDOWN ONLINE->SHUTDOWN RequestComMode(OFFLINE) oder alle Adressen freigegeben / ...(UNASSIGNED), Sockets schließen ONHOLD->ONLINE RequestComMode(ONLINE) / reaktivieren, ...(ASSIGNED) ONHOLD->SHUTDOWN RequestComMode(OFFLINE) / ...(UNASSIGNED) SHUTDOWN->OFFLINE Ressourcen freigegeben

Zustandsdiagramm: Ein Controller wird erst ONLINE, wenn ihm eine Adresse zugewiesen ist. Den Weg nach OFFLINE geht er über SHUTDOWN, in dem die Ressourcen freigegeben werden. Quellen: [SWS_TCPIP_00085], [SWS_TCPIP_00077], [SWS_TCPIP_00087], SWS TcpIp S. 60

Die Adressen stammen aus einer konfigurierten Tabelle lokaler Adressen. Sie werden statisch, per DHCP oder als Link-Local zugewiesen, nach Priorität ausgewählt und auf Wunsch im NvM gespeichert ([SWS_TCPIP_00099], [SWS_TCPIP_00065], [SWS_TCPIP_00127], [SWS_TCPIP_00219]). Über Änderungen informiert <Up_LocalIpAddrAssignmentChg> die obere Schicht [SWS_TCPIP_00229]. Sockets werden angefordert und mit TcpIp_Bind gebunden. TCP-Verbindungen entstehen per TcpIp_TcpConnect oder TcpIp_TcpListen ([SWS_TCPIP_00111], [SWS_TCPIP_00112], [SWS_TCPIP_00113]).

Gesendet wird asynchron über TcpIp_TcpTransmit oder synchron über TcpIp_UdpTransmit. Bei TCP übergibt die obere Schicht die Daten direkt oder stellt sie über <Up_CopyTxData> bereit ([SWS_TCPIP_00124], [SWS_TCPIP_00120]). Empfangene Datagramme ordnet TcpIp über lokale Adresse und Port einem Socket zu [SWS_TCPIP_00170]. Fehlt die MAC-Adresse des Ziels, legt TcpIpArpPacketQueueEnabled fest, ob das Paket eingereiht oder abgewiesen wird [SWS_TCPIP_00192]. Laufzeitfehler wie Timeouts, unerreichbare Hosts oder Adresskonflikte meldet TcpIp an den DET. In R20-11 sind dafür die Codes 0x01 bis 0x05 definiert [SWS_TCPIP_00255]. Zur Absicherung kommen TLS ab Version 1.2 und IPsec mit IKEv2 hinzu ([SWS_TCPIP_00302], [SWS_TCPIP_00353]).

Rolle im Ethernet-Stack: Vermittler zwischen Socket-Ownern und EthIf

TcpIp bündelt die IP-basierte Kommunikation eines Classic-Steuergeräts in Teilmodulen [SWS_TCPIP_00052]. Für IPv4 sind IP, ARP, ICMP, DHCPv4 (Client und Server), Auto-IP, UDP und TCP gefordert ([SWS_TCPIP_00053], [SWS_TCPIP_00056], [SWS_TCPIP_00058], [SWS_TCPIP_00057], [SWS_TCPIP_00061]). Für IPv6 kommen IPv6, NDP, ICMPv6 und ein DHCPv6-Client hinzu ([SWS_TCPIP_00160], [SWS_TCPIP_00164], [SWS_TCPIP_00166]). Drei Skalierungsklassen schneiden den Umfang zu: IPv4-Stack, IPv6-Stack und Dual Stack SWS TcpIp S. 18. Für Klasse 3 ist der volle Umfang verbindlich [SWS_TCPIP_00150].

Nach oben bedient TcpIp Socket-Owner. Ist TcpIpSocketOwnerUpperLayerType auf SOAD gesetzt, heißen die Callbacks SoAd_…. Bei CDD gelten die konfigurierten Funktionsnamen ([SWS_TCPIP_00220], [SWS_TCPIP_00221]). Jeder Owner erhält eine eigene TcpIp_<Up>GetSocket-Funktion, und die so angeforderten Sockets gehören ihm exklusiv [SWS_TCPIP_00222].

Nach unten empfängt TcpIp Rahmen über TcpIp_RxIndication [SWS_TCPIP_00029]. Es sendet über EthIf_Transmit, und zwar stets mit TxConfirmation = FALSE [SWS_TCPIP_00131]. Den Zustand steuert der EthSM über TcpIp_RequestComMode SWS EthSM S. 27. Optional nutzt TcpIp CSM-Dienste [SWS_TCPIP_00028] und meldet Sicherheitsereignisse an den IdsM [SWS_TCPIP_00361]. Einen Überblick über die Einbettung gibt SWS TcpIp S. 17.

kontext EthSM EthSM TcpIp TcpIp IPv4 / ARP / ICMP / DHCP / Auto-IP IPv6 / NDP / ICMPv6 / DHCPv6 UDP / TCP / TLS / IPsec EthSM->TcpIp TcpIp_RequestComMode SoAd SoAd (Socket-Owner SOAD) SoAd->TcpIp TcpIp_SoAdGetSocket, TcpIp_Bind, TcpIp_TcpTransmit, TcpIp_UdpTransmit CDD CDD (Socket-Owner CDD) CDD->TcpIp TcpIp_<Up>GetSocket, Transmit-Dienste TcpIp->SoAd SoAd_RxIndication, SoAd_TxConfirmation, SoAd_TcpAccepted, SoAd_LocalIpAddrAssignmentChg TcpIp->CDD konfigurierte Callback-Namen EthIf EthIf TcpIp->EthIf EthIf_ProvideTxBuffer, EthIf_Transmit Det DET TcpIp->Det Entwicklungs- und Laufzeitfehler Csm CSM (optional) TcpIp->Csm Krypto-Dienste (TLS) IdsM IdsM (optional) TcpIp->IdsM Sicherheitsereignisse NvM NvM-Block (TCPIP_STORE) TcpIp->NvM gespeicherte IP-Adressen EthIf->TcpIp TcpIp_RxIndication

Kontextdiagramm: TcpIp liegt zwischen den Socket-Ownern (SoAd oder CDD) und EthIf. Es wird vom EthSM gesteuert, meldet Fehler an den DET und Ereignisse an den IdsM und nutzt optional den CSM. Quellen: [SWS_TCPIP_00220], [SWS_TCPIP_00222], [SWS_TCPIP_00029], [SWS_TCPIP_00070], [SWS_TCPIP_00028], [SWS_TCPIP_00361], [SWS_TCPIP_00255], [SWS_TCPIP_00219], SWS TcpIp S. 17

Controller-Zustände: von TCPIP_STATE_OFFLINE zu TCPIP_STATE_ONLINE

Initialisiert wird das Modul mit TcpIp_Init und einer implementierungsspezifischen TcpIp_ConfigType ([SWS_TCPIP_00002], [SWS_TCPIP_00067]). TcpIp_MainFunction ist der Einstiegspunkt für den Scheduler [SWS_TCPIP_00026]. Interpretation: Dort dürften zeitgesteuerte Vorgänge wie Timeouts ablaufen. Frage Q-77b083e447651768 (offen) Die Spezifikation sagt dazu nur „Schedules the TCP/IP stack“.

TcpIp führt für jeden EthIf-Controller einen eigenen Zustand: OFFLINE, STARTUP, ONLINE, ONHOLD oder SHUTDOWN [SWS_TCPIP_00083]. Weicht die gespeicherte Anforderung vom aktiven Zustand ab, leitet TcpIp die nötigen Schritte ein [SWS_TCPIP_00136].

  • Eine ONLINE-Anforderung aus OFFLINE aktiviert die konfigurierten Adresszuweisungen [SWS_TCPIP_00075]. Sobald eine Adresse zugewiesen ist, wechselt der Controller nach ONLINE [SWS_TCPIP_00085].
  • ONHOLD meldet für alle Adressen TCPIP_IPADDR_STATE_ONHOLD. Sockets und Adressen bleiben erhalten, neue Sendeaufträge werden aber nicht angenommen ([SWS_TCPIP_00076], [SWS_TCPIP_00074]). Die Rückkehr nach ONLINE meldet wieder TCPIP_IPADDR_STATE_ASSIGNED [SWS_TCPIP_00086].
  • Eine OFFLINE-Anforderung oder die Freigabe aller Adressen meldet TCPIP_IPADDR_STATE_UNASSIGNED und schließt die Sockets ([SWS_TCPIP_00077], [SWS_TCPIP_00072]). Sind die Ressourcen freigegeben, folgt OFFLINE [SWS_TCPIP_00087].
zustand Start Start OFFLINE TCPIP_STATE_OFFLINE Start->OFFLINE TcpIp_Init() STARTUP TCPIP_STATE_STARTUP OFFLINE->STARTUP RequestComMode(ONLINE) / Adresszuweisungen aktivieren STARTUP->OFFLINE RequestComMode(OFFLINE) / Zuweisungen abbrechen ONLINE TCPIP_STATE_ONLINE STARTUP->ONLINE erste Adresse zugewiesen / <Up>_LocalIpAddrAssignmentChg(ASSIGNED) ONHOLD TCPIP_STATE_ONHOLD ONLINE->ONHOLD RequestComMode(ONHOLD) / ...(ONHOLD), Kommunikation deaktivieren SHUTDOWN TCPIP_STATE_SHUTDOWN ONLINE->SHUTDOWN RequestComMode(OFFLINE) oder alle Adressen freigegeben / ...(UNASSIGNED), Sockets schließen ONHOLD->ONLINE RequestComMode(ONLINE) / reaktivieren, ...(ASSIGNED) ONHOLD->SHUTDOWN RequestComMode(OFFLINE) / ...(UNASSIGNED) SHUTDOWN->OFFLINE Ressourcen freigegeben

Zustandsdiagramm: Jeder EthIf-Controller hat einen eigenen Zustandsautomaten. Anforderbar sind nur ONLINE, ONHOLD und OFFLINE, STARTUP und SHUTDOWN sind Durchgangszustände. Quellen: [SWS_TCPIP_00075], [SWS_TCPIP_00085], [SWS_TCPIP_00076], [SWS_TCPIP_00086], [SWS_TCPIP_00077], [SWS_TCPIP_00087], [SWS_TCPIP_00088], SWS TcpIp S. 60 (Schaubild aus R25-11, Übergänge durch die R20-11-Requirements gedeckt)

In STARTUP bricht eine OFFLINE-Anforderung laufende Zuweisungen ab [SWS_TCPIP_00088]. Fordert jemand STARTUP oder SHUTDOWN an, wird das mit E_NOT_OK abgewiesen [SWS_TCPIP_00089].

Ein typischer Hochlauf verläuft so: Der EthSM fordert auf Wunsch des ComM ONLINE an SWS EthSM S. 42. TcpIp meldet danach die zugewiesene Adresse. Daraufhin fordert der SoAd Sockets an und bindet sie ([SWS_TCPIP_00229], SWS SoAd S. 20). Das Schaubild aus R25-11 zeigt außerdem eine Rückmeldung per EthSM_TcpIpModeIndication SWS TcpIp S. 60. Für R20-11 dürfte das ebenso gelten. Frage Q-a5e26ad792c23d58 (offen)

Hochlauf eines Controllers bis zum gebundenen SocketComMEthSMTcpIpSoAdEthSM_RequestComMode(network,COMM_FULL_COMMUNICATION)TcpIp_RequestComMode(CtrlIdx,TCPIP_STATE_ONLINE)E_OK (Auftrag angenommen)TCPIP_STATE_STARTUP:Adresszuweisungen aktivierenasynchron, z. B. DHCP oder Link-Localerste Adresse zugewiesen:TCPIP_STATE_ONLINESoAd_LocalIpAddrAssignmentChg(IpAddrId,TCPIP_IPADDR_STATE_ASSIGNED)EthSM_TcpIpModeIndication(CtrlIdx,TCPIP_STATE_ONLINE) (vermutlich)Use Case: SoAd öffnet eine Socket-VerbindungTcpIp_SoAdGetSocket(Domain, Protocol,SocketIdPtr)E_OK, SocketIdTcpIp_Bind(SocketId, LocalAddrId, PortPtr)E_OK

Sequenzdiagramm: Erst die asynchrone Adresszuweisung macht den Controller ONLINE. Danach kann der SoAd Sockets anfordern und binden. Quellen: [SWS_TCPIP_00070], [SWS_TCPIP_00075], [SWS_TCPIP_00085], [SWS_TCPIP_00229], [SWS_TCPIP_00018], [SWS_TCPIP_00015], SWS EthSM S. 42. Die Rückmeldung an den EthSM ist vermutlich auch in R20-11 vorhanden.

Lokale Adressen und ihre Zuweisung

Grundlage ist eine Tabelle lokaler Adressen aus TcpIpLocalAddr, die zur Laufzeit EthIf-Controllern zugeordnet werden ([SWS_TCPIP_00099], SWS TcpIp S. 220). Ein Eintrag wird über TcpIp_LocalAddrIdType angesprochen [SWS_TCPIP_00030]. Je Eintrag sind mehrere Verfahren möglich, etwa statisch, DHCP oder Link-Local ([SWS_TCPIP_00065], SWS TcpIp S. 224). Wird eine Adresse mit höherer Priorität verfügbar, ersetzt sie die bisherige [SWS_TCPIP_00127].

Wie Zuweisung und Freigabe ausgelöst werden, hängt vom konfigurierten Trigger ab:

Jede Änderung einer Zuweisung meldet <Up_LocalIpAddrAssignmentChg> mit einem Wert vom Typ TcpIp_IpAddrStateType ([SWS_TCPIP_00229], [SWS_TCPIP_00082]). Neue IPv4-Adressen kündigt TcpIp per Gratuitous ARP an [SWS_TCPIP_00093]. IPv6-Adressen prüft es per Duplicate Address Detection [SWS_TCPIP_00159]. Zur Abfrage dienen TcpIp_GetIpAddr, TcpIp_GetPhysAddr und TcpIp_GetCtrlIdx ([SWS_TCPIP_00032], [SWS_TCPIP_00033], [SWS_TCPIP_00141]). Fragt man eine DHCP-Option ab, die nicht gesetzt ist, liefert der Lesedienst Länge 0 [SWS_TCPIP_00237].

Sockets: anfordern, binden, verbinden, schließen

Einen Socket fordert man mit Adressfamilie und Protokoll an ([SWS_TCPIP_00018], [SWS_TCPIP_00009], [SWS_TCPIP_00010]). TcpIp_Bind bindet ihn an eine lokale Adresse und einen Port [SWS_TCPIP_00111]. Das scheitert, wenn Port, Protokoll und Adresse schon belegt sind oder die Adresse nicht zugewiesen ist ([SWS_TCPIP_00146], [SWS_TCPIP_00254]). Mit TCPIP_PORT_ANY wählt der Stack selbst einen Port zwischen 49152 und 65535 SWS TcpIp S. 85.

Für TCP gibt es zwei Wege zur Verbindung:

  • Als Client baut TcpIp_TcpConnect die Verbindung asynchron auf. Steht sie, ruft TcpIp <Up_TcpConnected> ([SWS_TCPIP_00112], [SWS_TCPIP_00227]).
  • Als Server setzt TcpIp_TcpListen den Socket in den Listen-Zustand [SWS_TCPIP_00113]. Für jede eingehende Verbindung leitet TcpIp einen eigenen Socket ab und meldet ihn mit <Up_TcpAccepted> [SWS_TCPIP_00226]. Gibt die obere Schicht E_NOT_OK zurück, schließt TcpIp die Verbindung SWS SoAd S. 81.

Neue TCP-Verbindungen nimmt TcpIp nur im Zustand ONLINE an [SWS_TCPIP_00094].

TCP-Verbindungsaufbau als Client und als ServerSoAdTcpIpEthIfaltClient (aktives Öffnen)TcpIp_TcpConnect(SocketId, RemoteAddrPtr)E_OK (asynchron)EthIf_ProvideTxBuffer / EthIf_Transmit(SYN)TcpIp_RxIndication(...)(Antwort der Gegenstelle)SoAd_TcpConnected(SocketId)Server (passives Öffnen)TcpIp_TcpListen(SocketId, MaxChannels)E_OKTcpIp_RxIndication(...)(Verbindungsanfrage)Socket SocketIdConnected ableiten(höchstens MaxChannels parallel)SoAd_TcpAccepted(SocketId,SocketIdConnected, RemoteAddrPtr)E_OK / E_NOT_OK (Verbindung schließen)

Sequenzdiagramm: Der Client erhält eine Bestätigung über <Up_TcpConnected>. Der Server bekommt je Verbindung einen abgeleiteten Socket, den die obere Schicht annehmen oder ablehnen kann. Quellen: [SWS_TCPIP_00022], [SWS_TCPIP_00023], [SWS_TCPIP_00226], [SWS_TCPIP_00227], SWS TcpIp S. 129 (das spätere Schaubild enthält zusätzlich LSduR, das hier entfällt), SWS TcpIp S. 107

TcpIp_Close beendet eine TCP-Verbindung regulär. Mit Abort = TRUE bricht es sie sofort per RST ab. Bei UDP werden die Ressourcen sofort frei ([SWS_TCPIP_00109], [SWS_TCPIP_00110]). Ereignisse wie Reset, FIN oder Schließen meldet <Up_TcpIpEvent> [SWS_TCPIP_00144]. Mit TcpIp_ChangeParameter lassen sich Socket-Parameter ändern, etwa Empfangsfenster, Rahmenpriorität, Nagle, TCP-Optionsfilter oder UDP-Prüfsumme ([SWS_TCPIP_00126], [SWS_TCPIP_00266], [SWS_TCPIP_00279]).

Datenpfade: Senden, Empfangen, Adressauflösung

TcpIp_TcpTransmit arbeitet asynchron. Ist DataPtr gesetzt, übernimmt es die Daten aus diesem linearen Puffer. Ist DataPtr ein NULL_PTR, holt es die Daten per <Up_CopyTxData>. Mit ForceRetrieve = TRUE sind das genau AvailableLength Bytes, mit FALSE eventuell weniger ([SWS_TCPIP_00124], [SWS_TCPIP_00125], [SWS_TCPIP_00228]). Bei TCP ruft TcpIp <Up_TxConfirmation> erst, wenn die Gegenstelle quittiert hat ([SWS_TCPIP_00225], SWS SoAd S. 86). TcpIp_UdpTransmit sendet dagegen synchron und sofort ([SWS_TCPIP_00025], [SWS_TCPIP_00120]).

TCP-Senden mit direkter oder indirekter DatenbereitstellungSoAdTcpIpEthIfTcpIp_TcpTransmit(SocketId, DataPtr,AvailableLength, ForceRetrieve)altDataPtr != NULL_PTRDaten aus linearem Puffer übernehmenDataPtr == NULL_PTRloopbis AvailableLength (ForceRetrieve = TRUE) oder weniger (FALSE)SoAd_CopyTxData(SocketId, BufPtr, BufLength)BUFREQ_OKE_OKTcpIp_MainFunction()EthIf_ProvideTxBuffer(...)EthIf_Transmit(..., TxConfirmation = FALSE)TcpIp_RxIndication(...)(ACK der Gegenstelle)SoAd_TxConfirmation(SocketId, Length)

Sequenzdiagramm: Daten werden direkt übergeben oder per Kopier-Callback geholt. Der Versand an EthIf läuft im Kontext der MainFunction, die Bestätigung kommt erst nach dem ACK der Gegenstelle. Quellen: [SWS_TCPIP_00050], [SWS_TCPIP_00123], [SWS_TCPIP_00124], [SWS_TCPIP_00131], SWS TcpIp S. 109

Beim Empfang ordnet die IP-Schicht jedes Datagramm einem Eintrag der lokalen Adresstabelle zu [SWS_TCPIP_00169]. UDP und TCP wählen dann den Socket über Zielport und lokale Adresse ([SWS_TCPIP_00170], [SWS_TCPIP_00172]). Bei bestehenden TCP-Verbindungen müssen zusätzlich Quelladresse und Quellport passen [SWS_TCPIP_00173]. UDP-Broadcasts gehen an alle passenden Sockets, TCP-Segmente an Broadcast-Adressen werden verworfen ([SWS_TCPIP_00171], [SWS_TCPIP_00174]). Fragmentierte Datagramme setzt TcpIp wieder zusammen und darf den Empfang dafür entkoppeln ([SWS_TCPIP_00054], SWS TcpIp S. 131). Die Daten erreichen die obere Schicht über <Up_RxIndication>. Hat sie TCP-Daten verarbeitet, öffnet TcpIp_TcpReceived das Empfangsfenster wieder ([SWS_TCPIP_00223], [SWS_TCPIP_00115]).

Empfang eines Datagramms bis zur oberen SchichtEthIfTcpIpSoAdEthIf_MainFunctionRx()TcpIp_RxIndication(CtrlIdx, FrameType,IsBroadcast, PhysAddrPtr, DataPtr, LenByte)IP: Datagramm einer TcpIpAddrId zuordnenUDP/TCP: Socket über Zielport und lokale Adresse wählenFragmente: Reassemblierung,Empfang ggf. entkoppeltSoAd_RxIndication(SocketId, RemoteAddrPtr,BufPtr, Length)optTCP-SocketTcpIp_TcpReceived(SocketId, Length)Empfangsfenster vergrößern

Sequenzdiagramm: Ein empfangener Rahmen wird über die lokale Adresse und den Port einem Socket zugeordnet. Bei TCP gibt die Quittung der oberen Schicht das Empfangsfenster frei. Quellen: [SWS_TCPIP_00029], [SWS_TCPIP_00169], [SWS_TCPIP_00170], [SWS_TCPIP_00223], [SWS_TCPIP_00115], SWS TcpIp S. 108

Zum Senden braucht TcpIp die MAC-Adresse des Ziels und hält sie in einer ARP-Tabelle:

Jede Änderung der ARP-Tabelle meldet TcpIp über <Up_PhysAddrTableChg> [SWS_TCPIP_00142]. Ist der Neighbor Cache voll, wird der älteste Eintrag verdrängt [SWS_TCPIP_00264]. Abfragen erlauben TcpIp_GetRemotePhysAddr und die Cache-Lesedienste ([SWS_TCPIP_00138], [SWS_TCPIP_91002], [SWS_TCPIP_91001]).

adressaufloesung A IPv4-Paket an entfernten Host senden B Link-Layer-Adresse in ARP-Tabelle? A->B C Paket senden B->C ja D Adressauflösung starten (höchstens eine ARP-Anfrage je Ziel innerhalb TcpIpArpRequestTimeout) B->D nein E TcpIpArpPacketQueueEnabled? D->E F Paket einreihen, E_OK E->F TRUE G Sendeauftrag abweisen, E_NOT_OK E->G FALSE H ARP-Antwort empfangen: Tabelle aktualisieren, <Up>_PhysAddrTableChg(valid = TRUE) F->H H->C eingereihtes Paket (Interpretation)

Aktivitätsdiagramm: Fehlt beim Senden ein ARP-Eintrag, wird das Paket je nach Konfiguration eingereiht oder abgewiesen. Neue Anfragen an dasselbe Ziel werden gedrosselt. Quellen: [SWS_TCPIP_00191], [SWS_TCPIP_00192], [SWS_TCPIP_00350], [SWS_TCPIP_00142], SWS TcpIp S. 176. Interpretation: Das eingereihte Paket wird nach erfolgreicher Auflösung gesendet.

Absicherung und Filterung: TLS, IPsec, IdsM

Für TCP-Verbindungen unterstützt TcpIp TLS nach IETF RFC 5246. Versionen unter 1.2 werden abgewiesen ([SWS_TCPIP_00300], [SWS_TCPIP_00302]). PSK-Identitäten und die aktuelle Zeit liefern konfigurierbare Callouts ([SWS_TCPIP_91014], [SWS_TCPIP_91012]). Die Kryptografie läuft über den CSM ([SWS_TCPIP_00028], SWS TcpIp S. 251).

IPsec wird mit IKEv2 unterstützt, IKEv1 nicht ([SWS_TCPIP_00352], [SWS_TCPIP_00353]). Jedes Datagramm wird einer Policy zugeordnet und je nach Policy geschützt, durchgelassen oder verworfen ([SWS_TCPIP_00359], [SWS_TCPIP_00360]). Unzulässige IPv6-Extension-Header führen zum stillen Verwerfen [SWS_TCPIP_00260]. Ist TcpIpEnableSecurityEventReporting gesetzt, meldet TcpIp Sicherheitsereignisse an den IdsM [SWS_TCPIP_00361].

Verhalten im Fehlerfall

Die Entwicklungsfehler, darunter TCPIP_E_UNINIT, TCPIP_E_PARAM_POINTER, TCPIP_E_INV_ARG und TCPIP_E_ADDRINUSE, sind in [SWS_TCPIP_00042] definiert. Geprüft werden unter anderem:

Einige Ablehnungen gibt TcpIp unabhängig von der Fehlererkennung als E_NOT_OK zurück, zum Beispiel einen bereits belegten Port oder eine unpassende Adressfamilie ([SWS_TCPIP_00146], [SWS_TCPIP_00205]).

Laufzeitfehler meldet TcpIp per Det_ReportRuntimeError:

R20-11 definiert nur die Codes 0x01 bis 0x05 [SWS_TCPIP_00255]. Die in späteren Releases hinzugekommenen Codes TCPIP_E_TX_QUEUE_OVERRUN und TCPIP_E_TX_INTERNAL_PROCESSING_FAILED gelten hier nicht SWS TcpIp S. 65.

Viele Fehlerfälle bleiben still, weil unpassende Pakete einfach verworfen werden. TcpIp_GetAndResetMeasurementData zählt solche verworfenen Pakete und setzt die Zähler zurück ([SWS_TCPIP_91006], [SWS_TCPIP_00296]). Kann eine MAC-Adresse nicht aufgelöst werden, meldet TcpIp TCPIP_E_PHYS_ADDR_MISS [SWS_TCPIP_00066]. Für Ziele außerhalb des eigenen Subnetzes liefert TcpIp_GetRemotePhysAddr sofort TCPIP_E_NOT_OK [SWS_TCPIP_00139].

Weiterführende Detailbelege

KI-generierter Leitfaden auf Basis der Spezifikationsauszüge. Normativ für R20-11 sind ausschließlich die verlinkten Requirements, Abweichungen anderer Releases sind benannt.

TCP/IP Stack (TcpIp)

Provides IPv4/IPv6 networking, TCP/UDP sockets, ARP, ICMP, and DHCP services.

Funktionen — Übersicht

Typen — Übersicht

Funktionen & Typen — Detailansicht

function TcpIp_Init [SWS_TCPIP_00002] 📄 PDF

void TcpIp_Init (const TcpIp_ConfigType* ConfigPtr);

This service initializes the TCP/ IP Stack. Tcp Ip_ Init may not block the start - up process for an indefinite amount of time. Caveats: The call of this service is mandatory before using the Tcp Ip instance for further processing.

function TcpIp_TcpConnect [SWS_TCPIP_00022] 📄 PDF

Std_ReturnType TcpIp_TcpConnect (TcpIp_SocketIdType SocketId, const TcpIp_SockAddrType* RemoteAddrPtr);

B y this API service the TCP/ IP stack is requested to establish a TCP connection to the configured peer.

function TcpIp_TcpListen [SWS_TCPIP_00023] 📄 PDF

Std_ReturnType TcpIp_TcpListen (TcpIp_SocketIdType SocketId, uint16 MaxChannels);

By this API service the TCP/ IP stack is requested to listen on the TCP socket specified by the socket identifier. Available v ia Tcp Ip.h

function TcpIp_RequestComMode [SWS_TCPIP_00070] 📄 PDF

Std_ReturnType TcpIp_RequestComMode (uint8 CtrlIdx, TcpIp_StateType State);

By this API service the TCP/ IP stack is requested to change the Tcp Ip state of the communication network identified by Eth If controller index.

function TcpIp_RequestIpAddrAssignment [SWS_TCPIP_00037] 📄 PDF

Std_ReturnType TcpIp_RequestIpAddrAssignment (TcpIp_LocalAddrIdType LocalAddrId, TcpIp_IpAddrAssignmentTypeType, const TcpIp_SockAddrType* LocalIpAddrPtr, uint8 Netmask, const TcpIp_SockAddrType* DefaultRouterPtr);

Service TcpIp_RequestIpAddrAssignment.

function TcpIp_ReleaseIpAddrAssignment [SWS_TCPIP_00078] 📄 PDF

Std_ReturnType TcpIp_ReleaseIpAddrAssignment (TcpIp_LocalAddrIdType LocalAddrId);

By this API service the local IP address assignment for the IP address specified by Local Addr Id shall be released.

function TcpIp_IcmpV6Transmit [SWS_TCPIP_00187] 📄 PDF

Std_ReturnType TcpIp_IcmpV6Transmit (TcpIp_LocalAddrIdType LocalIpAddrId, const TcpIp_SockAddrType* RemoteAddrPtr, uint8 HopLimit, uint8Type, uint8 Code, uint16 DataLength, const uint8* DataPtr); ⚠️

By this API service the TCP/ IP stack sends an ICMPv6 message according to the specified parameters.

function TcpIp_DhcpReadOption [SWS_TCPIP_00040] 📄 PDF

Std_ReturnType TcpIp_DhcpReadOption (TcpIp_LocalAddrIdType LocalIpAddrId, uint8 Option, uint8* DataLength, uint8* DataPtr);

By this API service the TCP/ IP stack retrieves DHCP option data identified by parameter option for already received DHCP options.

function TcpIp_DhcpV6ReadOption [SWS_TCPIP_00189] 📄 PDF

Std_ReturnType TcpIp_DhcpV6ReadOption (TcpIp_LocalAddrIdType LocalIpAddrId, uint16 Option, uint16* DataLength, uint8* DataPtr);

By this API service the TCP/ IP stack retrieve s DHCPv6 option data identified by parameter option for already received DHCPv6 options.

function TcpIp_DhcpWriteOption [SWS_TCPIP_00020] 📄 PDF

Std_ReturnType TcpIp_DhcpWriteOption (TcpIp_LocalAddrIdType LocalIpAddrId, uint8 Option, uint8 DataLength, const uint8* DataPtr);

By this API service the TCP/ IP stack writes the DHCP option data identified by parameter option.

function TcpIp_DhcpV6WriteOption [SWS_TCPIP_00190] 📄 PDF

Std_ReturnType TcpIp_DhcpV6WriteOption (TcpIp_LocalAddrIdType LocalIpAddrId, uint16 Option, uint16 DataLength, const uint8* DataPtr);

By this API service the TCP/ IP stack writes the DHCPv6 option data identified by parameter option.

function TcpIp_ChangeParameter [SWS_TCPIP_00016] 📄 PDF

Std_ReturnType TcpIp_ChangeParameter (TcpIp_SocketIdType SocketId, TcpIp_ParamIdType ParameterId, const uint8* ParameterValue);

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.

function TcpIp_GetIpAddr [SWS_TCPIP_00032] 📄 PDF

Std_ReturnType TcpIp_GetIpAddr (TcpIp_LocalAddrIdType LocalAddrId, TcpIp_SockAddrType* IpAddrPtr, uint8* NetmaskPtr, TcpIp_SockAddrType* DefaultRouterPtr);

Service TcpIp_GetIpAddr.

function TcpIp_GetPhysAddr [SWS_TCPIP_00033] 📄 PDF

Std_ReturnType TcpIp_GetPhysAddr (TcpIp_LocalAddrIdType LocalAddrId, uint8* PhysAddrPtr);

Obtains the physical source address used by the Eth If controller implicitly specif ied via Local Addr Id.

function TcpIp_GetRemotePhysAddr [SWS_TCPIP_00137] 📄 PDF

TcpIp_ReturnType TcpIp_GetRemotePhysAddr (uint8 CtrlIdx, const TcpIp_SockAddrType* IpAddrPtr, uint8* PhysAddrPtr, boolean InitRes);

Tcp Ip_ Get Remote Phys Addr queries the IP/ physical address translation table specified by Ctrl Idx and returns the physical address related to the IP addres s specified by Ip Addr Ptr. In case no physical address can be retrieved and parameter init Res is TRUE, address resolution for the specified IP address is initiated on the local network.

function TcpIp_GetCtrlIdx [SWS_TCPIP_00140] 📄 PDF

Std_ReturnType TcpIp_GetCtrlIdx (TcpIp_LocalAddrIdType LocalAddrId, uint8* CtrlIdxPtr);

Tcp Ip_ Get Ctrl Idx returns the index of the controller related to Local Addr Id.

function TcpIp_GetArpCacheEntries [SWS_TCPIP_91002] 📄 PDF

Std_ReturnType TcpIp_GetArpCacheEntries (AUTO SAR CP R20 - of uint8 ctrlIdx, uint32* numberOfElements, TcpIp_ArpCacheEntryType* entryListPtr); ⚠️

Copies entries from the physic al address cache of the IPv4 instance that is active on the Eth If controller specified by ctrl Idx into a user provided buffer. The function will copy all or number Of

function TcpIp_GetNdpCacheEntries [SWS_TCPIP_91001] 📄 PDF

Std_ReturnType TcpIp_GetNdpCacheEntries (uint8 ctrlIdx, uint32* numberOfElements, TcpIp_NdpCacheEntryType* entryListPtr);

Copies entries from the physic al address cache of the IPv6 instance that is active on the Eth If controller specified by ctrl Idx into a user provided buffer. The function will copy all or number Of

function TcpIp_GetAndResetMeasurementData [SWS_TCPIP_91006] 📄 PDF

Std_ReturnType TcpIp_GetAndResetMeasurementData (TcpIp_MeasurementIdxType MeasurementIdx, boolean MeasurementResetNeeded, uint32* MeasurementDataPtr);

Allows to read and reset detailed measurement data for diagnostic purposes. Get all Measurement Idx's at once is not supported. TCPIP_ MEAS_ ALL shall only be used to reset all Measurement Idx's at once. A NULL_ PTR shall be provided for Measurement Data Ptr in this case.

function TcpIp_UdpTransmit [SWS_TCPIP_00025] 📄 PDF

Std_ReturnType TcpIp_UdpTransmit (TcpIp_SocketIdType SocketId, const uint8* DataPtr, const TcpIp_SockAddrType* RemoteAddrPtr, uint16 TotalLength);

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 Eth If.

function TcpIp_MainFunction [SWS_TCPIP_00026] 📄 PDF

void TcpIp_MainFunction (void);

Schedules the TCP/ IP stack. (Entry point for scheduling) AUTO SAR CP R20 - of Document ID : AUTOSAR_SWS_TcpIp

function <Up_PhysAddrTableChg> [SWS_TCPIP_00143] 📄 PDF

void <Up_PhysAddrTableChg> (uint8 CtrlIdx, const TcpIp_SockAddrType* IpAddrPtr, const uint8* PhysAddrPtr, boolean valid);

This API is called by Tcp Ip in case of a change in the ARP/ NDP table related to the controller specified by Ctrl Idx.

function <Up_RxIndication> [SWS_TCPIP_00223] 📄 PDF

void <Up_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.

function <Up_TxConfirmation> [SWS_TCPIP_00225] 📄 PDF

void <Up_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.

function <Up_TcpAccepted> [SWS_TCPIP_00226] 📄 PDF

Std_ReturnType <Up_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: T he TCP/ IP stack calls this function after a socket was set into the listen state with Tcp Ip_ Tcp Listen() and a TCP connection is requested by the peer.

function <Up_TcpConnected> [SWS_TCPIP_00227] 📄 PDF

void <Up_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 Tcp Ip_ Tcp Conn ect() and a TCP connection is confirmed by the peer. The parameter value of Socket Id equals the Socket Id value of the preceeding Tcp Ip_ Tcp Connect() call.

function <Up_CopyTxData> [SWS_TCPIP_00228] 📄 PDF

BufReq_ReturnType <Up_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 Tcp Ip_ Transmit(). Note: The call to _ Copy Tx Data() may happen in the context of Tcp Ip_ Transmit().

function <Up_LocalIpAddrAssignmentChg> [SWS_TCPIP_00229] 📄 PDF

void <Up_LocalIpAddrAssignmentChg> (TcpIp_LocalAddrIdType IpAddrId, TcpIp_IpAddrStateType State);

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).

function <Up_IcmpMsgHandler> [SWS_TCPIP_00270] 📄 PDF

void <Up_IcmpMsgHandler> (TcpIp_LocalAddrIdType LocalAddrId, const TcpIp_SockAddrType* RemoteAddrPtr, uint8 Ttl, uint8Type, uint8 Code, uint16 DataLength, uint8* DataPtr); ⚠️

By this API service the configured ICMP message handler function is called by the TCP/ IP stack on reception of a ICMP message which is not handled by the TCP/ IP stack.

function <Up_DADAddressConflict> [SWS_TCPIP_91005] 📄 PDF

void <Up_DADAddressConflict> (TcpIp_LocalAddrIdType IpAddrId, const TcpIp_SockAddrType* IpAddrPtr, const uint8* LocalPhysAddrPtr, const uint8* RemotePhysAddrPtr);

This API is called by Tcp Ip in case the Duplicate Address Detection (DAD) is enabled and detecting a duplicate IP Address.

function <Up_TlsGetCurrentTime> [SWS_TCPIP_91012] 📄 PDF

Std_ReturnType <Up_TlsGetCurrentTime> (uint32* CurrentTimeUtc);

This function queries the current time. This information will be requested when assembling the client hello message.

function <Up_TlsServerGetPskIdentityHint> [SWS_TCPIP_91013] 📄 PDF

Std_ReturnType <Up_TlsServerGetPskIdentityHint> (TcpIp_SocketIdType SocketId, TcpIp_TlsConnectionIdType TlsConnectionId, uint16* IdentityHintLengthPtr, uint8* IdentityHintPtr);

Queries the Identity hint for a pr e - shared key ciphersuite. This information is transmitted by the TLS Server to provide its identification to the TLS client.

function <Up_TlsServerGetPskIdentity> [SWS_TCPIP_91015] 📄 PDF

Std_ReturnType <Up_TlsServerGetPskIdentity> (TcpIp_SocketIdType SocketId, TcpIp_TlsConnectionIdType TlsConnectionId, uint16 PskKeyIdentityLength, const uint8* PskKeyIdentityPtr, uint32* CsmKeyId);

This callback is used for the TLS server to provide the CSM key name according to the key identification that was selected by the TLS client. The TLS server must provide a Csm Key reference to a key that matches this key identification name.

type TcpIp_SockAddrType [SWS_TCPIP_00012] 📄 PDF

Generic structure used by APIs to specify an IP address. (A specific address type can be derived from this structure via a cast to the specific struct type.)

type TcpIp_SockAddrInetType [SWS_TCPIP_00013] 📄 PDF

This structure defines an IPv4 address type which can be derived from the generic address structure via cast.

type TcpIp_SockAddrInet6Type [SWS_TCPIP_00014] 📄 PDF

This structure defines a IPv6 address type which can be derived from the generic address structure via cast. AUTO SAR CP R20 - of Document ID : AUTOSAR_SWS_TcpIp

type TcpIp_LocalAddrIdType [SWS_TCPIP_00030] 📄 PDF

Address identification type for unique identification of a local IP address and Eth If Controller configured in the Tcp Ip module.

type TcpIp_SocketIdType [SWS_TCPIP_00038] 📄 PDF

Socket identifier type for unique identification of a Tcp Ip stack socket. TCPIP_ SOCKETID_ INVALID shall specify an invalid socket handle.

type TcpIp_TlsConnectionIdType [SWS_TCPIP_91011] 📄 PDF

TLS connection identifier type for unique identification of a TLS connection. TCPIP_ TLSCONNECTIONID_ INVALID shall specify an invalid TLS connection handle.

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

Record
AUTOSAR/AP/record/CP_MOD_TcpIp
Status
unspecified
Version
AUTOSAR/AP/record/CP_MOD_TcpIp@rel:R20-11#25e07b52
Content hash
25e07b52
Source
https://www.autosar.org/fileadmin/standards/R20-11/CP/AUTOSAR_SWS_TcpIp.pdf#nameddest=SWS_TCPIP_00002

Themenkarte

Detailansicht

Wähle in der Gliederung einen Eintrag aus.

Initialisierung und Status

Returns the version information.

void TcpIp_GetVersionInfo (Std_VersionInfoType* versioninfo);
TcpIp_Init function

This service initializes the TCP/ IP Stack. Tcp Ip_ Init may not block the start - up process for an indefinite amount of time. Caveats: The call of this service is mandatory before using the Tcp Ip instance for further processing.

void TcpIp_Init (const TcpIp_ConfigType* ConfigPtr);

Dienste · Get…

Allows to read and reset detailed measurement data for diagnostic purposes. Get all Measurement Idx's at once is not supported. TCPIP_ MEAS_ ALL shall only be used to reset all Measurement Idx's at once. A NULL_ PTR shall be provided for Measurement Data Ptr in this case.

Std_ReturnType TcpIp_GetAndResetMeasurementData (TcpIp_MeasurementIdxType MeasurementIdx, boolean MeasurementResetNeeded, uint32* MeasurementDataPtr);

Copies entries from the physic al address cache of the IPv4 instance that is active on the Eth If controller specified by ctrl Idx into a user provided buffer. The function will copy all or number Of

Std_ReturnType TcpIp_GetArpCacheEntries (AUTO SAR CP R20 - of uint8 ctrlIdx, uint32* numberOfElements, TcpIp_ArpCacheEntryType* entryListPtr); ⚠️

Tcp Ip_ Get Ctrl Idx returns the index of the controller related to Local Addr Id.

Std_ReturnType TcpIp_GetCtrlIdx (TcpIp_LocalAddrIdType LocalAddrId, uint8* CtrlIdxPtr);

Service TcpIp_GetIpAddr.

Std_ReturnType TcpIp_GetIpAddr (TcpIp_LocalAddrIdType LocalAddrId, TcpIp_SockAddrType* IpAddrPtr, uint8* NetmaskPtr, TcpIp_SockAddrType* DefaultRouterPtr);

Copies entries from the physic al address cache of the IPv6 instance that is active on the Eth If controller specified by ctrl Idx into a user provided buffer. The function will copy all or number Of

Std_ReturnType TcpIp_GetNdpCacheEntries (uint8 ctrlIdx, uint32* numberOfElements, TcpIp_NdpCacheEntryType* entryListPtr);

Obtains the physical source address used by the Eth If controller implicitly specif ied via Local Addr Id.

Std_ReturnType TcpIp_GetPhysAddr (TcpIp_LocalAddrIdType LocalAddrId, uint8* PhysAddrPtr);

Tcp Ip_ Get Remote Phys Addr queries the IP/ physical address translation table specified by Ctrl Idx and returns the physical address related to the IP addres s specified by Ip Addr Ptr. In case no physical address can be retrieved and parameter init Res is TRUE, address resolution for the specified IP address is initiated on the local network.

TcpIp_ReturnType TcpIp_GetRemotePhysAddr (uint8 CtrlIdx, const TcpIp_SockAddrType* IpAddrPtr, uint8* PhysAddrPtr, boolean InitRes);

Dienste · Dhcp…

By this API service the TCP/ IP stack retrieves DHCP option data identified by parameter option for already received DHCP options.

Std_ReturnType TcpIp_DhcpReadOption (TcpIp_LocalAddrIdType LocalIpAddrId, uint8 Option, uint8* DataLength, uint8* DataPtr);

By this API service the TCP/ IP stack retrieve s DHCPv6 option data identified by parameter option for already received DHCPv6 options.

Std_ReturnType TcpIp_DhcpV6ReadOption (TcpIp_LocalAddrIdType LocalIpAddrId, uint16 Option, uint16* DataLength, uint8* DataPtr);

By this API service the TCP/ IP stack writes the DHCPv6 option data identified by parameter option.

Std_ReturnType TcpIp_DhcpV6WriteOption (TcpIp_LocalAddrIdType LocalIpAddrId, uint16 Option, uint16 DataLength, const uint8* DataPtr);

By this API service the TCP/ IP stack writes the DHCP option data identified by parameter option.

Std_ReturnType TcpIp_DhcpWriteOption (TcpIp_LocalAddrIdType LocalIpAddrId, uint8 Option, uint8 DataLength, const uint8* DataPtr);

Dienste · Tcp…

B y this API service the TCP/ IP stack is requested to establish a TCP connection to the configured peer.

Std_ReturnType TcpIp_TcpConnect (TcpIp_SocketIdType SocketId, const TcpIp_SockAddrType* RemoteAddrPtr);

By this API service the TCP/ IP stack is requested to listen on the TCP socket specified by the socket identifier. Available v ia Tcp Ip.h

Std_ReturnType TcpIp_TcpListen (TcpIp_SocketIdType SocketId, uint16 MaxChannels);

By this API service the reception of socket data is confirmed to the TCP/ IP stack.

Std_ReturnType TcpIp_TcpReceived (TcpIp_SocketIdType SocketId, uint32 Length);

Service TcpIp_TcpTransmit.

Std_ReturnType TcpIp_TcpTransmit (TcpIp_SocketIdType SocketId, const uint8* DataPtr, uint32 AvailableLength, boolean ForceRetrieve);

Dienste · Weitere

TcpIp_Bind function

Service TcpIp_Bind.

Std_ReturnType TcpIp_Bind (TcpIp_SocketIdType SocketId, TcpIp_LocalAddrIdType LocalAddrId, uint16* PortPtr);

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.

Std_ReturnType TcpIp_ChangeParameter (TcpIp_SocketIdType SocketId, TcpIp_ParamIdType ParameterId, const uint8* ParameterValue);
TcpIp_Close function

By this API service the TCP/ IP stack is requested to close the socket and release all related resources.

Std_ReturnType TcpIp_Close (TcpIp_SocketIdType SocketId, boolean Abort);

Service TcpIp_IcmpTransmit.

Std_ReturnType TcpIp_IcmpTransmit (TcpIp_LocalAddrIdType LocalIpAddrId, AUTO SAR CP R20 - of const TcpIp_SockAddrType* RemoteAddrPtr, uint8 Ttl, uint8Type, uint8 Code, uint16 DataLength, const uint8* DataPtr); ⚠️

By this API service the TCP/ IP stack sends an ICMPv6 message according to the specified parameters.

Std_ReturnType TcpIp_IcmpV6Transmit (TcpIp_LocalAddrIdType LocalIpAddrId, const TcpIp_SockAddrType* RemoteAddrPtr, uint8 HopLimit, uint8Type, uint8 Code, uint16 DataLength, const uint8* DataPtr); ⚠️

By this API service the local IP address assignment for the IP address specified by Local Addr Id shall be released.

Std_ReturnType TcpIp_ReleaseIpAddrAssignment (TcpIp_LocalAddrIdType LocalAddrId);

By this API service the TCP/ IP stack is requested to change the Tcp Ip state of the communication network identified by Eth If controller index.

Std_ReturnType TcpIp_RequestComMode (uint8 CtrlIdx, TcpIp_StateType State);

Service TcpIp_RequestIpAddrAssignment.

Std_ReturnType TcpIp_RequestIpAddrAssignment (TcpIp_LocalAddrIdType LocalAddrId, TcpIp_IpAddrAssignmentTypeType, const TcpIp_SockAddrType* LocalIpAddrPtr, uint8 Netmask, const TcpIp_SockAddrType* DefaultRouterPtr);

Resets all learned IP - addresses to invalid values.

Std_ReturnType TcpIp_ResetIpAssignment (void);

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 Eth If.

Std_ReturnType TcpIp_UdpTransmit (TcpIp_SocketIdType SocketId, const uint8* DataPtr, const TcpIp_SockAddrType* RemoteAddrPtr, uint16 TotalLength);

Callbacks

By this API service the TCP/ IP stack gets an indication and the data of a received frame.

void TcpIp_RxIndication (uint8 CtrlIdx, Eth_FrameType FrameType, boolean IsBroadcast, const uint8* PhysAddrPtr, const uint8* DataPtr, uint16 LenByte);

Callouts und erwartete Schnittstellen

This service requests to copy data for transmission to the buffer indicated. This call is triggered by Tcp Ip_ Transmit(). Note: The call to _ Copy Tx Data() may happen in the context of Tcp Ip_ Transmit().

BufReq_ReturnType <Up_CopyTxData> (TcpIp_SocketIdType SocketId, uint8* BufPtr, uint16 BufLength);

This API is called by Tcp Ip in case the Duplicate Address Detection (DAD) is enabled and detecting a duplicate IP Address.

void <Up_DADAddressConflict> (TcpIp_LocalAddrIdType IpAddrId, const TcpIp_SockAddrType* IpAddrPtr, const uint8* LocalPhysAddrPtr, const uint8* RemotePhysAddrPtr);

By this API service the configured ICMP message handler function is called by the TCP/ IP stack on reception of a ICMP message which is not handled by the TCP/ IP stack.

void <Up_IcmpMsgHandler> (TcpIp_LocalAddrIdType LocalAddrId, const TcpIp_SockAddrType* RemoteAddrPtr, uint8 Ttl, uint8Type, uint8 Code, uint16 DataLength, uint8* DataPtr); ⚠️

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 <Up_LocalIpAddrAssignmentChg> (TcpIp_LocalAddrIdType IpAddrId, TcpIp_IpAddrStateType State);

This API is called by Tcp Ip in case of a change in the ARP/ NDP table related to the controller specified by Ctrl Idx.

void <Up_PhysAddrTableChg> (uint8 CtrlIdx, const TcpIp_SockAddrType* IpAddrPtr, const uint8* PhysAddrPtr, boolean valid);

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 <Up_RxIndication> (TcpIp_SocketIdType SocketId, const TcpIp_SockAddrType* RemoteAddrPtr, const uint8* BufPtr, uint16 Length);

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: T he TCP/ IP stack calls this function after a socket was set into the listen state with Tcp Ip_ Tcp Listen() and a TCP connection is requested by the peer.

Std_ReturnType <Up_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 Tcp Ip_ Tcp Conn ect() and a TCP connection is confirmed by the peer. The parameter value of Socket Id equals the Socket Id value of the preceeding Tcp Ip_ Tcp Connect() call.

void <Up_TcpConnected> (TcpIp_SocketIdType SocketId);

Service .

Std_ReturnType <Up_TlsClientGetPskIdentity> (TcpIp_SocketIdType SocketId, TcpIp_TlsConnectionIdType TlsConnectionId, uint16 PskIdentityHintLength, const uint8* PskIdentityHintPtr, uint16* PskKeyIdentityLengthPtr, uint8* PskKeyIdentityPtr, uint32* CsmKeyId);

This function queries the current time. This information will be requested when assembling the client hello message.

Std_ReturnType <Up_TlsGetCurrentTime> (uint32* CurrentTimeUtc);

This callback is used for the TLS server to provide the CSM key name according to the key identification that was selected by the TLS client. The TLS server must provide a Csm Key reference to a key that matches this key identification name.

Std_ReturnType <Up_TlsServerGetPskIdentity> (TcpIp_SocketIdType SocketId, TcpIp_TlsConnectionIdType TlsConnectionId, uint16 PskKeyIdentityLength, const uint8* PskKeyIdentityPtr, uint32* CsmKeyId);

Queries the Identity hint for a pr e - shared key ciphersuite. This information is transmitted by the TLS Server to provide its identification to the TLS client.

Std_ReturnType <Up_TlsServerGetPskIdentityHint> (TcpIp_SocketIdType SocketId, TcpIp_TlsConnectionIdType TlsConnectionId, uint16* IdentityHintLengthPtr, uint8* IdentityHintPtr);

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 <Up_TxConfirmation> (TcpIp_SocketIdType SocketId, uint16 Length);

Zyklisch

Schedules the TCP/ IP stack. (Entry point for scheduling) AUTO SAR CP R20 - of Document ID : AUTOSAR_SWS_TcpIp

void TcpIp_MainFunction (void);

Typen

Tcp Ip_ Arp Cache Entries elements type

Configuration data structure of the Tcp Ip module.

Tcp Ip address families.

Events reported by Tcp Ip.

IPv6 address assignment policy.

Specifies the state of local IP a ddress assignment

Address identification type for unique identification of a local IP address and Eth If Controller configured in the Tcp Ip module.

Index to select specific measurement data

Tcp Ip_ Ndp Cache Entries elements type

Type TcpIp_ParamIdType.

Protocol type used by a socket.

Tcp Ip specific return type.

This structure defines a IPv6 address type which can be derived from the generic address structure via cast. AUTO SAR CP R20 - of Document ID : AUTOSAR_SWS_TcpIp

This structure defines an IPv4 address type which can be derived from the generic address structure via cast.

Generic structure used by APIs to specify an IP address. (A specific address type can be derived from this structure via a cast to the specific struct type.)

Socket identifier type for unique identification of a Tcp Ip stack socket. TCPIP_ SOCKETID_ INVALID shall specify an invalid socket handle.

Specifies the Tcp Ip state for a specific Eth If controller.

TLS connection identifier type for unique identification of a TLS connection. TCPIP_ TLSCONNECTIONID_ INVALID shall specify an invalid TLS connection handle.

IP6 address wildcard.

IP address wildcard.

Local Addr Id wildcard.

Port wildcard.