DEENESPTFRRUARHIKOZHNL

TCP/IP Stack (TcpIp)

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

Guia do móduloGERADO POR IA

Disponibiliza comunicação IP via TCP e UDP na stack Ethernet, juntamente com gerenciamento de endereços para camadas superiores.
GERADO POR IA não revisado Modelo: claude-opus-5-5 · Esforço: high · Temperatura: não controlável · Prompt: 0a4cda5ef1d2 Procedência Perguntas em aberto (3)
Âncora causal: R20-11 Válido a partir de R20-11 Sintetizado para esta versão de especificação.
traduzido do guia alemãogemini-3.8-flash-low · 2026-10-13 · Original em alemão

Disponibiliza comunicação IP via TCP e UDP na stack Ethernet, juntamente com gerenciamento de endereços para camadas superiores.

Na stack Ethernet Classic, o TcpIp disponibiliza IPv4 e IPv6 com ARP, NDP, ICMP e DHCP, bem como UDP e TCP, atendendo assim socket owners como o SoAd [SWS_TCPIP_00052]. O EthSM controla os estados ONLINE, ONHOLD e OFFLINE para cada controlador EthIf. Um controlador só passa a ONLINE depois que um endereço local lhe for atribuído [SWS_TCPIP_00085]. Sockets são solicitados, vinculados e, no TCP, conectados de forma ativa ou passiva; os dados trafegam por serviços de transmissão e callbacks. Condição de contorno mais importante: o TcpIp só aceita novas conexões TCP no estado ONLINE e, em ONHOLD, rejeita novas ordens de transmissão.

Na stack Ethernet Classic, o TcpIp é responsável pela comunicação IP. Ele é composto de submódulos para IPv4 (com ARP, ICMP, DHCP e Auto-IP), para IPv6 (com NDP, ICMPv6 e DHCPv6), bem como para UDP, TCP e TLS ([SWS_TCPIP_00052], [SWS_TCPIP_00150]). Para cima, atende socket owners, ou seja, o SoAd ou CDDs, com funções TcpIp_<Up>GetSocket próprias e callbacks ([SWS_TCPIP_00220], [SWS_TCPIP_00222]). Para baixo, troca frames com o 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 Erros de desenvolvimento e de tempo de execução 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: o TcpIp localiza-se entre os socket owners e o EthIf, é controlado pelo EthSM e relata ao DET e ao IdsM. Fontes: [SWS_TCPIP_00220], [SWS_TCPIP_00070], [SWS_TCPIP_00361], SWS TcpIp p. 17

O TcpIp mantém o estado de comunicação separadamente para cada controlador EthIf [SWS_TCPIP_00083]. O EthSM solicita via TcpIp_RequestComMode um dos estados ONLINE, ONHOLD ou OFFLINE [SWS_TCPIP_00070]. STARTUP e SHUTDOWN são estados transitórios e não podem ser solicitados [SWS_TCPIP_00089]. ONLINE inicia a atribuição de endereços. ONHOLD mantém sockets e endereços, mas não aceita ordens de transmissão. OFFLINE fecha os sockets ([SWS_TCPIP_00075], [SWS_TCPIP_00074], [SWS_TCPIP_00072]).

zustand Start Start OFFLINE TCPIP_STATE_OFFLINE Start->OFFLINE TcpIp_Init() STARTUP TCPIP_STATE_STARTUP OFFLINE->STARTUP RequestComMode(ONLINE) / Adresszuweisungen aktivieren STARTUP->OFFLINE RequestComMode(OFFLINE) / Zuweisungen abbrechen ONLINE TCPIP_STATE_ONLINE STARTUP->ONLINE erste Adresse zugewiesen / <Up>_LocalIpAddrAssignmentChg(ASSIGNED) ONHOLD TCPIP_STATE_ONHOLD ONLINE->ONHOLD RequestComMode(ONHOLD) / ...(ONHOLD), Kommunikation deaktivieren SHUTDOWN TCPIP_STATE_SHUTDOWN ONLINE->SHUTDOWN RequestComMode(OFFLINE) ou todos os endereços liberados / ...(UNASSIGNED), fechar sockets ONHOLD->ONLINE RequestComMode(ONLINE) / reaktivieren, ...(ASSIGNED) ONHOLD->SHUTDOWN RequestComMode(OFFLINE) / ...(UNASSIGNED) SHUTDOWN->OFFLINE Ressourcen freigegeben

Diagrama de estados: um controlador só passa a ONLINE após ter um endereço atribuído. O caminho para OFFLINE ocorre via SHUTDOWN, no qual os recursos são liberados. Fontes: [SWS_TCPIP_00085], [SWS_TCPIP_00077], [SWS_TCPIP_00087], SWS TcpIp p. 60

Os endereços provêm de uma tabela configurada de endereços locais. Eles são atribuídos estaticamente, via DHCP ou como link-local, selecionados por prioridade e, opcionalmente, armazenados na NvM ([SWS_TCPIP_00099], [SWS_TCPIP_00065], [SWS_TCPIP_00127], [SWS_TCPIP_00219]). Sobre alterações, <Up_LocalIpAddrAssignmentChg> informa a camada superior [SWS_TCPIP_00229]. Sockets são solicitados e vinculados com TcpIp_Bind. Conexões TCP são estabelecidas via TcpIp_TcpConnect ou TcpIp_TcpListen ([SWS_TCPIP_00111], [SWS_TCPIP_00112], [SWS_TCPIP_00113]).

A transmissão é feita de forma assíncrona via TcpIp_TcpTransmit ou síncrona via TcpIp_UdpTransmit. No TCP, a camada superior transfere os dados diretamente ou os disponibiliza via <Up_CopyTxData> ([SWS_TCPIP_00124], [SWS_TCPIP_00120]). O TcpIp associa datagramas recebidos a um socket por meio do endereço local e da porta [SWS_TCPIP_00170]. Se o endereço MAC de destino estiver ausente, TcpIpArpPacketQueueEnabled define se o pacote é enfileirado ou rejeitado [SWS_TCPIP_00192]. Erros de tempo de execução como timeouts, hosts inacessíveis ou conflitos de endereço são relatados pelo TcpIp ao DET. No R20-11, os códigos 0x01 a 0x05 estão definidos para isso [SWS_TCPIP_00255]. Para proteção adicional, somam-se o TLS a partir da versão 1.2 e o IPsec com IKEv2 ([SWS_TCPIP_00302], [SWS_TCPIP_00353]).

Papel na stack Ethernet: intermediário entre socket owners e EthIf

O TcpIp agrupa a comunicação baseada em IP de uma ECU Classic em submódulos [SWS_TCPIP_00052]. Para IPv4, são exigidos IP, ARP, ICMP, DHCPv4 (cliente e servidor), Auto-IP, UDP e TCP ([SWS_TCPIP_00053], [SWS_TCPIP_00056], [SWS_TCPIP_00058], [SWS_TCPIP_00057], [SWS_TCPIP_00061]). Para IPv6, somam-se IPv6, NDP, ICMPv6 e um cliente DHCPv6 ([SWS_TCPIP_00160], [SWS_TCPIP_00164], [SWS_TCPIP_00166]). Três classes de escalabilidade ajustam o escopo: stack IPv4, stack IPv6 e Dual Stack SWS TcpIp p. 18. Para a classe 3, o escopo completo é obrigatório [SWS_TCPIP_00150].

Para cima, o TcpIp atende socket owners. Se TcpIpSocketOwnerUpperLayerType estiver configurado como SOAD, os callbacks chamam-se SoAd_…. No caso de CDD, aplicam-se os nomes de função configurados ([SWS_TCPIP_00220], [SWS_TCPIP_00221]). Cada owner recebe uma função TcpIp_<Up>GetSocket própria, e os sockets solicitados dessa forma pertencem exclusivamente a ele [SWS_TCPIP_00222].

Para baixo, o TcpIp recebe frames via TcpIp_RxIndication [SWS_TCPIP_00029]. Ele transmite via EthIf_Transmit, e sempre com TxConfirmation = FALSE [SWS_TCPIP_00131]. O EthSM controla o estado via TcpIp_RequestComMode SWS EthSM p. 27. Opcionalmente, o TcpIp utiliza serviços do CSM [SWS_TCPIP_00028] e relata eventos de segurança ao IdsM [SWS_TCPIP_00361]. Uma visão geral da integração é fornecida em SWS TcpIp p. 17.

kontext EthSM EthSM TcpIp TcpIp IPv4 / ARP / ICMP / DHCP / Auto-IP IPv6 / NDP / ICMPv6 / DHCPv6 UDP / TCP / TLS / IPsec EthSM->TcpIp TcpIp_RequestComMode SoAd SoAd (Socket-Owner SOAD) SoAd->TcpIp TcpIp_SoAdGetSocket, TcpIp_Bind, TcpIp_TcpTransmit, TcpIp_UdpTransmit CDD CDD (Socket-Owner CDD) CDD->TcpIp TcpIp_<Up>GetSocket, Transmit-Dienste TcpIp->SoAd SoAd_RxIndication, SoAd_TxConfirmation, SoAd_TcpAccepted, SoAd_LocalIpAddrAssignmentChg TcpIp->CDD konfigurierte Callback-Namen EthIf EthIf TcpIp->EthIf EthIf_ProvideTxBuffer, EthIf_Transmit Det Det TcpIp->Det Erros de desenvolvimento e de tempo de execução 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: o TcpIp localiza-se entre os socket owners (SoAd ou CDD) e o EthIf. Ele é controlado pelo EthSM, relata erros ao DET e eventos ao IdsM e utiliza opcionalmente o CSM. Fontes: [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 do controlador: de TCPIP_STATE_OFFLINE para TCPIP_STATE_ONLINE

O módulo é inicializado com TcpIp_Init e uma TcpIp_ConfigType específica da implementação ([SWS_TCPIP_00002], [SWS_TCPIP_00067]). TcpIp_MainFunction é o ponto de entrada para o escalonador [SWS_TCPIP_00026]. Interpretação: é provável que processos temporizados, como timeouts, sejam executados ali. Pergunta Q-77b083e447651768 (aberta) A especificação afirma apenas "Schedules the TCP/IP stack".

O TcpIp mantém um estado próprio para cada controlador EthIf: OFFLINE, STARTUP, ONLINE, ONHOLD ou SHUTDOWN [SWS_TCPIP_00083]. Se a solicitação armazenada diferir do estado ativo, o TcpIp inicia os passos necessários [SWS_TCPIP_00136].

  • Uma solicitação de ONLINE a partir de OFFLINE ativa as atribuições de endereços configuradas [SWS_TCPIP_00075]. Assim que um endereço for atribuído, o controlador muda para ONLINE [SWS_TCPIP_00085].
  • ONHOLD relata TCPIP_IPADDR_STATE_ONHOLD para todos os endereços. Sockets e endereços são mantidos, mas novas ordens de transmissão não são aceitas ([SWS_TCPIP_00076], [SWS_TCPIP_00074]). O retorno para ONLINE relata novamente TCPIP_IPADDR_STATE_ASSIGNED [SWS_TCPIP_00086].
  • Uma solicitação de OFFLINE ou a liberação de todos os endereços relata TCPIP_IPADDR_STATE_UNASSIGNED e fecha os sockets ([SWS_TCPIP_00077], [SWS_TCPIP_00072]). Uma vez liberados os recursos, segue-se OFFLINE [SWS_TCPIP_00087].
zustand Start Start OFFLINE TCPIP_STATE_OFFLINE Start->OFFLINE TcpIp_Init() STARTUP TCPIP_STATE_STARTUP OFFLINE->STARTUP RequestComMode(ONLINE) / Adresszuweisungen aktivieren STARTUP->OFFLINE RequestComMode(OFFLINE) / Zuweisungen abbrechen ONLINE TCPIP_STATE_ONLINE STARTUP->ONLINE erste Adresse zugewiesen / <Up>_LocalIpAddrAssignmentChg(ASSIGNED) ONHOLD TCPIP_STATE_ONHOLD ONLINE->ONHOLD RequestComMode(ONHOLD) / ...(ONHOLD), Kommunikation deaktivieren SHUTDOWN TCPIP_STATE_SHUTDOWN ONLINE->SHUTDOWN RequestComMode(OFFLINE) ou todos os endereços liberados / ...(UNASSIGNED), fechar sockets ONHOLD->ONLINE RequestComMode(ONLINE) / reaktivieren, ...(ASSIGNED) ONHOLD->SHUTDOWN RequestComMode(OFFLINE) / ...(UNASSIGNED) SHUTDOWN->OFFLINE Ressourcen freigegeben

Diagrama de estados: cada controlador EthIf possui uma máquina de estados própria. Apenas ONLINE, ONHOLD e OFFLINE podem ser solicitados; STARTUP e SHUTDOWN são estados transitórios. Fontes: [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, transições cobertas pelos requisitos de R20-11)

Em STARTUP, uma solicitação de OFFLINE cancela atribuições em andamento [SWS_TCPIP_00088]. Se alguém solicitar STARTUP ou SHUTDOWN, isso é rejeitado com E_NOT_OK [SWS_TCPIP_00089].

Uma inicialização típica ocorre da seguinte forma: o EthSM solicita ONLINE a pedido do ComM SWS EthSM p. 42. Em seguida, o TcpIp relata o endereço atribuído. Depois disso, o SoAd solicita sockets e os vincula ([SWS_TCPIP_00229], SWS SoAd p. 20). O diagrama de R25-11 também mostra um retorno via EthSM_TcpIpModeIndication SWS TcpIp p. 60. É provável que isso também se aplique ao R20-11. Pergunta Q-a5e26ad792c23d58 (aberta)

Inicialização de um controlador até o socket vinculadoComMEthSMTcpIpSoAdEthSM_RequestComMode(network,COMM_FULL_COMMUNICATION)TcpIp_RequestComMode(CtrlIdx,TCPIP_STATE_ONLINE)E_OK (Auftrag angenommen)TCPIP_STATE_STARTUP:Adresszuweisungen aktivierenassíncrono, por 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 abre uma conexão de socketTcpIp_SoAdGetSocket(Domain, Protocol,SocketIdPtr)E_OK, SocketIdTcpIp_Bind(SocketId, LocalAddrId, PortPtr)E_OK

Diagrama de sequência: somente a atribuição assíncrona de endereços torna o controlador ONLINE. Depois disso, o SoAd pode solicitar e vincular sockets. Fontes: [SWS_TCPIP_00070], [SWS_TCPIP_00075], [SWS_TCPIP_00085], [SWS_TCPIP_00229], [SWS_TCPIP_00018], [SWS_TCPIP_00015], SWS EthSM p. 42. O retorno ao EthSM provavelmente também existe no R20-11.

Endereços locais e sua atribuição

A base é uma tabela de endereços locais de TcpIpLocalAddr, que são associados em tempo de execução a controladores EthIf ([SWS_TCPIP_00099], SWS TcpIp p. 220). Uma entrada é acessada via TcpIp_LocalAddrIdType [SWS_TCPIP_00030]. Por entrada, múltiplos métodos são possíveis, como estático, DHCP ou link-local ([SWS_TCPIP_00065], SWS TcpIp p. 224). Se um endereço com prioridade mais alta ficar disponível, ele substitui o anterior [SWS_TCPIP_00127].

A forma como a atribuição e a liberação são disparadas depende do trigger configurado:

Cada alteração de uma atribuição é relatada por <Up_LocalIpAddrAssignmentChg> com um valor do tipo TcpIp_IpAddrStateType ([SWS_TCPIP_00229], [SWS_TCPIP_00082]). Novos endereços IPv4 são anunciados pelo TcpIp via Gratuitous ARP [SWS_TCPIP_00093]. Endereços IPv6 são verificados por ele via Duplicate Address Detection [SWS_TCPIP_00159]. Para consulta, servem TcpIp_GetIpAddr, TcpIp_GetPhysAddr e TcpIp_GetCtrlIdx ([SWS_TCPIP_00032], [SWS_TCPIP_00033], [SWS_TCPIP_00141]). Se uma opção DHCP não configurada for consultada, o serviço de leitura retorna comprimento 0 [SWS_TCPIP_00237].

Sockets: solicitar, vincular, conectar, fechar

Um socket é solicitado com a família de endereços e o protocolo ([SWS_TCPIP_00018], [SWS_TCPIP_00009], [SWS_TCPIP_00010]). TcpIp_Bind vincula-o a um endereço local e a uma porta [SWS_TCPIP_00111]. Isso falha se a porta, o protocolo e o endereço já estiverem ocupados ou se o endereço não estiver atribuído ([SWS_TCPIP_00146], [SWS_TCPIP_00254]). Com TCPIP_PORT_ANY, a própria stack seleciona uma porta entre 49152 e 65535 SWS TcpIp p. 85.

Para o TCP, existem dois caminhos para a conexão:

  • Como cliente, TcpIp_TcpConnect estabelece a conexão de forma assíncrona. Uma vez estabelecida, o TcpIp chama <Up_TcpConnected> ([SWS_TCPIP_00112], [SWS_TCPIP_00227]).
  • Como servidor, TcpIp_TcpListen coloca o socket no estado listen [SWS_TCPIP_00113]. Para cada conexão de entrada, o TcpIp deriva um socket próprio e o relata com <Up_TcpAccepted> [SWS_TCPIP_00226]. Se a camada superior retornar E_NOT_OK, o TcpIp fecha a conexão SWS SoAd p. 81.

O TcpIp só aceita novas conexões TCP no estado ONLINE [SWS_TCPIP_00094].

Estabelecimento de conexão TCP como cliente e como servidorSoAdTcpIpEthIfaltCliente (abertura ativa)TcpIp_TcpConnect(SocketId, RemoteAddrPtr)E_OK (asynchron)EthIf_ProvideTxBuffer / EthIf_Transmit(SYN)TcpIp_RxIndication(...)(resposta do nó remoto)SoAd_TcpConnected(SocketId)Servidor (abertura passiva)TcpIp_TcpListen(SocketId, MaxChannels)E_OKTcpIp_RxIndication(...)(Verbindungsanfrage)Socket SocketIdConnected ableiten(no máximo MaxChannels em paralelo)SoAd_TcpAccepted(SocketId,SocketIdConnected, RemoteAddrPtr)E_OK / E_NOT_OK (fechar conexão)

Diagrama de sequência: o cliente recebe uma confirmação via <Up_TcpConnected>. O servidor recebe um socket derivado para cada conexão, que a camada superior pode aceitar ou rejeitar. Fontes: [SWS_TCPIP_00022], [SWS_TCPIP_00023], [SWS_TCPIP_00226], [SWS_TCPIP_00227], SWS TcpIp p. 129 (o diagrama posterior contém adicionalmente LSduR, que aqui é omitido), SWS TcpIp p. 107

TcpIp_Close encerra uma conexão TCP normalmente. Com Abort = TRUE, ele a cancela imediatamente via RST. No UDP, os recursos são liberados imediatamente ([SWS_TCPIP_00109], [SWS_TCPIP_00110]). Eventos como reset, FIN ou fechamento são relatados por <Up_TcpIpEvent> [SWS_TCPIP_00144]. Com TcpIp_ChangeParameter, é possível alterar parâmetros do socket, como janela de recepção, prioridade de frame, Nagle, filtro de opções TCP ou checksum UDP ([SWS_TCPIP_00126], [SWS_TCPIP_00266], [SWS_TCPIP_00279]).

Caminhos de dados: transmissão, recepção, resolução de endereços

TcpIp_TcpTransmit opera de forma assíncrona. Se DataPtr estiver definido, ele assume os dados a partir desse buffer linear. Se DataPtr for um NULL_PTR, ele obtém os dados via <Up_CopyTxData>. Com ForceRetrieve = TRUE, são exatamente AvailableLength bytes; com FALSE, eventualmente menos ([SWS_TCPIP_00124], [SWS_TCPIP_00125], [SWS_TCPIP_00228]). No TCP, o TcpIp chama <Up_TxConfirmation> apenas quando o nó remoto tiver confirmado ([SWS_TCPIP_00225], SWS SoAd p. 86). TcpIp_UdpTransmit, por outro lado, transmite de forma síncrona e imediata ([SWS_TCPIP_00025], [SWS_TCPIP_00120]).

Envio TCP com disponibilização direta ou indireta de dadosSoAdTcpIpEthIfTcpIp_TcpTransmit(SocketId, DataPtr,AvailableLength, ForceRetrieve)altDataPtr != NULL_PTRAdotar dados a partir do buffer linearDataPtr == NULL_PTRloopaté AvailableLength (ForceRetrieve = TRUE) ou menos (FALSE)SoAd_CopyTxData(SocketId, BufPtr, BufLength)BUFREQ_OKE_OKTcpIp_MainFunction()EthIf_ProvideTxBuffer(...)EthIf_Transmit(..., TxConfirmation = FALSE)TcpIp_RxIndication(...)(ACK do nó remoto)SoAd_TxConfirmation(SocketId, Length)

Diagrama de sequência: os dados são transferidos diretamente ou obtidos via callback de cópia. O envio para o EthIf ocorre no contexto da MainFunction; a confirmação só chega após o ACK do nó remoto. Fontes: [SWS_TCPIP_00050], [SWS_TCPIP_00123], [SWS_TCPIP_00124], [SWS_TCPIP_00131], SWS TcpIp p. 109

Na recepção, a camada IP associa cada datagrama a uma entrada da tabela de endereços locais [SWS_TCPIP_00169]. O UDP e o TCP selecionam então o socket por meio da porta de destino e do endereço local ([SWS_TCPIP_00170], [SWS_TCPIP_00172]). Em conexões TCP existentes, o endereço de origem e a porta de origem também devem coincidir [SWS_TCPIP_00173]. Broadcasts UDP vão para todos os sockets correspondentes; segmentos TCP para endereços de broadcast são descartados ([SWS_TCPIP_00171], [SWS_TCPIP_00174]). O TcpIp remonta datagramas fragmentados e pode desacoplar a recepção para essa finalidade ([SWS_TCPIP_00054], SWS TcpIp p. 131). Os dados chegam à camada superior via <Up_RxIndication>. Uma vez que ela tenha processado os dados TCP, TcpIp_TcpReceived reabre a janela de recepção ([SWS_TCPIP_00223], [SWS_TCPIP_00115]).

Recepção de um datagrama até a camada superiorEthIfTcpIpSoAdEthIf_MainFunctionRx()TcpIp_RxIndication(CtrlIdx, FrameType,IsBroadcast, PhysAddrPtr, DataPtr, LenByte)IP: associar datagrama a um TcpIpAddrIdUDP/TCP: selecionar socket via porta de destino e endereço localFragmente: Reassemblierung,Empfang ggf. entkoppeltSoAd_RxIndication(SocketId, RemoteAddrPtr,BufPtr, Length)optTCP-SocketTcpIp_TcpReceived(SocketId, Length)Aumentar janela de recepção

Diagrama de sequência: um frame recebido é associado a um socket por meio do endereço local e da porta. No TCP, a confirmação da camada superior libera a janela de recepção. Fontes: [SWS_TCPIP_00029], [SWS_TCPIP_00169], [SWS_TCPIP_00170], [SWS_TCPIP_00223], [SWS_TCPIP_00115], SWS TcpIp p. 108

Para transmitir, o TcpIp necessita do endereço MAC de destino e o mantém em uma tabela ARP:

Cada alteração na tabela ARP é relatada pelo TcpIp via <Up_PhysAddrTableChg> [SWS_TCPIP_00142]. Se a Neighbor Cache estiver cheia, a entrada mais antiga é substituída [SWS_TCPIP_00264]. Consultas são permitidas por TcpIp_GetRemotePhysAddr e pelos serviços de leitura da 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 sim D Iniciar resolução de endereço (no máximo uma requisição ARP por destino dentro de TcpIpArpRequestTimeout) B->D não 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 atividades: se faltar uma entrada ARP no envio, o pacote é enfileirado ou rejeitado, dependendo da configuração. Novas requisições para o mesmo destino são limitadas. Fontes: [SWS_TCPIP_00191], [SWS_TCPIP_00192], [SWS_TCPIP_00350], [SWS_TCPIP_00142], SWS TcpIp p. 176. Interpretação: o pacote enfileirado é enviado após a resolução bem-sucedida.

Proteção e filtragem: TLS, IPsec, IdsM

Para conexões TCP, o TcpIp suporta TLS de acordo com a RFC 5246 da IETF. Versões inferiores a 1.2 são rejeitadas ([SWS_TCPIP_00300], [SWS_TCPIP_00302]). Identidades PSK e a hora atual são fornecidas por callouts configuráveis ([SWS_TCPIP_91014], [SWS_TCPIP_91012]). A criptografia é executada via CSM ([SWS_TCPIP_00028], SWS TcpIp p. 251).

O IPsec é suportado com IKEv2; o IKEv1 não é suportado ([SWS_TCPIP_00352], [SWS_TCPIP_00353]). Cada datagrama é associado a uma política e, dependendo dela, protegido, permitido ou descartado ([SWS_TCPIP_00359], [SWS_TCPIP_00360]). Extension headers IPv6 inválidos resultam em descarte silencioso [SWS_TCPIP_00260]. Se TcpIpEnableSecurityEventReporting estiver definido, o TcpIp relata eventos de segurança ao IdsM [SWS_TCPIP_00361].

Comportamento em caso de erro

Os erros de desenvolvimento, entre eles TCPIP_E_UNINIT, TCPIP_E_PARAM_POINTER, TCPIP_E_INV_ARG e TCPIP_E_ADDRINUSE, são definidos em [SWS_TCPIP_00042]. São verificados, entre outros:

TcpIp retorna algumas rejeições como E_NOT_OK independentemente da detecção de erros, por exemplo, uma porta já ocupada ou uma família de endereços incompatível ([SWS_TCPIP_00146], [SWS_TCPIP_00205]).

TcpIp reporta erros de tempo de execução via Det_ReportRuntimeError:

O R20-11 define apenas os códigos 0x01 a 0x05 [SWS_TCPIP_00255]. Os códigos TCPIP_E_TX_QUEUE_OVERRUN e TCPIP_E_TX_INTERNAL_PROCESSING_FAILED adicionados em releases posteriores não se aplicam aqui SWS TcpIp p. 65.

Muitos casos de erro permanecem silenciosos porque pacotes incompatíveis são simplesmente descartados. TcpIp_GetAndResetMeasurementData conta esses pacotes descartados e reinicia os contadores ([SWS_TCPIP_91006], [SWS_TCPIP_00296]). Se um endereço MAC não puder ser resolvido, o TcpIp reporta TCPIP_E_PHYS_ADDR_MISS [SWS_TCPIP_00066]. Para destinos fora da própria sub-rede, TcpIp_GetRemotePhysAddr fornece imediatamente TCPIP_E_NOT_OK [SWS_TCPIP_00139].

Evidências mais detalhadas

Guia gerado por IA com base em extratos da especificação. Normativos para R20-11 são exclusivamente os requirements vinculados; desvios de outros releases estão identificados.

TCP/IP Stack (TcpIp)

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

Funktionen — Übersicht

Typen — Übersicht

Funktionen & Typen — Detailansicht

função 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.

função 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.

função 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

função 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.

função 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.

função 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.

função 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.

função 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.

função 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.

função 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.

função 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.

função 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.

função TcpIp_GetIpAddr [SWS_TCPIP_00032] 📄 PDF

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

Service TcpIp_GetIpAddr.

função 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.

função 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.

função 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.

função 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

função 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

função 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.

função 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.

função 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

função <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.

função <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.

função <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.

função <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.

função <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.

função <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().

função <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).

função <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.

função <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.

função <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.

função <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.

função <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#0b2c94a5
Content hash
0b2c94a5
Source
https://www.autosar.org/fileadmin/standards/R20-11/CP/AUTOSAR_SWS_TcpIp.pdf#nameddest=SWS_TCPIP_00002

Mapa de temas

Vista de detalhes

Selecione uma entrada no índice.

Inicialização e estado

Returns the version information.

void TcpIp_GetVersionInfo (Std_VersionInfoType* versioninfo);
TcpIp_Init função

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

Serviços · 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);

Serviços · 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);

Serviços · 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);

Serviços · Outros

TcpIp_Bind função

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 função

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.