NTDDK SRCNetworkPacket - PowerPoint PPT Presentation

1 / 6
About This Presentation
Title:

NTDDK SRCNetworkPacket

Description:

This driver demonstrates the functionality of an NDIS protocol ... Main file contains DriverEntry, Bind/Unbind Apdapter and other support routines. Read.c : ... – PowerPoint PPT presentation

Number of Views:25
Avg rating:3.0/5.0
Slides: 7
Provided by: goedelCh
Category:

less

Transcript and Presenter's Notes

Title: NTDDK SRCNetworkPacket


1
NTDDK SRC/Network/Packet
  • Aug 20, 2002.
  • CHONBUK NATIONAL UNIVERSITY
  • Prof. Woonchul Ham

2
Sample Protocol Driver
  • This driver demonstrates the functionality of an
    NDIS protocol driver on Windows 2000
  • It dynamically binds to real/virtual adapters,
    creates a named device object for each adapter
  • At the upper edge it uses regular driver
    interface (handles IRPs) and at the lower edge it
    uses NDIS interface to communicate with the NIC
    driver
  • Test application (packapp.exe) shows how to open
    the adapter, send or receive packets, and send
    OID requests to the adpater directly.

3
NDIS 5.0 compliant
  • It also has minimal support for PnP and Power
    mangement queries
  • Refer to NDIS protocols driver design in the DDK
    documentation for information.
  • For simplicity, the Packet driver is written so
    that it only binds to an Ethernet adapter. As a
    result it makes assumptions about frame size

4
BUILDING THE SAMPLE
  • Run the build -ceZ command from this directory
    to build the sampleit creates packet.sys and
    packapp.exe
  • On the desktop, right-click the My Network
    Places icon, and then choose Properties
  • Right-click the relevant Local Area Connection
    icon, and then choose Properties.
  • Click on Install, select Protocol and Click on
    Add button.
  • Click on Have Disk... point to the PACKET.INF
    file present in the sample directory.
  • Finally, follow through the dialog and finish
    the installation

5
Comments
  • This application automatically starts the driver
    when it loads, and stops the driver when it
    exits.
  • This application is single threaded, so if you do
    a read and if there are no incoming packets on
    the adapter, it will wait until it gets one.
  • So the application would appear as if it has
    hung.
  • If you want to exit the application, you can
    terminate it anytime with the Task Manager.
  • Also, this application can open only one adapter
    at a time. You can run multiple instances of this
    application to open other adapters, if the system
    has more than one.

6
Code tour
  • Packet.c
  • Main file contains DriverEntry, Bind/Unbind
    Apdapter and other support routines
  • Read.c
  • Routines for handling user read (receive) request
  • Write.c
  • Routines for handling user write (send) request
  • Openclos.c
  • Routines for handling user open and close
    requests
  • Testapp.c
  • Main file for the test application.
  • ChildWin.c
  • Routines for handling Child Windows messages.
  • Packet32.c
  • File for support routines used by the testapp.
Write a Comment
User Comments (0)
About PowerShow.com