1 /* |
1 /* |
2 * Copyright (c) 2004-2005 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2004-2005 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
5 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
6 * |
9 * Initial Contributors: |
7 * Initial Contributors: |
10 * Nokia Corporation - initial contribution. |
8 * Nokia Corporation - initial contribution. |
11 * |
9 * |
12 * Contributors: |
10 * Contributors: |
13 * |
11 * |
14 * Description: |
|
15 * |
12 * |
16 */ |
13 */ |
17 |
14 |
18 |
15 |
19 #define TRACE_PREFIX "WSOCK: ProtocolFamily: " |
16 #define TRACE_PREFIX "WSOCK: ProtocolFamily: " |
50 iWinSockType = aWinSockType; |
47 iWinSockType = aWinSockType; |
51 iWinProtocol = aWinProtocol; |
48 iWinProtocol = aWinProtocol; |
52 } |
49 } |
53 }; |
50 }; |
54 |
51 |
|
52 #if 0 |
|
53 |
|
54 TWinProtocolDescInit IP(_S("ip"), |
|
55 KAfInet, KSockStream, KProtocolInetTcp, KSIStreamBased | KSIInOrder | |
|
56 KSIReliable | KSIGracefulClose | KSIPeekData | KSIUrgentData, |
|
57 KSocketMessageSizeIsStream, ESocketSupport, |
|
58 SOCK_STREAM, IPPROTO_TCP); |
|
59 |
|
60 #ifdef WSOCK_IPV6 |
|
61 |
|
62 TWinProtocolDescInit IP6(_S("ip6"), |
|
63 KAfInet6, KSockStream, KProtocolInetTcp, KSIStreamBased | KSIInOrder | |
|
64 KSIReliable | KSIGracefulClose | KSIPeekData | KSIUrgentData, |
|
65 KSocketMessageSizeIsStream, ESocketSupport, |
|
66 SOCK_STREAM, IPPROTO_TCP); |
|
67 #endif |
|
68 |
|
69 // NOTE: the order of protocols must match the order of entries in the |
|
70 // ip.tcp.esk file (at the time of thie writing this file was located |
|
71 // in c:\private\101f7989\ESock directory). |
|
72 static const TWinProtocolDesc* ipProtocols[] = { |
|
73 &IP, |
|
74 #ifdef WSOCK_IPV6 |
|
75 &IP6 |
|
76 #endif // WSOCK_IPV6 |
|
77 }; |
|
78 #else |
|
79 TWinProtocolDescInit IP(_S("ip"), |
|
80 KAfInet, KSockStream, KProtocolInetTcp, KSIStreamBased | KSIInOrder | |
|
81 KSIReliable | KSIGracefulClose | KSIPeekData | KSIUrgentData, |
|
82 KSocketMessageSizeIsStream, ESocketSupport, |
|
83 SOCK_STREAM, IPPROTO_IP); |
|
84 |
55 TWinProtocolDescInit TCP(_S("tcp"), |
85 TWinProtocolDescInit TCP(_S("tcp"), |
56 KAfInet, KSockStream, KProtocolInetTcp, KSIStreamBased | KSIInOrder | |
86 KAfInet, KSockStream, KProtocolInetTcp, KSIStreamBased | KSIInOrder | |
57 KSIReliable | KSIGracefulClose | KSIPeekData | KSIUrgentData, |
87 KSIReliable | KSIGracefulClose | KSIPeekData | KSIUrgentData, |
58 KSocketMessageSizeIsStream, ESocketSupport, |
88 KSocketMessageSizeIsStream, ESocketSupport, |
59 SOCK_STREAM, IPPROTO_TCP); |
89 SOCK_STREAM, IPPROTO_TCP); |
75 KSIMessageBased | KSIBroadcast | KSIPeekData | KSIGracefulClose, |
105 KSIMessageBased | KSIBroadcast | KSIPeekData | KSIGracefulClose, |
76 65000, ESocketSupport | ETransport | EPreferDescriptors | EUseCanSend, |
106 65000, ESocketSupport | ETransport | EPreferDescriptors | EUseCanSend, |
77 SOCK_RAW, IPPROTO_ICMPV6); |
107 SOCK_RAW, IPPROTO_ICMPV6); |
78 |
108 |
79 #ifdef WSOCK_IPV6 |
109 #ifdef WSOCK_IPV6 |
|
110 |
|
111 TWinProtocolDescInit IP6(_S("ip6"), |
|
112 KAfInet6, KSockStream, KProtocolInetTcp, KSIStreamBased | KSIInOrder | |
|
113 KSIReliable | KSIGracefulClose | KSIPeekData | KSIUrgentData, |
|
114 KSocketMessageSizeIsStream, ESocketSupport, |
|
115 SOCK_STREAM, IPPROTO_IP); |
|
116 |
80 TWinProtocolDescInit TCP6(_S("tcp"), |
117 TWinProtocolDescInit TCP6(_S("tcp"), |
81 KAfInet6, KSockStream, KProtocolInetTcp, KSIStreamBased | KSIInOrder | |
118 KAfInet6, KSockStream, KProtocolInetTcp, KSIStreamBased | KSIInOrder | |
82 KSIReliable | KSIGracefulClose | KSIPeekData | KSIUrgentData, |
119 KSIReliable | KSIGracefulClose | KSIPeekData | KSIUrgentData, |
83 KSocketMessageSizeIsStream, ESocketSupport, |
120 KSocketMessageSizeIsStream, ESocketSupport, |
84 SOCK_STREAM, IPPROTO_TCP); |
121 SOCK_STREAM, IPPROTO_TCP); |
101 65000, ESocketSupport | ETransport | EPreferDescriptors | EUseCanSend, |
138 65000, ESocketSupport | ETransport | EPreferDescriptors | EUseCanSend, |
102 SOCK_RAW, IPPROTO_ICMPV6); |
139 SOCK_RAW, IPPROTO_ICMPV6); |
103 |
140 |
104 #endif // WSOCK_IPV6 |
141 #endif // WSOCK_IPV6 |
105 |
142 |
|
143 |
|
144 |
106 // NOTE: the order of protocols must match the order of entries in the |
145 // NOTE: the order of protocols must match the order of entries in the |
107 // ip.tcp.esk file (at the time of thie writing this file was located |
146 // ip.tcp.esk file (at the time of thie writing this file was located |
108 // in c:\private\101f7989\ESock directory). |
147 // in c:\private\101f7989\ESock directory). |
109 static const TWinProtocolDesc* ipProtocols[] = { |
148 static const TWinProtocolDesc* ipProtocols[] = { |
110 &TCP,&UDP,&ICMP4,&ICMP6, |
149 &IP,&TCP,&UDP,&ICMP4,&ICMP6, |
111 #ifdef WSOCK_IPV6 |
150 #ifdef WSOCK_IPV6 |
112 &TCP6,&UDP6,&ICMP46,&ICMP66 |
151 &IP6,&TCP6,&UDP6,&ICMP46,&ICMP66 |
113 #endif // WSOCK_IPV6 |
152 #endif // WSOCK_IPV6 |
114 }; |
153 }; |
115 |
154 #endif |
116 CWinsockProtocolFamily::CWinsockProtocolFamily(TUint aAddrFamily) : |
155 CWinsockProtocolFamily::CWinsockProtocolFamily(TUint aAddrFamily) : |
117 iAddrFamily(aAddrFamily) |
156 iAddrFamily(aAddrFamily) |
118 { |
157 { |
119 TRACE2("[%08X] created (0x%04x)",this,aAddrFamily); |
158 TRACE2("[%08X] created (0x%04x)",this,aAddrFamily); |
120 } |
159 } |
145 } |
184 } |
146 else |
185 else |
147 { |
186 { |
148 return NULL; |
187 return NULL; |
149 } |
188 } |
|
189 } |
|
190 |
|
191 // Returns comma separated list of protocol names |
|
192 void CWinsockProtocolFamily::ProtocolNamesfownetwork(TDes& aProtocols) |
|
193 { |
|
194 aProtocols.SetLength(0); |
|
195 /* for (TInt i=0; i<N(ipProtocols); i++) |
|
196 { |
|
197 TBool alreadyThere = EFalse; |
|
198 for (TInt k=0; k<i; k++) |
|
199 { |
|
200 if (!ipProtocols[i]->iName.Compare(ipProtocols[k]->iName)) |
|
201 { |
|
202 alreadyThere = ETrue; |
|
203 break; |
|
204 } |
|
205 } |
|
206 if (!alreadyThere) |
|
207 { |
|
208 if (i > 0) aProtocols.Append(','); |
|
209 aProtocols.Append(ipProtocols[i]->iName); |
|
210 } |
|
211 }*/ |
|
212 aProtocols.Append(ipProtocols[0]->iName); |
|
213 aProtocols.Append(','); |
|
214 aProtocols.Append(ipProtocols[5]->iName); |
|
215 |
|
216 TRACE1("ProtocolNames: %S",&aProtocols); |
150 } |
217 } |
151 |
218 |
152 // Returns comma separated list of protocol names |
219 // Returns comma separated list of protocol names |
153 void CWinsockProtocolFamily::ProtocolNames(TDes& aProtocols) |
220 void CWinsockProtocolFamily::ProtocolNames(TDes& aProtocols) |
154 { |
221 { |