All Classes Files Functions Variables Pages
Interfaces.idl
Go to the documentation of this file.
1 /**
2  * @file Interfaces.idl
3  * @brief API for network interfaces administration
4  * @version 2
5  */
6 #import <common.idl>
7 #import <Notifications.idl>
8 
9 module webadmin {
10 
11 enum InterfaceType {
12  Ethernet,
13  Ras,
14  DialIn,
15  VpnServer,
16  VpnTunnel
17 };
18 
19 enum InterfaceModeType {
20  InterfaceModeManual,
21  InterfaceModeAutomatic,
22  InterfaceModeLinkLocal
23 };
24 
25 enum InterfaceEncapType {
26  InterfaceEncapNative,
27  InterfaceEncapPppoe
28 };
29 
30 enum ConnectivityType {
31  Persistent,
32  DialOnDemand,
33  Failover,
34  LoadBalancing
35 };
36 
37 enum RasType {
38  PPPoE,
39  PPTP,
40  L2TP
41 };
42 
44  ConnectivityType mode;
45 
46  /*@{ Failover, LoadBalancing */
47  kerio::web::OptionalString probeHosts;
48  /*@}*/
49 
50  /*@{ Failover */
51  boolean reconnectTunnelsWhenPrimaryGoesBack;
52  boolean lazyFailover;
53  /*@}*/
54 };
55 
56 enum MppeType {
57  MppeDisabled,
58  MppeEnabled,
59  Mppe128Enabled
60 };
61 
62 struct RasConfig {
63  boolean dead;
64  string entryName;
65 
66  boolean useOwnCredentials;
67  CredentialsConfig credentials;
69 
70  kerio::web::OptionalEntity connectTime;
71  kerio::web::OptionalEntity noConnectTime;
72 
73  boolean bdScriptEnabled;
74  boolean adScriptEnabled;
75  boolean bhScriptEnabled;
76  boolean ahScriptEnabled;
77 
78  RasType rasType;
79  string pppoeIfaceId;
80  string server;
81 
82  boolean papEnabled;
83  boolean chapEnabled;
84  boolean mschapEnabled;
85  boolean mschapv2Enabled;
86  MppeType mppe;
87  boolean mppeStateful;
88 };
89 
90 struct VpnRoute {
91  kerio::web::KId id;
92 
93  boolean enabled;
94  string description;
95  kerio::web::IpAddress network;
96  kerio::web::IpAddress mask;
97 };
98 
99 typedef sequence<VpnRoute> VpnRouteList;
100 
102  /*@{ Kerio VPN */
103  boolean kerioVpnEnabled;
104  IdReference kerioVpnCertificate;
105  long port;
106  boolean defaultRoute;
107  /*@}*/
108 
109  /*@{ IPsec VPN */
110  boolean ipsecVpnEnabled;
111  boolean mschapv2Enabled;
112  IdReference ipsecVpnCertificate;
113  string cipherIke; ///< read-only
114  string cipherEsp; ///< read-only
115  boolean useCertificate;
117  /*@}*/
118 
119  VpnRouteList routes;
120 
121  kerio::web::IpAddress network;
122  kerio::web::IpAddress mask;
123 
124  boolean localDns;
125  kerio::web::IpAddress primaryDns;
126  kerio::web::IpAddress secondaryDns;
127 
128  boolean autodetectDomainSuffix;
129  string domainSuffix;
130 
131  boolean localWins;
132  kerio::web::IpAddress primaryWins;
133  kerio::web::IpAddress secondaryWins;
134 };
135 
137  IdReference certificate;
138  string value;
139 };
140 
141 typedef sequence<CertificateDn> CertificateDnList;
142 
144  string defaultLocalIdValue;
145  string defaultCipherIke;
146  string defaultCipherEsp;
147  CertificateDnList certificateDnValues; ///< values for IpsecPeerIdCertDn, based on choosen certificate
148 };
149 
151 VpnType type;
152  kerio::web::OptionalString peer; ///< hostname or ip, passive if disabled
153  VpnRouteList localRoutes; ///< IPsec only
154  VpnRouteList remoteRoutes;
155 
156  /*@{ Kerio VPN */
157  string remoteFingerprint;
158  boolean useRemoteAutomaticRoutes;
159  boolean useRemoteCustomRoutes;
160  /*@}*/
161 
162  /*@{ IPsec VPN */
163  kerio::web::OptionalString psk; ///< use certificate if disabled
164  IdReference certificate; ///< empty ID for "Remote certificate"
165  string cipherIke;
166  string cipherEsp;
167 
168  string localIdValue;
169  string remoteIdValue;
170  boolean useLocalAutomaticRoutes;
171  boolean useLocalCustomRoutes;
172  /*@}*/
173 
174  /*@}*/
175 };
176 
177 enum InterfaceGroupType {
178  Other,
179  Guest,
180  Vpn,
181  Trusted,
182  Internet
183 };
184 
185 enum InterfaceStatusType {
186  Up,
187  Down,
188  Connecting,
189  Disconnecting,
190  CableDisconnected,
191  Error,
192  Backup
193 };
194 
195 enum FailoverRoleType {
196  None,
197  Primary,
198  Secondary
199 };
200 
201 enum BandwidthUnit {
202  BandwidthUnitBits,
203  BandwidthUnitBytes,
204  BandwidthUnitKilobits,
205  BandwidthUnitKiloBytes,
206  BandwidthUnitMegabits,
207  BandwidthUnitMegaBytes,
208  BandwidthUnitPercent
209 };
210 
211 /* mode-dependent data */
213  /*@{ Failover */
214  FailoverRoleType failoverRole;
215  /*@}*/
216  /*@{ OnDemand */
217  boolean onDemand;
218  /*@}*/
219  /*@{ Balancing */
220  kerio::web::OptionalLong loadBalancingWeight;
221  /*@}*/
222 };
223 
225  boolean deletable;
226  boolean dialable;
227  boolean hangable;
228  boolean virtualSwitch;
229  boolean wifi;
230  boolean vlan;
231 };
232 
234  boolean localizable;
235  string fixedMessage;
236  kerio::web::LocalizableMessage localizableMessage;
237 };
238 
240  kerio::web::IpAddress ip; // can't name it ipAddress :-(
241  kerio::web::IpAddress subnetMask;
242 };
243 
244 typedef sequence<IpAddressMask> IpAddressMaskList;
245 
247  Ip6Address ip;
248  long prefixLength;
249 };
250 
251 typedef sequence<Ip6AddressMask> Ip6AddressMaskList;
252 
253 struct Interface {
254 
255  boolean enabled; /* engine on linux + vpn */
256  InterfaceType type;
257  kerio::web::StoreStatus status;
258 
259  boolean dhcpServerEnabled;
260 
261  /*@{ grid columns. they are not common subset from interface types */
262  kerio::web::KId id;
263  InterfaceGroupType group;
264  string name;
265 
266  InterfaceStatusType linkStatus;
267  DetailsConfig details;
268 
269  string mac;
270  string systemName;
271 
272  /*@{ IPv4 */
273  boolean ip4Enabled; /* engine on linux */
274  InterfaceModeType mode; /* engine on linux */
275 
276  kerio::web::IpAddress ip;
277  kerio::web::IpAddress subnetMask;
278  IpAddressMaskList secondaryAddresses;
279 
280  boolean dnsAutodetected;
281  string dnsServers; /* ipaddr;ipaddr */
282  boolean gatewayAutodetected;
283  kerio::web::IpAddress gateway;
284  /*@}*/
285 
286  /*@{ IPv6 */
287  boolean ip6Enabled; /* engine on linux */
288  InterfaceModeType ip6Mode; /* engine on linux */
289 
290  Ip6AddressMaskList ip6Addresses;
291  Ip6Address linkIp6Address; /* single (currently) link-local addr, read-only */
292 
293  kerio::web::IpAddress ip6Gateway;
294  boolean routedIp6PrefixAutodetected;
295  string routedIp6Prefix;
296  /*@}*/
297 
298  /*@}*/
299 
300  InterfaceConnectivityParameters connectivityParameters;
301 
302  /*@{ engine on linux */
303  InterfaceEncapType encap;
304  kerio::web::OptionalLong mtuOverride;
305  kerio::web::OptionalString macOverride;
306  /*@}*/
307 
308  /* medium-dependent data */
309 
310  /*@{ RAS */
311  RasConfig ras;
312  /*@}*/
313 
314  /*@{ VPN Server */
315  VpnServerConfig server;
316  /*@}*/
317 
318  /*@{ VPN Tunnel */
319  VpnTunnelConfig tunnel;
320  /*@}*/
321 
322  InterfaceFlags flags;
323 
324  /*@{ engine on HW Box */
325  kerio::web::KIdList ports;
326  boolean stp;
327  /*@}*/
328 
329  /*@{ for flags.vlan */
330  long vlanId;
331  /*@}*/
332 
333  /*@{ for flags.wifi */
334  kerio::web::KId ssidId;
335  /*@}*/
336 };
337 
338 typedef sequence<Interface> InterfaceList;
339 
340 enum ConnectivityStatus {
341  ConnectivityOk,
342  ConnectivityChecking,
343  ConnectivityError
344 };
345 
346 typedef sequence<kerio::web::KIdList> IpCollisionList;
347 
348 enum WifiBandType {
349  WifiBandA,
350  WifiBandBG,
351  WifiBandAC
352 };
353 
354 enum WifiEncryptionType {
355  WifiEncryptionDisabled,
356  WifiEncryptionWpaPsk,
357  WifiEncryptionWpaEnt,
358  WifiEncryptionWpa2Psk,
359  WifiEncryptionWpa2Ent
360 };
361 
363  string name;
364  string name80211n;
365  long value;
366 };
367 
368 typedef sequence<WifiChannelInfo> WifiChannelList;
369 
371  WifiBandType band;
372  WifiChannelList channels;
373 };
374 
375 typedef sequence<WifiModeChannelConfig> WifiModeChannelList;
376 
378  kerio::web::KId country; ///< Country code in ISO_3166-1_alpha-2
379  WifiModeChannelList channels;
380 };
381 
382 typedef sequence<WifiCountryConfig> WifiCountryList;
383 
385  kerio::web::KId id;
386  boolean enabled;
387  PortAssignmentType assignment; ///< PortAssignmentSwitch or PortAssignmentStandalone
388  string ssid;
389  InterfaceGroupType group;
390  WifiEncryptionType encryption;
391  string wpaPassword; ///< valid only for WifiEncryptionWpaPsk and WifiEncryptionWpa2Psk
392 };
393 
394 typedef sequence<WifiSsidConfig> WifiSsidConfigList;
395 
396 struct WifiConfig {
397  kerio::web::KId country; ///< Country code in ISO_3166-1_alpha-2
398  WifiBandType band;
399  boolean band80211n;
400  long channel;
401  WifiSsidConfigList ssids;
402 };
403 
404 interface Interfaces {
405 
406  /**
407  * Obtain list of interfaces
408  * @throws kerio::web::ApiException \n
409  * -32001 Session expired. - "The user is not logged in." \n
410  * 1004 Access denied. - "Insufficient rights to perform the requested operation."
411  * @note: when sorting is set to 'name' column, interfaces are first sorted by 'type' and then by 'name'. \n
412  * When sortByGroup is true and sorting is 'name', sorting order is 'group', 'type', 'name'
413  */
414  void get(out InterfaceList list, out long totalItems, in kerio::web::SearchQuery query, in boolean sortByGroup);
415 
416  /**
417  * Creates new interface (Only one interface can be created at a time) - VPN Tunnel or RAS on Ape/Box
418  *
419  * @param errors - list of errors \n
420  * 1001 Already exists. - "A tunnel with fingerprint %1 already exists!" \n
421  * 1001 Already exists. - "Tunnel %1 already exists!" \n
422  * 1001 Already exists. - "Interface %1 already exists."
423  * @param result - list of IDs assigned to each item
424  * @param list - list of interfaces desired to be created (must contain exactly one item)
425  * @throws kerio::web::ApiException \n
426  * -32001 Session expired. - "The user is not logged in." \n
427  * 1004 Access denied. - "Insufficient rights to perform the requested operation." \n
428  * 8000 Internal error. - "Internal error."
429  */
430  void create(out kerio::web::ErrorList errors, out kerio::web::CreateResultList result, in InterfaceList list);
431 
432  /**
433  * Update interface's details
434  * @param errors - list of errors \n
435  * 1001 Already exists. - "A tunnel with fingerprint %1 already exists!" \n
436  * 1001 Already exists. - "Tunnel %1 already exists!"
437  * @param ids - list of IDs of interfaces to modify
438  * @param details - details to set to every interface lister in ids parameter
439  * @throws kerio::web::ApiException \n
440  * -32001 Session expired. - "The user is not logged in." \n
441  * 1004 Access denied. - "Insufficient rights to perform the requested operation."
442  */
443  void set(out kerio::web::ErrorList errors, in kerio::web::KIdList ids, in Interface details);
444 
445  /**
446  * Delete Interface configuration - VPN Tunnel or RAS on Ape/Box
447  * @throws kerio::web::ApiException \n
448  * -32001 Session expired. - "The user is not logged in." \n
449  * 1004 Access denied. - "Insufficient rights to perform the requested operation."
450  */
451  void remove(out kerio::web::ErrorList errors, in kerio::web::KIdList ids);
452 
453  /**
454  * Checks collision of all interfaces IP + VPN Server network
455  * @throws kerio::web::ApiException \n
456  * -32001 Session expired. - "The user is not logged in." \n
457  * 1004 Access denied. - "Insufficient rights to perform the requested operation."
458  */
459  void checkIpCollision(out IpCollisionList collisions);
460 
461  /**
462  * Checks Link Load Balancing warnings
463  * @throws kerio::web::ApiException \n
464  * -32001 Session expired. - "The user is not logged in." \n
465  * 1004 Access denied. - "Insufficient rights to perform the requested operation."
466  */
467  void getWarnings(out NotificationTypeList warnings);
468 
469  /**
470  * Returns Connectivity config values
471  * @param config - Connectivity config values
472  * @throws kerio::web::ApiException \n
473  * -32001 Session expired. - "The user is not logged in." \n
474  * 1004 Access denied. - "Insufficient rights to perform the requested operation."
475  */
476  void getConnectivityConfig(out ConnectivityConfig config);
477 
478  /**
479  * Stores Connectivity config values
480  * @param config - Connectivity config values
481  * @throws kerio::web::ApiException \n
482  * -32001 Session expired. - "The user is not logged in." \n
483  * 1004 Access denied. - "Insufficient rights to perform the requested operation."
484  */
485  void setConnectivityConfig(in ConnectivityConfig config);
486 
487  /**
488  * Initiates testing of connectivity
489  * @throws kerio::web::ApiException \n
490  * -32001 Session expired. - "The user is not logged in." \n
491  * 1004 Access denied. - "Insufficient rights to perform the requested operation."
492  */
493  void startConnectivityTest();
494 
495  /**
496  * Returns progress of connectivity test
497  *
498  * startTest() has to be called before call of this function, otherwise status is instantly ConnectivityError.
499  * @param status - actual status
500  * @throws kerio::web::ApiException \n
501  * -32001 Session expired. - "The user is not logged in." \n
502  * 1004 Access denied. - "Insufficient rights to perform the requested operation."
503  */
504  void connectivityTestStatus(out ConnectivityStatus status);
505 
506  /**
507  * Cancels testing of connectivity nad sets status to ConnectivityError
508  * @throws kerio::web::ApiException \n
509  * -32001 Session expired. - "The user is not logged in." \n
510  * 1004 Access denied. - "Insufficient rights to perform the requested operation."
511  */
512  void cancelConnectivityTest();
513 
514  /**
515  * Dial interface. Works only for disconnected RAS. Action is taken immediatelly, without apply.
516  * @throws kerio::web::ApiException \n
517  * -32001 Session expired. - "The user is not logged in." \n
518  * 1000 Operation failed. - "Unable to dial interface." \n
519  * 1004 Access denied. - "You have no rights to dial this line."
520  */
521  void dial(in kerio::web::KId id);
522 
523  /**
524  * Hangup interface. Works only for connected RAS. Action is taken immediatelly, without apply.
525  * @throws kerio::web::ApiException \n
526  * -32001 Session expired. - "The user is not logged in." \n
527  * 1000 Operation failed. - "Unable to hang-up interface." \n
528  * 1004 Access denied. - "You have no rights to hang-up this line."
529  */
530  void hangup(in kerio::web::KId id);
531 
532  /**
533  * Returns (defaults/read-only) values to be displayed on VPN Tunnel IPsec dialog as peer ID config
534  *
535  * @throws kerio::web::ApiException \n
536  * -32001 Session expired. - "The user is not logged in." \n
537  * 1004 Access denied. - "You have no rights to hang-up this line."
538  */
539  void getIpsecPeerIdConfig(out IpsecPeerIdConfig config);
540 
541  /**
542  * Returns WiFi configuration
543  * @param config - WiFi configuration
544  * @throws kerio::web::ApiException \n
545  * -32001 Session expired. - "The user is not logged in." \n
546  * 1004 Access denied. - "Insufficient rights to perform the requested operation."
547  */
548  void getWifiConfig(out WifiConfig config);
549 
550  /**
551  * Sets WiFi configuration
552  * @param config - WiFi configuration
553  * @param errors - list of errors for SSID \n
554  * 8001 Invalid params. - "The WPA pre-shared key has invalid format." \n
555  * @throws kerio::web::ApiException \n
556  * -32001 Session expired. - "The user is not logged in." \n
557  * 1004 Access denied. - "Insufficient rights to perform the requested operation." \n
558  * 8000 Internal error. - "Internal error." \n
559  * 8001 Invalid params. - "Invalid parameters." \n
560  * 8001 Invalid params. - "Invalid country code." \n
561  * 8001 Invalid params. - "Selected channel doesn't match selected country and mode."
562  */
563  void setWifiConfig(out kerio::web::ErrorList errors, in WifiConfig config);
564 
565  /**
566  * Returns Country list with allowed channel configuration
567  * @param countries - Country list
568  * @throws kerio::web::ApiException \n
569  * -32001 Session expired. - "The user is not logged in." \n
570  * 1004 Access denied. - "Insufficient rights to perform the requested operation." \n
571  * 8000 Internal error. - "Internal error."
572  */
573  void getWifiCountries(out WifiCountryList countries);
574 
575  /**
576  * write changes cached in manager to configuration
577  * @param errors - list of errors \n
578  * 1001 Already exists. - "The same IP address is assigned to several interfaces." \n
579  * 1001 Already exists. - "The VPN server address range collides with interface %1." \n
580  * 1001 Already exists. - "Interface %1 already exists." \n
581  * 8001 Invalid params. - "Just one interface must be set for primary connection." \n
582  * 8001 Invalid params. - "Just one interface must be set for secondary connection." \n
583  * 8001 Invalid params. - "Just one interface is allowed to be set for dial on demand." \n
584  * 8001 Invalid params. - "Unable to add/modify tunnel %1, wrong parameters." \n
585  * 8002 Database error. - "Unable to add/modify tunnel %1." \n
586  * 8002 Database error. - "Unable to delete the tunnel." \n
587  * @param revertTimeout how many seconds to wait for confirmation until revert is performed
588  * @throws kerio::web::ApiException \n
589  * -32001 Session expired. - "The user is not logged in." \n
590  * 1004 Access denied. - "Insufficient rights to perform the requested operation."
591  */
592  void apply(out kerio::web::ErrorList errors, in long revertTimeout);
593 
594  /**
595  * discard changes cached in manager
596  * @throws kerio::web::ApiException \n
597  * -32001 Session expired. - "The user is not logged in." \n
598  * 1004 Access denied. - "Insufficient rights to perform the requested operation."
599  */
600  void reset();
601 };
602 
603 
604 }; //webadmin
Definition: Interfaces.idl:233
string cipherIke
read-only
Definition: Interfaces.idl:113
Definition: Interfaces.idl:43
Definition: Interfaces.idl:384
Definition: Interfaces.idl:239
string cipherEsp
read-only
Definition: Interfaces.idl:114
IdReference certificate
empty ID for "Remote certificate"
Definition: Interfaces.idl:164
Common Kerio Control structures, enums and types.
Definition: SharedStructures.idl:139
Definition: Interfaces.idl:143
Definition: Interfaces.idl:212
string wpaPassword
valid only for WifiEncryptionWpaPsk and WifiEncryptionWpa2Psk
Definition: Interfaces.idl:391
Definition: Interfaces.idl:362
kerio::web::OptionalString peer
hostname or ip, passive if disabled
Definition: Interfaces.idl:152
Definition: Interfaces.idl:377
CertificateDnList certificateDnValues
values for IpsecPeerIdCertDn, based on choosen certificate
Definition: Interfaces.idl:147
Definition: SharedStructures.idl:151
Pending Messages API.
Definition: common.idl:28
PortAssignmentType assignment
PortAssignmentSwitch or PortAssignmentStandalone.
Definition: Interfaces.idl:387
Definition: SharedStructures.idl:298
Definition: Interfaces.idl:150
kerio::web::KId country
Country code in ISO_3166-1_alpha-2.
Definition: Interfaces.idl:397
Definition: common.idl:18
VpnRouteList localRoutes
IPsec only.
Definition: Interfaces.idl:153
kerio::web::OptionalString psk
use certificate if disabled
Definition: Interfaces.idl:163
Definition: Interfaces.idl:136
Definition: Interfaces.idl:246
Definition: Interfaces.idl:396
Definition: Interfaces.idl:101
Definition: Interfaces.idl:253
Definition: Interfaces.idl:90
Definition: SharedStructures.idl:307
Definition: Interfaces.idl:404
Definition: Accounting.idl:11
Definition: SharedStructures.idl:289
kerio::web::KId country
Country code in ISO_3166-1_alpha-2.
Definition: Interfaces.idl:378
Definition: Interfaces.idl:62
Definition: Interfaces.idl:224
Definition: Interfaces.idl:370