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