1.2.3.1.39 TCPIP_TCP_PacketHandlerRegister Function

C

TCPIP_TCP_PROCESS_HANDLE TCPIP_TCP_PacketHandlerRegister(
    TCPIP_TCP_PACKET_HANDLER pktHandler, 
    const void* handlerParam
);

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.

Preconditions

TCP properly initialized.

Parameters

ParametersDescription
pktHandlerThe packet handler which will be called for an incoming packet.
handlerParamPacket handler parameter.

Returns

  • A valid TCPIP_TCP_PROCESS_HANDLE - If the operation succeeded.

  • NULL - If the operation failed.

Remarks

Currently only one packet handler is supported for the TCP module. The call will fail if a handler is already registered. Use TCPIP_TCP_PacketHandlerDeregister first.

Exists only if TCPIP_TCP_EXTERN_PACKET_PROCESS is true.

Example

TCPIP_TCP_PROCESS_HANDLE pktHandle = TCPIP_TCP_PacketHandlerRegister( myPktHandler, myParam );