DEENESPTFRRUARHIKOZHNL

TCP/IP Stack (TcpIp)

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

Guide du moduleGÉNÉRÉ PAR IA

Fournit, au sein de la pile Ethernet, la communication IP via TCP et UDP ainsi que la gestion des adresses pour les couches supérieures.
GÉNÉRÉ PAR IA non vérifié Modèle : claude-opus-5-5 · Effort : high · Température : non réglable · Prompt : 0a4cda5ef1d2 Provenance Questions ouvertes (3)
Ancre causale : R20-11 Valable à partir de R20-11 Synthétisé pour cette version de spécification.
traduit du guide allemandgemini-3.8-flash-low · 2026-10-13 · Original allemand

Fournit, au sein de la pile Ethernet, la communication IP via TCP et UDP ainsi que la gestion des adresses pour les couches supérieures.

Dans la pile Classic Ethernet, TcpIp fournit IPv4 et IPv6 avec ARP, NDP, ICMP et DHCP ainsi que UDP et TCP, desservant ainsi des détenteurs de sockets tels que SoAd [SWS_TCPIP_00052]. Pour chaque contrôleur EthIf, EthSM gère les états ONLINE, ONHOLD et OFFLINE. Un contrôleur ne passe à l'état ONLINE que lorsqu'une adresse locale lui est assignée [SWS_TCPIP_00085]. Les sockets sont demandés, liés et, dans le cas de TCP, connectés de manière active ou passive, les données transitant par des services d'émission et des callbacks. Contrainte majeure : TcpIp n'accepte de nouvelles connexions TCP qu'à l'état ONLINE, et rejette les nouvelles requêtes d'émission en ONHOLD.

Dans la pile Classic Ethernet, TcpIp est responsable de la communication IP. Il se compose de sous-modules pour IPv4 (avec ARP, ICMP, DHCP et Auto-IP), pour IPv6 (avec NDP, ICMPv6 et DHCPv6) ainsi que pour UDP, TCP et TLS ([SWS_TCPIP_00052], [SWS_TCPIP_00150]). Vers le haut, il dessert les détenteurs de sockets, c'est-à-dire le SoAd ou les CDD, avec ses propres fonctions TcpIp_<Up>GetSocket et callbacks ([SWS_TCPIP_00220], [SWS_TCPIP_00222]). Vers le bas, il échange des trames avec EthIf [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 Erreurs de développement et de runtime 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

Diagramme de contexte : TcpIp se situe entre les détenteurs de sockets et EthIf, est commandé par EthSM et signale à DET et IdsM. Sources : [SWS_TCPIP_00220], [SWS_TCPIP_00070], [SWS_TCPIP_00361], SWS TcpIp p. 17

TcpIp gère l'état de communication séparément pour chaque contrôleur EthIf [SWS_TCPIP_00083]. EthSM demande via TcpIp_RequestComMode l'un des états ONLINE, ONHOLD ou OFFLINE [SWS_TCPIP_00070]. STARTUP et SHUTDOWN sont des états transitoires et ne peuvent pas être demandés [SWS_TCPIP_00089]. ONLINE démarre l'assignation d'adresses. ONHOLD conserve les sockets et les adresses, mais n'accepte aucune requête d'émission. OFFLINE ferme les sockets ([SWS_TCPIP_00075], [SWS_TCPIP_00074], [SWS_TCPIP_00072]).

zustand Start commencer 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) ou toutes les adresses libérées / ...(UNASSIGNED), fermer les sockets ONHOLD->ONLINE RequestComMode(ONLINE) / reaktivieren, ...(ASSIGNED) ONHOLD->SHUTDOWN RequestComMode(OFFLINE) / ...(UNASSIGNED) SHUTDOWN->OFFLINE Ressourcen freigegeben

Diagramme d'état : un contrôleur ne passe ONLINE que lorsqu'une adresse lui est assignée. Il rejoint OFFLINE en passant par SHUTDOWN, état au cours duquel les ressources sont libérées. Sources : [SWS_TCPIP_00085], [SWS_TCPIP_00077], [SWS_TCPIP_00087], SWS TcpIp p. 60

Les adresses proviennent d'une table configurée d'adresses locales. Elles sont assignées de manière statique, par DHCP ou en Link-Local, sélectionnées par priorité et, sur demande, enregistrées dans NvM ([SWS_TCPIP_00099], [SWS_TCPIP_00065], [SWS_TCPIP_00127], [SWS_TCPIP_00219]). <Up_LocalIpAddrAssignmentChg> informe la couche supérieure des modifications [SWS_TCPIP_00229]. Les sockets sont demandés et liés avec TcpIp_Bind. Les connexions TCP s'établissent via TcpIp_TcpConnect ou TcpIp_TcpListen ([SWS_TCPIP_00111], [SWS_TCPIP_00112], [SWS_TCPIP_00113]).

L'émission s'effectue de manière asynchrone via TcpIp_TcpTransmit ou de manière synchrone via TcpIp_UdpTransmit. Avec TCP, la couche supérieure transmet les données directement ou les met à disposition via <Up_CopyTxData> ([SWS_TCPIP_00124], [SWS_TCPIP_00120]). TcpIp associe les datagrammes reçus à un socket au moyen de l'adresse locale et du port [SWS_TCPIP_00170]. Si l'adresse MAC de destination est manquante, TcpIpArpPacketQueueEnabled détermine si le paquet est mis en file d'attente ou rejeté [SWS_TCPIP_00192]. TcpIp signale au DET les erreurs d'exécution telles que les timeouts, les hôtes inaccessibles ou les conflits d'adresses. Dans R20-11, les codes 0x01 à 0x05 sont définis à cet effet [SWS_TCPIP_00255]. Pour la sécurisation s'ajoutent TLS à partir de la version 1.2 et IPsec avec IKEv2 ([SWS_TCPIP_00302], [SWS_TCPIP_00353]).

Rôle dans la pile Ethernet : intermédiaire entre les détenteurs de sockets et EthIf

TcpIp regroupe la communication basée sur IP d'un calculateur Classic au sein de sous-modules [SWS_TCPIP_00052]. Pour IPv4, IP, ARP, ICMP, DHCPv4 (client et serveur), Auto-IP, UDP et TCP sont requis ([SWS_TCPIP_00053], [SWS_TCPIP_00056], [SWS_TCPIP_00058], [SWS_TCPIP_00057], [SWS_TCPIP_00061]). Pour IPv6 s'y ajoutent IPv6, NDP, ICMPv6 et un client DHCPv6 ([SWS_TCPIP_00160], [SWS_TCPIP_00164], [SWS_TCPIP_00166]). Trois classes de scalabilité délimitent le périmètre : pile IPv4, pile IPv6 et Dual Stack SWS TcpIp p. 18. Pour la classe 3, l'intégralité du périmètre est obligatoire [SWS_TCPIP_00150].

Vers le haut, TcpIp dessert les détenteurs de sockets. Si TcpIpSocketOwnerUpperLayerType est défini sur SOAD, les callbacks se nomment SoAd_…. Pour un CDD, les noms de fonctions configurés s'appliquent ([SWS_TCPIP_00220], [SWS_TCPIP_00221]). Chaque détenteur reçoit une fonction TcpIp_<Up>GetSocket propre, et les sockets ainsi demandés lui appartiennent exclusivement [SWS_TCPIP_00222].

Vers le bas, TcpIp reçoit des trames via TcpIp_RxIndication [SWS_TCPIP_00029]. Il émet via EthIf_Transmit, et ce toujours avec TxConfirmation = FALSE [SWS_TCPIP_00131]. EthSM commande l'état via TcpIp_RequestComMode SWS EthSM p. 27. De manière optionnelle, TcpIp utilise les services de CSM [SWS_TCPIP_00028] et signale les événements de sécurité à IdsM [SWS_TCPIP_00361]. SWS TcpIp p. 17 donne un aperçu de l'intégration.

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 Erreurs de développement et de runtime 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

Diagramme de contexte : TcpIp se situe entre les détenteurs de sockets (SoAd ou CDD) et EthIf. Il est commandé par EthSM, signale les erreurs à DET et les événements à IdsM, et utilise facultativement le CSM. Sources : [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 p. 17

États du contrôleur : de TCPIP_STATE_OFFLINE à TCPIP_STATE_ONLINE

Le module est initialisé avec TcpIp_Init et une TcpIp_ConfigType spécifique à l'implémentation ([SWS_TCPIP_00002], [SWS_TCPIP_00067]). TcpIp_MainFunction est le point d'entrée pour le planificateur [SWS_TCPIP_00026]. Interprétation : c'est là que devraient s'exécuter des processus temporisés tels que les timeouts. Question Q-77b083e447651768 (ouverte) La spécification indique seulement à ce sujet « Schedules the TCP/IP stack ».

TcpIp maintient un état propre pour chaque contrôleur EthIf : OFFLINE, STARTUP, ONLINE, ONHOLD ou SHUTDOWN [SWS_TCPIP_00083]. Si la demande enregistrée diffère de l'état actif, TcpIp engage les démarches nécessaires [SWS_TCPIP_00136].

  • Une demande d'état ONLINE émise depuis OFFLINE active les assignations d'adresses configurées [SWS_TCPIP_00075]. Dès qu'une adresse est assignée, le contrôleur passe à l'état ONLINE [SWS_TCPIP_00085].
  • ONHOLD signale TCPIP_IPADDR_STATE_ONHOLD pour toutes les adresses. Les sockets et les adresses sont conservés, mais les nouvelles requêtes d'émission ne sont pas acceptées ([SWS_TCPIP_00076], [SWS_TCPIP_00074]). Le retour à l'état ONLINE signale de nouveau TCPIP_IPADDR_STATE_ASSIGNED [SWS_TCPIP_00086].
  • Une demande d'état OFFLINE ou la libération de toutes les adresses signale TCPIP_IPADDR_STATE_UNASSIGNED et ferme les sockets ([SWS_TCPIP_00077], [SWS_TCPIP_00072]). Une fois les ressources libérées, OFFLINE s'ensuit [SWS_TCPIP_00087].
zustand Start commencer 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) ou toutes les adresses libérées / ...(UNASSIGNED), fermer les sockets ONHOLD->ONLINE RequestComMode(ONLINE) / reaktivieren, ...(ASSIGNED) ONHOLD->SHUTDOWN RequestComMode(OFFLINE) / ...(UNASSIGNED) SHUTDOWN->OFFLINE Ressourcen freigegeben

Diagramme d'état : chaque contrôleur EthIf possède son propre automate d'état. Seuls ONLINE, ONHOLD et OFFLINE peuvent être demandés, STARTUP et SHUTDOWN étant des états transitoires. Sources : [SWS_TCPIP_00075], [SWS_TCPIP_00085], [SWS_TCPIP_00076], [SWS_TCPIP_00086], [SWS_TCPIP_00077], [SWS_TCPIP_00087], [SWS_TCPIP_00088], SWS TcpIp p. 60 (schéma issu de R25-11, transitions couvertes par les exigences de R20-11)

Dans STARTUP, une demande d'état OFFLINE interrompt les assignations en cours [SWS_TCPIP_00088]. Si quelqu'un demande STARTUP ou SHUTDOWN, la requête est rejetée avec E_NOT_OK [SWS_TCPIP_00089].

Un démarrage type se déroule ainsi : EthSM demande ONLINE à la requête de ComM SWS EthSM p. 42. TcpIp signale ensuite l'adresse assignée. SoAd demande alors des sockets et les lie ([SWS_TCPIP_00229], SWS SoAd p. 20). Le schéma issu de R25-11 montre en outre une notification en retour via EthSM_TcpIpModeIndication SWS TcpIp p. 60. Cela devrait également s'appliquer pour R20-11. Question Q-a5e26ad792c23d58 (ouverte)

Démarrage d'un contrôleur jusqu'au socket liéComMEthSMTcpIpSoAdEthSM_RequestComMode(network,COMM_FULL_COMMUNICATION)TcpIp_RequestComMode(CtrlIdx,TCPIP_STATE_ONLINE)E_OK (Auftrag angenommen)TCPIP_STATE_STARTUP:Adresszuweisungen aktivierenasynchrone, par ex. DHCP ou Link-Localerste Adresse zugewiesen:TCPIP_STATE_ONLINESoAd_LocalIpAddrAssignmentChg(IpAddrId,TCPIP_IPADDR_STATE_ASSIGNED)EthSM_TcpIpModeIndication(CtrlIdx,TCPIP_STATE_ONLINE) (vermutlich)Use Case: SoAd ouvre une connexion de socketTcpIp_SoAdGetSocket(Domain, Protocol,SocketIdPtr)E_OK, SocketIdTcpIp_Bind(SocketId, LocalAddrId, PortPtr)E_OK

Diagramme de séquence : seule l'assignation asynchrone d'adresse fait passer le contrôleur à l'état ONLINE. Ensuite, SoAd peut demander des sockets et les lier. Sources : [SWS_TCPIP_00070], [SWS_TCPIP_00075], [SWS_TCPIP_00085], [SWS_TCPIP_00229], [SWS_TCPIP_00018], [SWS_TCPIP_00015], SWS EthSM p. 42. La notification en retour à EthSM existe vraisemblablement aussi dans R20-11.

Adresses locales et leur assignation

La base est une table d'adresses locales issue de TcpIpLocalAddr, qui sont affectées au moment de l'exécution à des contrôleurs EthIf ([SWS_TCPIP_00099], SWS TcpIp p. 220). Une entrée est référencée via TcpIp_LocalAddrIdType [SWS_TCPIP_00030]. Plusieurs procédés sont envisageables par entrée, comme statique, DHCP ou Link-Local ([SWS_TCPIP_00065], SWS TcpIp p. 224). Si une adresse de priorité plus élevée devient disponible, elle remplace la précédente [SWS_TCPIP_00127].

La manière dont l'assignation et la libération sont déclenchées dépend du déclencheur configuré :

Toute modification d'une assignation est signalée par <Up_LocalIpAddrAssignmentChg> avec une valeur de type TcpIp_IpAddrStateType ([SWS_TCPIP_00229], [SWS_TCPIP_00082]). TcpIp annonce les nouvelles adresses IPv4 par Gratuitous ARP [SWS_TCPIP_00093]. Il vérifie les adresses IPv6 par Duplicate Address Detection [SWS_TCPIP_00159]. L'interrogation s'effectue via TcpIp_GetIpAddr, TcpIp_GetPhysAddr et TcpIp_GetCtrlIdx ([SWS_TCPIP_00032], [SWS_TCPIP_00033], [SWS_TCPIP_00141]). Si l'on interroge une option DHCP qui n'est pas définie, le service de lecture renvoie une longueur de 0 [SWS_TCPIP_00237].

Sockets : demander, lier, connecter, fermer

Un socket est demandé en spécifiant la famille d'adresses et le protocole ([SWS_TCPIP_00018], [SWS_TCPIP_00009], [SWS_TCPIP_00010]). TcpIp_Bind le lie à une adresse locale et à un port [SWS_TCPIP_00111]. Cela échoue si le port, le protocole et l'adresse sont déjà occupés ou si l'adresse n'est pas assignée ([SWS_TCPIP_00146], [SWS_TCPIP_00254]). Avec TCPIP_PORT_ANY, la pile choisit elle-même un port compris entre 49152 et 65535 SWS TcpIp p. 85.

Pour TCP, il existe deux manières d'établir la connexion :

  • En tant que client, TcpIp_TcpConnect établit la connexion de manière asynchrone. Une fois celle-ci établie, TcpIp appelle <Up_TcpConnected> ([SWS_TCPIP_00112], [SWS_TCPIP_00227]).
  • En tant que serveur, TcpIp_TcpListen place le socket dans l'état Listen [SWS_TCPIP_00113]. Pour chaque connexion entrante, TcpIp dérive un socket dédié et le signale avec <Up_TcpAccepted> [SWS_TCPIP_00226]. Si la couche supérieure renvoie E_NOT_OK, TcpIp ferme la connexion SWS SoAd p. 81.

TcpIp n'accepte de nouvelles connexions TCP que dans l'état ONLINE [SWS_TCPIP_00094].

Établissement de connexion TCP en tant que client et en tant que serveurSoAdTcpIpEthIfaltClient (ouverture active)TcpIp_TcpConnect(SocketId, RemoteAddrPtr)E_OK (asynchron)EthIf_ProvideTxBuffer / EthIf_Transmit(SYN)TcpIp_RxIndication(...)(réponse du correspondant)SoAd_TcpConnected(SocketId)Serveur (ouverture passive)TcpIp_TcpListen(SocketId, MaxChannels)E_OKTcpIp_RxIndication(...)(Verbindungsanfrage)Socket SocketIdConnected ableiten(au maximum MaxChannels en parallèle)SoAd_TcpAccepted(SocketId,SocketIdConnected, RemoteAddrPtr)E_OK / E_NOT_OK (fermer la connexion)

Diagramme de séquence : le client reçoit une confirmation via <Up_TcpConnected>. Le serveur reçoit pour chaque connexion un socket dérivé que la couche supérieure peut accepter ou refuser. Sources : [SWS_TCPIP_00022], [SWS_TCPIP_00023], [SWS_TCPIP_00226], [SWS_TCPIP_00227], SWS TcpIp p. 129 (le schéma ultérieur contient en plus LSduR, qui est omis ici), SWS TcpIp p. 107

TcpIp_Close met fin à une connexion TCP de manière normale. Avec Abort = TRUE, il l'interrompt immédiatement par un RST. Dans le cas d'UDP, les ressources sont libérées immédiatement ([SWS_TCPIP_00109], [SWS_TCPIP_00110]). Les événements tels que Reset, FIN ou la fermeture sont signalés par <Up_TcpIpEvent> [SWS_TCPIP_00144]. Avec TcpIp_ChangeParameter, il est possible de modifier les paramètres du socket, tels que la fenêtre de réception, la priorité de trame, Nagle, le filtre d'options TCP ou la somme de contrôle UDP ([SWS_TCPIP_00126], [SWS_TCPIP_00266], [SWS_TCPIP_00279]).

Chemins de données : émission, réception, résolution d'adresses

TcpIp_TcpTransmit fonctionne de manière asynchrone. Si DataPtr est défini, il prend en charge les données issues de ce tampon linéaire. Si DataPtr est un NULL_PTR, il récupère les données via <Up_CopyTxData>. Avec ForceRetrieve = TRUE, il s'agit exactement de AvailableLength octets, avec FALSE éventuellement de moins ([SWS_TCPIP_00124], [SWS_TCPIP_00125], [SWS_TCPIP_00228]). Dans le cas de TCP, TcpIp n'appelle <Up_TxConfirmation> que lorsque l'entité distante a acquitté ([SWS_TCPIP_00225], SWS SoAd p. 86). En revanche, TcpIp_UdpTransmit émet de manière synchrone et immédiate ([SWS_TCPIP_00025], [SWS_TCPIP_00120]).

Envoi TCP avec mise à disposition directe ou indirecte des donnéesSoAdTcpIpEthIfTcpIp_TcpTransmit(SocketId, DataPtr,AvailableLength, ForceRetrieve)altDataPtr != NULL_PTRReprendre les données du tampon linéaireDataPtr == NULL_PTRloopjusqu'à AvailableLength (ForceRetrieve = TRUE) ou moins (FALSE)SoAd_CopyTxData(SocketId, BufPtr, BufLength)BUFREQ_OKE_OKTcpIp_MainFunction()EthIf_ProvideTxBuffer(...)EthIf_Transmit(..., TxConfirmation = FALSE)TcpIp_RxIndication(...)(ACK du correspondant)SoAd_TxConfirmation(SocketId, Length)

Diagramme de séquence : les données sont transmises directement ou récupérées par un callback de copie. L'envoi vers EthIf s'exécute dans le contexte de la MainFunction, la confirmation n'intervenant qu'après l'ACK de l'entité distante. Sources : [SWS_TCPIP_00050], [SWS_TCPIP_00123], [SWS_TCPIP_00124], [SWS_TCPIP_00131], SWS TcpIp p. 109

Lors de la réception, la couche IP associe chaque datagramme à une entrée de la table d'adresses locales [SWS_TCPIP_00169]. UDP et TCP sélectionnent ensuite le socket via le port de destination et l'adresse locale ([SWS_TCPIP_00170], [SWS_TCPIP_00172]). Pour les connexions TCP existantes, l'adresse source et le port source doivent également correspondre [SWS_TCPIP_00173]. Les broadcasts UDP sont transmis à tous les sockets correspondants, les segments TCP destinés à des adresses de broadcast sont rejetés ([SWS_TCPIP_00171], [SWS_TCPIP_00174]). TcpIp réassemble les datagrammes fragmentés et est autorisé à découpler la réception à cette fin ([SWS_TCPIP_00054], SWS TcpIp p. 131). Les données parviennent à la couche supérieure via <Up_RxIndication>. Une fois que celle-ci a traité les données TCP, TcpIp_TcpReceived rouvre la fenêtre de réception ([SWS_TCPIP_00223], [SWS_TCPIP_00115]).

Réception d'un datagramme jusqu'à la couche supérieureEthIfTcpIpSoAdEthIf_MainFunctionRx()TcpIp_RxIndication(CtrlIdx, FrameType,IsBroadcast, PhysAddrPtr, DataPtr, LenByte)IP : associer le datagramme à un TcpIpAddrIdUDP/TCP : sélectionner le socket via le port de destination et l'adresse localeFragmente: Reassemblierung,Empfang ggf. entkoppeltSoAd_RxIndication(SocketId, RemoteAddrPtr,BufPtr, Length)optTCP-SocketTcpIp_TcpReceived(SocketId, Length)Agrandir la fenêtre de réception

Diagramme de séquence : une trame reçue est associée à un socket via l'adresse locale et le port. Dans le cas de TCP, l'acquittement de la couche supérieure libère la fenêtre de réception. Sources : [SWS_TCPIP_00029], [SWS_TCPIP_00169], [SWS_TCPIP_00170], [SWS_TCPIP_00223], [SWS_TCPIP_00115], SWS TcpIp p. 108

Pour émettre, TcpIp a besoin de l'adresse MAC de la destination et la conserve dans une table ARP :

  • La table est limitée à TcpIpArpTableSizeMax entrées [SWS_TCPIP_00090]. Les entrées non utilisées expirent après TcpIpArpTableEntryTimeout [SWS_TCPIP_00091].
  • TcpIp supprime les requêtes répétées vers la même destination pendant la durée de TcpIpArpRequestTimeout [SWS_TCPIP_00350].
  • Dans R20-11, chaque paquet IP reçu met à jour la table [SWS_TCPIP_00092]. Les versions ultérieures conditionnent cela à TcpIpArpDefensiveProcessing = FALSE SWS TcpIp p. 29.
  • Si une entrée est manquante, TcpIpArpPacketQueueEnabled détermine si le paquet est mis en file d'attente ou rejeté ([SWS_TCPIP_00191], [SWS_TCPIP_00192]). Il en va de même pour NDP [SWS_TCPIP_00193].

TcpIp signale toute modification de la table ARP via <Up_PhysAddrTableChg> [SWS_TCPIP_00142]. Si le Neighbor Cache est plein, l'entrée la plus ancienne est évincée [SWS_TCPIP_00264]. Les requêtes sont permises par TcpIp_GetRemotePhysAddr et par les services de lecture du cache ([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 Oui D Démarrer la résolution d'adresse (au maximum une requête ARP par cible au cours de TcpIpArpRequestTimeout) B->D Non 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)

Diagramme d'activité : si une entrée ARP est manquante lors de l'émission, le paquet est mis en file d'attente ou rejeté selon la configuration. Les nouvelles requêtes vers la même destination sont régulées. Sources : [SWS_TCPIP_00191], [SWS_TCPIP_00192], [SWS_TCPIP_00350], [SWS_TCPIP_00142], SWS TcpIp p. 176. Interprétation : le paquet mis en file d'attente est émis après une résolution réussie.

Sécurisation et filtrage : TLS, IPsec, IdsM

Pour les connexions TCP, TcpIp prend en charge TLS selon l'IETF RFC 5246. Les versions inférieures à 1.2 sont rejetées ([SWS_TCPIP_00300], [SWS_TCPIP_00302]). Les identités PSK et l'heure actuelle sont fournies par des callouts configurables ([SWS_TCPIP_91014], [SWS_TCPIP_91012]). La cryptographie s'exécute via le CSM ([SWS_TCPIP_00028], SWS TcpIp p. 251).

IPsec est pris en charge avec IKEv2, mais pas avec IKEv1 ([SWS_TCPIP_00352], [SWS_TCPIP_00353]). Chaque datagramme est associé à une politique et, selon celle-ci, protégé, laissé passer ou rejeté ([SWS_TCPIP_00359], [SWS_TCPIP_00360]). Des en-têtes d'extension IPv6 non autorisés entraînent un rejet silencieux [SWS_TCPIP_00260]. Si TcpIpEnableSecurityEventReporting est défini, TcpIp signale les événements de sécurité à l'IdsM [SWS_TCPIP_00361].

Comportement en cas d'erreur

Les erreurs de développement, parmi lesquelles TCPIP_E_UNINIT, TCPIP_E_PARAM_POINTER, TCPIP_E_INV_ARG et TCPIP_E_ADDRINUSE, sont définies dans [SWS_TCPIP_00042]. Sont notamment vérifiés :

Indépendamment de la détection d'erreurs, TcpIp renvoie certains refus sous la forme de E_NOT_OK, par exemple un port déjà occupé ou une famille d'adresses inadaptée ([SWS_TCPIP_00146], [SWS_TCPIP_00205]).

TcpIp signale les erreurs d'exécution via Det_ReportRuntimeError :

R20-11 ne définit que les codes 0x01 à 0x05 [SWS_TCPIP_00255]. Les codes TCPIP_E_TX_QUEUE_OVERRUN et TCPIP_E_TX_INTERNAL_PROCESSING_FAILED, ajoutés dans des versions ultérieures, ne s'appliquent pas ici SWS TcpIp p. 65.

De nombreux cas d'erreur restent silencieux, car les paquets inadaptés sont simplement rejetés. TcpIp_GetAndResetMeasurementData compte ces paquets rejetés et réinitialise les compteurs ([SWS_TCPIP_91006], [SWS_TCPIP_00296]). Si une adresse MAC ne peut pas être résolue, TcpIp signale TCPIP_E_PHYS_ADDR_MISS [SWS_TCPIP_00066]. Pour les destinations situées hors de son propre sous-réseau, TcpIp_GetRemotePhysAddr renvoie immédiatement TCPIP_E_NOT_OK [SWS_TCPIP_00139].

Preuves détaillées supplémentaires

Note : guide généré par IA sur la base d'extraits de spécifications. Seules les exigences liées sont normatives pour R20-11 ; les divergences des autres versions sont mentionnées.

TCP/IP Stack (TcpIp)

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

Funktionen — Übersicht

Typen — Übersicht

Funktionen & Typen — Detailansicht

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

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

fonction 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

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

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

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

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

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

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

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

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

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

fonction TcpIp_GetIpAddr [SWS_TCPIP_00032] 📄 PDF

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

Service TcpIp_GetIpAddr.

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

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

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

fonction 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

fonction 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

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

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

fonction 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

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

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

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

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

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

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

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

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

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

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

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

fonction <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#1dc2eb0c
Content hash
1dc2eb0c
Source
https://www.autosar.org/fileadmin/standards/R20-11/CP/AUTOSAR_SWS_TcpIp.pdf#nameddest=SWS_TCPIP_00002

Carte des thèmes

Vue détaillée

Sélectionnez une entrée dans le plan.

Initialisation et état

Returns the version information.

void TcpIp_GetVersionInfo (Std_VersionInfoType* versioninfo);
TcpIp_Init fonction

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

Services · 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);

Services · 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);

Services · 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);

Services · Autres

TcpIp_Bind fonction

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 fonction

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 et interfaces attendues

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

Cyclique

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

void TcpIp_MainFunction (void);

Types

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.