1/* config.h--SASL configuration for win32 2 * Ryan Troll 3 */ 4/* 5 * Copyright (c) 1998-2004 Carnegie Mellon University. All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions 9 * are met: 10 * 11 * 1. Redistributions of source code must retain the above copyright 12 * notice, this list of conditions and the following disclaimer. 13 * 14 * 2. Redistributions in binary form must reproduce the above copyright 15 * notice, this list of conditions and the following disclaimer in 16 * the documentation and/or other materials provided with the 17 * distribution. 18 * 19 * 3. The name "Carnegie Mellon University" must not be used to 20 * endorse or promote products derived from this software without 21 * prior written permission. For permission or any other legal 22 * details, please contact 23 * Office of Technology Transfer 24 * Carnegie Mellon University 25 * 5000 Forbes Avenue 26 * Pittsburgh, PA 15213-3890 27 * (412) 268-4387, fax: (412) 268-7395 28 * tech-transfer@andrew.cmu.edu 29 * 30 * 4. Redistributions of any form whatsoever must retain the following 31 * acknowledgment: 32 * "This product includes software developed by Computing Services 33 * at Carnegie Mellon University (http://www.cmu.edu/computing/)." 34 * 35 * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO 36 * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 37 * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE 38 * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 39 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN 40 * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING 41 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 42 */ 43 44#ifndef CONFIG_H 45#define CONFIG_H 46 47#include <stddef.h> 48 49/* winsock2 includes windows.h. 50 Note that we can't include both winsock.h and winsock2.h as 51 they conflict */ 52#include <winsock2.h> 53 54/* Our package */ 55#define PACKAGE "cyrus-sasl" 56 57/* Our version */ 58#define VERSION "2.1.26" 59 60/* Visual Studio supports prototypes */ 61#define PROTOTYPES 1 62 63#ifndef HAVE_CADDR_T 64#ifndef caddr_t 65typedef unsigned char *caddr_t; 66#define HAVE_CADDR_T 1 67#endif 68#endif 69 70#ifndef _INTPTR_T_DEFINED 71 72#ifdef _WIN64 73typedef __int64 intptr_t; 74#else 75typedef int intptr_t; 76#endif 77 78#endif 79 80/* Registry key that contains the locations of the plugins */ 81#define SASL_ROOT_KEY "SOFTWARE\\Carnegie Mellon\\Project Cyrus\\SASL Library" 82#define SASL_PLUGIN_PATH_ATTR "SearchPath" 83#define SASL_CONF_PATH_ATTR "ConfFile" 84 85/* : This should probably be replaced with a call to a function 86 : that gets the proper value from Registry */ 87#define SASL_DB_PATH "c:\\CMU\\sasldb2" 88 89/* what db package are we using? */ 90/* #undef SASL_GDBM */ 91/* #undef SASL_NDBM */ 92#define SASL_BERKELEYDB 1 93 94/* which mechs can we link staticly? */ 95#define STATIC_ANONYMOUS 1 96#define STATIC_CRAMMD5 1 97#define STATIC_DIGESTMD5 1 98#define STATIC_SCRAM 1 99#define STATIC_GSSAPIV2 1 100/* #undef STATIC_KERBEROS4 */ 101#define STATIC_LOGIN 1 102/* #undef STATIC_MYSQL */ 103#define STATIC_OTP 1 104#define STATIC_PLAIN 1 105#define STATIC_SASLDB 1 106#define STATIC_SRP 1 107 108/* ------------------------------------------------------------ */ 109 110/* Things that are fetched via autoconf under Unix 111 */ 112#define HAVE_MEMCPY 1 113 114#define PLUGINDIR "C:\\CMU\\bin\\sasl2" 115#define CONFIGDIR "C:\\CMU\\bin\\sasl2" 116 117/* Windows calls these functions something else 118 */ 119#define strcasecmp stricmp 120#define snprintf _snprintf 121#define strncasecmp strnicmp 122 123#define MAXHOSTNAMELEN 1024 124 125/* ------------------------------------------------------------ */ 126 127#define WITHOUT_NANA 128#define L_DEFAULT_GUARD (0) 129#define I_DEFAULT_GUARD (0) 130#define I(foo) 131#define VL(foo) printf foo; 132#define VLP(foo,bar) 133 134/* we're not gcc */ 135#define __attribute__(foo) 136 137/* : Same as in tpipv6.h */ 138#ifndef HAVE_SOCKLEN_T 139typedef int socklen_t; 140#endif /* HAVE_SOCKLEN_T */ 141 142/* If we expect to run on XP and later, we have IPv6 support natively */ 143#if TARGET_WIN_SYSTEM >= 51 144#if !defined(_WIN32_WINNT) 145/* This forces the inclusion of OS supported functions, with no fallback */ 146#define _WIN32_WINNT 0x0510 147#endif 148#endif 149 150#if defined(_MSC_VER) && (_MSC_VER >= 1300) 151/* The following two defines will prevent our own definitions below */ 152#define HAVE_GETADDRINFO 153#define HAVE_GETNAMEINFO 154#define HAVE_STRUCT_SOCKADDR_STORAGE 155/* Unless _WIN32_WINNT > 0x0500, Ws2tcpip.h will try to find OS provided 156 getaddrinfo at runtime. It will fallback to Microsoft emulation, 157 if not found */ 158#include <Ws2tcpip.h> 159#endif 160 161#if !defined(HAVE_STRUCT_SOCKADDR_STORAGE) && !defined(_SS_MAXSIZE) 162#define _SS_MAXSIZE 128 /* Implementation specific max size */ 163#define _SS_PADSIZE (_SS_MAXSIZE - sizeof (struct sockaddr)) 164 165struct sockaddr_storage { 166 struct sockaddr ss_sa; 167 char __ss_pad2[_SS_PADSIZE]; 168}; 169# define ss_family ss_sa.sa_family 170#endif /* !HAVE_STRUCT_SOCKADDR_STORAGE */ 171 172#ifndef AF_INET6 173/* Define it to something that should never appear */ 174#define AF_INET6 AF_MAX 175#endif 176 177#ifndef HAVE_GETADDRINFO 178#define getaddrinfo sasl_getaddrinfo 179#define freeaddrinfo sasl_freeaddrinfo 180#define gai_strerror sasl_gai_strerror 181#endif 182 183#ifndef HAVE_GETNAMEINFO 184#define getnameinfo sasl_getnameinfo 185#endif 186 187#if !defined(HAVE_GETNAMEINFO) || !defined(HAVE_GETADDRINFO) 188#include "gai.h" 189#endif 190 191#ifndef AI_NUMERICHOST /* support glibc 2.0.x */ 192#define AI_NUMERICHOST 4 193#define NI_NUMERICHOST 2 194#define NI_NAMEREQD 4 195#define NI_NUMERICSERV 8 196#endif 197 198#include <time.h> 199 200/* Keep in sync with SleepyCat definitions */ 201typedef int int32_t; 202typedef __int64 int64_t; 203#ifdef _WIN64 204typedef int64_t ssize_t; 205#else 206typedef int32_t ssize_t; 207#endif 208 209#define HIER_DELIMITER '\\' 210 211#ifndef sleep 212#define sleep(seconds) plug_sleep(seconds) 213unsigned int plug_sleep(unsigned int seconds); 214#endif 215 216#endif /* CONFIG_H */ 217