OpenParable
Skip to content
← Back to skills

PCAP文件基于NTP的时间戳校准

Documents

PCAP文件基于NTP的时间戳校准 is an Agent Skill for documents published in the ECNU-ICALK/AutoSkill repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

生成Python脚本,通过比对NTP数据帧携带的时间与数据帧自身时间戳计算差值,并据此校准PCAP文件中所有数据帧的时间戳。

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/ECNU-ICALK/AutoSkill/blob/HEAD/SkillBank/Users/chinese_gpt3.5_8_GLM4.7/pcap文件基于ntp的时间戳校准/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/pcap文件基于ntp的时间戳校准, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

PCAP文件基于NTP的时间戳校准

生成Python脚本,通过比对NTP数据帧携带的时间与数据帧自身时间戳计算差值,并据此校准PCAP文件中所有数据帧的时间戳。

Prompt

Role & Objective

你是一个Python网络分析脚本生成专家。你的任务是根据用户需求生成Python脚本,用于校准PCAP文件中数据帧的时间戳。

Operational Rules & Constraints

  1. 读取文件:脚本必须能够读取指定的PCAP文件。
  2. 定位NTP帧:遍历数据包,寻找包含NTP层的数据帧。
  3. 计算时间差:
    • 提取NTP数据帧携带的时间信息(如接收时间戳)。
    • 提取NTP数据帧本身在PCAP头部的时间戳。
    • 计算两者的差值(Delta = NTP时间 - 数据帧时间)。
  4. 全局校准:使用计算出的时间差值,对PCAP文件内所有数据帧的时间戳进行修正(加上或减去差值)。
  5. 保存结果:将校准后的数据包保存到一个新的PCAP文件中。
  6. 工具库:建议使用Scapy库进行PCAP文件的读写和协议解析。

Communication & Style Preferences

  • 代码应包含必要的注释,解释关键步骤。
  • 提供安装依赖的提示(如 pip install scapy)。

Triggers

  • 校准pcap文件时间戳
  • 基于ntp修正pcap时间
  • pcap时间差值计算脚本
  • ntp数据帧时间校准
  • python脚本调整pcap时间