html5-img
1 / 25

TamKang University Computer Science and Information Engineering

TamKang University Computer Science and Information Engineering. Member: 林玫君 資工 3D 李俊毅 資工 2B 陳 懷 資工 2B 李承恩 資工 2B 指導老師 : 石貴平 , 張志勇 助教 : Kevin Chang. OUTLINE. 組員分工 Introduction 技術分享 遭遇困難 未來規畫 參考資料. Work.

bryony
Download Presentation

TamKang University Computer Science and Information Engineering

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. TamKang UniversityComputer Science and Information Engineering Member: 林玫君 資工3D 李俊毅 資工2B 陳 懷 資工2B 李承恩 資工2B 指導老師: 石貴平,張志勇 助教: Kevin Chang

  2. OUTLINE • 組員分工 • Introduction • 技術分享 • 遭遇困難 • 未來規畫 • 參考資料

  3. Work 林玫君 程式撰寫、投影片製作、報告 李俊毅 程式撰寫、投影片製作、報告 李承恩 投影片製作 陳 懷 投影片製作

  4. 軟體支援 • PCAUSA company • - Rawether for Windows – The "Win32 NDIS Framework“ (WinDis32) • provides a uniform user-mode interface to Windows network drivers

  5. Rawether for Windows • directly access NDIS media-access controller (MAC) drivers on Windows platforms • •Network Monitors • Applications Which Use Non- Standard Protocols • Network Adapter Test Programs

  6. 名詞解釋 • NDIS:Network Driver Interface Specification(網路裝置介面規格) • SDK:software Development Kit • DDK:Driver Development Kit • OID:Object Identifier

  7. What is NDIS • (Network Driver Interface Specification)網路裝置介面規格 • 由Microsoft及3Com聯合制定的資料連結層程式介面規格,是為了解決多協定共存於單一網路介面的問題 • 早期,用戶通常只利用單一通訊協定 • 現今,因應網路的互通,經由NDIS可以利用同一張網卡即可同時接受數種協定的存取

  8. What is NDIS(cont.)

  9. Adapter Operations • Finding Adapters • Opening Adapter • Getting NDIS Adapter Information • About WinDis 32 Adapter Handle And Filters • Receiving Packets • Point To Consider About Receiving Packets • Sending Packets • Packet I/O CompletionRoutine • Timestamp Control And Interpretation • Closing Adapters

  10. Current • Show support Adapter • Show Adapter Information • Getting Adapter Name • Opening Adapter • Get ALL OID list

  11. Finding Adapters • Adapter Enumeration • Adapter Selection

  12. Finding Adapters (cont.) • Adapter Enumeration • Adapter Friendly Name: A human readable name that can be presented to a user to identify the adapter. • Adapter NDIS Name: A string token that is passed to the PCANDIS driver and eventually to NdisOpenAdapter. 例:\Device\{65A88950-829C-11D2-842E-81B82B383AF7}"

  13. Technology • Visual C++ • Microsoft Foundation Class (MFC)

  14. ShowAdapter

  15. void CShowAdapterDlg::OnShowAdapter() • { • DWORD nResult; • W32N_ADAPTER_INFO AdapterInfo; • nResult = W32N_GetFirstAdapterRegistryInfo( &AdapterInfo ); • //抓第一個adapter • ptr->ResetContent(); //清空 IDC_LIST1 • ptr1->ResetContent(); //清空 IDC_LIST3 • while( !nResult ) • { • ptr->AddString(AdapterInfo.cTitle); //在IDC_LIST1 印出 Title • nResult = W32N_GetNextAdapterRegistryInfo( &AdapterInfo ); • //抓下一個 adapter • } • }

  16. SelchangeList1(open)

  17. SelchangeList1(Not_open)

  18. void CShowAdapterDlg::OnSelchangeList1() • { • DWORD nResult; • int i=0; • char array[50]="\\Device\\"; • W32N_ADAPTER_INFO AdapterInfo; • nResult = W32N_GetFirstAdapterRegistryInfo( &AdapterInfo ); • index=ptr->GetCurSel(); //抓目前選到的那個 • if(index!=LB_ERR) // LB_ERR 沒有任何被選取的話的回傳值 • { • while( !nResult ) { • if(i==index) • { ptr1->ResetContent(); //清空 • strcat(array,AdapterInfo.cServiceName); //將ServiceName接到array後面 • ptr1->AddString(AdapterInfo.cServiceName); • if(W32N_OpenAdapter(array)!=INVALID_HANDLE_VALUE) • ptr1->AddString("Open"); //有被open • else ptr1->AddString("Not open"); //沒有open • adapter=AdapterInfo.cTitle; • break; • } • else • { • nResult = W32N_GetNextAdapterRegistryInfo( &AdapterInfo ); • //不是目前選到的,抓下一個adapter • i++; • } • } • } • }

  19. void CShowAdapterDlg::OnClear() • { • ptr->ResetContent(); • ptr1->ResetContent(); • ptr2->ResetContent(); • }

  20. OID_List

  21. void CShowAdapterDlg::OnOID_List() • { • ptr2->ResetContent(); • OID_INFO_RECORD OidInfoDatabase[]= • { • 0x00010101, "OID_GEN_SUPPORTED_LIST", 0x00000000, • 0x00010102, "OID_GEN_HARDWARE_STATUS", 0x00000000, • 0x00010103, "OID_GEN_MEDIA_SUPPORTED", 0x00000000, • 0x00010104, "OID_GEN_MEDIA_IN_USE", 0x00000000, • 0x00010105, "OID_GEN_MAXIMUM_LOOKAHEAD", 0x00000000, • ……………………. • …………………… • }; • POID_INFO_RECORD pOID; • pOID=OidInfoDatabase; • char Temp[100]; • for(int i=0;i<100;i++,pOID++) • { • sprintf(Temp,"0x%8.8x %s ",pOID->m_nValue,pOID->m_strName); • ptr2->AddString(Temp); • } • }

  22. Struct of OID_INFO_RECORD • typedef struct _OID_INFO_RECORD { DWORD m_nValue; char *m_strName; DWORD m_nFlags; } OID_INFO_RECORD, *POID_INFO_RECORD;

  23. Suffer • Can not List Support OID. • MFC is very complex and we have to spend much time.

  24. Future • Get Support OID to Query • Getting more information about MFC.

  25. Reference • Visual C++ 6 Bible • 擁抱Visual C++ • PCAUSA Document • PCAUSA simple code

More Related