/*
* 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
*/
/*
*/
#ifndef _ILBD_H
#define _ILBD_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdio.h>
#include <ucred.h>
#include <pwd.h>
#include <priv.h>
#include <stdarg.h>
#include <syslog.h>
#include <libscf.h>
#include <libintl.h>
#include <locale.h>
#include <libinetutil.h>
#include <auth_list.h>
#include <bsm/adt_event.h>
/* Max name and value length for scf properties */
/* Different events ILBD is interested in. */
typedef enum {
} ilbd_event_t;
typedef enum {
typedef enum {
typedef enum {
typedef enum {
/*
* All user struct pointer passed to port_associate() should have the first
* field as ilbd_event_t. The following struct can be used to find the
* event.
*/
typedef struct {
typedef struct {
typedef struct ilbd_srv {
} ilbd_srv_t;
typedef struct ilbd_sg {
} ilbd_sg_t;
typedef struct ilbd_rule {
} ilbd_rule_t;
/*
* Health check related definitions
*/
/* Default health check probe program provided */
/* Command name (argv[0]) passed to ilb_probe to indicate a ping test */
/* Use the first character of the rule's hcname to decide if rule has HC. */
/* Type of probe test */
typedef enum {
/* Struct representing a hc object in ilbd */
typedef struct {
/* Short hand for the fields inside ilb_hc_info_t */
} ilbd_hc_t;
struct ilbd_hc_srv_s;
/*
* Struct representing a hc rule object
*
* hcr_link: list linkage
* hcr_rule: pointer to the ilbd rule object
* hcr_servers: list of servers of this rule
*/
typedef struct {
struct ilbd_hc_srv_s;
/*
* Struct representing a event of the probe process
*
* ihp_ev: the event type, which is ILBD_EVENT_PROBE
* ihp_srv: pointer to the hc server object
* ihp_pid: pid of the probe process
* ihp_done: is ilbd done reading the output of the probe process
*/
typedef struct {
/*
* ilbd_hc_srv_t state
*
* ihd_hc_def_pinging: the default ping should be run
* ihd-hc_probing: the probe process should be started
*/
enum ilbd_hc_state {
};
/*
* Struct representing a server associated with a hc object
*
* shc_srv_link: list linkage
* shc_hc: pointer to the hc object
* shc_hc_rule: pointer to the hc rule object
* shc_sg_srv: pointer to the server group object
* shc_tid: timeout ID
* shc_cur_cnt: number of times the hc probe has been run
* shc_fail_cnt: number of consecutive probe failure
* shc_status: health status
* shc_rtt: rtt (in micro sec) to the backend server
* shc_lasttimer: last time a probe sequence is executed
* shc_nexttime: next time a probe sequence is executed
* shc_state: hc probe state
* shc_child_pid: pid of the probe process
* shc_child_fd: fd to the output of the probe process
* shc_ev: event object of the probe process
* shc_ev_port: event port of the event object
*/
typedef struct ilbd_hc_srv_s {
int shc_child_fd;
int shc_ev_port;
/*
* Structure for holding audit server and servergroup event
* data. Not all events use all members of the structure.
*/
typedef struct audit_sg_event_data {
/* Struct to store client info */
typedef struct {
int cli_sd;
char *cli_pw_buf;
void i_setup_sg_hlist(void);
void i_setup_rule_hlist(void);
void logperror(const char *);
ucred_t *);
ucred_t *);
ucred_t *);
int ilbd_get_num_krules(void);
ilbd_sg_t *i_find_sg_byname(const char *);
ucred_t *);
ucred_t *);
ucred_t *);
boolean_t is_debugging_on(void);
void ilbd_enable_debug(void);
/* Logging routine and macros */
void ilbd_log(int, const char *, ...);
/* Health check manipulation routines */
void i_ilbd_setup_hc_list(void);
ilbd_hc_t *ilbd_get_hc(const char *);
int);
const ilb_sg_srv_t *);
const ilb_sg_srv_t *);
/* Health check timer routines */
void ilbd_hc_probe_return(int, int, int, ilbd_hc_probe_event_t *);
void ilbd_hc_timer_init(int, ilbd_timer_event_obj_t *);
void ilbd_hc_timeout(void);
/* Show NAT info routines */
size_t *);
void ilbd_show_nat_cleanup(void);
/* Show sticky info routines */
size_t *);
void ilbd_show_sticky_cleanup(void);
const char *, void *);
void ilbd_scf_str_to_ip(int, char *, struct in6_addr *);
char *);
int ilbd_scf_limit(int);
void ilbd_algo_to_str(ilb_algo_t, char *);
void ilbd_topo_to_str(ilb_topo_t, char *);
#ifdef __cplusplus
}
#endif
#endif /* _ILBD_H */