ilb.h revision dbed73cbda2229fd1aa6dc5743993cae7f0a7ee9
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _INET_ILB_H
#define _INET_ILB_H
#ifdef __cplusplus
extern "C" {
#endif
/*
* This file contains the private interface to IP to configure ILB in
* the system. Note that this is not a supported interface, and is
* subject to be changed without notice. User level apps should instead
* use the libilb library to interface with ILB.
*/
/* ioctl cmds to IP to configure ILB */
typedef enum {
} ilb_cmd_t;
/* Supported load balancing algorithm type */
typedef enum {
/* Supported load balancing method */
typedef enum {
ILB_TOPO_IMPL_DSR = 1,
/* Max ILB rule name length */
#define ILB_RULE_NAMESZ 20
/* Max kstat server name length */
#define ILB_SERVER_NAMESZ 20
typedef struct {
char name[ILB_RULE_NAMESZ];
/* Flags for rule creation command */
#define ILB_RULE_ENABLED 0x1
#define ILB_RULE_STICKY 0x2
#define ILB_RULE_ALLRULES 0x4
#define ILB_RULE_BUSY 0x8
typedef struct {
char name[ILB_RULE_NAMESZ];
char servers_itf[LIFNAMSIZ];
/* Get number of servers command struct */
typedef struct {
char name[ILB_RULE_NAMESZ];
/* Get number of rules command struct */
typedef struct {
/* Get all rule names command struct */
typedef struct {
/* buf size is (num_names * ILB_RULE_NAMESZ) */
char buf[ILB_RULE_NAMESZ];
/* Flags for ilb_server_info_t */
#define ILB_SERVER_ENABLED 0x1
typedef struct {
char name[ILB_SERVER_NAMESZ];
int err; /* In return, non zero value indicates error */
typedef struct {
char name[ILB_RULE_NAMESZ];
/*
* command
*/
typedef struct {
int err; /* In return, non zero value indicates error */
typedef struct {
char name[ILB_RULE_NAMESZ];
/*
* Flags for listing NAT/persistence table entries
*
* ILB_LIST_BEGIN: start from the beginning of the table
* ILB_LIST_CONT: start from the last reply
* ILB_LIST_END: on return, this flag indicates the end of the table
*/
#define ILB_LIST_BEGIN 0x1
#define ILB_LIST_CONT 0x2
#define ILB_LIST_END 0x4
#pragma pack(4)
#endif
typedef struct {
/* List NAT table entries command struct */
typedef struct {
typedef struct {
char rule_name[ILB_RULE_NAMESZ];
/* List sticky table entries command struct */
typedef struct {
#pragma pack()
#endif
#ifdef __cplusplus
}
#endif
#endif /* _INET_ILB_H */