Packet Sniffer SDK DLL Edition

HNAdapter :: Methods :: AdpSyncSend

 Previous Next

Sends a packet synchronously.

Syntax:

DWORD __stdcall AdpSyncSend(HANDLE hAdp, LPVOID pPacket, DWORD PacketSize);

Parameters:

hAdp

[in] HNAdapter object handle.

pPacket

[in] A pointer to a packet.

PacketSize

[in] The packet size.

Return values:

HNERR_OKThe packet has been sent successfully.
HNERR_ADAPTER_NOT_OPENEDThe adapter has not been opened, see the AdpOpenAdapter function.
HNERR_SIZE_ERRThe PacketSize parameter value is greater than the maximum size, see AdpCfgGetMaxPacketSize.
HNERR_ADAPTER_REQ_ERRAn internal driver request error.
HNERR_INVALID_HANDLEhAdp parameter is not the HNAdapter object handle.

Description:

After the network adapter has been opened successfully by AdpOpenAdapter, you can send a raw packet directly, without using the OS functions. This packet will be sent synchronously.

This function cannot work with the devices recognized as atWAN. See HNNetAdapterType.
See also:Packets processing diagram, HNAdapter, HNNetAdapterType, AdpOpenAdapter, AdpCfgGetMaxPacketSize, AdpSyncSend, OnAdpAsyncSend