1.1 --- a/epoc32/include/etelpckt.inl Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/etelpckt.inl Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,297 @@
1.4 -etelpckt.inl
1.5 +// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +// All rights reserved.
1.7 +// This component and the accompanying materials are made available
1.8 +// 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
1.9 +// which accompanies this distribution, and is available
1.10 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.11 +//
1.12 +// Initial Contributors:
1.13 +// Nokia Corporation - initial contribution.
1.14 +//
1.15 +// Contributors:
1.16 +//
1.17 +// Description:
1.18 +//
1.19 +
1.20 +
1.21 +
1.22 +/**
1.23 + @file
1.24 +*/
1.25 +
1.26 +inline TBool RPacketContext::TPacketFilterV3::IsPresent(TPacketFilterDataBitmapPos aDataMemberBitmapPos)
1.27 +/**
1.28 + This method may be called by the client application.
1.29 + Checks if the bitmap of a certain attribute is set or not.
1.30 +
1.31 + @param aDataMemberBitmapPos Bitmap of an attribute.
1.32 +
1.33 +*/
1.34 + {
1.35 + return aDataMemberBitmapPos & iPresentDataBitmap;
1.36 + }
1.37 +
1.38 +inline void RPacketContext::TPacketFilterV3::Reset(TPacketFilterDataBitmapPos aDataMemberBitmapPos)
1.39 +/**
1.40 + This method may be called by the client application.
1.41 + Resets the iPresentDataBitmap of an attribute accordign to its Bitmap value.
1.42 +
1.43 + @param aDataMemberBitmapPos Bitmap of an attribute.
1.44 +
1.45 +*/
1.46 + {
1.47 + iPresentDataBitmap &= ~aDataMemberBitmapPos;
1.48 + }
1.49 +
1.50 +inline void RPacketContext::TPacketFilterV3::Reset()
1.51 +/**
1.52 + This method may be called by the client application.
1.53 + Sets the iPresentDataBitmap to 0.
1.54 +
1.55 +*/
1.56 + {
1.57 + iPresentDataBitmap = 0;
1.58 + }
1.59 +
1.60 +inline TInt RPacketContext::TPacketFilterV3::ProtocolNumberOrNextHeader()
1.61 +/**
1.62 + This method may be called by the client application.
1.63 + Gets the iProtocolNumberOrNextHeader value which has been set by the
1.64 + SetProtocolNumberOrNextHeader method.
1.65 +
1.66 +*/
1.67 + {
1.68 + return iProtocolNumberOrNextHeader;
1.69 + }
1.70 +
1.71 +inline TInt RPacketContext::TPacketFilterV3::SrcPortMin()
1.72 +/**
1.73 + This method may be called by the client application.
1.74 + Gets the iSrcPortMin value which has been set by the
1.75 + SetSrcPortMin method.
1.76 +
1.77 +*/
1.78 + {
1.79 + return iSrcPortMin;
1.80 + }
1.81 +
1.82 +inline TInt RPacketContext::TPacketFilterV3::SrcPortMax()
1.83 +/**
1.84 + This method may be called by the client application.
1.85 + Gets the iSrcPortMax value which has been set by the
1.86 + SetSrcPortMax method.
1.87 +
1.88 +*/
1.89 + {
1.90 + return iSrcPortMax;
1.91 + }
1.92 +
1.93 +inline TInt RPacketContext::TPacketFilterV3::DestPortMin()
1.94 +/**
1.95 + This method may be called by the client application.
1.96 + Gets the iDestPortMin value which has been set by the
1.97 + SetDestPortMin method.
1.98 +
1.99 +*/
1.100 + {
1.101 + return iDestPortMin;
1.102 + }
1.103 +
1.104 +inline TInt RPacketContext::TPacketFilterV3::DestPortMax()
1.105 +/**
1.106 + This method may be called by the client application.
1.107 + Gets the iDestPortMax value which has been set by the
1.108 + SetDestPortMax method.
1.109 +
1.110 +*/
1.111 + {
1.112 + return iDestPortMax;
1.113 + }
1.114 +
1.115 +inline TUint32 RPacketContext::TPacketFilterV3::SPI()
1.116 +/**
1.117 + This method may be called by the client application.
1.118 + Gets the iIPSecSPI value which has been set by the
1.119 + SetSPI method.
1.120 +
1.121 +*/
1.122 + {
1.123 + return iIPSecSPI;
1.124 + }
1.125 +
1.126 +inline TUint16 RPacketContext::TPacketFilterV3::TOSorTrafficClass()
1.127 +/**
1.128 + This method may be called by the client application.
1.129 + Gets the iTOSorTrafficClass value which has been set by the
1.130 + SetTOSorTrafficClass method.
1.131 +
1.132 +*/
1.133 + {
1.134 + return iTOSorTrafficClass;
1.135 + }
1.136 +
1.137 +inline TUint32 RPacketContext::TPacketFilterV3::FlowLabel()
1.138 +/**
1.139 + This method may be called by the client application.
1.140 + Gets the iFlowLabel value which has been set by the
1.141 + SetFlowLabel method.
1.142 +
1.143 +*/
1.144 + {
1.145 + return iFlowLabel;
1.146 + }
1.147 +
1.148 +/**
1.149 +Default constructor.
1.150 +*/
1.151 +inline RPacketContext::TPcoId::TPcoId():iId(0)
1.152 + {}
1.153 +
1.154 +/**
1.155 +Constructor that initialises Id by provoded value.
1.156 +
1.157 +@param aId Id ofIE identifier.
1.158 +*/
1.159 +inline RPacketContext::TPcoId::TPcoId(TUint16 aId):iId(aId)
1.160 + {}
1.161 +
1.162 +/**
1.163 +Sets PCO Id.
1.164 +
1.165 +@param aId PCO Id to set.
1.166 +*/
1.167 +inline void RPacketContext::TPcoId::SetId(TUint16 aId)
1.168 + {
1.169 + iId=aId;
1.170 + }
1.171 +
1.172 +/**
1.173 +Retrieves PCO Id.
1.174 +
1.175 +@return PCO id.
1.176 +*/
1.177 +inline TUint16 RPacketContext::TPcoId::Id() const
1.178 + {
1.179 + return iId;
1.180 + }
1.181 +
1.182 +/**
1.183 +Compares whether the PCO Id of other PCoId is the same.
1.184 +
1.185 +@param PCO Id to compare.
1.186 +*/
1.187 +inline TBool RPacketContext::TPcoId::IsEqual(const MTlvItemIdType& aOtherIdType) const
1.188 + {
1.189 + return iId==(static_cast<const TPcoId&>(aOtherIdType)).Id();
1.190 + }
1.191 +
1.192 +/**
1.193 +Length of serialised data.
1.194 +
1.195 +@return Length of id when serialized.
1.196 +*/
1.197 +inline TUint RPacketContext::TPcoId::SerializedLength()const
1.198 + {
1.199 + return sizeof(TUint16);
1.200 + }
1.201 +
1.202 +/**
1.203 +Serialise to the descriptor provided
1.204 +
1.205 +Converts internally stored little-endian data
1.206 +to big-endian encoded data as specified in 3GPP TS 24.008, table 10.5.154.
1.207 +
1.208 +@param aData On completion contains serialized PCO item identifier.
1.209 +*/
1.210 +inline void RPacketContext::TPcoId::ExternalizeL(TDes8& aData) const
1.211 + {
1.212 + if(aData.Length()<2)
1.213 + User::Leave(KErrOverflow);
1.214 + aData[0]=(iId & 0xff00)>>8;
1.215 + aData[1]=iId & 0xff;
1.216 + }
1.217 +
1.218 +/**
1.219 +Internalize data from the buffer provided.
1.220 +
1.221 +Converts internally stored little-endian data
1.222 +to big-endian encoded data as specified in 3GPP TS 24.008, table 10.5.154.
1.223 +
1.224 +@param aData Buffer containing PCO item Id to be internalized.
1.225 +*/
1.226 +inline void RPacketContext::TPcoId::InternalizeL(TDesC8& aData)
1.227 + {
1.228 + if(aData.Length()<2)
1.229 + User::Leave(KErrUnderflow);
1.230 + iId=aData[1];
1.231 + iId|=aData[0]<<8;
1.232 + }
1.233 +
1.234 +/**
1.235 +Constructor initialise length by provided value.
1.236 +
1.237 +@param aLen Length of PCO item.
1.238 +*/
1.239 +inline RPacketContext::TPcoItemDataLength::TPcoItemDataLength(TUint8 aLen):iDataLength(aLen)
1.240 + {}
1.241 +
1.242 +/**
1.243 +Default constructor.
1.244 +*/
1.245 +inline RPacketContext::TPcoItemDataLength::TPcoItemDataLength():iDataLength(0)
1.246 + {}
1.247 +
1.248 +/**
1.249 +Sets length of associated data.
1.250 +
1.251 +@param aLength Length of PCO item.
1.252 +*/
1.253 +inline void RPacketContext::TPcoItemDataLength::SetDataLength(TUint aLength)
1.254 + {
1.255 + iDataLength=(TUint8)aLength;
1.256 + }
1.257 +
1.258 +/**
1.259 +Length when serialised.
1.260 +
1.261 +@return Seriliazed length.
1.262 + */
1.263 +inline TUint RPacketContext::TPcoItemDataLength::SerializedLength() const
1.264 + {
1.265 + return sizeof(TUint8);
1.266 + }
1.267 +
1.268 +/**
1.269 +Length of associated item data.
1.270 +
1.271 +@return Length of PCO item.
1.272 +*/
1.273 +inline TUint RPacketContext::TPcoItemDataLength::DataLength() const
1.274 + {
1.275 + return iDataLength;
1.276 + };
1.277 +
1.278 +/**
1.279 +Serialize data member into provoded descriptor.
1.280 +
1.281 +@param aData buffer into which length will be serialized.
1.282 +*/
1.283 +inline void RPacketContext::TPcoItemDataLength::ExternalizeL(TDes8& aData) const
1.284 + {
1.285 + if(aData.Length()<1)
1.286 + User::Leave(KErrOverflow);
1.287 + aData[0]=iDataLength;
1.288 + }
1.289 +
1.290 +/**
1.291 +Deserialize data from provided buffer
1.292 +
1.293 +@param aData Buffer containing length to be internalized.
1.294 +*/
1.295 +inline void RPacketContext::TPcoItemDataLength::InternalizeL(TDesC8& aData)
1.296 + {
1.297 + if(aData.Length()<1)
1.298 + User::Leave(KErrUnderflow);
1.299 + iDataLength=aData[0];
1.300 + }
1.301 +