DEENESPTFRRUARHIKOZHNL

TCP/IP Stack (TcpIp)

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

모듈 가이드AI 생성

Ethernet 스택에서 상위 계층을 위한 주소 관리와 함께 TCP 및 UDP를 통한 IP 통신을 제공합니다.
AI 생성 미검증 모델: claude-opus-5-5 · 노력: high · 온도: 제어 불가 · 프롬프트: 0a4cda5ef1d2 출처 열린 질문 (3)
인과 앵커: R20-11 R20-11부터 유효 이 사양 릴리스용으로 새로 합성되었습니다.
독일어 가이드에서 번역됨gemini-3.8-flash-low · 2026-10-13 · 독일어 원문

Ethernet 스택에서 상위 계층을 위한 주소 관리와 함께 TCP 및 UDP를 통한 IP 통신을 제공합니다.

TcpIp는 Classic Ethernet 스택에서 ARP, NDP, ICMP, DHCP와 함께 IPv4 및 IPv6뿐만 아니라 UDP 및 TCP를 제공하며, 이를 통해 SoAd와 같은 소켓 소유자(Socket Owner)를 지원합니다 [SWS_TCPIP_00052]. EthSM은 각 EthIf 컨트롤러에 대해 ONLINE, ONHOLD 및 OFFLINE 상태를 제어합니다. 컨트롤러는 로컬 주소가 할당된 후에만 ONLINE이 됩니다 [SWS_TCPIP_00085]. 소켓은 요청되고 바인딩되며 TCP의 경우 활성 또는 수동으로 연결되고, 데이터는 전송 서비스 및 콜백을 통해 전달됩니다. 가장 중요한 제약 조건: TcpIp는 ONLINE 상태에서만 새 TCP 연결을 수락하며, ONHOLD에서는 새 전송 요청을 거부합니다.

Classic Ethernet 스택에서 TcpIp는 IP 통신을 담당합니다. 이는 IPv4(ARP, ICMP, DHCP 및 Auto-IP 포함), IPv6(NDP, ICMPv6 및 DHCPv6 포함)뿐만 아니라 UDP, TCP 및 TLS를 위한 하위 모듈로 구성됩니다 ([SWS_TCPIP_00052], [SWS_TCPIP_00150]). 상위 방향으로는 자체 TcpIp_<Up>GetSocket 함수 및 콜백을 통해 소켓 소유자(즉, SoAd 또는 CDD)를 지원합니다 ([SWS_TCPIP_00220], [SWS_TCPIP_00222]). 하위 방향으로는 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 개발 및 런타임 오류 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

컨텍스트 다이어그램: TcpIp는 소켓 소유자와 EthIf 사이에 위치하며 EthSM에 의해 제어되고 DET 및 IdsM에 보고합니다. 출처: [SWS_TCPIP_00220], [SWS_TCPIP_00070], [SWS_TCPIP_00361], SWS TcpIp 17쪽

TcpIp는 통신 상태를 각 EthIf 컨트롤러별로 별도로 관리합니다 [SWS_TCPIP_00083]. EthSM은 TcpIp_RequestComMode을(를) 통해 ONLINE, ONHOLD 또는 OFFLINE 상태 중 하나를 요청합니다 [SWS_TCPIP_00070]. STARTUP 및 SHUTDOWN은 과도기 상태(transient state)이며 요청할 수 없습니다 [SWS_TCPIP_00089]. ONLINE은 주소 할당을 시작합니다. ONHOLD는 소켓과 주소를 유지하지만 전송 요청을 수락하지 않습니다. OFFLINE은 소켓을 닫습니다 ([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) 또는 모든 주소 해제됨 / ...(UNASSIGNED), 소켓 닫기 ONHOLD->ONLINE RequestComMode(ONLINE) / reaktivieren, ...(ASSIGNED) ONHOLD->SHUTDOWN RequestComMode(OFFLINE) / ...(UNASSIGNED) SHUTDOWN->OFFLINE Ressourcen freigegeben

상태 다이어그램: 컨트롤러는 주소가 할당된 후에야 비로소 ONLINE이 됩니다. OFFLINE으로 가는 경로는 리소스가 해제되는 SHUTDOWN을 거칩니다. 출처: [SWS_TCPIP_00085], [SWS_TCPIP_00077], [SWS_TCPIP_00087], SWS TcpIp 60쪽

주소는 로컬 주소의 구성된 테이블에서 가져옵니다. 주소는 정적, DHCP 또는 링크 로컬로 할당되고, 우선순위에 따라 선택되며, 필요 시 NvM에 저장됩니다([SWS_TCPIP_00099], [SWS_TCPIP_00065], [SWS_TCPIP_00127], [SWS_TCPIP_00219]). 변경 사항에 대해서는 <Up_LocalIpAddrAssignmentChg>가 상위 계층 [SWS_TCPIP_00229]에 알립니다. 소켓은 요청된 후 TcpIp_Bind을 통해 바인딩됩니다. TCP 연결은 TcpIp_TcpConnect 또는 TcpIp_TcpListen을 통해 생성됩니다([SWS_TCPIP_00111], [SWS_TCPIP_00112], [SWS_TCPIP_00113]).

전송은 TcpIp_TcpTransmit을 통해 비동기식으로 또는 TcpIp_UdpTransmit을 통해 동기식으로 이루어집니다. TCP의 경우 상위 계층이 데이터를 직접 전달하거나 <Up_CopyTxData>를 통해 제공합니다([SWS_TCPIP_00124], [SWS_TCPIP_00120]). 수신된 데이터그램은 TcpIp가 로컬 주소와 포트를 통해 소켓에 할당합니다[SWS_TCPIP_00170]. 대상의 MAC 주소가 없는 경우, TcpIpArpPacketQueueEnabled이 패킷을 큐에 넣을지 거부할지 결정합니다[SWS_TCPIP_00192]. 타임아웃, 도달 불가능한 호스트 또는 주소 충돌과 같은 런타임 오류는 TcpIp가 DET에 보고합니다. R20-11에는 이를 위해 코드 0x01부터 0x05까지 정의되어 있습니다[SWS_TCPIP_00255]. 보안을 위해 버전 1.2 이상의 TLS 및 IKEv2가 적용된 IPsec이 추가됩니다([SWS_TCPIP_00302], [SWS_TCPIP_00353]).

Ethernet 스택에서의 역할: 소켓 소유자와 EthIf 간의 중재자

TcpIp는 Classic ECU의 IP 기반 통신을 하위 모듈들로 묶습니다[SWS_TCPIP_00052]. IPv4의 경우 IP, ARP, ICMP, DHCPv4(클라이언트 및 서버), Auto-IP, UDP 및 TCP가 요구됩니다([SWS_TCPIP_00053], [SWS_TCPIP_00056], [SWS_TCPIP_00058], [SWS_TCPIP_00057], [SWS_TCPIP_00061]). IPv6의 경우 IPv6, NDP, ICMPv6 및 DHCPv6 클라이언트가 추가됩니다([SWS_TCPIP_00160], [SWS_TCPIP_00164], [SWS_TCPIP_00166]). 세 가지 확장 클래스가 범위를 맞춤화합니다: IPv4 스택, IPv6 스택 및 듀얼 스택SWS TcpIp 18쪽. 클래스 3의 경우 전체 범위가 필수입니다[SWS_TCPIP_00150].

상위 방향으로 TcpIp는 소켓 소유자에게 서비스를 제공합니다. TcpIpSocketOwnerUpperLayerType이 SOAD로 설정된 경우 콜백 이름은 SoAd_…입니다. CDD의 경우 구성된 함수 이름이 적용됩니다([SWS_TCPIP_00220], [SWS_TCPIP_00221]). 각 소유자는 자체 TcpIp_<Up>GetSocket 함수를 받으며, 이렇게 요청된 소켓은 해당 소유자에게 독점적으로 귀속됩니다[SWS_TCPIP_00222].

하위 방향으로 TcpIp는 TcpIp_RxIndication을 통해 프레임을 수신합니다[SWS_TCPIP_00029]. 전송은 EthIf_Transmit를 통해 이루어지며, 항상 TxConfirmation = FALSE로 전송됩니다[SWS_TCPIP_00131]. 상태는 EthSM이 TcpIp_RequestComMode를 통해 제어합니다SWS EthSM 27쪽. 선택적으로 TcpIp는 CSM 서비스를 사용하고[SWS_TCPIP_00028] 보안 이벤트를 IdsM에 보고합니다[SWS_TCPIP_00361]. 임베딩에 대한 개요는 SWS TcpIp 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 개발 및 런타임 오류 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

컨텍스트 다이어그램: TcpIp는 소켓 소유자(SoAd 또는 CDD)와 EthIf 사이에 위치합니다. EthSM에 의해 제어되고, DET에 오류를 보고하며, IdsM에 이벤트를 보고하고, 선택적으로 CSM을 사용합니다. 출처: [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 17쪽

컨트롤러 상태: TCPIP_STATE_OFFLINE에서 TCPIP_STATE_ONLINE로

모듈은 TcpIp_Init 및 구현별 TcpIp_ConfigType을 통해 초기화됩니다([SWS_TCPIP_00002], [SWS_TCPIP_00067]). TcpIp_MainFunction는 스케줄러의 진입점입니다[SWS_TCPIP_00026]. 해석: 타임아웃과 같은 시간 기반 프로세스가 그곳에서 실행될 것으로 보입니다. 질문 Q-77b083e447651768 (열림) 규격에는 이에 대해 단지 “Schedules the TCP/IP stack”이라고만 명시되어 있습니다.

TcpIp는 각 EthIf 컨트롤러에 대해 별도의 상태(OFFLINE, STARTUP, ONLINE, ONHOLD 또는 SHUTDOWN)를 유지합니다[SWS_TCPIP_00083]. 저장된 요청이 활성 상태와 다르면 TcpIp는 필요한 조치를 시작합니다[SWS_TCPIP_00136].

  • OFFLINE에서의 ONLINE 요청은 구성된 주소 할당을 활성화합니다[SWS_TCPIP_00075]. 주소가 할당되는 즉시 컨트롤러는 ONLINE으로 전환됩니다[SWS_TCPIP_00085].
  • ONHOLD는 모든 주소에 대해 TCPIP_IPADDR_STATE_ONHOLD을 알립니다. 소켓과 주소는 유지되지만, 새로운 전송 요청은 수락되지 않습니다([SWS_TCPIP_00076], [SWS_TCPIP_00074]). ONLINE으로 복귀하면 다시 TCPIP_IPADDR_STATE_ASSIGNED을 알립니다[SWS_TCPIP_00086].
  • OFFLINE 요청 또는 모든 주소 해제는 TCPIP_IPADDR_STATE_UNASSIGNED을 알리고 소켓을 닫습니다([SWS_TCPIP_00077], [SWS_TCPIP_00072]). 리소스가 해제되면 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) 또는 모든 주소 해제됨 / ...(UNASSIGNED), 소켓 닫기 ONHOLD->ONLINE RequestComMode(ONLINE) / reaktivieren, ...(ASSIGNED) ONHOLD->SHUTDOWN RequestComMode(OFFLINE) / ...(UNASSIGNED) SHUTDOWN->OFFLINE Ressourcen freigegeben

상태 다이어그램: 각 EthIf 컨트롤러는 고유한 상태 머신을 가집니다. 요청 가능한 상태는 ONLINE, ONHOLD 및 OFFLINE뿐이며, STARTUP과 SHUTDOWN은 과도 상태입니다. 출처: [SWS_TCPIP_00075], [SWS_TCPIP_00085], [SWS_TCPIP_00076], [SWS_TCPIP_00086], [SWS_TCPIP_00077], [SWS_TCPIP_00087], [SWS_TCPIP_00088], SWS TcpIp 60쪽 (R25-11의 다이어그램, 전이는 R20-11 요구사항에 의해 뒷받침됨)

STARTUP 상태에서 OFFLINE 요청은 진행 중인 할당을 중단합니다[SWS_TCPIP_00088]. 누군가 STARTUP 또는 SHUTDOWN을 요청하면 이는 E_NOT_OK과 함께 거부됩니다[SWS_TCPIP_00089].

일반적인 기동 과정은 다음과 같습니다: EthSM이 ComM의 요청에 따라 ONLINE을 요청합니다SWS EthSM 42쪽. 그 후 TcpIp는 할당된 주소를 알립니다. 이에 따라 SoAd가 소켓을 요청하고 바인딩합니다([SWS_TCPIP_00229], SWS SoAd 20쪽). R25-11의 다이어그램은 EthSM_TcpIpModeIndication을 통한 피드백도 보여줍니다SWS TcpIp 60쪽. 이는 R20-11에도 동일하게 적용될 것입니다. 질문 Q-a5e26ad792c23d58 (열림)

바인딩된 소켓까지의 컨트롤러 시작ComMEthSMTcpIpSoAdEthSM_RequestComMode(network,COMM_FULL_COMMUNICATION)TcpIp_RequestComMode(CtrlIdx,TCPIP_STATE_ONLINE)E_OK (Auftrag angenommen)TCPIP_STATE_STARTUP:Adresszuweisungen aktivieren비동기(예: DHCP 또는 Link-Local)erste Adresse zugewiesen:TCPIP_STATE_ONLINESoAd_LocalIpAddrAssignmentChg(IpAddrId,TCPIP_IPADDR_STATE_ASSIGNED)EthSM_TcpIpModeIndication(CtrlIdx,TCPIP_STATE_ONLINE) (vermutlich)Use Case: SoAd가 소켓 연결을 염TcpIp_SoAdGetSocket(Domain, Protocol,SocketIdPtr)E_OK, SocketIdTcpIp_Bind(SocketId, LocalAddrId, PortPtr)E_OK

시퀀스 다이어그램: 비동기 주소 할당이 완료되어야만 컨트롤러가 ONLINE 상태가 됩니다. 그 후 SoAd는 소켓을 요청하고 바인딩할 수 있습니다. 출처: [SWS_TCPIP_00070], [SWS_TCPIP_00075], [SWS_TCPIP_00085], [SWS_TCPIP_00229], [SWS_TCPIP_00018], [SWS_TCPIP_00015], SWS EthSM 42쪽. EthSM으로의 피드백은 아마도 R20-11에도 존재할 것입니다.

로컬 주소 및 주소 할당

기반이 되는 것은 TcpIpLocalAddr의 로컬 주소 테이블이며, 이는 런타임에 EthIf 컨트롤러에 매핑됩니다([SWS_TCPIP_00099], SWS TcpIp 220쪽). 항목은 TcpIp_LocalAddrIdType을 통해 참조됩니다[SWS_TCPIP_00030]. 항목당 정적, DHCP 또는 링크 로컬과 같은 여러 방법이 가능합니다([SWS_TCPIP_00065], SWS TcpIp 224쪽). 더 높은 우선순위를 가진 주소를 사용할 수 있게 되면 기존 주소를 대체합니다[SWS_TCPIP_00127].

할당 및 해제가 트리거되는 방식은 구성된 트리거에 따라 달라집니다:

할당의 각 변경 사항은 <Up_LocalIpAddrAssignmentChg>이 TcpIp_IpAddrStateType 타입의 값으로 알립니다([SWS_TCPIP_00229], [SWS_TCPIP_00082]). 새로운 IPv4 주소는 TcpIp가 무상 ARP(Gratuitous ARP)를 통해 알립니다[SWS_TCPIP_00093]. IPv6 주소는 중복 주소 감지(Duplicate Address Detection)를 통해 확인합니다[SWS_TCPIP_00159]. 조회에는 TcpIp_GetIpAddr, TcpIp_GetPhysAddr 및 TcpIp_GetCtrlIdx이 사용됩니다([SWS_TCPIP_00032], [SWS_TCPIP_00033], [SWS_TCPIP_00141]). 설정되지 않은 DHCP 옵션을 쿼리하면 읽기 서비스가 길이 0을 반환합니다[SWS_TCPIP_00237].

소켓: 요청, 바인딩, 연결, 닫기

소켓은 주소 계열 및 프로토콜을 지정하여 요청합니다([SWS_TCPIP_00018], [SWS_TCPIP_00009], [SWS_TCPIP_00010]). TcpIp_Bind은 이를 로컬 주소 및 포트에 바인딩합니다[SWS_TCPIP_00111]. 포트, 프로토콜 및 주소가 이미 사용 중이거나 주소가 할당되지 않은 경우 실패합니다([SWS_TCPIP_00146], [SWS_TCPIP_00254]). TCPIP_PORT_ANY을 사용하면 스택이 49152에서 65535 사이의 포트를 직접 선택합니다SWS TcpIp 85쪽.

TCP의 경우 연결을 위한 두 가지 경로가 있습니다:

  • 클라이언트로서 TcpIp_TcpConnect은 연결을 비동기식으로 설정합니다. 연결이 수립되면 TcpIp가 <Up_TcpConnected>을 호출합니다([SWS_TCPIP_00112], [SWS_TCPIP_00227]).
  • 서버로서 TcpIp_TcpListen은 소켓을 리슨 상태로 전환합니다[SWS_TCPIP_00113]. 각각의 수신 연결에 대해 TcpIp는 별도의 소켓을 파생시키고 이를 <Up_TcpAccepted>로 알립니다[SWS_TCPIP_00226]. 상위 계층이 E_NOT_OK를 반환하면 TcpIp는 연결을 닫습니다SWS SoAd 81쪽.

새로운 TCP 연결은 TcpIp가 ONLINE 상태일 때만 수락합니다[SWS_TCPIP_00094].

클라이언트 및 서버로서의 TCP 연결 설정SoAdTcpIpEthIfalt클라이언트 (능동적 열기)TcpIp_TcpConnect(SocketId, RemoteAddrPtr)E_OK (asynchron)EthIf_ProvideTxBuffer / EthIf_Transmit(SYN)TcpIp_RxIndication(...)(원격 피어의 응답)SoAd_TcpConnected(SocketId)서버 (수동적 열기)TcpIp_TcpListen(SocketId, MaxChannels)E_OKTcpIp_RxIndication(...)(Verbindungsanfrage)Socket SocketIdConnected ableiten(최대 MaxChannels 병렬)SoAd_TcpAccepted(SocketId,SocketIdConnected, RemoteAddrPtr)E_OK / E_NOT_OK (연결 종료)

시퀀스 다이어그램: 클라이언트는 <Up_TcpConnected>을 통해 확인을 수신합니다. 서버는 연결마다 파생된 소켓을 받으며, 상위 계층은 이를 수락하거나 거부할 수 있습니다. 출처: [SWS_TCPIP_00022], [SWS_TCPIP_00023], [SWS_TCPIP_00226], [SWS_TCPIP_00227], SWS TcpIp 129쪽(이후 다이어그램에는 여기서는 생략된 LSduR이 추가로 포함됨), SWS TcpIp 107쪽

TcpIp_Close은 TCP 연결을 정상적으로 종료합니다. Abort = TRUE를 사용하면 RST를 통해 즉시 중단합니다. UDP의 경우 리소스가 즉시 해제됩니다([SWS_TCPIP_00109], [SWS_TCPIP_00110]). 리셋, FIN 또는 닫기와 같은 이벤트는 <Up_TcpIpEvent>가 알립니다[SWS_TCPIP_00144]. TcpIp_ChangeParameter을 사용하면 수신 윈도우, 프레임 우선순위, Nagle, TCP 옵션 필터 또는 UDP 체크섬과 같은 소켓 매개변수를 변경할 수 있습니다([SWS_TCPIP_00126], [SWS_TCPIP_00266], [SWS_TCPIP_00279]).

데이터 경로: 전송, 수신, 주소 확인

TcpIp_TcpTransmit은 비동기식으로 작동합니다. DataPtr이 설정된 경우 이 선형 버퍼에서 데이터를 가져옵니다. DataPtr가 NULL_PTR인 경우 <Up_CopyTxData>를 통해 데이터를 가져옵니다. ForceRetrieve = TRUE인 경우 정확히 AvailableLength 바이트이며, FALSE인 경우 더 적을 수 있습니다([SWS_TCPIP_00124], [SWS_TCPIP_00125], [SWS_TCPIP_00228]). TCP의 경우 TcpIp는 상대방이 확인 응답을 보낸 후에야 <Up_TxConfirmation>을 호출합니다([SWS_TCPIP_00225], SWS SoAd 86쪽). 반면 TcpIp_UdpTransmit은 동기식으로 즉시 전송합니다([SWS_TCPIP_00025], [SWS_TCPIP_00120]).

직접 또는 간접 데이터 제공을 통한 TCP 전송SoAdTcpIpEthIfTcpIp_TcpTransmit(SocketId, DataPtr,AvailableLength, ForceRetrieve)altDataPtr != NULL_PTR선형 버퍼에서 데이터 가져오기DataPtr == NULL_PTRloopAvailableLength까지(ForceRetrieve = TRUE) 또는 그 이하(FALSE)SoAd_CopyTxData(SocketId, BufPtr, BufLength)BUFREQ_OKE_OKTcpIp_MainFunction()EthIf_ProvideTxBuffer(...)EthIf_Transmit(..., TxConfirmation = FALSE)TcpIp_RxIndication(...)(원격 피어의 ACK)SoAd_TxConfirmation(SocketId, Length)

시퀀스 다이어그램: 데이터는 직접 전달되거나 복사 콜백을 통해 가져옵니다. EthIf로의 발송은 MainFunction의 컨텍스트에서 실행되며, 확인은 상대방의 ACK 이후에야 도착합니다. 출처: [SWS_TCPIP_00050], [SWS_TCPIP_00123], [SWS_TCPIP_00124], [SWS_TCPIP_00131], SWS TcpIp 109쪽

수신 시 IP 계층은 각 데이터그램을 로컬 주소 테이블의 항목에 매핑합니다[SWS_TCPIP_00169]. 그런 다음 UDP와 TCP는 대상 포트와 로컬 주소를 통해 소켓을 선택합니다([SWS_TCPIP_00170], [SWS_TCPIP_00172]). 기존 TCP 연결의 경우 소스 주소와 소스 포트도 일치해야 합니다[SWS_TCPIP_00173]. UDP 브로드캐스트는 일치하는 모든 소켓으로 전송되며, 브로드캐스트 주소로 전송된 TCP 세그먼트는 폐기됩니다([SWS_TCPIP_00171], [SWS_TCPIP_00174]). 단편화된 데이터그램은 TcpIp가 다시 재조립하며, 이를 위해 수신을 분리할 수 있습니다([SWS_TCPIP_00054], SWS TcpIp 131쪽). 데이터는 <Up_RxIndication>을 통해 상위 계층에 도달합니다. 상위 계층이 TCP 데이터를 처리하면 TcpIp_TcpReceived가 수신 윈도우를 다시 엽니다([SWS_TCPIP_00223], [SWS_TCPIP_00115]).

상위 계층까지의 데이터그램 수신EthIfTcpIpSoAdEthIf_MainFunctionRx()TcpIp_RxIndication(CtrlIdx, FrameType,IsBroadcast, PhysAddrPtr, DataPtr, LenByte)IP: 데이터그램을 TcpIpAddrId에 할당UDP/TCP: 대상 포트 및 로컬 주소를 통해 소켓 선택Fragmente: Reassemblierung,Empfang ggf. entkoppeltSoAd_RxIndication(SocketId, RemoteAddrPtr,BufPtr, Length)optTCP-SocketTcpIp_TcpReceived(SocketId, Length)수신 창 확장

시퀀스 다이어그램: 수신된 프레임은 로컬 주소와 포트를 통해 소켓에 할당됩니다. TCP의 경우 상위 계층의 확인 응답이 수신 윈도우를 해제합니다. 출처: [SWS_TCPIP_00029], [SWS_TCPIP_00169], [SWS_TCPIP_00170], [SWS_TCPIP_00223], [SWS_TCPIP_00115], SWS TcpIp 108쪽

전송을 위해 TcpIp는 대상의 MAC 주소가 필요하며 이를 ARP 테이블에 유지합니다:

  • 테이블은 TcpIpArpTableSizeMax개 항목으로 제한됩니다[SWS_TCPIP_00090]. 사용되지 않는 항목은 TcpIpArpTableEntryTimeout 후에 만료됩니다[SWS_TCPIP_00091].
  • 동일한 대상에 대한 반복 요청은 TcpIp가 TcpIpArpRequestTimeout 기간 동안 억제합니다[SWS_TCPIP_00350].
  • R20-11에서는 수신된 모든 IP 패킷이 테이블을 업데이트합니다[SWS_TCPIP_00092]. 이후 릴리스에서는 이를 TcpIpArpDefensiveProcessing = FALSE와 연계합니다SWS TcpIp 29쪽.
  • 항목이 없는 경우 TcpIpArpPacketQueueEnabled이 패킷을 큐에 넣을지 거부할지 결정합니다([SWS_TCPIP_00191], [SWS_TCPIP_00192]). NDP에도 동일하게 적용됩니다[SWS_TCPIP_00193].

ARP 테이블의 각 변경 사항은 TcpIp가 <Up_PhysAddrTableChg>을 통해 보고합니다[SWS_TCPIP_00142]. Neighbor Cache가 가득 차면 가장 오래된 항목이 축출됩니다[SWS_TCPIP_00264]. 쿼리는 TcpIp_GetRemotePhysAddr 및 캐시 읽기 서비스에서 허용됩니다([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 예 D 주소 변환 시작 (TcpIpArpRequestTimeout 내 대상당 최대 1개의 ARP 요청) B->D 아니요 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)

액티비티 다이어그램: 전송 시 ARP 항목이 없는 경우 패킷은 구성에 따라 큐에 대기하거나 거부됩니다. 동일한 대상에 대한 새로운 요청은 조절됩니다. 출처: [SWS_TCPIP_00191], [SWS_TCPIP_00192], [SWS_TCPIP_00350], [SWS_TCPIP_00142], SWS TcpIp 176쪽. 해석: 큐에 대기 중인 패킷은 확인이 성공한 후 전송됩니다.

보안 및 필터링: TLS, IPsec, IdsM

TCP 연결을 위해 TcpIp는 IETF RFC 5246에 따른 TLS를 지원합니다. 1.2 미만 버전은 거부됩니다([SWS_TCPIP_00300], [SWS_TCPIP_00302]). PSK ID 및 현재 시간은 구성 가능한 콜아웃에서 제공합니다([SWS_TCPIP_91014], [SWS_TCPIP_91012]). 암호화는 CSM을 통해 실행됩니다([SWS_TCPIP_00028], SWS TcpIp 251쪽).

IPsec은 IKEv2와 함께 지원되며, IKEv1은 지원되지 않습니다([SWS_TCPIP_00352], [SWS_TCPIP_00353]). 각 데이터그램은 정책에 매핑되며 정책에 따라 보호되거나 통과되거나 폐기됩니다([SWS_TCPIP_00359], [SWS_TCPIP_00360]). 허용되지 않는 IPv6 확장 헤더는 조용한 폐기로 이어집니다[SWS_TCPIP_00260]. TcpIpEnableSecurityEventReporting가 설정된 경우 TcpIp는 보안 이벤트를 IdsM에 보고합니다[SWS_TCPIP_00361].

오류가 발생한 경우의 동작

TCPIP_E_UNINIT, TCPIP_E_PARAM_POINTER, TCPIP_E_INV_ARG 및 TCPIP_E_ADDRINUSE을 포함한 개발 오류는 [SWS_TCPIP_00042]에 정의되어 있습니다. 검증 항목은 다음과 같습니다:

TcpIp는 오류 감지와 무관하게 일부 거부를 E_NOT_OK으로 반환합니다. 예를 들어 이미 사용 중인 포트 또는 일치하지 않는 주소 계열이 있습니다([SWS_TCPIP_00146], [SWS_TCPIP_00205]).

런타임 오류는 TcpIp가 Det_ReportRuntimeError을 통해 보고합니다:

R20-11은 코드 0x01부터 0x05까지만 정의합니다[SWS_TCPIP_00255]. 이후 릴리스에 추가된 코드 TCPIP_E_TX_QUEUE_OVERRUN 및 TCPIP_E_TX_INTERNAL_PROCESSING_FAILED는 여기에는 적용되지 않습니다SWS TcpIp 65쪽.

적합하지 않은 패킷은 단순히 폐기되므로 많은 오류 사례가 조용히 유지됩니다. TcpIp_GetAndResetMeasurementData은 이렇게 폐기된 패킷을 카운트하고 카운터를 리셋합니다([SWS_TCPIP_91006], [SWS_TCPIP_00296]). MAC 주소를 확인할 수 없는 경우 TcpIp는 TCPIP_E_PHYS_ADDR_MISS을 보고합니다[SWS_TCPIP_00066]. 자체 서브넷 외부의 대상에 대해 TcpIp_GetRemotePhysAddr는 즉시 TCPIP_E_NOT_OK을 반환합니다[SWS_TCPIP_00139].

더 자세한 증거

규격 발췌본을 기반으로 AI가 생성한 가이드입니다. R20-11에 대해 규범적인 것은 링크된 요구사항뿐이며, 다른 릴리스의 차이점은 명시되어 있습니다.

TCP/IP Stack (TcpIp)

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

Funktionen — Übersicht

Typen — Übersicht

Funktionen & Typen — Detailansicht

함수 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.

함수 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.

함수 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

함수 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.

함수 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.

함수 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.

함수 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.

함수 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.

함수 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.

함수 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.

함수 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.

함수 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.

함수 TcpIp_GetIpAddr [SWS_TCPIP_00032] 📄 PDF

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

Service TcpIp_GetIpAddr.

함수 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.

함수 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.

함수 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.

함수 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

함수 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

함수 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.

함수 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.

함수 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

함수 <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.

함수 <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.

함수 <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.

함수 <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.

함수 <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.

함수 <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().

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

함수 <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.

함수 <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.

함수 <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.

함수 <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.

함수 <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.

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

타입 TcpIp_SockAddrInetType [SWS_TCPIP_00013] 📄 PDF

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

타입 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

타입 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.

타입 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.

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

주제 맵

상세 보기

개요에서 항목을 선택하세요.

초기화 및 상태

Returns the version information.

void TcpIp_GetVersionInfo (Std_VersionInfoType* versioninfo);
TcpIp_Init 함수

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

서비스 · 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);

서비스 · 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);

서비스 · 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);

서비스 · 기타

TcpIp_Bind 함수

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

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

콜백

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

콜아웃 및 예상 인터페이스

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

주기적

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

void TcpIp_MainFunction (void);

타입

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.