DEENESPTFRRUARHIKOZHNL

TCP/IP Stack (TcpIp)

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

دليل الوحدةمولَّد بالذكاء الاصطناعي

يوفر اتصالات IP عبر TCP وUDP مع إدارة العناوين للطبقات العليا في حزمة Ethernet.
مُولَّد بالذكاء الاصطناعي غير مُراجَع النموذج: claude-opus-5-5 · الجهد: high · درجة الحرارة: غير قابل للتحكم · الموجّه: 0a4cda5ef1d2 المصدر أسئلة مفتوحة (3)
المرساة السببية: R20-11 صالح اعتبارًا من R20-11 مُركَّب حديثًا لهذا الإصدار من المواصفة.
مترجم من الدليل الألمانيgemini-3.8-flash-low · 2026-10-13 · الأصل الألماني

يوفر اتصالات IP عبر TCP وUDP مع إدارة العناوين للطبقات العليا في حزمة Ethernet.

يوفر TcpIp في حزمة Classic-Ethernet كلاً من IPv4 وIPv6 مع ARP وNDP وICMP وDHCP بالإضافة إلى UDP وTCP، وبالتالي يخدم مالكي المقابس مثل SoAd [SWS_TCPIP_00052]. ويتحكم EthSM في الحالات ONLINE وONHOLD وOFFLINE لكل وحدة تحكم EthIf. ولا تصبح وحدة التحكم في حالة ONLINE إلا بعد تعيين عنوان محلي لها [SWS_TCPIP_00085]. يتم طلب المقابس وربطها وتوصيلها في TCP بشكل نشط أو سلبي، وتتدفق البيانات عبر خدمات الإرسال واستدعاءات الرد (Callbacks). أهم شرط محدد: لا يقبل TcpIp اتصالات TCP جديدة إلا في الحالة ONLINE، ويرفض طلبات الإرسال الجديدة في الحالة ONHOLD.

في حزمة Classic-Ethernet، يكون TcpIp مسؤولاً عن اتصالات IP. وهو يتألف من وحدات فرعية لـ IPv4 (مع ARP وICMP وDHCP وAuto-IP)، ولـ IPv6 (مع NDP وICMPv6 وDHCPv6) بالإضافة إلى UDP وTCP وTLS ([SWS_TCPIP_00052]، [SWS_TCPIP_00150]). وفي الاتجاه الأعلى، يخدم مالكي المقابس، أي SoAd أو وحدات CDD، بدوال TcpIp_<Up>GetSocket خاصة به واستدعاءات رد ([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 حالتين انتقاليتين ولا يمكن طلبهما [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، أو كـ Link-Local، ويتم اختيارها حسب الأولوية وتخزينها عند الرغبة في 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 بتعيين مخططات البيانات (Datagrams) المستلمة إلى مقبس عبر العنوان المحلي والمنفذ [SWS_TCPIP_00170]. وإذا كان عنوان MAC للوجهة مفقودًا، يحدد TcpIpArpPacketQueueEnabled ما إذا كانت الحزمة ستوضع في قائمة الانتظار أم ستُرفض [SWS_TCPIP_00192]. ويبلغ TcpIp عن أخطاء وقت التشغيل مثل انتهاء المهلة، أو المضيفين الذين يتعذر الوصول إليهم، أو تضارب العناوين إلى DET. وفي R20-11، تم تعريف الرموز من 0x01 إلى 0x05 لهذا الغرض [SWS_TCPIP_00255]. ولأغراض الحماية، يضاف TLS بدءًا من الإصدار 1.2 وIPsec مع IKEv2 ([SWS_TCPIP_00302]، [SWS_TCPIP_00353]).

الدور في حزمة Ethernet: وسيط بين مالكي المقابس وEthIf

يجمع TcpIp الاتصالات المستندة إلى IP لوحدة تحكم إلكترونية كلاسيكية (Classic ECU) في وحدات فرعية [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]). تحدد ثلاث فئات قابلية توسع (Scaling Classes) النطاق: حزمة IPv4، وحزمة IPv6، والحزمة المزدوجة (Dual Stack) 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].

  • يؤدي طلب ONLINE من الحالة OFFLINE إلى تنشيط تعيينات العناوين المهيأة [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 الحالة ONLINE بناءً على طلب ComM 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-Localerste 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 أو Link-Local ([SWS_TCPIP_00065]، SWS TcpIp ص. 224). وإذا أصبح عنوان ذو أولوية أعلى متاحًا، فإنه يحل محل العنوان الحالي [SWS_TCPIP_00127].

تعتمد كيفية تشغيل التعيين والتحرير على المشغل (Trigger) المهيأ:

يبلغ <Up_LocalIpAddrAssignmentChg> عن كل تغيير في التعيين بقيمة من النوع TcpIp_IpAddrStateType ([SWS_TCPIP_00229]، [SWS_TCPIP_00082]). ويعلن TcpIp عن عناوين IPv4 الجديدة عبر 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 المقبس في حالة الاستماع (Listen) [SWS_TCPIP_00113]. ولكل اتصال وارد، يشتق TcpIp مقبسًا خاصًا به ويبلغ عنه باستخدام <Up_TcpAccepted> [SWS_TCPIP_00226]. وإذا أرجعت الطبقة العليا E_NOT_OK، يغلق TcpIp الاتصال SWS SoAd ص. 81.

لا يقبل TcpIp اتصالات TCP جديدة إلا في الحالة 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]). تبلغ <Up_TcpIpEvent> عن أحداث مثل إعادة الضبط (Reset) أو FIN أو الإغلاق [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_PTRloopحتى AvailableLength (عند 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: تعيين مخطط البيانات لمُعرّف TcpIpAddrIdUDP/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].

يبلغ TcpIp عن كل تغيير في جدول ARP عبر <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 بدء تحليل العناوين (طلب ARP واحد كحد أقصى لكل وجهة خلال TcpIpArpRequestTimeout) 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 بروتوكول TLS وفقًا لـ IETF RFC 5246. ويتم رفض الإصدارات الأقدم من 1.2 ([SWS_TCPIP_00300]، [SWS_TCPIP_00302]). وتوفر استدعاءات الخروج (Callouts) القابلة للتهيئة هويات PSK والوقت الحالي ([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:

  • TCPIP_E_TIMEDOUT، إذا لم يرد أي رد على SYN، أو انتهت مهلة مراقبة Keep-Alive، أو استنفدت محاولات الإعادة [SWS_TCPIP_00256]،
  • TCPIP_E_CONNREFUSED وTCPIP_E_HOSTUNREACH وTCPIP_E_PACKETTOBIG بعد رسائل ICMP المقابلة ([SWS_TCPIP_00257]، [SWS_TCPIP_00258]، [SWS_TCPIP_00259])،
  • TCPIP_E_DADCONFLICT في حالة تكرار تعيين عنوان [SWS_TCPIP_00282].

يحدد 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].

أدلة تفصيلية إضافية

دليل تم إنشاؤه بواسطة الذكاء الاصطناعي بناءً على مقتطفات من المواصفات. إن المتطلبات المرتبطة هي وحدها المعيارية للإصدار 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#614eeefc
Content hash
614eeefc
Source
https://www.autosar.org/fileadmin/standards/R20-11/CP/AUTOSAR_SWS_TcpIp.pdf#nameddest=SWS_TCPIP_00002

خريطة المواضيع

التهيئة والحالة

2

دوال الاستدعاء الراجع

1

عرض التفاصيل

اختر عنصرًا من المخطط.

التهيئة والحالة

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);
TcpIp_Close دالة

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

دوال Callout والواجهات المتوقعة

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.