networkingtestandutils/ipprobe/src/family.cpp
changeset 37 052078dda061
parent 0 af10295192d8
child 58 8d540f55e491
equal deleted inserted replaced
18:39bb7c3571e9 37:052078dda061
     1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2009-2010 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 	}
    23 
    27 
    24 class CProtocolFamilyProbe : public CProtocolFamilyBase
    28 class CProtocolFamilyProbe : public CProtocolFamilyBase
    25 	{
    29 	{
    26 public:
    30 public:
    27 	CProtocolFamilyProbe();
    31 	CProtocolFamilyProbe();
    30 	TInt Remove();
    34 	TInt Remove();
    31 	TUint ProtocolList(TServerProtocolDesc *& aProtocolList);
    35 	TUint ProtocolList(TServerProtocolDesc *& aProtocolList);
    32 	CProtocolBase* NewProtocolL(TUint /*aSockType*/, TUint aProtocol);
    36 	CProtocolBase* NewProtocolL(TUint /*aSockType*/, TUint aProtocol);
    33 	};
    37 	};
    34 
    38 
    35 extern "C" { IMPORT_C CProtocolFamilyBase* Install(void); }
    39 extern "C" { IMPORT_C CProtocolFamilyBase* Install(); }
    36 EXPORT_C CProtocolFamilyBase* Install()
    40 EXPORT_C CProtocolFamilyBase* Install()
    37 	{
    41 	{
    38 	return new (ELeave) CProtocolFamilyProbe;
    42 	// Due to naming convention this cannot leave
       
    43 	// However null return value handled correctly in the caller...
       
    44 	return new CProtocolFamilyProbe;
    39 	}
    45 	}
    40 
    46 
    41 //----------------------------------------------------------------------
    47 //----------------------------------------------------------------------
    42 // Dummy protocol family declaration. Required for DLL's
    48 // Dummy protocol family declaration. Required for DLL's
    43 //
    49 //
    61 	return KErrNone;
    67 	return KErrNone;
    62 	}
    68 	}
    63 
    69 
    64 TUint CProtocolFamilyProbe::ProtocolList(TServerProtocolDesc *& aList)
    70 TUint CProtocolFamilyProbe::ProtocolList(TServerProtocolDesc *& aList)
    65 	{
    71 	{
    66 	aList = new TServerProtocolDesc[2];
    72 	// This function might leave, but it has been taken care of in the calling function
       
    73 	const TInt index =2;
       
    74 	aList = new TServerProtocolDesc[index];
    67 	if (aList == NULL)
    75 	if (aList == NULL)
    68 		return 0;
    76 		return 0;
    69 	
    77 	
    70 	CProtocolProbe::FillIdentification(aList[0], 1);
    78 	CProtocolProbe::FillIdentification(aList[0], 1);
    71 	CProtocolProbe::FillIdentification(aList[1], 2);
    79 	CProtocolProbe::FillIdentification(aList[1], 2);