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