Skip to content

Commit

Permalink
Update doc format
Browse files Browse the repository at this point in the history
  • Loading branch information
WinGeek committed Sep 8, 2024
1 parent 82b79c5 commit d248ee8
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 10 deletions.
2 changes: 1 addition & 1 deletion docs/code.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ nav_order: 6
permalink: /code/
---

# Understand the OpenNHP Source Code
# Understand the Source Code
{: .fs-9 }


Expand Down
3 changes: 3 additions & 0 deletions docs/zh-cn/about.zh-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,8 @@ permalink: /zh-cn/about/
---

# 关于OpenNHP开源项目
{: .fs-9 }

---


3 changes: 3 additions & 0 deletions docs/zh-cn/build.zh-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ permalink: /zh-cn/build/
---

# 编译OpenNHP
{: .fs-9 }

---

## 1. WSL环境准备

Expand Down
21 changes: 12 additions & 9 deletions docs/zh-cn/code.zh-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,27 @@ permalink: /zh-cn/code/
---

# OpeNHP代码解读
{: .fs-9 }

---

## 1. 层级架构

1.上层逻辑组件层负责UDP的连接建立、维护与断开
2.Device层负责:1.将上层的消息明文转为NHP报文并发送到连接;2.将从连接收到的NHP报文转化为消息明文并提供上层处理
3.上层逻辑组件提供
![avatar](./images/provide.png)
1. 上层逻辑组件层负责UDP的连接建立、维护与断开
2. Device层负责:1.将上层的消息明文转为NHP报文并发送到连接;2.将从连接收到的NHP报文转化为消息明文并提供上层处理
3. 上层逻辑组件提供
![avatar](/images/provide.png)

## 2. 连接管理

1.上层逻辑组件可以建立并维护多个连接UdpConn,根据实际需求创建所需对象成员。每一个UdpConn起一个线程进行收发包操作。
2.每一个UdpConn需要建立一个Device层的ConnData,并向Device ConnData传递实际连接中的远端地址,报文收发通道,cookie等。
3.每一个UdpConn允许进行多次双向的transaction或单向发包。(agent除外,原则上agent每次请求都创建一个新的连接)
4.每一个transaction都建立一个自身的线程和通道用于维持交互操作,超时后自行销毁。Local transaction(本地创建的交互)由device统一管理,Remote transaction(远端创建的交互)由远端连接管理,transaction的回应在收发包时需要找出相应的transaction线程进行后续操作。
1. 上层逻辑组件可以建立并维护多个连接UdpConn,根据实际需求创建所需对象成员。每一个UdpConn起一个线程进行收发包操作。
2. 每一个UdpConn需要建立一个Device层的ConnData,并向Device ConnData传递实际连接中的远端地址,报文收发通道,cookie等。
3. 每一个UdpConn允许进行多次双向的transaction或单向发包。(agent除外,原则上agent每次请求都创建一个新的连接)
4. 每一个transaction都建立一个自身的线程和通道用于维持交互操作,超时后自行销毁。Local transaction(本地创建的交互)由device统一管理,Remote transaction(远端创建的交互)由远端连接管理,transaction的回应在收发包时需要找出相应的transaction线程进行后续操作。

## 3. 对象命名

1.上层逻辑组件在收发方向上可能具有多重身份,Device层中使用initiator和responder表示发起方和接收方。
1. 上层逻辑组件在收发方向上可能具有多重身份,Device层中使用initiator和responder表示发起方和接收方。

## 4. 报文缓冲区的创建与销毁(回收)

Expand Down
3 changes: 3 additions & 0 deletions docs/zh-cn/comparison.zh-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@ permalink: /zh-cn/comparison/
---

# NHP与SPA的对比
{: .fs-9 }

---

3 changes: 3 additions & 0 deletions docs/zh-cn/deploy.zh-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ permalink: /zh-cn/deploy/
---

# 部署OpenNHP
{: .fs-9 }

---

## 1. OpenNHP组件说明

Expand Down
3 changes: 3 additions & 0 deletions docs/zh-cn/features.zh-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,8 @@ permalink: /zh-cn/features/
---

# OpenNHP功能列表
{: .fs-9 }

---


3 changes: 3 additions & 0 deletions docs/zh-cn/index.zh-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ permalink: /zh-cn/
---

# OpenNHP中文版文档
{: .fs-9 }

---
3 changes: 3 additions & 0 deletions docs/zh-cn/overview.zh-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ permalink: /zh-cn/overview/
---

# OpenNHP:零信任网络隐身协议
{: .fs-9 }

---

## 第一章:导读

Expand Down
3 changes: 3 additions & 0 deletions docs/zh-cn/server_plugin.zh-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ permalink: /zh-cn/server_plugin/
---

# NHP服务器 插件开发文档
{: .fs-9 }

---

## 简介
NHP服务器中的插件是添加特定功能到主应用程序的模块。它们被设计为高度模块化,与主应用程序松散耦合,允许开发人员添加、删除或更新插件,而不影响服务器的核心功能。
Expand Down

0 comments on commit d248ee8

Please sign in to comment.