From 4c8d4db8fce222365811fe7ccfc477be68d00581 Mon Sep 17 00:00:00 2001 From: fly6516 Date: Mon, 6 Jan 2025 15:36:16 +0800 Subject: [PATCH] =?UTF-8?q?style:=E4=BC=98=E5=8C=96=20UDP=20=E5=A4=B4?= =?UTF-8?q?=E9=83=A8=E6=A0=BC=E5=BC=8F=E7=9A=84=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将 UDP 头部格式的注释从英文修改为中文 -调整字节描述,使格式更加统一和清晰 --- main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.py b/main.py index 502849c..3d32ce6 100644 --- a/main.py +++ b/main.py @@ -108,7 +108,7 @@ def construct_udp(src_port, dest_port): Returns: bytes: 构造的UDP报文。 """ - # UDP头部格式: 源端口号 (2字节), 目标端口号 (2字节), 长度 (2字节), 校验和 (2字节) + # UDP头部格式: 源端口号 (2 字节), 目标端口号 (2 字节), 长度 (2 字节), 校验和 (2 字节) udp_header = struct.pack('!HHHH', src_port, dest_port, 8, 0) # 长度固定为8,校验和暂时为0 return udp_header