diff --git a/inc/common.h b/inc/common.h index ac3859b..08d61af 100644 --- a/inc/common.h +++ b/inc/common.h @@ -150,7 +150,11 @@ typedef unsigned short __u16; typedef __signed__ int __s32; typedef unsigned int __u32; -#define ETH_TYPE_IP 0x0800 +#define ETH_P_LOOP 0x0060 /* Ethernet Loopback packet */ +#define ETH_P_ECHO 0x0200 /* Ethernet Echo packet */ +#define ETH_P_PPP_DISC 0x8863 /* PPPoE discovery messages */ +#define ETH_P_PPP_SES 0x8864 /* PPPoE session messages */ + #define ETH_P_IP 0x0800 /* Internet Protocol packet */ #define ETH_P_ARP 0x0806 /* Address Resolution packet */ #define ETH_P_RARP 0x8035 /* Reverse Addr Res packet */ diff --git a/release_notes.txt b/release_notes.txt index 5101d79..3291df4 100644 --- a/release_notes.txt +++ b/release_notes.txt @@ -1,11 +1,12 @@ - 小兵以太网测试仪 v2.3.1 + 小兵以太网测试仪 v2.3.2 -发布日期:2013-11-20 +发布日期:2013-11-21 +【错误修改】 + o 纠正了报文列表框中的地址显示错误。 【功能完善】 - o 优化了报文列表的显示内容。 - o 优化了部分界面显示。 + o 完善了报文列表框中以太网报文的显示内容。 \ No newline at end of file diff --git a/src/common.c b/src/common.c index c3e44a3..66b3ab8 100644 --- a/src/common.c +++ b/src/common.c @@ -1063,6 +1063,19 @@ void get_eth_type_name(int type, char *info) strcpy(info, "rarp"); return; + case ETH_P_LOOP: + strcpy(info, "LOOP"); + return; + + case ETH_P_ECHO: + strcpy(info, "ECHO"); + return; + + case ETH_P_PPP_DISC: + case ETH_P_PPP_SES: + strcpy(info, "PPPoE"); + return; + case ETH_P_IPV6: strcpy(info, "ipv6"); return; diff --git a/src/frame_window.c b/src/frame_window.c index 556ed03..bada703 100644 --- a/src/frame_window.c +++ b/src/frame_window.c @@ -316,7 +316,7 @@ CreateStatusBar(); case IDM_GET_NEW_VERSION: ShellExecute(NULL, "open" - , "http://www.crsky.com/soft/49404.html" + , "http://sourceforge.net/projects/xb-ether-tester/files/latest/download?source=directory" , NULL, NULL, SW_SHOWNORMAL); return 0 ; diff --git a/src/right_window.c b/src/right_window.c index 7cefa13..5f16a5e 100644 --- a/src/right_window.c +++ b/src/right_window.c @@ -12,7 +12,7 @@ #include "global_info.h" #include "res.h" -const char version[4]={'2','3','1','0'}; +const char version[4]={'2','3','2','0'}; TCHAR szRightWinClassName[] = TEXT ("right_win") ; HWND hwnd_right; @@ -270,23 +270,11 @@ BOOL InsertItemFromStream(HWND hWndListView, t_stream* pt_stream) if (ntohs(pt_eth_hdr->type)!=ETH_P_IP) { - sprintf(info, "%02hhx %02hhx %02hhx %02hhx %02hhx %02hhx" - , pt_stream->eth_packet.src[0] - , pt_stream->eth_packet.src[1] - , pt_stream->eth_packet.src[2] - , pt_stream->eth_packet.src[3] - , pt_stream->eth_packet.src[4] - , pt_stream->eth_packet.src[5]); + mac_n2str(info, pt_stream->eth_packet.src); ListView_SetItemText(hWndListView, index, 4, info); - sprintf(info, "%02hhx %02hhx %02hhx %02hhx %02hhx %02hhx" - , pt_stream->eth_packet.dst[0] - , pt_stream->eth_packet.dst[1] - , pt_stream->eth_packet.dst[2] - , pt_stream->eth_packet.dst[3] - , pt_stream->eth_packet.dst[4] - , pt_stream->eth_packet.dst[5]); + mac_n2str(info, pt_stream->eth_packet.dst); ListView_SetItemText(hWndListView, index, 5, info); get_eth_type_name(ntohs(pt_stream->eth_packet.type), info); diff --git a/src/stream_edit_dlg.c b/src/stream_edit_dlg.c index a7a20f6..c399033 100644 --- a/src/stream_edit_dlg.c +++ b/src/stream_edit_dlg.c @@ -672,6 +672,22 @@ void get_pkt_desc_info(char *info, void* p_eth_hdr, uint32_t err_flags) strcpy(info, "rarp"); goto append_err_info; + case ETH_P_LOOP: + strcpy(info, "Ethernet Loopback packet"); + goto append_err_info; + + case ETH_P_ECHO: + strcpy(info, "Ethernet Echo packet"); + goto append_err_info; + + case ETH_P_PPP_DISC: + strcpy(info, "PPPoE discovery messages"); + goto append_err_info; + + case ETH_P_PPP_SES: + strcpy(info, "PPPoE session messages"); + goto append_err_info; + case ETH_P_IPV6: strcpy(info, "IPv6"); goto append_err_info; @@ -890,7 +906,7 @@ void show_edit_ui_for_tvi(HWND hDlg, HWND htv, HTREEITEM htvi) hex_win_sel(GetDlgItem(hDlg, ID_SED_HEX_EDIT), pt_tvi_data->data_offset, pt_tvi_data->len); - if ((ETH_TYPE_IP==ntohs(gt_edit_stream.eth_packet.type)) + if ((ETH_P_IP==ntohs(gt_edit_stream.eth_packet.type)) && (pt_tvi_data->data_offset==23)) { @@ -1879,22 +1895,10 @@ BOOL InsertItemFromPkt(HWND hWndListView, t_dump_pkt *pt_pkt, struct timeval *ba if (ntohs(pt_eth_hdr->type)!=ETH_P_IP) { - sprintf(info, "%02hhx %02hhx %02hhx %02hhx %02hhx %02hhx" - , pt_pkt->pkt_data[0] - , pt_pkt->pkt_data[1] - , pt_pkt->pkt_data[2] - , pt_pkt->pkt_data[3] - , pt_pkt->pkt_data[4] - , pt_pkt->pkt_data[5]); + mac_n2str(info, pt_pkt->pkt_data+6); ListView_SetItemText(hWndListView, index, 2, info); - sprintf(info, "%02hhx %02hhx %02hhx %02hhx %02hhx %02hhx" - , pt_pkt->pkt_data[6] - , pt_pkt->pkt_data[7] - , pt_pkt->pkt_data[8] - , pt_pkt->pkt_data[9] - , pt_pkt->pkt_data[10] - , pt_pkt->pkt_data[11]); + mac_n2str(info, pt_pkt->pkt_data); ListView_SetItemText(hWndListView, index, 3, info); get_eth_type_name(ntohs(pt_eth_hdr->type), info); @@ -1908,7 +1912,7 @@ BOOL InsertItemFromPkt(HWND hWndListView, t_dump_pkt *pt_pkt, struct timeval *ba ip_n2str(info, &(iph->saddr)); ListView_SetItemText(hWndListView, index, 2, info); - ip_n2str(info, &(iph->saddr)); + ip_n2str(info, &(iph->daddr)); ListView_SetItemText(hWndListView, index, 3, info); get_protocol_name(iph->protocol, info); diff --git a/xb_ether_tester.nsi b/xb_ether_tester.nsi index 00dcbc8..5ec3187 100644 --- a/xb_ether_tester.nsi +++ b/xb_ether_tester.nsi @@ -12,7 +12,7 @@ ; HM NIS Edit Wizard helper defines !define PRODUCT_NAME "小兵以太网测试仪" -!define PRODUCT_VERSION "2.3.1" +!define PRODUCT_VERSION "2.3.2" !define PRODUCT_PUBLISHER "孙明保" !define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\xb_ether_tester.exe" !define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"