Reply To: Can directly send/recieve UDP Packets?

Home Forums Discussions Support Portal Can directly send/recieve UDP Packets? Reply To: Can directly send/recieve UDP Packets?

#6552

Vadim Smirnov
Moderator

Loading the following filter will force all UDP packets to pass without processing in user mode, all other packets will be redirected for processing to user mode.

// Common values
pFilters->m_StaticFilters[0].m_Adapter.QuadPart = 0; // applied to all adapters
pFilters->m_StaticFilters[0].m_ValidFields = NETWORK_LAYER_VALID;
pFilters->m_StaticFilters[0].m_FilterAction = FILTER_PACKET_PASS;
pFilters->m_StaticFilters[0].m_dwDirectionFlags = PACKET_FLAG_ON_SEND | PACKET_FLAG_ON_RECEIVE;

// Network layer filter
pFilters->m_StaticFilters[0].m_NetworkFilter.m_dwUnionSelector = IPV4;
pFilters->m_StaticFilters[0].m_NetworkFilter.m_IPv4.m_ValidFields = IP_V4_FILTER_PROTOCOL;
pFilters->m_StaticFilters[0].m_NetworkFilter.m_IPv4.m_Protocol = IPPROTO_UDP;

Refer “filter” sample for the general filters usage.