style:优化 UDP 头部格式的注释

- 将 UDP 头部格式的注释从英文修改为中文
-调整字节描述,使格式更加统一和清晰
This commit is contained in:
fly6516 2025-01-06 15:36:16 +08:00
parent 1e7ce614d4
commit 4c8d4db8fc

View File

@ -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