4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
34 * This file contains the private interface to IP to configure ILB in
35 * the system. Note that this is not a supported interface, and is
36 * subject to be changed without notice. User level apps should instead
37 * use the libilb library to interface with ILB.
40 /* ioctl cmds to IP to configure ILB */
59 /* Supported load balancing algorithm type */
61 ILB_ALG_IMPL_ROUNDROBIN
= 1,
63 ILB_ALG_IMPL_HASH_IP_SPORT
,
64 ILB_ALG_IMPL_HASH_IP_VIP
67 /* Supported load balancing method */
69 ILB_TOPO_IMPL_DSR
= 1,
71 ILB_TOPO_IMPL_HALF_NAT
74 /* Max ILB rule name length */
75 #define ILB_RULE_NAMESZ 20
77 /* Max kstat server name length */
78 #define ILB_SERVER_NAMESZ 20
80 /* Rule destroy/enable/disable command struct */
83 char name
[ILB_RULE_NAMESZ
];
87 /* Flags for rule creation command */
88 /* these are echoed in lib/libilb/common/libilb.h - please keep in sync */
89 #define ILB_RULE_ENABLED 0x1
90 #define ILB_RULE_STICKY 0x2
91 #define ILB_RULE_ALLRULES 0x4
92 #define ILB_RULE_BUSY 0x8
94 /* Rule creation/retrieval command struct */
97 char name
[ILB_RULE_NAMESZ
];
100 char vip_itf
[LIFNAMSIZ
];
102 in_port_t min_port
; /* In network byte order */
104 ilb_algo_impl_t algo
;
105 ilb_topo_impl_t topo
;
106 char servers_itf
[LIFNAMSIZ
];
107 in6_addr_t nat_src_start
;
108 in6_addr_t nat_src_end
;
110 in6_addr_t sticky_mask
;
111 uint32_t conn_drain_timeout
; /* Time value is in seconds */
113 uint32_t sticky_expiry
;
116 /* Get number of servers command struct */
119 char name
[ILB_RULE_NAMESZ
];
121 } ilb_num_servers_cmd_t
;
123 /* Get number of rules command struct */
127 } ilb_num_rules_cmd_t
;
129 /* Get all rule names command struct */
133 /* buf size is (num_names * ILB_RULE_NAMESZ) */
134 char buf
[ILB_RULE_NAMESZ
];
135 } ilb_rule_names_cmd_t
;
137 /* Flags for ilb_server_info_t */
138 #define ILB_SERVER_ENABLED 0x1
140 /* Struct to represent a backend server for add/list command */
142 char name
[ILB_SERVER_NAMESZ
];
144 in_port_t min_port
; /* In network byte order */
147 int err
; /* In return, non zero value indicates error */
150 /* Add/list servers command struct */
153 char name
[ILB_RULE_NAMESZ
];
154 uint32_t num_servers
;
155 ilb_server_info_t servers
[1];
156 } ilb_servers_info_cmd_t
;
159 * Struct to represent a backend server for delete/enable/disable
164 int err
; /* In return, non zero value indicates error */
167 /* Delete/enable/disable a server command struct */
170 char name
[ILB_RULE_NAMESZ
];
171 uint32_t num_servers
;
172 ilb_server_arg_t servers
[1];
176 * Flags for listing NAT/persistence table entries
178 * ILB_LIST_BEGIN: start from the beginning of the table
179 * ILB_LIST_CONT: start from the last reply
180 * ILB_LIST_END: on return, this flag indicates the end of the table
182 #define ILB_LIST_BEGIN 0x1
183 #define ILB_LIST_CONT 0x2
184 #define ILB_LIST_END 0x4
186 #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
194 in6_addr_t in_global
;
195 in6_addr_t out_local
;
196 in6_addr_t out_global
;
198 in_port_t in_local_port
;
199 in_port_t in_global_port
;
200 in_port_t out_local_port
;
201 in_port_t out_global_port
;
204 int64_t last_access_time
;
208 /* List NAT table entries command struct */
213 ilb_nat_entry_t entries
[1];
214 } ilb_list_nat_cmd_t
;
217 char rule_name
[ILB_RULE_NAMESZ
];
221 } ilb_sticky_entry_t
;
223 /* List sticky table entries command struct */
228 ilb_sticky_entry_t entries
[1];
229 } ilb_list_sticky_cmd_t
;
231 #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
239 #endif /* _INET_ILB_H */