|
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 "natfwunsafremoteaddressattribute.h" |
|
22 |
|
23 // ----------------------------------------------------------------------------- |
|
24 // CNATFWUNSAFRemoteAddressAttribute::DecodeAttributeL |
|
25 // ----------------------------------------------------------------------------- |
|
26 // |
|
27 CNATFWUNSAFAttribute* CNATFWUNSAFRemoteAddressAttribute::DecodeAttributeL( |
|
28 const TDesC8& aByteStream) |
|
29 { |
|
30 CheckLengthL(aByteStream); |
|
31 TInetAddr emptyAddress; |
|
32 CNATFWUNSAFRemoteAddressAttribute* self = |
|
33 CNATFWUNSAFRemoteAddressAttribute::NewLC(emptyAddress); |
|
34 self->DecodeValueL(aByteStream.Mid(EValueOffset)); |
|
35 CleanupStack::Pop(self); |
|
36 return self; |
|
37 } |
|
38 |
|
39 // ----------------------------------------------------------------------------- |
|
40 // CNATFWUNSAFRemoteAddressAttribute::NewL |
|
41 // ----------------------------------------------------------------------------- |
|
42 // |
|
43 EXPORT_C CNATFWUNSAFRemoteAddressAttribute* |
|
44 CNATFWUNSAFRemoteAddressAttribute::NewL(const TInetAddr& aAddress) |
|
45 { |
|
46 CNATFWUNSAFRemoteAddressAttribute* self = |
|
47 CNATFWUNSAFRemoteAddressAttribute::NewLC(aAddress); |
|
48 CleanupStack::Pop(self); |
|
49 return self; |
|
50 } |
|
51 |
|
52 // ----------------------------------------------------------------------------- |
|
53 // CNATFWUNSAFRemoteAddressAttribute::NewLC |
|
54 // ----------------------------------------------------------------------------- |
|
55 // |
|
56 EXPORT_C CNATFWUNSAFRemoteAddressAttribute* |
|
57 CNATFWUNSAFRemoteAddressAttribute::NewLC(const TInetAddr& aAddress) |
|
58 { |
|
59 CNATFWUNSAFRemoteAddressAttribute* self = |
|
60 new (ELeave) CNATFWUNSAFRemoteAddressAttribute(aAddress); |
|
61 CleanupStack::PushL(self); |
|
62 return self; |
|
63 } |
|
64 |
|
65 // ----------------------------------------------------------------------------- |
|
66 // CNATFWUNSAFRemoteAddressAttribute::CNATFWUNSAFRemoteAddressAttribute |
|
67 // ----------------------------------------------------------------------------- |
|
68 // |
|
69 CNATFWUNSAFRemoteAddressAttribute::CNATFWUNSAFRemoteAddressAttribute( |
|
70 const TInetAddr& aAddress) : |
|
71 CNATFWUNSAFAddressAttribute(aAddress) |
|
72 { |
|
73 } |
|
74 |
|
75 // ----------------------------------------------------------------------------- |
|
76 // CNATFWUNSAFRemoteAddressAttribute::~CNATFWUNSAFRemoteAddressAttribute |
|
77 // ----------------------------------------------------------------------------- |
|
78 // |
|
79 CNATFWUNSAFRemoteAddressAttribute::~CNATFWUNSAFRemoteAddressAttribute() |
|
80 { |
|
81 } |
|
82 |
|
83 // ----------------------------------------------------------------------------- |
|
84 // CNATFWUNSAFRemoteAddressAttribute::Type |
|
85 // ----------------------------------------------------------------------------- |
|
86 // |
|
87 CNATFWUNSAFAttribute::TType |
|
88 CNATFWUNSAFRemoteAddressAttribute::Type() const |
|
89 { |
|
90 return ERemoteAddress; |
|
91 } |