/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Generic SASL plugin utility functions
* Rob Siemborski
* $Id: plugin_common.h,v 1.16 2003/04/07 16:03:43 rjs3 Exp $
*/
/*
* Copyright (c) 1998-2003 Carnegie Mellon University. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* distribution.
*
* 3. The name "Carnegie Mellon University" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For permission or any other legal
* details, please contact
* Office of Technology Transfer
* Carnegie Mellon University
* 5000 Forbes Avenue
* Pittsburgh, PA 15213-3890
* (412) 268-4387, fax: (412) 268-7395
* tech-transfer@andrew.cmu.edu
*
* 4. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by Computing Services
* at Carnegie Mellon University (http://www.cmu.edu/computing/)."
*
* CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
* THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE
* FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef _PLUGIN_COMMON_H_
#define _PLUGIN_COMMON_H_
#include <config.h>
#ifndef macintosh
#ifdef WIN32
# include <winsock.h>
#else
# include <netdb.h>
#endif /* WIN32 */
#endif /* macintosh */
#include <sasl.h>
#include <saslutil.h>
#include <saslplug.h>
#ifdef WIN32
#else
#define PLUG_API extern
#endif
#define SASL_CLIENT_PLUG_INIT( x ) \
extern sasl_client_plug_init_t x##_client_plug_init; \
int maxversion, int *out_version, \
int *plugcount) { \
}
#define SASL_SERVER_PLUG_INIT( x ) \
extern sasl_server_plug_init_t x##_server_plug_init; \
int maxversion, int *out_version, \
int *plugcount) { \
}
#define SASL_AUXPROP_PLUG_INIT( x ) \
extern sasl_auxprop_init_t x##_auxprop_plug_init; \
int maxversion, int *out_version, \
sasl_auxprop_plug_t **plug, \
const char *plugname) {\
}
#define SASL_CANONUSER_PLUG_INIT( x ) \
extern sasl_canonuser_init_t x##_canonuser_plug_init; \
int maxversion, int *out_version, \
const char *plugname) {\
}
/* note: msg cannot include additional variables, so if you want to
* do a printf-format string, then you need to call seterror yourself */
#ifndef MEMERROR
#ifdef _SUN_SDK_
#else
#endif /* _SUN_SDK_ */
#endif
#ifndef PARAMERROR
#ifdef _SUN_SDK_
#else
#endif /* _SUN_SDK_ */
#endif
#ifndef SASLINT_H
typedef struct buffer_info
{
char *data;
#endif
#ifdef _INTEGRATED_SOLARIS_
void **h,
#endif /* _INTEGRATED_SOLARIS_ */
const char *user_prompt, const char *user_def,
const char *auth_prompt, const char *auth_def,
const char *pass_prompt, const char *pass_def,
const char *echo_chal,
const char *echo_prompt, const char *echo_def,
const char *realm_chal,
const char *realm_prompt, const char *realm_def);
void *context,
int (*decode_pkt)(void *context,
const char *serverFQDN, const char *input);
#ifdef _INTEGRATED_SOLARIS_
typedef void reg_sun_t(void *);
#define REG_PLUG( X, Y ) { \
unsigned int l; \
(const char **)&func, &l); \
(*func)(Y); \
}
#endif /* _INTEGRATED_SOLARIS_ */
#endif /* _PLUGIN_COMMON_H_ */