tcpiputils/dhcp/include/DhcpIP6Msg.h
changeset 0 af10295192d8
equal deleted inserted replaced
-1:000000000000 0:af10295192d8
       
     1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // DHCPv6 Message wrapper header file
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file
       
    20 */
       
    21 
       
    22 #ifndef DHCPIP6MSG_H
       
    23 #define DHCPIP6MSG_H
       
    24 
       
    25 #include "DHCPMsg.h"
       
    26 #include "DHCPIP6_Std.h"
       
    27 #ifdef SYMBIAN_TCPIPDHCP_UPDATE
       
    28 #include "DomainNameDecoder.h"
       
    29 #endif //SYMBIAN_TCPIPDHCP_UPDATE
       
    30 //!!!!BEWARE all message handling so far (except message receiver) expects there's a buffer long enough
       
    31 //to hold whatever necessary.
       
    32 //We should be able to compute the length of needed buffer beforehand based on the message structure
       
    33 
       
    34 _LIT( KDhcpv6, "DHCPv6" );
       
    35 
       
    36 class TInetAddr;
       
    37 class TDhcpRnd;
       
    38 
       
    39 namespace DHCPv6
       
    40 {
       
    41 
       
    42 enum TMessageType
       
    43 /**
       
    44   * DHCPv6::TMessageType
       
    45   *
       
    46   * The message type constants for the DHCPv6
       
    47   * message type option for inclusion in DHCPv6
       
    48   * messages.
       
    49   *
       
    50   * @internalTechnology
       
    51   */
       
    52 	{
       
    53 	ESolicit = 0x01,		   // request
       
    54 	EAdvertise,		   		// reply
       
    55 	ERequest,				   // request
       
    56 	EConfirm,				   // request
       
    57 	ERenew,					   // request
       
    58 	ERebind,		   		   // request
       
    59 	EReply,			         // reply
       
    60 	ERelease,					// request
       
    61 	EDecline,					// request
       
    62 	EReconfigure,				// reply
       
    63 	EInformationRequest,		// request
       
    64 //	ERelayForw,	   			// not supported
       
    65 //	ERelayRepl 		   		// not supported
       
    66    EUnknown = 0xFAFA
       
    67 	};
       
    68 
       
    69 /**
       
    70  * DHCPv6::TStatusCodes
       
    71  * A Status Code option may appear in the options field of a DHCP
       
    72  * message and/or in the options field of another option.  If the Status
       
    73  * Code option does not appear in a message in which the option could
       
    74  * appear, the status of the message is assumed to be Success.
       
    75 */
       
    76 enum TStatusCodes
       
    77    {
       
    78 	//RFC status codes
       
    79    ESuccess        = 0, //Success.
       
    80    EUnspecFail     = 1, //Failure, reason unspecified; this
       
    81                         //status code is sent by either a client
       
    82                         //or a server to indicate a failure
       
    83                         //not explicitly specified in this
       
    84                         //document.
       
    85    ENoAddrsAvail   = 2, //Server has no addresses available to assign to
       
    86                         //the IA(s).
       
    87    ENoBinding      = 3, //Client record (binding) unavailable.
       
    88    ENotOnLink      = 4, //The prefix for the address is not appropriate for
       
    89                         //the link to which the client is attached.
       
    90    EUseMulticast   = 5, //Sent by a server to a client to force the
       
    91                         //client to send messages to the server.
       
    92                         //using the All_DHCP_Relay_Agents_and_Servers
       
    93                         //address.
       
    94 	//internal component status codes
       
    95 	EMarkForRelease = 128,
       
    96 	EMarkForDecline = 129,
       
    97 	EMarkToRequest	 = 130,
       
    98 	EStatusUnknown	 = 0xFF, //highest possible status code
       
    99 
       
   100    };
       
   101 /**
       
   102   * DHCPv6 negotiation constants (the time values are in seconds)
       
   103   *
       
   104   * @internalTechnology
       
   105   */
       
   106 const TInt  KSolMaxDelay   = 1;   //sec   Max delay of first Solicit
       
   107 const TInt  KSolTimeout    = 1;   //sec   Initial Solicit timeout
       
   108 const TInt  KSolMaxRt      = 120; //secs  Max Solicit timeout value
       
   109 const TInt  KReqTimeout    = 1;   //sec   Initial Request timeout
       
   110 const TInt  KReqMaxRt      = 30;  //secs  Max Request timeout value
       
   111 const TInt  KReqMaxRc      = 10;  //     Max Request retry attempts
       
   112 const TInt  KCnfMaxDelay   = 1;   //sec   Max delay of first Confirm
       
   113 const TInt  KCnfTimeout    = 1;   //sec   Initial Confirm timeout
       
   114 const TInt  KCnfMaxRt      = 4;   //secs  Max Confirm timeout
       
   115 const TInt  KCnfMaxRd      = 10;  //secs  Max Confirm duration
       
   116 const TInt  KRenTimeout    = 10;  //secs  Initial Renew timeout
       
   117 const TInt  KRenMaxRt      = 600; //secs  Max Renew timeout value
       
   118 const TInt  KRebTimeout    = 10;  //secs  Initial Rebind timeout
       
   119 const TInt  KRebMaxRt      = 600; //secs  Max Rebind timeout value
       
   120 const TInt  KInfMaxDelay   = 1;   //sec   Max delay of first Information-request
       
   121 const TInt  KInfTimeout    = 1;   //sec   Initial Information-request timeout
       
   122 const TInt  KInfMaxRt      = 120; //secs  Max Information-request timeout value
       
   123 const TInt  KRelTimeout    = 1;   //sec   Initial Release timeout
       
   124 const TInt  KRelMaxRc      = 5;   //    MAX Release attempts
       
   125 const TInt  KDecTimeout    = 1;   //sec   Initial Decline timeout
       
   126 const TInt  KDecMaxRc      = 5;   //    Max Decline attempts
       
   127 const TInt  KRecTimeout    = 2;   //secs  Initial Reconfigure timeout
       
   128 const TInt  KRecMaxRc      = 8;   //    Max Reconfigure attempts
       
   129 const TInt  KHopCountLimit = 32;  //     Max hop count in a Relay-forward message
       
   130 
       
   131 /******DHCP extension template []->optional - the code dependent******
       
   132        0                   1                   2                   3
       
   133        0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
       
   134       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       
   135       |          option-code          |           option-len          |
       
   136       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       
   137       |                          option-data                          |
       
   138       |                      (option-len octets)                      |
       
   139       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       
   140 
       
   141       option-code   An unsigned integer identifying the specific option
       
   142                     type carried in this option.
       
   143 
       
   144       option-len    An unsigned integer giving the length of the
       
   145                     option-data field in this option in octets.
       
   146 
       
   147       option-data   The data for the option; the format of this data
       
   148                     depends on the definition of the option.
       
   149                     +-+-+-+-+-+-+-+-+-+-+-+-+-++-+-+-+-+-+-++-+-+-+-+-+
       
   150                     | fixed part      | variable part (option list)   |
       
   151                     +-+-+-+-+-+-+-+-+-+-+-+-+-++-+-+-+-+-+-++-+-+-+-+-+
       
   152 *********************************************************************/
       
   153 enum TOptionCodes
       
   154 /**
       
   155   * DHCPv6::TOptionCodes
       
   156   *
       
   157   * The constant values for each supported
       
   158   * option type.
       
   159   *
       
   160   * @internalTechnology
       
   161   */
       
   162 	{
       
   163 	EClientId = 1,          //Client DUID
       
   164 	EServerId = 2,          //Server DUID
       
   165 	EIaNa = 3,              //Identity Association for Non-temporary Addresses 
       
   166 	EIaTa = 4,              //Identity Association for Temporary Addresses
       
   167 	EIaAddr = 5,            //IPv6 addresses associated with an IA_NA(EIaNa) or an IA_TA(EIaTa)
       
   168 	EOro = 6,               //Option Request - identify a list of options in a message
       
   169 	EPreference = 7,
       
   170    EElapsedTime = 8,
       
   171    ERelayMsg   = 9,        //for relay agents only
       
   172 	EAuthentication = 11,
       
   173 	EUnicast = 12,          //server sends to indicate the client is allowed to unicast messages
       
   174 	EStatusCode = 13,
       
   175 	ERapidCommit = 14,
       
   176 	EUserClass = 15,
       
   177 	EVendorClass = 16,
       
   178 	EVendorOpts = 17,
       
   179 	EInterfaceId = 18,      //for relay agents only
       
   180 	EReconfMsg = 19,
       
   181    EReconfAccept = 20,
       
   182    ESipServerD = 21,       //SIP Server Domain Name List
       
   183    ESipServerA = 22,        //SIP Servers IPv6 Address List
       
   184    //the options 23/24 are just in  Solicit, Advertise, Request, Renew, Rebind, Information-Request, and Reply
       
   185    EDNSServers = 23,       
       
   186    EDomainList = 24,       //Domain Search List option
       
   187    EOptionAny = 0xFAFA
       
   188    //prefix delegation
       
   189    //otion lifetime
       
   190 	};
       
   191 
       
   192 enum TReconfigureTypes
       
   193     {
       
   194     EReconfigureRenew  = 5,
       
   195     EReconfigureInformRequest = 11
       
   196     };
       
   197 
       
   198 const TInt KDHCPHeaderLength = 4;
       
   199 const TInt KXidLength = 3;
       
   200 const TInt KXidOffset = 1;
       
   201 const TInt KOptionHeaderLength = 4;
       
   202 const TInt K32bitNumberOctets = 4;
       
   203 const TInt KOptionLengthOffset = 2;
       
   204 const TInt KOptionCodeOffset = 0;
       
   205 const TInt KOptionCodeLen = 2;
       
   206 const TInt KElapsedTimeOptionLen = 2;
       
   207 const TInt KOptionLengthLen = 2;
       
   208 
       
   209 const TInt KDuidTypeLen         = 2;
       
   210 const TInt KDuidLLTypeCode      = 3;
       
   211 const TInt KDuidHardwareTypeLen = 2;
       
   212 const TInt KDuidEthMacAddrSize	= 6;
       
   213 
       
   214 template <typename LAYOUT>
       
   215 class TOptionHeader : public TValue< LAYOUT >
       
   216 	{
       
   217 public:
       
   218 	TOptionHeader(TInt aValueLength) :
       
   219 		TValue<LAYOUT>(aValueLength)
       
   220 		{
       
   221 		};
       
   222 
       
   223 	TInt GetValue(const TUint8* aPtr8) const;
       
   224 	void SetValue(TUint8* aPtr8, TInt aValue) const;
       
   225 	};
       
   226 
       
   227 template <typename LAYOUT>
       
   228 TInt TOptionHeader<LAYOUT>::GetValue(const TUint8* aPtr8) const
       
   229 	{
       
   230    __ASSERT_DEBUG( this->iValueLength == KOptionHeaderLength, User::Panic( KDhcpv6, KErrBadDescriptor ) );
       
   231 	return LAYOUT::GetValue(aPtr8 + KOptionLengthOffset, this->iValueLength - KOptionLengthOffset);
       
   232 	}
       
   233 
       
   234 template <typename LAYOUT>
       
   235 void TOptionHeader<LAYOUT>::SetValue(TUint8* aPtr8, TInt aValue) const
       
   236 	{
       
   237    __ASSERT_DEBUG( this->iValueLength == KOptionHeaderLength, User::Panic( KDhcpv6, KErrBadDescriptor ) );
       
   238 	LAYOUT::SetValue(aPtr8 + KOptionLengthOffset, this->iValueLength - KOptionLengthOffset, aValue);
       
   239 	}
       
   240 
       
   241 template <class TLAYOUT>
       
   242 class COption : public CItem<TOptionHeader<TLAYOUT> >
       
   243 	{
       
   244 public:
       
   245 	COption(CItemBase* aNext) :
       
   246 		CItem<TOptionHeader<TLAYOUT> >(aNext, KOptionHeaderLength)
       
   247 		{
       
   248 		}
       
   249 
       
   250 	TUint OpCode() const
       
   251 		{
       
   252       return TLAYOUT::GetValue( this->CItemBase::iPtr8, KOptionCodeLen );
       
   253 		}
       
   254 	void SetOpCode(TUint aOpCode)
       
   255 		{
       
   256       TLAYOUT::SetValue( this->CItemBase::iPtr8, KOptionCodeLen, aOpCode );
       
   257 		}
       
   258 	};
       
   259 
       
   260 class COptionNode : public COption<TBigEndian>
       
   261 /**
       
   262   * represents one DHCPv6 option in a message
       
   263   * 
       
   264   *
       
   265   * @internalTechnology
       
   266   */
       
   267 	{
       
   268 	friend class COptionList;
       
   269 
       
   270 public:
       
   271     
       
   272 #ifdef __FLOG_ACTIVE
       
   273 	virtual void Dump(const TDesC& aTag, const TDesC& aFile);
       
   274 #endif
       
   275 
       
   276    static COptionNode* NewL();
       
   277 
       
   278 public:
       
   279   	TRecord iRecord;
       
   280 
       
   281 protected:
       
   282 	COptionNode( CItemBase* aNext );
       
   283 	virtual ~COptionNode();
       
   284    };
       
   285    
       
   286 
       
   287 inline COptionNode::COptionNode( CItemBase* aNext ) :
       
   288 	COption<TBigEndian>(aNext),
       
   289    iRecord( NULL )
       
   290 	{
       
   291 	iRecord.iFirst = this; //to get rid of too cautious warning C4355 (assignment of uncompleted this)
       
   292 	}
       
   293 
       
   294 class COptionList : public CListItem
       
   295 	{
       
   296 public:
       
   297 	COptionList(CItemBase* aNext);
       
   298    
       
   299 	COptionNode* AddNodeL(TOptionCodes aOpCode, TInt aInitialLength);
       
   300 	COptionNode* FindOption(TUint aOpCode) const;
       
   301 	COptionNode* FindOption(TUint aOpCode, TInt& aPos) const;
       
   302 
       
   303 	virtual void ParseL(TPtr8& aDes8);
       
   304 
       
   305    //get 32bit value (offset == aIndex * 4bytes)
       
   306 	TUint32 GetL( TInt aIndex, TUint aOpCode ) const;
       
   307 
       
   308 protected:
       
   309    static COptionNode* CreateNodeL( TUint aOpCode );
       
   310 	};
       
   311 
       
   312 inline COptionList::COptionList(CItemBase* aNext) : 
       
   313 	CListItem(aNext, 0)
       
   314 	{
       
   315 	}
       
   316 
       
   317 inline COptionNode* COptionList::FindOption(TUint aOpCode) const
       
   318 /**
       
   319   * Find the location of an option in the message and return a pointer to it
       
   320   *
       
   321   * @internalTechnology
       
   322   */
       
   323 	{
       
   324 	TInt dummy = 0;
       
   325 	return FindOption(aOpCode,dummy);
       
   326 	}
       
   327 
       
   328 class CDHCPOptionAny : public COptionNode
       
   329 /**
       
   330   * Class parsing any DHCP option that has a structure given by a subclass and
       
   331   * followed by unspecified trailing option data (member iOptionData)
       
   332   *
       
   333   * @internalTechnology
       
   334   */
       
   335 	{
       
   336 
       
   337 public:
       
   338 	CDHCPOptionAny(CItemBase* aNext) :
       
   339       COptionNode( aNext )
       
   340       {
       
   341       }
       
   342 
       
   343    static COptionNode* NewL();
       
   344 
       
   345 #if 0
       
   346 public:
       
   347 	virtual void ParseL( TPtr8& aDes8 );
       
   348 
       
   349 public:
       
   350 	TPtr8 OptionData();
       
   351 	
       
   352 protected:
       
   353 	TUint8* iPtrOptionData;
       
   354 	TInt iLenOptionData;
       
   355 #endif
       
   356 	};
       
   357 
       
   358 /**
       
   359   * This DNS Recursive Name Server option(option 23) returns the Recursive DNS server addresses
       
   360   * Ref: RFC 3646
       
   361   * @internalTechnology
       
   362   */
       
   363 class CDHCPOptionDNSServers : public COptionNode
       
   364 	{
       
   365 public:
       
   366 	CDHCPOptionDNSServers() :
       
   367       COptionNode(NULL)
       
   368       {
       
   369       }
       
   370 	
       
   371 	virtual void ParseL( TPtr8& aDes8 );
       
   372 
       
   373 	TBool GetDomainNameServer( TInt aIndex, TInetAddr& addr );
       
   374 	};
       
   375 
       
   376 
       
   377 /**
       
   378   * This option returns the SIP server addresses
       
   379   *
       
   380   * @internalTechnology
       
   381   */
       
   382 class CDHCPOptionSipServerAddrs : public COptionNode
       
   383 	{
       
   384 public:
       
   385 	CDHCPOptionSipServerAddrs() :
       
   386       COptionNode(NULL)
       
   387       {
       
   388       }
       
   389 	
       
   390 	virtual void ParseL(TPtr8& aDes8);
       
   391 
       
   392 	TBool GetSipServerAddr(TInt aIndex, TInetAddr& addr);
       
   393 	};
       
   394 
       
   395 /**
       
   396   * This option returns the SIP server domain names
       
   397   *
       
   398   * @internalTechnology
       
   399   */
       
   400 class CDHCPOptionSipServerDomains : public COptionNode
       
   401 	{
       
   402 public:
       
   403 	CDHCPOptionSipServerDomains() :
       
   404       COptionNode(NULL)
       
   405       {
       
   406       }
       
   407 	
       
   408 	virtual void ParseL(TPtr8& aDes8);
       
   409 
       
   410 	TBool GetSipServerDomains(TInt aIndex, THostName& aName);
       
   411 	};
       
   412 #ifdef SYMBIAN_TCPIPDHCP_UPDATE
       
   413 /**
       
   414   * This Domain Search List option(option 24) returns the Domain names while doing
       
   415   * name resolution
       
   416   * Ref: RFC 3646
       
   417   * @internalTechnology
       
   418   */
       
   419 class CDHCPOptionDomainSearchList  : public COptionNode
       
   420 	{
       
   421 public:
       
   422 	CDHCPOptionDomainSearchList() :
       
   423       COptionNode(NULL)
       
   424       {
       
   425       }
       
   426 	
       
   427 	virtual void ParseL(TPtr8& aDes8);
       
   428 
       
   429 	TBool GetDomainSearchList(TInt aIndex, THostName& aName);
       
   430 	};
       
   431 
       
   432 #endif //SYMBIAN_TCPIPDHCP_UPDATE	
       
   433 
       
   434 const TInt KDHCPOptionStatusCodeLength = 2; //bytes
       
   435 
       
   436 class CDHCPOptionStatusCode : public CDHCPOptionAny
       
   437 /**
       
   438   * This option returns a status indication related to the DHCP message
       
   439   * or option in which it appears.
       
   440   *
       
   441   * @internalTechnology
       
   442   */
       
   443 	{
       
   444 
       
   445 public:
       
   446     CDHCPOptionStatusCode() : CDHCPOptionAny(NULL) 
       
   447         {
       
   448         }
       
   449     
       
   450     COptionNode* NewL();
       
   451 
       
   452 public:
       
   453 	TUint32 GetStatusCode() const;
       
   454 	void SetStatusCode( TUint32 aStatusCode );
       
   455 	};
       
   456 
       
   457 const TInt KDHCPOptionRequestLen = 12;
       
   458 
       
   459 class CDHCPOptionRequestOption : public COptionNode
       
   460 /**
       
   461   * This option returns a status indication related to the DHCP message
       
   462   * or option in which it appears.
       
   463   *
       
   464   * @internalTechnology
       
   465   */
       
   466 	{
       
   467 
       
   468 public:
       
   469 	CDHCPOptionRequestOption() :
       
   470 		COptionNode( NULL )
       
   471 		{
       
   472      	}
       
   473 
       
   474    static COptionNode* NewL();
       
   475 
       
   476 public:
       
   477 	void AppendRequestedOptions();
       
   478 
       
   479 	};
       
   480 
       
   481 /**********************DHCPv6 message header****************************
       
   482        0                   1                   2                   3
       
   483        0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
       
   484       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       
   485       |    msg-type   |               transaction-id                  |
       
   486       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       
   487       |                                                               |
       
   488       .                            options                            .
       
   489       .                           (variable)                          .
       
   490       |                                                               |
       
   491       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
       
   492 
       
   493       msg-type             Identifies the DHCP message type; the
       
   494                            available message types are listed in
       
   495                            section 5.3.
       
   496 
       
   497       transaction-id       The transaction ID for this message exchange.
       
   498 
       
   499       options              Options carried in this message; options are
       
   500                            described in section 22.
       
   501 **********************************************************************/
       
   502 class CDHCPMessageHeaderIP6 : public CDHCPMessageHeader
       
   503 	{	
       
   504 public:
       
   505 	CDHCPMessageHeaderIP6(HBufC8*& aMsg) :
       
   506 		CDHCPMessageHeader(&iOptions, KDHCPHeaderLength, aMsg),
       
   507 		iOptions(NULL)
       
   508 		{
       
   509 #ifdef _FLOG_ACTIVE
       
   510 		iOptions.iName = _L("Options");
       
   511 #endif
       
   512 	    }
       
   513 	~CDHCPMessageHeaderIP6();
       
   514 
       
   515 public:
       
   516 	TInt Parse(const TDhcpRnd& aXid, const TDesC8& aClientId, RBuf8& aServerId);
       
   517 	virtual void RemoveAllOptions();
       
   518    
       
   519 	DHCPv6::COptionNode* AddOptionL(DHCPv6::TOptionCodes aOpCode, TInt aLength);
       
   520 
       
   521 	void SetMessageType(TUint8 aMsgType);		
       
   522 	void SetXid(TUint32 aXid); 				// Transaction ID
       
   523 	TUint8 GetMessageType() const;
       
   524 	TUint32 GetXid() const; 				// Transaction ID
       
   525    DHCPv6::TStatusCodes GetStatusCode() const;  //returns status code for the message 
       
   526                                        //if no status option present it returns success
       
   527 
       
   528 	inline DHCPv6::COptionList& GetOptions() { return iOptions; };
       
   529 
       
   530 	void Close() //so as it could be put on the stack and on the cleanup stack
       
   531 		{
       
   532 		iOptions.RemoveAllNodes();
       
   533 		}
       
   534 	
       
   535 protected:
       
   536 	DHCPv6::COptionList iOptions;
       
   537 
       
   538 	};
       
   539 
       
   540 inline DHCPv6::TStatusCodes CDHCPMessageHeaderIP6::GetStatusCode() const
       
   541    {//for the moment inline
       
   542    return DHCPv6::ESuccess;
       
   543    }
       
   544 
       
   545 inline void CDHCPMessageHeaderIP6::RemoveAllOptions()
       
   546 	{
       
   547 	iOptions.RemoveAllNodes();
       
   548 	}
       
   549 
       
   550 inline TUint8 CDHCPMessageHeaderIP6::GetMessageType() const
       
   551 /**
       
   552   * Retrieve message type
       
   553   *
       
   554   * @internalTechnology
       
   555   *
       
   556   */
       
   557 	{
       
   558 	return static_cast<TUint8>(*Ptr());
       
   559 	}
       
   560 
       
   561 inline void CDHCPMessageHeaderIP6::SetMessageType(TUint8 aMsgType)
       
   562 /**
       
   563   * Set Message Type
       
   564   *
       
   565   * @internalTechnology
       
   566   *
       
   567   */
       
   568 	{
       
   569    TUint8* ptr = Ptr();
       
   570    *ptr = aMsgType;
       
   571 	}
       
   572 
       
   573 inline void CDHCPMessageHeaderIP6::SetXid(TUint32 aXid)
       
   574 /**
       
   575   * Set Transaction ID in message
       
   576   *
       
   577   * @internalTechnology
       
   578   *
       
   579   */
       
   580 	{//set it as a big endian
       
   581     TBigEndian::SetValue( Ptr() + KXidOffset, KXidLength, aXid );
       
   582 	}
       
   583 
       
   584 inline TUint32 CDHCPMessageHeaderIP6::GetXid() const
       
   585 /**
       
   586   * Retrieve Transaction ID from message
       
   587   *
       
   588   * @internalTechnology
       
   589   *
       
   590   */
       
   591 	{//get as a big endian
       
   592    return TBigEndian::GetValue( Ptr() + KXidOffset, KXidLength );
       
   593 	}
       
   594 
       
   595 } //namespace DHCPv6
       
   596 #endif