/*
* 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 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _DCS_H
#define _DCS_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
#include <poll.h>
#include <signal.h>
#include "remote_cfg.h"
#include "rdr_param_types.h"
/*
* Header files for per-socket IPsec
*/
/*
* The IPsec socket option struct, from ipsec(7P):
*
* typedef struct ipsec_req {
* uint_t ipsr_ah_req; AH request
* uint_t ipsr_esp_req; ESP request
* uint_t ipsr_self_encap_req; Self-Encap request
* uint8_t ipsr_auth_alg; Auth algs for AH
* uint8_t ipsr_esp_alg; Encr algs for ESP
* uint8_t ipsr_esp_auth_alg; Auth algs for ESP
* } ipsec_req_t;
*
* The -a option sets the ipsr_auth_alg field. Allowable arguments
* are "none", "md5", or "sha1". The -e option sets the ipsr_esp_alg
* field. Allowable arguments are "none", "des", or "3des". "none"
* is the default for both options. The -u option sets the ipsr_esp_auth_alg
* field. Allowable arguments are the same as -a.
*
* The arguments ("md5", "des", etc.) are named so that they match
* kmd(1m)'s accepted arguments which are listed on the SC in
*/
/*
* A type to hold the command line argument string used to select a
* particular authentication header (AH) or encapsulating security
* payload (ESP) algorithm and the ID used for that algorithm when
* filling the ipsec_req_t structure which is passed to
* setsockopt(3SOCKET).
*/
typedef struct dcs_alg {
char *arg_name;
} dcs_alg_t;
/*
* Debugging
*/
#ifdef DCS_DEBUG
/*
* supported options for debug version:
*
* -d control the amount of debugging
* -S control standalone mode
* -s control maximum active sessions
* -a control the IPsec AH algorithm ("none", "md5", or "sha1")
* -e control the IPsec ESP encr algorithm ("none", "des", or "3des")
* -u control the IPsec ESP auth algorithm ("none", "md5", or "sha1")
* -l control the use of libdscp for endpoint authentication.
*/
#else /* DCS_DEBUG */
/*
* supported options for non-debug version:
*
* -s control maximum active sessions
* -a control the IPsec AH algorithm ("none", "md5", or "sha1")
* -e control the IPsec ESP encr algorithm ("none", "des", or "3des")
* -u control the IPsec ESP auth algorithm ("none", "md5", or "sha1")
* -l control the use of libdscp for endpoint authentication.
*/
#endif /* DCS_DEBUG */
/*
* Error codes that are used internally in the DCS. These error codes
* are mapped to the strings listed to the right of each error code
* as a comment.
*/
typedef enum {
/*
* Network Errors:
*/
/* port 665 */
/*
* Session Errors:
*/
/*
* DR Request Errors:
*/
/* established */
/*
* General Errors:
*/
} dcs_err_code;
/*
* Public error codes. These error codes are returned to the
* client in the event of a fatal error. Since the DCS can
* report either a libcfgadm or internal error, there is a
* possiblity of conflicting error codes. To avoid this, the
* DCS error codes are offset by a constant value. However,
* 0 will always indicate that no errors have occurred.
*/
typedef enum {
DCS_OK = 0,
} dcs_err_t;
/*
* DCS states. These states are the states that the DCS moves
* through as it processes a DR request. The order represents
* the transitions performed in a successful operation.
*/
typedef enum {
/*
* Message Contents
*/
typedef struct message {
} message_t;
/*
* Session information
*/
typedef struct session {
unsigned long id;
unsigned short major_version;
unsigned short minor_version;
unsigned long random_req;
unsigned long random_resp;
int fd;
} session_t;
/*
* Message Direction
*/
typedef enum {
/*
* Globals
*/
extern int standalone;
extern ulong_t max_sessions;
extern int use_libdscp;
/*
* From dcs.c:
*/
/*
* From dcs_ses.c:
*/
void ses_abort_enable(void);
void ses_abort_disable(void);
void abort_handler(void);
int ses_setlocale(char *locale);
long curr_ses_id(void);
/*
* From dcs_msg.c:
*/
const char *dcs_strerror(int err_code);
/*
* If the dcs_debug global variable is not set, no
* debugging messages will be logged.
*/
#ifdef __cplusplus
}
#endif
#endif /* _DCS_H */