TCPIP_UDP_PacketHandlerRegister Function

C

TCPIP_UDP_PROCESS_HANDLE TCPIP_UDP_PacketHandlerRegister(TCPIP_UDP_PACKET_HANDLER pktHandler, const void* handlerParam); 

Returns

  • a valid TCPIP_UDP_PROCESS_HANDLE - if the operation succeeded

  • NULL - if the operation failed

Description

This function registers a new packet processing handler. The caller can use the handler to be notified of incoming packets and given a chance to examine/process them.

Remarks

Currently only one packet handler is supported for the UDP module. The call will fail if a handler is already registered. Use TCPIP_UDP_PacketHandlerDeregister first Exists only if TCPIP_UDP_EXTERN_PACKET_PROCESS is true

Preconditions

UDP properly initialized

Example

TCPIP_UDP_PROCESS_HANDLE pktHandle = TCPIP_UDP_PacketHandlerRegister( myPktHandler, myParam );

Parameters

ParametersDescription
pktHandlerthe packet handler which will be called for an incoming packet
handlerParampacket handler parameter