realtimenetprots/sipfw/SIP/Common/inc/sipclientserver.h
changeset 0 307788aac0a8
child 55 36ea1f90a3d8
equal deleted inserted replaced
-1:000000000000 0:307788aac0a8
       
     1 /*
       
     2 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 * Name          : sipclientserver.h
       
    16 * Part of       : SIPCommon
       
    17 * Version       : SIP/6.0
       
    18 *
       
    19 */
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 /**
       
    25  @internalComponent
       
    26 */
       
    27 
       
    28 
       
    29 #ifndef SIPCLIENTSERVER_H
       
    30 #define SIPCLIENTSERVER_H
       
    31 
       
    32 #include <e32std.h>
       
    33 
       
    34 _LIT(KSipServerName,"SipServer");
       
    35 _LIT(KSipServerFilename, "SipServer");
       
    36 _LIT(KSipServerSemaphoreName, "SipServerSemaphore");
       
    37 
       
    38 const TUid KServerUid3 = {0x101f5d36};
       
    39 
       
    40 #if (defined (__WINS__) || defined(__WINSCW__))
       
    41 static const TUint KServerMinHeapSize =  0x1000;  //   4K
       
    42 static const TUint KServerMaxHeapSize = 0x80000;  // 512K !?!?
       
    43 #endif
       
    44 
       
    45 // The server version.
       
    46 // A version must be specifyed when creating a session with the server
       
    47 const TUint KSipServerMajorVersionNumber=0;
       
    48 const TUint KSipServerMinorVersionNumber=1;
       
    49 const TUint KSipServerBuildVersionNumber=1;
       
    50 
       
    51 
       
    52 // A container for SIP IDs
       
    53 class TSIPIds
       
    54 	{
       
    55 public:
       
    56 
       
    57 	TSIPIds()
       
    58 		: iIapId(0),
       
    59           iRequestId(0),
       
    60 		  iRegistrationId(0),
       
    61 		  iDialogId(0),
       
    62 		  iRefreshId(0),
       
    63 		  iRefresh(EFalse),
       
    64 		  iTargetRefresh(EFalse),
       
    65 		  iSendWithExpires(ETrue),
       
    66 		  iCacheOutboundProxyIP(EFalse),
       
    67 		  iConnectionError(KErrNone){}
       
    68 
       
    69 	TSIPIds(const TSIPIds& aIds)
       
    70 		: iIapId(aIds.iIapId),
       
    71           iRequestId(aIds.iRequestId),
       
    72 		  iRegistrationId(aIds.iRegistrationId),
       
    73 		  iDialogId(aIds.iDialogId),
       
    74 		  iRefreshId(aIds.iRefreshId),
       
    75 		  iRefresh(aIds.iRefresh),
       
    76 		  iTargetRefresh(aIds.iTargetRefresh),
       
    77 		  iSendWithExpires(aIds.iSendWithExpires),
       
    78 		  iCacheOutboundProxyIP(aIds.iCacheOutboundProxyIP),
       
    79 		  iConnectionError(aIds.iConnectionError){}
       
    80 
       
    81     TUint32 iIapId;
       
    82 	TUint32 iRequestId;
       
    83 	TUint32 iRegistrationId;
       
    84 	TUint32 iDialogId;
       
    85 	TUint32 iRefreshId;
       
    86 	TBool iRefresh;
       
    87 	TBool iTargetRefresh;
       
    88 	TBool iSendWithExpires;
       
    89 	TBool iCacheOutboundProxyIP;
       
    90 	TInt iConnectionError;
       
    91 	};
       
    92 
       
    93 
       
    94 // A container for incoming buffer sizes
       
    95 class TSIPMessageBufSizes
       
    96     {
       
    97 public:
       
    98 
       
    99     TSIPMessageBufSizes()
       
   100         : iHeaderBufSize(0),
       
   101           iContentBufSize(0) {}
       
   102 
       
   103     TSIPMessageBufSizes(TInt aHeaderBufSize, TInt aContentBufSize)
       
   104         : iHeaderBufSize(aHeaderBufSize),
       
   105           iContentBufSize(aContentBufSize) {}
       
   106 
       
   107 	TSIPMessageBufSizes(const TSIPMessageBufSizes& aSizes)
       
   108         : iHeaderBufSize(aSizes.iHeaderBufSize),
       
   109           iContentBufSize(aSizes.iContentBufSize) {}
       
   110 
       
   111     TInt iHeaderBufSize;
       
   112     TInt iContentBufSize;
       
   113     };
       
   114     
       
   115     
       
   116 // A container for SIP socket options
       
   117 class TSIPSockOpt
       
   118     {
       
   119 public:
       
   120 
       
   121     TSIPSockOpt()
       
   122         : iOptionName(0),
       
   123           iOptionLevel(0),
       
   124           iOption(0) {}
       
   125 
       
   126     TSIPSockOpt(TUint aOptionName, TUint aOptionLevel, TInt aOption=0)
       
   127         : iOptionName(aOptionName),
       
   128           iOptionLevel(aOptionLevel),
       
   129           iOption(aOption) {}
       
   130 
       
   131     TUint iOptionName;
       
   132     TUint iOptionLevel;
       
   133     TInt iOption;
       
   134     };    
       
   135 
       
   136 
       
   137 // HTTP Digest observer type
       
   138 enum TSipHttpDigestObserverType
       
   139 	{
       
   140     ESipNoHttpDigestObserver = 0,
       
   141     ESipRealmHttpDigestObserver = 1,
       
   142     ESipResponseHttpDigestObserver = 2
       
   143 	};
       
   144 	
       
   145 	
       
   146 // Oper. codes used in passing IPC messages between C/S-client and C/S-server
       
   147 enum TSipItcFunctions
       
   148     {
       
   149 	// 0-23: No capabilities required
       
   150     ESipItcTerminateDialog,
       
   151     ESipItcTerminateRefresh,
       
   152     ESipItcTerminateDialogRefresh,
       
   153     ESipItcTerminateRegistration,
       
   154     ESipItcSupportedSecurityMechanisms,
       
   155     ESipItcNegotiatedSecurityMechanism,
       
   156     ESipItcIsSigCompSupported,
       
   157     ESipItcGetTransactionState,
       
   158     ESipItcGetDialogState,
       
   159     ESipItcGetCompartmentCount,
       
   160     ESipItcGetFromHeader,
       
   161     ESipItcGetRefreshInterval,
       
   162     ESipItcGetCallIDHeader,
       
   163     ESipItcGetLocalTag,
       
   164     ESipItcOutboundProxy,
       
   165     ESipItcGetRegisteredContact,
       
   166     ESipItcGetLocalAddr,
       
   167     ESipItcSetOutboundProxy,
       
   168     ESipItcRemoveOutboundProxy,
       
   169     ESipItcSetRefreshInterval,
       
   170     ESipItcSetHttpDigestObserver,
       
   171     ESipItcSetCredentials,
       
   172     ESipItcRemoveCredentials,
       
   173     ESipItcIgnoreChallenge,
       
   174     ESipItcSetSecurityHandling,
       
   175     ESipItcResetDialogState,
       
   176     // 26: WriteDeviceData capability required
       
   177     ESipItcSetAppUid,
       
   178     // 27-28: // Custom check: same capabilities as SIP server required
       
   179     ESipItcSetSIPSockOpt,
       
   180     ESipItcSetSIPSockOptWithDes,
       
   181     // 29-51: NetworkServices capability required
       
   182     ESipItcOpenSubSession,
       
   183     ESipItcCloseSubSession,    
       
   184     ESipItcRegister,
       
   185     ESipItcRegisterAndSetOutboundProxy,
       
   186     ESipItcUpdateRegistration,
       
   187     ESipItcUnRegister,
       
   188     ESipItcFetchRegistrations,
       
   189     ESipItcSendRequest,
       
   190     ESipItcSendRequestAndUpdateRefresh,
       
   191     ESipItcSendRequestAndTerminateRefresh,
       
   192     ESipItcSendResponse,
       
   193     ESipItcSendCancel,
       
   194     ESipItcSendResponseAndCreateDialog,
       
   195     ESipItcSendResponseInDialog,
       
   196     ESipItcSendRequestAndCreateDialog,
       
   197     ESipItcSendRequestInDialog,
       
   198     ESipItcSendRequestInDialogAndUpdateRefresh,
       
   199     ESipItcClientReadyToReceive, // Asynchronous receive
       
   200     ESipItcClientReceiveSipMessage, // Synchronous receive
       
   201     ESipItcClientCancelReceive,      
       
   202     ESipItcConnectionReadyToReceive, // Asynchronous receive
       
   203     ESipItcConnectionReceiveSipMessage, // Synchronous receive
       
   204     ESipItcConnectionCancelReceive,
       
   205     ESipItcRefreshConnection,
       
   206     ESipItcGetConnectionError
       
   207     };	
       
   208 
       
   209 
       
   210 // Indexes used in IPC parameter array passed between C/S-client and C/S-server
       
   211 //
       
   212 // NOTE: Remember to update the types in comments if the actual types change.
       
   213 //
       
   214 enum TSipItcArguments
       
   215 	{
       
   216     ESipItcArgConnectionState = 0,         // Type: TInt
       
   217     ESipItcArgInternalState = 0,           // Type: TInt
       
   218     ESipItcArgRefreshInterval = 0,         // Type: TInt
       
   219     ESipItcArgMessageHeaders = 0,          // Type: TDes8/TDesC8
       
   220     ESipItcArgRealm = 0,                   // Type: TDes8/TDesC8
       
   221     ESipItcArgAuthenticationMechanism = 0, // Type: TDesC8
       
   222     ESipItcArgSockOpt = 0,                 // Type: TSIPSockOpt
       
   223     ESipItcArgLocalAddr = 0,               // Type: TInetAddr
       
   224     ESipItcArgLocalTag = 0,                // Type: TDesC8
       
   225     ESipItcArgHttpDigestObserverType = 0,  // Type: TSipHttpDigestObserverType
       
   226     ESipItcArgSecurityHandling = 0,        // Type: TBool
       
   227     ESipItcArgAppUid = 1,                  // Type: TInt
       
   228     ESipItcArgIds = 1,                     // Type: TSIPIds
       
   229     ESipItcArgNextHop = 1,                 // Type: TDesC8    
       
   230     ESipItcArgBufSizes = 2,                // Type: TSIPMessageBufSizes
       
   231     ESipItcArgMessageContent = 2,          // Type: TDes8/TDesC8
       
   232     ESipItcArgSockOptDes = 2,              // Type: TDesC8
       
   233     ESipItcArgCredentials = 2,             // Type: TDesC8
       
   234     ESipItcArgSubSessionHandle = 3         // Type: TInt
       
   235 	};
       
   236 
       
   237 #endif // SIPCLIENTSERVER_H
       
   238 
       
   239 // End of File