DEENESPTFRRUARHIKOZHNL

TCP/IP Stack (TcpIp)

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

Guía del móduloGENERADO POR IA

Proporciona en la pila Ethernet comunicación IP mediante TCP y UDP junto con la gestión de direcciones para las capas superiores.
GENERADO POR IA no revisado Modelo: claude-opus-5-5 · Esfuerzo: high · Temperatura: no controlable · Prompt: 0a4cda5ef1d2 Procedencia Preguntas abiertas (3)
Ancla causal: R20-11 Válido desde R20-11 Sintetizado para esta versión de especificación.
traducido de la guía alemanagemini-3.8-flash-low · 2026-10-13 · Original en alemán

Proporciona en la pila Ethernet comunicación IP mediante TCP y UDP junto con la gestión de direcciones para las capas superiores.

TcpIp proporciona en la pila Classic Ethernet IPv4 e IPv6 con ARP, NDP, ICMP y DHCP, así como UDP y TCP, atendiendo con ello a socket owners como SoAd [SWS_TCPIP_00052]. EthSM controla para cada controlador EthIf los estados ONLINE, ONHOLD y OFFLINE. Un controlador pasa a ONLINE solo cuando tiene asignada una dirección local [SWS_TCPIP_00085]. Los sockets se solicitan, se vinculan y, en TCP, se conectan de forma activa o pasiva; los datos fluyen a través de servicios de transmisión y callbacks. Condición de contorno más importante: TcpIp solo acepta nuevas conexiones TCP en el estado ONLINE, y en ONHOLD rechaza nuevas solicitudes de transmisión.

En la pila Classic Ethernet, TcpIp es responsable de la comunicación IP. Se compone de submódulos para IPv4 (con ARP, ICMP, DHCP y Auto-IP), para IPv6 (con NDP, ICMPv6 y DHCPv6), así como para UDP, TCP y TLS ([SWS_TCPIP_00052], [SWS_TCPIP_00150]). Hacia arriba atiende a socket owners, es decir, SoAd o CDD, con funciones TcpIp_<Up>GetSocket propias y callbacks ([SWS_TCPIP_00220], [SWS_TCPIP_00222]). Hacia abajo intercambia tramas con 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 Errores de desarrollo y de tiempo de ejecución 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

Diagrama de contexto: TcpIp se ubica entre los socket owners y EthIf, es controlado por EthSM y notifica a DET e IdsM. Fuentes: [SWS_TCPIP_00220], [SWS_TCPIP_00070], [SWS_TCPIP_00361], SWS TcpIp p. 17

TcpIp gestiona el estado de comunicación de forma independiente para cada controlador EthIf [SWS_TCPIP_00083]. EthSM solicita mediante TcpIp_RequestComMode uno de los estados ONLINE, ONHOLD u OFFLINE [SWS_TCPIP_00070]. STARTUP y SHUTDOWN son estados transitorios y no pueden solicitarse [SWS_TCPIP_00089]. ONLINE inicia la asignación de direcciones. ONHOLD conserva los sockets y las direcciones, pero no acepta solicitudes de transmisión. OFFLINE cierra los sockets ([SWS_TCPIP_00075], [SWS_TCPIP_00074], [SWS_TCPIP_00072]).

zustand Start comenzar 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) o todas las direcciones liberadas / ...(UNASSIGNED), cerrar sockets ONHOLD->ONLINE RequestComMode(ONLINE) / reaktivieren, ...(ASSIGNED) ONHOLD->SHUTDOWN RequestComMode(OFFLINE) / ...(UNASSIGNED) SHUTDOWN->OFFLINE Ressourcen freigegeben

Diagrama de estados: un controlador solo pasa a ONLINE cuando se le ha asignado una dirección. El camino hacia OFFLINE lo realiza a través de SHUTDOWN, en el cual se liberan los recursos. Fuentes: [SWS_TCPIP_00085], [SWS_TCPIP_00077], [SWS_TCPIP_00087], SWS TcpIp p. 60

Las direcciones proceden de una tabla configurada de direcciones locales. Se asignan de forma estática, por DHCP o como enlace local (Link-Local), se seleccionan por prioridad y, opcionalmente, se almacenan en NvM ([SWS_TCPIP_00099], [SWS_TCPIP_00065], [SWS_TCPIP_00127], [SWS_TCPIP_00219]). Sobre los cambios, <Up_LocalIpAddrAssignmentChg> informa a la capa superior [SWS_TCPIP_00229]. Los sockets se solicitan y se vinculan con TcpIp_Bind. Las conexiones TCP se originan mediante TcpIp_TcpConnect u TcpIp_TcpListen ([SWS_TCPIP_00111], [SWS_TCPIP_00112], [SWS_TCPIP_00113]).

La transmisión se realiza de forma asíncrona mediante TcpIp_TcpTransmit o de forma síncrona mediante TcpIp_UdpTransmit. En TCP, la capa superior entrega los datos directamente o los pone a disposición a través de <Up_CopyTxData> ([SWS_TCPIP_00124], [SWS_TCPIP_00120]). TcpIp asigna los datagramas recibidos a un socket mediante la dirección local y el puerto [SWS_TCPIP_00170]. Si falta la dirección MAC de destino, TcpIpArpPacketQueueEnabled determina si el paquete se pone en cola o se rechaza [SWS_TCPIP_00192]. TcpIp notifica a DET los errores en tiempo de ejecución, tales como timeouts, hosts inalcanzables o conflictos de direcciones. En R20-11 se han definido para ello los códigos 0x01 a 0x05 [SWS_TCPIP_00255]. Para la protección se añaden TLS a partir de la versión 1.2 e IPsec con IKEv2 ([SWS_TCPIP_00302], [SWS_TCPIP_00353]).

Rol en la pila Ethernet: intermediario entre los socket owners y EthIf

TcpIp agrupa la comunicación basada en IP de una unidad de control Classic en submódulos [SWS_TCPIP_00052]. Para IPv4 se requieren IP, ARP, ICMP, DHCPv4 (cliente y servidor), Auto-IP, UDP y TCP ([SWS_TCPIP_00053], [SWS_TCPIP_00056], [SWS_TCPIP_00058], [SWS_TCPIP_00057], [SWS_TCPIP_00061]). Para IPv6 se añaden IPv6, NDP, ICMPv6 y un cliente DHCPv6 ([SWS_TCPIP_00160], [SWS_TCPIP_00164], [SWS_TCPIP_00166]). Tres clases de escalabilidad dimensionan el alcance: pila IPv4, pila IPv6 y doble pila (Dual Stack) SWS TcpIp p. 18. Para la clase 3, el alcance completo es obligatorio [SWS_TCPIP_00150].

Hacia arriba, TcpIp atiende a socket owners. Si TcpIpSocketOwnerUpperLayerType está configurado en SOAD, los callbacks se denominan SoAd_…. En CDD rigen los nombres de función configurados ([SWS_TCPIP_00220], [SWS_TCPIP_00221]). Cada owner recibe una función TcpIp_<Up>GetSocket propia, y los sockets solicitados de esta forma le pertenecen en exclusiva [SWS_TCPIP_00222].

Hacia abajo, TcpIp recibe tramas a través de TcpIp_RxIndication [SWS_TCPIP_00029]. Transmite a través de EthIf_Transmit, y siempre con TxConfirmation = FALSE [SWS_TCPIP_00131]. EthSM controla el estado mediante TcpIp_RequestComMode SWS EthSM p. 27. De forma opcional, TcpIp utiliza servicios de CSM [SWS_TCPIP_00028] y notifica eventos de seguridad a IdsM [SWS_TCPIP_00361]. SWS TcpIp p. 17 ofrece una visión general de la integración.

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 Errores de desarrollo y de tiempo de ejecución 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

Diagrama de contexto: TcpIp se sitúa entre los socket owners (SoAd o CDD) y EthIf. Es controlado por EthSM, notifica errores a DET y eventos a IdsM, y utiliza opcionalmente CSM. Fuentes: [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

Estados del controlador: de TCPIP_STATE_OFFLINE a TCPIP_STATE_ONLINE

El módulo se inicializa con TcpIp_Init y una TcpIp_ConfigType específica de la implementación ([SWS_TCPIP_00002], [SWS_TCPIP_00067]). TcpIp_MainFunction es el punto de entrada para el scheduler [SWS_TCPIP_00026]. Interpretación: allí deberían ejecutarse procesos controlados por tiempo, como los timeouts. Pregunta Q-77b083e447651768 (abierta) La especificación solo dice al respecto «Schedules the TCP/IP stack».

TcpIp mantiene un estado propio para cada controlador EthIf: OFFLINE, STARTUP, ONLINE, ONHOLD o SHUTDOWN [SWS_TCPIP_00083]. Si la solicitud guardada difiere del estado activo, TcpIp inicia los pasos necesarios [SWS_TCPIP_00136].

  • Una solicitud ONLINE desde OFFLINE activa las asignaciones de direcciones configuradas [SWS_TCPIP_00075]. Tan pronto como se asigna una dirección, el controlador pasa a ONLINE [SWS_TCPIP_00085].
  • ONHOLD notifica TCPIP_IPADDR_STATE_ONHOLD para todas las direcciones. Los sockets y las direcciones se conservan, pero no se aceptan nuevas solicitudes de transmisión ([SWS_TCPIP_00076], [SWS_TCPIP_00074]). El retorno a ONLINE notifica de nuevo TCPIP_IPADDR_STATE_ASSIGNED [SWS_TCPIP_00086].
  • Una solicitud OFFLINE o la liberación de todas las direcciones notifica TCPIP_IPADDR_STATE_UNASSIGNED y cierra los sockets ([SWS_TCPIP_00077], [SWS_TCPIP_00072]). Una vez liberados los recursos, sigue OFFLINE [SWS_TCPIP_00087].
zustand Start comenzar 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) o todas las direcciones liberadas / ...(UNASSIGNED), cerrar sockets ONHOLD->ONLINE RequestComMode(ONLINE) / reaktivieren, ...(ASSIGNED) ONHOLD->SHUTDOWN RequestComMode(OFFLINE) / ...(UNASSIGNED) SHUTDOWN->OFFLINE Ressourcen freigegeben

Diagrama de estados: cada controlador EthIf tiene una máquina de estados propia. Solo pueden solicitarse ONLINE, ONHOLD y OFFLINE; STARTUP y SHUTDOWN son estados transitorios. Fuentes: [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 (diagrama de R25-11, transiciones respaldadas por los requirements de R20-11)

En STARTUP, una solicitud OFFLINE cancela las asignaciones en curso [SWS_TCPIP_00088]. Si se solicita STARTUP o SHUTDOWN, la solicitud se rechaza con E_NOT_OK [SWS_TCPIP_00089].

Un arranque típico transcurre así: EthSM solicita ONLINE a petición de ComM SWS EthSM p. 42. TcpIp notifica a continuación la dirección asignada. Acto seguido, SoAd solicita sockets y los vincula ([SWS_TCPIP_00229], SWS SoAd p. 20). El diagrama de R25-11 muestra además una respuesta mediante EthSM_TcpIpModeIndication SWS TcpIp p. 60. Es de esperar que esto también sea aplicable a R20-11. Pregunta Q-a5e26ad792c23d58 (abierta)

Puesta en marcha de un controlador hasta el socket vinculadoComMEthSMTcpIpSoAdEthSM_RequestComMode(network,COMM_FULL_COMMUNICATION)TcpIp_RequestComMode(CtrlIdx,TCPIP_STATE_ONLINE)E_OK (Auftrag angenommen)TCPIP_STATE_STARTUP:Adresszuweisungen aktivierenasíncrono, p. ej., DHCP o enlace localerste Adresse zugewiesen:TCPIP_STATE_ONLINESoAd_LocalIpAddrAssignmentChg(IpAddrId,TCPIP_IPADDR_STATE_ASSIGNED)EthSM_TcpIpModeIndication(CtrlIdx,TCPIP_STATE_ONLINE) (vermutlich)Use Case: SoAd abre una conexión de socketTcpIp_SoAdGetSocket(Domain, Protocol,SocketIdPtr)E_OK, SocketIdTcpIp_Bind(SocketId, LocalAddrId, PortPtr)E_OK

Diagrama de secuencias: solo la asignación asíncrona de direcciones sitúa al controlador en ONLINE. A continuación, SoAd puede solicitar y vincular sockets. Fuentes: [SWS_TCPIP_00070], [SWS_TCPIP_00075], [SWS_TCPIP_00085], [SWS_TCPIP_00229], [SWS_TCPIP_00018], [SWS_TCPIP_00015], SWS EthSM p. 42. La respuesta a EthSM está presumiblemente presente también en R20-11.

Direcciones locales y su asignación

La base es una tabla de direcciones locales de TcpIpLocalAddr, que se asignan en tiempo de ejecución a los controladores EthIf ([SWS_TCPIP_00099], SWS TcpIp p. 220). Una entrada se direcciona mediante TcpIp_LocalAddrIdType [SWS_TCPIP_00030]. Por cada entrada son posibles varios métodos, como estático, DHCP o Link-Local ([SWS_TCPIP_00065], SWS TcpIp p. 224). Si pasa a estar disponible una dirección con mayor prioridad, esta sustituye a la anterior [SWS_TCPIP_00127].

La forma en que se desencadenan la asignación y la liberación depende del trigger configurado:

Cada cambio de una asignación lo notifica <Up_LocalIpAddrAssignmentChg> con un valor del tipo TcpIp_IpAddrStateType ([SWS_TCPIP_00229], [SWS_TCPIP_00082]). TcpIp anuncia nuevas direcciones IPv4 mediante Gratuitous ARP [SWS_TCPIP_00093]. Las direcciones IPv6 las comprueba mediante Duplicate Address Detection [SWS_TCPIP_00159]. Para la consulta sirven TcpIp_GetIpAddr, TcpIp_GetPhysAddr y TcpIp_GetCtrlIdx ([SWS_TCPIP_00032], [SWS_TCPIP_00033], [SWS_TCPIP_00141]). Si se consulta una opción DHCP que no está establecida, el servicio de lectura devuelve longitud 0 [SWS_TCPIP_00237].

Sockets: solicitar, vincular, conectar, cerrar

Un socket se solicita con la familia de direcciones y el protocolo ([SWS_TCPIP_00018], [SWS_TCPIP_00009], [SWS_TCPIP_00010]). TcpIp_Bind lo vincula a una dirección local y a un puerto [SWS_TCPIP_00111]. Esto falla si el puerto, el protocolo y la dirección ya están ocupados o la dirección no está asignada ([SWS_TCPIP_00146], [SWS_TCPIP_00254]). Con TCPIP_PORT_ANY, la propia pila selecciona un puerto entre 49152 y 65535 SWS TcpIp p. 85.

Para TCP existen dos vías hacia la conexión:

  • Como cliente, TcpIp_TcpConnect establece la conexión de forma asíncrona. Una vez establecida, TcpIp llama a <Up_TcpConnected> ([SWS_TCPIP_00112], [SWS_TCPIP_00227]).
  • Como servidor, TcpIp_TcpListen pone el socket en estado de escucha (Listen) [SWS_TCPIP_00113]. Para cada conexión entrante, TcpIp deriva un socket propio y lo notifica con <Up_TcpAccepted> [SWS_TCPIP_00226]. Si la capa superior devuelve E_NOT_OK, TcpIp cierra la conexión SWS SoAd p. 81.

TcpIp solo acepta nuevas conexiones TCP en el estado ONLINE [SWS_TCPIP_00094].

Establecimiento de conexión TCP como cliente y como servidorSoAdTcpIpEthIfaltCliente (apertura activa)TcpIp_TcpConnect(SocketId, RemoteAddrPtr)E_OK (asynchron)EthIf_ProvideTxBuffer / EthIf_Transmit(SYN)TcpIp_RxIndication(...)(Respuesta del extremo remoto)SoAd_TcpConnected(SocketId)Servidor (apertura pasiva)TcpIp_TcpListen(SocketId, MaxChannels)E_OKTcpIp_RxIndication(...)(Verbindungsanfrage)Socket SocketIdConnected ableiten(como máximo MaxChannels en paralelo)SoAd_TcpAccepted(SocketId,SocketIdConnected, RemoteAddrPtr)E_OK / E_NOT_OK (cerrar conexión)

Diagrama de secuencias: el cliente recibe una confirmación mediante <Up_TcpConnected>. El servidor recibe por cada conexión un socket derivado, que la capa superior puede aceptar o rechazar. Fuentes: [SWS_TCPIP_00022], [SWS_TCPIP_00023], [SWS_TCPIP_00226], [SWS_TCPIP_00227], SWS TcpIp p. 129 (el diagrama posterior contiene adicionalmente LSduR, que aquí se omite), SWS TcpIp p. 107.

TcpIp_Close finaliza una conexión TCP de forma regular. Con Abort = TRUE la interrumpe inmediatamente mediante RST. En UDP, los recursos se liberan de inmediato ([SWS_TCPIP_00109], [SWS_TCPIP_00110]). Eventos como reinicio (Reset), FIN o cierre los notifica <Up_TcpIpEvent> [SWS_TCPIP_00144]. Con TcpIp_ChangeParameter pueden modificarse parámetros del socket, como la ventana de recepción, la prioridad de trama, Nagle, el filtro de opciones TCP o la suma de comprobación UDP ([SWS_TCPIP_00126], [SWS_TCPIP_00266], [SWS_TCPIP_00279]).

Rutas de datos: transmisión, recepción, resolución de direcciones

TcpIp_TcpTransmit opera de forma asíncrona. Si DataPtr está establecido, toma los datos de este búfer lineal. Si DataPtr es un NULL_PTR, obtiene los datos mediante <Up_CopyTxData>. Con ForceRetrieve = TRUE son exactamente AvailableLength bytes, con FALSE eventualmente menos ([SWS_TCPIP_00124], [SWS_TCPIP_00125], [SWS_TCPIP_00228]). En TCP, TcpIp solo llama a <Up_TxConfirmation> una vez que el interlocutor ha confirmado ([SWS_TCPIP_00225], SWS SoAd p. 86). TcpIp_UdpTransmit, en cambio, transmite de forma síncrona e inmediata ([SWS_TCPIP_00025], [SWS_TCPIP_00120]).

Envío TCP con provisión directa o indirecta de datosSoAdTcpIpEthIfTcpIp_TcpTransmit(SocketId, DataPtr,AvailableLength, ForceRetrieve)altDataPtr != NULL_PTRTransferir datos desde el búfer linealDataPtr == NULL_PTRloophasta AvailableLength (ForceRetrieve = TRUE) o menos (FALSE)SoAd_CopyTxData(SocketId, BufPtr, BufLength)BUFREQ_OKE_OKTcpIp_MainFunction()EthIf_ProvideTxBuffer(...)EthIf_Transmit(..., TxConfirmation = FALSE)TcpIp_RxIndication(...)(ACK del extremo remoto)SoAd_TxConfirmation(SocketId, Length)

Diagrama de secuencias: los datos se transfieren directamente o se obtienen mediante un callback de copia. El envío a EthIf se ejecuta en el contexto de la MainFunction; la confirmación no llega hasta después del ACK del interlocutor. Fuentes: [SWS_TCPIP_00050], [SWS_TCPIP_00123], [SWS_TCPIP_00124], [SWS_TCPIP_00131], SWS TcpIp p. 109

Durante la recepción, la capa IP asigna cada datagrama a una entrada de la tabla de direcciones locales [SWS_TCPIP_00169]. UDP y TCP seleccionan a continuación el socket mediante el puerto de destino y la dirección local ([SWS_TCPIP_00170], [SWS_TCPIP_00172]). En conexiones TCP existentes, además deben coincidir la dirección de origen y el puerto de origen [SWS_TCPIP_00173]. Las difusiones (broadcasts) UDP se dirigen a todos los sockets coincidentes; los segmentos TCP dirigidos a direcciones de difusión se descartan ([SWS_TCPIP_00171], [SWS_TCPIP_00174]). TcpIp reensambla los datagramas fragmentados y, para ello, puede desacoplar la recepción ([SWS_TCPIP_00054], SWS TcpIp p. 131). Los datos llegan a la capa superior mediante <Up_RxIndication>. Una vez que esta ha procesado los datos TCP, TcpIp_TcpReceived vuelve a abrir la ventana de recepción ([SWS_TCPIP_00223], [SWS_TCPIP_00115]).

Recepción de un datagrama hasta la capa superiorEthIfTcpIpSoAdEthIf_MainFunctionRx()TcpIp_RxIndication(CtrlIdx, FrameType,IsBroadcast, PhysAddrPtr, DataPtr, LenByte)IP: asignar datagrama a un TcpIpAddrIdUDP/TCP: seleccionar socket mediante puerto de destino y dirección localFragmente: Reassemblierung,Empfang ggf. entkoppeltSoAd_RxIndication(SocketId, RemoteAddrPtr,BufPtr, Length)optTCP-SocketTcpIp_TcpReceived(SocketId, Length)Aumentar la ventana de recepción

Diagrama de secuencias: una trama recibida se asigna a un socket a través de la dirección local y el puerto. En TCP, el acuse de recibo de la capa superior libera la ventana de recepción. Fuentes: [SWS_TCPIP_00029], [SWS_TCPIP_00169], [SWS_TCPIP_00170], [SWS_TCPIP_00223], [SWS_TCPIP_00115], SWS TcpIp p. 108

Para transmitir, TcpIp necesita la dirección MAC del destino y la mantiene en una tabla ARP:

TcpIp notifica cada cambio de la tabla ARP a través de <Up_PhysAddrTableChg> [SWS_TCPIP_00142]. Si la caché de vecinos (Neighbor Cache) está llena, se desaloja la entrada más antigua [SWS_TCPIP_00264]. Las consultas las permiten TcpIp_GetRemotePhysAddr y los servicios de lectura de caché ([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 Sí D Iniciar resolución de direcciones (como máximo una solicitud ARP por destino dentro de TcpIpArpRequestTimeout) B->D No 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)

Diagrama de actividades: si al transmitir falta una entrada ARP, el paquete se encola o se rechaza según la configuración. Las nuevas solicitudes al mismo destino se limitan. Fuentes: [SWS_TCPIP_00191], [SWS_TCPIP_00192], [SWS_TCPIP_00350], [SWS_TCPIP_00142], SWS TcpIp p. 176. Interpretación: el paquete encolado se transmite tras una resolución exitosa.

Protección y filtrado: TLS, IPsec, IdsM

Para conexiones TCP, TcpIp admite TLS conforme a IETF RFC 5246. Las versiones inferiores a 1.2 se rechazan ([SWS_TCPIP_00300], [SWS_TCPIP_00302]). Las identidades PSK y la hora actual las proporcionan callouts configurables ([SWS_TCPIP_91014], [SWS_TCPIP_91012]). La criptografía se ejecuta a través de CSM ([SWS_TCPIP_00028], SWS TcpIp p. 251).

IPsec se admite con IKEv2, no con IKEv1 ([SWS_TCPIP_00352], [SWS_TCPIP_00353]). Cada datagrama se asigna a una política (policy) y, en función de esta, se protege, se deja pasar o se descarta ([SWS_TCPIP_00359], [SWS_TCPIP_00360]). Los encabezados de extensión IPv6 no permitidos provocan un descarte silencioso [SWS_TCPIP_00260]. Si TcpIpEnableSecurityEventReporting está configurado, TcpIp notifica eventos de seguridad a IdsM [SWS_TCPIP_00361].

Comportamiento en caso de error

Los errores de desarrollo, entre ellos TCPIP_E_UNINIT, TCPIP_E_PARAM_POINTER, TCPIP_E_INV_ARG y TCPIP_E_ADDRINUSE, están definidos en [SWS_TCPIP_00042]. Se comprueban, entre otros:

TcpIp devuelve algunos rechazos de forma independiente a la detección de errores como E_NOT_OK, por ejemplo un puerto ya ocupado o una familia de direcciones no adecuada ([SWS_TCPIP_00146], [SWS_TCPIP_00205]).

TcpIp notifica errores en tiempo de ejecución mediante Det_ReportRuntimeError:

R20-11 solo define los códigos 0x01 a 0x05 [SWS_TCPIP_00255]. Los códigos TCPIP_E_TX_QUEUE_OVERRUN y TCPIP_E_TX_INTERNAL_PROCESSING_FAILED añadidos en versiones posteriores no son válidos aquí SWS TcpIp p. 65.

Muchos casos de error permanecen silenciosos, ya que los paquetes no coincidentes simplemente se descartan. TcpIp_GetAndResetMeasurementData cuenta dichos paquetes descartados y restablece los contadores ([SWS_TCPIP_91006], [SWS_TCPIP_00296]). Si una dirección MAC no puede resolverse, TcpIp notifica TCPIP_E_PHYS_ADDR_MISS [SWS_TCPIP_00066]. Para destinos fuera de la propia subred, TcpIp_GetRemotePhysAddr devuelve inmediatamente TCPIP_E_NOT_OK [SWS_TCPIP_00139].

Más evidencia detallada

Guía generada por IA sobre la base de los extractos de especificación. Para R20-11 son exclusivamente normativos los requirements enlazados; las discrepancias de otras versiones están identificadas.

TCP/IP Stack (TcpIp)

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

Funktionen — Übersicht

Typen — Übersicht

Funktionen & Typen — Detailansicht

función 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.

función 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.

función 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

función 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.

función 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.

función 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.

función 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.

función 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.

función 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.

función 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.

función 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.

función 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.

función TcpIp_GetIpAddr [SWS_TCPIP_00032] 📄 PDF

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

Service TcpIp_GetIpAddr.

función 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.

función 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.

función 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.

función 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

función 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

función 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.

función 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.

función 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

función <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.

función <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.

función <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.

función <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.

función <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.

función <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().

función <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).

función <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.

función <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.

función <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.

función <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.

función <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.

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

tipo TcpIp_SockAddrInetType [SWS_TCPIP_00013] 📄 PDF

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

tipo 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

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

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

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

Mapa de temas

Vista de detalle

Selecciona una entrada en el índice.

Inicialización y estado

Returns the version information.

void TcpIp_GetVersionInfo (Std_VersionInfoType* versioninfo);
TcpIp_Init función

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

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

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

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

Servicios · Otros

TcpIp_Bind función

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 función

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 e interfaces esperadas

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

Cíclico

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

void TcpIp_MainFunction (void);

Tipos

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.