All Classes Files Functions Variables Pages
TrafficPolicy.idl
Go to the documentation of this file.
1 /**
2  * @file TrafficPolicy.idl
3  * @brief API for Traffic Policy
4  * @version 5
5  */
6 
7 #import <kerio/web/idl/SharedStructures.idl>
8 #import <common.idl>
9 #import <Interfaces.idl>
10 #import <Users.idl>
11 #import <IpServices.idl>
12 
13 module webadmin {
14 
15 /**
16  * Mode of source address NAT
17  */
18 enum SourceNatMode {
19  NatDefault,
20  NatInterface,
21  NatIpAddress
22 };
23 
24 /**
25  * Balancing mode of source address NAT
26  */
27 enum NatBalancing {
28  BalancingPerHost,
29  BalancingPerConnection
30 };
31 
32 /**
33  * IP version
34  */
35 enum TrafficIpVersion {
36  Ipv4,
37  Ipv6,
38  IpAll
39 };
40 
41 /**
42  * Type of interface in rule
43  */
44 enum InterfaceConditionType {
45  InterfaceInternet,
46  InterfaceTrusted,
47  InterfaceGuest,
48  InterfaceSelected
49 };
50 
51 /**
52  * One interface in rule
53  */
55  InterfaceConditionType type;
56  InterfaceType interfaceType; ///< @see InterfaceManager, used values: Ethernet, Ras
57  IdReference selectedInterface; ///< invalid - interface is no more in the configuration (nothing)
58  boolean enabled; ///< interface is present, but disabled/down
59 };
60 
61 /**
62  * Type of VPN in rule
63  */
64 enum VpnConditionType {
65  IncomingClient,
66  SelectedTunnel,
67  AllTunnels
68 };
69 
70 /**
71  * One VPN in rule
72  */
73 struct VpnCondition {
74  VpnConditionType type;
75  IdReference tunnel; ///< invalid - tunnel is no more in the configuration (nothing)
76  boolean enabled; ///< tunnel is present, but disabled/down
77 };
78 
79 /**
80  * Type of Traffic Entity in TrafficEntityList
81  */
82 enum TrafficEntityType {
83  TrafficEntityHost,
84  TrafficEntityNetwork,
85  TrafficEntityRange,
86  TrafficEntityAddressGroup,
87  TrafficEntityPrefix,
88  TrafficEntityInterface,
89  TrafficEntityVpn,
90  TrafficEntityUsers
91 };
92 
93 /**
94  * One entity if there is list of entities in rule's Source or Destination
95  */
96 struct TrafficEntity {
97 
98  TrafficEntityType type;
99 
100  /*@{ host */
101  string host; /**< name or IP or Prefix */
102  /*@}*/
103 
104  /*@{ network, range */
105  kerio::web::IpAddress addr1; /**< network/from, e.g. 192.168.0.0 */
106  kerio::web::IpAddress addr2; /**< mask/to, e.g. 255.255.0.0 */
107  /*@}*/
108 
109  /*@{ IP address group */
110  IdReference addressGroup;
111  /*@}*/
112 
113  /*@{ interface */
114  InterfaceCondition interfaceCondition;
115  /*@}*/
116 
117  /*@{ vpn */
118  VpnCondition vpnCondition;
119  /*@}*/
120 
121  /*@{ users */
122  UserConditionType userType; ///< @see Users.idl, used values: AuthenticatedUsers, SelectedUsers
123  UserReference user; ///< @see UserManager
124  /*@}*/
125 };
126 
127 /**
128  * All entities in rule's Source or Destination
129  */
130 typedef sequence<TrafficEntity> TrafficEntityList;
131 
132 /**
133  * Rule's Source or Destination
134  */
136  RuleConditionType type;
137  boolean firewall;
138  TrafficEntityList entities;
139 };
140 
141 /**
142  * One service if there is list of services
143  */
145  boolean definedService;
146  IpServiceReference service;
147  long protocol; ///< TCP - 6, UDP - 17 @see IpServiceManager
148  PortCondition port;
149 };
150 
151 /**
152  * List of services
153  */
154 typedef sequence<TrafficServiceEntity> TrafficServiceEntityList;
155 
156 /**
157  * Rule's Services properties
158  */
160  RuleConditionType type;
161  TrafficServiceEntityList entries;
162 };
163 
164 /**
165  * List of logEnabled values, order:
166  * 1. logPackets
167  * 2. logConnections
168  */
169 typedef sequence<boolean> LogEnabled;
170 
171 /**
172  * One traffic policy rule
173  */
174 struct TrafficRule {
175  kerio::web::KId id;
176 
177  /*@{ name */
178  boolean enabled;
179  string name;
180  string description;
181  string color;
182 
183  /*@{ rule Sourc, Destination */
184  TrafficCondition source;
185  TrafficCondition destination;
186 
187  /*@{ service */
188  TrafficService service;
189 
190  /*@{ IP verison */
191  TrafficIpVersion ipVersion;
192 
193  /*@{ action */
194  RuleAction action; ///< @see common; possible values: allow, deny, drop
195  LogEnabled logEnabled;
196  boolean graphEnabled;
198 
199  /*@{ NAT IP version */
200  boolean natIpv4Only;
201 
202  /*@{ source NAT */
203  boolean enableSourceNat;
204  SourceNatMode natMode;
205  boolean allowReverseConnection;
206  /*@{ properties of NatDefault */
207  NatBalancing balancing;
208  /*@{ properties of NatInterface */
209  IdReference natInterface;
210  boolean allowFailover;
211  /*@{ properties of NatIpAddress */
212  string ipAddress;
213  string ipv6Address;
214 
215  /*@{ destination NAT */
216  boolean enableDestinationNat;
217  string translatedHost;
218  string translatedIpv6Host;
219  kerio::web::OptionalLong translatedPort;
220 
221  /*@{ valid time */
222  IdReference validTimeRange;
223 
224  /*@{ protocol inspector */
225  string inspector; ///< name of Protocol Inspector, @see InspectorManager + values: default, none
226 
227  TimeSpan lastUsed; ///< last time when connection matched, read-only
228 
229 };
230 
231 /**
232  * All traffic policy rules
233  */
234 typedef sequence<TrafficRule> TrafficRuleList;
235 
237  kerio::web::IpAddress sourceIp;
238  kerio::web::IpAddress destinationIp;
239  long port;
240 };
241 
242 /**
243  * Manager for Traffic Policy
244  */
245 interface TrafficPolicy {
246  /**
247  * Get the list of Traffic Policy rules
248  *
249  * @param list - list of Traffic Policy rules
250  * @param totalItems - count of all rules in Traffic Policy
251  * @throws kerio::web::ApiException \n
252  * -32001 Session expired. - "The user is not logged in." \n
253  * 1004 Access denied. - "Insufficient rights to perform the requested operation."
254  */
255  void get(out TrafficRuleList list, out long totalItems);
256 
257  /**
258  * Stores the list of Traffic Policy rules
259  *
260  * @param errors - list of errors \n
261  * 8002 Database error. - "Unable to modify rule '%1'." \n
262  * 8002 Database error. - "Unable to create rule '%1'." \n
263  * 8002 Database error. - "Unable to delete rule '%1'."
264  * @param rules - list of Traffic Policy rules
265  * @param defaultRule - properties of default rule
266  * @throws kerio::web::ApiException \n
267  * -32001 Session expired. - "The user is not logged in." \n
268  * 1004 Access denied. - "Insufficient rights to perform the requested operation."
269  */
270  void set(out kerio::web::ErrorList errors, in TrafficRuleList rules, in TrafficRule defaultRule);
271 
272  /**
273  * Return list of overlappped rules
274  * @param collisions - list of collisions
275  * @throws kerio::web::ApiException on error:
276  * -32001 Session expired. - "The user is not logged in."
277  * 1004 Access denied. - "Insufficient rights to perform the requested operation."
278  */
279  void getCollisions(out CollisionList list);
280 
281  /**
282  * Get properties of default rule
283  *
284  * @param rule - properties of default rule
285  * @throws kerio::web::ApiException \n
286  * -32001 Session expired. - "The user is not logged in." \n
287  * 1004 Access denied. - "Insufficient rights to perform the requested operation."
288  */
289  void getDefaultRule(out TrafficRule rule);
290 
291  /**
292  * Return all rules, that matches given criteria in time, when this method was called.
293  *
294  * @param list - IDs of rules
295  * @param condition - Filter parameters. Empty parameter (0 for numbers) in condition means 'any'.
296  * @throws kerio::web::ApiException \n
297  * -32001 Session expired. - "The user is not logged in." \n
298  * 1004 Access denied. - "Insufficient rights to perform the requested operation." \n
299  * 8001 Invalid parameters. - "Invalid parameters."
300  */
301  void filterRules(out kerio::web::KIdList idList, in TrafficPolicyFilter condition);
302 
303  /**
304  * Normalize TrafficEntity.
305  *
306  * @param input - TrafficEntity
307  * @throws kerio::web::ApiException \n
308  * -32001 Session expired. - "The user is not logged in." \n
309  * 1004 Access denied. - "Insufficient rights to perform the requested operation." \n
310  * 8001 Invalid parameters. - "Invalid parameters."
311  */
312  void normalizeTrafficEntity(out kerio::web::ErrorList errors, out TrafficEntity result, in TrafficEntity input);
313 };
314 
315 }; //webadmin
Definition: IpServices.idl:14
Definition: TrafficPolicy.idl:73
boolean enabled
interface is present, but disabled/down
Definition: TrafficPolicy.idl:58
Common Kerio Control structures, enums and types.
kerio::web::IpAddress addr1
Definition: TrafficPolicy.idl:105
API for Kerio Control Users.
IdReference tunnel
invalid - tunnel is no more in the configuration (nothing)
Definition: TrafficPolicy.idl:75
string host
Definition: TrafficPolicy.idl:101
Definition: TrafficPolicy.idl:174
Definition: TrafficPolicy.idl:159
Definition: Users.idl:91
kerio::web::IpAddress addr2
Definition: TrafficPolicy.idl:106
Definition: common.idl:67
string inspector
name of Protocol Inspector,
Definition: TrafficPolicy.idl:225
Definition: common.idl:28
TimeSpan lastUsed
last time when connection matched, read-only
Definition: TrafficPolicy.idl:227
InterfaceType interfaceType
Definition: TrafficPolicy.idl:56
Definition: TrafficPolicy.idl:245
Definition: SharedStructures.idl:298
Definition: TrafficPolicy.idl:54
API for services administration.
IdReference selectedInterface
invalid - interface is no more in the configuration (nothing)
Definition: TrafficPolicy.idl:57
UserConditionType userType
Definition: TrafficPolicy.idl:122
Definition: IpServices.idl:42
long protocol
TCP - 6, UDP - 17.
Definition: TrafficPolicy.idl:147
Definition: TrafficPolicy.idl:144
UserReference user
Definition: TrafficPolicy.idl:123
Definition: TrafficPolicy.idl:135
API for network interfaces administration.
Definition: TrafficPolicy.idl:236
RuleAction action
Definition: TrafficPolicy.idl:194
Definition: TrafficPolicy.idl:96
Definition: Accounting.idl:11
boolean enabled
tunnel is present, but disabled/down
Definition: TrafficPolicy.idl:76