0
|
1 |
/*
|
|
2 |
* Copyright (c) 2004-2005 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
1
|
5 |
* under the terms of the License "Eclipse Public License v1.0"
|
0
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
1
|
14 |
* Description:
|
0
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#ifndef _WSOCK_INTERFACE_H_
|
|
20 |
#define _WSOCK_INTERFACE_H_
|
|
21 |
|
|
22 |
#include <nifif.h>
|
|
23 |
#include <nifagt.h>
|
|
24 |
#include "WinsockUid.h"
|
|
25 |
|
|
26 |
const TInt KWinsockInterfaceSignature = KWinsockInterfaceUid;
|
|
27 |
|
|
28 |
class CWinsockInterface : public CNifIfLink,
|
1
|
29 |
// public MNifIfExtendedManagementInterface,
|
0
|
30 |
public MNifAgentExtendedManagementInterface
|
|
31 |
{
|
|
32 |
private:
|
|
33 |
class CallbackQueueEntry;
|
|
34 |
typedef void (CWinsockInterface::*CallbackMethod)(TInt aArg1, TInt aArg2);
|
|
35 |
|
|
36 |
private:
|
|
37 |
TInt iSignature;
|
|
38 |
TUint iBytesSent;
|
|
39 |
TUint iBytesReceived;
|
|
40 |
TUint iBytesSentMark;
|
|
41 |
TUint iBytesReceivedMark;
|
|
42 |
TUint iBytesSentGranularity;
|
|
43 |
TUint iBytesReceivedGranularity;
|
|
44 |
TTime iTimeStarted;
|
|
45 |
TSglQue<CallbackQueueEntry> iCallbackQueue;
|
|
46 |
CAsyncCallBack iCallback;
|
|
47 |
|
|
48 |
public:
|
|
49 |
CWinsockInterface(CNifIfFactory* aFactory, MNifIfNotify* aNotify);
|
|
50 |
~CWinsockInterface();
|
|
51 |
|
|
52 |
TInt Signature() const;
|
|
53 |
void DataSent(TUint aBytes);
|
|
54 |
void DataReceived(TUint aBytes);
|
|
55 |
|
|
56 |
// CNifIfLink
|
|
57 |
virtual TInt Start();
|
|
58 |
virtual void Stop(TInt aReason, MNifIfNotify::TAction aAction);
|
|
59 |
virtual CNifIfBase* GetBinderL(const TDesC& aName);
|
|
60 |
|
|
61 |
// CNifIfBase
|
|
62 |
virtual void Info(TNifIfInfo& aInfo) const;
|
|
63 |
virtual TInt Send(RMBufChain& aPdu, TAny* aSource);
|
|
64 |
virtual TInt Notification(TAgentToNifEventType aEvent, void * aInfo);
|
|
65 |
virtual TInt Control(TUint aLevel,TUint aName,TDes8& aOption,TAny* aSrc);
|
|
66 |
|
|
67 |
// MNifIfExtendedManagementInterface
|
|
68 |
virtual TInt Stop(TSubConnectionUniqueId aSubConnectionId, TInt aReason);
|
|
69 |
virtual TInt GetDataTransferred(TSubConnectionUniqueId aSubConnectionId, TUint& aSentBytes, TUint& aReceivedBytes);
|
|
70 |
virtual TInt SetDataSentNotificationGranularity(TSubConnectionUniqueId aSubConnectionId, TUint aGranularity);
|
|
71 |
virtual TInt CancelDataSentNotification(TSubConnectionUniqueId aSubConnectionId);
|
|
72 |
virtual TInt SetDataReceivedNotificationGranularity(TSubConnectionUniqueId aSubConnectionId, TUint aGranularity);
|
|
73 |
virtual TInt CancelDataReceivedNotification(TSubConnectionUniqueId aSubConnectionId);
|
|
74 |
|
|
75 |
// MNifAgentExtendedManagementInterface
|
|
76 |
virtual TInt GetInterfaceType(TConnectionType& aConnectionType);
|
|
77 |
virtual TInt EnumerateSubConnections(TUint& aCount);
|
|
78 |
virtual TInt GetSubConnectionInfo(TUint aIndex, TDes8& aSubConnectionInfo);
|
|
79 |
virtual TInt GetSubConnectionInfo(TDes8& aSubConnectionInfo);
|
|
80 |
|
|
81 |
private:
|
|
82 |
// Operations on asynchronous event queue
|
|
83 |
static TInt AsyncCallbackProc(TAny* aPtr);
|
|
84 |
void HandleAsyncCallback();
|
|
85 |
void ScheduleAsyncCallback(CallbackMethod aMethod, TInt aP1=0, TInt aP2=0);
|
|
86 |
void CancelOutstandingCallbacks();
|
|
87 |
|
|
88 |
// Asynchronous callbacks that fire various interface-related events
|
|
89 |
void NotifyLinkLayerUp(TInt aParam1, TInt aParam2);
|
|
90 |
void NotifyLinkLayerOpen(TInt aParam1, TInt aParam2);
|
|
91 |
void NotifySubConnectionOpened(TInt aParam1, TInt aParam2);
|
|
92 |
void NotifySubConnectionClosed(TInt aParam1, TInt aParam2);
|
|
93 |
void NotifyLinkLayerDown(TInt aParam1, TInt aParam2);
|
|
94 |
void NotifyLinkLayerClosed(TInt aParam1, TInt aParam2);
|
|
95 |
};
|
|
96 |
|
|
97 |
#endif // _WSOCK_INTERFACE_H_
|
|
98 |
|
|
99 |
/*
|
|
100 |
* Local Variables:
|
|
101 |
* mode: c++
|
|
102 |
* c-basic-offset: 4
|
|
103 |
* indent-tabs-mode: nil
|
|
104 |
* End:
|
|
105 |
*/
|