networkingtestandutils/ipprobe/src/family.cpp
changeset 0 af10295192d8
child 25 d15a50675083
equal deleted inserted replaced
-1:000000000000 0:af10295192d8
       
     1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // family.cpp - Packet Probe Hook
       
    15 //
       
    16 
       
    17 #include <e32std.h>
       
    18 #include "family.h"
       
    19 #include "prt.h"
       
    20 //
       
    21 // Nothing interesting here...
       
    22 //
       
    23 
       
    24 class CProtocolFamilyProbe : public CProtocolFamilyBase
       
    25 	{
       
    26 public:
       
    27 	CProtocolFamilyProbe();
       
    28 	~CProtocolFamilyProbe();
       
    29 	TInt Install();
       
    30 	TInt Remove();
       
    31 	TUint ProtocolList(TServerProtocolDesc *& aProtocolList);
       
    32 	CProtocolBase* NewProtocolL(TUint /*aSockType*/, TUint aProtocol);
       
    33 	};
       
    34 
       
    35 extern "C" { IMPORT_C CProtocolFamilyBase* Install(void); }
       
    36 EXPORT_C CProtocolFamilyBase* Install()
       
    37 	{
       
    38 	return new (ELeave) CProtocolFamilyProbe;
       
    39 	}
       
    40 
       
    41 //----------------------------------------------------------------------
       
    42 // Dummy protocol family declaration. Required for DLL's
       
    43 //
       
    44 
       
    45 CProtocolFamilyProbe::CProtocolFamilyProbe()
       
    46 	{
       
    47 	__DECLARE_NAME(_S("CProtocolFamilyProbe"));
       
    48 	}
       
    49 
       
    50 CProtocolFamilyProbe::~CProtocolFamilyProbe()
       
    51 	{
       
    52 	}
       
    53 
       
    54 TInt CProtocolFamilyProbe::Install()
       
    55 	{
       
    56 	return KErrNone;
       
    57 	}
       
    58 
       
    59 TInt CProtocolFamilyProbe::Remove()
       
    60 	{
       
    61 	return KErrNone;
       
    62 	}
       
    63 
       
    64 TUint CProtocolFamilyProbe::ProtocolList(TServerProtocolDesc *& aList)
       
    65 	{
       
    66 	aList = new TServerProtocolDesc[2];
       
    67 	if (aList == NULL)
       
    68 		return 0;
       
    69 	
       
    70 	CProtocolProbe::FillIdentification(aList[0], 1);
       
    71 	CProtocolProbe::FillIdentification(aList[1], 2);
       
    72 	return 2;
       
    73 	}
       
    74 
       
    75 
       
    76 CProtocolBase* CProtocolFamilyProbe::NewProtocolL(TUint /*aSockType*/,
       
    77 												 TUint aProtocol)
       
    78 	{
       
    79 	return CProtocolProbe::NewL(aProtocol);
       
    80 	}
       
    81 
       
    82 void Panic(TProbePanic aPanic)
       
    83 	{
       
    84     User::Panic(_L("PROBE"), aPanic);
       
    85 	}