TianoCore EDK2 master
Loading...
Searching...
No Matches
WinPacketFilter.c File Reference
#include "WinHost.h"

Go to the source code of this file.

Data Structures

struct  _NT_NET_INTERFACE_INFO
 
struct  _NT_NET_UTILITY_TABLE
 
struct  WIN_NT_INSTANCE_DATA
 
struct  WIN_NT_SNP_PRIVATE
 

Macros

#define NETWORK_LIBRARY_NAME_U   L"SnpNt32Io.dll"
 
#define NETWORK_LIBRARY_INITIALIZE   "SnpInitialize"
 
#define NETWORK_LIBRARY_FINALIZE   "SnpFinalize"
 
#define NETWORK_LIBRARY_SET_RCV_FILTER   "SnpSetReceiveFilter"
 
#define NETWORK_LIBRARY_RECEIVE   "SnpReceive"
 
#define NETWORK_LIBRARY_TRANSMIT   "SnpTransmit"
 
#define NET_ETHER_HEADER_SIZE   14
 
#define MAX_INTERFACE_INFO_NUMBER   16
 
#define SNP_MAX_TX_BUFFER_NUM   65536
 
#define SNP_TX_BUFFER_INCREASEMENT   32
 
#define DEFAULT_SELECTED_NIC_INDEX   0
 
#define WIN_NT_INSTANCE_SIGNATURE   SIGNATURE_32 ('N', 'T', 'I', 'S')
 
#define WIN_NT_SIMPLE_NETWORK_PRIVATE_SIGNATURE   SIGNATURE_32 ('N', 'T', 's', 'n')
 
#define WIN_NT_SNP_PRIVATE_DATA_FROM_THIS(a)    CR(a, WIN_NT_SNP_PRIVATE, EmuSnp, WIN_NT_SIMPLE_NETWORK_PRIVATE_SIGNATURE)
 

Typedefs

typedef struct _NT_NET_INTERFACE_INFO NT_NET_INTERFACE_INFO
 
typedef INT32(* NT_NET_INITIALIZE) (IN OUT UINT32 *InterfaceCount, IN OUT NT_NET_INTERFACE_INFO *InterfaceInfoBuffer)
 
typedef INT32(* NT_NET_FINALIZE) (VOID)
 
typedef INT32(* NT_NET_SET_RECEIVE_FILTER) (IN UINT32 Index, IN UINT32 EnableFilter, IN UINT32 MCastFilterCnt, IN EFI_MAC_ADDRESS *MCastFilter)
 
typedef INT32(* NT_NET_RECEIVE) (IN UINT32 Index, IN OUT UINT32 *BufferSize, OUT VOID *Buffer)
 
typedef INT32(* NT_NET_TRANSMIT) (IN UINT32 Index, IN UINT32 HeaderSize, IN UINT32 BufferSize, IN VOID *Buffer, IN EFI_MAC_ADDRESS *SrcAddr, IN EFI_MAC_ADDRESS *DestAddr, IN UINT16 *Protocol)
 
typedef struct _NT_NET_UTILITY_TABLE NT_NET_UTILITY_TABLE
 

Functions

EFI_STATUS WinNtSnpCreateMapping (IN EMU_SNP_PROTOCOL *This, IN EFI_SIMPLE_NETWORK_MODE *Mode)
 
EFI_STATUS WinNtSnpStart (IN EMU_SNP_PROTOCOL *This)
 
EFI_STATUS WinNtSnpStop (IN EMU_SNP_PROTOCOL *This)
 
EFI_STATUS WinNtSnpInitialize (IN EMU_SNP_PROTOCOL *This, IN UINTN ExtraRxBufferSize OPTIONAL, IN UINTN ExtraTxBufferSize OPTIONAL)
 
EFI_STATUS WinNtSnpReset (IN EMU_SNP_PROTOCOL *This, IN BOOLEAN ExtendedVerification)
 
EFI_STATUS WinNtSnpShutdown (IN EMU_SNP_PROTOCOL *This)
 
EFI_STATUS WinNtSnpReceiveFilters (IN EMU_SNP_PROTOCOL *This, IN UINT32 Enable, IN UINT32 Disable, IN BOOLEAN ResetMCastFilter, IN UINTN MCastFilterCnt OPTIONAL, IN EFI_MAC_ADDRESS *MCastFilter OPTIONAL)
 
EFI_STATUS WinNtSnpStationAddress (IN EMU_SNP_PROTOCOL *This, IN BOOLEAN Reset, IN EFI_MAC_ADDRESS *New OPTIONAL)
 
EFI_STATUS WinNtSnpStatistics (IN EMU_SNP_PROTOCOL *This, IN BOOLEAN Reset, IN OUT UINTN *StatisticsSize OPTIONAL, OUT EFI_NETWORK_STATISTICS *StatisticsTable OPTIONAL)
 
EFI_STATUS WinNtSnpMCastIpToMac (IN EMU_SNP_PROTOCOL *This, IN BOOLEAN IPv6, IN EFI_IP_ADDRESS *IP, OUT EFI_MAC_ADDRESS *MAC)
 
EFI_STATUS WinNtSnpNvData (IN EMU_SNP_PROTOCOL *This, IN BOOLEAN ReadWrite, IN UINTN Offset, IN UINTN BufferSize, IN OUT VOID *Buffer)
 
EFI_STATUS WinNtSnpGetStatus (IN EMU_SNP_PROTOCOL *This, OUT UINT32 *InterruptStatus OPTIONAL, OUT VOID **TxBuf OPTIONAL)
 
EFI_STATUS WinNtSnpTransmit (IN EMU_SNP_PROTOCOL *This, IN UINTN HeaderSize, IN UINTN BufferSize, IN VOID *Buffer, IN EFI_MAC_ADDRESS *SrcAddr OPTIONAL, IN EFI_MAC_ADDRESS *DestAddr OPTIONAL, IN UINT16 *Protocol OPTIONAL)
 
EFI_STATUS WinNtSnpReceive (IN EMU_SNP_PROTOCOL *This, OUT UINTN *HeaderSize OPTIONAL, IN OUT UINTN *BufferSize, OUT VOID *Buffer, OUT EFI_MAC_ADDRESS *SrcAddr OPTIONAL, OUT EFI_MAC_ADDRESS *DestAddr OPTIONAL, OUT UINT16 *Protocol OPTIONAL)
 
EFI_STATUS WinNtInitializeInstanceData (IN OUT WIN_NT_INSTANCE_DATA *Instance, IN NT_NET_INTERFACE_INFO *NetInfo)
 
EFI_STATUS WintNtInitializeNetUtilityData (IN OUT WIN_NT_SNP_PRIVATE *Private, IN UINT8 ActiveInstance)
 
EFI_STATUS WintNtReleaseNetUtilityData (IN OUT WIN_NT_SNP_PRIVATE *Private)
 
EFI_STATUS WinNtSnpThunkOpen (IN EMU_IO_THUNK_PROTOCOL *This)
 
EFI_STATUS WinNtSnpThunkClose (IN EMU_IO_THUNK_PROTOCOL *This)
 

Variables

EMU_SNP_PROTOCOL mWinNtSnpProtocol
 
EMU_IO_THUNK_PROTOCOL mWinNtSnpThunkIo
 

Detailed Description

Windows Packet Filter implementation of the EMU_SNP_PROTOCOL that allows the emulator to get on real networks.

Copyright (c) 2004 - 2009, Intel Corporation. All rights reserved.
Portions copyright (c) 2011, Apple Inc. All rights reserved. (C) Copyright 2020 Hewlett Packard Enterprise Development LP

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file WinPacketFilter.c.

Macro Definition Documentation

◆ DEFAULT_SELECTED_NIC_INDEX

#define DEFAULT_SELECTED_NIC_INDEX   0

Definition at line 32 of file WinPacketFilter.c.

◆ MAX_INTERFACE_INFO_NUMBER

#define MAX_INTERFACE_INFO_NUMBER   16

Definition at line 29 of file WinPacketFilter.c.

◆ NET_ETHER_HEADER_SIZE

#define NET_ETHER_HEADER_SIZE   14

Definition at line 28 of file WinPacketFilter.c.

◆ NETWORK_LIBRARY_FINALIZE

#define NETWORK_LIBRARY_FINALIZE   "SnpFinalize"

Definition at line 16 of file WinPacketFilter.c.

◆ NETWORK_LIBRARY_INITIALIZE

#define NETWORK_LIBRARY_INITIALIZE   "SnpInitialize"

Definition at line 15 of file WinPacketFilter.c.

◆ NETWORK_LIBRARY_NAME_U

#define NETWORK_LIBRARY_NAME_U   L"SnpNt32Io.dll"

Definition at line 14 of file WinPacketFilter.c.

◆ NETWORK_LIBRARY_RECEIVE

#define NETWORK_LIBRARY_RECEIVE   "SnpReceive"

Definition at line 18 of file WinPacketFilter.c.

◆ NETWORK_LIBRARY_SET_RCV_FILTER

#define NETWORK_LIBRARY_SET_RCV_FILTER   "SnpSetReceiveFilter"

Definition at line 17 of file WinPacketFilter.c.

◆ NETWORK_LIBRARY_TRANSMIT

#define NETWORK_LIBRARY_TRANSMIT   "SnpTransmit"

Definition at line 19 of file WinPacketFilter.c.

◆ SNP_MAX_TX_BUFFER_NUM

#define SNP_MAX_TX_BUFFER_NUM   65536

Definition at line 30 of file WinPacketFilter.c.

◆ SNP_TX_BUFFER_INCREASEMENT

#define SNP_TX_BUFFER_INCREASEMENT   32

Definition at line 31 of file WinPacketFilter.c.

◆ WIN_NT_INSTANCE_SIGNATURE

#define WIN_NT_INSTANCE_SIGNATURE   SIGNATURE_32 ('N', 'T', 'I', 'S')

Definition at line 90 of file WinPacketFilter.c.

◆ WIN_NT_SIMPLE_NETWORK_PRIVATE_SIGNATURE

#define WIN_NT_SIMPLE_NETWORK_PRIVATE_SIGNATURE   SIGNATURE_32 ('N', 'T', 's', 'n')

Definition at line 116 of file WinPacketFilter.c.

◆ WIN_NT_SNP_PRIVATE_DATA_FROM_THIS

#define WIN_NT_SNP_PRIVATE_DATA_FROM_THIS (   a)     CR(a, WIN_NT_SNP_PRIVATE, EmuSnp, WIN_NT_SIMPLE_NETWORK_PRIVATE_SIGNATURE)

Definition at line 128 of file WinPacketFilter.c.

Typedef Documentation

◆ NT_NET_FINALIZE

typedef INT32(* NT_NET_FINALIZE) (VOID)

Definition at line 45 of file WinPacketFilter.c.

◆ NT_NET_INITIALIZE

typedef INT32(* NT_NET_INITIALIZE) (IN OUT UINT32 *InterfaceCount, IN OUT NT_NET_INTERFACE_INFO *InterfaceInfoBuffer)

Definition at line 38 of file WinPacketFilter.c.

◆ NT_NET_RECEIVE

typedef INT32(* NT_NET_RECEIVE) (IN UINT32 Index, IN OUT UINT32 *BufferSize, OUT VOID *Buffer)

Definition at line 60 of file WinPacketFilter.c.

◆ NT_NET_SET_RECEIVE_FILTER

typedef INT32(* NT_NET_SET_RECEIVE_FILTER) (IN UINT32 Index, IN UINT32 EnableFilter, IN UINT32 MCastFilterCnt, IN EFI_MAC_ADDRESS *MCastFilter)

Definition at line 51 of file WinPacketFilter.c.

◆ NT_NET_TRANSMIT

typedef INT32(* NT_NET_TRANSMIT) (IN UINT32 Index, IN UINT32 HeaderSize, IN UINT32 BufferSize, IN VOID *Buffer, IN EFI_MAC_ADDRESS *SrcAddr, IN EFI_MAC_ADDRESS *DestAddr, IN UINT16 *Protocol)

Definition at line 68 of file WinPacketFilter.c.

Function Documentation

◆ WinNtInitializeInstanceData()

EFI_STATUS WinNtInitializeInstanceData ( IN OUT WIN_NT_INSTANCE_DATA Instance,
IN NT_NET_INTERFACE_INFO NetInfo 
)

Initialize the snpnt32 driver instance.

Parameters
InstancePointer to the instance context data.
NetInfoPointer to the interface info.
Return values
EFI_SUCCESSThe driver instance is initialized.
otherInitialization errors.

Definition at line 823 of file WinPacketFilter.c.

◆ WinNtSnpCreateMapping()

EFI_STATUS WinNtSnpCreateMapping ( IN EMU_SNP_PROTOCOL This,
IN EFI_SIMPLE_NETWORK_MODE Mode 
)

Register storage for SNP Mode.

Parameters
ThisProtocol instance pointer.
ModeSimpleNetworkProtocol Mode structure passed into driver.
Return values
EFI_SUCCESSThe network interface was started.
EFI_INVALID_PARAMETEROne or more of the parameters has an unsupported value.

Definition at line 142 of file WinPacketFilter.c.

◆ WinNtSnpGetStatus()

EFI_STATUS WinNtSnpGetStatus ( IN EMU_SNP_PROTOCOL This,
OUT UINT32 *InterruptStatus  OPTIONAL,
OUT VOID **TxBuf  OPTIONAL 
)

Reads the current interrupt status and recycled transmit buffer status from a network interface.

Parameters
ThisThe protocol instance pointer.
InterruptStatusA pointer to the bit mask of the currently active interrupts If this is NULL, the interrupt status will not be read from the device. If this is not NULL, the interrupt status will be read from the device. When the interrupt status is read, it will also be cleared. Clearing the transmit interrupt does not empty the recycled transmit buffer array.
TxBufRecycled transmit buffer address. The network interface will not transmit if its internal recycled transmit buffer array is full. Reading the transmit buffer does not clear the transmit interrupt. If this is NULL, then the transmit buffer status will not be read. If there are no transmit buffers to recycle and TxBuf is not NULL, * TxBuf will be set to NULL.
Return values
EFI_SUCCESSThe status of the network interface was retrieved.
EFI_NOT_STARTEDThe network interface has not been started.
EFI_INVALID_PARAMETEROne or more of the parameters has an unsupported value.
EFI_DEVICE_ERRORThe command could not be sent to the network interface.
EFI_UNSUPPORTEDThis function is not supported by the network interface.

Definition at line 606 of file WinPacketFilter.c.

◆ WinNtSnpInitialize()

EFI_STATUS WinNtSnpInitialize ( IN EMU_SNP_PROTOCOL This,
IN UINTN ExtraRxBufferSize  OPTIONAL,
IN UINTN ExtraTxBufferSize  OPTIONAL 
)

Resets a network adapter and allocates the transmit and receive buffers required by the network interface; optionally, also requests allocation of additional transmit and receive buffers.

Parameters
ThisThe protocol instance pointer.
ExtraRxBufferSizeThe size, in bytes, of the extra receive buffer space that the driver should allocate for the network interface. Some network interfaces will not be able to use the extra buffer, and the caller will not know if it is actually being used.
ExtraTxBufferSizeThe size, in bytes, of the extra transmit buffer space that the driver should allocate for the network interface. Some network interfaces will not be able to use the extra buffer, and the caller will not know if it is actually being used.
Return values
EFI_SUCCESSThe network interface was initialized.
EFI_NOT_STARTEDThe network interface has not been started.
EFI_OUT_OF_RESOURCESThere was not enough memory for the transmit and receive buffers.
EFI_INVALID_PARAMETEROne or more of the parameters has an unsupported value.
EFI_DEVICE_ERRORThe command could not be sent to the network interface.
EFI_UNSUPPORTEDThis function is not supported by the network interface.

Definition at line 272 of file WinPacketFilter.c.

◆ WinNtSnpMCastIpToMac()

EFI_STATUS WinNtSnpMCastIpToMac ( IN EMU_SNP_PROTOCOL This,
IN BOOLEAN  IPv6,
IN EFI_IP_ADDRESS IP,
OUT EFI_MAC_ADDRESS MAC 
)

Converts a multicast IP address to a multicast HW MAC address.

Parameters
ThisThe protocol instance pointer.
IPv6Set to TRUE if the multicast IP address is IPv6 [RFC 2460]. Set to FALSE if the multicast IP address is IPv4 [RFC 791].
IPThe multicast IP address that is to be converted to a multicast HW MAC address.
MACThe multicast HW MAC address that is to be generated from IP.
Return values
EFI_SUCCESSThe multicast IP address was mapped to the multicast HW MAC address.
EFI_NOT_STARTEDThe network interface has not been started.
EFI_BUFFER_TOO_SMALLThe Statistics buffer was too small. The current buffer size needed to hold the statistics is returned in StatisticsSize.
EFI_INVALID_PARAMETEROne or more of the parameters has an unsupported value.
EFI_DEVICE_ERRORThe command could not be sent to the network interface.
EFI_UNSUPPORTEDThis function is not supported by the network interface.

Definition at line 530 of file WinPacketFilter.c.

◆ WinNtSnpNvData()

EFI_STATUS WinNtSnpNvData ( IN EMU_SNP_PROTOCOL This,
IN BOOLEAN  ReadWrite,
IN UINTN  Offset,
IN UINTN  BufferSize,
IN OUT VOID *  Buffer 
)

Performs read and write operations on the NVRAM device attached to a network interface.

Parameters
ThisThe protocol instance pointer.
ReadWriteTRUE for read operations, FALSE for write operations.
OffsetByte offset in the NVRAM device at which to start the read or write operation. This must be a multiple of NvRamAccessSize and less than NvRamSize.
BufferSizeThe number of bytes to read or write from the NVRAM device. This must also be a multiple of NvramAccessSize.
BufferA pointer to the data buffer.
Return values
EFI_SUCCESSThe NVRAM access was performed.
EFI_NOT_STARTEDThe network interface has not been started.
EFI_INVALID_PARAMETEROne or more of the parameters has an unsupported value.
EFI_DEVICE_ERRORThe command could not be sent to the network interface.
EFI_UNSUPPORTEDThis function is not supported by the network interface.

Definition at line 565 of file WinPacketFilter.c.

◆ WinNtSnpReceive()

EFI_STATUS WinNtSnpReceive ( IN EMU_SNP_PROTOCOL This,
OUT UINTN *HeaderSize  OPTIONAL,
IN OUT UINTN BufferSize,
OUT VOID *  Buffer,
OUT EFI_MAC_ADDRESS *SrcAddr  OPTIONAL,
OUT EFI_MAC_ADDRESS *DestAddr  OPTIONAL,
OUT UINT16 *Protocol  OPTIONAL 
)

Receives a packet from a network interface.

Parameters
ThisThe protocol instance pointer.
HeaderSizeThe size, in bytes, of the media header received on the network interface. If this parameter is NULL, then the media header size will not be returned.
BufferSizeOn entry, the size, in bytes, of Buffer. On exit, the size, in bytes, of the packet that was received on the network interface.
BufferA pointer to the data buffer to receive both the media header and the data.
SrcAddrThe source HW MAC address. If this parameter is NULL, the HW MAC source address will not be extracted from the media header.
DestAddrThe destination HW MAC address. If this parameter is NULL, the HW MAC destination address will not be extracted from the media header.
ProtocolThe media header type. If this parameter is NULL, then the protocol will not be extracted from the media header. See RFC 1700 section "Ether Types" for examples.
Return values
EFI_SUCCESSThe received data was stored in Buffer, and BufferSize has been updated to the number of bytes received.
EFI_NOT_STARTEDThe network interface has not been started.
EFI_NOT_READYThe network interface is too busy to accept this transmit request.
EFI_BUFFER_TOO_SMALLThe BufferSize parameter is too small.
EFI_INVALID_PARAMETEROne or more of the parameters has an unsupported value.
EFI_DEVICE_ERRORThe command could not be sent to the network interface.
EFI_UNSUPPORTEDThis function is not supported by the network interface.

Definition at line 755 of file WinPacketFilter.c.

◆ WinNtSnpReceiveFilters()

EFI_STATUS WinNtSnpReceiveFilters ( IN EMU_SNP_PROTOCOL This,
IN UINT32  Enable,
IN UINT32  Disable,
IN BOOLEAN  ResetMCastFilter,
IN UINTN MCastFilterCnt  OPTIONAL,
IN EFI_MAC_ADDRESS *MCastFilter  OPTIONAL 
)

Manages the multicast receive filters of a network interface.

Parameters
ThisThe protocol instance pointer.
EnableA bit mask of receive filters to enable on the network interface.
DisableA bit mask of receive filters to disable on the network interface.
ResetMCastFilterSet to TRUE to reset the contents of the multicast receive filters on the network interface to their default values.
McastFilterCntNumber of multicast HW MAC addresses in the new MCastFilter list. This value must be less than or equal to the MCastFilterCnt field of EMU_SNP_MODE. This field is optional if ResetMCastFilter is TRUE.
MCastFilterA pointer to a list of new multicast receive filter HW MAC addresses. This list will replace any existing multicast HW MAC address list. This field is optional if ResetMCastFilter is TRUE.
Return values
EFI_SUCCESSThe multicast receive filter list was updated.
EFI_NOT_STARTEDThe network interface has not been started.
EFI_INVALID_PARAMETEROne or more of the parameters has an unsupported value.
EFI_DEVICE_ERRORThe command could not be sent to the network interface.
EFI_UNSUPPORTEDThis function is not supported by the network interface.

Definition at line 415 of file WinPacketFilter.c.

◆ WinNtSnpReset()

EFI_STATUS WinNtSnpReset ( IN EMU_SNP_PROTOCOL This,
IN BOOLEAN  ExtendedVerification 
)

Resets a network adapter and re-initializes it with the parameters that were provided in the previous call to Initialize().

Parameters
ThisThe protocol instance pointer.
ExtendedVerificationIndicates that the driver may perform a more exhaustive verification operation of the device during reset.
Return values
EFI_SUCCESSThe network interface was reset.
EFI_NOT_STARTEDThe network interface has not been started.
EFI_INVALID_PARAMETEROne or more of the parameters has an unsupported value.
EFI_DEVICE_ERRORThe command could not be sent to the network interface.
EFI_UNSUPPORTEDThis function is not supported by the network interface.

Definition at line 321 of file WinPacketFilter.c.

◆ WinNtSnpShutdown()

EFI_STATUS WinNtSnpShutdown ( IN EMU_SNP_PROTOCOL This)

Resets a network adapter and leaves it in a state that is safe for another driver to initialize.

Parameters
ThisProtocol instance pointer.
Return values
EFI_SUCCESSThe network interface was shutdown.
EFI_NOT_STARTEDThe network interface has not been started.
EFI_INVALID_PARAMETEROne or more of the parameters has an unsupported value.
EFI_DEVICE_ERRORThe command could not be sent to the network interface.
EFI_UNSUPPORTEDThis function is not supported by the network interface.

Definition at line 360 of file WinPacketFilter.c.

◆ WinNtSnpStart()

EFI_STATUS WinNtSnpStart ( IN EMU_SNP_PROTOCOL This)

Changes the state of a network interface from "stopped" to "started".

Parameters
ThisProtocol instance pointer.
Return values
EFI_SUCCESSThe network interface was started.
EFI_ALREADY_STARTEDThe network interface is already in the started state.
EFI_INVALID_PARAMETEROne or more of the parameters has an unsupported value.
EFI_DEVICE_ERRORThe command could not be sent to the network interface.
EFI_UNSUPPORTEDThis function is not supported by the network interface.

Definition at line 179 of file WinPacketFilter.c.

◆ WinNtSnpStationAddress()

EFI_STATUS WinNtSnpStationAddress ( IN EMU_SNP_PROTOCOL This,
IN BOOLEAN  Reset,
IN EFI_MAC_ADDRESS *New  OPTIONAL 
)

Modifies or resets the current station address, if supported.

Parameters
ThisThe protocol instance pointer.
ResetFlag used to reset the station address to the network interfaces permanent address.
NewThe new station address to be used for the network interface.
Return values
EFI_SUCCESSThe network interfaces station address was updated.
EFI_NOT_STARTEDThe network interface has not been started.
EFI_INVALID_PARAMETEROne or more of the parameters has an unsupported value.
EFI_DEVICE_ERRORThe command could not be sent to the network interface.
EFI_UNSUPPORTEDThis function is not supported by the network interface.

Definition at line 459 of file WinPacketFilter.c.

◆ WinNtSnpStatistics()

EFI_STATUS WinNtSnpStatistics ( IN EMU_SNP_PROTOCOL This,
IN BOOLEAN  Reset,
IN OUT UINTN *StatisticsSize  OPTIONAL,
OUT EFI_NETWORK_STATISTICS *StatisticsTable  OPTIONAL 
)

Resets or collects the statistics on a network interface.

Parameters
ThisProtocol instance pointer.
ResetSet to TRUE to reset the statistics for the network interface.
StatisticsSizeOn input the size, in bytes, of StatisticsTable. On output the size, in bytes, of the resulting table of statistics.
StatisticsTableA pointer to the EFI_NETWORK_STATISTICS structure that contains the statistics.
Return values
EFI_SUCCESSThe statistics were collected from the network interface.
EFI_NOT_STARTEDThe network interface has not been started.
EFI_BUFFER_TOO_SMALLThe Statistics buffer was too small. The current buffer size needed to hold the statistics is returned in StatisticsSize.
EFI_INVALID_PARAMETEROne or more of the parameters has an unsupported value.
EFI_DEVICE_ERRORThe command could not be sent to the network interface.
EFI_UNSUPPORTEDThis function is not supported by the network interface.

Definition at line 494 of file WinPacketFilter.c.

◆ WinNtSnpStop()

EFI_STATUS WinNtSnpStop ( IN EMU_SNP_PROTOCOL This)

Changes the state of a network interface from "started" to "stopped".

Parameters
ThisProtocol instance pointer.
Return values
EFI_SUCCESSThe network interface was stopped.
EFI_ALREADY_STARTEDThe network interface is already in the stopped state.
EFI_INVALID_PARAMETEROne or more of the parameters has an unsupported value.
EFI_DEVICE_ERRORThe command could not be sent to the network interface.
EFI_UNSUPPORTEDThis function is not supported by the network interface.

Definition at line 219 of file WinPacketFilter.c.

◆ WinNtSnpThunkClose()

EFI_STATUS WinNtSnpThunkClose ( IN EMU_IO_THUNK_PROTOCOL This)

Close SNP thunk protocol.

Parameters
ThisPointer to the thunk protocol instance.
Return values
EFI_SUCCESSSNP thunk protocol is closed successfully.
EFI_UNSUPPORTEDThis is not SNP thunk protocol.
otherOther errors.

Definition at line 1109 of file WinPacketFilter.c.

◆ WinNtSnpThunkOpen()

EFI_STATUS WinNtSnpThunkOpen ( IN EMU_IO_THUNK_PROTOCOL This)

Open SNP thunk protocol.

Parameters
ThisPointer to the thunk protocol instance.
Return values
EFI_SUCCESSSNP thunk protocol is opened successfully.
EFI_UNSUPPORTEDThis is not SNP thunk protocol.
EFI_OUT_OF_RESOURCESNot enough memory.
otherOther errors.

Definition at line 1062 of file WinPacketFilter.c.

◆ WinNtSnpTransmit()

EFI_STATUS WinNtSnpTransmit ( IN EMU_SNP_PROTOCOL This,
IN UINTN  HeaderSize,
IN UINTN  BufferSize,
IN VOID *  Buffer,
IN EFI_MAC_ADDRESS *SrcAddr  OPTIONAL,
IN EFI_MAC_ADDRESS *DestAddr  OPTIONAL,
IN UINT16 *Protocol  OPTIONAL 
)

Places a packet in the transmit queue of a network interface.

Parameters
ThisThe protocol instance pointer.
HeaderSizeThe size, in bytes, of the media header to be filled in by the Transmit() function. If HeaderSize is non-zero, then it must be equal to This->Mode->MediaHeaderSize and the DestAddr and Protocol parameters must not be NULL.
BufferSizeThe size, in bytes, of the entire packet (media header and data) to be transmitted through the network interface.
BufferA pointer to the packet (media header followed by data) to be transmitted. This parameter cannot be NULL. If HeaderSize is zero, then the media header in Buffer must already be filled in by the caller. If HeaderSize is non-zero, then the media header will be filled in by the Transmit() function.
SrcAddrThe source HW MAC address. If HeaderSize is zero, then this parameter is ignored. If HeaderSize is non-zero and SrcAddr is NULL, then This->Mode->CurrentAddress is used for the source HW MAC address.
DestAddrThe destination HW MAC address. If HeaderSize is zero, then this parameter is ignored.
ProtocolThe type of header to build. If HeaderSize is zero, then this parameter is ignored. See RFC 1700, section "Ether Types", for examples.
Return values
EFI_SUCCESSThe packet was placed on the transmit queue.
EFI_NOT_STARTEDThe network interface has not been started.
EFI_NOT_READYThe network interface is too busy to accept this transmit request.
EFI_BUFFER_TOO_SMALLThe BufferSize parameter is too small.
EFI_INVALID_PARAMETEROne or more of the parameters has an unsupported value.
EFI_DEVICE_ERRORThe command could not be sent to the network interface.
EFI_UNSUPPORTEDThis function is not supported by the network interface.

Definition at line 666 of file WinPacketFilter.c.

◆ WintNtInitializeNetUtilityData()

EFI_STATUS WintNtInitializeNetUtilityData ( IN OUT WIN_NT_SNP_PRIVATE Private,
IN UINT8  ActiveInstance 
)

Initialize the net utility data.

Parameters
ThisPointer to the private data.
ActiveInstanceThe active network interface.
Return values
EFI_SUCCESSThe global data is initialized.
EFI_NOT_FOUNDThe required DLL is not found.
EFI_DEVICE_ERRORError initialize network utility library.
otherOther errors.

Definition at line 893 of file WinPacketFilter.c.

◆ WintNtReleaseNetUtilityData()

EFI_STATUS WintNtReleaseNetUtilityData ( IN OUT WIN_NT_SNP_PRIVATE Private)

Release the net utility data.

Parameters
ThisPointer to the private data.
Return values
EFI_SUCCESSThe global data is released.
otherOther errors.

Definition at line 1012 of file WinPacketFilter.c.

Variable Documentation

◆ mWinNtSnpProtocol

EMU_SNP_PROTOCOL mWinNtSnpProtocol
Initial value:
= {
}
EFI_STATUS WinNtSnpReceiveFilters(IN EMU_SNP_PROTOCOL *This, IN UINT32 Enable, IN UINT32 Disable, IN BOOLEAN ResetMCastFilter, IN UINTN MCastFilterCnt OPTIONAL, IN EFI_MAC_ADDRESS *MCastFilter OPTIONAL)
EFI_STATUS WinNtSnpStop(IN EMU_SNP_PROTOCOL *This)
EFI_STATUS WinNtSnpInitialize(IN EMU_SNP_PROTOCOL *This, IN UINTN ExtraRxBufferSize OPTIONAL, IN UINTN ExtraTxBufferSize OPTIONAL)
EFI_STATUS WinNtSnpMCastIpToMac(IN EMU_SNP_PROTOCOL *This, IN BOOLEAN IPv6, IN EFI_IP_ADDRESS *IP, OUT EFI_MAC_ADDRESS *MAC)
EFI_STATUS WinNtSnpTransmit(IN EMU_SNP_PROTOCOL *This, IN UINTN HeaderSize, IN UINTN BufferSize, IN VOID *Buffer, IN EFI_MAC_ADDRESS *SrcAddr OPTIONAL, IN EFI_MAC_ADDRESS *DestAddr OPTIONAL, IN UINT16 *Protocol OPTIONAL)
EFI_STATUS WinNtSnpReceive(IN EMU_SNP_PROTOCOL *This, OUT UINTN *HeaderSize OPTIONAL, IN OUT UINTN *BufferSize, OUT VOID *Buffer, OUT EFI_MAC_ADDRESS *SrcAddr OPTIONAL, OUT EFI_MAC_ADDRESS *DestAddr OPTIONAL, OUT UINT16 *Protocol OPTIONAL)
EFI_STATUS WinNtSnpStart(IN EMU_SNP_PROTOCOL *This)
EFI_STATUS WinNtSnpStatistics(IN EMU_SNP_PROTOCOL *This, IN BOOLEAN Reset, IN OUT UINTN *StatisticsSize OPTIONAL, OUT EFI_NETWORK_STATISTICS *StatisticsTable OPTIONAL)
EFI_STATUS WinNtSnpGetStatus(IN EMU_SNP_PROTOCOL *This, OUT UINT32 *InterruptStatus OPTIONAL, OUT VOID **TxBuf OPTIONAL)
EFI_STATUS WinNtSnpStationAddress(IN EMU_SNP_PROTOCOL *This, IN BOOLEAN Reset, IN EFI_MAC_ADDRESS *New OPTIONAL)
EFI_STATUS WinNtSnpShutdown(IN EMU_SNP_PROTOCOL *This)
EFI_STATUS WinNtSnpReset(IN EMU_SNP_PROTOCOL *This, IN BOOLEAN ExtendedVerification)
EFI_STATUS WinNtSnpCreateMapping(IN EMU_SNP_PROTOCOL *This, IN EFI_SIMPLE_NETWORK_MODE *Mode)
EFI_STATUS WinNtSnpNvData(IN EMU_SNP_PROTOCOL *This, IN BOOLEAN ReadWrite, IN UINTN Offset, IN UINTN BufferSize, IN OUT VOID *Buffer)

Definition at line 1033 of file WinPacketFilter.c.

◆ mWinNtSnpThunkIo

EMU_IO_THUNK_PROTOCOL mWinNtSnpThunkIo
Initial value:
= {
&gEmuSnpProtocolGuid,
0,
}
#define NULL
Definition: Base.h:319
EFI_STATUS WinNtSnpThunkClose(IN EMU_IO_THUNK_PROTOCOL *This)
EFI_STATUS WinNtSnpThunkOpen(IN EMU_IO_THUNK_PROTOCOL *This)

Definition at line 1126 of file WinPacketFilter.c.