networkingtestandutils/ipprobe/src/family.cpp
branchRCL_3
changeset 58 8d540f55e491
parent 57 abbed5a4b42a
equal deleted inserted replaced
57:abbed5a4b42a 58:8d540f55e491
     1 // Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
    18 #include "family.h"
    18 #include "family.h"
    19 #include "prt.h"
    19 #include "prt.h"
    20 //
    20 //
    21 // Nothing interesting here...
    21 // Nothing interesting here...
    22 //
    22 //
    23 GLDEF_C TInt E32Dll()
       
    24 	{
       
    25 	return KErrNone;
       
    26 	}
       
    27 
    23 
    28 class CProtocolFamilyProbe : public CProtocolFamilyBase
    24 class CProtocolFamilyProbe : public CProtocolFamilyBase
    29 	{
    25 	{
    30 public:
    26 public:
    31 	CProtocolFamilyProbe();
    27 	CProtocolFamilyProbe();
    34 	TInt Remove();
    30 	TInt Remove();
    35 	TUint ProtocolList(TServerProtocolDesc *& aProtocolList);
    31 	TUint ProtocolList(TServerProtocolDesc *& aProtocolList);
    36 	CProtocolBase* NewProtocolL(TUint /*aSockType*/, TUint aProtocol);
    32 	CProtocolBase* NewProtocolL(TUint /*aSockType*/, TUint aProtocol);
    37 	};
    33 	};
    38 
    34 
    39 extern "C" { IMPORT_C CProtocolFamilyBase* Install(); }
    35 extern "C" { IMPORT_C CProtocolFamilyBase* Install(void); }
    40 EXPORT_C CProtocolFamilyBase* Install()
    36 EXPORT_C CProtocolFamilyBase* Install()
    41 	{
    37 	{
    42 	// Due to naming convention this cannot leave
    38 	return new (ELeave) CProtocolFamilyProbe;
    43 	// However null return value handled correctly in the caller...
       
    44 	return new CProtocolFamilyProbe;
       
    45 	}
    39 	}
    46 
    40 
    47 //----------------------------------------------------------------------
    41 //----------------------------------------------------------------------
    48 // Dummy protocol family declaration. Required for DLL's
    42 // Dummy protocol family declaration. Required for DLL's
    49 //
    43 //
    67 	return KErrNone;
    61 	return KErrNone;
    68 	}
    62 	}
    69 
    63 
    70 TUint CProtocolFamilyProbe::ProtocolList(TServerProtocolDesc *& aList)
    64 TUint CProtocolFamilyProbe::ProtocolList(TServerProtocolDesc *& aList)
    71 	{
    65 	{
    72 	// This function might leave, but it has been taken care of in the calling function
    66 	aList = new TServerProtocolDesc[2];
    73 	const TInt index =2;
       
    74 	aList = new TServerProtocolDesc[index];
       
    75 	if (aList == NULL)
    67 	if (aList == NULL)
    76 		return 0;
    68 		return 0;
    77 	
    69 	
    78 	CProtocolProbe::FillIdentification(aList[0], 1);
    70 	CProtocolProbe::FillIdentification(aList[0], 1);
    79 	CProtocolProbe::FillIdentification(aList[1], 2);
    71 	CProtocolProbe::FillIdentification(aList[1], 2);