|
1 /* |
|
2 * Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
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 |
|
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 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #include "natfwunsafdataindication.h" |
|
22 |
|
23 // ----------------------------------------------------------------------------- |
|
24 // CNATFWUNSAFDataIndication::NewL |
|
25 // ----------------------------------------------------------------------------- |
|
26 // |
|
27 EXPORT_C CNATFWUNSAFDataIndication* |
|
28 CNATFWUNSAFDataIndication::NewL( |
|
29 const TNATFWUNSAFTransactionID& aTransactionID) |
|
30 { |
|
31 CNATFWUNSAFDataIndication* self = CNATFWUNSAFDataIndication::NewLC( |
|
32 aTransactionID); |
|
33 CleanupStack::Pop(self); |
|
34 return self; |
|
35 } |
|
36 |
|
37 // ----------------------------------------------------------------------------- |
|
38 // CNATFWUNSAFDataIndication::NewLC |
|
39 // ----------------------------------------------------------------------------- |
|
40 // |
|
41 EXPORT_C CNATFWUNSAFDataIndication* |
|
42 CNATFWUNSAFDataIndication::NewLC( |
|
43 const TNATFWUNSAFTransactionID& aTransactionID) |
|
44 { |
|
45 CNATFWUNSAFDataIndication* self = |
|
46 new (ELeave) CNATFWUNSAFDataIndication(aTransactionID); |
|
47 CleanupStack::PushL(self); |
|
48 return self; |
|
49 } |
|
50 |
|
51 // ----------------------------------------------------------------------------- |
|
52 // CNATFWUNSAFDataIndication::CreateL |
|
53 // ----------------------------------------------------------------------------- |
|
54 // |
|
55 CNATFWUNSAFMessage* |
|
56 CNATFWUNSAFDataIndication::CreateL( |
|
57 const TNATFWUNSAFTransactionID& aTransactionID) |
|
58 { |
|
59 return NewL(aTransactionID); |
|
60 } |
|
61 |
|
62 // ----------------------------------------------------------------------------- |
|
63 // CNATFWUNSAFDataIndication::CNATFWUNSAFDataIndication |
|
64 // ----------------------------------------------------------------------------- |
|
65 // |
|
66 CNATFWUNSAFDataIndication::CNATFWUNSAFDataIndication( |
|
67 const TNATFWUNSAFTransactionID& aTransactionID) : |
|
68 CNATFWUNSAFMessage(aTransactionID) |
|
69 { |
|
70 } |
|
71 |
|
72 // ----------------------------------------------------------------------------- |
|
73 // CNATFWUNSAFDataIndication::~CNATFWUNSAFDataIndication |
|
74 // ----------------------------------------------------------------------------- |
|
75 // |
|
76 CNATFWUNSAFDataIndication::~CNATFWUNSAFDataIndication() |
|
77 { |
|
78 } |
|
79 |
|
80 // ----------------------------------------------------------------------------- |
|
81 // CNATFWUNSAFDataIndication::Type |
|
82 // ----------------------------------------------------------------------------- |
|
83 // |
|
84 CNATFWUNSAFMessage::TType CNATFWUNSAFDataIndication::Type() const |
|
85 { |
|
86 return CNATFWUNSAFMessage::EDataIndication; |
|
87 } |
|
88 |
|
89 // ----------------------------------------------------------------------------- |
|
90 // CNATFWUNSAFDataIndication::Validate |
|
91 // ----------------------------------------------------------------------------- |
|
92 // |
|
93 TBool CNATFWUNSAFDataIndication::Validate() const |
|
94 { |
|
95 return (HasAttribute(CNATFWUNSAFAttribute::EData) && |
|
96 HasAttribute(CNATFWUNSAFAttribute::ERemoteAddress)); |
|
97 } |
|
98 |
|
99 // ----------------------------------------------------------------------------- |
|
100 // CNATFWUNSAFDataIndication::IsAllowed |
|
101 // ----------------------------------------------------------------------------- |
|
102 // |
|
103 TBool CNATFWUNSAFDataIndication::IsAllowed(TUint16 aAttributeType) const |
|
104 { |
|
105 return (aAttributeType == CNATFWUNSAFAttribute::EData || |
|
106 aAttributeType == CNATFWUNSAFAttribute::ERemoteAddress || |
|
107 aAttributeType == CNATFWUNSAFAttribute::EFingerprint); |
|
108 } |