IPHook

IPHooks are plug-in modules that increase the use of the TCP/IP stack. IPHooks enable you to process incoming and outgoing data packets at the IP level.

IPHooks are associated with socket servers. The socket server loads the IPHook to limit other protocols and is specified in an ESK file. The inhook6.dll is the library file used by developers to write hooks. All hooks must be derived from CIp6Hook() base class and provide a family base class object that is derived from CProtocolFamilyBase

The hooks are also known as protocol modules (prt). The hooks are called at different levels of data processing within the TCP/IP stack.

Types of IPHook

IPHooks are protocol modules used to process incoming and outgoing data packets. The hooks are called at different levels of data processing within the TCP/IP stack. The 4 types of IPHooks are:

Inbound hooks

The inbound hooks are used to add new headers or modify the existing headers in the incoming packets. The inbound hooks are called at IP level. The hooks process the incoming data packets. The TCP/IP stack calls all registered inbound hooks, after processing the data packets to the next hook or upper layer protocols.

Outbound flow hooks

A flow is created for each type of data to optimise the data packets. A flow is a calculated path between the upper layer protocol and the interface. The upper layer protocols use the IP address parameter and packet length to maximize the performance of data packets. The hooks called during the flow are outbound flow hooks. The outbound flow hooks changes the data packets in the outbound direction. There can be any number of flow hooks registered with the socket server. The socket server loads the protocols and TCP/IP stack calls the hook modules.

Pre-processing hooks

The pre-processing hooks are called when the data packets are between the network interface (NIF) and the IP. The pre-processing hooks are called before processing is done by the IP stack. The pre-processing hooks are used as a packet sniffer. The pre-processing hook reads the incoming data packets and forward to other hooks or upper layer protocols.

Post-processing hooks

The hooks called after the IP level processing, but before forwarding the packets to the interface are known as post-processing hooks. The post processing hooks are also known as outbound post hooks. There can be any number of post-processing hooks. The TCP/IP stack calls all the registered hooks until a terminator is reached. When a terminator is reached, the data packets are forwarded to the interface.

Related concepts
Creating an ESK File