04
09

rpcapd與netcat-測試嵌入式系統的好工具

最近在改一個SPI driver,發現硬體的通訊界面好像都差不多,不是direct就是indirect, command與data也是一來一回,不同的硬體通訊界面只有速度快慢的問題,感覺SPI似乎比IIC要快很多

netcat這個東西已經好多人講了它的用法,所以這邊不再贅述,它可以打死netconsole這個linux新的feature,比方說在device上下達指令

cat /proc/kmsg | netcat –l –p 1234

這樣子就可以在本機端連device的port 1234觀察kernel log,本機端的指令下法如下

nc [device IP] 1234

rpcapd是主機端抓device封包的好物,可以遠端截取device上任意網卡界面的封包,有個不錯的網頁介紹rpcap daemon可以下的所有指令,搭配主機端的wireshark或ethereal,可以省掉我們在device console執行tcpdump的不便

在device上下達指令

rpcapd –b [local IP address] –n(NULL認證)

在wireshark選擇adpater option後,設定capture的界面為rpcap://[IP address]/[interface name]

[2009.4.10]New Added

rpcapd cross compile steps:

1. cross compile libpcap under winpcap directory

2. cross compile rpcapd and fix some bugs

3. rpcapd executable static binary for little endian arm could be downloaded from here (rpcap binary is updated)[2009.4.15]

[2009.4.15]Update

[Important]You must config kernel PACKET_SOCKET option to use rpcapd. (Sorry for this late update, I haven't totally read user manual in libpcap)

 Packet socket
        CONFIG_PACKET
          The Packet protocol is used by applications which communicate
          directly with network devices without an intermediate network
          protocol implemented in the kernel, e.g. tcpdump. If you want them
          to work, choose Y.


在device端執行畫面如下

設定畫面大概如下圖

標籤: embedded
評論: 0 | 引用: 0 | 閱讀: 8665
發表評論
暱 稱: 密 碼:
網 址: E - mail:
驗證碼: 驗證碼圖片 選 項:
頭 像:
內 容: