networksecurity/tls/secsock/GenericSecureSocket.inl
changeset 0 af10295192d8
equal deleted inserted replaced
-1:000000000000 0:af10295192d8
       
     1 // Copyright (c) 2005-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 // Generic Secure Socket Interface Inline Functions
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file
       
    20  @internalTechnology
       
    21 */
       
    22 
       
    23 #ifndef __GENERICSECURESOCKET_INL__
       
    24 #define __GENERICSECURESOCKET_INL__
       
    25 
       
    26 template<class TYPE>
       
    27 inline CGenericSecureSocket<TYPE>::CGenericSecureSocket(TYPE& aProvider)
       
    28 :    iProvider(aProvider)
       
    29 /**
       
    30 Constructor
       
    31 */
       
    32     {
       
    33     }
       
    34 
       
    35 template<class TYPE>
       
    36 inline CGenericSecureSocket<TYPE>::~CGenericSecureSocket()
       
    37 /**
       
    38 Destructor
       
    39 */
       
    40     {
       
    41     }
       
    42 
       
    43 template<class TYPE>
       
    44 inline void CGenericSecureSocket<TYPE>::Send(const TDesC8& aDesc,TUint aFlags, TRequestStatus& aStatus)
       
    45 /**
       
    46 Send data over the generic socket for the secure socket
       
    47 @param aDataToSend encrypted data to send for secure socket
       
    48 @param aFlags Flags which are passed through to protocol
       
    49 @param aStatus Request Status
       
    50 */
       
    51 	{
       
    52 	iProvider.Send(aDesc, aFlags, aStatus);
       
    53 	}
       
    54 
       
    55 template<class TYPE>
       
    56 inline void CGenericSecureSocket<TYPE>::CancelSend()
       
    57 /**
       
    58 Cancel the current send operation
       
    59 */
       
    60 	{
       
    61 	iProvider.CancelSend();
       
    62 	}
       
    63 
       
    64 template<class TYPE>
       
    65 inline void CGenericSecureSocket<TYPE>::Recv(TDes8& aDesc,TUint aFlags, TRequestStatus& aStatus)
       
    66 /**
       
    67 Receive data from the generic socket for the secure socket
       
    68 @param aDataReceived encrypted data received for the secure socket
       
    69 @param aFlags Flags which are passed through to protocol
       
    70 @param aStatus Request Status.  On return KErrNone if successful, 
       
    71        otherwise another of the system-wide error
       
    72 */
       
    73 	{
       
    74 	iProvider.Recv(aDesc, aFlags, aStatus);
       
    75 	}
       
    76 
       
    77 template<class TYPE>
       
    78 inline void CGenericSecureSocket<TYPE>::CancelRecv()
       
    79 /**
       
    80 Cancel the current recv operation
       
    81 */
       
    82 	{
       
    83 	iProvider.CancelRecv();
       
    84 	}
       
    85 
       
    86 
       
    87 template<class TYPE>
       
    88 inline void CGenericSecureSocket<TYPE>::Read(TDes8& aDesc, TRequestStatus& aStatus)
       
    89 /**
       
    90 Read data from the generic socket for the secure socket
       
    91 @param aDataRead encrypted data read for the secure socket
       
    92 @param aStatus Request Status.  On return KErrNone if successful, 
       
    93        otherwise another of the system-wide error
       
    94 */
       
    95 	{
       
    96 	iProvider.Read(aDesc, aStatus);
       
    97 	}
       
    98 
       
    99 template<class TYPE>
       
   100 inline void CGenericSecureSocket<TYPE>::CancelRead()
       
   101 /**
       
   102 Cancel the current read operation
       
   103 */
       
   104 	{
       
   105 	iProvider.CancelRead();
       
   106 	}
       
   107 
       
   108 template<class TYPE>
       
   109 inline TInt CGenericSecureSocket<TYPE>::SetOpt(TUint aOptionName,TUint aOptionLevel,const TDesC8& aOption)
       
   110 /**
       
   111 Sets a socket option
       
   112 @param aOptionName An integer constant which identifies an option.
       
   113 @param aOptionLevel An integer constant which identifies level of an option
       
   114 @param aOption Option value packaged in a descriptor.
       
   115 @return KErrNone if successful, otherwise another of the system-wide error codes. 
       
   116 */
       
   117 	{
       
   118 	return iProvider.SetOpt(aOptionName, aOptionLevel, aOption);
       
   119 	}
       
   120 
       
   121 template<class TYPE>
       
   122 inline TInt CGenericSecureSocket<TYPE>::GetOpt(TUint aOptionName,TUint aOptionLevel,TDes8& aOption)
       
   123 /**
       
   124 Gets a socket option
       
   125 @param aOptionName An integer constant which identifies an option.
       
   126 @param aOptionLevel An integer constant which identifies level of an option
       
   127 @param aOption Option value packaged in a descriptor.
       
   128 @return KErrNone if successful, otherwise another of the system-wide error codes. 
       
   129 */
       
   130 	{
       
   131 	return iProvider.GetOpt(aOptionName, aOptionLevel, aOption);
       
   132 	}
       
   133 
       
   134 template<class TYPE>
       
   135 inline void CGenericSecureSocket<TYPE>::RemoteName(TSockAddr& aAddr)
       
   136 /**
       
   137 Gets the local address of a bound socket. 
       
   138 @param aAddr Local address which is filled in on return. 
       
   139 */
       
   140 	{
       
   141 	iProvider.RemoteName(aAddr);
       
   142 	}
       
   143 
       
   144 template<class TYPE>
       
   145 inline void CGenericSecureSocket<TYPE>::LocalName(TSockAddr& aAddr)
       
   146 /**
       
   147 Gets the remote address of a bound socket. 
       
   148 @param aAddr Remote address which is filled in on return. 
       
   149 */
       
   150 	{
       
   151 	iProvider.LocalName(aAddr);
       
   152 	}
       
   153 
       
   154 template<class TYPE>
       
   155 inline void CGenericSecureSocket<TYPE>::Close()
       
   156 /**
       
   157 Close the Generic Socket
       
   158 */
       
   159 	{
       
   160 	iProvider.Close();
       
   161 	}
       
   162 
       
   163 #endif // __GENERICSECURESOCKET_INL__