andya 2004/04/28 08:06:47 Modified: jk/native2/server/dsapi jk_dsapi_plugin.c dsapifilter.h config.h Log: Removed notesapi dependencies and NO_CAPI switch. Revision Changes Path 1.9 +6 -29 jakarta-tomcat-connectors/jk/native2/server/dsapi/jk_dsapi_plugin.c Index: jk_dsapi_plugin.c =================================================================== RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/dsapi/jk_dsapi_plugin.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- jk_dsapi_plugin.c 29 Mar 2004 14:13:36 -0000 1.8 +++ jk_dsapi_plugin.c 28 Apr 2004 15:06:46 -0000 1.9 @@ -49,25 +49,16 @@ #include "jk_worker.h" #include "apr_general.h" -#ifndef NO_CAPI -/* Domino stuff */ -#include <global.h> -#include <addin.h> -#else -#include <stdarg.h> -#define NOERROR 0 -#endif - /* Domino DSAPI filter definitions */ #include "dsapifilter.h" +int JK_METHOD jk2_logger_domino_factory(jk_env_t *env, jk_pool_t *pool, jk_bean_t *result, const char *type, const char *name); + #if defined(TESTING) #define LOGGER "logger.printf" int JK_METHOD jk2_logger_printf_factory(jk_env_t *env, jk_pool_t *pool, jk_bean_t *result, const char *type, const char *name); -#elif defined(WIN32) -#define LOGGER "logger.win32" #else -#define LOGGER "logger.file" +#define LOGGER "logger.domino" #endif #ifdef WIN32 @@ -184,22 +175,6 @@ return 0; } -#ifdef NO_CAPI -/* Alternative to the Domino function */ -static void AddInLogMessageText(char *msg, unsigned short code, ...) { - va_list ap; - - if (code != NOERROR) { - printf("Error %d: ", code); - } - - va_start(ap, code); - vprintf(msg, ap); - va_end(ap); - printf("\n"); -} -#endif - #ifdef _DEBUG static void _printf(const char *msg, ...) { char buf[512]; /* dangerous fixed size buffer */ @@ -1118,6 +1093,8 @@ */ #ifdef TESTING env->registerFactory(env, "logger.printf", jk2_logger_printf_factory); +#else + env->registerFactory(env, "logger.domino", jk2_logger_domino_factory ); #endif jkb = env->createBean2(env, env->globalPool, LOGGER, ""); 1.2 +195 -317 jakarta-tomcat-connectors/jk/native2/server/dsapi/dsapifilter.h Index: dsapifilter.h =================================================================== RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/dsapi/dsapifilter.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- dsapifilter.h 13 Nov 2003 17:10:56 -0000 1.1 +++ dsapifilter.h 28 Apr 2004 15:06:47 -0000 1.2 @@ -1,329 +1,207 @@ -/*-------------------------------------------------------------------- +/* + * Copyright 1999-2001,2004 The Apache Software Foundation. * - * File: dsapifilter.h + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * Copyright (c)1999 Iris Associates + * http://www.apache.org/licenses/LICENSE-2.0 * - *-------------------------------------------------------------------*/ - -#if !defined(DSAPIFILTER_H) -#define DSAPIFILTER_H - -#ifdef __cplusplus -extern "C" -{ -#endif - -/*--- - * Types and Defines + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ -#define kInterfaceVersion 2 -#define kMaxFilterDesc 255 - - typedef unsigned char LMBCS; - - typedef enum - { - kFilterNotHandled = 0, - kFilterHandledRequest = 1, - kFilterHandledEvent = 2, - kFilterError = 3 - } - FilterReturnCode; - -/*-- - * Filter interface - */ - -/*--- -* events to register for -*/ - typedef enum - { - kFilterRawRequest = 0x01, - kFilterParsedRequest = 0x02, - kFilterAuthUser = 0x04, - kFilterUserNameList = 0x08, - kFilterMapURL = 0x10, - kFilterResponse = 0x20, - kFilterRawWrite = 0x40, - kFilterEndRequest = 0x80, - kFilterAny = 0xFF - } - EventFlags; - -/*--- - * filter initialization data - */ - typedef struct - { - unsigned int serverFilterVersion; - unsigned int appFilterVersion; - unsigned int eventFlags; - unsigned int initFlags; - char filterDesc[kMaxFilterDesc + 1]; - } - FilterInitData; - -/*--- - * request line structure - */ - typedef struct - { - unsigned int method; - char *URL; - char *version; - char *userName; - char *password; - unsigned char *clientCert; - unsigned int clientCertLen; - char *contentRead; - unsigned int contentReadLen; - } - FilterRequest; - -/*--- - * filter context data included in every call to filter - */ - typedef struct _FilterContext - { - unsigned int contextSize; - unsigned int revision; - void *serverContext; - unsigned int serverReserved; - unsigned int securePort; - void *privateContext; - - int (*GetRequest) (struct _FilterContext *context, FilterRequest * request, - unsigned int *errID); - - int (*GetRequestContents) (struct _FilterContext *context, char **contents, - unsigned int *errID); - - int (*GetServerVariable) (struct _FilterContext * context, char *name, void *buffer, - unsigned int bufferSize, unsigned int *errID); - - int (*WriteClient) (struct _FilterContext * context, char *buffer, unsigned int bufferLen, - unsigned int reserved, unsigned int *errID); - - void *(*AllocMem) (struct _FilterContext * context, unsigned int size, - unsigned int reserved, unsigned int *errID); - - int (*ServerSupport) (struct _FilterContext * context, unsigned int funcType, void *data1, - void *data2, unsigned int other, unsigned int *errID); - } - FilterContext; - - typedef unsigned int (*FilterInitFuncType) (FilterInitData * initData); - typedef unsigned int (*FilterEventFuncType) (FilterContext * context, unsigned int eventType, - void *eventData, unsigned int *errID); - typedef unsigned int (*FilterTermFuncType) (unsigned int); - -/*--- - * request methods - */ - typedef enum - { - kRequestNone = 0, - kRequestHEAD = 1, - kRequestGET = 2, - kRequestPOST = 3, - kRequestPUT = 4, - kRequestDELETE = 5 - } - RequestMethod; - -/*--- - * server support function types - */ - typedef enum - { - kWriteResponseHeaders = 1 - } - ServerSupportTypes; - -/*--- - * 'data1' for server support function 'kWriteResponseHeaders' - */ - typedef struct - { - unsigned int responseCode; - char *reasonText; - char *headerText; - } - FilterResponseHeaders; - -/*--- - * raw request (headers not processed yet) - */ - typedef struct - { - unsigned int requestMethod; - - int (*GetAllHeaders) (FilterContext * context, char **headers, unsigned int *errID); - - int (*GetHeader) (FilterContext * context, char *name, char *buffer, - unsigned int bufferSize, unsigned int *errID); +/*************************************************************************** + * Description: DSAPI plugin for Lotus Domino * + * Author: Andy Armstrong <[EMAIL PROTECTED]> * + * Version: $Revision$ * + ***************************************************************************/ - int (*SetHeader) (FilterContext * context, char *name, char *value, unsigned int *errID); +#ifndef __dsapifilter_h +#define __dsapifilter_h - int (*AddHeader) (FilterContext * context, char *header, unsigned int *errID); - - unsigned int reserved; - } - FilterRawRequest; - -/*--- - * parsed request - */ - typedef struct - { - unsigned int requestMethod; - - int (*GetAllHeaders) (FilterContext * context, char **headers, unsigned int *errID); - - int (*GetHeader) (FilterContext * context, char *name, char *buffer, - unsigned int bufferSize, unsigned int *errID); - - unsigned int reserved; - } - FilterParsedRequest; - -/*--- - * URL map - */ - typedef struct - { - const char *url; - char *pathBuffer; - unsigned int bufferSize; - unsigned int mapType; - } - FilterMapURL; - -/*--- - * URL map types - */ - typedef enum - { - kURLMapUnknown = 0, - kURLMapPass = 1, - kURLMapExec = 2, - kURLMapRedirect = 3, - kURLMapService = 4, - kURLMapDomino = 5 - } - FilterULMapTypes; - -/*--- - * user authentication - */ - typedef struct - { - LMBCS *userName; - LMBCS *password; - unsigned char *clientCert; - unsigned int clientCertLen; - unsigned int authFlags; - unsigned int preAuthenticated; - unsigned int foundInCache; - unsigned int authNameSize; - LMBCS *authName; - unsigned int authType; - - int (*GetUserNameList) (FilterContext * context, LMBCS * buffer, unsigned int bufferSize, - unsigned int *numNames, unsigned int reserved, unsigned int *errID); - - int (*GetHeader) (FilterContext * context, char *name, char *buffer, - unsigned int bufferSize, unsigned int *errID); - } - FilterAuthenticate; - -/*--- - * user authentication types - */ - typedef enum - { - kNotAuthentic = 0, - kAuthenticBasic = 1, - kAuthenticClientCert = 2 - } - FilterAuthenticationTypes; - -/*--- - * authentication configuration flags - */ - typedef enum - { - kAuthAllowBasic = 1, - kAuthAllowAnonymous = 2, - kAuthAllowSSLCert = 4, - kAuthAllowSSLBasic = 8, - kAuthAllowSSLAnonymous = 16, - kAuthRedirectToSSL = 32 - } - FilterAuthConfigFlags; - -/*--- - * user name list - */ - typedef struct - { - const LMBCS *userName; - - int (*GetUserNameList) (FilterContext * context, LMBCS * buffer, unsigned int bufferSize, - unsigned int *numNames, unsigned int reserved, unsigned int *errID); - - int (*PopulateUserNameList) (FilterContext * context, LMBCS * buffer, - unsigned int bufferSize, unsigned int *numNames, - unsigned int reserved, unsigned int *errID); - - int (*AddGroupsToList) (FilterContext * context, LMBCS * groupNames, - unsigned int numGroupNames, unsigned int reserved, - unsigned int *errID); - - int (*RemoveGroupsFromList) (FilterContext * context, unsigned int reserved, - unsigned int *errID); - - unsigned int reserved; - } - FilterUserNameList; - -/*--- - * request response - */ - typedef struct - { - unsigned int responseCode; - char *reasonText; - - int (*GetAllHeaders) (FilterContext * context, char **headers, unsigned int *errID); - - int (*GetHeader) (FilterContext * context, char *name, char *buffer, - unsigned int bufferSize, unsigned int *errID); +#define kInterfaceVersion 2 +#define kMaxFilterDesc 255 - int (*SetHeader) (FilterContext * context, char *name, char *value, unsigned int *errID); +typedef enum { + kFilterNotHandled = 0, + kFilterHandledRequest = 1, + kFilterHandledEvent = 2, + kFilterError = 3 +} FilterReturnCode; + +typedef enum { + kFilterRawRequest = 0x01, + kFilterParsedRequest = 0x02, + kFilterAuthUser = 0x04, + kFilterUserNameList = 0x08, + kFilterMapURL = 0x10, + kFilterResponse = 0x20, + kFilterRawWrite = 0x40, + kFilterEndRequest = 0x80, + kFilterAny = 0xFF +} EventFlags; + +typedef struct { + unsigned int serverFilterVersion; + unsigned int appFilterVersion; + unsigned int eventFlags; + unsigned int initFlags; + char filterDesc[kMaxFilterDesc + 1]; +} FilterInitData; + +typedef struct { + unsigned int method; + char *URL; + char *version; + char *userName; + char *password; + unsigned char *clientCert; + unsigned int clientCertLen; + char *contentRead; + unsigned int contentReadLen; +} FilterRequest; + +typedef struct _FilterContext FilterContext; + +struct _FilterContext { + unsigned int contextSize; + unsigned int revision; + void *serverContext; + unsigned int serverReserved; + unsigned int securePort; + void *privateContext; + + int (*GetRequest)(FilterContext *context, FilterRequest * request, unsigned int *errID); + int (*GetRequestContents)(FilterContext *context, char **contents, unsigned int *errID); + int (*GetServerVariable)(FilterContext *context, char *name, void *buffer, unsigned int bufferSize, unsigned int *errID); + int (*WriteClient)(FilterContext *context, char *buffer, unsigned int bufferLen, unsigned int reserved, unsigned int *errID); + void *(*AllocMem)(FilterContext *context, unsigned int size, unsigned int reserved, unsigned int *errID); + int (*ServerSupport)(FilterContext *context, unsigned int funcType, void *data1, void *data2, unsigned int other, unsigned int *errID); +}; + +typedef enum { + kRequestNone = 0, + kRequestHEAD = 1, + kRequestGET = 2, + kRequestPOST = 3, + kRequestPUT = 4, + kRequestDELETE = 5 +} RequestMethod; + +typedef enum { + kWriteResponseHeaders = 1 +} ServerSupportTypes; + +typedef struct { + unsigned int responseCode; + char *reasonText; + char *headerText; +} FilterResponseHeaders; + +typedef struct { + unsigned int requestMethod; + + int (*GetAllHeaders)(FilterContext *context, char **headers, unsigned int *errID); + int (*GetHeader)(FilterContext *context, char *name, char *buffer, unsigned int bufferSize, unsigned int *errID); + int (*SetHeader)(FilterContext *context, char *name, char *value, unsigned int *errID); + int (*AddHeader)(FilterContext *context, char *header, unsigned int *errID); + + unsigned int reserved; +} FilterRawRequest; + +typedef struct { + unsigned int requestMethod; + + int (*GetAllHeaders)(FilterContext *context, char **headers, unsigned int *errID); + int (*GetHeader)(FilterContext *context, char *name, char *buffer, unsigned int bufferSize, unsigned int *errID); + + unsigned int reserved; +} FilterParsedRequest; + +typedef struct { + const char *url; + char *pathBuffer; + unsigned int bufferSize; + unsigned int mapType; +} FilterMapURL; + +typedef enum { + kURLMapUnknown = 0, + kURLMapPass = 1, + kURLMapExec = 2, + kURLMapRedirect = 3, + kURLMapService = 4, + kURLMapDomino = 5 +} FilterULMapTypes; + +typedef struct { + unsigned char *userName; + unsigned char *password; + unsigned char *clientCert; + unsigned int clientCertLen; + unsigned int authFlags; + unsigned int preAuthenticated; + unsigned int foundInCache; + unsigned int authNameSize; + unsigned char *authName; + unsigned int authType; + + int (*GetUserNameList)(FilterContext *context, unsigned char * buffer, unsigned int bufferSize, unsigned int *numNames, unsigned int reserved, unsigned int *errID); + int (*GetHeader)(FilterContext *context, char *name, char *buffer, unsigned int bufferSize, unsigned int *errID); +} FilterAuthenticate; + +typedef enum { + kNotAuthentic = 0, + kAuthenticBasic = 1, + kAuthenticClientCert = 2 +} FilterAuthenticationTypes; + +typedef enum { + kAuthAllowBasic = 0x01, + kAuthAllowAnonymous = 0x02, + kAuthAllowSSLCert = 0x04, + kAuthAllowSSLBasic = 0x08, + kAuthAllowSSLAnonymous = 0x10, + kAuthRedirectToSSL = 0x20 +} FilterAuthConfigFlags; + +typedef struct { + const unsigned char *userName; + + int (*GetUserNameList)(FilterContext *context, unsigned char * buffer, unsigned int bufferSize, unsigned int *numNames, unsigned int reserved, unsigned int *errID); + int (*PopulateUserNameList)(FilterContext *context, unsigned char * buffer, unsigned int bufferSize, unsigned int *numNames, unsigned int reserved, unsigned int *errID); + int (*AddGroupsToList)(FilterContext *context, unsigned char * groupNames, unsigned int numGroupNames, unsigned int reserved, unsigned int *errID); + int (*RemoveGroupsFromList)(FilterContext *context, unsigned int reserved, unsigned int *errID); + + unsigned int reserved; +} FilterUserNameList; + +typedef struct { + unsigned int responseCode; + char *reasonText; + + int (*GetAllHeaders)(FilterContext *context, char **headers, unsigned int *errID); + int (*GetHeader)(FilterContext *context, char *name, char *buffer, unsigned int bufferSize, unsigned int *errID); + int (*SetHeader)(FilterContext *context, char *name, char *value, unsigned int *errID); + int (*AddHeader)(FilterContext *context, char *header, unsigned int *errID); + + unsigned int reserved; +} FilterResponse; + +typedef struct { + char *content; + unsigned int contentLen; + unsigned int reserved; +} FilterRawWrite; - int (*AddHeader) (FilterContext * context, char *header, unsigned int *errID); +/* Non DSAPI stuff here for convenience */ - unsigned int reserved; - } - FilterResponse; +#define NOERROR 0 -/*--- - * write content - */ - typedef struct - { - char *content; - unsigned int contentLen; - unsigned int reserved; - } - FilterRawWrite; - -#ifdef __cplusplus -} -#endif +void AddInLogMessageText(char *string, unsigned short err, ...); -#endif /* DSAPIFILTER_H */ +#endif /* __dsapi_filter_h */ 1.7 +1 -8 jakarta-tomcat-connectors/jk/native2/server/dsapi/config.h Index: config.h =================================================================== RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/dsapi/config.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- config.h 26 Mar 2004 13:52:39 -0000 1.6 +++ config.h 28 Apr 2004 15:06:47 -0000 1.7 @@ -37,15 +37,8 @@ #undef HAVE_MEMICMP #define PATHSEP '/' #define MAX_PATH 512 -#define NO_CAPI #endif - -/* define if you don't have the Notes C API which is available from - * - * http://www.lotus.com/rw/dlcapi.nsf - */ -/* #undef NO_CAPI */ #ifdef _DEBUG #define DEBUG(args) \
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]