/// <summary> /// Initializes a new instance of the <see cref="WinpkFilterDevice" /> class. /// </summary> /// <param name="adapterHandle">The handle.</param> /// <param name="nameBytes">Name of the adapter in bytes.</param> /// <param name="medium">The medium.</param> /// <param name="address">The mac address.</param> /// <param name="mtu">The mtu.</param> internal WinpkFilterDevice( DriverHandle driverHandle, IntPtr adapterHandle, byte[] nameBytes, uint medium, byte[] address, ushort mtu) { DriverHandle = driverHandle; AdapterHandle = adapterHandle; Mtu = mtu; NdisMedium = medium; MacAddress = new PhysicalAddress(address); Name = GetPrivateName(nameBytes); FriendlyName = ConvertAdapterName(nameBytes); }
/// <summary> /// Initializes a new instance of the <see cref="WinpkFilterDriver" /> class. /// </summary> /// <param name="handle">The filter driver handle.</param> /// <param name="driverNameBytes">The driver name bytes.</param> protected WinpkFilterDriver(DriverHandle handle) { Handle = handle; }
internal static extern bool GetHwPacketFilter(DriverHandle hOpen, IntPtr hAdapter, ref HardwarePacketFilters pFilter);
internal static extern bool SetPacketEvent(DriverHandle hOpen, IntPtr hAdapter, SafeWaitHandle hWin32Event);
internal static extern bool GetAdapterPacketQueueSize(DriverHandle hOpen, IntPtr hAdapter, ref uint dwSize);
internal static extern bool GetAdapterMode(DriverHandle hOpen, ref AdapterMode mode);
internal static extern bool ReadPacket(DriverHandle hOpen, ref EthRequest packet);
internal static extern bool SendPacketToAdapter(DriverHandle hOpen, ref EthRequest packet);
internal static extern bool GetTcpipBoundAdaptersInfo(DriverHandle hOpen, ref TcpAdapterList adapters);
internal static extern uint GetDriverVersion(DriverHandle hOpen);