|
1 // Copyright (c) 1997-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 // |
|
15 |
|
16 #include <es_ver.h> |
|
17 #include <es_prot.h> |
|
18 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS |
|
19 #include <es_prot_internal.h> |
|
20 #endif |
|
21 #include "ES_IPC.H" |
|
22 #include "IPC_MAIN.H" |
|
23 |
|
24 CIpcProtocolFamily::CIpcProtocolFamily() |
|
25 // |
|
26 // CTor for the IPC protocol family |
|
27 // |
|
28 { |
|
29 __DECLARE_NAME(_S("CIpcProtocolFamily")); |
|
30 } |
|
31 |
|
32 CIpcProtocolFamily * CIpcProtocolFamily::NewL() |
|
33 // |
|
34 // Creator for IPC protocol family |
|
35 // |
|
36 { |
|
37 return new (ELeave)CIpcProtocolFamily; |
|
38 } |
|
39 |
|
40 TInt CIpcProtocolFamily::Install() |
|
41 // |
|
42 // Nothing to do |
|
43 // |
|
44 { |
|
45 return KErrNone; |
|
46 } |
|
47 |
|
48 TInt CIpcProtocolFamily::Remove() |
|
49 // |
|
50 // Nothing to do |
|
51 // |
|
52 { |
|
53 return KErrNone; |
|
54 } |
|
55 |
|
56 CProtocolBase * CIpcProtocolFamily::NewProtocolL(TUint aSockType,TUint /*aProtocol*/) |
|
57 // |
|
58 // return a new CIPCProtocol - this is parameterised on socketType |
|
59 // |
|
60 { |
|
61 return CIpcProtocol::NewL(aSockType); |
|
62 } |
|
63 |
|
64 TUint CIpcProtocolFamily::ProtocolList(TServerProtocolDesc *& aProtocolList) |
|
65 // |
|
66 // |
|
67 // |
|
68 { |
|
69 |
|
70 TRAPD(ret,aProtocolList=new(ELeave) TServerProtocolDesc[2]); |
|
71 if(ret!=KErrNone) |
|
72 return 0; |
|
73 |
|
74 // Stream protocol |
|
75 _LIT(ipcStream,"IPC Stream"); |
|
76 aProtocolList[0].iName=ipcStream; |
|
77 aProtocolList[0].iAddrFamily=KIPCAddrFamily; |
|
78 aProtocolList[0].iSockType=KSockStream; |
|
79 aProtocolList[0].iProtocol=KIPCStreamProtocol; |
|
80 |
|
81 aProtocolList[0].iVersion=TVersion(KES32MajorVersionNumber,KES32MinorVersionNumber,KES32BuildVersionNumber); |
|
82 aProtocolList[0].iByteOrder=ELittleEndian; |
|
83 aProtocolList[0].iServiceInfo=KIPCStreamServiceInfo; |
|
84 aProtocolList[0].iNamingServices=0; |
|
85 aProtocolList[0].iSecurity=KSocketNoSecurity; |
|
86 aProtocolList[0].iMessageSize=KSocketMessageSizeIsStream; |
|
87 aProtocolList[0].iServiceTypeInfo=ESocketSupport; |
|
88 aProtocolList[0].iNumSockets=KIPSNumberSockets; |
|
89 |
|
90 // Datagram protocol |
|
91 _LIT(ipcDatagramm,"IPC Datagramm"); |
|
92 aProtocolList[1].iName=ipcDatagramm; |
|
93 aProtocolList[1].iAddrFamily=KIPCAddrFamily; |
|
94 aProtocolList[1].iSockType=KSockDatagram; |
|
95 aProtocolList[1].iProtocol=KIPCDatagramProtocol; |
|
96 |
|
97 aProtocolList[1].iVersion=TVersion(KES32MajorVersionNumber,KES32MinorVersionNumber,KES32BuildVersionNumber); |
|
98 aProtocolList[1].iByteOrder=ELittleEndian; |
|
99 aProtocolList[1].iServiceInfo=KIPCDatagramServiceInfo; |
|
100 aProtocolList[1].iNamingServices=0; |
|
101 aProtocolList[1].iSecurity=KSocketNoSecurity; |
|
102 aProtocolList[1].iMessageSize=KSocketMessageSizeNoLimit; |
|
103 aProtocolList[1].iServiceTypeInfo=ESocketSupport; |
|
104 aProtocolList[1].iNumSockets=KIPSNumberSockets; |
|
105 |
|
106 return 2; |
|
107 } |
|
108 |
|
109 extern "C" |
|
110 { |
|
111 IMPORT_C CProtocolFamilyBase* InstallIPC(void); // Force export |
|
112 |
|
113 EXPORT_C CProtocolFamilyBase * InstallIPC() |
|
114 // |
|
115 // Create a new protocol family |
|
116 // |
|
117 { |
|
118 return CIpcProtocolFamily::NewL(); |
|
119 } |
|
120 } |
|
121 |