1.2.4.5.22 TCPIP_IPV4_PacketHandlerRegister Function
C
TCPIP_IPV4_PROCESS_HANDLE TCPIP_IPV4_PacketHandlerRegister(
TCPIP_IPV4_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
IPv4 properly initialized.
Parameters
Parameters | Description |
---|---|
pktHandler | The packet handler which will be called for an incoming packet. |
handlerParam | Packet handler parameter. |
Returns
A valid TCPIP_IPV4_PROCESS_HANDLE - If the operation succeeded.
NULL - If the operation failed.
Remarks
Currently only one packet handler is supported for the IPv4 module. The call will fail if a handler is already registered. Use TCPIP_IPV4_PacketHandlerDeregister() first. Exists only if TCPIP_IPV4_EXTERN_PACKET_PROCESS is true.
Example
TCPIP_IPV4_PROCESS_HANDLE pktHandle = TCPIP_IPV4_PacketHandlerRegister( myPktHandler, myParam );