25
TamKang University Computer Science and Inf ormation Engineering Member: 林林林 林林 3D 林林林 林林 2B 林 林林 2B 林林林 林林 2B 林林林林 : 林林林 , 林林林 林林 : Kevin Cha ng

TamKang University Computer Science and Information Engineering

  • Upload
    bryony

  • View
    45

  • Download
    1

Embed Size (px)

DESCRIPTION

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

Citation preview

Page 1: TamKang University Computer Science and          Information Engineering

TamKang University Computer Science and Information En

gineering

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

Page 2: TamKang University Computer Science and          Information Engineering

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

Page 3: TamKang University Computer Science and          Information Engineering

Work

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

Page 4: TamKang University Computer Science and          Information Engineering

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

Windows network drivers

Page 5: TamKang University Computer Science and          Information Engineering

Rawether for Windows directly access NDIS media-access contro

ller (MAC) drivers on Windows platforms • Network Monitors • Applications Which Use Non- Standard Protocols • Network Adapter Test Programs

Page 6: TamKang University Computer Science and          Information Engineering

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

Page 7: TamKang University Computer Science and          Information Engineering

What is NDIS

(Network Driver Interface Specification) 網路裝置介面規格

由 Microsoft 及 3Com 聯合制定的資料連結層程式介面規格,是為了解決多協定共存於單一網路介面的問題

早期,用戶通常只利用單一通訊協定 現今,因應網路的互通,經由 NDIS 可以利用同

一張網卡即可同時接受數種協定的存取

Page 8: TamKang University Computer Science and          Information Engineering

What is NDIS(cont.)

Page 9: TamKang University Computer Science and          Information Engineering

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

Page 10: TamKang University Computer Science and          Information Engineering

Current

Show support Adapter Show Adapter Information Getting Adapter Name Opening Adapter Get ALL OID list

Page 11: TamKang University Computer Science and          Information Engineering

Finding Adapters Adapter Enumeration Adapter Selection

Page 12: TamKang University Computer Science and          Information Engineering

Finding Adapters (cont.) Adapter Enumeration Adapter Friendly Name: A human readable name that can be presented t

o a user to identify the adapter. Adapter NDIS Name: A string token that is passed to the PCANDIS driv

er and eventually to NdisOpenAdapter. 例: \Device\{65A88950-829C-11D2-842E-81B82B383

AF7}"

Page 13: TamKang University Computer Science and          Information Engineering

Technology

Visual C++ Microsoft Foundation Class (MFC)

Page 14: TamKang University Computer Science and          Information Engineering

ShowAdapter

Page 15: TamKang University Computer Science and          Information Engineering

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 } }

Page 16: TamKang University Computer Science and          Information Engineering

SelchangeList1(open)

Page 17: TamKang University Computer Science and          Information Engineering

SelchangeList1(Not_open)

Page 18: TamKang University Computer Science and          Information Engineering

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++; } } } }

Page 19: TamKang University Computer Science and          Information Engineering

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

Page 20: TamKang University Computer Science and          Information Engineering

OID_List

Page 21: TamKang University Computer Science and          Information Engineering

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); } }

Page 22: TamKang University Computer Science and          Information Engineering

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;

Page 23: TamKang University Computer Science and          Information Engineering

Suffer Can not List Support OID. MFC is very complex and we have to spen

d much time.

Page 24: TamKang University Computer Science and          Information Engineering

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

Page 25: TamKang University Computer Science and          Information Engineering

Reference

Visual C++ 6 Bible 擁抱 Visual C++ PCAUSA Document PCAUSA simple code