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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Interface Manager API
25 #if !defined(__NIFMAN_H__)
33 class CNifFactory : public CObject
43 IMPORT_C CNifFactory();
44 IMPORT_C virtual TInt Open();
45 IMPORT_C virtual void Close();
46 IMPORT_C static void Cleanup(TAny* aObject);
47 IMPORT_C static TInt ControlledDelete(TAny* aFactory);
48 IMPORT_C void InitL(RLibrary& aLib, CObjectCon& aCon);
51 IMPORT_C ~CNifFactory();
52 virtual void InstallL()=0;
54 CAsyncCallBack* iAsyncDtor;
58 Static internal API class
61 enum TNifSocketState { ENifBuffers2048=-4, ENifBuffers1024, ENifBuffers512,
63 ENifSocketCreated=0, ENifSocketOpen=3, ENifSocketConnected=4,
71 class CConnectionProvdBase;
78 /** Network protocol support */
79 IMPORT_C static void BindL(MNifIfUser& aUser, TAny* aId, TDes& aResult, const TDesC& aName=TPtrC(0,0));
80 IMPORT_C static void NetworkLayerClosed(MNifIfUser& aUser);
81 IMPORT_C static void StartL(TDes& aResult, const TDesC& aName=TPtrC());
82 IMPORT_C static void Stop(const TDesC& aName=TPtrC());
83 IMPORT_C static CNifIfBase* CreateInterfaceL(const TDesC& aName, MNifIfNotify* aNotify);
84 IMPORT_C static CNifAgentBase* CreateAgentL(const TDesC& aAgentName, const TBool aNewInstance = EFalse);
85 IMPORT_C static void CheckInstalledMBufManagerL();
86 IMPORT_C static CProtocolBase* IsProtocolLoaded(const TDesC& aName);
87 IMPORT_C static void CheckInstalledL();
88 IMPORT_C static TInt SetSocketState(TNifSocketState aState, CServProviderBase* aProvd);
89 IMPORT_C static void ProgressL(TNifProgress& aProgress, const TDesC& aName=TPtrC());
90 IMPORT_C static void Stop(TAny* aId, CNifIfBase* aIf=0);
91 IMPORT_C static void ProgressL(TNifProgress& aProgress, TAny* aId, CNifIfBase* aIf=0);
92 IMPORT_C static CConnectionProvdBase* NewConnectionL(MConnectionNotify* aConnection, TUint aId);
93 /** deprecated function */
94 IMPORT_C static CNifIfBase* CreateInterfaceL(const TDesC& aName);
100 async message for progress notifier
103 @deprecated 7.0s - replaced with RConnection API
105 const TInt KDefaultNifSlots = 1;
111 @capability NetworkControl These control options affect configuration at the designated level.
112 @ref RConnection::Control
114 const TUint KCOLInterface = 100;
119 @capability NetworkControl These control options affect configuration at the designated level.
120 @ref RConnection::Control
122 const TUint KCOLAgent = 200;
125 // RConnection::Ioctl() level for NIFMAN
130 @ref RConnection::Ioctl
132 const TUint KCOLConfiguration = 300;
136 Debug-only option level used to pass test-only option names onto PPP.
139 const TUint KCOLLinkLayerTestLevel = 325;
143 // RConnection::Control() options
148 @capability NetworkControl Restrict ability to switch on/off idle timers
149 @ref RConnection::Control
151 const TUint KConnDisableTimers = KConnReadUserDataBit | 1;
156 @ref RConnection::Control
158 const TUint KConnGetInterfaceName = KConnReadUserDataBit | KConnWriteUserDataBit | 2;
161 // RConnection::Ioctl() options
166 @ref RConnection::Ioctl
168 const TUint KConnGetCurrentAddr = KConnWriteUserDataBit | 3;
173 @ref RConnection::Ioctl
175 const TUint KConnGetServerAddr = KConnWriteUserDataBit | 4;
180 @ref RConnection::Ioctl
182 const TUint KConnGetAddrLeaseTimeRemain = KConnWriteUserDataBit | 5;
187 @capability NetworkControl Restrict ability to release a configured address
188 @ref RConnection::Ioctl
190 const TUint KConnAddrRelease = 6;
195 @capability NetworkControl Restrict ability to renew a configured address
196 @ref RConnection::Ioctl
198 This option is used for user initiated RENEW request where an attempt
199 is made to renew the lease obtained from the orginal DHCP server.
200 If the server response is not received before the default timeout(RebindTimeT2 - RenewalTimeT1)
201 the dhcp client will then initiate a REBIND.An user defined timeout can also be
202 supplied when using this option which will override the default timeout value.
210 //Option1: Initiate a Renew request.
211 conn.Ioctl(KCOLConfiguration, KConnAddrRenew, stat);
213 //Option2: Initiate a Renew request with a user defined timeout
214 TInt secValue(2); //Eg timeout set to 2secs
215 TPckg<TInt> val(secValue);
216 conn.Ioctl(KCOLConfiguration, KConnAddrRenew, stat,&val);
219 const TUint KConnAddrRenew = 7;
225 const TUint KNifSessionSetConnectionAttempt = KConnInternalOptionBit|8;
231 const TUint KNifSessionGetConnectionAttempt = KConnInternalOptionBit|9;
236 const TUint KNifSessionSetBlockProgresses = KConnInternalOptionBit|10;
242 const TUint KNifSessionGetBlockProgresses = KConnInternalOptionBit|11;
248 const TUint KNifSessionGetStopping = KConnInternalOptionBit|12;
250 // DHCP specific RConnection::Ioctl options
254 @ref RConnection::Ioctl
255 */const TUint KConnGetDhcpRawOptionData = KConnWriteUserDataBit|KConnReadUserDataBit|100;
260 @ref RConnection::Ioctl
262 const TUint KConnGetSipServerAddr = KConnWriteUserDataBit|KConnReadUserDataBit|101;
267 @ref RConnection::Ioctl
269 const TUint KConnGetSipServerDomain = KConnWriteUserDataBit|KConnReadUserDataBit|102;
271 #ifdef SYMBIAN_NETWORKING_DHCPSERVER
275 @ref RConnection::Ioctl
277 const TUint KConnSetDhcpRawOptionData = KConnWriteUserDataBit|KConnReadUserDataBit|103;
278 #endif // SYMBIAN_NETWORKING_DHCPSERVER
280 #ifdef SYMBIAN_NETWORKING_DHCP_MSG_HEADERS
282 * This constant is used to retrieve the DHCP Header Sname which is the
283 * host name of the next available server. This is sometimes overloaded
284 * to carry option value 66 which is the TftpServerName.
287 * @see RConnection::Ioctl()
289 const TUint KConnGetDhcpHdrSname = KConnWriteUserDataBit|KConnReadUserDataBit|104;
292 * This constant is used to retrieve the DHCP Header Siaddr which is the
293 * IPAddress of the next available server.
296 * @see RConnection::Ioctl()
298 const TUint KConnGetDhcpHdrSiaddr = KConnWriteUserDataBit|KConnReadUserDataBit|105;
301 * This constant is used to retrieve the DHCP Option 66, Tftp Server Name.
304 * @see RConnection::Ioctl()
306 const TUint KConnGetTftpServerName = KConnWriteUserDataBit|KConnReadUserDataBit|106;
309 * This constant is used to retrieve the DHCP Option 150, Tftp Server Address.
312 * @see RConnection::Ioctl()
314 const TUint KConnGetTftpServerAddr = KConnWriteUserDataBit|KConnReadUserDataBit|107;
318 * This constant is used to retrieve multiple opcode data in a raw format.
321 * @see RConnection::Ioctl()
323 const TUint KConnDhcpGetMultipleParams = KConnWriteUserDataBit|KConnReadUserDataBit|108;
324 #endif //SYMBIAN_NETWORKING_DHCP_MSG_HEADERS
331 const TUint KConnMaxInterfaceName = 32;
333 class TConnInterfaceName
341 TBuf<KConnMaxInterfaceName> iName;
346 enum TAgentConnectType
355 #endif // __NIFMAN_H__