Reading PCAP files on Matlab

89 ビュー (過去 30 日間)
Nishu Vidyarthi
Nishu Vidyarthi 2020 年 2 月 20 日
回答済み: Idin Motedayen-Aval 2024 年 6 月 3 日
I am trying to read PCAP files on matlab. Can anyone suggest how to do so?
  5 件のコメント
Tolga Ulupinar
Tolga Ulupinar 2022 年 2 月 1 日
Hi James. I have some problems in your scripts. In capture read " error using hex2num Too many input arguments" . Can you help me for this error. How can ı fix this error. I used test_packet.txt
Walter Roberson
Walter Roberson 2022 年 2 月 1 日
編集済み: Walter Roberson 2022 年 2 月 1 日
I see that @James mentioned that he wrote the code using Octave. The Octave hex2num() supports passing a class as the second parameter, but MATLAB does not.
I think you can change the hex2udp line
udp.(fields{fn})=hex2num(udp.(fields{fn}),'uint16');
to
udp.(fields{fn}) = uint16(sscanf(udp.(fields{fn}), '%x'));
This would possibly have slightly different behaviour in cases where the input somehow had spaces or non-hex characters instead of the expect hex output; I do not have access to Octave to test its behaviour in detail (and there is the big question of what would be most reasonable to have happen in that circumstance.)

サインインしてコメントする。

採用された回答

Pujitha Narra
Pujitha Narra 2020 年 2 月 24 日
編集済み: Pujitha Narra 2020 年 2 月 24 日
Hi,
There is no such feature as of now, but it might be considered for a future release. However, 'pcap2matlab' is one of the several submissions in MATLAB File Exchange on MATLAB Central which is a forum for our product users to interact, exchange information and knowledge, without MathWorks' involvement. Feel free to contact the author of this submission directly for specific questions about the implementation.
Here's the link to the file:

その他の回答 (2 件)

michael
michael 2020 年 6 月 20 日
Hello,
Please see my response here on how to use pcap2matlab

Idin Motedayen-Aval
Idin Motedayen-Aval 2024 年 6 月 3 日
For completeness:
If you have access to 5G Toolbox, there is built-in pcapReader function that has been available since R2021b.

カテゴリ

Help Center および File ExchangeWLAN Toolbox についてさらに検索

タグ

製品


リリース

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by