feat(doc):添加网络子系统模块 (#1020)

* feat(doc): 添加网络子系统文档

* make fmt
This commit is contained in:
Cai Junyuan 2024-10-30 14:46:44 +08:00 committed by GitHub
parent fad1c09757
commit 055c1448e3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 31 additions and 0 deletions

View File

@ -31,6 +31,7 @@
kernel/ktest/index kernel/ktest/index
kernel/cpu_arch/index kernel/cpu_arch/index
kernel/libs/index kernel/libs/index
kernel/net/index
.. toctree:: .. toctree::

View File

@ -0,0 +1,8 @@
网络子系统
====================================
DragonOS 网络子系统
.. toctree::
:maxdepth: 1
unix

22
docs/kernel/net/unix.md Normal file
View File

@ -0,0 +1,22 @@
# UNIX
## unix socket
unix - 用于进程间通信的socket
## 描述
AF_UNIX socket family 用于在同一台机器中的不同进程之间的通信IPC。unix socket地址现支持绑定文件地址未支持绑定abstract namespace抽象命名空间。
目前unix 域中合法的socket type有SOCK_STREAM, 提供stream-oriented socket可靠有序传输消息SOCK_SEQPACKET提供connection-oriented消息边界和按发送顺序交付消息保证的socket。
### unix stream socket 进程通信描述
unix stream socket 提供进程间流式传输消息的功能。假设对端进程作为服务端本端进程作为客户端。进程间使用stream socket通信过程如下
分别在对端进程和本端进程创建socket服务端需要bind地址客户端不必须bind地址。通信过程类似tcp三次握手流程服务端调用listen系统调用进入监听状态监听服务端bind的地址客户端调用connect系统调用连接服务端地址服务端调用accept系统调用接受来自客户端的连接返回建立连接的新的socket。成功建立连接后可以调用write\send\sendto\sendmsg进行写操作调用read\recv\recvfrom\recvmsg进行读操作。目前尚未支持非阻塞式读写默认为阻塞式读写。读写完毕后调用close系统调用关闭socket连接。
### unix seqpacket socket 进程通信描述