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