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