|
1 // Copyright (c) 2004-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 // Name : CSipSecSaDbMsgReceiver.cpp |
|
15 // Part of : SIPSec |
|
16 // Version : SIP/4.0 |
|
17 // |
|
18 |
|
19 |
|
20 |
|
21 #include <pfkey_send.h> |
|
22 #include "CSipSecSaDbMsgReceiver.h" |
|
23 #include "MSipSecSaDbSendReceiveObserver.h" |
|
24 |
|
25 // ---------------------------------------------------------------------------- |
|
26 // CSipSecSadbMsgReceiver::NewL |
|
27 // ---------------------------------------------------------------------------- |
|
28 // |
|
29 CSipSecSaDbMsgReceiver* CSipSecSaDbMsgReceiver::NewL( |
|
30 MSipSecSaDbSendReceiveObserver& aObserver, |
|
31 RSADB& aSadb ) |
|
32 { |
|
33 CSipSecSaDbMsgReceiver* self = NewLC( aObserver, aSadb ); |
|
34 CleanupStack::Pop( self ); |
|
35 return self; |
|
36 } |
|
37 |
|
38 // ---------------------------------------------------------------------------- |
|
39 // CSipSecSadbMsgReceiver::NewLC |
|
40 // ---------------------------------------------------------------------------- |
|
41 // |
|
42 CSipSecSaDbMsgReceiver* CSipSecSaDbMsgReceiver::NewLC( |
|
43 MSipSecSaDbSendReceiveObserver& aObserver, |
|
44 RSADB& aSadb ) |
|
45 { |
|
46 CSipSecSaDbMsgReceiver* self = |
|
47 new (ELeave) CSipSecSaDbMsgReceiver( aObserver, aSadb ); |
|
48 CleanupStack::PushL(self); |
|
49 self->ConstructL(); |
|
50 return self; |
|
51 } |
|
52 |
|
53 // ---------------------------------------------------------------------------- |
|
54 // CSipSecSadbMsgReceiver::CSipSecSaDbMsgReceiver |
|
55 // ---------------------------------------------------------------------------- |
|
56 // |
|
57 CSipSecSaDbMsgReceiver::CSipSecSaDbMsgReceiver( |
|
58 MSipSecSaDbSendReceiveObserver& aObserver, |
|
59 RSADB& aSadb ) : |
|
60 CSipSecSaDbMsgTransport( aObserver, aSadb ) |
|
61 { |
|
62 } |
|
63 |
|
64 // ---------------------------------------------------------------------------- |
|
65 // CSipSecSadbMsgReceiver::~CSipSecSaDbMsgReceiver |
|
66 // ---------------------------------------------------------------------------- |
|
67 // |
|
68 CSipSecSaDbMsgReceiver::~CSipSecSaDbMsgReceiver() |
|
69 { |
|
70 Cancel(); |
|
71 } |
|
72 |
|
73 // ---------------------------------------------------------------------------- |
|
74 // CSipSecSadbMsgReceiver::Receive |
|
75 // ---------------------------------------------------------------------------- |
|
76 // |
|
77 void CSipSecSaDbMsgReceiver::Receive( TDes8& aMsg ) |
|
78 { |
|
79 if ( !IsActive() ) |
|
80 { |
|
81 iSaDb.ReadRequest( aMsg, iStatus ); |
|
82 SetActive(); |
|
83 } |
|
84 } |
|
85 |
|
86 // ---------------------------------------------------------------------------- |
|
87 // CSipSecSadbMsgReceiver::RunL |
|
88 // ---------------------------------------------------------------------------- |
|
89 // |
|
90 void CSipSecSaDbMsgReceiver::RunL() |
|
91 { |
|
92 iObserver.MessageReceived( iStatus.Int() ); |
|
93 } |
|
94 |
|
95 // ---------------------------------------------------------------------------- |
|
96 // CSipSecSadbMsgReceiver::DoCancel |
|
97 // ---------------------------------------------------------------------------- |
|
98 // |
|
99 void CSipSecSaDbMsgReceiver::DoCancel() |
|
100 { |
|
101 iSaDb.CancelRecv(); |
|
102 } |
|
103 |
|
104 // End of File |