1. 打開 /trace/cmu-trace.cc
2. 移到CMUTrace::format_mac(Packet *p, int offset)
3. 把 else if (newtrace_) 內的程式碼改成這樣
sprintf(pt_->buffer() + offset, "-Ma %x -Md %x -Ms %x -Mt %x -Mtype %s ",
mh->dh_duration, ETHER_ADDR(mh->dh_ra), ETHER_ADDR(mh->dh_ta),
GET_ETHER_TYPE(mh->dh_body),
(mh->dh_fc.fc_subtype == MAC_Subtype_RTS) ? "RTS" :
(mh->dh_fc.fc_subtype == MAC_Subtype_CTS) ? "CTS" :
(mh->dh_fc.fc_subtype == MAC_Subtype_ACK) ? "ACK" : "DATA");
為新增的地方, 注意 -Mtype %s 後有個空白
4. 存檔, 重新compile 即可
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.112.42.171