簡體   English   中英

Linux內核中的tcp_disconnect函數是做什么的,在什么情況下調用的?

[英]What does tcp_disconnect function in the Linux kernel do, and under what circumstances is it invoked?

我正在嘗試在 Linux 內核模塊中實現 ULP,並且一直在查看全局變量struct proto tcp_prot中的函數指針,以便我可以了解哪些函數指針字段要復制到我自己的struct proto以及哪些用我自己的實現覆蓋的字段。 struct proto的字段之一是disconnect ,它被設置為內核函數tcp_disconnect 但是,我似乎無法找到此功能的用戶空間模擬,而且 Google 沒有提供任何有用的信息。 那么tcp_disconnect的目的是tcp_disconnect 它做什么以及何時調用?

與大多數協議棧一樣,Linux 內核中的 TCP/IP 棧是作為狀態機實現的,即https://wiki.aalto.fi/download/attachments/70789052/linux-tcp-review.pdf第 5 頁. 所以TCP協議並沒有完全導出到用戶空間,而是機器之間存在“隱藏通信”。

linux內核中TCP狀態機中tcp_disconnect()的源碼在https://elixir.bootlin.com/linux/v4.6/source/net/ipv4/tcp.c#L2191

http://www.tcpipguide.com/free/t_TCPOperationalOverviewandtheTCPFiniteStateMachineF-2.htm

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM