需要 CAPL 脚本通过 TCP 连接查找 fin 或 RST 消息 - DOIP

问题描述 投票:0回答:1

有人可以帮助我使用 CAPL 脚本通过独木舟跟踪窗口查找 FIN /RST 消息吗?这是用于 DOIP 模块的 - 我希望它检查来自测试仪以及 ECU 的 RST/FIN(如我们指定的)

基本上,我们希望通过独木舟跟踪窗口识别 RST/FIN 消息,并检查其来自哪个 IP 或 MAC 地址。这有助于我们识别是从 ECU 还是测试仪接收到的信息

我们通过从 Wireshark 获取日志来使用 python 实现它,这没有用,因为我们没有在 Wireshark 中观察到当前出现在独木舟跟踪窗口上的此消息 无法找到有关 CAPL 脚本的任何帮助来实现此目的,因此需要相同的支持

on ethernetPacket *
 {
 if((this.dir == tx) && (this.tcp.IsAvailable()))     
   {
    int i; 
    for(i=0;i<=60;i++)
    {
     write(" %d TCP packet bytes %X",i,this.Byte(i));

    }
  } 
 }  
ethernet capl canoe tcpsocket automotive
1个回答
0
投票

可以使用成员

<packet>.tcp.Flags
(或
flags
,因为 CAPL 不区分大小写)来访问 TCP 标志。

在您的情况下,以下内容应该有效:

on ethernetPacket *
{
  byte RST = 0x4;

  if((this.dir == tx) && (this.tcp.IsAvailable()))     
  {
    if(this.tcp.Flags & RST == RST)
    {
      write("RST packet received");
    }
  } 
}
© www.soinside.com 2019 - 2024. All rights reserved.