|
1 /* |
|
2 * Copyright (c) 2003-2006 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: VPN API definitions. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 /** |
|
20 @file |
|
21 @released |
|
22 @publishedPartner |
|
23 |
|
24 VPN API definitions |
|
25 */ |
|
26 |
|
27 #ifndef __VPNAPIDEFS_H__ |
|
28 #define __VPNAPIDEFS_H__ |
|
29 |
|
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; |
|
46 |
|
47 // Deprecated error code definitions |
|
48 const TInt KVpnErrCaCertFileMissing = -5233; |
|
49 const TInt KVpnErrUserCertFileMissing = -5235; |
|
50 const TInt KVpnErrUserPrivKeyFileMissing = -5236; |
|
51 |
|
52 // Other constants |
|
53 const TInt KMaxIdLength = 50; |
|
54 const TInt KMaxNameLength = 128; |
|
55 const TInt KMaxVersionLength = 16; |
|
56 const TInt KMaxDescriptionLength = 256; |
|
57 |
|
58 // Type definitions |
|
59 typedef TBuf<KMaxIdLength> TVpnPolicyId; |
|
60 typedef TBuf8<KMaxIdLength> TVpnPolicyId8; |
|
61 |
|
62 typedef TBuf<KMaxNameLength> TVpnPolicyName; |
|
63 |
|
64 /** |
|
65 * Policy usage status |
|
66 */ |
|
67 enum TPolicyUsageStatus |
|
68 { |
|
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 |
|
73 }; |
|
74 |
|
75 /** |
|
76 * Policy PKI status |
|
77 */ |
|
78 enum TPolicyPkiStatus |
|
79 { |
|
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 |
|
85 }; |
|
86 |
|
87 /** |
|
88 * A compact policy information structure |
|
89 */ |
|
90 struct TVpnPolicyInfo |
|
91 { |
|
92 TVpnPolicyId iId; ///< Policy ID |
|
93 TVpnPolicyName iName; ///< Policy name |
|
94 }; |
|
95 |
|
96 /** |
|
97 * A more detailed policy information structure |
|
98 */ |
|
99 struct TVpnPolicyDetails : public TVpnPolicyInfo |
|
100 { |
|
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 |
|
107 }; |
|
108 |
|
109 _LIT(KHiddenPolicyIndicator, "<<HIDDEN>>"); |
|
110 |
|
111 #endif |