telephonyserver/etelpacketdata/inc/ETELPCKT.INL
changeset 0 3553901f7fa8
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     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 //
       
    15 
       
    16 /**
       
    17  @file
       
    18 */
       
    19 
       
    20 inline TBool RPacketContext::TPacketFilterV3::IsPresent(TPacketFilterDataBitmapPos aDataMemberBitmapPos)
       
    21 /**
       
    22 	This method may be called by the client application. 
       
    23 	Checks if the bitmap of a certain attribute is set or not.
       
    24 	
       
    25 	@param aDataMemberBitmapPos Bitmap of an attribute.
       
    26 
       
    27 */
       
    28 	{
       
    29 	return aDataMemberBitmapPos & iPresentDataBitmap;
       
    30 	}
       
    31 	
       
    32 inline void RPacketContext::TPacketFilterV3::Reset(TPacketFilterDataBitmapPos aDataMemberBitmapPos)
       
    33 /**
       
    34 	This method may be called by the client application. 
       
    35 	Resets the iPresentDataBitmap of an attribute accordign to its Bitmap value.
       
    36 	
       
    37 	@param aDataMemberBitmapPos Bitmap of an attribute.
       
    38 
       
    39 */
       
    40 	{
       
    41 	iPresentDataBitmap &= ~aDataMemberBitmapPos;
       
    42 	}
       
    43 	
       
    44 inline void RPacketContext::TPacketFilterV3::Reset()
       
    45 /**
       
    46 	This method may be called by the client application. 
       
    47 	Sets the iPresentDataBitmap to 0.
       
    48 
       
    49 */
       
    50 	{
       
    51 	iPresentDataBitmap = 0;
       
    52 	}
       
    53 	
       
    54 inline TInt RPacketContext::TPacketFilterV3::ProtocolNumberOrNextHeader()
       
    55 /**
       
    56 	This method may be called by the client application. 
       
    57 	Gets the iProtocolNumberOrNextHeader value which has been set by the 
       
    58 	SetProtocolNumberOrNextHeader method.
       
    59 
       
    60 */
       
    61 	{
       
    62 	return iProtocolNumberOrNextHeader;
       
    63 	}
       
    64 		
       
    65 inline TInt RPacketContext::TPacketFilterV3::SrcPortMin()
       
    66 /**
       
    67 	This method may be called by the client application. 
       
    68 	Gets the iSrcPortMin value which has been set by the 
       
    69 	SetSrcPortMin method.
       
    70 
       
    71 */
       
    72 	{
       
    73 	return iSrcPortMin;
       
    74 	}
       
    75 	
       
    76 inline TInt RPacketContext::TPacketFilterV3::SrcPortMax()
       
    77 /**
       
    78 	This method may be called by the client application. 
       
    79 	Gets the iSrcPortMax value which has been set by the 
       
    80 	SetSrcPortMax method.
       
    81 
       
    82 */
       
    83 	{
       
    84 	return iSrcPortMax;
       
    85 	}
       
    86 		
       
    87 inline TInt RPacketContext::TPacketFilterV3::DestPortMin()
       
    88 /**
       
    89 	This method may be called by the client application. 
       
    90 	Gets the iDestPortMin value which has been set by the 
       
    91 	SetDestPortMin method.
       
    92 
       
    93 */
       
    94 	{
       
    95 	return iDestPortMin;
       
    96 	}
       
    97 	
       
    98 inline TInt RPacketContext::TPacketFilterV3::DestPortMax()
       
    99 /**
       
   100 	This method may be called by the client application. 
       
   101 	Gets the iDestPortMax value which has been set by the 
       
   102 	SetDestPortMax method.
       
   103 
       
   104 */
       
   105 	{
       
   106 	return iDestPortMax;
       
   107 	}
       
   108 		
       
   109 inline TUint32 RPacketContext::TPacketFilterV3::SPI()
       
   110 /**
       
   111 	This method may be called by the client application. 
       
   112 	Gets the iIPSecSPI value which has been set by the 
       
   113 	SetSPI method.
       
   114 
       
   115 */
       
   116 	{
       
   117 	return iIPSecSPI;
       
   118 	}
       
   119 		
       
   120 inline TUint16 RPacketContext::TPacketFilterV3::TOSorTrafficClass()
       
   121 /**
       
   122 	This method may be called by the client application. 
       
   123 	Gets the iTOSorTrafficClass value which has been set by the 
       
   124 	SetTOSorTrafficClass method.
       
   125 
       
   126 */
       
   127 	{
       
   128 	return iTOSorTrafficClass;
       
   129 	}
       
   130 	
       
   131 inline TUint32 RPacketContext::TPacketFilterV3::FlowLabel()
       
   132 /**
       
   133 	This method may be called by the client application. 
       
   134 	Gets the iFlowLabel value which has been set by the 
       
   135 	SetFlowLabel method.
       
   136 
       
   137 */
       
   138 	{
       
   139 	return iFlowLabel;
       
   140 	}
       
   141 	
       
   142 /** 
       
   143 Default constructor.
       
   144 */
       
   145 inline RPacketContext::TPcoId::TPcoId():iId(0)
       
   146 	{}
       
   147 
       
   148 /** 
       
   149 Constructor that initialises Id by provoded value.
       
   150 
       
   151 @param aId Id ofIE identifier.
       
   152 */	
       
   153 inline RPacketContext::TPcoId::TPcoId(TUint16 aId):iId(aId)
       
   154 	{}
       
   155 
       
   156 /** 
       
   157 Sets PCO Id.
       
   158 
       
   159 @param aId PCO Id to set.
       
   160 */	
       
   161 inline void RPacketContext::TPcoId::SetId(TUint16 aId)
       
   162 	{
       
   163 	iId=aId;
       
   164 	}
       
   165 	
       
   166 /** 
       
   167 Retrieves PCO Id.
       
   168 
       
   169 @return PCO id.
       
   170 */
       
   171 inline TUint16 RPacketContext::TPcoId::Id() const
       
   172 	{
       
   173 	return iId;
       
   174 	}
       
   175 	
       
   176 /** 
       
   177 Compares whether the PCO Id of other PCoId is the same.
       
   178 
       
   179 @param PCO Id to compare.
       
   180 */		
       
   181 inline TBool RPacketContext::TPcoId::IsEqual(const MTlvItemIdType& aOtherIdType) const
       
   182 	{
       
   183 	return iId==(static_cast<const TPcoId&>(aOtherIdType)).Id();
       
   184 	}
       
   185 
       
   186 /** 
       
   187 Length of serialised data.
       
   188 
       
   189 @return Length of id when serialized.
       
   190 */
       
   191 inline TUint RPacketContext::TPcoId::SerializedLength()const
       
   192 	{
       
   193 	return sizeof(TUint16);
       
   194 	}
       
   195 
       
   196 /** 
       
   197 Serialise to the descriptor provided
       
   198 
       
   199 Converts internally stored little-endian data 		
       
   200 to big-endian encoded data as specified in 3GPP TS 24.008, table 10.5.154.
       
   201 
       
   202 @param aData On completion contains serialized PCO item identifier.
       
   203 */		
       
   204 inline void RPacketContext::TPcoId::ExternalizeL(TDes8& aData) const
       
   205 	{
       
   206 	if(aData.Length()<2)
       
   207 		User::Leave(KErrOverflow);
       
   208 	aData[0]=(iId & 0xff00)>>8;
       
   209 	aData[1]=iId & 0xff;	
       
   210 	}
       
   211 
       
   212 /** 
       
   213 Internalize data from the buffer provided.
       
   214 
       
   215 Converts internally stored little-endian data 		
       
   216 to big-endian encoded data as specified in 3GPP TS 24.008, table 10.5.154.
       
   217 
       
   218 @param aData Buffer containing PCO item Id to be internalized.
       
   219 */
       
   220 inline void RPacketContext::TPcoId::InternalizeL(TDesC8& aData)
       
   221 	{
       
   222 	if(aData.Length()<2)
       
   223 		User::Leave(KErrUnderflow);
       
   224 	iId=aData[1];
       
   225 	iId|=aData[0]<<8;	
       
   226 	}
       
   227 	
       
   228 /** 
       
   229 Constructor initialise length by provided value.
       
   230 
       
   231 @param aLen Length of PCO item.
       
   232 */
       
   233 inline RPacketContext::TPcoItemDataLength::TPcoItemDataLength(TUint8 aLen):iDataLength(aLen)
       
   234 	{}
       
   235 
       
   236 /** 
       
   237 Default constructor.
       
   238 */		
       
   239 inline RPacketContext::TPcoItemDataLength::TPcoItemDataLength():iDataLength(0)
       
   240 	{}
       
   241 	
       
   242 /** 
       
   243 Sets length of associated data.
       
   244 
       
   245 @param aLength Length of PCO item.
       
   246 */	
       
   247 inline void RPacketContext::TPcoItemDataLength::SetDataLength(TUint aLength)
       
   248 	{
       
   249 	iDataLength=(TUint8)aLength;
       
   250 	}
       
   251 
       
   252 /** 
       
   253 Length when serialised.
       
   254 
       
   255 @return Seriliazed length.
       
   256  */	
       
   257 inline TUint RPacketContext::TPcoItemDataLength::SerializedLength() const
       
   258 	{
       
   259 	return sizeof(TUint8);
       
   260 	}
       
   261 
       
   262 /** 
       
   263 Length of associated item data.
       
   264 
       
   265 @return Length of PCO item.
       
   266 */		
       
   267 inline TUint RPacketContext::TPcoItemDataLength::DataLength() const
       
   268 	{
       
   269 	return iDataLength;
       
   270 	};
       
   271 
       
   272 /** 
       
   273 Serialize data member into provoded descriptor.
       
   274 
       
   275 @param aData buffer into which length will be serialized.
       
   276 */	
       
   277 inline void RPacketContext::TPcoItemDataLength::ExternalizeL(TDes8& aData) const
       
   278 	{
       
   279 	if(aData.Length()<1)
       
   280 		User::Leave(KErrOverflow);
       
   281 	aData[0]=iDataLength;
       
   282 	}
       
   283 
       
   284 /** 
       
   285 Deserialize data from provided buffer
       
   286 
       
   287 @param aData Buffer containing length to be internalized.
       
   288 */
       
   289 inline void RPacketContext::TPcoItemDataLength::InternalizeL(TDesC8& aData)
       
   290 	{	
       
   291 	if(aData.Length()<1)
       
   292 		User::Leave(KErrUnderflow);
       
   293 	iDataLength=aData[0];
       
   294 	}
       
   295