Symbian3/PDK/Source/GUID-B9B506DD-356F-5E04-A8CA-34874F3BD702.dita
author Dominic Pinkman <Dominic.Pinkman@Nokia.com>
Tue, 30 Mar 2010 16:16:55 +0100
changeset 6 43e37759235e
parent 5 f345bda72bc4
child 14 578be2adaf3e
permissions -rw-r--r--
Week 12 contribution of example code"

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
<!-- This component and the accompanying materials are made available under the terms of the License 
"Eclipse Public License v1.0" which accompanies this distribution, 
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
<!-- Initial Contributors:
    Nokia Corporation - initial contribution.
Contributors: 
-->
<!DOCTYPE concept
  PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept xml:lang="en" id="GUID-B9B506DD-356F-5E04-A8CA-34874F3BD702"><title> IPHook</title><shortdesc>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. </shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody><p>IPHooks are associated with socket servers. The socket server loads the IPHook to limit other protocols and is specified in an <codeph>ESK</codeph> file. The <codeph>inhook6.dll</codeph> is the library file used by developers to write hooks. All hooks must be derived from <xref href="GUID-1A52EC87-DAD1-32C8-B530-295A65EB7292.dita"><apiname>CIp6Hook()</apiname></xref> base class and provide a family base class object that is derived from <codeph>CProtocolFamilyBase</codeph> </p> <p>The hooks are also known as protocol modules (prt). The hooks are called at different levels of data processing within the TCP/IP stack. </p> <section id="GUID-AF679B6D-9F0E-51AF-B0D7-C79A7AB54DDA"><title>Types of IPHook</title> <p>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: </p> <ul><li id="GUID-42258B75-0927-58DA-BFCB-166D1B891FCF"><p> <xref href="GUID-B9B506DD-356F-5E04-A8CA-34874F3BD702.dita#GUID-B9B506DD-356F-5E04-A8CA-34874F3BD702/GUID-D09DA878-25EB-5B6F-B4E2-040ED1311F2E"> Inbound hooks</xref> </p> </li> <li id="GUID-55CB119E-B33B-5BAF-B41F-FD2CB6F01419"><p> <xref href="GUID-B9B506DD-356F-5E04-A8CA-34874F3BD702.dita#GUID-B9B506DD-356F-5E04-A8CA-34874F3BD702/GUID-D61AA606-BBE6-5DE4-8FC8-56A2FF2DC5E5">Outbound flow hooks</xref> </p> </li> <li id="GUID-7C6290F5-7380-51CC-AD49-1EB9683690D0"><p> <xref href="GUID-B9B506DD-356F-5E04-A8CA-34874F3BD702.dita#GUID-B9B506DD-356F-5E04-A8CA-34874F3BD702/GUID-11980DAB-4275-544D-8E2F-10273591A4D4">Pre-processing hooks</xref> </p> </li> <li id="GUID-DDDF74A0-2649-526A-8202-3F3AF06AFF4F"><p> <xref href="GUID-B9B506DD-356F-5E04-A8CA-34874F3BD702.dita#GUID-B9B506DD-356F-5E04-A8CA-34874F3BD702/GUID-BF6C4707-2D52-5A6B-B2AC-7A5C7D95587D">Post-processing hooks</xref> </p> </li> </ul> </section> <section id="GUID-D09DA878-25EB-5B6F-B4E2-040ED1311F2E"><title>Inbound hooks</title> <p>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. </p> </section> <section id="GUID-D61AA606-BBE6-5DE4-8FC8-56A2FF2DC5E5"><title>Outbound flow hooks</title> <p>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. </p> </section> <section id="GUID-11980DAB-4275-544D-8E2F-10273591A4D4"><title>Pre-processing hooks</title> <p>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. </p> </section> <section id="GUID-BF6C4707-2D52-5A6B-B2AC-7A5C7D95587D"><title>Post-processing hooks</title> <p>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. </p> </section> </conbody><related-links><link href="GUID-340C57A4-B799-502D-8B86-39955E2F4268.dita"><linktext>Creating an ESK File</linktext> </link> <link href="GUID-6998404B-CC51-5337-B04F-8444C32B99C9.dita"><linktext>Writing an Inbound
                Hook</linktext> </link> <link href="GUID-88AB6957-6D2B-5668-8CC3-4E426E68C9B7.dita"><linktext>Writing an Outflow
                Hook</linktext> </link> </related-links></concept>