2 * Copyright (c) 2003-2006 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: VPN API definitions.
27 #ifndef __VPNAPIDEFS_H__
28 #define __VPNAPIDEFS_H__
30 // VPN API error codes
31 // NOTE! The error code values below MUST be kept in sync with
32 // the corresponding error code values defined together by
33 // vpnapi/data/vpnerr.rss and vpnapi/data/vpnerr.ra
34 const TInt KVpnErrNoPolicyFile = -5229;
35 const TInt KVpnErrNoPolicyInfoFile = -5230;
36 const TInt KVpnErrInvalidPolicyFile = -5231;
37 const TInt KVpnErrPolicyNotFound = -5232;
38 const TInt KVpnErrInvalidCaCertFile = -5233;
39 const TInt KVpnErrPeerCertFileMissing = -5234;
40 const TInt KVpnErrInvalidUserCertFile = -5235;
41 const TInt KVpnErrInvalidUserPrivKeyFile = -5236;
42 const TInt KVpnErrImportOngoing = -5237;
43 const TInt KVpnErrPwdChangeOngoing = -5238;
44 const TInt KVpnErrPolicyCountChanged = -5239;
45 const TInt KVpnErrPolicySizeChanged = -5239;
47 // Deprecated error code definitions
48 const TInt KVpnErrCaCertFileMissing = -5233;
49 const TInt KVpnErrUserCertFileMissing = -5235;
50 const TInt KVpnErrUserPrivKeyFileMissing = -5236;
53 const TInt KMaxIdLength = 50;
54 const TInt KMaxNameLength = 128;
55 const TInt KMaxVersionLength = 16;
56 const TInt KMaxDescriptionLength = 256;
59 typedef TBuf<KMaxIdLength> TVpnPolicyId;
60 typedef TBuf8<KMaxIdLength> TVpnPolicyId8;
62 typedef TBuf<KMaxNameLength> TVpnPolicyName;
67 enum TPolicyUsageStatus
69 EUsageStatusUnknown = 1, ///< For some reason, the usage status could not be found out
70 EUsageStatusUnused, ///< The policy is neither assigned to any IAP nor active
71 EUsageStatusAssignedToIap, ///< The policy is assigned to one or more IAPs but is not currently active
72 EUsageStatusActive, ///< The policy is assigned to one or more IAPs and is currently active
80 EPkiStatusUnknown = 1, ///< For some reason, the PKI status could not be found out
81 EPkiStatusReady, ///< The PKI information is present
82 EPkiStatusNoCert, ///< At least one of the required certificates is missing
83 EPkiStatusCertExpired, ///< At least one of the required certificates has expired
84 EPkiStatusCertNotValidYet, ///< At least one of the required certificates is not yet valid
88 * A compact policy information structure
92 TVpnPolicyId iId; ///< Policy ID
93 TVpnPolicyName iName; ///< Policy name
97 * A more detailed policy information structure
99 struct TVpnPolicyDetails : public TVpnPolicyInfo
101 TBuf<KMaxDescriptionLength> iDescription; ///< A short description of the policy
102 TBuf<KMaxVersionLength> iVersion; ///< The version number of the policy
103 TBuf<KMaxNameLength> iIssuerName; ///< The name of the organization or person who created the policy
104 TBuf<KMaxNameLength> iContactInfo; ///< The phone number, email address, URL or other kind of issuer contact information
105 TPolicyUsageStatus iUsageStatus; ///< Policy usage status
106 TPolicyPkiStatus iPkiStatus; ///< Policy usage status
109 _LIT(KHiddenPolicyIndicator, "<<HIDDEN>>");