資源簡介
1.按Ethernet V2.0格式封裝Ethernet幀,源地址來自本機MAC地址,目的地址為隨意編寫的有效MAC地址,類型字段為IP協議對應值,數據字段來自文本文件(見附件),幀校驗字段采用8位CRC校驗。
2.輸出每個幀的各字段內容,數據字段采用字符串輸出,其他字段為十六進制輸出。
3.命令行程序(85分封頂)或圖形化程序(100分封頂)。

代碼片段和文件信息
#include
using?namespace?std;
void?checkCRC(int?&chCurrByteint?chNextByte)????????????
{
for(int?nMask=0x80;?nMask>0;?nMask>>=?1)
{
if((chCurrByte&0x80)!=0) ????//首位為1:移位,并進行異或運算
{
chCurrByte<<=1;
if((chNextByte&nMask)!=0)
{
chCurrByte|=?1;
}
chCurrByte?^=7; //首位移出,僅對低8位進行異或運算
}
else //首位為0,只移位,不進行異或運算
{
chCurrByte<<=1; //移一位
if((chNextByte&nMask)!=?0) //補一位
{
chCurrByte|=1;
}
}
}
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????134366??2013-10-31?10:49??Ethernet幀的解析\2120130365-籍鑫璞-第一次作業\2012130365-籍鑫璞-第一次作業.doc
?????文件????1633280??2013-10-31?13:26??Ethernet幀的解析\2120130365-籍鑫璞-第一次作業\Ethernetfr
?????文件????????905??2013-10-28?21:00??Ethernet幀的解析\2120130365-籍鑫璞-第一次作業\Ethernetfr
????..A..H.?????10240??2013-10-31?13:26??Ethernet幀的解析\2120130365-籍鑫璞-第一次作業\Ethernetfr
?????文件????????544??2013-10-28?21:02??Ethernet幀的解析\2120130365-籍鑫璞-第一次作業\Ethernetfr
?????文件???????4970??2013-10-30?16:10??Ethernet幀的解析\2120130365-籍鑫璞-第一次作業\Ethernetfr
?????文件???????4001??2013-10-29?10:29??Ethernet幀的解析\2120130365-籍鑫璞-第一次作業\Ethernetfr
?????文件???????1427??2013-10-31?13:26??Ethernet幀的解析\2120130365-籍鑫璞-第一次作業\Ethernetfr
?????文件???????2303??2013-10-08?16:52??Ethernet幀的解析\2120130365-籍鑫璞-第一次作業\Ethernetfr
?????文件???????6270??2013-10-30?16:10??Ethernet幀的解析\2120130365-籍鑫璞-第一次作業\Ethernetfr
?????文件??????23070??2013-10-28?21:02??Ethernet幀的解析\2120130365-籍鑫璞-第一次作業\Ethernetfr
?????文件????????663??2013-10-28?21:02??Ethernet幀的解析\2120130365-籍鑫璞-第一次作業\Ethernetfr
?????文件????????728??2013-10-28?21:02??Ethernet幀的解析\2120130365-籍鑫璞-第一次作業\Ethernetfr
?????文件????????621??2013-10-30?16:10??Ethernet幀的解析\2120130365-籍鑫璞-第一次作業\Ethernetfr
?????文件??????63980??2013-10-30?16:10??Ethernet幀的解析\2120130365-籍鑫璞-第一次作業\Ethernetfr
?????文件?????????67??2013-10-30?16:10??Ethernet幀的解析\2120130365-籍鑫璞-第一次作業\Ethernetfr
?????文件?????232448??2013-10-30?16:10??Ethernet幀的解析\2120130365-籍鑫璞-第一次作業\Ethernetfr
?????文件?????225280??2013-10-30?16:10??Ethernet幀的解析\2120130365-籍鑫璞-第一次作業\Ethernetfr
?????文件??????48640??2013-10-30?16:10??Ethernet幀的解析\2120130365-籍鑫璞-第一次作業\Ethernetfr
?????文件?????564332??2013-10-30?16:10??Ethernet幀的解析\2120130365-籍鑫璞-第一次作業\Ethernetfr
?????文件?????633856??2013-10-30?16:10??Ethernet幀的解析\2120130365-籍鑫璞-第一次作業\Ethernetfr
?????文件???????2303??2013-10-08?16:52??Ethernet幀的解析\2120130365-籍鑫璞-第一次作業\Ethernetfr
?????目錄??????????0??2013-10-31?16:50??Ethernet幀的解析\2120130365-籍鑫璞-第一次作業\Ethernetfr
?????目錄??????????0??2013-10-31?16:50??Ethernet幀的解析\2120130365-籍鑫璞-第一次作業\Ethernetfr
?????目錄??????????0??2013-10-31?16:50??Ethernet幀的解析\2120130365-籍鑫璞-第一次作業\Ethernetfr
?????目錄??????????0??2013-10-31?16:50??Ethernet幀的解析\2120130365-籍鑫璞-第一次作業\Ethernetfr
?????目錄??????????0??2013-10-31?16:50??Ethernet幀的解析\2120130365-籍鑫璞-第一次作業
?????目錄??????????0??2013-10-31?16:50??Ethernet幀的解析
-----------?---------??----------?-----??----
??????????????3594294????????????????????28
............此處省略1個文件信息
- 上一篇:夾具設計--一面兩孔的夾具設計
- 下一篇:XY2-100協議說明
評論
共有 條評論